修改卡绑定功能,登录方式改为跳转
diff --git a/app.json b/app.json
index 6dad880..17269db 100644
--- a/app.json
+++ b/app.json
@@ -20,7 +20,8 @@
"pages/logs/logs",
"pages/scan/scan",
"pages/scan2/scan2",
- "pages/qrcode/qrcode"
+ "pages/qrcode/qrcode",
+ "pages/unbind/unbind"
],
"window": {
"backgroundTextStyle": "dark",
diff --git a/app.wxss b/app.wxss
index 91a9b2d..b8def15 100644
--- a/app.wxss
+++ b/app.wxss
@@ -66,6 +66,13 @@
}
+.long-btn-warn {
+ margin-top: 30rpx;
+ background-color: red;
+ color: white;
+
+}
+
.authcode {
color: rgb(21, 106, 180);
@@ -73,4 +80,7 @@
border-left: 1px solid rgb(235, 235, 235);
display: flex;
+}
+.policy{
+ color: rgb(82, 178, 243);
}
\ No newline at end of file
diff --git a/pages/bindcard/bindcard.js b/pages/bindcard/bindcard.js
index dc76332..8fb93b7 100644
--- a/pages/bindcard/bindcard.js
+++ b/pages/bindcard/bindcard.js
@@ -169,7 +169,6 @@
wx.$doPost('/v1/bindcard', param, function(ok, ret) {
wx.hideLoading();
if (ok) {
-
console.log(ret)
if (ret.data.code == 200) {
wx.setStorageSync("name", name);
@@ -180,6 +179,12 @@
wx.setStorageSync("personid", ret.data.personid);
wx.setStorageSync("signed", ret.data.signed);
wx.setStorageSync("paypwdset", ret.data.paypwdset);
+ var signed = wx.getStorageSync("signed");
+ if (!wx.$isEmpty(signed) && signed == 'yes') {
+ wx.navigateTo({
+ url: '../index/index',
+ })
+ }
wx.navigateTo({
url: '../bindcheck/bindcheck',
})
diff --git a/pages/bindcheck/bindcheck.js b/pages/bindcheck/bindcheck.js
index 3ca4c4c..c9f97eb 100644
--- a/pages/bindcheck/bindcheck.js
+++ b/pages/bindcheck/bindcheck.js
@@ -11,7 +11,7 @@
sendColor: 'rgb(124, 255, 112)',
snsMsgWait: 30,
smsFlag: true,
-
+ privacyCheck:''
},
/**
@@ -35,6 +35,7 @@
}
},
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -88,46 +89,43 @@
onShareAppMessage: function() {
},
+ checkboxChange:function(e){
+ console.log(e.detail.value);
+ this.setData({
+ privacyCheck: e.detail.value
+ })
+ },
+ showXy:function(){
+ wx.navigateTo({
+ url: '../signxy/signxy',
+ })
+ },
doNext: function () {
var code = this.data.code;
if (wx.$isEmpty(code)) {
return;
}
- var personid = wx.getStorageSync("personid");
-
- var param = {
- "personid": personid,
- "code": code,
+ var agree =this.data.privacyCheck;
+ if (wx.$isEmpty(agree)) {
+ wx.showModal({
+ title: '提示',
+ content: '请同意民卡免密代扣签约协议',
+ })
+ return;
}
- wx.$doPost('/v1/checkcode',param, function (ok, ret) {
+ var personid = wx.getStorageSync("personid");
+ var param={
+ "agree":code
+ }
+ wx.$doPost('/v1/signbxy',param, function (ok, ret) {
if (ok) {
-
- console.log(ret)
if (ret.data.code == 200) {
- wx.setStorageSync("paypwdtype", "new");
wx.setStorageSync("userid", personid);
- var signed = wx.getStorageSync("signed");
- var paypwdset = wx.getStorageSync("paypwdset");
- console.log(paypwdset)
- if (!paypwdset || 'false' == paypwdset) {
- wx.navigateTo({
- url: '../paypwdset/paypwdset',
- })
-
- } else {
- if (!wx.$isEmpty(signed) && signed == 'yes') {
- wx.navigateTo({
- url: '../index/index',
- })
-
- } else {
- wx.navigateTo({
- url: '../signxy/signxy',
- })
-
- }
- }
+ wx.setStorageSync("signed", ret.data.signed);
+ wx.navigateTo({
+ url: '../index/index',
+ })
} else {
wx.showModal({
title: '错误',
@@ -153,18 +151,18 @@
wx.$doCountdown(this);
- var name = wx.getStorageSync("name");
- var cardno = wx.getStorageSync("cardno");
- var idtype = wx.getStorageSync("idtype");
- var idno = wx.getStorageSync("idno");
+ // var name = wx.getStorageSync("name");
+ // var cardno = wx.getStorageSync("cardno");
+ // var idtype = wx.getStorageSync("idtype");
+ // var idno = wx.getStorageSync("idno");
var param = {
- "cardno": cardno,
- "idtype": idtype,
- "name": name,
- "idno": idno
+ // "cardno": cardno,
+ // "idtype": idtype,
+ // "name": name,
+ // "idno": idno
}
- wx.$doPost('/v1/bindcard', param, function(ok, ret) {
+ wx.$doPost('/v1/bindcardcode', param, function(ok, ret) {
console.log(ret.data);
if (ok) {
if (ret.data.code == 200) {} else {
diff --git a/pages/bindcheck/bindcheck.wxml b/pages/bindcheck/bindcheck.wxml
index 87dbe70..1b00856 100644
--- a/pages/bindcheck/bindcheck.wxml
+++ b/pages/bindcheck/bindcheck.wxml
@@ -6,13 +6,23 @@
<view class="input-desc">
验证码
</view>
- <input placeholder="请输入验证码 " type="number" style="width:70%" bindinput="setCode"></input>
-
+ <input placeholder="请输入验证码" type="number" style="width:45%" bindinput="setCode"></input>
+ <view class="authcode center" style="color:{{sendColor}}" bindtap="getCode">
+ {{sendTime}}
+ </view>
</view>
-
- <button bindtap="doNext" class="long-btn" style="width: 90%;">下一步</button>
+ <view class="inline-item" style="margin-top:30rpx;background-color:rgb(240, 240, 240)">
+ <checkbox-group bindchange="checkboxChange">
+ <label>
+ <checkbox value="1" class="checkbox" />我已阅读并同意
+ </label>
+ </checkbox-group>
+
+ <view class="policy" bindtap="showXy">《市民卡免密代扣签约协议》</view>
+ </view>
+ <button bindtap="doNext" class="long-btn" style="width: 90%;">签约</button>
</view>
</view>
\ No newline at end of file
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>
diff --git a/pages/loadpage/loadpage.js b/pages/loadpage/loadpage.js
index 642b288..62be5f8 100644
--- a/pages/loadpage/loadpage.js
+++ b/pages/loadpage/loadpage.js
@@ -40,7 +40,7 @@
if (!wx.$isEmpty(ret.data.token)) {
wx.setStorageSync("token", ret.data.token);
}
- wx.navigateTo({
+ wx.redirectTo({
url: '../index/index',
})
@@ -101,7 +101,6 @@
*/
onShow: function() {
-
},
/**
diff --git a/pages/register/register.wxss b/pages/register/register.wxss
index bb3e2e8..55fe44e 100644
--- a/pages/register/register.wxss
+++ b/pages/register/register.wxss
@@ -3,6 +3,3 @@
-.policy{
- color: rgb(82, 178, 243);
-}
\ No newline at end of file
diff --git a/pages/signxy/signxy.wxml b/pages/signxy/signxy.wxml
index 235e86c..dec6df9 100644
--- a/pages/signxy/signxy.wxml
+++ b/pages/signxy/signxy.wxml
@@ -70,4 +70,3 @@
方披露自己的个人信息,如联络方式或者邮政地址。请您妥善保护自己的个人信息,仅在必要的情形下向他人提供。如您发现自己的个人信息泄密,尤其是本应用用户名及密码发生泄露,请您立即联络本应用客服,以便本应用采取相应措施。
</text>
- <button class="long-btn" style="width: 90%;margin-bottom:30rpx" disabled="{{disabled}}" bindtap="signXY">{{signMsg}}</button>
\ No newline at end of file
diff --git a/pages/unbind/unbind.js b/pages/unbind/unbind.js
new file mode 100644
index 0000000..e9c2ff1
--- /dev/null
+++ b/pages/unbind/unbind.js
@@ -0,0 +1,146 @@
+// pages/unbind/unbind.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ bankcard:'',
+ name:'',
+ status:''
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this;
+ wx.$doPost('/v1/cardinfor',{}, function(ok, ret) {
+ if (ok) {
+ wx.hideLoading();
+ console.log(ret)
+ if (ret.data.code == 200) {
+ that.setData({
+ name: ret.data.name,
+ bankcard: ret.data.cardno,
+ status:ret.data.cardstatus
+ })
+
+ } else {
+ wx.showModal({
+ title: '错误',
+ content: ret.data.msg,
+ duration: 2000
+ })
+ }
+ } else {
+ wx.hideLoading();
+ wx.showModal({
+ title: '错误',
+ content: "请求失败了,请稍后再试",
+ duration: 2000
+ })
+ }
+ })
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ unSign: function() {
+
+ wx.showModal({
+ title: '提示',
+ content: '确定要解除签约吗',
+ success(res) {
+ if (res.confirm) {
+
+ wx.$doPost('/v1/unsignbxy', {}, function(ok, ret) {
+ if (ok) {
+ console.log(ret)
+ if (ret.data.code == 200) {
+ wx.setStorageSync("signed", ret.data.signed);
+
+ wx.showModal({
+ title: '提示',
+ content: '解约成功',
+ showCancel:false,
+ success(res) {
+ if (res.confirm) {
+ wx.navigateTo({
+ url: '../index/index',
+ })
+ }
+ }
+ })
+
+ } else {
+ wx.showModal({
+ title: '错误',
+ content: ret.data.msg,
+ duration: 2000
+ })
+
+ }
+ } else {
+ wx.showModal({
+ title: '错误',
+ content: ret.data.msg,
+ duration: 2000
+ })
+ }
+ })
+
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/unbind/unbind.json b/pages/unbind/unbind.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/unbind/unbind.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/unbind/unbind.wxml b/pages/unbind/unbind.wxml
new file mode 100644
index 0000000..98681cf
--- /dev/null
+++ b/pages/unbind/unbind.wxml
@@ -0,0 +1,34 @@
+<view class="container">
+
+ <view class="global-background">
+ <view class=" center inline-item" >
+ <view style="float:left">
+ 姓名
+ </view>
+ <view style="float:right;display: block;" style="margin-left:75%;color:gray">
+ {{name}}
+ </view>
+ </view>
+ <view class=" center inline-item" >
+ <view style="float:left">
+ 市民卡
+ </view>
+ <view style="float:right;display: block;" style="margin-left:45%;color:gray">
+ {{bankcard}}
+ </view>
+
+ </view>
+ <view class=" center inline-item" >
+ <view style="float:left">
+ 状态
+ </view>
+ <view style="float:right;display: block;" style="margin-left:75%;color:gray">
+ {{status}}
+ </view>
+
+ </view>
+
+ <button class="long-btn-warn" style="width: 90%;margin-bottom:30rpx; " bindtap="unSign">解除签约</button>
+
+ </view>
+</view>
\ No newline at end of file
diff --git a/pages/unbind/unbind.wxss b/pages/unbind/unbind.wxss
new file mode 100644
index 0000000..3d8d901
--- /dev/null
+++ b/pages/unbind/unbind.wxss
@@ -0,0 +1 @@
+/* pages/unbind/unbind.wxss */
\ No newline at end of file