一、引进js
http://res2.wx.qq.com/open/js/jweixin-1.6.0.js
import wx from "jweixin-module";
let jsApiList = ['chooseImage']
wx.config({
debug: true, // 调试模式,调用的所有api的返回值会alert出来,false就不会alert
appId: me.appId, // 必填,公众号的唯一标识,填自己的!
timestamp: me.timestamp, // 必填,生成签名的时间戳,刚才接口拿到的数据
nonceStr: me.nonceStr, // 必填,生成签名的随机串
signature: me.signature, // 必填,签名,见附录1
jsApiList:jsApiList,
openTagList: ['wx-open-launch-weapp'] ,// 跳转小程序时必填
});
1、JS-SDK 报 “errMsg“:“config:ok“,“verifyJsApiList:[],openTagList:[]“
后台要给你这些参数,需要你提供当前页面的url
主要是:你的url给地址不对
要详细到当前页面,例如:https://xxx.com/xxxx/#/pages/camera/camera
2、username是要跳转的小程序的账号原始ID,不是什么appid
<wx-open-launch-weapp id="launch-btn" username="gh_xxxxxx" path="pages/xxx/xxx">
<script type="text/wxtag-template">
<style scoped>
.name-btn{
/* word-spacing:20px; */
letter-spacing:2px;
text-align: center;
margin-top: 35rpx;
padding: 12px;
color: #fff;
background-color:#6080f7;
border: 0 none;
border-radius: 12rpx;
}
</style>
<button class="name-btn">进入小程序</button>
</script>
</wx-open-launch-weapp>
好了,正常使用跳转。。。。