From c682425318fb690ec3bb8716f178411e6695d9bb Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Thu, 1 Dec 2016 15:51:31 +0800 Subject: [PATCH] =?UTF-8?q?parseInt=20=E6=98=AF=E7=94=B1=E4=BA=8E=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E5=92=8C=E7=9C=9F=E6=9C=BA=E4=B8=8D=E5=A4=AA?= =?UTF-8?q?=E4=B8=80=E6=A0=B7=EF=BC=9B=E4=BC=98=E6=83=A0=E5=88=B8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=9C=A8=E6=80=BB=E9=87=91=E9=A2=9D=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cart/cart.js | 10 +++++++--- pages/cart/cart.wxml | 7 ++++++- pages/mine/mine.js | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pages/cart/cart.js b/pages/cart/cart.js index bb9ceb0..6c00f64 100644 --- a/pages/cart/cart.js +++ b/pages/cart/cart.js @@ -124,7 +124,7 @@ Page({ } order.postBilling(params, function(result){ - if (result.statusCode === '403') { + if (parseInt(result.statusCode) === 403) { wx.showModal({ title: '出错', content: result.data.msg, @@ -144,7 +144,11 @@ Page({ showCancel: false, success: function(res) { if (res.confirm) { - that.setData({cartItems: []}) + that.setData({ + cartItems: [], + coupon: null + }) + that.changeCartAmount() } } }) @@ -179,7 +183,7 @@ Page({ amount += entry.quantity * entry.product['member-price'] }) } - + this.setData({amount: amount}) }, diff --git a/pages/cart/cart.wxml b/pages/cart/cart.wxml index f881837..e251956 100644 --- a/pages/cart/cart.wxml +++ b/pages/cart/cart.wxml @@ -65,6 +65,11 @@ - 总计:¥{{amount}}元 + + 总计:¥{{amount}}元 {{'-' + coupon['coupon-value'] + '元优惠券' }} + + + 总计:¥{{amount}}元 + diff --git a/pages/mine/mine.js b/pages/mine/mine.js index cc7bc00..fc136f4 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -105,7 +105,7 @@ Page({ data: {code: app.globalData.code}, method: 'POST', success: function(res) { - if (res.statusCode === '200') { + if (parseInt(res.statusCode) === 200) { wx.removeStorage({ key: 'token' }) app.globalData.currentCustomer = null app.globalData.token = null