收藏
回答

点击确认不能跳转小程序,这是为什么?

https://img-mid.csdnimg.cn/release/static/image/mid/ask/990528017276117.png?x-oss-process=image/auto-orient,1/resize,w_320,m_lfit
<div class="hktshare">
         <div>会客厅</div> 
      </div>
         <div class="del_mask" id="hktshare_pop" style="display: none;">
            <div class="del_block">
              <div class="del_content">即将打开"智能会客厅"小程序</div>
              <div>
                <div class="del_cancel" onclick="delhkt()">取消</div>
                  <!-- <div class="del_sure" onclick="surehkt()">确定</div>   -->
                <div class="wx_open_box">
                  <wx-open-launch-weapp id="launch-btn" username="gh_4b4a3e566703" path="pages/index/index?source=personalPlan&to=h5tp&linkUrl=https%3A%2F%2Fsales-dev.ihxlife.com%2Fimr%2Fyx_plan%2Fviews%2Fperson_plan%2Fper_produce_plan.html%3FagentCode%3D150007993%26agentState%3D0%26openid%3D%26planNo%3D2022041200000001%26createSource%3Dwmp%26pageName%3Dperson_plan">
                     <!-- <template> -->
                        <button class="hktbtn" style="font-weight: 600;line-height: 1.6rem;font-size: 0.65rem;width: 49%;background-color: white;color: #4f7b97;">确认</button>
                     <!-- </template> -->
                  </wx-open-launch-weapp>
              </div>
              </div>
            </div>
          </div>
<script src="https://sales-dev.ihxlife.com/HuaPM_V/bcard/h5/tpSwitch.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="./lib/jquery-1.5.2.min.js"></script>
<script src="./lib/jquery.qrcode.min.js?v=1.11"></script>
<script>
      $.get("https://uc-dev-bg.ihxlife.com/api/v1/wechat/signatureinfo/get?pageUrl="+location.href.split('#')[0],function(data,status){
         wx.config({
            debug: true, // 调试时可开启
            appId: 'wxfe7a30139d06a90e', // <!-- replace -->
            timestamp: data.data.timestamp,
            nonceStr: data.data.nonceStr,
            signature: data.data.signature,
            jsApiList: ["checkJsApi", "updateTimelineShareData", 'chooseImage',
                'previewImage', 'onMenuShareTimeline', 'wx-open-launch-weapp'
              ], // 必填,随意一个接口即可 
            openTagList:['wx-open-launch-weapp'], // 填入打开小程序的开放标签名
         })


         wx.error(function (res) {
            alert(JSON.stringify(res))
         });
//          wx.navigateToMiniProgram({
//   appId: 'wxfe7a30139d06a90e',
//   path: 'pages/index/index?source=personalPlan&to=h5tp&linkUrl=https%3A%2F%2Fsales-dev.ihxlife.com%2Fimr%2Fyx_plan%2Fviews%2Fperson_plan%2Fper_produce_plan.html%3FagentCode%3D150007993%26agentState%3D0%26openid%3D%26planNo%3D2022041200000001%26createSource%3Dwmp%26pageName%3Dperson_plan',
//   success(res) {
//     // 打开成功
//   }
// })
$('.hktbtn').click(() =>{
 wx.miniProgram.navigateTo({
   url:'pages/index/index?source=personalPlan&to=h5tp&linkUrl=https%3A%2F%2Fsales-dev.ihxlife.com%2Fimr%2Fyx_plan%2Fviews%2Fperson_plan%2Fper_produce_plan.html%3FagentCode%3D150007993%26agentState%3D0%26openid%3D%26planNo%3D2022041200000001%26createSource%3Dwmp%26pageName%3Dperson_plan' // 小程序配置路径
 })
console.log("点击了会客厅")
})
      });      
   </script>
回答关注问题邀请回答
收藏

2 个回答

  • Jianbo
    Jianbo
    2023-01-03

    你直接参考官方的例子写,不要自己搞一套:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#%E5%BC%80%E6%94%BE%E6%A0%87%E7%AD%BE

    2023-01-03
    有用
    回复 1
  • 郑钱花
    郑钱花
    2023-01-03

    你别放在<wx-open-launch-weapp里面试试

    2023-01-03
    有用
    回复 11
    • 我妈已经三天没打我了
      我妈已经三天没打我了
      2023-01-03
      不太懂,是不要用wx-open-launch-weapp这个标签吗
      2023-01-03
      回复
    • 郑钱花
      郑钱花
      2023-01-03回复我妈已经三天没打我了
      嗯,就是放个btn不要包裹wx-open-launch-weapp。
      2023-01-03
      回复
    • 我妈已经三天没打我了
      我妈已经三天没打我了
      2023-01-03
      2023-01-03
      回复
    • 郑钱花
      郑钱花
      2023-01-03回复我妈已经三天没打我了
      你这网页是不是在小程序web-view中使用啊?
      2023-01-03
      回复
    • 我妈已经三天没打我了
      我妈已经三天没打我了
      2023-01-03回复郑钱花
      是的我现在在用浏览器跳转,但是项目是个app,还能发链接在微信中使用
      2023-01-03
      回复
    查看更多(6)
登录 后发表内容