wangjiahai 1 year ago
parent
commit
e82ad85297
  1. 61
      pages/login/login.vue

61
pages/login/login.vue

@ -17,11 +17,13 @@
contentrefresh: "获取信息中,请稍后", contentrefresh: "获取信息中,请稍后",
contentnomore: "没有更多数据了" contentnomore: "没有更多数据了"
}, },
shareUrl: '' //
middleware: null
} }
}, },
onLoad(options) { onLoad(options) {
//
if (options != undefined && options.data != undefined) { if (options != undefined && options.data != undefined) {
let shareData; let shareData;
try { try {
@ -30,8 +32,7 @@
} catch (e) { } catch (e) {
shareData = JSON.parse(decodeURIComponent(options.data)) shareData = JSON.parse(decodeURIComponent(options.data))
} }
if (this.stringIsNotEmpty(shareData.url)) this.middleware = shareData
this.shareUrl = shareData.url
} }
this.getWxCode() this.getWxCode()
@ -80,15 +81,61 @@
uni.setStorageSync("satoken", res.data.data.token) uni.setStorageSync("satoken", res.data.data.token)
console.log("人员sid", res.data.data.sid); console.log("人员sid", res.data.data.sid);
console.log("token", res.data.data.token); console.log("token", res.data.data.token);
if (_this.stringIsNotEmpty(_this.shareUrl)) {
uni.reLaunch({ if (_this.middleware != null) {
url: _this.shareUrl //
}); if ('share' == _this.middleware.functionName) {
uni.reLaunch({
url: _this.middleware.url
});
} else if ('bindCard' == _this.middleware
.functionName) {
_this.middleware.params.customerSid = res.data.data
.sid
_this.$api.pickUpCardBind(_this.middleware.params)
.then((resp) => {
uni.reLaunch({
url: _this.middleware.url
});
}).catch(e => {
uni.showModal({
title: '提示',
content: '绑卡时发生错误',
showCancel: false,
success: function(res) {
uni.switchTab({
url: '/pages/home/pickUpCard'
})
}
});
})
} else {
uni.showModal({
title: '提示',
content: '版本过低',
showCancel: false,
success: function(res) {
uni.switchTab({
url: '/pages/home/pickUpCard'
})
}
});
}
} else { } else {
uni.switchTab({ uni.switchTab({
url: '/pages/home/pickUpCard' url: '/pages/home/pickUpCard'
}) })
} }
if (_this.stringIsNotEmpty(_this.shareUrl)) {
} else {
}
} }
} else { } else {
_this.status = 'more' _this.status = 'more'

Loading…
Cancel
Save