Commit c7233570 by 高淑倩

add: 查看微信卡包中的卡券

parent 372b810f
......@@ -82,18 +82,19 @@ Component({
},
handleGoWxCard() {
console.log('kabao')
wxService.openCardList()
// wechatCardId wechatCode
const {wechatCardId,wechatCode} = wx.getStorageSync('_baseUserInfo')
// const {wechatCardId,wechatCode} = wx.getStorageSync('_baseUserInfo')
wx.openCard({
cardList: [{
cardId: wechatCardId,
code: wechatCode
}],
success (res) {
console.log('查看微信卡包中的卡券', res)
}
})
// wx.openCard({
// cardList: [{
// cardId: wechatCardId,
// code: wechatCode
// }],
// success (res) {
// console.log('查看微信卡包中的卡券', res)
// }
// })
}
}
......
......@@ -512,7 +512,9 @@ class WXService extends Http {
// }
// })
}
/**
* 开卡
*/
openCard() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
return new Promise((resolve, reject) => {
......@@ -530,7 +532,25 @@ class WXService extends Http {
}
})
}
/**
* 查看微信卡包中的卡券
*/
openCardList() {
// wechatCardId wechatCode
const {wechatCardId,wechatCode} = wx.getStorageSync('_baseUserInfo')
wx.openCard({
cardList: [{
cardId: wechatCardId,
code: wechatCode
}],
success (res) {
console.log('openCardList success', res)
},
fail(err){
console.log('openCardList fail data is %o', err)
}
})
}
getRandom (num = 1) {
let random = Math.random()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment