Commit 65016047 by 李嘉林

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

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