Files
juipnet/Host/Views.Mobile/User/IndexInfo.cshtml
“wanyongkang” 7aedb2d73e eso
2021-10-19 15:02:02 +08:00

721 lines
25 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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;
}
.cash-out-before {
position: fixed;
width: 90%;
left: 30%;
top: 39%;
margin-left: -200px;
margin-top: -160px;
z-index: 3;
background: #fff;
border-radius: 10px;
box-shadow: 0px 6px 8px 6px #ccc;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 30px;
display: none;
}
.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>
<button class="btnXq" id="real-name-confirm" onclick="$('#real-name').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>
<button class="btnXq" id="cash_out_confirm" onclick="tixian()">提现</button>
<button class="btnXq" onclick="$('#money-change').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 class="layerTable" id="cash-out" style="margin-right:10em;">
<form id="cashForm">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>提现金额:</td>
<td><input type="number" id="cash-out-money" class="inputBox" placeholder="请输入提现金额"/></td>
</tr>
<tr>
<td>提现理由:</td>
<td><input type="text" id="cash-out-reason" class="inputBox" placeholder="请输入提现理由"/></td>
</tr>
<tr>
<td>提现支付宝账号:</td>
<td><input type="text" id="alipay-account" class="inputBox" placeholder="请输入支付宝账号"/></td>
</tr>
<tr>
<td>支付宝真实姓名</td>
<td><input type="text" id="real-name-out" class="inputBox" placeholder="请输入与支付宝关联的真实姓名"/></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#cash-out').hide()">返回</button>
<button type="button" class="btnXq" onclick="cash_out()">确定</button>
</div>
</form>
</div>
<div class="cash-out-before">
<p>聚IP涵盖十余种全网知名旗舰产品总有一款适合您</p>
<p>联系客服帮您推荐合适的产品,我们将最大努力满足您的需求!</p>
<p class="text-center">
<button type="button" class="btn btn-primary" ><a target="_blank" style="color: white;" href="https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2852138148&fid=299&key=f377ec024ca45115a03a7632c7bda230&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true">联系客服</a></button>
<button type="button" class="btn btn-danger quxiao" style="margin-left:20px;" onclick="$('#cash-out').show();$('.cash-out-before').hide();">我不需要</button>
</p>
</div>
<div class="layerTable" id="real-name" style="margin-right:10em;">
<form id="id-cert">
<table border="0" cellspacing="0" cellpadding="0">
<p>《中华人民共和国网络安全法》第二十四条规定:<br>
网络运营者为用户办理网络接入、域名注册服务,办理固定电话、移动电话等入网手续,或者为用户提供信息发布、即时通讯等服务,在与用户签订协议或者确认提供服务时,应当要求用户提供真实身份信息。用户不提供真实身份信息的,网络运营者不得为其提供相关服务。</p>
<p>1、为了你的帐号安全请勿使用他人手机号或身份信息</p>
<p>2、聚IP承诺用户的个人隐私数据仅与支付宝方面进行交互本公司不调用及储存用户的实人认证数据仅接收支付宝方面的实人认证结果</p>
<p>3、若您支付宝扫脸认证不成功请联系客服</p>
<tr>
<td>真实姓名:</td>
<td><input type="text" id="real-name-name" class="inputBox" placeholder="请输入真实姓名"/></td>
</tr>
<tr>
<td>身份证号:</td>
<td><input type="number" id="real-name-code" class="inputBox" placeholder="请输入身份证号码"/></td>
</tr>
<tr>
<td>手机号码:</td>
<td><input type="text" id="real-name-phone" class="inputBox" placeholder="请输入手机号码" ></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#real-name').hide()">返回</button>
<button type="button" class="btnXq" onclick="realname()">确定</button>
</div>
</form>
<h1 id="verify-info" style="display:none;text-align: center;padding-top:100px;font-size:25px">请截图此页面,进入支付宝扫码验证,请勿关闭此页面,验证完成后请返回此页面,点击认证成功按钮,若扫脸后仍未认证成功,请联系客服</h1>
<div style="padding: 50px 100px;text-align: center;" id="qrcode"></div>
<div style="padding: 0 100px;text-align: center;"><button style="font-size:50px;" onclick="get_verify_res()" type="button" class="btn btn-success">已扫脸认证</button></div>
</div>
<div class="layerTable" id="money-change" style="margin-right:10em;">
<form id="id-cert">
<table border="0" cellspacing="0" cellpadding="0">
<div style="margin: 0 3%;">
<p>功能介绍</p>
<p>1、此功能主要为资金无法及时到账用户使用通过不同账号之间类似支付宝转账的效果进行资金转移</p>
<p>2、输入要将资金转入的会员号以及金额点击确认即可进行资金转移</p>
</div>
<br>
<tr>
<td>转入会员号:</td>
<td><input type="text" style="width: 80%;" id="money-change-user" class="form-control" placeholder="请输入待转入会员号" ></td>
</tr>
<tr>
<td>转入资金:</td>
<td><input type="text" style="width: 80%;" id="money-change-money" class="form-control" placeholder="请输入待转入金额" ></td>
</tr>
</table>
<div class="" style="text-align:center;">
<button type="button" class="btnXq" onclick="$('#money-change').hide()">取消</button>
<button type="button" class="btnXq" onclick="moneychange()">确认</button>
</div>
</form>
<h1 id="verify-info" style="display:none;text-align: center;padding-top:100px;font-size:25px">请截图此页面,进入支付宝扫码验证,请勿关闭此页面,验证完成后请返回此页面</h1>
<div style="padding: 50px 100px;text-align: center;" id="qrcode"></div>
</div>
<!-- 支付弹窗 -->
<div id="aliPayBox" style="display:none"></div>
<script type="text/javascript" src="https://static.runoob.com/assets/qrcode/qrcode.min.js"></script>
<script>
var t1 = null;
/** 表单序列化成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);
}
}
});
}
// function realname(){
// let id_code = $('#real-name-code').val(),
// name = $('#real-name-name').val();
// if(id_code.length <= 0){
// alert("抱歉!请重新输入身份证号!");
// return;
// }
// if(name.length <= 0){
// alert("抱歉!请重新输入姓名!");
// return;
// }
// let data = {
// cookie:document.cookie,
// id_code: id_code,
// name: name
// }
// $.ajax({
// type: 'POST',
// url: 'http://php-api.juip.com/api/Realname/index',
// dataType: "json",
// contentType: "application/json",
// data: JSON.stringify(data),
// beforeSend: function(xhr) {
// xhr.withCredentials = true;
// },
// crossDomain: true,
// success: function (res) {
// if (res.Code == 10000) {
// $('.real-name').hide();
// alert('实名认证成功。');
// } else {
// alert('请正确填写姓名和身份证号码。');
// }
// }
// });
// }
function realname(){
let id_code = $('#real-name-code').val(),
name = $('#real-name-name').val(),
phone = $('#real-name-phone').val();
if(id_code.length <= 0){
alert("抱歉!请重新输入身份证号!");
return;
}
if(phone.length != 11){
alert("抱歉!请重新输入手机号!");
return;
}
if(name.length <= 0){
alert("抱歉!请重新输入姓名!");
return;
}
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(id_code) === false)
{
alert("身份证输入不合法");
return false;
}
let data = {
cookie:document.cookie,
id_code: id_code,
name: name,
phone: phone
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/api/test/aliverify',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
beforeSend: function(xhr) {
xhr.withCredentials = true;
},
crossDomain: true,
success: function (res) {
if (res.Code == 20000) {
alert('已经认证成功');
window.location.href='/User/Index';
return ;
}
if (res.Code == 10000) {
$('#id-cert').hide();
$('#verify-info').show();
new QRCode(document.getElementById("qrcode"), {
text: res.url,
width : 500,
height : 500
});
} else {
alert('请正确填写姓名和身份证号码。');
}
}
});
// let data = {
// cookie:document.cookie,
// id_code: id_code,
// name: name
// }
// $.ajax({
// type: 'POST',
// url: 'http://php-api.juip.com/api/Realname/index',
// dataType: "json",
// contentType: "application/json",
// data: JSON.stringify(data),
// beforeSend: function(xhr) {
// xhr.withCredentials = true;
// },
// crossDomain: true,
// success: function (res) {
// if (res.Code == 10000) {
// $('.real-name').hide();
// alert('实名认证成功。');
// } else {
// alert('请正确填写姓名和身份证号码。');
// }
// }
// });
}
function moneychange(){
let user = $('#money-change-user').val(),
money = $('#money-change-money').val();
if (money<0) {
alert('转移金额必须大于0');
return;
}
if(money > @Model.UserModel.RestAmount){
alert("抱歉!您转移的额度大于余额,请重新输入金额!");
return;
}
let data = {
cookie:document.cookie,
luser:@Model.UserModel.LoginCode,
ruser:user,
money:money,
}
}
function get_verify_res(){
let data = {
cookie:document.cookie
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/api/test/aliGetResult',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
beforeSend: function(xhr) {
xhr.withCredentials = true;
},
crossDomain: true,
success: function (res) {
if (res.Code == 10000) {
clearInterval(t1);
window.location.href='/User/Index';
}
}
});
}
function tixian(){
$('.cash-out-before').show();
}
function cash_out() {
let cash_out_money = $('#cash-out-money').val(),
reason = $('#cash-out-reason').val(),
real_name = $('#real-name-out').val(),
alipay_account = $('#alipay-account').val();
if(cash_out_money > @Model.UserModel.RestAmount){
alert("抱歉!您提现的额度大于余额,请重新输入提现金额!");
return;
}
if(cash_out_money <= 0){
alert("抱歉!请重新输入提现金额!");
return;
}
//
let reg = /^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/;
if(alipay_account.length <= 0 || alipay_account.match(reg) == null){
alert("抱歉!请重新输入支付宝账号!");
return;
}
$('#cash_out_confirm').addClass('disabled');
$('#cash_out_confirm').prop('disabled', true);
let cashOutData = {
cash_out_money: cash_out_money,
reason: reason,
alipay_account: alipay_account,
real_name: real_name,
cookie:document.cookie
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/order/CashOutIndex/index',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(cashOutData),
beforeSend: function(xhr) {
xhr.withCredentials = true;
},
crossDomain: true,
success: function (res) {
console.log(res);
if (res.Code == 10000) {
$('.cash-out').hide();
alert('提现请求发送成功,我们会在一到两个工作日进行处理,请注意查看资金明细。');
} else {
alert('提现异常!请重试或联系客服。');
}
}
});
}
</script>