<template>
<view>
测试app跳转到小程序
<button @click="text">跳转</button>
<!--<navigator target = "miniProgram" app-id="wx7164452bc95f80be" path="pages/index/index" open-type='navigate'>
<view>点击</view>
</navigator>-->
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
text:function(){
plus.share.getServices(function(res){
var sweixin = null;
for(var i=0;i<res.length;i++){
var t = res[i];
if(t.id == 'weixin'){
sweixin = t;
}
}
if(sweixin){
sweixin.launchMiniProgram({
id: 'gh_709a85fced99',
path: 'pages/index/index?phone=0', // 指定默认页面及传参(可不要此行)
type: 0
});
}
},function(res){
console.log(JSON.stringify(res));
});
}
}
}
</script>
<style>
</style>