微信小程序–开卡组件
查看具体参数配置
navigator
组件的extra-data
属性
encrypt_card_id , outer_str ,biz
具体文档:微信小程序–会员卡组件
- 使用
navigator
组件
<navigator bindcomplete="bindcomplete" target="miniProgram" app-id="wxeb490c6f9b154ef9" extra-data="{{wxExtraData}}">领取会员卡</navigator>
data:{
wxExtraData: {
'encrypt_card_id': decodeURIComponent('9wLA7RVjx9wVnM9iZY%2BVftvvUC26%2F%2FUFdpfUTYHWFbBi9V1vU8ZdelEMPEQ6usuh'),
'outer_str': '1',
'biz': decodeURIComponent('MzU2NzQxNTg3Mw%3D%3D')
}
},
bindcomplete(res) {
console.log(res)
},
2.使用 wx.navigateToMiniProgram
api
* navigateToMiniProgram
接口即将废弃,新版本中请使用navigator
组件来使用此功能
<view bindtap="card">领取会员卡</view>
card(){
wx.navigateToMiniProgram({
appId: 'wxeb490c6f9b154ef9', //固定为此 appid,不可改动
//包括 encrypt_card_id, outer_str, biz三个字段,须从 step3 中获得的链接中获取参数
extraData: this.data.wxExtraData,
success: function (res) {
console.log(res)
},
fail: function (err) {
console.log(err)
},
complete: function () {}
})
},
不管是navigator
组件 还是 navigateToMiniProgram
接口都需要在app.json
中配置,才能跳转到开卡小程序
"navigateToMiniProgramAppIdList": [
"wxeb490c6f9b154ef9"
],