Commit f11d622a authored by 肖健's avatar 肖健

对接扫码跳转逻辑

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