123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- import { randomSelectOne, randomSelectN } from './utils';
- //mock wareListData
- let wareList = [];
- let state = [0, 1];
- let typeArr = [0, 1, 1, 1, 1];
- let cp = {0: '贝尔安亲', 1: '昂乐教育', 2: '鲨鱼公园'};
- let tagsArr = [{1: '幼小衔接'}, {2: 'EQ情商'}, {3: '中华教育'}];
- let imgsArr = [
- {8: 'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/01/04/000008.jpg'},
- {72:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700072.jpg'},
- {73:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700073.jpg'},
- {74:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700074.jpg'},
- {75:'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/09/700075.jpg'},
- ];
- for (let i = 1; i < 401; i++) {
- let cpId = randomSelectOne([0, 1, 2]);
- let cpName = cp[cpId];
- wareList.push({
- id: i,
- code: 'J-001-' + i,
- name: `第${i}课`,
- type: randomSelectOne(typeArr),
- tags: randomSelectN(tagsArr),
- playUrl: `http://www.lj-2b.com/play/J-001-${i}`,
- imgUrls: imgsArr,
- cpId: cpId,
- cpName: cpName,
- state: randomSelectOne(state),
- gmtCreated: (new Date()).getTime(),
- gmtModified: (new Date()).getTime(),
- });
- }
- // mock taglist
- let tagList = [];
- const tagTypeArr = ['课程', '师训', '周边'];
- const merchant = [{
- merchantId: 0,
- merchantName: '贝尔安亲',
- },{
- merchantId: 1,
- merchantName: '昂乐教育',
- },{
- merchantId: 2,
- merchantName: '好托管',
- },{
- merchantId: 3,
- merchantName: '红黄蓝',
- },{
- merchantId: 4,
- merchantName: '英乐教育',
- }];
- for (let i = 1; i < 300; i++) {
- const merchantItem = randomSelectOne(merchant);
- tagList.push({
- tagId: i,
- tagName: `EQ情商教育-${i}`,
- tagType: randomSelectOne(tagTypeArr),
- merchantName: merchantItem.merchantName,
- merchantId: merchantItem.merchantId,
- gmtModified: (new Date()).getTime(),
- });
- }
- //mock lessonlist
- let lessonList = [];
- let status = ['NORMAL', 'DELETE'];
- for (let i = 1; i < 501; i++) {
- lessonList.push({
- id: 1511509291305739 + i,
- code: `K-test-${i}`,
- name: `第${i}课`,
- digest: '这是一段描述,不知道描述个啥,但即便你是个描述,我也要写的很认真!',
- sort: null,
- status: randomSelectOne(status),
- state: randomSelectOne(state),
- gmtCreated: (new Date()).getTime(),
- gmtModified: (new Date()).getTime(),
- });
- }
- //mock courselist
- let courseList = [];
- for (let i = 1; i < 400; i++) {
- courseList.push({
- id: 151150929133433 + i,
- code: `C-001-002-${i}`,
- name: `小学${i}年级语文上册`,
- title: `[${i}年级] 语文上册`,
- digest: '顾名思义,这是交小学生语文的,哦不,不一定非得是小学生,400年级是什么鬼?',
- detail: null,
- cpId: 8000,
- cpName: '鲨鱼公园',
- status: status[i % 2],
- gmtCreated: (new Date()).getTime(),
- gmtModified: (new Date()).getTime(),
- subItemList: [],
- })
- }
- //mock supportlist
- let supportList = [];
- for (let i = 1; i < 400; i++) {
- supportList.push({
- id: 151150929133433 + i,
- code: `S-001-002-${i}`,
- name: `学生练习册[sub]急用先学的汉字${i}`,
- title: `[学生练习册] 急用先学的汉字${i}`,
- digest: '顾名思义,这是周边配套,周边配套,周边配套,周边配套,妈呀,累死我了!',
- cpId: 8000,
- tags: [{tagId: 1, tagName: '师训'}, {tagId:2, tagName: '幼小衔接'}],
- cpName: '鲨鱼公园',
- status: status[i % 2],
- gmtCreated: (new Date()).getTime(),
- gmtModified: (new Date()).getTime(),
- supportArr: [],
- })
- }
- module.exports = {
- wareList,
- tagList,
- lessonList,
- courseList,
- supportList,
- }
|