|
...
|
...
|
@@ -9,6 +9,7 @@ Page({ |
|
|
|
probablyPrice: '',
|
|
|
|
sellerid: '',
|
|
|
|
notes: '',
|
|
|
|
noData: false,
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
...
|
...
|
@@ -16,6 +17,7 @@ Page({ |
|
|
|
onLoad(options) {
|
|
|
|
console.log('options', options);
|
|
|
|
let obj = JSON.parse(options.obj);
|
|
|
|
let noData = false;
|
|
|
|
let cookbooklist = JSON.parse(options.cookbooklist);
|
|
|
|
let probablyPrice = 0;
|
|
|
|
cookbooklist.forEach(items => {
|
|
...
|
...
|
@@ -24,6 +26,7 @@ Page({ |
|
|
|
let price = item.quantum * 1 * (item.price * 1);
|
|
|
|
probablyPrice += price;
|
|
|
|
if (item.quantum > 0) {
|
|
|
|
noData = true
|
|
|
|
items.is_show = true
|
|
|
|
}
|
|
|
|
})
|
|
...
|
...
|
@@ -32,19 +35,22 @@ Page({ |
|
|
|
cookbooklist,
|
|
|
|
sellerName: obj.sellerName,
|
|
|
|
sellerid: obj.sellerid,
|
|
|
|
probablyPrice
|
|
|
|
probablyPrice,
|
|
|
|
noData
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 确认下单
|
|
|
|
determineFun() {
|
|
|
|
let obj = {
|
|
|
|
sellerName: this.data.sellerName,
|
|
|
|
sellerid: this.data.sellerid,
|
|
|
|
notes: this.data.notes
|
|
|
|
if (this.data.noData) {
|
|
|
|
let obj = {
|
|
|
|
sellerName: this.data.sellerName,
|
|
|
|
sellerid: this.data.sellerid,
|
|
|
|
notes: this.data.notes
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pack-cookbook/pages/success_new?cookbooklist=${JSON.stringify(this.data.cookbooklist)}&obj=${JSON.stringify(obj)}`,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pack-cookbook/pages/success_new?cookbooklist=${JSON.stringify(this.data.cookbooklist)}&obj=${JSON.stringify(obj)}`,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 加
|
|
|
|
addDdish() {
|
...
|
...
|
|