|
|
|
@ -20,6 +20,17 @@ Page({
|
|
|
|
|
url: '../orderdetail/orderdetail?id='+e.currentTarget.dataset.id+'' |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
timeFormat(d, format = 'yyyy-MM-dd HH:mm:ss'){ |
|
|
|
|
let fnumber = v => v > 10 ? `${v}` : ('0' + v); |
|
|
|
|
let date = new Date(d); |
|
|
|
|
let result = format.replace('yyyy', date.getFullYear()); |
|
|
|
|
result = result.replace('MM', fnumber(date.getMonth() + 1)); |
|
|
|
|
result = result.replace('dd', fnumber(date.getDay())); |
|
|
|
|
result = result.replace('HH', fnumber(date.getHours())); |
|
|
|
|
result = result.replace('mm', fnumber(date.getMinutes())); |
|
|
|
|
result = result.replace('ss', fnumber(date.getSeconds())); |
|
|
|
|
return result; |
|
|
|
|
}, |
|
|
|
|
currentTab: function (e) { |
|
|
|
|
var that = this; |
|
|
|
|
if (that.data.currentTab == e.currentTarget.dataset.idx) { |
|
|
|
@ -109,7 +120,14 @@ Page({
|
|
|
|
|
datas.cost = val.cost; |
|
|
|
|
datas.createdTime = val.createdTime; |
|
|
|
|
datas.orderId = val.orderId; |
|
|
|
|
orderlist = orderlist.concat(datas); |
|
|
|
|
// console.log('datas:', datas)
|
|
|
|
|
// orderlist.forEach(item => {
|
|
|
|
|
datas.startTime = that.timeFormat(datas.startTime, 'yyyy-MM-dd HH:mm'); |
|
|
|
|
datas.endTime = that.timeFormat(datas.endTime, 'yyyy-MM-dd HH:mm'); |
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
orderlist = orderlist.concat([datas]); |
|
|
|
|
// console.log('orderlist:', orderlist);
|
|
|
|
|
that.setData({ |
|
|
|
|
// array:array,
|
|
|
|
|
orderlist:orderlist |
|
|
|
|