zoukankan      html  css  js  c++  java
  • 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="250px;height:45px;margin-left:15%;" class="btn" src="https://cdn.dianshihome.com/wechat/song/lookVipMore.png" alt="">
                                    </script>
                                </wx-open-launch-weapp>

    作者:人参,每篇随笔皆原创(除非注明原作者的随笔),欢迎指正!

  • 相关阅读:
    linux 邮件服务器
    Nginx学习之keepalive
    explain 和 desc 详解
    mysql 常用语句
    loop设备及losetup命令
    cryptsetup文件系统加密
    ftp主动与被动模式详解
    大型网站关键技术
    大访问量网站架构设计
    Mysql 的事务隔离级别
  • 原文地址:https://www.cnblogs.com/panax/p/14464690.html
Copyright © 2011-2022 走看看