h5 打開小程序


1. jssdk  必須1.60 以上

2. 在wx.config 進行注冊

wx.config({
                                debug: false,
                                appId: data.data.appid,
                                timestamp: data.data.timestamp,
                                nonceStr: data.data.noncestr,
                                signature: data.data.signature,
                                jsApiList: [
                                    'onMenuShareTimeline',
                                    'onMenuShareAppMessage',
                                    'updateAppMessageShareData',
                                    'updateTimelineShareData'
                                ],
                                openTagList: ["wx-open-launch-weapp"]  // 很重要
                            });

3. 使用 小程序標簽 wx-open-launch-weapp

// template

<wx-open-launch-weapp
                                id="launch-btn"
                                username=""                  // 小程序原始id
                                path="pages/family/main"     // 小程序頁面路徑
                                >
                                <!-- <template>
                                    <style>.btn { padding: 12px }</style>
                                    <button class="btn">打開小程序</button>
                                </template> -->
                                <script type="text/wxtag-template">
                                    <img style="width:250px;height:45px;margin-left:15%;" class="btn" src="https://cdn.dianshihome.com/wechat/song/lookVipMore.png" alt="">
                                </script>
                            </wx-open-launch-weapp>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM