<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)
}
})
},
是的,跳转其它小程序必须放在点击事件里,有点击操作