极客西瓜月卡自动优惠券

This commit is contained in:
“wanyongkang”
2021-04-13 14:37:10 +08:00
parent 6fa6ce18d2
commit 9c92fe06e7
6 changed files with 61 additions and 10 deletions

View File

@@ -194,7 +194,7 @@
</div>
</div>
<div class="col-lg-4 text-left">
<span class="grayText">每隔30天淘宝下单获得一张优惠券</span>
<span class="grayText">淘宝每次下单获得优惠券</span>
</div>
</div>
<div class="row">
@@ -345,7 +345,7 @@
</div>
</div>
<div class="col-lg-4 text-left">
<span class="grayText">每隔30天淘宝下单获得一张优惠券</span>
<span class="grayText">淘宝每次下单获得优惠券</span>
</div>
</div>
<div class="row">
@@ -500,6 +500,11 @@
var restAmout = this.OneBuyModel.UseAccountAmount == 1 ? this.RestAmount : 0;
var total = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount - 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);
},
MoreTotalAmount: function () {
@@ -510,12 +515,20 @@
var restAmout = this.MoreBuyModel.UseAccountAmount == 1 ? this.RestAmount : 0;
var total = this.MoreBuyModel.Price * this.MoreBuyModel.ConnectCount * this.MoreBuyModel.MaxPostfix - this.MoreBuyModel.CouponAmount ;
total = total < 0 ? 0 : total;
//西瓜极客优惠券
if(@(Model.Package.Id) == 64||@(Model.Package.Id) == 1004){
total -= this.MoreBuyModel.ConnectCount * (this.MoreBuyModel.Price - 52.8) * this.MoreBuyModel.MaxPostfix
}
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];
@@ -544,6 +557,9 @@
},
'MoreBuyModel.CouponId': { //加引号监听对象里的属性
handler: function (newValue, oldValue) {
if( this.OneBuyModel.CouponId == 10000000){
return;
}
var totalAmount = this.MoreBuyModel.Price * this.MoreBuyModel.ConnectCount;
for (var i = 0; i < this.Coupons.length; i++) {
var item = this.Coupons[i];
@@ -585,6 +601,10 @@
immediate: true
}
},
created () {
this.OneBuyModel.CouponId = 10000000
this.MoreBuyModel.CouponId = 10000000
},
mounted: function () {
@if(user != null) {
<text>this.getCoupons()</text>
@@ -605,8 +625,17 @@
type: 'GET',
url: url,
success: function (res) {
console.log(res);
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);
}
console.log(res.Data)
that.Coupons = res.Data.map(m => m.Coupon);
}
}