Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
c7233570
Commit
c7233570
authored
Jun 14, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 查看微信卡包中的卡券
parent
372b810f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
12 deletions
+33
-12
personCenter.js
src/component/personCenter/personCenter.js
+11
-10
wxService.js
src/utils/wxService.js
+22
-2
No files found.
src/component/personCenter/personCenter.js
View file @
c7233570
...
...
@@ -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)
//
}
//
})
}
}
...
...
src/utils/wxService.js
View file @
c7233570
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment