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 {
logoutVisible
:
false
,
}
},
//
//
分享给朋友
//
onShareAppMessage() {
//
return {
//
title: `壹点灵心理学课程`,
//
path: `/pages/my/my`,
//
}
//
},
// 分享给朋友
onShareAppMessage
()
{
return
{
title
:
`壹点灵心理学课程`
,
path
:
`/pages/my/my`
,
}
},
computed
:
{
// 用户基本信息
userInfo
()
{
...
...
src/pages/web/web.vue
View file @
ba96cdec
...
...
@@ -46,61 +46,31 @@ export default {
onUnload
()
{
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
},
// // 分享给朋友
// onShareAppMessage() {
// const getSuccessPageUrl = _pagePath => {
// const pageParams = {
// uid: this.$store.state.user.uid || '',
// isFromMin: 'weapp',
// courseId: this.courseId,
// groupRecordId: this.groupRecordId,
// }
// const urlStr = qs.stringify(pageParams)
// let url = `${hostPrefix}/h5-course/${_pagePath}?${urlStr}`
// url = `/pages/web/web?title=${'支付成功'}&loadUrl=${encodeURIComponent(url)}`
// return url
// }
// const getDetailPageUrl = () => {
// let url = this.loadUrl
// // 分享页面,去掉登陆信息
// const query = {
// 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 {}
// },
// 分享给朋友
onShareAppMessage
()
{
const
getDetailPageUrl
=
()
=>
{
let
url
=
this
.
loadUrl
// 分享页面,去掉登陆信息
const
query
=
{
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
(
'h5-course/detail'
))
{
return
{
title
:
`课程详情`
,
path
:
getDetailPageUrl
(),
}
}
},
mounted
()
{
// 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