messages.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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: 1566047865417,
  86. content: "我是测试时候看到的",
  87. toContactId: 1,
  88. fromUser: getContact(4),
  89. },
  90. {
  91. id: generateRandId(),
  92. status: "succeed",
  93. type: "text",
  94. sendTime: 1566047865417,
  95. content: "上新版本了,玩玩",
  96. toContactId: 1,
  97. fromUser: getContact(4),
  98. },
  99. {
  100. id: generateRandId(),
  101. status: "succeed",
  102. type: "text",
  103. sendTime: 1566047865417,
  104. content: "项目内没有搞这个",
  105. toContactId: 1,
  106. fromUser: getContact(4),
  107. },
  108. {
  109. id: generateRandId(),
  110. status: "succeed",
  111. type: "text",
  112. sendTime: 1566047865417,
  113. content: "@awesome 最新的,不然哪有这功能",
  114. toContactId: 1,
  115. fromUser: getContact(5),
  116. },
  117. {
  118. id: generateRandId(),
  119. status: "succeed",
  120. type: "text",
  121. sendTime: 1566047865417,
  122. content: "其实是跟你的遮罩层有冲突",
  123. toContactId: 1,
  124. fromUser: getContact(4),
  125. },
  126. {
  127. id: generateRandId(),
  128. status: "succeed",
  129. type: "text",
  130. sendTime: 1566047865417,
  131. content: "自己修改index哈",
  132. toContactId: 1,
  133. fromUser: UserData,
  134. },
  135. {
  136. id: generateRandId(),
  137. status: "succeed",
  138. type: "text",
  139. sendTime: 1566047865417,
  140. content: "你们升级到最近版了吗?",
  141. toContactId: 1,
  142. fromUser: getContact(6),
  143. },
  144. {
  145. id: generateRandId(),
  146. status: "succeed",
  147. type: "text",
  148. sendTime: 1566047865417,
  149. content: "wo 现在用的142",
  150. toContactId: 1,
  151. fromUser: getContact(7),
  152. },
  153. ],
  154. 14: [],
  155. 15: [],
  156. };