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