Commit 58c5a92a authored by 肖健's avatar 肖健

导航栏扫一扫需要登录

parent 0cfced19
...@@ -56,36 +56,37 @@ export default { ...@@ -56,36 +56,37 @@ export default {
this.tab = 'moveCar' this.tab = 'moveCar'
break; break;
case 2: case 2:
uni.scanCode({ let token = uni.getStorageSync('userToken');
success: function (res) { if(token) {
let path = res.path uni.scanCode({
let token = uni.getStorageSync('userToken'); success: function (res) {
if(token){ let path = res.path
let opts = { url: '/app/user/info', method: 'get' } let opts = { url: '/app/user/info', method: 'get' }
that.http.httpTokenRequest(opts, {}).then(res => { that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let xcxIndexPath = res.data.data.xcxIndexPath let xcxIndexPath = res.data.data.xcxIndexPath
if (xcxIndexPath) { if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '') xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
if (xcxIndexPath.indexOf('scene') >= 0) { if (xcxIndexPath.indexOf('scene') >= 0) {
let scene = xcxIndexPath.replace('scene=', '') let scene = xcxIndexPath.replace('scene=', '')
let param = { let param = {
code: scene code: scene
} }
let opts = { let opts = {
url: '/app/user/check/move/code', url: '/app/user/check/move/code',
method: 'post' method: 'post'
} }
that.http.httpTokenRequest(opts, param).then(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 { } else {
uni.showToast({ uni.showToast({
title: '扫码失败', title: '扫码失败',
icon: 'none', icon: 'none',
...@@ -99,14 +100,13 @@ export default { ...@@ -99,14 +100,13 @@ export default {
} }
} }
}) })
} else { }
uni.showToast({ });
title: '扫码失败', } else {
icon: 'none', uni.navigateTo({
}) url: '/pages/binding/index'
} })
} }
});
break; break;
case 3: case 3:
this.tab = 'shop' this.tab = 'shop'
......
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