You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

273 lines
9.4 KiB

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>实名认证</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="../../../lib/css/mui.min.css" rel="stylesheet" />
<!--引入公共样式-->
<link href="../../../lib/css/basic.css" rel="stylesheet" />
<link href="../../css/account_safe.css" rel="stylesheet" />
<script src="../../../lib/js/rem-layout.js"></script>
<script src="../../../lib/js/mui.min.js"></script>
<script src="../../../lib/js/vue.js"></script>
<script src="../../../lib/js/app.js"></script>
<script src="../../js/my/my_ajax.js"></script>
<script type="text/javascript" src="../../js/login/login_ajax.js"></script>
<!--下拉刷新上拉加载js-->
<!--<script src="../../../lib/js/mui.pullToRefresh.js"></script>
<script src="../../../lib/js/mui.pullToRefresh.js"></script>-->
<script src="../../../lib/js/mui.pullToRefresh.js"></script>
<script src="../../../lib/js/mui.pullToRefresh.material.js"></script>
<script src="../../../lib/js/require2.1.11.js"></script>
<!--下拉刷新上拉加载css-->
</head>
<body>
<div id="data-info">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{langue.title}}</h1>
</header>
<div class="mui-content">
<div id="ul-group" class="ul-group">
<ul class="mui-table-view app-table-view">
<li class="mui-table-view-cell">
<a class="view-herf mui-navigate-right" id="primary-identity" v-if="userLocalStorage.lowAuth == 'N'" view-id="my_identity.html" view-url="my_identity.html">
<span class="txt">{{langue.PrimaryRealNameAuthentication}}</span>
<span class="binding">{{langue.Unverified}}</span>
</a>
<a class="mui-navigate-right" id="primary-identity" v-else-if="userLocalStorage.lowAuth == 'W'">
<span class="txt">{{langue.PrimaryRealNameAuthentication}}</span>
<span class="binding">{{langue.InVerification}}</span>
</a>
<a class="mui-navigate-right" id="primary-identity" v-else-if="userLocalStorage.lowAuth == 'F'" view-id="my_identity.html" view-url="my_identity.html">
<span class="txt">{{langue.PrimaryRealNameAuthentication}}</span>
<span class="binding">{{langue.VerificationFailed}}</span>
</a>
<a class="mui-navigate-right" id="primary-identity" v-else>
<span class="txt">{{langue.PrimaryRealNameAuthentication}}</span>
<span class="binding">{{langue.Authenticated}}</span>
</a>
</li>
<li class="mui-table-view-cell">
<a class="view-herf mui-navigate-right" id="advanced-identity" v-if="userLocalStorage.highAuth == 'N'" view-id="advanced_identity.html" view-url="advanced_identity.html">
<span class="txt">{{langue.AdvancedRealNameAuthentication}}</span>
<span class="binding">{{langue.Unverified}}</span>
</a>
<a class="mui-navigate-right" id="advanced-identity" v-else-if="userLocalStorage.highAuth == 'W'">
<span class="txt">{{langue.AdvancedRealNameAuthentication}}</span>
<span class="binding">{{langue.InVerification}}</span>
</a>
<a class="mui-navigate-right" id="advanced-identity" v-else-if="userLocalStorage.highAuth == 'F'" view-id="advanced_identity.html" view-url="advanced_identity.html">
<span class="txt">{{langue.AdvancedRealNameAuthentication}}</span>
<span class="binding">{{langue.VerificationFailed}}</span>
</a>
<a class="mui-navigate-right" id="advanced-identity" v-else>
<span class="txt">{{langue.AdvancedRealNameAuthentication}}</span>
<span class="binding">{{langue.Authenticated}}</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</body>
<script>
// 国际化
var langues = {
zh_CN: {
title: "实名认证",
PrimaryRealNameAuthentication: "初级实名认证",
AdvancedRealNameAuthentication: "高级实名认证",
Unverified: "未认证",
InVerification: "正在审核",
Authenticated: "已认证",
VerificationFailed: "认证失败",
AjaxError: "网络异常,请检查网络状态"
},
zh_HK: {
title: "實名認證",
PrimaryRealNameAuthentication: "初級實名認證",
AdvancedRealNameAuthentication: "高級實名認證",
Unverified: "未認證",
InVerification: "正在審核",
Authenticated: "已認證",
VerificationFailed: "認證失敗",
AjaxError: "網絡異常,請檢查網絡狀態"
},
en_US: {
title: "real name authentication",
PrimaryRealNameAuthentication: "Primary",
AdvancedRealNameAuthentication: "Advanced",
Unverified: "Uncertified",
InVerification: "Under review",
Authenticated: "Authenticated",
VerificationFailed: "Failed",
AjaxError: "Network exception, please check network status"
}
}
</script>
<script type="text/javascript">
var dataInfo = new Vue({
el: '#data-info',
data: {
langue: langues[app.getLanguageLocalStorage()],
dataBase: {}, // 页面文字渲染
userLocalStorage: {}
},
computed: {
loginType: function() {
if(JSON.stringify(this.userLocalStorage) != '{}') {
return true;
} else {
return false;
}
},
getUserIdcardStatus: function() {
if(Object.is(JSON.stringify(this.userLocalStorage), "{}")) {
return "";
} else {
if(this.userLocalStorage.userStatus == 2) {
return this.dataBase.userIdcardStatus[2];
} else {
return this.dataBase.userIdcardStatus[1];
}
}
}
}
});
mui.plusReady(function() {
saveUserInfoData();
selectUserInfo();
// 列表项跳转
mui(".mui-table-view-cell").on('tap', '.view-herf', function() {
var viewId = this.getAttribute('view-id');
var viewUrl = this.getAttribute('view-url');
app.openWin(viewUrl, viewId);
});
//下拉刷新
// mui("#data-info").pullToRefresh({
// down: {
// callback: function() {
// selectUserInfo();
// saveUserInfoData();
// var self = this;
// setTimeout(function() {
// self.endPullDownToRefresh();
// }, 1000);
// }
// }
// });
})
/**
* 更新用户为最新的缓存信息
*/
function saveUserInfoData() {
dataInfo.userLocalStorage = app.getUserLocalStorage();
}
/**
* 查询用户身份证认证情况
*/
function selectUserIdcardStatus() {
mui.ajax(myAjaxJs.AJAX_GET_USER_IDCARD_STATUS.getUrl, {
headers: {
"X-CSRF-TOKEN": localStorage.getItem("user_token")
},
async: false,
type: myAjaxJs.AJAX_GET_USER_IDCARD_STATUS.getType, //HTTP请求类型
dataType: 'json', //服务器返回json格式数据
timeout: 5000,
success: function(data) {
if("200" == data.code) {
var state_url, state_id;
if(data.data && data.data != 'null') { //说明是审核中
state_url = "/state/state_under_review.html";
state_id = "mine/html/state/state_under_review.html";
} else { //说明是未申请
state_url = "my/my_identity.html";
state_id = "mine/html/my/my_identity.html";
}
app.openWin(state_url, state_id);
}
},
error: function(xhr, type, errorThrown) {
app.toast(langue.AjaxError);
}
})
}
/**
* 查询用户信息
*/
function selectUserInfo() {
mui.ajax(myAjaxJs.AJAX_GET_USER.getUrl, {
headers: {
"X-Requested-Token": app.getTokenStorage(), // token头部
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: myAjaxJs.AJAX_GET_USER.getType, //HTTP请求类型
data: dataInfo.userLocalStorage,
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if("200" == data.code) {
// 更新用户缓存数据
app.setUserLocalStorage(data.data);
// 渲染用户数据
dataInfo.userLocalStorage = data.data;
// mui.toast("刷新成功");
}
},
error: function(xhr, type, errorThrown) {}
})
}
/*//初级认证监听
document.getElementById('primary-identity').addEventListener('tap', function() {
app.openWin("my_identity.html", "my_identity.html");
});
//高级认证监听
document.getElementById('advanced-identity').addEventListener('tap', function() {
app.openWin("advanced_identity.html", "advanced_identity.html");
});*/
//点击认证
document.getElementById("primary-identity").addEventListener("tap", function() {
console.log("==点击认证==" + dataInfo.userLocalStorage.lowAuth);
//
if(!dataInfo.loginType) {
app.openWin("wallet_login.html", "mine/html/wallet_login.html");
} else if(dataInfo.userLocalStorage.lowAuth == 'F' || dataInfo.userLocalStorage.lowAuth == 'N') {
app.openWin('my_identity.html', 'my_identity.html');
}
// else {
// if(dataInfo.userLocalStorage.userStatus == 1) {
//
// selectUserIdcardStatus();
// }
// }
});
document.getElementById("advanced-identity").addEventListener("tap", function() {
console.log("==点击认证==");
if(!dataInfo.loginType) {
app.openWin("wallet_login.html", "mine/html/wallet_login.html");
} else if(dataInfo.userLocalStorage.highAuth == 'F' || dataInfo.userLocalStorage.highAuth == 'N') {
app.openWin('advanced_identity.html', 'advanced_identity.html');
}
});
// 国际化统一方法
window.addEventListener('switchLangueData', function(e) {
dataInfo.langue = langues[e.detail];
});
</script>
</html>