Commit f11d622a authored by 肖健's avatar 肖健

对接扫码跳转逻辑

parent 516f5268
......@@ -111,10 +111,21 @@ export default {
uni.setStorageSync("userToken", res.data.data.token)
if(this.scene) {
this.gotoMoveCar();
let param = {code : this.scene}
opts = { url: '/app/index/check/move/code', method: 'post' }
that.http.httpTokenRequest(opts, param).then(res => {
console.info(res);
if (res.data.code == 200) {
if(res.data.data.bindFlag) {
that.gotoMoveCar();
} else {
that.gotoBindMoveCar();
}
}
})
} else {
//跳转到绑定页面
this.gotoIndex()
that.gotoIndex()
}
} else {
......@@ -130,7 +141,9 @@ export default {
gotoIndex() {
//跳转到绑定页面
uni.reLaunch({ //信息更新成功后跳转到小程序首页
url: '/pages/binding/binding'
//todo 京东账号绑定界面暂缓
//url: '/pages/binding/binding'
url: '/pagesA/pages/index/index'
})
// uni.navigateTo({
......@@ -138,10 +151,18 @@ export default {
// });
},
//调整到挪车页面
gotoMoveCar(scene) {
//跳转到挪车页面
gotoMoveCar() {
let that = this;
uni.navigateTo({
url: '/pagesB/pages/move-car/oneMoveCar?scene=' + that.scene
});
},
//跳转到绑定页面
gotoBindMoveCar() {
let that = this;
uni.navigateTo({
url: '/pagesB/pages/move-car/oneMoveCar?scene=' + scene
url: '/pagesB/pages/move-car/scan?moveCode=' + that.scene
});
},
},
......@@ -161,6 +182,7 @@ export default {
}
this.wechatLogin()
let userToken = uni.getStorageSync('userToken')
......@@ -170,8 +192,20 @@ export default {
that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
if(this.scene) {
this.gotoMoveCar();
if(that.scene) {
let param = {code : this.scene}
opts = { url: '/app/index/check/move/code', method: 'post' }
that.http.httpTokenRequest(opts, param).then(res => {
console.info(res);
if (res.data.code == 200) {
if(res.data.data.bindFlag) {
that.gotoMoveCar();
} else {
that.gotoBindMoveCar();
}
}
})
} else {
this.gotoIndex()
}
......
......@@ -15,10 +15,11 @@
当前位置:
</div>
<div class="item__value">
北京市朝阳区爱琴海停车场
<div class="item__icon">
<image src="@/static/move-car/move-car-code1.png" />
</div>
<!-- //todo 这个滚动通知有一个padding的设置项,导致高度增加不少,需要解决 -->
<u-notice-bar :text="appBo.detailInfo" icon=" " single="true" color="#333333" height="35" bgColor="#ffffff" fontSize="30rpx" ></u-notice-bar>
<div class="item__icon">
<image src="@/static/move-car/move-car-code1.png" />
</div>
</div>
</div>
<div class="car_item__three">
......@@ -216,7 +217,7 @@ export default {
// 2)需要当前地理位置的经纬度
// 3)小程序的key值
loadCity(longitude, latitude) {
const _this = this
const that = this
uni.request({
header: {
'Content-Type': 'application/text',
......@@ -233,19 +234,19 @@ export default {
if(res.data.status === '1') {
let addressInfo = res.data
//详细地址
_this.detailInfo = addressInfo.regeocode.formatted_address
that.appBo.detailInfo = addressInfo.regeocode.formatted_address
//省
_this.provinceName = addressInfo.regeocode.addressComponent.province
that.appBo.provinceName = addressInfo.regeocode.addressComponent.province
//市,直辖市有可能为空数组
_this.cityName = addressInfo.regeocode.addressComponent.city
that.appBo.cityName = addressInfo.regeocode.addressComponent.city
//为数组的时候设置为空
if(Array.isArray(cityName)) {
_this.cityName = ''
if(Array.isArray(that.appBo.cityName)) {
that.appBo.cityName = ''
}
//区
_this.countyName = addressInfo.regeocode.addressComponent.district
that.appBo.countyName = addressInfo.regeocode.addressComponent.district
console.log("当前位置: " + _this.detailInfo + " " + _this.provinceName + " " + " " + _this.cityName + " " + _this.countyName)
console.log("当前位置: " + that.appBo.detailInfo + " " + that.appBo.provinceName + " " + " " + that.appBo.cityName + " " + that.appBo.countyName)
}
} else {
console.log('获取信息失败,请重试!')
......@@ -254,7 +255,7 @@ export default {
})
}
},
onLoad() {
onLoad(e) {
// 在页面加载的时候去判断用户有没有授权地理位置,没授权的话引导用户去设置页手动授权
this.getAuthorize()
if(e.query) {
......@@ -276,6 +277,9 @@ export default {
</script>
<style lang="scss" scoped>
.u-notice-bar {
padding: 0 !important;
}
.oneMoveCar {
.u-checkbox-group {
......
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