|
- <!doctype html>
- <html>
-
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="css/mui.min.css" rel="stylesheet" />
- <link href="css/style.css" rel="stylesheet" />
- <script src="js/mui.min.js"></script>
- <script src="js/serverurl.js"></script>
- <script src="js/userinfos.js"></script>
- <script type="text/javascript">
- function GetData(id) {
- var xhr = new plus.net.XMLHttpRequest();
- xhr.responseType = "json";
- xhr.onreadystatechange = function() {
- switch(xhr.readyState) {
- case 4:
- if(xhr.status == 200) {
- plus.nativeUI.closeWaiting();
- if(xhr.response != null) {
- document.getElementById("bankName").value=xhr.response.BANK_NAME;
- document.getElementById("bankNumber").value=xhr.response.BANK_NUMBER;
- } else {
- plus.nativeUI.toast("获取失败,请重试。");
- }
- } else {
- plus.nativeUI.closeWaiting();
- plus.nativeUI.toast('您的网络不给力');
- }
- break;
- default:
- break;
- }
- }
- xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getBackCardInfo&content={'userID':'" + users.ID + "'}"));
- xhr.send();
- plus.nativeUI.showWaiting("加载中...");
- }
- var id;
- mui.plusReady(function() {
- CheckLogin();
- id = plus.webview.currentWebview().id;
- if(id != undefined && id != null && id != '') {
- GetData(id);
- }
- document.getElementById("username").value = users.username;
- document.getElementById("btsave").addEventListener("tap", function() {
- if(document.getElementById("bankName").value == "" || document.getElementById("bankNumber").value == "" || document.getElementById("bankNumber2").value == "") {
- plus.nativeUI.toast('请填写完整表单。');
- return;
- }
- if(document.getElementById("bankNumber").value != document.getElementById("bankNumber2").value) {
- plus.nativeUI.toast('修改失败!两次输入的卡号不相同。');
- return;
- }
- //更新服务端
- var xhr = new plus.net.XMLHttpRequest();
- xhr.responseType = "json";
- xhr.onreadystatechange = function() {
- switch(xhr.readyState) {
- case 4:
- if(xhr.status == 200) {
- plus.nativeUI.closeWaiting();
- if(xhr.response.result == "ok") {
- plus.webview.currentWebview().opener().evalJS("GetData();");
- plus.webview.currentWebview().close();
-
- plus.nativeUI.toast('绑定成功。');
- } else {
- plus.nativeUI.toast("绑定失败,请重试。");
- }
- } else {
- plus.nativeUI.closeWaiting();
- plus.nativeUI.toast('您的网络不给力');
- }
- break;
- default:
- break;
- }
- }
- xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=setBacks&content={'userID':'" + users.ID + "','bankNumber':'" + document.getElementById("bankNumber").value + "','bankName':'" + document.getElementById("bankName").value + "'}"));
- xhr.send();
- plus.nativeUI.showWaiting("加载中...");
- });
- });
- </script>
- <style>
- .mui-btn-primary {
- width: 90%;
- margin: 10px;
- }
-
- .mui-content p {
- color: #c70f1a;
- width: 96%;
- text-align: center;
- line-height: 40px;
- font-size: 15px;
- margin: auto;
- }
- </style>
- </head>
-
- <body>
-
- <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">绑定银行卡</h1>
-
- </header>
- <div class="mui-content">
- <p>为保证提现成功,请确认该银行卡开户姓名必须为您的姓名</p>
- <form class="mui-input-group">
- <div class="mui-input-row">
- <label>持卡人</label>
- <input type="text" class="mui-input-clear" id="username" disabled="disabled">
- </div>
- <div class="mui-input-row">
- <label>所属银行</label>
- <input type="text" class="mui-input-clear" placeholder="请输入银行" id="bankName">
- </div>
-
- <div class="mui-input-row">
- <label>银行卡号</label>
- <input class="mui-input-clear mui-input-numbox" type="number" placeholder="请输入您的银行卡号" id="bankNumber">
- </div>
- <div class="mui-input-row">
- <label>确认卡号</label>
- <input class="mui-input-clear mui-input-numbox" type="number" placeholder="请输入您的银行卡号" id="bankNumber2">
- </div>
-
- </form>
- <div class="mui-button-row">
- <button type="button" class="mui-btn mui-btn-primary" id="btsave">确认绑定</button>
- </div>
-
- </div>
-
- </body>
-
- </html>
|