新增短效无限量白名单处理

This commit is contained in:
wmp
2025-10-18 20:15:43 +08:00
parent aada71df8a
commit 2b7a4996e6
6 changed files with 490 additions and 97 deletions

View File

@@ -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;