修改解约流程
diff --git a/www/js/cardinfor.js b/www/js/cardinfor.js
index da6e04f..6361910 100644
--- a/www/js/cardinfor.js
+++ b/www/js/cardinfor.js
@@ -1,20 +1,20 @@
var app = {
// Application Constructor
- initialize: function() {
+ initialize: function () {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
-
- onDeviceReady: function() {
+
+ onDeviceReady: function () {
$.showLoading("加载中");
- V1Cardinfor(function(ok, ret, err) {
+ V1Cardinfor(function (ok, ret, err) {
if (ok) {
- $.hideLoading();
- if(ret.code==200){
+ $.hideLoading();
+ if (ret.code == 200) {
$("#name").text(ret.name);
$("#cardnum").text(ret.cardno);
$("#cardstatus").text(ret.cardstatus);
- }else{
+ } else {
$.alert(ret.msg, "错误");
}
} else {
@@ -23,29 +23,29 @@
}
})
},
- unBindcard: function(){
+ unBindcard: function () {
var dialog = new auiDialog({})
dialog.prompt({
- title:"请输入支付密码",
- text:'请输入支付密码',
- buttons:['取消','确定']
- },function(ret){
+ title: "请输入支付密码",
+ text: '请输入支付密码',
+ buttons: ['取消', '确定']
+ }, function (ret) {
console.log(ret);
- if(ret.buttonIndex == 2){
- if(!isEmpty(ret.text)){
+ if (ret.buttonIndex == 2) {
+ if (!isEmpty(ret.text)) {
$.showLoading("正在请求");
var param = {
- "paypwd":ret.text
+ "paypwd": ret.text
}
- V1Unbindcard(param,function(ok, ret, err) {
+ V1Unbindcard(param, function (ok, ret, err) {
if (ok) {
- $.hideLoading();
- if(ret.code==200){
+ $.hideLoading();
+ if (ret.code == 200) {
window.localStorage.removeItem("userid");
- $.alert('解绑成功', "提示", function() {
+ $.alert('解绑成功', "提示", function () {
window.location = 'main.html'
});
- }else{
+ } else {
$.alert(ret.msg, "错误");
}
} else {
@@ -57,9 +57,30 @@
}
});
var input = $(".aui-dialog-body").find("input");
- if(input){
- input.attr("type","password");
+ if (input) {
+ input.attr("type", "password");
}
+ },
+ doNext: function () {
+ $.confirm('您正在进行解除签约操作,是否确定?', '解除签约确认',
+ function () {
+ V1UnSignbxy(null, function(ok, ret, err) {
+ if (ok) {
+ $.hideLoading();
+ if (ret.code == 200) {
+ window.localStorage.setItem("signed", ret.signed);
+ $.alert('解除成功', "提示", function() {
+ window.location = 'main.html'
+ });
+ } else {
+ $.alert(ret.msg, "错误");
+ }
+ } else {
+ $.hideLoading();
+ $.alert("请求失败了:" + ret.status + "请稍后再试", "错误");
+ }
+ })
+ });
}
};
app.initialize();