import Mock from 'mockjs'; import { doCustomTimes } from '@/libs/util'; const Random = Mock.Random; export const getMessageInit = () => { let unreadList = []; doCustomTimes(3, () => { unreadList.push( Mock.mock({ title: Random.cword(10, 15), create_time: '@date', msg_id: Random.increment(100), }), ); }); let readedList = []; doCustomTimes(4, () => { readedList.push( Mock.mock({ title: Random.cword(10, 15), create_time: '@date', msg_id: Random.increment(100), }), ); }); let trashList = []; doCustomTimes(2, () => { trashList.push( Mock.mock({ title: Random.cword(10, 15), create_time: '@date', msg_id: Random.increment(100), }), ); }); return { unread: unreadList, readed: readedList, trash: trashList, }; }; export const getContentByMsgId = () => { return `
        这是消息内容,这个内容是使用富文本编辑器编辑的,所以你可以看到一些格式
  1. 你可以查看Mock返回的数据格式,和api请求的接口,来确定你的后端接口的开发
  2. 使用你的真实接口后,前端页面基本不需要修改即可满足基本需求
  3. 快来试试吧

${Random.csentence( 100, 200, )}

`; }; export const hasRead = () => { return true; }; export const removeReaded = () => { return true; }; export const restoreTrash = () => { return true; }; export const messageCount = () => { return 3; };