2022-08-20 10:15:07 +08:00

65 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 `<divcourier new',="" monospace;font-weight:="" normal;font-size:="" 12px;line-height:="" 18px;white-space:="" pre;"=""><div>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: medium;">这是消息内容,这个内容是使用<span style="color: rgb(255, 255, 255); background-color: rgb(28, 72, 127);">富文本编辑器</span>编辑的,所以你可以看到一些<span style="text-decoration-line: underline; font-style: italic; color: rgb(194, 79, 74);">格式</span></span></div><ol><li>你可以查看Mock返回的数据格式,和api请求的接口,来确定你的后端接口的开发</li><li>使用你的真实接口后,前端页面基本不需要修改即可满足基本需求</li><li>快来试试吧</li></ol><p>${Random.csentence(
100,
200,
)}</p></divcourier>`;
};
export const hasRead = () => {
return true;
};
export const removeReaded = () => {
return true;
};
export const restoreTrash = () => {
return true;
};
export const messageCount = () => {
return 3;
};