From edd0353694f41cef41e2665dae2b848494e2a41d Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Thu, 18 Apr 2019 21:53:19 +0800 Subject: [PATCH] =?UTF-8?q?fix[litemall-wx=EF=BC=8Crenard-wx]:=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E5=9C=B0=E5=9D=80=E5=88=A0=E9=99=A4=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=BF=E9=97=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-wx/pages/checkout/checkout.js | 45 +++++++++---------- renard-wx/pages/shopping/checkout/checkout.js | 45 +++++++++---------- 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/litemall-wx/pages/checkout/checkout.js b/litemall-wx/pages/checkout/checkout.js index 79c3e82e..5444d163 100644 --- a/litemall-wx/pages/checkout/checkout.js +++ b/litemall-wx/pages/checkout/checkout.js @@ -79,39 +79,34 @@ Page({ }); try { var cartId = wx.getStorageSync('cartId'); - if (cartId) { - this.setData({ - 'cartId': cartId - }); + if (cartId === "") { + cartId = 0; } - var addressId = wx.getStorageSync('addressId'); - if (addressId) { - this.setData({ - 'addressId': addressId - }); + if (addressId === "") { + addressId = 0; } - var couponId = wx.getStorageSync('couponId'); - if (couponId) { - this.setData({ - 'couponId': couponId - }); + if (couponId === "") { + couponId = 0; } - var grouponRulesId = wx.getStorageSync('grouponRulesId'); - if (grouponRulesId) { - this.setData({ - 'grouponRulesId': grouponRulesId - }); + if (grouponRulesId === "") { + grouponRulesId = 0; + } + var grouponLinkId = wx.getStorageSync('grouponLinkId'); + if (grouponLinkId === "") { + grouponLinkId = 0; } - var grouponLinkId = wx.getStorageSync('grouponLinkId'); - if (grouponLinkId) { - this.setData({ - 'grouponLinkId': grouponLinkId - }); - } + this.setData({ + cartId: cartId, + addressId: addressId, + couponId: couponId, + grouponRulesId: grouponRulesId, + grouponLinkId: grouponLinkId + }); + } catch (e) { // Do something when catch error console.log(e); diff --git a/renard-wx/pages/shopping/checkout/checkout.js b/renard-wx/pages/shopping/checkout/checkout.js index 9f4cb071..65a149aa 100644 --- a/renard-wx/pages/shopping/checkout/checkout.js +++ b/renard-wx/pages/shopping/checkout/checkout.js @@ -68,39 +68,34 @@ Page({ }); try { var cartId = wx.getStorageSync('cartId'); - if (cartId) { - this.setData({ - 'cartId': cartId - }); + if (cartId === "") { + cartId = 0; } - var addressId = wx.getStorageSync('addressId'); - if (addressId) { - this.setData({ - 'addressId': addressId - }); + if (addressId === "") { + addressId = 0; } - var couponId = wx.getStorageSync('couponId'); - if (couponId) { - this.setData({ - 'couponId': couponId - }); + if (couponId === "") { + couponId = 0; } - var grouponRulesId = wx.getStorageSync('grouponRulesId'); - if (grouponRulesId) { - this.setData({ - 'grouponRulesId': grouponRulesId - }); + if (grouponRulesId === "") { + grouponRulesId = 0; + } + var grouponLinkId = wx.getStorageSync('grouponLinkId'); + if (grouponLinkId === "") { + grouponLinkId = 0; } - var grouponLinkId = wx.getStorageSync('grouponLinkId'); - if (grouponLinkId) { - this.setData({ - 'grouponLinkId': grouponLinkId - }); - } + this.setData({ + cartId: cartId, + addressId: addressId, + couponId: couponId, + grouponRulesId: grouponRulesId, + grouponLinkId: grouponLinkId + }); + } catch (e) { // Do something when catch error console.log(e);