收藏
回答

JSSDK开放标签wx-open-launch-weapp在IOS无法显示是什么问题?

AppID
wxd553b804c102dfe9

在Android下正常运行,但是在IOS手机上就不显示跳转按钮了

也尝试过去掉 v-if="initDone",,让渲染优先于wx.config,也是一样的效果

实际测试下来,无论在Android还是IOS,wx.ready 都有运行

<template>
  <view>
    <view v-html="wxOpenLaunchWeapp" v-if="initDone"></view>
  </view>
</template>


<script>
export default {
  setup() {
    const initDone = ref(false)
    const wxOpenLaunchWeapp = `<wx-open-launch-weapp id="wx-open-launch-weapp" appid="${appid}" path="${path}">
      <script type="text/wxtag-template">
        <button style="width: 200px; height: 45px; text-align: center; font-size: 17px; display: block; margin: 0 auto; padding: 8px 24px; border: none; border-radius: 4px; background-color: #07c160; color:#fff;">
              打开“云闪付”小程序
            </button>
      <\/script>
    </wx-open-launch-weapp>`
    onMounted(() => {
      wx.config({
        debug: process.env.NODE_ENV === 'development',
        appId: appId,
        timestamp: timestamp,
        nonceStr: nonceStr,
        signature: signature,
        jsApiList: [],
        openTagList: ['wx-open-launch-weapp']
      })
      wx.ready(() => {
        initDone.value = true
      })
    })
    return {
      initDone,
      wxOpenLaunchWeapp,
    }
  }
}
</script>



回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签