收藏
回答

首次长按无法跳转其他小程序,必须点击一下,长按才能跳转?

      <view class="woodenfish" bindtap="retract" bindlongpress="jump" animation="{{animation}}" >
        <image src="{{showWoodenfish == 'mouth'?'../../image/mouth.png':showWoodenfish == 'eyes'?'../../image/eyes.png':'../../image/woodenfish.png'}}"  class="woodenfish-img" mode="widthFix"/>
        <image src="../../image/leftHand.png" mode="widthFix" animation="{{animationLeftHand}}" class="{{showHand=='in'?'left-hand-in':'left-hand'}}"/>
        <image src="../../image/leftHand.png" mode="widthFix" animation="{{animationRightHand}}"  class="{{showHand=='in'?'right-hand-in':'right-hand'}}"/>
      </view>
  jump(e) {
    let url = e.currentTarget.dataset.url
    let extraData = {
      appId: cityConfig[city].appId,
      mchId: cityConfig[city].mchId,
      cityCode: cityConfig[city].cityCode,
      openId: wx.getStorageSync(util.key.openId),
      userPhone: wx.getStorageSync(util.key.userPhone) || '110',
      user_name: wx.getStorageSync(util.key.name),
      user_pic: wx.getStorageSync(util.key.headPortrait),
      city: cityConfig[city].authAddrName,
      userId: wx.getStorageSync(util.key.userid),
    }
    wx.navigateToMiniProgram({
      appId: 'wxa9cef34caa07eb24',
      path: url,
      extraData: extraData,
      envVersion: 'trial',
      success(res) {
        // 打开成功
      },
      fail(res) {
        console.log(res)
      }
    })
  },



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

1 个回答

  • 一笑皆春
    一笑皆春
    04-22

    是的,跳转其它小程序必须放在点击事件里,有点击操作

    04-22
    有用
    回复 2
    • 淡
      04-22
      请问有什么办法解决吗
      04-22
      回复
    • 一笑皆春
      一笑皆春
      04-22回复
      没办法啊,微信就这样要求的
      04-22
      回复
登录 后发表内容