新增短效无限量白名单处理
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
@{
|
||||
Layout = "_UserLayout";
|
||||
}
|
||||
@@ -447,9 +446,17 @@
|
||||
<div class="col-sm-12 ">
|
||||
<div class="boxes boxes-border-top text-left margin-top-30 clearfix">
|
||||
<div class="col-sm-12">
|
||||
<h5 class=" text-left">价格:¥{{order_info.money}} <span style="float:right;">
|
||||
<button class="btn btn-new" v-on:click="pay()" data-backdrop="static" >实付¥{{order_info.money}}</button>
|
||||
</span></h5>
|
||||
<h5 class=" text-left">
|
||||
<span style="margin-right:4px">价格:¥{{order_info.money}}</span>
|
||||
<span style="font-size: 13px;font-weight: 400;color: #666666;">
|
||||
无限量白名单上限:{{whitelist}}
|
||||
</span>
|
||||
<span style="float:right;">
|
||||
<button class="btn btn-new" v-on:click="pay()"
|
||||
data-backdrop="static">实付¥{{order_info.money}}
|
||||
</button>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -462,50 +469,53 @@
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
<script>
|
||||
var vm = new Vue({
|
||||
el:'#app',
|
||||
data:{
|
||||
pakage_list:[],
|
||||
order_list:[],
|
||||
rebuy_data:{
|
||||
title:'',
|
||||
packId:'',
|
||||
packType:'',
|
||||
periodType:1,
|
||||
periodAmount:1,
|
||||
durationType:5,
|
||||
var baseUrl = '@ViewData["BaseUrl"]';
|
||||
var vm = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
pakage_list: [],
|
||||
order_list: [],
|
||||
rebuy_data: {
|
||||
title: '',
|
||||
packId: '',
|
||||
packType: '',
|
||||
periodType: 1,
|
||||
periodAmount: 1,
|
||||
durationType: 5,
|
||||
},
|
||||
order_time_type:'天',
|
||||
order_info:{
|
||||
order_type:2,//1:预储值、2:短效无限量、3:短效包天、4:短效包量、5:长效游戏
|
||||
money:1,
|
||||
data:{}
|
||||
order_time_type: '天',
|
||||
order_info: {
|
||||
order_type: 2,//1:预储值、2:短效无限量、3:短效包天、4:短效包量、5:长效游戏
|
||||
money: 1,
|
||||
data: {}
|
||||
},
|
||||
|
||||
api_link:'',
|
||||
api_link_item:{
|
||||
num:1
|
||||
api_link: '',
|
||||
api_link_item: {
|
||||
num: 1
|
||||
},
|
||||
regions:[],
|
||||
user_detail:{},
|
||||
},
|
||||
created:function(){
|
||||
this.get_package_list();
|
||||
regions: [],
|
||||
user_detail: {},
|
||||
whitelist: 1,
|
||||
},
|
||||
methods:{
|
||||
get_package_list(){
|
||||
created: function () {
|
||||
this.get_package_list();
|
||||
this.get_whitelist_max();
|
||||
},
|
||||
methods: {
|
||||
get_package_list() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/dx_package',
|
||||
url: `${baseUrl}/http/user/dx_package`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -516,17 +526,17 @@
|
||||
},
|
||||
get_ip() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/get_user_token',
|
||||
url: `${baseUrl}/http/user/get_user_token`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -536,23 +546,23 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
autowhiteip(){
|
||||
autowhiteip() {
|
||||
this.api_link_item.u = this.user_detail.u
|
||||
this.api_link_item.t = this.user_detail.t
|
||||
},
|
||||
get_order_list() {
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/user/dx_order',
|
||||
url: `${baseUrl}/http/user/dx_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -562,6 +572,8 @@
|
||||
});
|
||||
},
|
||||
rebuy(r) {
|
||||
console.log(r);
|
||||
|
||||
this.rebuy_data.title = r.name;
|
||||
this.rebuy_data.packId = r.id;
|
||||
this.rebuy_data.packType = r.planType;
|
||||
@@ -577,52 +589,53 @@
|
||||
this.calc_price();
|
||||
|
||||
},
|
||||
set_btn_checked(id_f,id,text){
|
||||
set_btn_checked(id_f, id, text) {
|
||||
var i = 0;
|
||||
if (text.length > 0) {
|
||||
this.order_time_type = text
|
||||
}
|
||||
for (i=0;i<100;i++) {
|
||||
$("#"+id_f+i).removeClass("btn-new");
|
||||
$("#"+id_f+i).addClass("btn-default");
|
||||
for (i = 0; i < 100; i++) {
|
||||
$("#" + id_f + i).removeClass("btn-new");
|
||||
$("#" + id_f + i).addClass("btn-default");
|
||||
}
|
||||
$("#"+id_f+id).removeClass("btn-default");
|
||||
$("#"+id_f+id).addClass("btn-new");
|
||||
|
||||
let _this=this
|
||||
setTimeout(function() {
|
||||
|
||||
$("#" + id_f + id).removeClass("btn-default");
|
||||
$("#" + id_f + id).addClass("btn-new");
|
||||
|
||||
let _this = this
|
||||
setTimeout(function () {
|
||||
|
||||
_this.calc_price()
|
||||
|
||||
|
||||
}, 500);
|
||||
},
|
||||
gmsc_add(){
|
||||
gmsc_add() {
|
||||
this.rebuy_data.periodAmount++;
|
||||
this.calc_price();
|
||||
},
|
||||
//短效包天购买时长修改
|
||||
gmsc_reduce(){
|
||||
gmsc_reduce() {
|
||||
if (this.rebuy_data.periodAmount > 1) {
|
||||
this.rebuy_data.periodAmount--;
|
||||
this.calc_price();
|
||||
}
|
||||
},
|
||||
pay(){
|
||||
pay() {
|
||||
let that = this;
|
||||
this.order_info.data = this.rebuy_data;
|
||||
|
||||
this.order_info.renew = 1;
|
||||
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
cookie: document.cookie,
|
||||
order_info: this.order_info
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/order/rebuy_order',
|
||||
url: `${baseUrl}/http/order/rebuy_order`,
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
beforeSend: function (xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
@@ -631,19 +644,19 @@
|
||||
$('#myModal').modal('hide');
|
||||
alert(res.msg);
|
||||
that.get_package_list();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
chaneg_type(r){
|
||||
chaneg_type(r) {
|
||||
var that = this;
|
||||
this.pakage_list.forEach(function(item,index,arr){
|
||||
this.pakage_list.forEach(function (item, index, arr) {
|
||||
|
||||
if (that.api_link_item.pack == item.id) {
|
||||
that.api_link_item.pt = item.planType;
|
||||
that.api_link_item.time = item.durationType2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
@@ -658,25 +671,25 @@
|
||||
$("#qc").show();
|
||||
$("#at").hide();
|
||||
that.api_link_item.distinct = 0;
|
||||
}
|
||||
}
|
||||
if (that.api_link_item.pt == 21) {
|
||||
$("#gt").show();
|
||||
}
|
||||
},
|
||||
qqms(i){
|
||||
qqms(i) {
|
||||
if (i == 1) {
|
||||
$("#sp").hide();
|
||||
} else {
|
||||
$("#sp").show();
|
||||
}
|
||||
},
|
||||
create_api_link(){
|
||||
create_api_link() {
|
||||
this.api_link = 'http://get.ip.juip.com/get/ip?';
|
||||
var regions_list = this.regions.join(",");
|
||||
|
||||
|
||||
for (let key in this.api_link_item) {
|
||||
if (this.api_link_item.hasOwnProperty(key)) {
|
||||
this.api_link += key + "=" + this.api_link_item[key]+'&';
|
||||
this.api_link += key + "=" + this.api_link_item[key] + '&';
|
||||
}
|
||||
}
|
||||
this.api_link += 'regions=' + regions_list;
|
||||
@@ -684,18 +697,18 @@
|
||||
// 全选按钮点击事件处理程序
|
||||
selectAll() {
|
||||
var checkboxes = document.querySelectorAll('input[name="regions"]'); // 获取所有复选框元素
|
||||
|
||||
|
||||
for (var i = 0; i < checkboxes.length; i++) {
|
||||
checkboxes[i].checked=true; // 将每个复选框的 checked 属性设置为 true
|
||||
checkboxes[i].checked = true; // 将每个复选框的 checked 属性设置为 true
|
||||
this.regions[i] = checkboxes[i].value;
|
||||
}
|
||||
},
|
||||
// 取消全选按钮点击事件处理程序
|
||||
deselectAll() {
|
||||
var checkboxes = document.querySelectorAll('input[name="regions"]'); // 获取所有复选框元素
|
||||
|
||||
|
||||
for (var i = 0; i < checkboxes.length; i++) {
|
||||
checkboxes[i].checked=false; // 移除每个复选框的 checked 属性
|
||||
checkboxes[i].checked = false; // 移除每个复选框的 checked 属性
|
||||
}
|
||||
this.regions = [];
|
||||
},
|
||||
@@ -716,30 +729,49 @@
|
||||
this.order_info.data = this.rebuy_data;
|
||||
|
||||
var price_info = {
|
||||
'ipAmount':0,
|
||||
'price':0,
|
||||
'ipAmount': 0,
|
||||
'price': 0,
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/http/product/calc_price',
|
||||
url: `${baseUrl}/http/product/calc_price`,
|
||||
dataType: "json",
|
||||
async:false,
|
||||
async: false,
|
||||
data: this.order_info,
|
||||
success: function (res) {
|
||||
price_info = res
|
||||
}
|
||||
});
|
||||
switch(this.order_info.order_type) {
|
||||
switch (this.order_info.order_type) {
|
||||
case 2:
|
||||
this.order_info.money = this.order_info.data.periodAmount * price_info.price;
|
||||
break;
|
||||
const whitelist = this.whitelist
|
||||
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;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
this.order_info.money = this.order_info.money.toFixed(2);
|
||||
},
|
||||
|
||||
// 查询短效无限量白名单数量
|
||||
get_whitelist_max() {
|
||||
const data = {
|
||||
cookie: document.cookie,
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `${baseUrl}/http/user/white_limit_get_su`,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
this.whitelist = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user