Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
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 697d9600
authored
Oct 12, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改分享方法
1 parent
0a6f5abe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
login/index/index.js
utils/share.js
login/index/index.js
View file @
697d960
...
...
@@ -56,7 +56,7 @@ Page({
/**
* 用户点击右上角分享
*/
//
onShareAppMessage() {},
onShareAppMessage
()
{},
checkLoginBtn
(
disabled
=
false
)
{
const
{
loginType
...
...
utils/share.js
View file @
697d960
/** 分享
* @param {*} shareTitle 分享标题
* @param {*} sharePath 分享页面路径 不传默认当前页
* @param {*} shareImage 分享图片 不传默认当前页面截图
* @param {*} shareQuery 分享页面参数
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @returns
*/
class
Share
{
constructor
()
{
console
.
log
(
'---------------- 分享初始化 ----------------'
)
...
...
@@ -23,16 +31,16 @@ class Share {
shareTitle
,
sharePath
,
shareImage
,
shareQuery
}
=
this
if
(
!
sharePath
)
{
let
url
=
`/
${
this
.
route
}
`
if
(
shareQuery
)
url
+=
`?
${
shareQuery
}
`
sharePath
=
`login/loading/loading?url=
${
encodeURIComponent
(
url
)
}
`
}
shareQuery
,
noPageAuth
}
=
this
,
path
=
`/
${
this
.
route
}
`
if
(
sharePath
)
path
=
`/
${
sharePath
}
`
if
(
shareQuery
)
path
+=
`?
${
shareQuery
}
`
if
(
!
noPageAuth
)
path
=
`/login/loading/loading?url=
${
encodeURIComponent
(
path
)}
`
return
{
path
,
title
:
shareTitle
,
path
:
`/
${
sharePath
}
`
,
imageUrl
:
shareImage
}
}
...
...
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