初始提交

This commit is contained in:
wanyongkang
2020-10-07 20:25:03 +08:00
commit d318014316
3809 changed files with 263103 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
@using Home.Models
@model UserHomeModel
@{
Layout = "_Layout";
}
<div class="loginArea">
<div class="loginTop">
<p> <img src="~/m/img/logoBlue.png"></p>
<p class="logoTit">找回密码</p>
</div>
<div class="loginCenter">
<p><img src="~/m/img/phone.png"><input type="text" name="" id="username" value="" placeholder="手机号" /></p>
<p><img src="~/m/img/password.png"><input type="text" name="" id="password" value="" placeholder="密码" /></p>
<p class="yzm"><img src="~/m/img/yanzhengma.png"><input type="text" name="" id="yanzhengma" value="" placeholder="验证码" /><button type="button" class="btnBlue" onclick="getCode(this)">获取验证码</button></p>
</div>
<p><button type="button" class="btnLogin" onclick="reg()">找回密码</button></p>
<p class="tixing">*手机号不是PPTP账号请登录后开通PPTP账号*</p>
<p class="bianjie">已有账号?<a asp-action="WebLogin" asp-controller="User">立即登录</a></p>
</div>
<script>
var time = 60;
function getCode(_self) {
var name = $("#username").val()
if(name == '') { alert('手机号不能为空'); return; }
if (!timing(_self)) return;
var url = '/User/SendPhoneCode?key=FindUser_Code&phone=' + name;
$.ajax({
type: 'GET',
url: url,
success: function (res) {
alert(res.Message)
//if (res.Code == 10000) {
// alert(res.Message)
//}
}
});
}
function timing(_self) {
if (time != 60) return false
var timerHandler = setInterval(function () {
time--;
if (time <= 1) {
clearInterval(timerHandler);
time = 60;
$(_self).text("获取验证码")
} else {
$(_self).text(time + "s");
}
}, 1000)
return true;
}
function reg() {
var name = $("#username").val()
var pwd = $("#password").val()
var code = $("#yanzhengma").val()
if (name == '') { alert('手机号不能为空'); return; }
if (code == '') { alert('验证码不能为空'); return; }
var data = { Phone: name, Pwd: pwd, Code: code };
$.ajax({
type: 'POST',
url: '/User/FindPwd',
contentType: "application/json",
data: JSON.stringify(data),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
alert("密码重置成功,请重新登录")
window.location.href="/User/WebLogin"
} else {
alert(res.Message)
}
}
});
}
</script>

View File

@@ -0,0 +1,19 @@
@using Home.Models
@using Hncore.Pass.BaseInfo.Response
@model UserHomeModel
@{
Layout = "_Layout";
}
<vc:redirecct-login></vc:redirecct-login>
<div class="ptop">
<a class="pname">@Model.UserModel.LoginCode</a>
</div>
<ul class="plist">
<li><img src="~/m/img/p1.png"><a asp-action="indexInfo" asp-controller="user">个人信息<img src="~/m/img/arrow.png"></a></li>
<li><img src="~/m/img/p1.png"><a asp-action="myorders" asp-controller="user">我的订单<img src="~/m/img/arrow.png"></a></li>
<li><img src="~/m/img/p2.png"><a asp-action="myrefundorders" asp-controller="user">退货订单<img src="~/m/img/arrow.png"></a></li>
<li><img src="~/m/img/p3.png"><a asp-action="myaccounts" asp-controller="user">PPTP账号管理<img src="~/m/img/arrow.png"></a></li>
<li><img src="~/m/img/p4.png"><a asp-action="mycoupons" asp-controller="user">我的优惠券<img src="~/m/img/arrow.png"></a></li>
</ul>

View File

