Files
juipnet/Host/Views.Mobile/User/AssignAddress.cshtml

366 lines
15 KiB
Plaintext
Raw Normal View History

2021-03-30 14:37:23 +08:00
@using Home.Models
@using Hncore.Pass.BaseInfo.Response
@using Hncore.Pass.Vpn.Model
@using Hncore.Infrastructure.Extension
@model List<OriginAccountOnlineModel>
@{
Layout = "_Layout";
var productId = this.Context.Request.GetInt("productId");
}
<style type="text/css">
body {
background: #f5f5f5;
}
.checkbox {
margin-left: 1rem;
margin-top: 2rem;
2021-06-01 18:24:05 +08:00
height: calc(80vh);
2021-03-30 14:37:23 +08:00
overflow: auto;
}
2021-04-28 08:48:56 +08:00
.form-control {
height: 50px;
font-size: 25px;
width: 90%;
}
.citylabel {
font-weight: normal;
width: 300px;
height: 50px;
padding-left: 5px;
padding-top: 5px;
text-align: left;
border: solid 1px #ccc;
}
.citylabel>span{
padding-left: 50px;
display: block;
float: left;
}
.radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] {
position:none;
margin-left: 10px;
width: 25px;
height: 25px;
}
.btn {
height: 50px;
width: 90%;
font-size: 25px;
}
.province{
margin-bottom: 10px;
}
2021-03-30 14:37:23 +08:00
</style>
<vc:redirecct-login></vc:redirecct-login>
<div id="app" >
<div class="checkbox">
2021-04-28 08:48:56 +08:00
<div id="jike">
2021-06-02 11:06:54 +08:00
<h4 v-if="productId==13">请点击☞<a style="cursor:pointer" v-on:click="checkLine(1)">入口一</a> <a style="cursor:pointer" v-on:click="checkLine(2)">入口二</a></h4>
<h4><span style="color:#FF6666">{{line_text}}</span>统一服务器地址为:<span style="color:#FF6666">{{address_url}}</span> 换地区时无需在设备上更换服务器,只需在此页面选择需要的地区即可,可实现任意城市组合的混拨。<span style="color: red;">标红</span>为此线路正在维护中最多可选择20个线路</h4>
2021-04-28 08:48:56 +08:00
<label style="width: 90%;margin-left: 0.3rem;" v-for="(item,index) in assign_add_list">
2021-06-01 18:24:05 +08:00
<input type="checkbox" v-model="assign_list" style="left:-13px;" :value="item.name+'-'+item.id"/><span v-if="item.status ==2">{{item.name}}</span><span v-if="item.status ==1" style="color: red;">{{item.name}}</span>
2021-04-28 08:48:56 +08:00
</label>
<br>
<br>
<br>
</div>
<div id="huohu">
加载中,请稍后...
</div>
2021-03-30 14:37:23 +08:00
</div>
<div style="text-align: center;height:calc(5vh);margin-top:0.2rem;">
<button type="button" class="btnTui btn-refund" v-on:click="selectAddAssign()">确定选择</button>
</div>
</div>
<script>
$(function(){
let product_id = getQueryVariable('productId'),
account = getQueryVariable('account'),
pass = getQueryVariable('password');
2021-08-14 15:11:31 +08:00
if(product_id != 13&&product_id != 19&&product_id != 17&&product_id != 1) {
alert('目前仅支持极客、火狐、西瓜、强子产品!');
2021-03-30 14:37:23 +08:00
window.location.href = "/User/MyAccounts";
}
var app = new Vue({
el: '#app',
data: {
assign_add_list:[],
assign_list:[],
assign_account:'',
assign_pass:'',
2021-06-02 11:06:54 +08:00
line_text:'入口一',
2021-06-01 18:24:05 +08:00
address_url:'',
productId:getQueryVariable('productId')
2021-03-30 14:37:23 +08:00
},
mounted: function () {
this.assign_address();
},
methods: {
assign_address () {
var that = this;
this.assign_account = account;
this.assign_pass = pass;
2021-04-28 08:48:56 +08:00
if(product_id == 13){
$("#jike").show();
$("#huohu").hide();
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/index?user='+account+'&password='+pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
2021-06-01 18:24:05 +08:00
that.assign_add_list = res.data;
that.assign_list =res.list;
that.address_url = 'a.jkip.com'
2021-06-02 11:06:54 +08:00
that.line_text = '入口一'
2021-06-01 18:24:05 +08:00
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
}
});
}
if(product_id == 17){
$("#jike").show();
$("#huohu").hide();
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/indexXigua?user='+account+'&password='+pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
that.assign_add_list = res.data;
that.assign_list =res.list;
that.address_url = 'a.xgip.vip'
2021-06-02 11:06:54 +08:00
that.line_text = ''
2021-04-28 08:48:56 +08:00
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
}
});
2021-03-30 14:37:23 +08:00
}
2021-04-28 08:48:56 +08:00
if(product_id == 19){
$("#huohu").show();
$("#jike").hide();
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/getList?user='+account+'&password='+pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
2021-06-04 18:50:47 +08:00
$("#huohu").html('<p style="font-size:30px;">统一服务器地址1.hhip.vip <span style="color:red;">请不要选择剩余为0的地区</span></p><p>换地区时无需在设备上更换服务器,只需在此页面选择需要的地区即可,可实现任意城市组合的混拨。</p>');
2021-04-28 08:48:56 +08:00
$("#huohu").append(res.ipmodel);
$("#huohu").append("<hr>");
$("#huohu").append(res.city);
}
});
2021-03-30 14:37:23 +08:00
}
2021-08-14 15:11:31 +08:00
if(product_id == 1){
$("#huohu").show();
$("#jike").hide();
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/qiangzi_address?user='+account+'&password='+pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
$("#huohu").html('<p style="font-size:30px;">服务器地址是混拨服务器,不选择任何地区,则为全国随机</p>');
$("#huohu").append(res);
}
});
}
2021-04-28 08:48:56 +08:00
},
2021-06-01 18:24:05 +08:00
checkLine(n) {
var that = this;
if (n==1){
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/index?user='+this.assign_account+'&password='+this.assign_pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
that.assign_add_list = res.data;
that.assign_list =res.list;
that.address_url = 'a.jkip.com'
2021-06-02 11:06:54 +08:00
that.line_text = '入口一'
2021-06-01 18:24:05 +08:00
}
});
}
if (n==2){
$.ajax({
type: 'GET',
url: 'http://php-api.juip.com/product/AccountAddress/index2?user='+this.assign_account+'&password='+this.assign_pass,
dataType: "json",
contentType: "application/json",
success: function (res) {
that.assign_add_list = res.data;
that.assign_list =res.list;
that.address_url = 'b.jkip.com'
2021-06-02 11:06:54 +08:00
that.line_text = '入口二'
2021-06-01 18:24:05 +08:00
}
});
}
},
2021-04-28 08:48:56 +08:00
selectAddAssign() {
if(product_id == 13){
if(this.assign_list.length>20||this.assign_list.length==0){
alert('最多选择20个至少选择一个');
return;
}
let data = {
list:this.assign_list,
account:this.assign_account,
password:this.assign_pass,
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/product/AccountAddress/select',
dataType: "json",
data:JSON.stringify(data),
contentType: "application/json",
success: function (res) {
if(res.code == 1){
alert('选择成功');
} else {
alert('选择失败');
}
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
2021-03-30 14:37:23 +08:00
}
2021-04-28 08:48:56 +08:00
});
2021-06-01 18:24:05 +08:00
}
if(this.productId == 17){
if(this.assign_list.length>20||this.assign_list.length==0){
alert('最多选择20个至少选择一个');
return;
}
let data = {
list:this.assign_list,
account:this.assign_account,
password:this.assign_pass,
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/product/AccountAddress/selectXigua',
dataType: "json",
data:JSON.stringify(data),
contentType: "application/json",
success: function (res) {
if(res.code == 1){
alert('选择成功');
} else {
alert('选择失败');
}
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
}
});
2021-08-14 15:11:31 +08:00
}
if(this.productId == 1){
let address_checked = [];
$("input[name='poolids[]']:checked").each(function(i){
address_checked.push($(this).val());
});
let data = {
list:address_checked,
account:this.assign_account,
password:this.assign_pass,
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/product/AccountAddress/qiangzi',
dataType: "json",
data:JSON.stringify(data),
contentType: "application/json",
success: function (res) {
if(res.code == 1){
alert('选择成功');
} else {
alert('选择失败');
}
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
}
});
2021-04-28 08:48:56 +08:00
}
if(product_id == 19){
let address_checked = [];
$("input[name='citys[]']:checked").each(function(i){
address_checked.push($(this).val());
});
let ipmode = $("select[name='ipmode']").val();
console.log(address_checked)
console.log(ipmode)
let data = {
list:address_checked,
account:this.assign_account,
password:this.assign_pass,
ipmode:ipmode,
2021-03-30 14:37:23 +08:00
}
2021-04-28 08:48:56 +08:00
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/product/AccountAddress/setAddress',
dataType: "json",
data:JSON.stringify(data),
contentType: "application/json",
success: function (res) {
if(res.code == 1){
alert('选择成功');
} else {
alert('选择失败');
}
//if (res.Code == 10000) {
// that.onLineData = res.Data;
// for (var i = 0; i < that.onLineData.length; i++) {
// that.onLineData[i].ProductId = productId;
// }
//}
}
});
}
2021-03-30 14:37:23 +08:00
},
}
})
});
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
</script>