Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
zhwy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7d4beb90
authored
Oct 08, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
领取券的merchantid,存用户昵称和头像
1 parent
a8dfa1e0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
12 deletions
api/module/equity.js
packageEquity/pages/freecard/freecard.js
pages/crowdfunding/blank/blank.js
pages/crowdfunding/blank/blank.wxml
api/module/equity.js
View file @
7d4beb9
...
...
@@ -42,6 +42,16 @@ module.exports = {
true
);
},
// 通过scene获取merchantId等信息
sceneGetId
(
data
)
{
return
api
.
post
(
{
method
:
`scrm.api.wechat.get.scene.by.id`
,
...
data
,
},
true
);
},
// 获取商品信息
commodityMsg
(
data
)
{
return
api
.
post
({
...
...
packageEquity/pages/freecard/freecard.js
View file @
7d4beb9
...
...
@@ -88,11 +88,10 @@ Page({
})
},
//
async
tofreeReceive
()
{
const
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
let
{
merchantId
,
phone
}
=
userInfo
const
{
merchantId
}
=
this
.
data
let
{
phone
}
=
userInfo
wx
.
p
.
wxApi
.
showLoading
()
this
.
toPostFreeCard
(
merchantId
,
phone
,
userInfo
)
},
...
...
@@ -115,7 +114,6 @@ Page({
})
return
}
console
.
log
(
res
,
'////'
)
if
(
code
==
0
)
{
// 获取会员卡信息
wx
.
p
.
api
.
equityApi
.
checkOpenMember
().
then
(
res
=>
{
...
...
@@ -170,11 +168,26 @@ Page({
})
},
sceneGetId
(
id
)
{
wx
.
p
.
api
.
equityApi
.
sceneGetId
({
id
}).
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
this
.
setData
({
merchantId
:
data
?.
scene
.
split
(
'='
)[
1
]
})
}
else
{
this
.
showTips
(
message
)
}
})
},
async
onLoad
(
options
)
{
let
system
=
wx
.
getSystemInfoSync
()
const
authStatus
=
await
wx
.
p
.
router
.
intercept
(
false
)
// const { merchantId } = wx.p.storage.get('merchant_info')
// this.toGetFreeCardDay(merchantId)
let
appEnter
=
wx
.
getEnterOptionsSync
()
if
(
appEnter
?.
query
?.
scene
)
{
this
.
sceneGetId
(
decodeURIComponent
(
appEnter
.
query
.
scene
).
split
(
'='
)[
1
])
}
wx
.
p
.
wxApi
.
showLoading
()
const
{
data
,
...
...
@@ -188,9 +201,6 @@ Page({
textpadding
:
system
.
windowHeight
*
0.31
,
authStatus
})
if
(
!
authStatus
)
{
this
.
data
.
userInfo
}
},
onUnload
:
function
()
{
}
...
...
pages/crowdfunding/blank/blank.js
View file @
7d4beb9
// pages/crowdfunding/blank/blank.js
import
USERAPI
from
"~/api/usersApi/index"
;
Page
({
/**
...
...
@@ -11,8 +12,12 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
const
info
=
decodeURIComponent
(
options
.
userProfile
)
async
onLoad
(
options
)
{
const
info
=
JSON
.
parse
(
decodeURIComponent
(
options
.
userProfile
))
const
res
=
await
USERAPI
.
updateUserInfo
({
nickName
:
info
.
nickName
,
avatarUrl
:
info
.
avatarUrl
})
wx
.
p
.
router
.
back
(
res
=>
{
res
.
setData
({
nickName
:
info
.
nickName
,
...
...
pages/crowdfunding/blank/blank.wxml
View file @
7d4beb9
<!--pages/crowdfunding/blank/blank.wxml-->
<text>pages/crowdfunding/blank/blank.wxml</text>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment