修改卡绑定功能,登录方式改为跳转
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