Commit b803f356 by 赵雅纹

购物车金额问题和订单地址bug

parent 154c71fb
...@@ -399,6 +399,16 @@ wxService.page({ ...@@ -399,6 +399,16 @@ wxService.page({
cartList: cartList cartList: cartList
}) })
self.editDelOk(skuid) //调用完成 self.editDelOk(skuid) //调用完成
var totalFee = 0
// 购物车总金额
for (let i = 0; i < cartList.length; i++) {
if (cartList[i].checked) {
totalFee += cartList[i].price * (cartList[i].count ? cartList[i].count : 1)
}
}
self.setData({
shopCartTotalFee: totalFee.toFixed(2)
})
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消')
} }
......
...@@ -20,7 +20,8 @@ wxService.page({ ...@@ -20,7 +20,8 @@ wxService.page({
cityView: '', cityView: '',
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
selectCityName: ['', ''], selectCityName: ['', ''],
currentCoupon: '无可用优惠券' currentCoupon: '无可用优惠券',
wxAddress: false
}, },
/** /**
...@@ -61,7 +62,9 @@ wxService.page({ ...@@ -61,7 +62,9 @@ wxService.page({
this.initCitys() this.initCitys()
// 地址列表 // 地址列表
this.getAddressList() if (!this.data.wxAddress){
this.getAddressList()
}
}, },
updateCoupon(e){ updateCoupon(e){
console.log('e', e.detail) console.log('e', e.detail)
...@@ -302,6 +305,7 @@ wxService.page({ ...@@ -302,6 +305,7 @@ wxService.page({
this.setData({ this.setData({
addressInfo: _defalutAddress addressInfo: _defalutAddress
}) })
console.log(this.data.addressInfo)
} }
} }
}).finally(() => { }).finally(() => {
...@@ -312,10 +316,16 @@ wxService.page({ ...@@ -312,10 +316,16 @@ wxService.page({
wx.chooseAddress({ wx.chooseAddress({
success: (res) => { success: (res) => {
console.log('微信地址', res) console.log('微信地址', res)
res.name = res.userName
res.phone = res.telNumber
res.fullArea = res.provinceName + res.cityName + res.countyName
res.address = res.detailInfo
this.setData({ this.setData({
goodsAddress: false, goodsAddress: false,
addressInfo: res, wxAddress: true,
addressInfo: res
}) })
console.log('WX---------------------', this.data.addressInfo)
}, },
fail: function (err) { fail: function (err) {
console.log(err) console.log(err)
......
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