Commit 0ae8e2fe by 李嘉林

fix

parent 837199b6
......@@ -4,7 +4,7 @@
<div v-else class="toMini" @click="toMini">点击跳转到其他小程序</div>
</div>
</template>
<script>
export default {
data() {
......@@ -12,6 +12,7 @@ export default {
loadFlag: 0,
options: "",
pageType: 0, // 0默认 1打开地图
isOpenLocation: false,
}
},
onLoad(options) {
......@@ -19,6 +20,7 @@ export default {
console.log("onLoad", this.loadFlag, this.options)
if (this.options && this.options.type == 1) {
this.pageType = 1;
this.isOpenLocation = false
this.openLocation();
} else {
this.toMini();
......@@ -28,19 +30,23 @@ export default {
this.loadFlag++;
console.log("onShow", this.loadFlag)
this.toMini();
if (this.pageType == 1) {
console.log('this.isOpenLocation', this.isOpenLocation)
if (this.isOpenLocation) {
wx.navigateBack();
}
},
methods: {
openLocation() {
const _this = this
wx.openLocation({
latitude: this.options.latitude - 0,
longitude: this.options.longitude - 0,
address: this.options.address,
scale: 18,
success(res) {
console.log("success", res)
_this.$nextTick(() => {
_this.isOpenLocation = true
})
},
fail(res) {
console.log("fail", res)
......@@ -76,7 +82,7 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.text {
text-align: center;
......@@ -96,4 +102,5 @@ export default {
background: #41c867;
border-radius: 40px;
}
</style>
\ No newline at end of file
</style>
\ No newline at end of file
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