product.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import { randomSelectOne, randomSelectN } from './utils';
  2. //mock wareListData
  3. let wareList = [];
  4. let state = [0, 1];
  5. let typeArr = [0, 1, 1, 1, 1];
  6. let cp = {0: '贝尔安亲', 1: '昂乐教育', 2: '鲨鱼公园'};
  7. let tagsArr = [{1: '幼小衔接'}, {2: 'EQ情商'}, {3: '中华教育'}];
  8. let imgsArr = [
  9. {8: 'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/01/04/000008.jpg'},
  10. {72:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700072.jpg'},
  11. {73:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700073.jpg'},
  12. {74:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700074.jpg'},
  13. {75:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700075.jpg'},
  14. ];
  15. for (let i = 1; i < 401; i++) {
  16. let cpId = randomSelectOne([0, 1, 2]);
  17. let cpName = cp[cpId];
  18. wareList.push({
  19. id: i,
  20. code: 'J-001-' + i,
  21. name: `第${i}课`,
  22. type: randomSelectOne(typeArr),
  23. tags: randomSelectN(tagsArr),
  24. playUrl: `http://www.lj-2b.com/play/J-001-${i}`,
  25. imgUrls: imgsArr,
  26. cpId: cpId,
  27. cpName: cpName,
  28. state: randomSelectOne(state),
  29. gmtCreated: (new Date()).getTime(),
  30. gmtModified: (new Date()).getTime(),
  31. });
  32. }
  33. // mock taglist
  34. let tagList = [];
  35. const tagTypeArr = ['课程', '师训', '周边'];
  36. const merchant = [{
  37. merchantId: 0,
  38. merchantName: '贝尔安亲',
  39. },{
  40. merchantId: 1,
  41. merchantName: '昂乐教育',
  42. },{
  43. merchantId: 2,
  44. merchantName: '好托管',
  45. },{
  46. merchantId: 3,
  47. merchantName: '红黄蓝',
  48. },{
  49. merchantId: 4,
  50. merchantName: '英乐教育',
  51. }];
  52. for (let i = 1; i < 300; i++) {
  53. const merchantItem = randomSelectOne(merchant);
  54. tagList.push({
  55. tagId: i,
  56. tagName: `EQ情商教育-${i}`,
  57. tagType: randomSelectOne(tagTypeArr),
  58. merchantName: merchantItem.merchantName,
  59. merchantId: merchantItem.merchantId,
  60. gmtModified: (new Date()).getTime(),
  61. });
  62. }
  63. //mock lessonlist
  64. let lessonList = [];
  65. let status = ['NORMAL', 'DELETE'];
  66. for (let i = 1; i < 501; i++) {
  67. lessonList.push({
  68. id: 1511509291305739 + i,
  69. code: `K-test-${i}`,
  70. name: `第${i}课`,
  71. digest: '这是一段描述,不知道描述个啥,但即便你是个描述,我也要写的很认真!',
  72. sort: null,
  73. status: randomSelectOne(status),
  74. state: randomSelectOne(state),
  75. gmtCreated: (new Date()).getTime(),
  76. gmtModified: (new Date()).getTime(),
  77. });
  78. }
  79. //mock courselist
  80. let courseList = [];
  81. for (let i = 1; i < 400; i++) {
  82. courseList.push({
  83. id: 151150929133433 + i,
  84. code: `C-001-002-${i}`,
  85. name: `小学${i}年级语文上册`,
  86. title: `[${i}年级] 语文上册`,
  87. digest: '顾名思义,这是交小学生语文的,哦不,不一定非得是小学生,400年级是什么鬼?',
  88. detail: null,
  89. cpId: 8000,
  90. cpName: '鲨鱼公园',
  91. status: status[i % 2],
  92. gmtCreated: (new Date()).getTime(),
  93. gmtModified: (new Date()).getTime(),
  94. subItemList: [],
  95. })
  96. }
  97. //mock supportlist
  98. let supportList = [];
  99. for (let i = 1; i < 400; i++) {
  100. supportList.push({
  101. id: 151150929133433 + i,
  102. code: `S-001-002-${i}`,
  103. name: `学生练习册[sub]急用先学的汉字${i}`,
  104. title: `[学生练习册] 急用先学的汉字${i}`,
  105. digest: '顾名思义,这是周边配套,周边配套,周边配套,周边配套,妈呀,累死我了!',
  106. cpId: 8000,
  107. tags: [{tagId: 1, tagName: '师训'}, {tagId:2, tagName: '幼小衔接'}],
  108. cpName: '鲨鱼公园',
  109. status: status[i % 2],
  110. gmtCreated: (new Date()).getTime(),
  111. gmtModified: (new Date()).getTime(),
  112. supportArr: [],
  113. })
  114. }
  115. module.exports = {
  116. wareList,
  117. tagList,
  118. lessonList,
  119. courseList,
  120. supportList,
  121. }