messages.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. import ContactsData from "./contacts";
  2. import UserData from "./user";
  3. const generateRandId = () => {
  4. return Math.random()
  5. .toString(36)
  6. .substr(-8);
  7. };
  8. const getContact = id => {
  9. const data = ContactsData.find(contact => contact.id == id);
  10. return { id: data.id, avatar: data.avatar, displayName: data.displayName };
  11. };
  12. export default {
  13. 1: [
  14. {
  15. id: generateRandId(),
  16. status: "succeed",
  17. type: "text",
  18. sendTime: 1566047865417,
  19. content: "问你件事",
  20. toContactId: 1,
  21. fromUser: UserData,
  22. },
  23. {
  24. id: generateRandId(),
  25. status: "succeed",
  26. type: "text",
  27. sendTime: 1566047865417,
  28. content: "啥子。",
  29. toContactId: 1,
  30. fromUser: getContact(1),
  31. },
  32. {
  33. id: generateRandId(),
  34. status: "succeed",
  35. type: "text",
  36. sendTime: 1566047865417,
  37. content: "为什么",
  38. toContactId: 1,
  39. fromUser: UserData,
  40. },
  41. {
  42. id: generateRandId(),
  43. status: "succeed",
  44. type: "text",
  45. sendTime: 1566047865417,
  46. content: "你穿了高跟鞋还这么矮",
  47. toContactId: 1,
  48. fromUser: UserData,
  49. },
  50. {
  51. id: generateRandId(),
  52. status: "succeed",
  53. type: "text",
  54. sendTime: 1566047865417,
  55. content: "因为我矮啊。[!1f600][!1f600][!1f600]",
  56. toContactId: 1,
  57. fromUser: getContact(1),
  58. },
  59. {
  60. id: generateRandId(),
  61. status: "succeed",
  62. type: "text",
  63. sendTime: 1566047865417,
  64. content: "你开心吗",
  65. toContactId: 1,
  66. fromUser: getContact(1),
  67. },
  68. ],
  69. 2: [],
  70. 3: [],
  71. 4: [],
  72. 5: [],
  73. 6: [],
  74. 7: [],
  75. 8: [],
  76. 9: [],
  77. 10: [],
  78. 11: [],
  79. 12: [],
  80. 13: [
  81. {
  82. id: generateRandId(),
  83. status: "succeed",
  84. type: "text",
  85. sendTime: 1670481209000,
  86. content: "我是测试时候看到的",
  87. toContactId: 1,
  88. fromUser: getContact(4),
  89. },
  90. {
  91. id: generateRandId(),
  92. status: "succeed",
  93. type: "text",
  94. sendTime: 1670541395000,
  95. content: "上新版本了,玩玩",
  96. toContactId: 1,
  97. fromUser: getContact(4),
  98. },
  99. {
  100. id: generateRandId(),
  101. status: "succeed",
  102. type: "text",
  103. sendTime: 1670544995000,
  104. content: "项目内没有搞这个",
  105. toContactId: 1,
  106. fromUser: getContact(4),
  107. },
  108. {
  109. id: generateRandId(),
  110. status: "succeed",
  111. type: "text",
  112. sendTime: 1670545175000,
  113. content: "@awesome 最新的,不然哪有这功能",
  114. toContactId: 1,
  115. fromUser: getContact(5),
  116. },
  117. {
  118. id: generateRandId(),
  119. status: "succeed",
  120. type: "text",
  121. sendTime: 1670631575000,
  122. content: "其实是跟你的遮罩层有冲突",
  123. toContactId: 1,
  124. fromUser: getContact(4),
  125. },
  126. {
  127. id: generateRandId(),
  128. status: "succeed",
  129. type: "text",
  130. sendTime: 1670804375000,
  131. content: "自己修改index哈",
  132. toContactId: 1,
  133. fromUser: UserData,
  134. },
  135. {
  136. id: generateRandId(),
  137. status: "succeed",
  138. type: "text",
  139. sendTime: 1670977175000,
  140. content: "你们升级到最近版了吗?",
  141. toContactId: 1,
  142. fromUser: getContact(6),
  143. },
  144. {
  145. id: generateRandId(),
  146. status: "succeed",
  147. type: "text",
  148. sendTime: 1670980775000,
  149. content: "wo 现在用的142",
  150. toContactId: 1,
  151. fromUser: getContact(7),
  152. },
  153. {
  154. id: generateRandId(),
  155. status: "succeed",
  156. type: "text",
  157. sendTime: 1671247175000,
  158. content: "问你件事",
  159. toContactId: 1,
  160. fromUser: UserData,
  161. },
  162. {
  163. id: generateRandId(),
  164. status: "failed",
  165. type: "text",
  166. sendTime: 1671340182000,
  167. content: "啥子。",
  168. toContactId: 1,
  169. fromUser: getContact(1),
  170. },
  171. {
  172. id: generateRandId(),
  173. status: "succeed",
  174. type: "text",
  175. sendTime: 1696907382000,
  176. content: "为什么",
  177. toContactId: 1,
  178. fromUser: UserData,
  179. },
  180. {
  181. id: generateRandId(),
  182. status: "succeed",
  183. type: "text",
  184. sendTime: 1696920042000,
  185. content: "你穿了高跟鞋还这么矮[!1f62c][!1f601][!1f602]",
  186. toContactId: 1,
  187. fromUser: UserData,
  188. },
  189. {
  190. id: generateRandId(),
  191. status: "succeed",
  192. type: "text",
  193. sendTime: 1696995642000,
  194. content: "因为我矮啊。[!1f600][!1f600][!1f600]",
  195. toContactId: 1,
  196. fromUser: getContact(1),
  197. },
  198. {
  199. id: generateRandId(),
  200. status: "succeed",
  201. type: "text",
  202. sendTime: 1696995642000,
  203. content: "你有意见吗。[!1f643][!1f643][!1f643]",
  204. toContactId: 1,
  205. fromUser: getContact(1),
  206. },
  207. {
  208. id: generateRandId(),
  209. status: "succeed",
  210. type: "text",
  211. sendTime: 1696995942000,
  212. content: "你开心吗",
  213. toContactId: 1,
  214. fromUser: getContact(1),
  215. },
  216. ],
  217. 14: [],
  218. 15: [],
  219. 1688856679458971: [
  220. {
  221. id: generateRandId(),
  222. status: "succeed",
  223. type: "text",
  224. sendTime: 1670481209000,
  225. content: "我是测试时候看到的",
  226. toContactId: 1,
  227. fromUser: getContact(4),
  228. },
  229. {
  230. id: generateRandId(),
  231. status: "succeed",
  232. type: "text",
  233. sendTime: 1670541395000,
  234. content: "上新版本了,玩玩",
  235. toContactId: 1,
  236. fromUser: getContact(4),
  237. },
  238. {
  239. id: generateRandId(),
  240. status: "succeed",
  241. type: "text",
  242. sendTime: 1670544995000,
  243. content: "项目内没有搞这个",
  244. toContactId: 1,
  245. fromUser: getContact(4),
  246. },
  247. {
  248. id: generateRandId(),
  249. status: "succeed",
  250. type: "text",
  251. sendTime: 1670545175000,
  252. content: "@awesome 最新的,不然哪有这功能",
  253. toContactId: 1,
  254. fromUser: getContact(5),
  255. },
  256. {
  257. id: generateRandId(),
  258. status: "succeed",
  259. type: "text",
  260. sendTime: 1670631575000,
  261. content: "其实是跟你的遮罩层有冲突",
  262. toContactId: 1,
  263. fromUser: getContact(4),
  264. },
  265. {
  266. id: generateRandId(),
  267. status: "succeed",
  268. type: "text",
  269. sendTime: 1670804375000,
  270. content: "自己修改index哈",
  271. toContactId: 1,
  272. fromUser: UserData,
  273. },
  274. {
  275. id: generateRandId(),
  276. status: "succeed",
  277. type: "text",
  278. sendTime: 1670977175000,
  279. content: "你们升级到最近版了吗?",
  280. toContactId: 1,
  281. fromUser: getContact(6),
  282. },
  283. {
  284. id: generateRandId(),
  285. status: "succeed",
  286. type: "text",
  287. sendTime: 1670980775000,
  288. content: "wo 现在用的142",
  289. toContactId: 1,
  290. fromUser: getContact(7),
  291. },
  292. {
  293. id: generateRandId(),
  294. status: "succeed",
  295. type: "text",
  296. sendTime: 1671247175000,
  297. content: "问你件事",
  298. toContactId: 1,
  299. fromUser: UserData,
  300. },
  301. {
  302. id: generateRandId(),
  303. status: "failed",
  304. type: "text",
  305. sendTime: 1671340182000,
  306. content: "啥子。",
  307. toContactId: 1,
  308. fromUser: getContact(1),
  309. },
  310. {
  311. id: generateRandId(),
  312. status: "succeed",
  313. type: "text",
  314. sendTime: 1696907382000,
  315. content: "为什么",
  316. toContactId: 1,
  317. fromUser: UserData,
  318. },
  319. {
  320. id: generateRandId(),
  321. status: "succeed",
  322. type: "text",
  323. sendTime: 1696920042000,
  324. content: "你穿了高跟鞋还这么矮[!1f62c][!1f601][!1f602]",
  325. toContactId: 1,
  326. fromUser: UserData,
  327. },
  328. {
  329. id: generateRandId(),
  330. status: "succeed",
  331. type: "text",
  332. sendTime: 1696995642000,
  333. content: "因为我矮啊。[!1f600][!1f600][!1f600]",
  334. toContactId: 1,
  335. fromUser: getContact(1),
  336. },
  337. {
  338. id: generateRandId(),
  339. status: "succeed",
  340. type: "text",
  341. sendTime: 1696995642000,
  342. content: "你有意见吗。[!1f643][!1f643][!1f643]",
  343. toContactId: 1,
  344. fromUser: getContact(1),
  345. },
  346. {
  347. id: generateRandId(),
  348. status: "succeed",
  349. type: "text",
  350. sendTime: 1696995942000,
  351. content: "你开心吗",
  352. toContactId: 1,
  353. fromUser: getContact(1),
  354. },
  355. ],
  356. };