新增短效无限量白名单处理
This commit is contained in:
@@ -221,6 +221,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
<h5 class="margin-top-0">白名单数量:</h5>
|
||||
<div class="d-flex align-items-center" style="gap: 15px;">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" v-on:click="dxwxl_whitelist_reduce()" :disabled="dxwxl_data.maxWhitelist <= 1" class="btn btn-new">-</button>
|
||||
<button type="button" class="btn btn-default">{{ dxwxl_data.maxWhitelist }}</button>
|
||||
<button type="button" v-on:click="dxwxl_whitelist_add()" :disabled="dxwxl_data.maxWhitelist >= 20" class="btn btn-new">+</button>
|
||||
</div>
|
||||
<span style="margin-left: 20px;">
|
||||
您的白名单上限{{ dxwxl_data.maxWhitelist }}个,
|
||||
<span v-if="dxwxl_data.maxWhitelist === 1">价格<span class="text-danger">无折扣</span></span>
|
||||
<span v-else-if="dxwxl_data.maxWhitelist <= 5" class="text-danger">{{11 - dxwxl_data.maxWhitelist}}折</span>
|
||||
<span v-else class="text-danger">6折</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
@@ -700,7 +720,7 @@
|
||||
<script src="~/js/vue.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var baseUrl = '@ViewData["BaseUrl"]';
|
||||
var select_ip_num = 0;
|
||||
|
||||
$(document).on("ready", function(e) {
|
||||
@@ -806,6 +826,7 @@ $(document).on("ready", function(e) {
|
||||
durationType:5,
|
||||
periodType:1060,//必填,周期类型,1060-小时,1-按天,7-按周,30-按月,90-按季度
|
||||
periodAmount:1,//必填,购买周期,根据periodType来,例如按天,就是N天,按周就是N周
|
||||
maxWhitelist:1,//选填,变更无限量白名单数量,不填写会默认使用当前白名单数量
|
||||
},
|
||||
dxbt_data:{//短效包天
|
||||
durationType:5,//必填,有效时长,5-1至5分钟,25-5至25分钟,180-25至180分钟,360-3至6小时
|
||||
@@ -927,7 +948,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/city',
|
||||
url: `${baseUrl}/http/product/city`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -941,7 +962,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/game',
|
||||
url: `${baseUrl}/http/product/game`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -976,7 +997,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/linecount',
|
||||
url: `${baseUrl}/http/product/linecount`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
@@ -1026,6 +1047,18 @@ $(document).on("ready", function(e) {
|
||||
this.dxwxl_data.periodAmount++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效无限量购买白名单修改
|
||||
dxwxl_whitelist_reduce(){
|
||||
if (this.dxwxl_data.maxWhitelist > 1) {
|
||||
this.dxwxl_data.maxWhitelist--;
|
||||
this.calc_price();
|
||||
}
|
||||
},
|
||||
//短效无限量购买白名单修改
|
||||
dxwxl_whitelist_add(){
|
||||
this.dxwxl_data.maxWhitelist++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效包天购买时长修改
|
||||
dxbt_gmsc_reduce(){
|
||||
if (this.dxbt_data.periodAmount > 1) {
|
||||
@@ -1115,7 +1148,7 @@ $(document).on("ready", function(e) {
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/order/create_order',
|
||||
url: `${baseUrl}/http/order/create_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -1159,7 +1192,7 @@ $(document).on("ready", function(e) {
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/get_balance',
|
||||
url: `${baseUrl}/http/user/get_balance`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -1199,7 +1232,7 @@ $(document).on("ready", function(e) {
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/calc_price',
|
||||
url: `${baseUrl}/http/product/calc_price`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data: this.order_info,
|
||||
@@ -1209,7 +1242,9 @@ $(document).on("ready", function(e) {
|
||||
});
|
||||
switch(this.order_info.order_type) {
|
||||
case 2:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price;
|
||||
const whitelist = this.order_info.data.maxWhitelist
|
||||
const discount = Math.max(.6, 1 - .1 * (whitelist - 1))
|
||||
this.order_info.money = this.order_info.data.periodAmount * whitelist * discount * price_info.price;
|
||||
break;
|
||||
case 3:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price * this.order_info.data.ipAmount;
|
||||
|
||||
Reference in New Issue
Block a user