Commit c7233570 by 高淑倩

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

parent 372b810f
...@@ -82,18 +82,19 @@ Component({ ...@@ -82,18 +82,19 @@ Component({
}, },
handleGoWxCard() { handleGoWxCard() {
console.log('kabao') console.log('kabao')
wxService.openCardList()
// wechatCardId wechatCode // wechatCardId wechatCode
const {wechatCardId,wechatCode} = wx.getStorageSync('_baseUserInfo') // const {wechatCardId,wechatCode} = wx.getStorageSync('_baseUserInfo')
wx.openCard({ // wx.openCard({
cardList: [{ // cardList: [{
cardId: wechatCardId, // cardId: wechatCardId,
code: wechatCode // code: wechatCode
}], // }],
success (res) { // success (res) {
console.log('查看微信卡包中的卡券', res) // console.log('查看微信卡包中的卡券', res)
} // }
}) // })
} }
} }
......
...@@ -512,7 +512,9 @@ class WXService extends Http { ...@@ -512,7 +512,9 @@ class WXService extends Http {
// } // }
// }) // })
} }
/**
* 开卡
*/
openCard() { openCard() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -530,7 +532,25 @@ class WXService extends Http { ...@@ -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) { getRandom (num = 1) {
let random = Math.random() 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