2020-10-07 20:25:03 +08:00
|
|
|
|
@using Hncore.Pass.Vpn.Response.Product
|
|
|
|
|
|
@using Hncore.Infrastructure.Extension
|
|
|
|
|
|
@using Hncore.Pass.BaseInfo.Response
|
|
|
|
|
|
@using Hncore.Infrastructure.Serializer;
|
|
|
|
|
|
@using Hncore.Pass.BaseInfo.Service
|
|
|
|
|
|
@using Hncore.Infrastructure.Common
|
|
|
|
|
|
@model PackageInfoResponse
|
|
|
|
|
|
@inject UserService m_UserService
|
|
|
|
|
|
@inject Hncore.Pass.Vpn.Service.ProductAccountService m_AccountService
|
|
|
|
|
|
@{
|
|
|
|
|
|
ViewData["Title"] = "购买产品";
|
|
|
|
|
|
UserLoginModel user = null;
|
|
|
|
|
|
Hncore.Pass.BaseInfo.Models.User userEntity = new Hncore.Pass.BaseInfo.Models.User();
|
|
|
|
|
|
if (this.Context.Request.Cookies.TryGetValue("userInfo", out string userCookie))
|
|
|
|
|
|
{
|
|
|
|
|
|
user = userCookie.FromJsonTo<UserLoginModel>();
|
|
|
|
|
|
userEntity = await m_UserService.GetById(user.Id);
|
|
|
|
|
|
}
|
|
|
|
|
|
var randomPwd = ValidateCodeHelper.MakeNumCode(3).ToLower();
|
|
|
|
|
|
var randomAccount1 = ValidateCodeHelper.MakeCharCode(2).ToLower() + ValidateCodeHelper.MakeNumCode(4).ToLower();
|
2021-09-09 18:08:11 +08:00
|
|
|
|
@* while (m_AccountService.Exist(m => m.Account == randomAccount1))
|
2020-10-07 20:25:03 +08:00
|
|
|
|
{
|
|
|
|
|
|
randomAccount1 = ValidateCodeHelper.MakeCharCode(2).ToLower() + ValidateCodeHelper.MakeNumCode(4).ToLower();
|
2021-09-09 18:08:11 +08:00
|
|
|
|
} *@
|
2020-10-07 20:25:03 +08:00
|
|
|
|
|
|
|
|
|
|
var randomAccountMutil = ValidateCodeHelper.MakeCharCode(3).ToLower();
|
|
|
|
|
|
|
2021-09-09 18:08:11 +08:00
|
|
|
|
@* while (m_AccountService.Exist(m => m.Account.StartsWith(randomAccountMutil)))
|
2020-10-07 20:25:03 +08:00
|
|
|
|
{
|
|
|
|
|
|
randomAccountMutil = ValidateCodeHelper.MakeCharCode(3).ToLower();
|
2021-09-09 18:08:11 +08:00
|
|
|
|
} *@
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
2021-05-08 16:44:55 +08:00
|
|
|
|
<script src="~/js/vue.js"></script>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
$(function () {
|
2020-12-13 12:53:37 +08:00
|
|
|
|
let realverify = {
|
|
|
|
|
|
cookie:document.cookie,
|
|
|
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
async:false,
|
|
|
|
|
|
url: 'http://php-api.juip.com/api/Realname/index',
|
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
|
data: JSON.stringify(realverify),
|
|
|
|
|
|
beforeSend: function(xhr) {
|
|
|
|
|
|
xhr.withCredentials = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
crossDomain: true,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
if (res.Code == -10000) {
|
2020-12-27 17:22:06 +08:00
|
|
|
|
alert('接主管部门要求,会员需要实名认证方可使用该产品,点击确定前往 用户主页、个人信息 实名认证。');
|
2020-12-27 19:06:35 +08:00
|
|
|
|
window.location.href="/User/IndexInfo";
|
2020-12-13 12:53:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2020-10-07 20:25:03 +08:00
|
|
|
|
$(".btnNav").click(function () {
|
|
|
|
|
|
$(".mask").fadeIn();
|
|
|
|
|
|
});
|
|
|
|
|
|
$(".btnClose").click(function () {
|
|
|
|
|
|
$(".mask").fadeOut();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".dan").click(function () {
|
|
|
|
|
|
$(this).addClass("zActive");
|
|
|
|
|
|
$(".pi").removeClass("zActive");
|
|
|
|
|
|
$(".conDan").show();
|
|
|
|
|
|
$(".conPi").hide();
|
|
|
|
|
|
});
|
|
|
|
|
|
$(".pi").click(function () {
|
|
|
|
|
|
$(this).addClass("zActive");
|
|
|
|
|
|
$(".dan").removeClass("zActive");
|
|
|
|
|
|
$(".conDan").hide();
|
|
|
|
|
|
$(".conPi").show();
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<vc:redirecct-login></vc:redirecct-login>
|
|
|
|
|
|
<vc:pay-wait></vc:pay-wait>
|
|
|
|
|
|
<div id="app">
|
|
|
|
|
|
<div class="cpTop">
|
|
|
|
|
|
<p class="choose">当前已选产品:</p>
|
|
|
|
|
|
<div class="kArea">
|
|
|
|
|
|
<div class="cpKuang">
|
|
|
|
|
|
<div class="item">
|
|
|
|
|
|
<p><img src="/@Model.Product.Image"></p>
|
|
|
|
|
|
<p>@Model.Product.Name</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item">
|
|
|
|
|
|
<p class="kaci">@Model.Package.Name</p>
|
|
|
|
|
|
<p class="grayText">@(Model.Package.DayPrice)元/天</p>
|
|
|
|
|
|
<p class="grayText">@Model.Package.Profile</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item">
|
2021-04-13 16:13:46 +08:00
|
|
|
|
@if(Model.Package.Price < 60 && (Model.Package.Id == 64||Model.Package.Id == 1004)){
|
|
|
|
|
|
<span class="price">60.00</span>
|
|
|
|
|
|
} else {
|
|
|
|
|
|
<span class="price">@Model.Package.Price</span>
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="chongxin">
|
|
|
|
|
|
<div class="item redText">
|
|
|
|
|
|
*请确认好所需产品,买错产品换货将产生费用
|
|
|
|
|
|
@if (Model.Package.Name == "天卡")
|
|
|
|
|
|
{
|
|
|
|
|
|
<p class="item redText" style="text-align:center">*天卡不支持退款,请谨慎购买</p>
|
|
|
|
|
|
}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="item">
|
|
|
|
|
|
<button type="button" class="btnBlue" onclick="history.go(-1)">返回重新选择</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row mytab">
|
|
|
|
|
|
<div class="col-sm-6 col-xs-6 text-right">
|
|
|
|
|
|
<span class="dan zActive">单个注册</span>
|
|
|
|
|
|
</div>
|
2021-01-18 17:57:11 +08:00
|
|
|
|
<div v-if="OnePayAmount != 0.1" class="col-sm-6 col-xs-6 text-left">
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<span class="pi">批量注册</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="conDan">
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP账号前缀:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
|
|
|
|
|
<input type="text" v-model="OneBuyModel.Account" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP账号密码:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
|
|
|
|
|
<input type="text" v-model="OneBuyModel.Pwd" v-on:blur="checkOnePwd" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
连接数:
|
|
|
|
|
|
</div>
|
2021-01-18 17:57:11 +08:00
|
|
|
|
<div v-if="OnePayAmount != 0.1" class="col-sm-7 col-xs-7">
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<div class="jiajian">
|
|
|
|
|
|
<div class="item" v-on:click="OneBuyModel.ConnectCount>1&&OneBuyModel.ConnectCount--">
|
|
|
|
|
|
-
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item">
|
|
|
|
|
|
<input type="text" style="width:100%;height:60px;border:0;padding-left:20px" v-model="OneBuyModel.ConnectCount" />
|
|
|
|
|
|
@*<span>{{OneBuyModel.ConnectCount}}</span>*@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item" v-on:click="OneBuyModel.ConnectCount++">
|
|
|
|
|
|
+
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-01-18 17:57:11 +08:00
|
|
|
|
<div v-if="OnePayAmount == 0.1" class="col-sm-7 col-xs-7">
|
|
|
|
|
|
1
|
|
|
|
|
|
</div>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
选择优惠券:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 select">
|
|
|
|
|
|
<select class="chooseYhq" v-model="OneBuyModel.CouponId">
|
|
|
|
|
|
<option value="volvo">选择优惠券</option>
|
|
|
|
|
|
<option v-for="item in Coupons" :value="item.Id">{{item.Name}}</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
余额:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<div class="">
|
|
|
|
|
|
当前账户余额<span class="blueText">@(userEntity.RestAmount)</span>元
|
|
|
|
|
|
<a href="/User/Index">前往充值</a>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row" v-if="showPayType">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
支付方式:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 pay">
|
|
|
|
|
|
<div class="radio" v-on:click="OneBuyModel.OPayType=100">
|
2020-10-12 21:54:19 +08:00
|
|
|
|
<input id="zhifubaopay_s1" name="OPayType" type="radio" v-model="OneBuyModel.OPayType" checked value="100">
|
|
|
|
|
|
<label for="zhifubaopay_s1" class="radio-label"><img src="~/m/img/zfb.png"> 支付宝支付</label>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio" v-on:click="OneBuyModel.OPayType=70">
|
2020-10-12 21:54:19 +08:00
|
|
|
|
<input id="weixinpay_s1" name="OPayType" type="radio" v-model="OneBuyModel.OPayType" value="70">
|
|
|
|
|
|
<label for="weixinpay_s1" class="radio-label"><img src="~/m/img/wx.png"> 微信支付</label>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio" >
|
|
|
|
|
|
<input id="UseAccountAmount" name="OPayType" type="radio" v-model="OneBuyModel.UseAccountAmount" value="1">
|
|
|
|
|
|
<label for="UseAccountAmount" class="radio-label" style="line-height:150%"> 余额支付</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-10-12 18:08:24 +08:00
|
|
|
|
总金额:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<span>{{OneTotalAmount}}</span>元
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-10-12 18:08:24 +08:00
|
|
|
|
<div class="row">
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
应付款:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<span class="yingfu" style="font-size: 35px;font-weight: bold;">{{OnePayAmount}}</span>元
|
2021-04-23 18:17:13 +08:00
|
|
|
|
|
|
|
|
|
|
</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>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
2020-10-12 18:08:24 +08:00
|
|
|
|
</div>
|
2021-04-13 14:37:10 +08:00
|
|
|
|
<p class="grayText songquan">淘宝每次下单获得优惠券</p>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<p class="redText songquan">{{Tip}}</p>
|
|
|
|
|
|
<div class="ok">
|
2020-10-22 09:48:00 +08:00
|
|
|
|
<button type="button" class="btnPay pay-botton" v-on:click="onePay">确认支付</button>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="conPi">
|
|
|
|
|
|
<p class="shuoming">批量注册的账号会使用【账号前缀】+【开始数】+【个数】顺序进行注册,</p>
|
2021-03-19 18:28:09 +08:00
|
|
|
|
<p class="shuoming">如:注册账号前缀为【user】开始数为【2】个数为【10】,则注册的账号为:user2,user3,user4,....user11</p>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP账号前缀:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
2021-03-19 18:35:53 +08:00
|
|
|
|
<input type="text" v-on:input="changeAccountCount()" v-model="MoreBuyModel.Account" />
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP开始号:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
2021-03-19 18:28:09 +08:00
|
|
|
|
<input type="number" v-on:input="changeAccountCount()" v-model="MoreBuyModel.MinPostfix" />
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP注册个数:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
2021-03-19 18:28:09 +08:00
|
|
|
|
<input type="number" v-on:input="changeAccountCount()" v-model="MoreBuyModel.MaxPostfix" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
即将生成的账号:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
|
|
|
|
|
<p class="jinggao">{{acount_list}}</p>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
2020-11-30 13:56:19 +08:00
|
|
|
|
IP账号密码:
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 shuru">
|
|
|
|
|
|
<input type="text" v-model="MoreBuyModel.Pwd" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
连接数:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
<div class="jiajian">
|
|
|
|
|
|
<div class="item" @@click="MoreBuyModel.ConnectCount>1&&MoreBuyModel.ConnectCount--">
|
|
|
|
|
|
-
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item">
|
|
|
|
|
|
<input type="text" style="width:100%;height:60px;border:0;padding-left:20px" v-model="MoreBuyModel.ConnectCount" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="item" @@click="MoreBuyModel.ConnectCount++">
|
|
|
|
|
|
+
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
@*<span class="quanxian">超过10个请联系客服开通</span>*@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
选择优惠券:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 select">
|
|
|
|
|
|
<select class="chooseYhq" v-model="MoreBuyModel.CouponId">
|
|
|
|
|
|
<option value="volvo">选择优惠券</option>
|
|
|
|
|
|
<option v-for="item in Coupons" :value="item.Id">{{item.Name}}</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
余额:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<div class="">
|
|
|
|
|
|
当前账户余额<span class="blueText">@(userEntity.RestAmount)</span>元
|
|
|
|
|
|
<a href="/User/Index">前往充值</a>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row" v-if="showPayType">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
支付方式:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7 pay">
|
|
|
|
|
|
<div class="radio" v-on:click="MoreBuyModel.OPayType=100">
|
2020-10-12 21:54:19 +08:00
|
|
|
|
<input id="zhifubaopay_s" name="radio" type="radio" value="100" checked v-model="MoreBuyModel.OPayType">
|
|
|
|
|
|
<label for="zhifubaopay_s" class="radio-label"><img src="~/m/img/zfb.png"> 支付宝支付</label>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio" v-on:click="MoreBuyModel.OPayType=70">
|
2020-10-12 21:54:19 +08:00
|
|
|
|
<input id="weixinpay_s" name="radio" type="radio" value="70" v-model="MoreBuyModel.OPayType">
|
|
|
|
|
|
<label for="weixinpay_s" class="radio-label"><img src="~/m/img/wx.png"> 微信支付</label>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio" >
|
|
|
|
|
|
<input id="UseAccountAmount_s" name="radio" type="radio" v-model="MoreBuyModel.UseAccountAmount" value="1">
|
|
|
|
|
|
<label for="UseAccountAmount_s" class="radio-label" style="line-height:150%"> 余额支付</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
总金额:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<span>{{MoreTotalAmount}}</span>元
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-5 col-xs-5">
|
|
|
|
|
|
应付款:
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-7 col-xs-7">
|
|
|
|
|
|
<span class="yingfu">{{MorePayAmount}}</span>元
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-04-23 18:17:13 +08:00
|
|
|
|
<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>
|
2021-04-13 14:37:10 +08:00
|
|
|
|
<p class="grayText songquan">淘宝每次下单获得优惠券</p>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
<p class="redText songquan">{{Tip}}</p>
|
|
|
|
|
|
<div class="ok">
|
2020-10-22 09:48:00 +08:00
|
|
|
|
<button type="button" class="btnPay pay-botton" @@click="morePay">确认支付</button>
|
2020-10-07 20:25:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 支付弹窗结束 -->
|
|
|
|
|
|
|
|
|
|
|
|
<div id="aliPayBox" style="display:none"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@section Scripts{
|
|
|
|
|
|
<script>
|
|
|
|
|
|
var productId =@(Model.Product.Id);
|
|
|
|
|
|
/** 表单序列化成json字符串的方法 */
|
|
|
|
|
|
function form2JsonString(formId) {
|
|
|
|
|
|
var paramArray = $('#' + formId).serializeArray();
|
|
|
|
|
|
var jsonObj = {};
|
|
|
|
|
|
$(paramArray).each(function () {
|
|
|
|
|
|
jsonObj[this.name] = this.value;
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(jsonObj);
|
|
|
|
|
|
return JSON.stringify(jsonObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var app = new Vue({
|
|
|
|
|
|
el: '#app',
|
|
|
|
|
|
data: {
|
2021-04-23 18:17:13 +08:00
|
|
|
|
auto_discount_text:'',
|
2021-03-19 18:28:09 +08:00
|
|
|
|
acount_list:'',
|
2020-10-07 20:25:03 +08:00
|
|
|
|
showPayType:true,
|
|
|
|
|
|
payHandler:null,
|
|
|
|
|
|
Tip:'',
|
|
|
|
|
|
RestAmount: @(userEntity.RestAmount),
|
|
|
|
|
|
Coupons: [],
|
|
|
|
|
|
SelectCoupon: {},
|
|
|
|
|
|
OrderInfo: {},
|
|
|
|
|
|
OneChecker: {
|
|
|
|
|
|
AccountOk: true,
|
|
|
|
|
|
PwdOk:true
|
|
|
|
|
|
},
|
|
|
|
|
|
MoreChecker: {
|
|
|
|
|
|
AccountOk: true,
|
|
|
|
|
|
PwdOk: true,
|
|
|
|
|
|
Max:10,
|
|
|
|
|
|
},
|
|
|
|
|
|
OneBuyModel: {
|
|
|
|
|
|
Price:@(Model.Package.Price),
|
|
|
|
|
|
PackageId:@(Model.Package.Id),
|
|
|
|
|
|
CouponAmount: 0,
|
|
|
|
|
|
OrderType: 1,
|
|
|
|
|
|
Account: '@(randomAccount1)',
|
|
|
|
|
|
Pwd: '@(randomPwd)',
|
|
|
|
|
|
ConnectCount: 1,
|
|
|
|
|
|
CouponId: 0,
|
|
|
|
|
|
UseAccountAmount: 0,
|
|
|
|
|
|
OPayType: 100,
|
|
|
|
|
|
PayChannel:40,
|
|
|
|
|
|
},
|
|
|
|
|
|
MoreBuyModel: {
|
|
|
|
|
|
Price:@(Model.Package.Price),
|
|
|
|
|
|
PackageId:@(Model.Package.Id),
|
|
|
|
|
|
CouponAmount: 0,
|
|
|
|
|
|
OrderType: 2,
|
|
|
|
|
|
Account: '@(randomAccountMutil)',
|
|
|
|
|
|
Pwd: '@(randomPwd)',
|
|
|
|
|
|
ConnectCount: 1,
|
|
|
|
|
|
CouponId: 0,
|
|
|
|
|
|
UseAccountAmount: 0,
|
|
|
|
|
|
OPayType: 100,
|
|
|
|
|
|
MinPostfix: 1,
|
|
|
|
|
|
MaxPostfix: 1,
|
|
|
|
|
|
PayChannel:40,
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
OneTotalAmount: function () {
|
|
|
|
|
|
var total= this.OneBuyModel.Price * this.OneBuyModel.ConnectCount
|
2021-04-13 16:13:46 +08:00
|
|
|
|
//西瓜极客优惠券
|
|
|
|
|
|
if((@(Model.Package.Id) == 64||@(Model.Package.Id) == 1004) && @(Model.Package.Price)<60){
|
|
|
|
|
|
total = this.OneBuyModel.ConnectCount * 60.00
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return total.toFixed(2);
|
|
|
|
|
|
},
|
|
|
|
|
|
OnePayAmount: function () {
|
|
|
|
|
|
var restAmout = this.OneBuyModel.UseAccountAmount == 1 ?this.RestAmount:0;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
var total = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount - this.OneBuyModel.CouponAmount ;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
total= total < 0 ? 0 : total;
|
2021-04-23 18:17:13 +08:00
|
|
|
|
total = parseFloat(total.toFixed(2));
|
|
|
|
|
|
|
2021-05-11 14:32:34 +08:00
|
|
|
|
|
2021-04-24 15:04:31 +08:00
|
|
|
|
|
|
|
|
|
|
//最低价
|
|
|
|
|
|
var min_cost = @(Model.Package.MinPrice) * this.OneBuyModel.ConnectCount - this.OneBuyModel.CouponAmount;
|
|
|
|
|
|
if(total<min_cost){
|
|
|
|
|
|
total = min_cost;
|
|
|
|
|
|
}
|
2021-04-23 18:17:13 +08:00
|
|
|
|
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return total.toFixed(2);
|
|
|
|
|
|
},
|
|
|
|
|
|
MoreTotalAmount: function () {
|
|
|
|
|
|
var total= this.MoreBuyModel.Price * this.MoreBuyModel.ConnectCount * this.MoreBuyModel.MaxPostfix;
|
2021-04-13 16:13:46 +08:00
|
|
|
|
//西瓜极客优惠券
|
|
|
|
|
|
if((@(Model.Package.Id) == 64||@(Model.Package.Id) == 1004) && @(Model.Package.Price)<60){
|
|
|
|
|
|
total = this.MoreBuyModel.ConnectCount * 60.00 * this.MoreBuyModel.MaxPostfix
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return total.toFixed(2);
|
|
|
|
|
|
},
|
|
|
|
|
|
MorePayAmount: function () {
|
|
|
|
|
|
var restAmout = this.MoreBuyModel.UseAccountAmount == 1 ? this.RestAmount : 0;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
var total = this.MoreBuyModel.Price * this.MoreBuyModel.ConnectCount * this.MoreBuyModel.MaxPostfix - this.MoreBuyModel.CouponAmount ;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
total= total < 0 ? 0 : total;
|
2021-04-23 18:17:13 +08:00
|
|
|
|
total = parseFloat(total.toFixed(2));
|
|
|
|
|
|
|
2021-05-11 14:32:34 +08:00
|
|
|
|
|
2021-04-24 15:04:31 +08:00
|
|
|
|
|
|
|
|
|
|
//最低价
|
|
|
|
|
|
var min_cost = @(Model.Package.MinPrice) * this.MoreBuyModel.ConnectCount * this.MoreBuyModel.MaxPostfix - this.OneBuyModel.CouponAmount;
|
|
|
|
|
|
if(total<min_cost){
|
|
|
|
|
|
total = min_cost;
|
|
|
|
|
|
}
|
2021-05-11 14:32:34 +08:00
|
|
|
|
|
2021-04-23 18:17:13 +08:00
|
|
|
|
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return total.toFixed(2);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
'OneBuyModel.CouponId': { //加引号监听对象里的属性
|
|
|
|
|
|
handler: function (newValue, oldValue) {
|
|
|
|
|
|
var totalAmount = this.OneBuyModel.Price * this.OneBuyModel.ConnectCount;
|
|
|
|
|
|
for (var i = 0; i < this.Coupons.length; i++) {
|
|
|
|
|
|
var item = this.Coupons[i];
|
|
|
|
|
|
if (totalAmount < item.AllowMinAmount) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (item.Id == newValue) {
|
|
|
|
|
|
if (item.CouponType == 1) {//满减
|
|
|
|
|
|
this.OneBuyModel.CouponAmount = item.CouponValue;
|
|
|
|
|
|
} else {
|
2020-10-12 19:37:47 +08:00
|
|
|
|
//亲 请勿非法操作呦^.^ 请按照正常的流程操作 我们后台是有记录滴
|
|
|
|
|
|
if($(".kaci").text() == '天卡'){
|
|
|
|
|
|
this.OneBuyModel.CouponAmount = totalAmount * item.CouponValue * 0.1;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
alert('非天卡无效');
|
|
|
|
|
|
this.OneBuyModel.CouponId = '0';
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
return;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.OneBuyModel.CouponAmount = 0;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
},
|
|
|
|
|
|
'MoreBuyModel.CouponId': { //加引号监听对象里的属性
|
|
|
|
|
|
handler: function (newValue, oldValue) {
|
|
|
|
|
|
var totalAmount = this.MoreBuyModel.Price * this.MoreBuyModel.ConnectCount;
|
|
|
|
|
|
for (var i = 0; i < this.Coupons.length; i++) {
|
|
|
|
|
|
var item = this.Coupons[i];
|
|
|
|
|
|
if (totalAmount < item.AllowMinAmount) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2020-10-12 21:54:19 +08:00
|
|
|
|
|
2020-10-07 20:25:03 +08:00
|
|
|
|
if (item.Id == newValue) {
|
|
|
|
|
|
if (item.CouponType == 1) {//满减
|
|
|
|
|
|
this.MoreBuyModel.CouponAmount = item.CouponValue;
|
|
|
|
|
|
} else {
|
2020-10-12 19:37:47 +08:00
|
|
|
|
//亲 请勿非法操作呦^.^ 请按照正常的流程操作 我们后台是有记录滴
|
|
|
|
|
|
if($(".kaci").text() == '天卡'){
|
|
|
|
|
|
this.MoreBuyModel.CouponAmount = totalAmount * item.CouponValue * 0.1;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
alert('非天卡无效');
|
2020-10-13 10:12:51 +08:00
|
|
|
|
this.MoreBuyModel.CouponId = '0';
|
2020-10-12 19:37:47 +08:00
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
return;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.MoreBuyModel.CouponAmount = 0;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
},
|
|
|
|
|
|
'OneBuyModel.OPayType': { //加引号监听对象里的属性
|
|
|
|
|
|
handler: function (newValue, oldValue) {
|
|
|
|
|
|
var wx = 10;
|
|
|
|
|
|
this.OneBuyModel.UseAccountAmount = false;
|
|
|
|
|
|
if (isWeiXin()) wx = 20;
|
|
|
|
|
|
this.OneBuyModel.PayChannel = newValue == 70 ? wx : 40;
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
},
|
|
|
|
|
|
'MoreBuyModel.OPayType': { //加引号监听对象里的属性
|
|
|
|
|
|
handler: function (newValue, oldValue) {
|
|
|
|
|
|
var wx = 10;
|
|
|
|
|
|
this.MoreBuyModel.UseAccountAmount = false;
|
|
|
|
|
|
if (isWeiXin()) wx = 20;
|
|
|
|
|
|
this.MoreBuyModel.PayChannel = newValue == 70 ? wx : 40;
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted: function () {
|
|
|
|
|
|
if (isWeiXin()) {
|
|
|
|
|
|
this.OneBuyModel.PayChannel = 20;
|
|
|
|
|
|
this.OneBuyModel.OPayType = 70;
|
|
|
|
|
|
this.MoreBuyModel.PayChannel = 20;
|
|
|
|
|
|
this.MoreBuyModel.OPayType = 70;
|
|
|
|
|
|
this.showPayType = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
@if(user != null) {
|
|
|
|
|
|
<text>this.getCoupons()</text>
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
isNum(value) {
|
|
|
|
|
|
return typeof value === 'number' && !isNaN(value);
|
|
|
|
|
|
},
|
|
|
|
|
|
selectFn: function (e) {
|
|
|
|
|
|
console.log(e.target.value) // 选择项的value
|
|
|
|
|
|
},
|
|
|
|
|
|
getCoupons: function () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
var url = '/api/sells/v1/coupon/GetAvailableCoupon';
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.Code == 10000) {
|
|
|
|
|
|
that.Coupons = res.Data.map(m => m.Coupon);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-03-19 18:28:09 +08:00
|
|
|
|
hasNumAndChar(str) {
|
|
|
|
|
|
var zg = /^[0-9a-zA-Z]*$/;
|
|
|
|
|
|
if (!zg.test(str)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-10-07 20:25:03 +08:00
|
|
|
|
checkOneAccount() {
|
2021-03-19 18:28:09 +08:00
|
|
|
|
if (this.OneBuyModel.Account.length > 10 || this.OneBuyModel.Account.length < 5|| !this.hasNumAndChar(this.OneBuyModel.Account)) {
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.OneChecker.AccountOk = false;
|
2021-03-19 18:28:09 +08:00
|
|
|
|
alert('账号长度必须在5-10位,且不能包含特殊字符');
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.OneChecker.AccountOk = true;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
},
|
|
|
|
|
|
checkOnePwd() {
|
2021-03-19 18:28:09 +08:00
|
|
|
|
if (this.OneBuyModel.Pwd.length > 6 || this.OneBuyModel.Pwd.length <1 || !this.hasNumAndChar(this.OneBuyModel.Pwd)) {
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.OneChecker.PwdOk = false;
|
2021-03-19 18:28:09 +08:00
|
|
|
|
alert('密码长度必须在1-6位,且不能包含特殊字符');
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.OneChecker.PwdOk = true;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
},
|
|
|
|
|
|
checkMoreAccount() {
|
2021-03-19 18:28:09 +08:00
|
|
|
|
if (this.MoreBuyModel.Account.length > 10 || this.MoreBuyModel.Account.length < 3|| !this.hasNumAndChar(this.MoreBuyModel.Account)) {
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.MoreChecker.AccountOk = false;
|
2021-03-19 18:28:09 +08:00
|
|
|
|
alert('账号长度必须在5-10位,且不能包含特殊字符');
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.MoreChecker.AccountOk = true;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
},
|
|
|
|
|
|
checkMorePwd() {
|
2021-03-19 18:28:09 +08:00
|
|
|
|
if (this.MoreBuyModel.Pwd.length > 6 || this.MoreBuyModel.Pwd.length < 1 || !this.hasNumAndChar(this.MoreBuyModel.Pwd)) {
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.MoreChecker.PwdOk = false;
|
2021-03-19 18:28:09 +08:00
|
|
|
|
alert('密码长度必须在1-6位,且不能包含特殊字符');
|
2020-10-07 20:25:03 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.MoreChecker.PwdOk = true;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
},
|
|
|
|
|
|
onePay: function () {
|
2020-10-22 09:48:00 +08:00
|
|
|
|
$(".pay-botton").hide();
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.OneBuyModel.ConnectCount = parseInt(this.OneBuyModel.ConnectCount)
|
|
|
|
|
|
if (!this.isNum(this.OneBuyModel.ConnectCount)) return;
|
|
|
|
|
|
if (!this.checkOneAccount() || !this.checkOnePwd()) return;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
|
|
|
|
|
|
if (this.OneBuyModel.UseAccountAmount) {
|
|
|
|
|
|
if (this.RestAmount < this.OnePayAmount){
|
2020-10-08 17:49:50 +08:00
|
|
|
|
alert('余额不足,请充值。您也可以使用微信、支付宝支付。');return;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.RestAmount = this.RestAmount - this.OnePayAmount;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
if (this.OneBuyModel.UseAccountAmount === true) this.OneBuyModel.UseAccountAmount = 1;
|
|
|
|
|
|
if (this.OneBuyModel.UseAccountAmount === false) this.OneBuyModel.UseAccountAmount = 0;
|
|
|
|
|
|
showPayWait();
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
url: '/product/CreateOrder',
|
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
|
data: JSON.stringify(this.OneBuyModel),
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.Code == 10000) {
|
|
|
|
|
|
hidePayWait();
|
|
|
|
|
|
if (res.Data == "00") {
|
2020-11-13 09:39:59 +08:00
|
|
|
|
alert('购买成功');
|
|
|
|
|
|
window.location.href = "/user/myaccounts";
|
2020-10-07 20:25:03 +08:00
|
|
|
|
showPayOk();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
that.payCallback(res.Data)
|
|
|
|
|
|
that.isPay(res.Data.OrderInfo.OrderNo);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//that.Tip = res.Message;
|
|
|
|
|
|
tipPayWait(res.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
morePay: function () {
|
2020-10-22 09:48:00 +08:00
|
|
|
|
$(".pay-botton").hide();
|
2020-10-07 20:25:03 +08:00
|
|
|
|
this.MoreBuyModel.ConnectCount = parseInt(this.MoreBuyModel.ConnectCount)
|
|
|
|
|
|
if (!this.isNum(this.MoreBuyModel.ConnectCount)) return;
|
|
|
|
|
|
if (!this.checkMoreAccount() || !this.checkMorePwd() || this.MoreBuyModel.MaxPostfix>500) return;
|
|
|
|
|
|
var that = this;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
if (this.MoreBuyModel.UseAccountAmount) {
|
|
|
|
|
|
if (this.RestAmount < this.MorePayAmount){
|
2020-10-08 17:49:50 +08:00
|
|
|
|
alert('余额不足,请充值。您也可以使用微信、支付宝支付。');return;
|
2020-10-12 21:54:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.RestAmount = this.RestAmount - this.MorePayAmount;
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.MoreBuyModel.UseAccountAmount === true) this.MoreBuyModel.UseAccountAmount = 1;
|
|
|
|
|
|
if (this.MoreBuyModel.UseAccountAmount === false) this.MoreBuyModel.UseAccountAmount = 0;
|
|
|
|
|
|
showPayWait();
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
url: '/product/CreateOrder',
|
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
|
data: JSON.stringify(this.MoreBuyModel),
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
if (res.Code == 10000) {
|
|
|
|
|
|
hidePayWait();
|
|
|
|
|
|
if (res.Data == "00") {
|
2020-11-13 09:39:59 +08:00
|
|
|
|
alert('购买成功');
|
|
|
|
|
|
window.location.href = "/user/myaccounts";
|
2020-10-07 20:25:03 +08:00
|
|
|
|
showPayOk();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
that.payCallback(res.Data)
|
|
|
|
|
|
that.isPay(res.Data.OrderInfo.OrderNo);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//that.Tip = res.Message;
|
|
|
|
|
|
tipPayWait(res.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
payCallback: function (data) {
|
|
|
|
|
|
this.OrderInfo = data.OrderInfo;
|
|
|
|
|
|
if (!data.PayData) { alert("下单失败");return; }
|
|
|
|
|
|
var payChannel = this.OrderInfo.PayChannel;
|
|
|
|
|
|
if (payChannel == 10) {
|
|
|
|
|
|
this.h5WxPay(data.PayData)
|
|
|
|
|
|
} else if (payChannel == 20) {
|
|
|
|
|
|
this.jsWxPay(data.PayData);
|
|
|
|
|
|
} else if (payChannel == 40) {
|
|
|
|
|
|
this.aliPay(data.PayData);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
h5WxPay(payData) {
|
|
|
|
|
|
window.location.href = payData;
|
|
|
|
|
|
},
|
|
|
|
|
|
jsWxPay(payData) {
|
|
|
|
|
|
WeixinJSBridge.invoke(
|
|
|
|
|
|
'getBrandWCPayRequest',
|
|
|
|
|
|
JSON.parse(payData),
|
|
|
|
|
|
function (res) {
|
|
|
|
|
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
|
|
|
window.location.href = "/User/MyAccounts";
|
|
|
|
|
|
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
alert("支付失败" + res.err_msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
aliPay(payData) {
|
|
|
|
|
|
$("#aliPayBox").html(payData);
|
|
|
|
|
|
//window.location.href = payData;
|
|
|
|
|
|
},
|
|
|
|
|
|
checkAccount: function () {
|
|
|
|
|
|
var account = $("#sAccount").val()
|
|
|
|
|
|
var url = '/api/course/v1/productaccount/ExistAccount?productId=' + productId + '&accounts=' + account;
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.Code != 10000) {
|
|
|
|
|
|
$("#sAccountTip").text(res.Message)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
isPay: function (orderNo) {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
this.payHandler= setInterval(function () {
|
|
|
|
|
|
var url = '/product/IsPay?orderNo=' + orderNo;
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
if (res.Code == 10000 && res.Data ==1) {
|
|
|
|
|
|
clearInterval(that.payHandler);
|
|
|
|
|
|
$(".payMask").hide();
|
|
|
|
|
|
showPayOk();
|
2020-11-13 09:39:59 +08:00
|
|
|
|
alert('购买成功');
|
|
|
|
|
|
window.location.href = "/user/myaccounts";
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}, 3000)
|
|
|
|
|
|
},
|
|
|
|
|
|
close() {
|
|
|
|
|
|
clearInterval(this.payHandler);
|
|
|
|
|
|
$('.payMask').hide();
|
|
|
|
|
|
$('#qrcode').empty();
|
2021-03-19 18:28:09 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeAccountCount() {
|
|
|
|
|
|
this.acount_list = '';
|
|
|
|
|
|
let start_account = this.MoreBuyModel.MinPostfix;
|
|
|
|
|
|
let end_account = this.MoreBuyModel.MaxPostfix;
|
|
|
|
|
|
if(end_account>3){
|
|
|
|
|
|
for(let i = start_account;i<parseInt(start_account)+3;i++){
|
|
|
|
|
|
this.acount_list += this.MoreBuyModel.Account+i+',';
|
|
|
|
|
|
}
|
|
|
|
|
|
this.acount_list = this.acount_list.substr(0,this.acount_list.length - 1);
|
|
|
|
|
|
this.acount_list += '...'+this.MoreBuyModel.Account+(parseInt(start_account)+parseInt(end_account)-1)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
for(let i = start_account;i<parseInt(start_account)+parseInt(end_account);i++){
|
|
|
|
|
|
this.acount_list += this.MoreBuyModel.Account+i+',';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.acount_list = this.acount_list.substr(0,this.acount_list.length - 1);
|
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
function checkAccount() {
|
|
|
|
|
|
var account = $("#sAccount").val()
|
|
|
|
|
|
var url = '/api/course/v1/productaccount/ExistAccount?productId=' + productId+ '&accounts=' + account;
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'GET',
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.Code != 10000) {
|
|
|
|
|
|
$("#sAccountTip").text(res.Message)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
}
|