時(shí)間:2021年5月25日
實(shí)現(xiàn)功能:H5頁(yè)面跳轉(zhuǎn)小程序
參考鏈接:官方文檔
由于easyWeChat生成的jssdk配置沒有添加小程序跳轉(zhuǎn)配置,先手動(dòng)加上去,如下如:

需要修改源碼的文件.png

需要修改的代碼.png
只有線上才能測(cè)試,本地測(cè)試不了。
微信開發(fā)工具看到下面配置項(xiàng)說(shuō)明配置成功生效??梢蚤_始著手跳轉(zhuǎn)了。

image.png
html頁(yè)面代碼,需要先確保上述配置生效才可以。
<wx-open-launch-weapp
id="launch-btn"
username="gh_05c3xxxxxx"
path="pages/groupCourse/groupCourseList"
>
<template>
<style>
.jump_wx_mini{font-size: 12px; color: #9e9e9e;padding: 12px;}
</style>
<div class="jump_wx_mini" >跳轉(zhuǎn)小程序</div>
</template>
</wx-open-launch-weapp>
比較坑的是樣式上需要在temp里面單獨(dú)寫,如果需要撐開,padding一下吧,試試就知道我為啥要提這句了 T T.
簡(jiǎn)單記錄希望能幫到你。