|
@@ -200,22 +200,23 @@ var renew = {
|
|
goodsOrder.updatePrice(size.price / 100)
|
|
goodsOrder.updatePrice(size.price / 100)
|
|
// 查有无满赠活动 有满赠不再请求优惠券接口
|
|
// 查有无满赠活动 有满赠不再请求优惠券接口
|
|
renew.getGiftList(function(){
|
|
renew.getGiftList(function(){
|
|
- goodsCoupon.updatePrice(size.price / 100)
|
|
|
|
|
|
+ goodsCoupon.updatePrice(size.price / 100, size.pId)
|
|
})
|
|
})
|
|
// 校验本次选择的周期是否达到3年的最大限制
|
|
// 校验本次选择的周期是否达到3年的最大限制
|
|
renew.checkOver3Years(goodsSize.getTimeSelect(size.period))
|
|
renew.checkOver3Years(goodsSize.getTimeSelect(size.period))
|
|
} else {
|
|
} else {
|
|
// 初始化默认一年*省份数量或全国价格
|
|
// 初始化默认一年*省份数量或全国价格
|
|
|
|
+ // 一年对应的pId 是1014
|
|
sessionStorage.removeItem('$select-coupon')
|
|
sessionStorage.removeItem('$select-coupon')
|
|
if (count >= 16) {
|
|
if (count >= 16) {
|
|
goodsOrder.updatePrice(599900 / 100)
|
|
goodsOrder.updatePrice(599900 / 100)
|
|
renew.getGiftList(function(){
|
|
renew.getGiftList(function(){
|
|
- goodsCoupon.updatePrice(599900 / 100)
|
|
|
|
|
|
+ goodsCoupon.updatePrice(599900 / 100, 1014)
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
goodsOrder.updatePrice(38000*count / 100)
|
|
goodsOrder.updatePrice(38000*count / 100)
|
|
renew.getGiftList(function(){
|
|
renew.getGiftList(function(){
|
|
- goodsCoupon.updatePrice(38000*count / 100)
|
|
|
|
|
|
+ goodsCoupon.updatePrice(38000*count / 100, 1014)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// 校验本次选择的周期是否达到3年的最大限制
|
|
// 校验本次选择的周期是否达到3年的最大限制
|
|
@@ -224,7 +225,7 @@ var renew = {
|
|
} else {
|
|
} else {
|
|
// 旧规则初始化订单价格
|
|
// 旧规则初始化订单价格
|
|
goodsOrder.updatePrice(this.price / 100)
|
|
goodsOrder.updatePrice(this.price / 100)
|
|
- // 旧规则初始化自动领券 旧规则无满赠活动可直接领券
|
|
|
|
|
|
+ // 旧规则初始化自动领券 旧规则无满赠活动可直接领券 旧规则使用默认的pId 101 不传即为默认
|
|
goodsCoupon.updatePrice(this.price / 100)
|
|
goodsCoupon.updatePrice(this.price / 100)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -614,7 +615,9 @@ function clearSessionStorage() {
|
|
sessionStorage.removeItem("liveActiveCode_new");
|
|
sessionStorage.removeItem("liveActiveCode_new");
|
|
// 清除商品规格当前选择
|
|
// 清除商品规格当前选择
|
|
sessionStorage.removeItem("vip-cur-select-size")
|
|
sessionStorage.removeItem("vip-cur-select-size")
|
|
- sessionStorage.removeItem("$select-coupon")
|
|
|
|
|
|
+ sessionStorage.removeItem("$select-coupon") // 原订单提交组件上记录的缓存
|
|
|
|
+ // 商品介绍页上记录的当前选择的优惠券
|
|
|
|
+ sessionStorage.removeItem('vip-cur-select-coupon')
|
|
}
|
|
}
|
|
function showToast(text) {
|
|
function showToast(text) {
|
|
weui.toast(text, {
|
|
weui.toast(text, {
|
|
@@ -693,7 +696,7 @@ var goodsSize = new Vue({
|
|
goodsOrder.updatePrice(data.price/100)
|
|
goodsOrder.updatePrice(data.price/100)
|
|
// 查询有无满赠,无满赠执行回调查优惠券
|
|
// 查询有无满赠,无满赠执行回调查优惠券
|
|
renew.getGiftList(function(){
|
|
renew.getGiftList(function(){
|
|
- goodsCoupon.updatePrice(data.price/100)
|
|
|
|
|
|
+ goodsCoupon.updatePrice(data.price/100, data.pId)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getTimeSelect: function(data) {
|
|
getTimeSelect: function(data) {
|
|
@@ -723,8 +726,8 @@ var goodsCoupon = new Vue({
|
|
},
|
|
},
|
|
mounted () {},
|
|
mounted () {},
|
|
methods: {
|
|
methods: {
|
|
- updatePrice: function(data){
|
|
|
|
- this.$refs.goodsCoupon.getCoupon(data)
|
|
|
|
|
|
+ updatePrice: function(data, pId){
|
|
|
|
+ this.$refs.goodsCoupon.getCoupon(data, pId)
|
|
},
|
|
},
|
|
updateCoupon: function(data) {
|
|
updateCoupon: function(data) {
|
|
console.log(data, '更新优惠券选择')
|
|
console.log(data, '更新优惠券选择')
|
|
@@ -776,7 +779,7 @@ var goodsOrder = new Vue({
|
|
if (curCoupon) {
|
|
if (curCoupon) {
|
|
if(curCoupon.lotteryAttribute == '折扣券') {
|
|
if(curCoupon.lotteryAttribute == '折扣券') {
|
|
// disCount为折扣率 优惠金额 = 原价*优惠了多少比例(100 - disCount)
|
|
// disCount为折扣率 优惠金额 = 原价*优惠了多少比例(100 - disCount)
|
|
- this.$refs.couponRef.coupon.value = Number(before*((100 - curCoupon.disCount)/100)).toFixed(2)
|
|
|
|
|
|
+ this.$refs.couponRef.coupon.value = Number(before*((100 - curCoupon.disCount*10)/100)).toFixed(2)
|
|
} else if (curCoupon.lotteryAttribute == '满减券') {
|
|
} else if (curCoupon.lotteryAttribute == '满减券') {
|
|
this.$refs.couponRef.coupon.value = curCoupon.reduce
|
|
this.$refs.couponRef.coupon.value = curCoupon.reduce
|
|
}
|
|
}
|