极客西瓜月卡自动优惠券
This commit is contained in:
@@ -157,7 +157,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 text-left">
|
||||
<span class="grayText">每隔30天淘宝下单可获得一张优惠券</span>
|
||||
<span class="grayText">淘宝每次下单获得优惠券</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -280,12 +280,19 @@
|
||||
var restAmout = this.OneBuyModel.UseAccountAmount == 1 ? this.RestAmount : 0;
|
||||
var total = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount * count - this.OneBuyModel.CouponAmount ;
|
||||
total= total < 0 ? 0 : total;
|
||||
//西瓜极客优惠券
|
||||
if(@(Model.Package.Id) == 64||@(Model.Package.Id) == 1004){
|
||||
total -= this.OneBuyModel.ConnectCount * (this.OneBuyModel.Price - 52.8)
|
||||
}
|
||||
return total.toFixed(2);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'OneBuyModel.CouponId': { //加引号监听对象里的属性
|
||||
handler: function (newValue, oldValue) {
|
||||
if( this.OneBuyModel.CouponId == 10000000){
|
||||
return;
|
||||
}
|
||||
var totalAmount = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount;
|
||||
for (var i = 0; i < this.Coupons.length; i++) {
|
||||
var item = this.Coupons[i];
|
||||
@@ -321,6 +328,9 @@
|
||||
mounted: function () {
|
||||
this.getCoupons();
|
||||
},
|
||||
created () {
|
||||
this.OneBuyModel.CouponId = 10000000
|
||||
},
|
||||
methods: {
|
||||
getCoupons: function () {
|
||||
var that = this;
|
||||
@@ -330,7 +340,16 @@
|
||||
url: url,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (res.Code == 10000) {
|
||||
if (res.Code == 10000) {
|
||||
if(@(Model.Package.Id) == 64||@(Model.Package.Id) == 1004){
|
||||
var coupon_json = {
|
||||
"Coupon":{
|
||||
"Id":10000000,
|
||||
"Name":"极客-西瓜-满减劵",
|
||||
}
|
||||
}
|
||||
res.Data.push(coupon_json);
|
||||
}
|
||||
that.Coupons = res.Data.map(m => m.Coupon);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user