3 changed files with 101 additions and 9 deletions
@ -1,11 +1,40 @@ |
|||
<template> |
|||
<view class="" style="text-align: center;padding-top: 50rpx;"> |
|||
开发中 |
|||
<view class="content"> |
|||
<web-view :src="src"></web-view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
src: '' |
|||
} |
|||
}, |
|||
onShow() { |
|||
// 必须登录 |
|||
let userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} |
|||
console.log(userInfo) |
|||
if(userInfo.token) { |
|||
this.src = 'http://localhost:8080/?token=' + userInfo.token |
|||
// this.src = 'https://chang-map.js-dyyj.com?token=' + userInfo.token |
|||
console.log(this.src) |
|||
}else { |
|||
uni.navigateTo({ |
|||
url: '/pages/login/login' |
|||
}) |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
<style lang="scss" scoped> |
|||
.content { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
padding-bottom: env(safe-area-inset-bottom) |
|||
} |
|||
</style> |
@ -0,0 +1,57 @@ |
|||
<template> |
|||
<view></view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
onShow() { |
|||
// 从第三方小程序返回后 |
|||
const oTherMiniprogramIsBack = uni.getStorageSync('oTherMiniprogramIsBack') |
|||
if(oTherMiniprogramIsBack) { |
|||
uni.showModal({ |
|||
title: '是否返回常熟小程序', |
|||
success: () => { |
|||
uni.removeStorageSync('oTherMiniprogramIsBack') |
|||
uni.navigateBack(); |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
let data = JSON.parse(option.data) |
|||
if(data && data.type == 'xcx') { |
|||
uni.navigateToMiniProgram({ |
|||
shortLink: data.url, |
|||
success(res) { |
|||
uni.setStorageSync('oTherMiniprogramIsBack', 1) |
|||
} |
|||
}) |
|||
}else if(data && data.type == 'map') { |
|||
uni.openLocation({ |
|||
longitude: Number(data.lon), // 经度 |
|||
latitude: Number(data.lat), //纬度 |
|||
name: data.address || data.title || data.name, // 位置名称 |
|||
address: data.address, //详细地址 |
|||
// complete: res => { |
|||
// if(res.errMsg.indexOf("openLocation:ok") != -1) { |
|||
// uni.switchTab({ |
|||
// url: '/pages/map/map' |
|||
// }) |
|||
// } |
|||
// } |
|||
success: res => { |
|||
uni.setStorageSync('oTherMiniprogramIsBack', 1) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
Loading…
Reference in new issue