Commit 099ca345 by 张立顺

代码合并冲突

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