修改卡绑定功能,登录方式改为跳转
diff --git a/pages/index/index.js b/pages/index/index.js
index ceb267b..a6dd36f 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -45,29 +45,29 @@
var userid = wx.getStorageSync("userid");
var signed = wx.getStorageSync("signed");
- if (wx.$isEmpty(userid)) {
+ if (wx.$isEmpty(signed) || signed != 'yes') {
this.setData({
- bind: '未绑定',
+ bind: '未签约',
bindcolor: 'red'
})
} else {
this.setData({
- bind: '已绑定',
+ bind: '已签约',
bindcolor: 'green'
})
}
- if (wx.$isEmpty(signed) || signed != 'yes') {
- this.setData({
- sign: '未签约',
- signcolor: 'red'
- })
- } else {
- this.setData({
- sign: '已签约',
- signcolor: 'green'
- })
- }
+ // if (wx.$isEmpty(signed) || signed != 'yes') {
+ // this.setData({
+ // sign: '未签约',
+ // signcolor: 'red'
+ // })
+ // } else {
+ // this.setData({
+ // sign: '已签约',
+ // signcolor: 'green'
+ // })
+ // }
// if (app.globalData.userInfo) {
// this.setData({
@@ -110,9 +110,19 @@
})
},
doBind: function() {
- wx.navigateTo({
- url: '../bindcard/bindcard'
- })
+ var signed = wx.getStorageSync("signed");
+ if (wx.$isEmpty(signed) || signed != 'yes') {
+ wx.navigateTo({
+ url: '../bindcard/bindcard'
+ })
+
+ }else{
+ wx.navigateTo({
+ url: '../unbind/unbind'
+ })
+
+ }
+
},
doSign: function() {
var check = wx.$checkBankcard();
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index 257b1c0..b832291 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -38,7 +38,7 @@
<view class=" center inline-item" bindtap="doBind" style="margin-top:1%;">
<view style="float:left">
- 银行卡
+ 市民卡
</view>
<view style="float:right;display: block;" style="margin-left:75%;color:{{bindcolor}}">
{{bind}}
@@ -47,17 +47,7 @@
>
</view>
</view>
- <view class=" center inline-item" bindtap="doSign" >
- <view style="float:left">
- 签约代扣免密付
- </view>
- <view style="float:right;display: block;" style="margin-left:62%;color:{{signcolor}}">
- {{sign}}
- </view>
- <view class="arrow-icon" style="float:right;">
- >
- </view>
- </view>
+
</view>
</view>