Commit 632eb1db authored by 肖健's avatar 肖健

扫码逻辑调整

parent cc64f8b0
...@@ -58,41 +58,53 @@ export default { ...@@ -58,41 +58,53 @@ export default {
case 2: case 2:
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
let path = res.path let path = res.path
console.log(path+ "123") let token = uni.getStorageSync('userToken');
if (path) { if(token){
let xcxIndexPath = uni.getStorageSync('xcxIndexPath') let opts = { url: '/app/user/info', method: 'get' }
console.info(xcxIndexPath); that.http.httpTokenRequest(opts, {}).then(res => {
if (xcxIndexPath) { if (res.data.code == 200) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '') let xcxIndexPath = res.data.data.xcxIndexPath
if (xcxIndexPath.indexOf('scene') >= 0) { if (xcxIndexPath) {
let scene = xcxIndexPath.replace('scene=', '') xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
let param = { if (xcxIndexPath.indexOf('scene') >= 0) {
code: scene let scene = xcxIndexPath.replace('scene=', '')
} let param = {
let opts = { code: scene
url: '/app/user/check/move/code', }
method: 'post' let opts = {
} url: '/app/user/check/move/code',
console.log(param); method: 'post'
that.http.httpTokenRequest(opts, param).then(res => { }
console.info(res) that.http.httpTokenRequest(opts, param).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.bindFlag) { if (res.data.data.bindFlag) {
that.gotoMoveCar(scene) that.gotoMoveCar(scene)
} else { } else {
that.gotoBindMoveCar(scene) that.gotoBindMoveCar(scene)
} }
} }
}) })
} } else {
} uni.showToast({
} else { title: '扫码失败',
uni.showToast({ icon: 'none',
title: '扫码失败', })
icon: 'none', }
}) } else {
} uni.showToast({
title: '扫码失败',
icon: 'none',
})
}
}
})
} else {
uni.showToast({
title: '扫码失败',
icon: 'none',
})
}
} }
}); });
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment