Commit b803f356 by 赵雅纹

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

parent 154c71fb
......@@ -399,6 +399,16 @@ wxService.page({
cartList: cartList
})
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) {
console.log('用户点击取消')
}
......
......@@ -20,7 +20,8 @@ wxService.page({
cityView: '',
multiIndex: [0, 0, 0],
selectCityName: ['', ''],
currentCoupon: '无可用优惠券'
currentCoupon: '无可用优惠券',
wxAddress: false
},
/**
......@@ -61,7 +62,9 @@ wxService.page({
this.initCitys()
// 地址列表
this.getAddressList()
if (!this.data.wxAddress){
this.getAddressList()
}
},
updateCoupon(e){
console.log('e', e.detail)
......@@ -302,6 +305,7 @@ wxService.page({
this.setData({
addressInfo: _defalutAddress
})
console.log(this.data.addressInfo)
}
}
}).finally(() => {
......@@ -312,10 +316,16 @@ wxService.page({
wx.chooseAddress({
success: (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({
goodsAddress: false,
addressInfo: res,
wxAddress: true,
addressInfo: res
})
console.log('WX---------------------', this.data.addressInfo)
},
fail: function (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