Commit 099ca345 by 张立顺

代码合并冲突

2 parents 0c8e71df 0e3cd5ce
......@@ -168,14 +168,14 @@ Component({
let { goodsList } = this.data
if (goodsList.length < 1) return
if (!chooseList.length) return wx.$util.showToast('请勾选商品')
let thisPage = wx.$router.getPageInstance()
// thisPage.setGoodsTotal(chooseList)
// console.log(chooseList)
thisPage.setData({
goodsList: chooseList
})
thisPage.setGoodsTotal(chooseList)
console.log(chooseList)
this.setData({
show: false
})
......
......@@ -11,7 +11,7 @@
* 3生产环境
* 4预发布
*/
let index = 2
let index = 3
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -58,7 +58,7 @@ Page({
},
selectPayType: 2,
remark: '',
customerCouponId:'',
customerCouponId: ''
},
goodsList: [],
goodsData: [],
......@@ -148,7 +148,7 @@ Page({
orderObj,
goodsList
})
this.setGoodsTotal(goodsList)
// this.setGoodsTotal(goodsList)
}
}
this.setData({
......@@ -217,7 +217,7 @@ Page({
this.showToast('单价不可低于商品最低价')
}
let { goodsList } = this.data
this.setGoodsTotal(goodsList)
// this.setGoodsTotal(goodsList)
},
priceBlur(e) {
let { index, item } = e.currentTarget.dataset
......@@ -227,16 +227,16 @@ Page({
})
let { goodsList } = this.data
this.setGoodsTotal(goodsList)
// this.setGoodsTotal(goodsList)
},
setGoodsTotal(goodsList) {
let { totalFee } = this.data
let total = 0
// goodsList.map(i => (total += i.count * i.price))
goodsList.map(i =>{
const totalPrice = NP.times(i.count,i.price)
total = NP.plus(total,totalPrice)
} )
goodsList.map(i => {
const totalPrice = NP.times(i.count, i.price)
total = NP.plus(total, totalPrice)
})
// 用来解决小数相减导致精度问题
// total = this.accMul(total, 100)
total = NP.times(total, 100)
......@@ -249,7 +249,7 @@ Page({
// console.log(this.accMul(total, 100))
// 解决数据精度丢失问题
// let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0
let priceSpread = goodsList.length ? NP.minus(total,totalFee): 0
let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0
// console.log(priceSpread)
this.setData({
priceSpread: priceSpread,
......@@ -302,7 +302,7 @@ Page({
this.setData({
goodsList
})
this.setGoodsTotal(goodsList)
// this.setGoodsTotal(goodsList)
},
submit(i) {
// 判断手机号是否用配置的默认值
......@@ -439,6 +439,7 @@ Page({
}
} else {
this.showToast(message)
throw message
}
})
.finally(() => {
......@@ -687,7 +688,7 @@ Page({
goodsList: chooseList,
first: false
})
this.setGoodsTotal(chooseList)
// this.setGoodsTotal(chooseList)
},
getSetting() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!