|
|
@ -30,7 +30,8 @@ Page({ |
|
|
flag:null, |
|
|
flag:null, |
|
|
ticket_type:1, |
|
|
ticket_type:1, |
|
|
isCar:'single', |
|
|
isCar:'single', |
|
|
showMask: false |
|
|
showMask: false, |
|
|
|
|
|
price:0, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -63,12 +64,13 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
productNum: app.globalData.product.num < 1 ? 1 : app.globalData.product.num |
|
|
productNum: app.globalData.product.num < 1 ? 1 : app.globalData.product.num |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
product: app.globalData.product, |
|
|
product: app.globalData.product, |
|
|
singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price |
|
|
singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price |
|
|
}) |
|
|
}) |
|
|
console.log(this.data.product); |
|
|
this.showAllPrice() |
|
|
|
|
|
// console.log('********',this.data.product);
|
|
|
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') { |
|
|
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') { |
|
|
this.couponCom = this.selectAllComponents("#coupon")[0]; |
|
|
this.couponCom = this.selectAllComponents("#coupon")[0]; |
|
|
} |
|
|
} |
|
|
@ -78,6 +80,37 @@ Page({ |
|
|
// showMask:true
|
|
|
// showMask:true
|
|
|
// })
|
|
|
// })
|
|
|
// },
|
|
|
// },
|
|
|
|
|
|
showAllPrice:function () { |
|
|
|
|
|
// console.log('detail',app.globalData.product);
|
|
|
|
|
|
// console.log('singlePrice',this.data.singlePrice);
|
|
|
|
|
|
// console.log('productNum',this.data.productNum);
|
|
|
|
|
|
if (app.globalData.product.price) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
singlePrice:app.globalData.product.price |
|
|
|
|
|
}) |
|
|
|
|
|
let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) |
|
|
|
|
|
if (price >0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
price:price/100 |
|
|
|
|
|
}) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
price:0 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// console.log(this.data.singlePrice);
|
|
|
|
|
|
} |
|
|
|
|
|
let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) |
|
|
|
|
|
if (price >0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
price:price/100 |
|
|
|
|
|
}) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
price:0 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
cancel: function () { |
|
|
cancel: function () { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
showMask:false |
|
|
showMask:false |
|
|
@ -133,6 +166,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
this.data.product.num = this.data.productNum |
|
|
this.data.product.num = this.data.productNum |
|
|
this.changePrice() |
|
|
this.changePrice() |
|
|
|
|
|
this.showAllPrice() |
|
|
}, |
|
|
}, |
|
|
minus: function () { |
|
|
minus: function () { |
|
|
if (this.data.productNum==undefined) { |
|
|
if (this.data.productNum==undefined) { |
|
|
@ -160,15 +194,19 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
this.data.product.num = this.data.productNum |
|
|
this.data.product.num = this.data.productNum |
|
|
this.changePrice() |
|
|
this.changePrice() |
|
|
|
|
|
this.showAllPrice() |
|
|
}, |
|
|
}, |
|
|
changeDate: function (e) { |
|
|
changeDate: function (e) { |
|
|
|
|
|
// console.log('打印',e);
|
|
|
|
|
|
this.showAllPrice() |
|
|
if (e.detail.price != this.data.singlePrice && this.data.coupon) { |
|
|
if (e.detail.price != this.data.singlePrice && this.data.coupon) { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '订单价格发生变化,请重新选择优惠券', |
|
|
title: '订单价格发生变化,请重新选择优惠券', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
coupon: null |
|
|
coupon: null, |
|
|
|
|
|
singlePrice:e.detail.price |
|
|
}) |
|
|
}) |
|
|
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') { |
|
|
if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') { |
|
|
this.couponCom.setNullCoupon() |
|
|
this.couponCom.setNullCoupon() |
|
|
@ -541,6 +579,9 @@ Page({ |
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
// })
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// console.log('-----',app.globalData.product.sku.price);
|
|
|
|
|
|
// app.globalData.product = delete(app.globalData.product.detail)
|
|
|
|
|
|
// this.showAllPrice()
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|