Commit 654147b0 by 姜雷

测试

parent f84fc621
...@@ -25,19 +25,17 @@ Page({ ...@@ -25,19 +25,17 @@ Page({
wx.hideLoading(); wx.hideLoading();
console.log(res); console.log(res);
var _a = res.data, areaDeviceAmount = _a.areaDeviceAmount, statusAmount = _a.statusAmount, totalAmount = _a.totalAmount; var _a = res.data, areaDeviceAmount = _a.areaDeviceAmount, statusAmount = _a.statusAmount, totalAmount = _a.totalAmount;
var total = totalAmount.reduce(function (count, item) { return count + item.value; }, 0);
_this.setData({ _this.setData({
areaDeviceAmount: areaDeviceAmount, areaDeviceAmount: areaDeviceAmount,
statusAmount: statusAmount, statusAmount: statusAmount,
totalAmount: totalAmount, totalAmount: totalAmount,
total: total,
}); });
}) })
.catch(function (err) { .catch(function (err) {
console.log(err); console.log(err);
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: err.msg || err || '网络错误', title: err.msg || err.message || '网络错误',
icon: 'none', icon: 'none',
duration: 4000, duration: 4000,
}); });
...@@ -54,4 +52,4 @@ Page({ ...@@ -54,4 +52,4 @@ Page({
}); });
}, },
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXF1aXBtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXF1aXBtZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEseUNBQThDO0FBRzlDLElBQUksQ0FBQztJQUlILElBQUksRUFBRTtRQUNKLE1BQU0sRUFBRSxDQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFNBQVMsQ0FBQztRQUNwRCxnQkFBZ0IsRUFBRSxFQUFFO1FBQ3BCLFlBQVksRUFBRSxFQUFFO1FBQ2hCLFdBQVcsRUFBRSxFQUFFO1FBQ2YsS0FBSyxFQUFFLENBQUM7S0FDVDtJQUtELE1BQU07UUFDSixPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0F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hdGEuYXJlYURldmljZUFtb3VudFtpbmRleF07XG4gICAgd3gubmF2aWdhdGVUbyh7XG4gICAgICB1cmw6IGAvcGFnZXMvZXF1aXBtZW50UmVwb3J0L2VxdWlwbWVudFJlcG9ydD9hcmVhSWQ9JHtpdGVtLmFyZWFJZH0mYXJlYU5hbWU9JHtpdGVtLmFyZWFOYW1lfWAsXG4gICAgICBzdWNjZXNzOiBmdW5jdGlvbihyZXMpIHtcbiAgICAgICAgLy8g6YCa6L+HZXZlbnRDaGFubmVs5ZCR6KKr5omT5byA6aG16Z2i5Lyg6YCB5pWw5o2uXG4gICAgICAgIHJlcy5ldmVudENoYW5uZWwuZW1pdCgnYWNjZXB0RGF0YUZyb21PcGVuZXJQYWdlJywgeyBkYXRhOiBpdGVtIH0pO1xuICAgICAgfSxcbiAgICB9KTtcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file \ No newline at end of file
...@@ -32,19 +32,22 @@ Page({ ...@@ -32,19 +32,22 @@ Page({
wx.hideLoading(); wx.hideLoading();
console.log(res); console.log(res);
const { areaDeviceAmount, statusAmount, totalAmount } = res.data; const { areaDeviceAmount, statusAmount, totalAmount } = res.data;
let total = totalAmount.reduce((count, item) => count + item.value, 0); // let total = totalAmount.reduce(
// (count: Number, item) => count + item.value,
// 0,
// );
this.setData!({ this.setData!({
areaDeviceAmount, areaDeviceAmount,
statusAmount, statusAmount,
totalAmount, totalAmount,
total, // total,
}); });
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: err.msg || err || '网络错误', title: err.msg || err.message || '网络错误',
icon: 'none', icon: 'none',
duration: 4000, duration: 4000,
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment