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
ba96cdec
Commit
ba96cdec
authored
Apr 07, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 分享能力
parent
5bcd54a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
62 deletions
+32
-62
my.vue
src/pages/my/my.vue
+7
-7
web.vue
src/pages/web/web.vue
+25
-55
No files found.
src/pages/my/my.vue
View file @
ba96cdec
...
@@ -123,13 +123,13 @@ export default {
...
@@ -123,13 +123,13 @@ export default {
logoutVisible
:
false
,
logoutVisible
:
false
,
}
}
},
},
//
//
分享给朋友
// 分享给朋友
//
onShareAppMessage() {
onShareAppMessage
()
{
//
return {
return
{
//
title: `壹点灵心理学课程`,
title
:
`壹点灵心理学课程`
,
//
path: `/pages/my/my`,
path
:
`/pages/my/my`
,
//
}
}
//
},
},
computed
:
{
computed
:
{
// 用户基本信息
// 用户基本信息
userInfo
()
{
userInfo
()
{
...
...
src/pages/web/web.vue
View file @
ba96cdec
...
@@ -46,61 +46,31 @@ export default {
...
@@ -46,61 +46,31 @@ export default {
onUnload
()
{
onUnload
()
{
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
},
},
// // 分享给朋友
// 分享给朋友
// onShareAppMessage() {
onShareAppMessage
()
{
// const getSuccessPageUrl = _pagePath => {
const
getDetailPageUrl
=
()
=>
{
// const pageParams = {
let
url
=
this
.
loadUrl
// uid: this.$store.state.user.uid || '',
// 分享页面,去掉登陆信息
// isFromMin: 'weapp',
const
query
=
{
// courseId: this.courseId,
accessToken
:
''
,
// groupRecordId: this.groupRecordId,
uid
:
''
,
// }
timestamp
:
+
new
Date
(),
}
// const urlStr = qs.stringify(pageParams)
// 更新 url 中的参数
// let url = `${hostPrefix}/h5-course/${_pagePath}?${urlStr}`
Object
.
keys
(
query
).
forEach
(
prop
=>
{
url
=
this
.
changeURLArg
(
this
.
loadUrl
,
prop
,
query
[
prop
])
// url = `/pages/web/web?title=${'支付成功'}&loadUrl=${encodeURIComponent(url)}`
})
url
=
`/pages/web/web?loadUrl=
${
encodeURIComponent
(
url
)}
`
// return url
return
url
// }
}
// 课程详情页面
// const getDetailPageUrl = () => {
if
(
this
.
loadUrl
.
includes
(
'h5-course/detail'
))
{
// let url = this.loadUrl
return
{
// // 分享页面,去掉登陆信息
title
:
`课程详情`
,
// const query = {
path
:
getDetailPageUrl
(),
// accessToken: '',
}
// uid: '',
}
// timestamp: +new Date(),
},
// }
// // 更新 url 中的参数
// Object.keys(query).forEach(prop => {
// url = this.changeURLArg(this.loadUrl, prop, query[prop])
// })
// url = `/pages/web/web?loadUrl=${encodeURIComponent(url)}`
// return url
// }
// // 支付成功详情页面
// if (this.loadUrl.includes('pay/groupSuccess')) {
// return {
// title: `支付成功详情`,
// path: getSuccessPageUrl('pay/groupSuccess'),
// }
// }
// if (this.loadUrl.includes('pay/success')) {
// return {
// title: `支付成功详情`,
// path: getSuccessPageUrl('pay/success'),
// }
// }
// if (this.loadUrl.includes('h5-course/detail')) {
// return {
// title: `课程详情`,
// path: getDetailPageUrl(),
// }
// }
// // return {}
// },
mounted
()
{
mounted
()
{
// this.options.scene 无值,说明是非扫描二维码,此时自己拼装路径
// this.options.scene 无值,说明是非扫描二维码,此时自己拼装路径
if
(
!
this
.
options
.
scene
)
{
if
(
!
this
.
options
.
scene
)
{
...
...
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