Commit 697d9600 by 李伟康

修改分享方法

1 parent 0a6f5abe
......@@ -56,7 +56,7 @@ Page({
/**
* 用户点击右上角分享
*/
// onShareAppMessage() {},
onShareAppMessage() {},
checkLoginBtn(disabled = false) {
const {
loginType
......
/** 分享
* @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
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!