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