|
|
@@ -14,7 +14,6 @@ Page({
|
|
|
productList: [], //列表
|
|
|
line: 0, //显示列表下标
|
|
|
active: 0, //tabs下标
|
|
|
- statisticsData: {}, //统计数据
|
|
|
isCanDraw: false,
|
|
|
pageNumber: 1,
|
|
|
pageTotal: 1,
|
|
|
@@ -103,15 +102,36 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log("供需", res)
|
|
|
if (res.msg != "成功") return wx.showToast({
|
|
|
title: res.data,
|
|
|
})
|
|
|
+ //格式化时间
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ if (res.data[i].phone.length != 0) {
|
|
|
+ let data = res.data[i].phone;
|
|
|
+ for (let index = 0; index < data.length; index++) {
|
|
|
+ res.data[i].phone[index].createdate = data[index].createdate.slice(5, 16)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data[i].read.length != 0) {
|
|
|
+ let data = res.data[i].read;
|
|
|
+ for (let index = 0; index < data.length; index++) {
|
|
|
+ res.data[i].read[index].createdate = data[index].createdate.slice(5, 16)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.data[i].share.length != 0) {
|
|
|
+ let data = res.data[i].share;
|
|
|
+ for (let index = 0; index < data.length; index++) {
|
|
|
+ res.data[i].share[index].createdate = data[index].createdate.slice(5, 16)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
let data = (res.data.length > 0) ? handleList.getYTD(res.data) : [];
|
|
|
(res.pageNumber == 1) ? '' : data = this.data.productList.concat(data);
|
|
|
this.setData({
|
|
|
productList: data
|
|
|
})
|
|
|
- if (res.pageNumber == 1) this.getsupplyanddemandLogTop10(0);
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -134,40 +154,13 @@ Page({
|
|
|
line,
|
|
|
active: index - 0
|
|
|
})
|
|
|
- this.getsupplyanddemandLogTop10(line)
|
|
|
- },
|
|
|
- /* 获取十条数据 */
|
|
|
- getsupplyanddemandLogTop10(index) {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.supplyanddemand.supplyanddemand",
|
|
|
- "method": "getsupplyanddemandLogTop10",
|
|
|
- "content": {
|
|
|
- "tsupplyanddemandid": this.data.productList[index].tsupplyanddemandid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- for (let i in res.data) {
|
|
|
- let data = res.data[i];
|
|
|
- if (data.length > 0) {
|
|
|
- for (let index = 0; index < data.length; index++) {
|
|
|
- data[index].createdate = data[index].createdate.slice(5, 16)
|
|
|
- }
|
|
|
- res.data[i] = data
|
|
|
- };
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- statisticsData: res.data
|
|
|
- })
|
|
|
- })
|
|
|
},
|
|
|
/* tabs改变 */
|
|
|
tabsOnChange(e) {
|
|
|
+ let productList = this.data.productList;
|
|
|
+ productList[e.currentTarget.dataset.line].indexTab = e.detail.index
|
|
|
this.setData({
|
|
|
- active: e.detail.index
|
|
|
+ productList
|
|
|
})
|
|
|
},
|
|
|
startDraw(e) {
|