Skip to content

Commit

Permalink
create order can not set districtId, proved order list red point status
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed Jun 8, 2017
1 parent eaee0ae commit 39c1302
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
49 changes: 30 additions & 19 deletions pages/order-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,35 @@ Page({
// 生命周期函数--监听页面初次渲染完成

},
getOrderStatistics : function () {
var that = this;
wx.request({
url: 'https://api.it120.cc/' + app.globalData.subDomain + '/order/statistics',
data: { token: app.globalData.token },
success: (res) => {
wx.hideLoading();
if (res.data.code == 0) {
var tabClass = that.data.tabClass;
if (res.data.data.count_id_no_pay > 0) {
tabClass[1] = "red-dot"
}
if (res.data.data.count_id_no_transfer > 0) {
tabClass[2] = "red-dot"
}
if (res.data.data.count_id_no_confirm > 0) {
tabClass[3] = "red-dot"
}
if (res.data.data.count_id_success > 0) {
tabClass[4] = "red-dot"
}

that.setData({
tabClass: tabClass,
});
}
}
})
},
onShow:function(){
// 获取订单列表
wx.showLoading();
Expand All @@ -78,32 +107,14 @@ Page({
if (that.data.currentTpye == 4) {
postData.status = 4
}
this.getOrderStatistics();
wx.request({
url: 'https://api.it120.cc/' + app.globalData.subDomain + '/order/list',
data: postData,
success: (res) => {
wx.hideLoading();
if (res.data.code == 0) {
var tabClass = that.data.tabClass;
if (that.data.currentTpye == 0) {
for (var i = 0; i < res.data.data.orderList.length; i++) {
var order = res.data.data.orderList[i]
if (order.status == 0) {
tabClass[1] = "red-dot"
}
if (order.status == 1) {
tabClass[2] = "red-dot"
}
if (order.status == 2) {
tabClass[3] = "red-dot"
}
if (order.status == 4) {
tabClass[4] = "red-dot"
}
}
}
that.setData({
tabClass: tabClass,
orderList: res.data.data.orderList,
logisticsMap : res.data.data.logisticsMap,
goodsMap : res.data.data.goodsMap
Expand Down
4 changes: 3 additions & 1 deletion pages/to-pay-order/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ Page({
}
postData.provinceId = that.data.curAddressData.provinceId;
postData.cityId = that.data.curAddressData.cityId;
postData.districtId = that.data.curAddressData.districtId;
if (that.data.curAddressData.districtId) {
postData.districtId = that.data.curAddressData.districtId;
}
postData.address = that.data.curAddressData.address;
postData.linkMan = that.data.curAddressData.linkMan;
postData.mobile = that.data.curAddressData.mobile;
Expand Down

0 comments on commit 39c1302

Please sign in to comment.