@@ -0,0 +1,361 @@
@using Home.Models
@using Hncore.Pass.BaseInfo.Response
@model UserHomeModel
@{
Layout = "_Layout";
}
<style type="text/css">
body {
background: #f5f5f5;
}
.msg {
margin-top: 1.466666rem;
}
.lineBar {
background: #3c5eb5;
width: 5px;
height: 30px;
display: inline-block;
vertical-align: middle;
margin-right: 10px;
}
.accout_tit {
height: 1.2rem;
line-height: 1.2rem;
border-bottom: 1px solid #eee;
font-size: 30px;
}
.model {
display: flex;
flex-direction: row;
width: 100%;
height: 0.933333rem;
line-height: 0.933333rem;
background: #fff;
flex-wrap: wrap;
height: auto;
}
.model .item {
border-bottom: 1px solid #f5f5f5;
height: 0.933333rem;
line-height: 0.933333rem;
}
.model .item:nth-child(odd) {
width: 30%;
text-align: right;
}
.model .item:nth-child(even) {
width: 70%;
text-align: center;
color: #ccc;
}
.red {
color: red;
}
.inputBox {
width: 330px;
}
</style>
<vc:redirecct-login></vc:redirecct-login>
<div class="container msg">
<!-- 账户信息 -->
<div class="accout_tit"><span class="lineBar"></span>账户信息 <button class="btnXq" onclick="$('#infoBox').show()">完善信息</button> <button class="btnXq" onclick="$('#pwdBox').show()">修改密码</button></div>
<div class="model">
<div class="item">
用户名:
</div>
<div class="item">
@(Model.UserModel.Phone??Model.UserModel.LoginCode)
</div>
<div class="item">
密码:
</div>
<div class="item">
<span>********</span>
</div>
<div class="item">
QQ
</div>
<div class="item">
@(Model.UserModel.QQ??"--")
</div>
<div class="item">
微信号:
</div>
<div class="item">
@(Model.UserModel.Wx??"--")
</div>
<div class="item">
淘宝会员名:
</div>
<div class="item">
@(Model.UserModel.TaoBao??"--")
</div>
<div class="item">
邮箱:
</div>
<div class="item">
@(Model.UserModel.Email??"--")
</div>
</div>
<!-- 余额 -->
<div class="accout_tit"><span class="lineBar"></span>余额 <button class="btnXq" onclick="$('#chargeBox').show()">充值</button></div>
<div class="model">
<div class="item">
余额:
</div>
<div class="item">
@Model.UserModel.RestAmount
</div>
</div>
<!-- pptv账号 -->
<div class="accout_tit"><span class="lineBar"></span>PPTV账号</div>
<div class="model">
<div class="item">
使用中:
</div>
<div class="item">
@(Model.AccountModel.TotalCount-Model.AccountModel.ExpriedCount)
</div>
<div class="item">
总个数:
</div>
<div class="item">
@Model.AccountModel.TotalCount
</div>
<div class="item">
已过期:
</div>
<div class="item">
@Model.AccountModel.ExpriedCount
</div>
</div>
<!-- 消费信息 -->
<div class="accout_tit"><span class="lineBar"></span>消费信息</div>
<div class="model">
<div class="item">
今日消费:
</div>
<div class="item">
@Model.Statistic.TodayExpend
</div>
<div class="item">
今日退款:
</div>
<div class="item">
@Model.Statistic.TodayRefund
</div>
<div class="item">
今日充值:
</div>
<div class="item">
@Model.Statistic.TodayCharege
</div>
<div class="item">
当月消费:
</div>
<div class="item">
@Model.Statistic.MonthExpend
</div>
<div class="item">
当月退款:
</div>
<div class="item">
@Model.Statistic.MonthRefund
</div>
<div class="item">
当月充值:
</div>
<div class="item">
@Model.Statistic.MonthCharege
</div>
<div class="item">
本年消费:
</div>
<div class="item">
@Model.Statistic.YearExpend
</div>
</div>
</div>
<!-- 修改个人详情 -->
<div class="layerTable" id="infoBox">
<form asp-action="UpdateInfo" asp-controller="User" method="post">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>QQ</td>
<td><input type="text" name="QQ" value="@(Model.UserModel.QQ)" /></td>
</tr>
<tr>
<td>微信号:</td>
<td><input type="text" name="Wx" value="@(Model.UserModel.Wx)" /></td>
</tr>
<tr>
<td>淘宝会员名:</td>
<td><input type="text" name="TaoBao" value="@(Model.UserModel.TaoBao)" /></td>
</tr>
<tr>
<td>邮箱:</td>
<td><input type="text" name="Email" value="@(Model.UserModel.Email)" /></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#infoBox').hide()">返回</button>
<button type="submit" class="btnXq">确定</button>
</div>
</form>
</div>
<!-- 修改密码 -->
<div class="layerTable" id="pwdBox">
<form id="pwdForm">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>原密码:</td>
<td><input type="text" class="inputBox" name="OldPwd" /></td>
</tr>
<tr>
<td>新密码:</td>
<td><input type="text" class="inputBox" name="NewPwd" /></td>
</tr>
<tr>
<td>确认新密码:</td>
<td><input type="text" class="inputBox" name="ConfirmPwd" /></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#pwdBox').hide()">返回</button>
<button type="button" class="btnXq" onclick="updatePwd()">确定</button>
</div>
</form>
</div>
<!-- 充值 -->
<div class="layerTable" id="chargeBox">
<form id="pwdForm">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>充值金额:</td>
<td><input type="number" class="inputBox" id="orderAmount" value="100" /></td>
</tr>
<tr>
<td>支付方式:</td>
<td>
<input type="radio" name="PayChannel" value="40" checked> <img src="~/img/zfb.png">支付宝支付<br />
<input type="radio" name="PayChannel" value="10"> <img src="~/img/wx.png">微信支付
</td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#chargeBox').hide()">返回</button>
<button type="button" class="btnXq" onclick="charge()">确定</button>
</div>
</form>
</div>
<!-- 支付弹窗 -->
<div id="aliPayBox" style="display:none"></div>
<script>
/** 表单序列化成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);
}
function updatePwd() {
var that = this;
$.ajax({
type: 'POST',
url: '/user/UpdatePwd',
dataType: "json",
contentType: "application/json",
data: form2JsonString("pwdForm"),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
$("#pwdBox").hide();
} else {
alert(res.Message)
}
}
});
}
function h5WxPay(payData) {
window.location.href = payData;
}
function jsWxPay(payData) {
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
JSON.parse(payData),
function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
window.location.href = "/User/indexInfo";
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
} else {
alert("支付失败" + res.err_msg);
}
});
}
function aliPay(payData) {
$("#aliPayBox").html(payData);
}
function payCallback(data) {
var orderInfo = data.OrderInfo;
if (!data.PayData) { alert("下单失败"); return; }
var payChannel = orderInfo.PayChannel;
if (payChannel == 10) {
h5WxPay(data.PayData)
} else if (payChannel == 20) {
jsWxPay(data.PayData);
} else if (payChannel == 40) {
aliPay(data.PayData);
}
}
function charge() {
var chargeData = {
ChargeAmount: $('#orderAmount').val(),
PayChannel: $('input[name="PayChannel"]:checked').val()
}
if (isWeiXin()) {
chargeData.PayChannel = 20;
}
$.ajax({
type: 'POST',
url: '/user/CreateOrder',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(chargeData),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
payCallback(res.Data)
} else {
alert(res.Message);
}
}
});
}
</script>

View File

@@ -0,0 +1,73 @@
@using Home.Models
@using Microsoft.Extensions.Configuration
@using Hncore.Infrastructure.Extension
@inject IConfiguration m_Configuration
@model UserHomeModel
@{
Layout = "_Layout";
var BaseUrl = m_Configuration["Service_BaseUrl"];
var WxAppId = m_Configuration["WxApps:AppID"];
}
<div class="loginArea">
<div class="loginTop">
<p> <img src="~/m/img/logoBlue.png"></p>
<p class="logoTit">用户登录</p>
<p><span class="xinyonghu">新用户免费赠送3次测试机会</span></p>
</div>
<div class="loginCenter">
<p><img src="~/m/img/phone.png"><input type="text" name="" id="rLogin_Name" value="" placeholder="会员手机号" /></p>
<p><img src="~/m/img/password.png"><input type="password" name="" id="rLogin_Pwd" value="" placeholder="密码" /></p>
</div>
<p>@*<span><input type="checkbox" name="" id="" value="" />自动登录</span>*@<span class="pull-right"><a asp-action="FindPwd" asp-controller="User">忘记密码?</a></span></p>
<p class="denglu"><button type="button" class="btnLogin" onclick="login()">登录</button></p>
<p class="tixing">*手机号不是PPTP账号请登录后开通PPTP账号*</p>
<p class="bianjie">还没有账号?<a asp-action="Regist" asp-controller="User">立即注册</a></p>
</div>
<script>
var redirect = "@ViewBag.redirect" || "/user/index";
function isWeiXin() {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/micromessenger/i) == 'micromessenger') {
return true;
} else {
return false;
}
}
function login() {
var name = $("#rLogin_Name").val()
var pwd = $("#rLogin_Pwd").val()
var data = { Logincode: name, Password: pwd, Code: 1 };
$.ajax({
type: 'POST',
url: '/user/login',
contentType: "application/json",
data: JSON.stringify(data),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
loginSuccess(res.Data.User)
} else {
alert(res.Message)
}
}
});
}
function loginSuccess(user) {
if (!isWeiXin()) {
window.location.href = redirect;
return;
}
window.location.href = "@(BaseUrl)User/MP_GetUserInfo?appid=@WxAppId&callbakUrl=" + redirect + "&state=" + user.Id;
//if (!user.OpenId) {
//} else {
// window.location.href = "/User/Index";
//}
}
</script>

View File

@@ -0,0 +1,518 @@
@using Hncore.Infrastructure.Data
@using Hncore.Pass.Vpn.Domain
@using Hncore.Infrastructure.Extension
@using ViewComponents
@model List<ProductAccountEntity>
@{
Layout = "_UserLayout";
}
<div id="app">
@*<div class="qq">
<img src="~/m/img/smile.png"> 为给您带来更好的服务体验请完善QQ号和微信号
</div>*@
<div class="chaxun2">
<input type="text" v-model="searchModel.Keyword" placeholder="账号" /><button type="button" class="btnOrange" v-on:click="search">查询</button>
</div>
<div class="row riqi">
<div class="col-sm-4 col-xs-4">
日期查询:
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="start_date" id="start_date" placeholder="选择开通日期" readonly="readonly" v-model="searchModel.BTime" />
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="end_date" id="end_date" placeholder="选择到期日期" readonly="readonly" v-model="searchModel.ETime" />
</div>
</div>
<div class="row shaixuan">
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.ProductId">
<option value="0">全部产品</option>
<option v-for="item in productWithPackage" :value="item.Product.Id">{{item.Product.Name}}</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.PackageId">
<option value="0">全部套餐</option>
<option v-for="item in packages" :value="item.Id">{{item.Name}}</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<button type="button" class="btnRenzheng"><img src="~/m/img/renzheng.png">老账号认证</button>
</div>
</div>
<table border="0" cellspacing="0" cellpadding="0" class="orderTable">
<tr>
<th><input type="checkbox" name="" id="checkAll" value="" style="width: 0.4rem;height: 0.4rem;" /></th>
<th>套餐</th>
<th>账号</th>
<th>操作</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td><input type="checkbox" class="selectAccount" value="@item.Account" a-pid="@(item.ProductId)" a-connectCount="@item.ConnectCount" a-aType="@item.AccountType" style="width: 0.4rem;height: 0.4rem;" /></td>
<td>@item.ProductName/@item.PackageName</td>
<td>@item.Account</td>
<td>
<button type="button" class="btnXq toDetail"
a-UserCode="@item.UserCode"
a-ProductName="@item.ProductName"
a-PackageName="@item.PackageName"
a-Account="@item.Account"
a-Pwd="@item.Pwd"
a-ConnectCount="@item.ConnectCount"
a-StartTime="@item.StartTime"
a-EndTime="@item.EndTime"
a-RestTime="@item.RestTime">
详情
</button>
<a class="btnXq" asp-action="OnLine" asp-controller="User" asp-route-productId="@item.ProductId" asp-route-account="@item.Account">
<button type="button" class="btnXq" style="margin-top:3px">查看</button>
</a>
</td>
</tr>
}
</table>
@*<div class="fenye" style="margin-top: -210px;margin-bottom: 200px;">
@await Component.InvokeAsync("Pager", new PagerModel() { Total = Model.RowCount, PageIndex = this.Context.Request.GetInt("PageIndex") })
</div>*@
<div class="bottomBar">
<button type="button" class="btnXu btn-rebuy"><img src="~/m/img/xufei.png">续费</button><button type="button" class="btnTui btn-refund"><img src="~/m/img/tui.png">退货</button>
</div>
<!-- 认证弹窗 -->
<div class="renzhengMask">
<div class="renzhenKuang">
<img src="~/m/img/close.png" class="renzhengClose">
<!-- Nav tabs -->
<ul class="nav nav-tabs renzhengTab" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">单个认证</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">批量认证</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="home">
<div class="renzhengModel">
<div class="item">
选择产品
</div>
<div class="item chooseCp">
<select v-model="oneAuthModel.ProductId">
<option v-for="item in productWithPackage" :value="item.Product.Id">{{item.Product.Name}}</option>
</select>
</div>
</div>
<div class="renzhengModel">
<div class="item">
输入账号
</div>
<div class="item renzhengInput">
<input type="text" v-model="oneAuthModel.Account" />
</div>
</div>
<div class="renzhengModel">
<div class="item">
验证密码
</div>
<div class="item renzhengInput">
<input type="text" v-model="oneAuthModel.Pwd" />
</div>
</div>
<p class="btnRz" v-on:click="accountOneAuth">认证账号</p>
</div>
<div role="tabpanel" class="tab-pane" id="profile">
<div class="renzhengModel">
<div class="item">
选择产品
</div>
<div class="item chooseCp">
<select v-model="mutilAuthModel.ProductId">
<option v-for="item in productWithPackage" :value="item.Product.Id">{{item.Product.Name}}</option>
</select>
</div>
</div>
<div class="renzhengModel">
<div class="item">
账号前缀
</div>
<div class="item renzhengInput">
<input type="text" v-model="mutilAuthModel.Account" />
</div>
</div>
<div class="renzhengModel">
<div class="item">
开始数
</div>
<div class="item renzhengInput">
<input type="number" v-model="mutilAuthModel.StartNum" />
</div>
</div>
<div class="renzhengModel">
<div class="item">
认证个数
</div>
<div class="item renzhengInput">
<input type="number" v-model="mutilAuthModel.Count" />
</div>
</div>
<div class="renzhengModel">
<div class="item">
验证密码
</div>
<div class="item renzhengInput">
<input type="text" v-model="mutilAuthModel.Pwd" />
</div>
</div>
<p v-if="mutilAuthLoading" style="margin:8px;color:red;text-align:center">认证中,请耐心等待...</p>
<p class="btnRz" v-on:click="accountMutilAuth">认证账号</p>
</div>
</div>
</div>
</div>
<!-- 弹窗详情 -->
<div class="layerTable">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>用户:</td>
<td>{{currentAccount.UserCode}}</td>
</tr>
<tr>
<td>产品:</td>
<td>{{currentAccount.ProductName}}</td>
</tr>
<tr>
<td>套餐:</td>
<td>{{currentAccount.PackageName}}</td>
</tr>
<tr>
<td>账号:</td>
<td>{{currentAccount.Account}}</td>
</tr>
<tr>
<td>密码:</td>
<td>{{currentAccount.Pwd}}</td>
</tr>
<tr>
<td>连接数:</td>
<td>{{currentAccount.ConnectCount}}</td>
</tr>
<tr>
<td>开通时间:</td>
<td>{{currentAccount.StartTime}}</td>
</tr>
<tr>
<td>到期时间:</td>
<td>{{currentAccount.EndTime}}</td>
</tr>
<tr>
<td>剩余时间:</td>
<td>{{currentAccount.RestTime}}</td>
</tr>
</table>
<div class="back">
<img src="~/m/img/arrowback.png"> 返回列表
</div>
</div>
</div>
<script src="~/m/js/LCalendar.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
mutilAuthLoading: false,
productWithPackage: [],
packages: [],
searchModel: {
ExpiredDay:-1,
ProductId:@this.Context.Request.GetInt("ProductId"),
PackageId:@this.Context.Request.GetInt("PackageId"),
Keyword:'@this.Context.Request.Get("Keyword")',
BTime: '@this.Context.Request.Get("BTime")',
ETime: '@this.Context.Request.Get("ETime")',
},
oneAuthModel: {
ProductId: 0,
Account: "",
Pwd:""
},
mutilAuthModel: {
ProductId: 0,
Account: "",
Pwd: "",
StartNum: 0,
Count:0
},
currentAccount: {
UserCode: "",
ProductName: "",
PackageName: "",
Account: "",
Pwd: "",
ConnectCount: "",
StartTime: "",
EndTime: "",
RestTime: "",
}
},
computed: {
},
watch: {
'searchModel.ProductId': { //加引号监听对象里的属性
handler: function (newValue, oldValue) {
for (var i = 0; i < this.productWithPackage.length; i++) {
var item = this.productWithPackage[i];
if (item.Product.Id == newValue) {
this.packages = item.Packages
return;
}
}
},
immediate: true
}
},
mounted: function () {
this.getProducts();
},
methods: {
initPackages: function () {
var productId = this.searchModel.ProductId;
if (productId == 0) return;
for (var i = 0; i < this.productWithPackage.length; i++) {
var item = this.productWithPackage[i];
if (item.Product.Id == productId) {
this.packages = item.Packages
return;
}
}
},
getProducts() {
var that = this;
$.ajax({
type: 'GET',
url: '/api/course/v1/product/ProductWithPackage',
success: function (res) {
if (res.Code == 10000) {
that.productWithPackage = res.Data;
that.initPackages();
}
}
});
},
search() {
var ps = [];
for (var item in this.searchModel) {
var p = item + "=" + this.searchModel[item];
ps.push(p);
}
window.location.href = "?" + ps.join("&");
},
accountOneAuth() {
if (this.oneAuthModel.ProductId ==0) {
alert('请选择产品')
return;
}
if (this.oneAuthModel.Account == '' || this.oneAuthModel.Pwd == '') {
alert('账号和密码不能为空')
return;
}
$.ajax({
type: 'POST',
url: '/user/OrginAccountAuth',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(this.oneAuthModel),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
alert('认证成功')
window.location.reload();
} else {
alert(res.Message)
}
}
});
},
accountMutilAuth() {
if (this.mutilAuthModel.ProductId == 0) {
alert('请选择产品')
return;
}
if (this.mutilAuthModel.Account == '' || this.mutilAuthModel.Pwd == '') {
alert('账号和密码不能为空')
return;
}
if (this.mutilAuthLoading) return;
this.mutilAuthLoading = true;
var that = this;
$.ajax({
type: 'POST',
url: '/user/OrginAccountAuth',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(this.mutilAuthModel),
success: function (res) {
that.mutilAuthLoading = false;
console.log(res);
if (res.Code == 10000) {
alert('认证成功')
window.location.reload();
} else {
alert(res.Message)
}
}
});
},
setAccountInfo(info) {
this.currentAccount = info;
}
}
})
function showDetail(_self) {
var currentOrder = {
UserCode: $(_self).attr('a-UserCode'),
ProductName: $(_self).attr('a-ProductName'),
PackageName: $(_self).attr('a-PackageName'),
Account: $(_self).attr('a-Account'),
Pwd: $(_self).attr('a-Pwd'),
ConnectCount: $(_self).attr('a-ConnectCount'),
StartTime: $(_self).attr('a-StartTime'),
EndTime: $(_self).attr('a-EndTime'),
RestTime: $(_self).attr('a-RestTime'),
}
app.setAccountInfo(currentOrder);
$(_self).show();
}
$(function () {
//退款
function caclRefund(account,refundFun) {
$.ajax({
type: 'GET',
url: '/api/course/v1/order/CaclRefund?account=' + account,
success: function (res) {
if (res.Code == 10000) {
var msg ="剩余:"+res.Data.RefundRestTime+",还需退款:"+ res.Data.RefundAmount+",确定要退款吗?"
if (!confirm(msg)) { return; }
refundFun(account);
} else {
alert(res.Message)
}
}
});
}
function refund(account) {
$.ajax({
type: 'GET',
url: '/api/course/v1/order/Refund?account=' +account,
success: function (res) {
if (res.Code == 10000) {
alert('退款成功')
window.location.reload()
} else {
alert(res.Message)
}
}
});
}
$(".btn-refund").on('click', function () {
var accounts = [];
$.each($('input:checkbox:checked'), function () {
accounts.push($(this).val())
});
if (accounts.length >1) { alert('一次只能退款一个账号'); return; }
if (accounts.length == 0) { alert('请选择账号'); return; }
caclRefund(accounts[0],refund)
})
function isSame(data, property) {
if (data.length == 0) return true;
var first = data[0];
for (var i = 1; i < data.length; i++) {
var item = data[i];
if (first[property] != item[property])
return false;
}
return true;
}
//续费
$(".btn-rebuy").on('click', function () {
var accounts = [];
var accountModels = [];
var isTest = false
$.each($('input:checkbox:checked'), function () {
var account = $(this).val();
if (account) {
var accountItem = {
account: account,
pid: $(this).attr('a-pid'),
connectCount: $(this).attr('a-connectCount'),
isTest: $(this).attr('a-aType') == 200
}
accountModels.push(accountItem)
accounts.push(account)
if (accountItem.isTest) isTest = true;
}
});
if (accountModels.length == 0) { alert('请选择账号'); return; }
if (!isSame(accountModels, 'pid')) { alert('必须选择相同的产品'); return; }
if (!isSame(accountModels, 'connectCount')) { alert('必须选择相同的连接数'); return; }
if (isTest) { alert('测试账号暂不支持续费,请新开正式账号'); return; }
window.location.href = "/product/rebuyindex?productId=" + accountModels[0].pid + "&accounts=" + accounts.join(",");
})
$(".toDetail").click(function () {
showDetail($(this))
$(".layerTable").show();
});
$(".back").click(function () {
$(".layerTable").hide();
})
$(".btnRenzheng").click(function () {
$(".renzhengMask").show();
});
$(".renzhengClose").click(function () {
$(".renzhengMask").hide();
});
$("#checkAll").on('click', function () {
console.log($(this).prop("checked"), "check")
$("td > input:checkbox").prop("checked", $(this).prop("checked"))
})
});
</script>
<script type="text/javascript">
var calendar = new LCalendar();
calendar.init({
'trigger': '#start_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
var calendar = new LCalendar();
calendar.init({
'trigger': '#end_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
</script>

View File

@@ -0,0 +1,68 @@
@using Hncore.Pass.Sells.Model
@model List<UserCouponModel>
@{
Layout = "_UserLayout";
Func<UserCouponModel, string> format = (item) =>
{
if (item.IsExpired) return "已过期";
if (item.IsUsed) return "已使用";
return "可使用";
};
}
<div class="kong">
</div>
@foreach (var item in Model)
{
<div class="yhq">
@if (item.Coupon.CouponType == ECouponType.Discount)
{
<div class="item">
<span class="jiage">@(item.Coupon.CouponValue)折</span> <span class="zhuangtai">@format(item)</span>
</div>
}
@if (item.Coupon.CouponType == ECouponType.Minus)
{
<div class="item">
<span class="jiage">¥@(item.Coupon.CouponValue)</span><span class="zhuangtai">@format(item)</span>
</div>
}
<div class="item">
<p>@item.Coupon.Name</p>
<p>使用规则:<span>@(item.Coupon.AllowMinAmount > 0 ? $"满{item.Coupon.AllowMinAmount}元可用" : "无限制")</span></p>
<p>有效时间:<span>@(item.Orgin.StartTime.Value.ToString("yyyy.MM.dd"))至@(item.Orgin.EndTime.Value.ToString("yyyy.MM.dd"))</span></p>
<p>获取途径:<span>@(item.Orgin.Remark)</span></p>
</div>
</div>
}
@*<div class="yhq">
<div class="item">
<span class="jiage">¥6</span><span class="zhuangtai">可使用</span>
</div>
<div class="item">
<p>优惠券名称</p>
<p>使用规则:<span>无限制</span></p>
<p>有效时间:<span>2020.1.1至2020.3.1</span></p>
<p>获取途径:<span>淘宝下单赠送</span></p>
</div>
</div>
<div class="yhq gray">
<div class="item">
<span class="jiage">¥6</span><span class="zhuangtai">已使用</span>
</div>
<div class="item">
<p>优惠券名称</p>
<p>使用规则:<span>无限制</span></p>
<p>有效时间:<span>2020.1.1至2020.3.1</span></p>
<p>获取途径:<span>淘宝下单赠送</span></p>
</div>
</div>*@

View File

@@ -0,0 +1,281 @@
@using Hncore.Infrastructure.Data
@using Hncore.Pass.Vpn.Domain
@using Hncore.Infrastructure.Extension
@using ViewComponents
@model PageData<ProductOrderEntity>
@{
Layout = "_UserLayout";
Func<string, string> cut = word =>
{
if (word.Length > 15)
return word.Substring(0, 15) + "...";
return word;
};
}
<div id="app">
<form asp-action="myorders" asp-controller="user" method="get">
<div class="chaxun2">
<input type="text" v-model="searchModel.KeyWord" /><button type="button" class="btnOrange" v-on:click="search">查询</button>
</div>
<div class="row riqi">
<div class="col-sm-4 col-xs-4">
日期查询:
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="start_date" id="start_date" v-model="searchModel.BTime" placeholder="选择开始日期" readonly="readonly" />
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="end_date" id="end_date" v-model="searchModel.ETime" placeholder="选择结束日期" readonly="readonly" />
</div>
</div>
<div class="row shaixuan">
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.OrderType">
<option value="0">全部类型</option>
<option value="1">新开</option>
<option value="2">续费</option>
<option value="3">批量新开</option>
<option value="4">批量续费</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.ProductId">
<option value="0">全部产品</option>
<option v-for="item in productWithPackage" :value="item.Product.Id">{{item.Product.Name}}</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.PackageId">
<option value="0">全部套餐</option>
<option v-for="item in packages" :value="item.Id">{{item.Name}}</option>
</select>
</div>
</div>
</form>
<table border="0" cellspacing="0" cellpadding="0" class="orderTable">
<tr><th>类型</th><th>产品</th><th>套餐</th><th>详情</th></tr>
@foreach (var item in Model.List)
{
<tr>
<td>@item.OrderType.GetEnumDisplayName()</td>
<td>@item.ProductName</td>
<td>@item.PackageName</td>
<td>
<button type="button" class="btnXq toDetail" onclick="showDetail(this)"
a-date="@item.CreateTime.ToString("yyyy.MM.dd")"
a-orderno="@item.OrderNo"
a-ordertype="@item.OrderType.GetEnumDisplayName()"
a-product="@item.ProductName"
a-package="@item.PackageName"
a-price="@item.DayPrice"
a-conncount="@(item.AccountCount*item.ConnectCount)"
a-account="@item.Accounts"
a-orderamount="@item.OrderAmount"
a-couponamount="@item.CouponAmount"
a-payamount="@item.PaymentAmount">
详情
</button>
</td>
</tr>
}
</table>
<div class="fenye">
@await Component.InvokeAsync("Pager", new PagerModel() { Total = Model.RowCount, PageIndex = this.Context.Request.GetInt("PageIndex") })
</div>
<!-- 弹窗详情 -->
<div class="layerTable">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>日期:</td>
<td>{{currentOrder.date}}</td>
</tr>
<tr>
<td>订单编号:</td>
<td>{{currentOrder.orderno}}</td>
</tr>
<tr>
<td>类型:</td>
<td>{{currentOrder.ordertype}}</td>
</tr>
<tr>
<td>产品:</td>
<td>{{currentOrder.product}}</td>
</tr>
<tr>
<td>套餐:</td>
<td>{{currentOrder.package}}</td>
</tr>
<tr>
<td>单价:</td>
<td>{{currentOrder.price}}</td>
</tr>
<tr>
<td>总连接数:</td>
<td>{{currentOrder.conncount}}</td>
</tr>
<tr>
<td>账号:</td>
<td>{{currentOrder.account}}</td>
</tr>
<tr>
<td>订单金额:</td>
<td>{{currentOrder.orderamount}}</td>
</tr>
<tr>
<td>优惠金额:</td>
<td>{{currentOrder.couponamount}}</td>
</tr>
<tr>
<td>实付金额:</td>
<td>{{currentOrder.payamount}}</td>
</tr>
</table>
<div class="back">
<img src="~/m/img/arrowback.png"> 返回列表
</div>
</div>
</div>
<script src="~/m/js/LCalendar.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
productWithPackage: [],
packages: [],
searchModel: {
OrderType:0,
ProductId:@this.Context.Request.GetInt("ProductId"),
PackageId:@this.Context.Request.GetInt("PackageId"),
KeyWord:'',
BTime: '@this.Context.Request.Get("BTime")',
ETime: '@this.Context.Request.Get("ETime")',
},
oneAuthModel: {
ProductId: 0,
Account: "",
Pwd:""
},
mutilAuthModel: {
ProductId: 0,
Account: "",
Pwd: "",
StartNum: 0,
Count:0
},
currentOrder: {
date:"",
orderno:"",
ordertype:"",
product:"",
package:"",
price:"",
conncount:"",
account:"",
orderamount:"",
couponamount:"",
payamount:""
}
},
computed: {
},
watch: {
'searchModel.ProductId': { //加引号监听对象里的属性
handler: function (newValue, oldValue) {
for (var i = 0; i < this.productWithPackage.length; i++) {
var item = this.productWithPackage[i];
if (item.Product.Id == newValue) {
this.packages = item.Packages
return;
}
}
},
immediate: true
}
},
created: function () {
this.getProducts();
},
methods: {
getProducts() {
var that = this;
$.ajax({
type: 'GET',
url: '/api/course/v1/product/ProductWithPackage',
success: function (res) {
if (res.Code == 10000) {
that.productWithPackage = res.Data;
}
}
});
},
search() {
var ps = [];
this.searchModel.BTime = $("#BTime").val();
this.searchModel.ETime = $("#ETime").val();
for (var item in this.searchModel) {
var p = item + "=" + this.searchModel[item];
ps.push(p);
}
window.location.href = "?" + ps.join("&");
},
setOrderInfo(info) {
this.currentOrder = info;
}
}
})
function showDetail(_self) {
var currentOrder = {
date: $(_self).attr('a-date'),
orderno: $(_self).attr('a-orderno'),
ordertype: $(_self).attr('a-ordertype'),
product: $(_self).attr('a-product'),
package: $(_self).attr('a-package'),
price: $(_self).attr('a-price'),
conncount: $(_self).attr('a-conncount'),
account: $(_self).attr('a-account'),
orderamount: $(_self).attr('a-orderamount'),
couponamount: $(_self).attr('a-couponamount'),
payamount: $(_self).attr('a-payamount'),
}
app.setOrderInfo(currentOrder);
$(_self).show();
}
</script>
<script type="text/javascript">
var calendar = new LCalendar();
calendar.init({
'trigger': '#start_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
var calendar = new LCalendar();
calendar.init({
'trigger': '#end_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
$(".toDetail").click(function () {
showDetail($(this))
$(".layerTable").show();
});
$(".back").click(function () {
$(".layerTable").hide();
})
</script>

View File

@@ -0,0 +1,271 @@
@using Hncore.Infrastructure.Data
@using Hncore.Pass.Vpn.Domain
@using Hncore.Infrastructure.Extension
@using ViewComponents
@model PageData<ProductOrderEntity>
@{
Layout = "_UserLayout";
}
<div id="app">
<form asp-action="myorders" asp-controller="user" method="get">
<div class="chaxun2">
<input type="text" v-model="searchModel.KeyWord" /><button type="button" class="btnOrange" v-on:click="search">查询</button>
</div>
<div class="row riqi">
<div class="col-sm-4 col-xs-4">
日期查询:
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="start_date" id="start_date" v-model="searchModel.BTime" placeholder="选择开始日期" readonly="readonly" />
</div>
<div class="col-sm-4 col-xs-4">
<input type="text" name="end_date" id="end_date" v-model="searchModel.ETime" placeholder="选择结束日期" readonly="readonly" />
</div>
</div>
<div class="row shaixuan">
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.OrderType">
<option value="0">全部类型</option>
<option value="1">新开</option>
<option value="2">续费</option>
<option value="3">批量新开</option>
<option value="4">批量续费</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.ProductId">
<option value="0">全部产品</option>
<option v-for="item in productWithPackage" :value="item.Product.Id">{{item.Product.Name}}</option>
</select>
</div>
<div class="col-sm-4 col-xs-4">
<select v-model="searchModel.PackageId">
<option value="0">全部套餐</option>
<option v-for="item in packages" :value="item.Id">{{item.Name}}</option>
</select>
</div>
</div>
</form>
<table border="0" cellspacing="0" cellpadding="0" class="orderTable">
<tr><th>类型</th><th>产品</th><th>套餐</th><th>详情</th></tr>
@foreach (var item in Model.List)
{
<tr>
<td>@item.OrderType.GetEnumDisplayName()</td>
<td>@item.ProductName</td>
<td>@item.PackageName</td>
<td>
<button type="button" class="btnXq toDetail" onclick="showDetail(this)"
a-date="@item.CreateTime.ToString("yyyy.MM.dd")"
a-orderno="@item.OrderNo"
a-ordertype="@item.OrderType.GetEnumDisplayName()"
a-product="@item.ProductName"
a-package="@item.PackageName"
a-price="@item.DayPrice"
a-dayprice="@item.DayPrice"
a-conncount="@(item.AccountCount*item.ConnectCount)"
a-account="@item.Accounts"
a-orderamount="@item.OrderAmount"
a-refundamount="@item.RefundAmount"
a-payamount="@item.PaymentAmount"
a-refundresttime="@item.RefundRestTime">
详情
</button>
</td>
</tr>
}
</table>
<div class="fenye">
@await Component.InvokeAsync("Pager", new PagerModel() { Total = Model.RowCount, PageIndex = this.Context.Request.GetInt("PageIndex") })
</div>
<!-- 弹窗详情 -->
<div class="layerTable">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>日期:</td>
<td>{{currentOrder.date}}</td>
</tr>
<tr>
<td>订单编号:</td>
<td>{{currentOrder.orderno}}</td>
</tr>
<tr>
<td>类型:</td>
<td>{{currentOrder.ordertype}}</td>
</tr>
<tr>
<td>产品:</td>
<td>{{currentOrder.product}}</td>
</tr>
<tr>
<td>套餐:</td>
<td>{{currentOrder.package}}</td>
</tr>
<tr>
<td>总连接数:</td>
<td>{{currentOrder.conncount}}</td>
</tr>
<tr>
<td>账号:</td>
<td>{{currentOrder.account}}</td>
</tr>
<tr>
<td>退款单价:</td>
<td>{{currentOrder.dayprice}}</td>
</tr>
<tr>
<td>退款时长:</td>
<td>{{currentOrder.refundresttime}}</td>
</tr>
<tr>
<td>实付金额:</td>
<td>{{currentOrder.paymentamount}}</td>
</tr>
<tr>
<td>退款金额:</td>
<td>{{currentOrder.refundamount}}</td>
</tr>
</table>
<div class="back">
<img src="~/m/img/arrowback.png"> 返回列表
</div>
</div>
</div>
<script src="~/m/js/LCalendar.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
productWithPackage: [],
packages: [],
searchModel: {
OrderType:0,
ProductId:@this.Context.Request.GetInt("ProductId"),
PackageId:@this.Context.Request.GetInt("PackageId"),
KeyWord:'',
BTime: '@this.Context.Request.Get("BTime")',
ETime: '@this.Context.Request.Get("ETime")',
},
oneAuthModel: {
ProductId: 0,
Account: "",
Pwd:""
},
mutilAuthModel: {
ProductId: 0,
Account: "",
Pwd: "",
StartNum: 0,
Count:0
},
currentOrder: {
date:"",
orderno:"",
ordertype:"",
product:"",
package:"",
price:"",
conncount:"",
account:"",
orderamount:"",
couponamount:"",
payamount:""
}
},
computed: {
},
watch: {
'searchModel.ProductId': { //加引号监听对象里的属性
handler: function (newValue, oldValue) {
for (var i = 0; i < this.productWithPackage.length; i++) {
var item = this.productWithPackage[i];
if (item.Product.Id == newValue) {
this.packages = item.Packages
return;
}
}
},
immediate: true
}
},
created: function () {
this.getProducts();
},
methods: {
getProducts() {
var that = this;
$.ajax({
type: 'GET',
url: '/api/course/v1/product/ProductWithPackage',
success: function (res) {
if (res.Code == 10000) {
that.productWithPackage = res.Data;
}
}
});
},
search() {
var ps = [];
this.searchModel.BTime = $("#BTime").val();
this.searchModel.ETime = $("#ETime").val();
for (var item in this.searchModel) {
var p = item + "=" + this.searchModel[item];
ps.push(p);
}
window.location.href = "?" + ps.join("&");
},
setOrderInfo(info) {
this.currentOrder = info;
}
}
})
function showDetail(_self) {
var currentOrder = {
date: $(_self).attr('a-date'),
orderno: $(_self).attr('a-orderno'),
ordertype: $(_self).attr('a-ordertype'),
product: $(_self).attr('a-product'),
package: $(_self).attr('a-package'),
dayprice: $(_self).attr('a-dayprice'),
conncount: $(_self).attr('a-conncount'),
account: $(_self).attr('a-account'),
orderamount: $(_self).attr('a-orderamount'),
couponamount: $(_self).attr('a-couponamount'),
payamount: $(_self).attr('a-payamount'),
refundresttime: $(_self).attr('a-refundresttime'),
payamount: $(_self).attr('a-payamount'),
}
app.setOrderInfo(currentOrder);
$(_self).show();
}
</script>
<script type="text/javascript">
var calendar = new LCalendar();
calendar.init({
'trigger': '#start_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
var calendar = new LCalendar();
calendar.init({
'trigger': '#end_date', //标签id
'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
});
$(".toDetail").click(function () {
showDetail($(this))
$(".layerTable").show();
});
$(".back").click(function () {
$(".layerTable").hide();
})
</script>

View File

@@ -0,0 +1,149 @@
@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;
}
.msg {
margin-top: 1.466666rem;
}
.lineBar {
background: #3c5eb5;
width: 5px;
height: 30px;
display: inline-block;
vertical-align: middle;
margin-right: 10px;
}
.accout_tit {
height: 1.2rem;
line-height: 1.2rem;
border-bottom: 1px solid #eee;
font-size: 30px;
}
.model {
display: flex;
flex-direction: row;
width: 100%;
height: 0.933333rem;
line-height: 0.933333rem;
background: #fff;
flex-wrap: wrap;
height: auto;
}
.model .item {
border-bottom: 1px solid #f5f5f5;
height: 0.933333rem;
line-height: 0.933333rem;
}
.model .item:nth-child(odd) {
width: 30%;
text-align: right;
}
.model .item:nth-child(even) {
width: 70%;
text-align: center;
color: #ccc;
}
.red {
color: red;
}
.inputBox {
width: 330px;
}
</style>
<vc:redirecct-login></vc:redirecct-login>
<div class="container msg">
@if (Model.Count == 0)
{
<div class="red" style="text-align:center">暂无数据</div>
}
@foreach (var item in Model)
{
<div class="accout_tit"><span class="lineBar"></span>#@(Model.IndexOf(item)+1) <button class="btnXq" onclick="killout(@item.Id)">强制离线</button> </div>
<div class="model">
<div class="item">
账号:
</div>
<div class="item">
@item.Account
</div>
<div class="item">
登录时间:
</div>
<div class="item">
@item.LoginTime
</div>
<div class="item">
在线时间:
</div>
<div class="item">
@item.OnlineTime
</div>
<div class="item">
服务器Ip
</div>
<div class="item">
@item.ServerIP
</div>
<div class="item">
登录ip
</div>
<div class="item">
@item.LoginIP
</div>
<div class="item">
上/下行:
</div>
<div class="item">
@item.UpStream / @item.UpStream
</div>
</div>
}
</div>
<script>
/** 表单序列化成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);
}
function killout(productId,id) {
var that = this;
$.ajax({
type: 'GET',
url: '/api/course/v1/productaccount/KillOut?productId=@productId&id=' + id,
success: function (res) {
if (res.Code == 10000) {
alert("操作成功");
window.location.reload();
}
}
});
}
</script>

View File

@@ -0,0 +1,97 @@
@using Home.Models
@using Microsoft.Extensions.Configuration
@using Hncore.Infrastructure.Extension
@inject IConfiguration m_Configuration
@model UserHomeModel
@{
Layout = "_Layout";
var BaseUrl = m_Configuration["Service_BaseUrl"];
var WxAppId = m_Configuration["WxApps:AppID"];
}
<div class="loginArea">
<div class="loginTop">
<p> <img src="~/m/img/logoBlue.png"></p>
<p class="logoTit">用户注册</p>
<p><span class="xinyonghu">新用户免费赠送3次测试机会</span></p>
</div>
<div class="loginCenter">
<p><img src="~/m/img/phone.png"><input type="text" name="" id="username" value="" placeholder="手机号" /></p>
<p><img src="~/m/img/password.png"><input type="password" name="" id="password" value="" placeholder="密码" /></p>
<p class="yzm"><img src="~/m/img/yanzhengma.png"><input type="text" name="" id="yanzhengma" value="" placeholder="验证码" /><button type="button" class="btnBlue" onclick="getCode(this)">获取验证码</button></p>
<p><img src="~/m/img/phone.png"><input type="text" name="" id="wxhao" value="" placeholder="微信号" /></p>
<p><img src="~/m/img/phone.png"><input type="text" name="" id="wxhao" value="" placeholder="QQ号" /></p>
</div>
<p class="xieyi"><input type="checkbox" name="" id="" value="" />我同意<span>《聚IP JUIP.COM用户注册协议》</span></p>
<p><button type="button" class="btnLogin" onclick="reg()">注册</button></p>
<p class="tixing">*手机号不是PPTP账号请登录后开通PPTP账号*</p>
<p class="bianjie">已有账号?<a href="#">立即登录</a></p>
</div>
<script>
var redirect = "@ViewBag.redirect" || "/user/index";
var time = 60;
function getCode(_self) {
var name = $("#username").val()
if(name == '') { alert('手机号不能为空'); return; }
if (!timing(_self)) return;
var url = '/user/SendPhoneCode?key=User_Code&phone=' + name;
$.ajax({
type: 'GET',
url: url,
success: function (res) {
alert(res.Message)
}
});
}
function timing(_self) {
if (time != 60) return false
var timerHandler = setInterval(function () {
time--;
if (time <= 1) {
clearInterval(timerHandler);
time = 60;
$(_self).text("获取验证码")
} else {
$(_self).text(time + "s");
}
}, 1000)
return true;
}
function reg() {
var name = $("#username").val()
var pwd = $("#password").val()
var code = $("#yanzhengma").val()
if (name == '') { alert('手机号不能为空'); return; }
if (code == '') { alert('验证码不能为空'); return; }
var wx = $("#wxhao").val()
var qq = $("#qqhao").val()
var data = { Phone: name, Pwd: pwd, Code: code, Wx: wx, QQ: qq };
$.ajax({
type: 'POST',
url: '/user/Regist',
contentType: "application/json",
data: JSON.stringify(data),
success: function (res) {
console.log(res);
if (res.Code == 10000) {
loginSuccess(res.Data.User)
} else {
alert(res.Message)
}
}
});
}
function loginSuccess(user) {
if (!isWeiXin()) {
window.location.href = redirect;
return;
}
if (!user.OpenId) {
window.location.href = "@(BaseUrl)User/MP_GetUserInfo?appid=@WxAppId&callbakUrl="+redirect+"&state="+user.Id;
}
}
</script>