购买自动升级折扣

This commit is contained in:
“wanyongkang”
2021-04-23 18:17:13 +08:00
parent dbca60c95a
commit 746edaf5db
4 changed files with 137 additions and 0 deletions

View File

@@ -220,6 +220,14 @@
</div>
<div class="col-sm-7 col-xs-7">
<span class="yingfu" style="font-size: 35px;font-weight: bold;">{{OnePayAmount}}</span>元
</div>
</div>
<div class="row">
<div class="col-sm-5 col-xs-5">
</div>
<div class="col-sm-7 col-xs-7">
<p>{{auto_discount_text}}</p>
</div>
</div>
<p class="grayText songquan">淘宝每次下单获得优惠券</p>
@@ -352,6 +360,13 @@
<span class="yingfu">{{MorePayAmount}}</span>元
</div>
</div>
<div class="row">
<div class="col-sm-5 col-xs-5">
</div>
<div class="col-sm-7 col-xs-7">
<p>{{auto_discount_text}}</p>
</div>
</div>
<p class="grayText songquan">淘宝每次下单获得优惠券</p>
<p class="redText songquan">{{Tip}}</p>
<div class="ok">
@@ -381,6 +396,7 @@
var app = new Vue({
el: '#app',
data: {
auto_discount_text:'',
acount_list:'',
showPayType:true,
payHandler:null,
@@ -440,6 +456,42 @@
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;
total = parseFloat(total.toFixed(2));
if(@(userEntity.agent_id) == 0){
var consume_value = @(userEntity.ConsumeAmount);
var cost_money = total + consume_value;
var discount = 100;
if (cost_money>=200 && cost_money<500){
discount = 90;
this.auto_discount_text = '自动升级至 9 折会员';
} else if(cost_money>=500 && cost_money<1500) {
discount = 80;
this.auto_discount_text = '自动升级至 8 折会员';
} else if(cost_money>=1500 && cost_money<3000) {
discount = 70;
this.auto_discount_text = '自动升级至 7 折会员';
} else if(cost_money>=3000 && cost_money<6000) {
discount = 65;
this.auto_discount_text = '自动升级至 6.5 折会员';
} else if(cost_money>=6000) {
discount = 60;
this.auto_discount_text = '自动升级至 6 折会员';
}
var need_cost = 100000000;
if(discount != 100){
need_cost = @(Model.Package.LinePrice) * this.OneBuyModel.ConnectCount * discount / 100 - this.OneBuyModel.CouponAmount;
}
if(need_cost<total){
total = need_cost;
} else {
this.auto_discount_text = '';
}
}
return total.toFixed(2);
},
MoreTotalAmount: function () {
@@ -454,6 +506,42 @@
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;
total = parseFloat(total.toFixed(2));
if(@(userEntity.agent_id) == 0){
var consume_value = @(userEntity.ConsumeAmount);
var cost_money = total + consume_value;
var discount = 100;
if (cost_money>=200 && cost_money<500){
discount = 90;
this.auto_discount_text = '自动升级至 9 折会员';
} else if(cost_money>=500 && cost_money<1500) {
discount = 80;
this.auto_discount_text = '自动升级至 8 折会员';
} else if(cost_money>=1500 && cost_money<3000) {
discount = 70;
this.auto_discount_text = '自动升级至 7 折会员';
} else if(cost_money>=3000 && cost_money<6000) {
discount = 65;
this.auto_discount_text = '自动升级至 6.5 折会员';
} else if(cost_money>=6000) {
discount = 60;
this.auto_discount_text = '自动升级至 6 折会员';
}
var need_cost = 100000000;
if(discount != 100){
need_cost = @(Model.Package.LinePrice) * this.MoreBuyModel.ConnectCount * this.MoreBuyModel.MaxPostfix * discount / 100 - this.MoreBuyModel.CouponAmount;
}
if(need_cost<total){
total = need_cost;
} else {
this.auto_discount_text = '';
}
}
return total.toFixed(2);
}
},

View File

@@ -173,6 +173,13 @@
<span class="yingfu" style="font-size: 35px;font-weight: bold;">{{PayAmount}}</span>元
</div>
</div>
<div class="row">
<div class="col-sm-5 col-xs-5">
</div>
<div class="col-sm-7 col-xs-7">
<p>{{auto_discount_text}}</p>
</div>
</div>
<p class="grayText songquan">淘宝每次下单获得优惠券</p>
<p class="grayText songquan" style="color:red">{{Tip}}</p>
<div class="ok">
@@ -187,6 +194,7 @@
var app = new Vue({
el: '#app',
data: {
auto_discount_text:'',
showPayType: true,
Tip:'',
RestAmount: @(userEntity.RestAmount),
@@ -218,6 +226,42 @@
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;
total = parseFloat(total.toFixed(2));
if(@(userEntity.agent_id) == 0){
var consume_value = @(userEntity.ConsumeAmount);
var cost_money = total + consume_value;
var discount = 100;
if (cost_money>=200 && cost_money<500){
discount = 90;
this.auto_discount_text = '自动升级至 9 折会员';
} else if(cost_money>=500 && cost_money<1500) {
discount = 80;
this.auto_discount_text = '自动升级至 8 折会员';
} else if(cost_money>=1500 && cost_money<3000) {
discount = 70;
this.auto_discount_text = '自动升级至 7 折会员';
} else if(cost_money>=3000 && cost_money<6000) {
discount = 65;
this.auto_discount_text = '自动升级至 6.5 折会员';
} else if(cost_money>=6000) {
discount = 60;
this.auto_discount_text = '自动升级至 6 折会员';
}
var need_cost = 100000000;
if(discount != 100){
need_cost = @(Model.Package.LinePrice) * this.OneBuyModel.ConnectCount * discount / 100 - this.OneBuyModel.CouponAmount;
}
if(need_cost<total){
total = need_cost;
} else {
this.auto_discount_text = '';
}
}
return total.toFixed(2);
}
},

View File

@@ -512,6 +512,8 @@
var total = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount - this.OneBuyModel.CouponAmount ;
total = total < 0 ? 0 : total;
total = parseFloat(total.toFixed(2));
if(@(userEntity.agent_id) == 0){
var consume_value = @(userEntity.ConsumeAmount);
var cost_money = total + consume_value;
@@ -544,6 +546,7 @@
} else {
this.auto_discount_text = '';
}
}
return total.toFixed(2);
@@ -560,6 +563,7 @@
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;
total = parseFloat(total.toFixed(2));
if(@(userEntity.agent_id) == 0){
var consume_value = @(userEntity.ConsumeAmount);

View File

@@ -290,6 +290,7 @@
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;
total = parseFloat(total.toFixed(2));
//自动折扣
if(@(userEntity.agent_id) == 0){