2 回复
微信API: wx.openCard
具体实现:从后台拉取卡券id列表;再调用wx.openCard
openWxCard:function(){
let params = {
data: {},
url: xxx
}
wx.ajax(params, "POST").then(res => {
if (res.data.data!=''){
res = res.data.data.map(val => {
return { cardId: val.card_id, code: val.code }
})
wx.openCard({
cardList: res,
success(res) { }
})
}else{
wx.commonJs.tip('您的卡包为空!', 'none')
}
}).catch(res => {
wx.commonJs.tip('打开卡包失败', 'none')
})
},