spring-cloud/admin-web/mock/profile.js

178 lines
3.2 KiB
Java

import mockjs from 'mockjs';
const basicGoods = [
{
id: '1234561',
name: ' 550ml',
barcode: '12421432143214321',
price: '2.00',
num: '1',
amount: '2.00',
},
{
id: '1234562',
name: ' 300ml',
barcode: '12421432143214322',
price: '3.00',
num: '2',
amount: '6.00',
},
{
id: '1234563',
name: '',
barcode: '12421432143214323',
price: '7.00',
num: '4',
amount: '28.00',
},
{
id: '1234564',
name: '',
barcode: '12421432143214324',
price: '8.50',
num: '3',
amount: '25.50',
},
];
const basicProgress = [
{
key: '1',
time: '2017-10-01 14:10',
rate: '',
status: 'processing',
operator: ' ID1234',
cost: '5mins',
},
{
key: '2',
time: '2017-10-01 14:05',
rate: '',
status: 'success',
operator: ' ID1234',
cost: '1h',
},
{
key: '3',
time: '2017-10-01 13:05',
rate: '',
status: 'success',
operator: ' ID1234',
cost: '5mins',
},
{
key: '4',
time: '2017-10-01 13:00',
rate: '',
status: 'success',
operator: '',
cost: '1h',
},
{
key: '5',
time: '2017-10-01 12:00',
rate: '退',
status: 'success',
operator: '',
cost: '5mins',
},
];
const advancedOperation1 = [
{
key: 'op1',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '-',
},
{
key: 'op2',
type: '',
name: '',
status: 'reject',
updatedAt: '2017-10-03 19:23:12',
memo: '',
},
{
key: 'op3',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '-',
},
{
key: 'op4',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '',
},
{
key: 'op5',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '-',
},
];
const advancedOperation2 = [
{
key: 'op1',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '-',
},
];
const advancedOperation3 = [
{
key: 'op1',
type: '',
name: '',
status: 'agree',
updatedAt: '2017-10-03 19:23:12',
memo: '-',
},
];
const getProfileAdvancedData = {
advancedOperation1,
advancedOperation2,
advancedOperation3,
};
const { Random } = mockjs;
export default {
'GET /api/profile/advanced': getProfileAdvancedData,
'GET /api/profile/basic': (req, res) => {
const { id } = req.query;
const application = {
id,
status: '',
orderNo: Random.id(),
childOrderNo: Random.id(),
};
const userInfo = {
name: Random.cname(),
tel: '18100000000',
delivery: '',
addr: '西18',
remark: '',
};
res.json({
userInfo,
application,
basicGoods,
basicProgress,
});
},
};