Commit 65016047 by 李嘉林

再次跳转外部小程序无效问题

parent a9687865
<template>
<div class="text">
正在跳转到其他小程序...
<div v-if="loadFlag<=1">正在跳转到其他小程序...</div>
<div v-else class="toMini" @click="toMini">点击跳转到其他小程序</div>
</div>
</template>
<script>
export default {
data(){
return {
loadFlag: 0,
options: "",
}
},
onLoad(options){
this.options = options;
console.log("onLoad",this.loadFlag)
this.toMini();
},
onShow(){
this.loadFlag ++;
console.log("onShow",this.loadFlag)
this.toMini();
},
methods: {
toMini(){
let _this = this;
wx.navigateToMiniProgram({
appId: options.weappAppId,
path: decodeURIComponent(options.weappPage),
appId: _this.options.weappAppId,
path: decodeURIComponent(_this.options.weappPage),
// envVersion: 'release',
extraData: options.extraData && JSON.parse(options.extraData),
extraData: _this.options.extraData && JSON.parse(_this.options.extraData),
success(res) {
console.log(res,'--------打开成功')
// 打开成功
},
complete(res){
console.log(res,'------------------38')
}
})
}
}
}
</script>
<style lang="scss" scoped>
......@@ -27,4 +51,15 @@
font-size: 16px;
color: #333;
}
.toMini{
width: 60%;
margin: 0 auto;
margin-top: 40vh;
height: 40px;
line-height: 40px;
padding: 0 30px;
color: #fff;
background: #41c867;
border-radius: 40px;
}
</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