|
- <!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/userinfos.js"></script>
- <script src="js/serverurl.js"></script>
- <script type="text/javascript">
- mui.plusReady(function() {
- CheckLogin();
- GetData();
- document.getElementById("binding").addEventListener("tap", function() {
- mui.openWindow({
- url: 'binding.html',
- id: 'binding',
- show: {
- aniShow: 'pop-in'
- }
- });
- });
- });
-
- function longPress(id) {
- timeOutEvent = 0;
- var btnArray = [{
- title: "修改银行卡",
- style: "destructive"
- }];
- plus.nativeUI.actionSheet({
- cancel: "取消",
- buttons: btnArray
- }, function(e) {
- var index = e.index;
- if(index == 1) {
- EditCard(id);
- }
- });
- }
-
- function EditCard(id) {
- mui.openWindow({
- url: 'binding.html',
- id: 'binding',
- extras: {
- id: id
- },
- show: {
- aniShow: 'pop-in'
- }
- });
- }
-
- function GetData() {
- var table = document.getElementById("table");
- //server data
- // var xhr = new plus.net.XMLHttpRequest();
- // xhr.responseType = "json";
- // xhr.onreadystatechange = function() {
- // switch(xhr.readyState) {
- // case 4:
- // if(xhr.status == 200) {
- // table.innerHTML = "";
- // table.innerText = "";
- // if(xhr.response.msg != null && xhr.response.msg.length > 0) {
- // document.getElementById("binding").style.display = 'none';
- // for(var i = 0; i < xhr.response.msg.length; i++) {
- // //load list
- // var dataobject = xhr.response.msg;
- // var li = document.createElement('div');
- // li.setAttribute("bankNumber", "" + users.ID + "");
- // li.addEventListener("touchstart", function(e) {
- // timeOutEvent = setTimeout("longPress('" + this.getAttribute('bankNumber') + "')", 500);
- // e.preventDefault();
- // });
- // li.addEventListener("touchend", function(e) {
- // clearTimeout(timeOutEvent);
- // if(timeOutEvent != 0) {}
- // return false;
- // });
- // li.className = 'yhk';
- // li.innerHTML = '<div>' +
- // '<h4>' + dataobject[i].bankName + '</h4>' +
- // '<p style="color: #FFFFFF;">' + users.username + '</p>' +
- // '<span>' + dataobject[i].bankNumber + '</span>' +
- // '</div>';
- // table.appendChild(li, table.firstChild);
- // }
- // } else {
- // document.getElementById("binding").style.display = 'block';
- // }
- // plus.nativeUI.closeWaiting();
- // } else {
- // plus.nativeUI.closeWaiting();
- // plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
- // }
- // break;
- // default:
- // break;
- // }
- // }
- // xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getBanksList&content={'userID':'" + users.ID + "'}"));
- // xhr.send();
- plus.nativeUI.showWaiting("数据加载中...");
-
- mui.post(api+'/user/bankinfo',{data:users.ID},function(res){
- if(res.code=="200"){
- plus.nativeUI.closeWaiting();
- document.getElementById("binding").style.display = 'none';
- for(var i = 0; i < res.data.length; i++) {
- //load list
- var dataobject = res.data;
- var li = document.createElement('div');
- li.setAttribute("bankNumber", "" + users.ID + "");
- li.addEventListener("touchstart", function(e) {
- timeOutEvent = setTimeout("longPress('" + this.getAttribute('bankNumber') + "')", 500);
- e.preventDefault();
- });
- li.addEventListener("touchend", function(e) {
- clearTimeout(timeOutEvent);
- if(timeOutEvent != 0) {}
- return false;
- });
- li.className = 'yhk';
- li.innerHTML = '<div>' +
- '<h4>' + dataobject[i].bankName + '</h4>' +
- '<p style="color: #FFFFFF;">' + users.username + '</p>' +
- '<span>' + dataobject[i].bankNumber + '</span>' +
- '</div>';
- table.appendChild(li, table.firstChild);
- }
- }
- },'json')
- }
- </script>
- <style></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">银行卡<p style="color: #FFFFFF; float: right;" id="binding">绑定银行卡</p></h1>
- </header>
- <div class="mui-content" id="table">
- </div>
- </body>
-
- </html>
|