微信小程序开发交流qq群 173683895
承接微信小程序开发。扫码加微信。
小程序实现代码:
onLoad: function(option) {
wx.addCard({
cardList: [{
"cardExt": '{"nonce_str":"42a34c6e84334c69961f5294643ad331","code":"892237947","signature":"6211eb80ec26b4054c566b3a7d1868fa304183f4","timestamp":"1541723819"}',
"cardId": "pCS2i1DQQWELTTEcORmb-irOTRqo"
}],
success(res) {
console.log(res.cardList) // 卡券添加结果
}
})
}
页面加载的时候,调用 wx.addCard API ,如图:领取,然后打开微信卡包页面,领取成功后可点击立即使用,