Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-group-course
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
黄志
ydl-group-course
Commits
8f215cd6
Commit
8f215cd6
authored
Mar 15, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 拼团二维码参数
parent
e83ebbf2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
my.vue
src/pages/my/my.vue
+2
-1
pay.vue
src/pages/pay/pay.vue
+4
-6
web.vue
src/pages/web/web.vue
+22
-5
No files found.
src/pages/my/my.vue
View file @
8f215cd6
...
@@ -211,13 +211,14 @@ export default {
...
@@ -211,13 +211,14 @@ export default {
// const aa =
// const aa =
// 'orderId=90230307003008&totalAmount=0.03&balance=9779&payType=5&title=%E6%94%AF%E4%BB%98%E4%B8%AD%E9%97%B4%E9%A1%B5%E9%9D%A2'
// 'orderId=90230307003008&totalAmount=0.03&balance=9779&payType=5&title=%E6%94%AF%E4%BB%98%E4%B8%AD%E9%97%B4%E9%A1%B5%E9%9D%A2'
// uni.navigateTo({
// uni.navigateTo({
// url: `/pages/pay/pay
?${aa}
`,
// url: `/pages/pay/pay`,
// })
// })
if
(
!
this
.
isLogin
)
{
if
(
!
this
.
isLogin
)
{
this
.
handleLogin
()
this
.
handleLogin
()
return
return
}
}
const
url
=
`
${
hostPrefix
}
/h5-course/my/components/Buylist`
const
url
=
`
${
hostPrefix
}
/h5-course/my/components/Buylist`
// const url = `${hostPrefix}/h5-course/detail/7747?uid&accessToken&appId=wx1106c32a36d87d49&isFromMin=weapp&miniType=groupActivity&ffrom=AppletWechatCourseFuLi×tamp=1678689403156`
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/web/web?title=已购订单&loadUrl=
${
encodeURIComponent
(
url
)}
`
,
url
:
`/pages/web/web?title=已购订单&loadUrl=
${
encodeURIComponent
(
url
)}
`
,
...
...
src/pages/pay/pay.vue
View file @
8f215cd6
<
template
>
<
template
>
<view
class=
"pay-page"
>
<view
class=
"pay-page"
>
<div>
正在支付中.12...
</div>
<div>
正在支付中
</div>
<div>
正在支付中.22...
</div>
<div>
正在支付中.32...
</div>
</view>
</view>
</
template
>
</
template
>
...
@@ -192,14 +190,14 @@ export default {
...
@@ -192,14 +190,14 @@ export default {
title
:
'支付成功'
,
title
:
'支付成功'
,
duration
:
1500
,
duration
:
1500
,
})
})
// todo 如何是 非拼团购买,就跳普通页面。
// 当前只有拼团业务才会被分享出来,在微信小程序中支付
// 当前只有拼团业务才会被分享出来,在微信小程序中支付
const
url
=
`
${
hostPrefix
}
/h5-course/pay/groupSuccess?ccc=qwe&ttt=123`
const
url
=
`
${
hostPrefix
}
/h5-course/pay/groupSuccess?ccc=qwe&ttt=123`
// const url = `${hostPrefix}/h5-course/detail/7934?uid&accessToken&appId=wx1106c32a36d87d49&isFromMin=weapp&miniType=groupActivity&ffrom=AppletWechatCourseFuLi×tamp=1678689403156`
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/web/web?title=
${
url
:
`/pages/web/web?title=
${
'支付成功'
}
&loadUrl=
${
encodeURIComponent
(
url
)}
`
,
this
.
doctor
.
name
?
`
${
this
.
doctor
.
name
}
的评价`
:
''
}
&loadUrl=
${
encodeURIComponent
(
url
)}
`
,
})
})
},
},
},
},
...
...
src/pages/web/web.vue
View file @
8f215cd6
...
@@ -54,7 +54,7 @@ export default {
...
@@ -54,7 +54,7 @@ export default {
methods
:
{
methods
:
{
// 设置页面地址额外的通用参数
// 设置页面地址额外的通用参数
setCommonUrlParams
(
pageUrl
)
{
setCommonUrlParams
(
pageUrl
,
urlParmas
)
{
let
url
=
decodeURIComponent
(
pageUrl
)
let
url
=
decodeURIComponent
(
pageUrl
)
const
query
=
{
const
query
=
{
...
@@ -65,6 +65,7 @@ export default {
...
@@ -65,6 +65,7 @@ export default {
miniType
:
'groupActivity'
,
miniType
:
'groupActivity'
,
ffrom
,
ffrom
,
timestamp
:
+
new
Date
(),
timestamp
:
+
new
Date
(),
...
urlParmas
,
}
}
// 更新 url 中的参数
// 更新 url 中的参数
Object
.
keys
(
query
).
forEach
(
prop
=>
{
Object
.
keys
(
query
).
forEach
(
prop
=>
{
...
@@ -93,12 +94,28 @@ export default {
...
@@ -93,12 +94,28 @@ export default {
.
finally
(()
=>
(
this
.
loading
=
false
))
.
finally
(()
=>
(
this
.
loading
=
false
))
if
(
res
)
{
if
(
res
)
{
// todo
this
.
options
.
courseId
=
res
.
courseId
||
res
.
doctorId
// https://testnewm.ydl.com/h5-course/detail/7529
// https://testnewm.ydl.com/h5-course/detail/7529
const
url
=
`
${
hostPrefix
}
/h5-course/detail/
${
res
.
courseId
||
res
.
doctorId
}
`
const
url
=
`
${
hostPrefix
}
/h5-course/detail/
${
res
.
productId
}
`
this
.
loadUrl
=
this
.
setCommonUrlParams
(
`
${
url
}
`
)
// productId 商品id
// activityId 拼团活动id
// channel 活动渠道
// recordId 成团id
// shareUid 分享人id
// moreId 待定
const
params
=
[
'activityId'
,
'channel'
,
'recordId'
,
'shareUid'
].
reduce
((
acc
,
key
)
=>
{
// groupRecordId
if
(
res
[
key
]
||
res
[
key
]
===
0
)
{
// 为了保证参数连贯性,使用通用的 groupRecordId
if
(
key
===
'recordId'
)
{
acc
[
'groupRecordId'
]
=
res
[
key
]
}
else
{
acc
[
key
]
=
res
[
key
]
}
}
return
acc
},
{})
this
.
loadUrl
=
this
.
setCommonUrlParams
(
`
${
url
}
`
,
params
)
console
.
log
(
res
,
'二维码参数解析'
)
console
.
log
(
res
,
'二维码参数解析'
)
uni
.
hideLoading
()
uni
.
hideLoading
()
}
else
{
}
else
{
...
...
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