Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RB_StrongestBrain_250520
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
RB_StrongestBrain_250520
Commits
c70332dc
Commit
c70332dc
authored
May 21, 2025
by
cc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f016a81b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
448 additions
and
38 deletions
+448
-38
index.html
index.html
+25
-0
index.ts
mock/index.ts
+6
-12
task.ts
mock/task.ts
+2
-2
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+1
-1
MyPrize.tsx
src/pages/MyPrize/MyPrize.tsx
+2
-2
FillAddress.jsx
src/panels/FillAddress/FillAddress.jsx
+3
-3
longImgPop.jsx
src/panels/longImgPop/longImgPop.jsx
+0
-0
selectmodal.jsx
src/panels/selectmodal/selectmodal.jsx
+0
-0
taskpop.jsx
src/panels/taskpop/taskpop.jsx
+4
-5
share.ts
src/store/share.ts
+314
-0
task.ts
src/store/task.ts
+3
-3
share.ts
src/utils/share.ts
+88
-10
No files found.
index.html
View file @
c70332dc
...
...
@@ -50,8 +50,33 @@
}
// 免登中间页
CFG
.
loginMidUrl
=
"/customShare/share?id="
+
CFG
.
loginMidId
+
"&source=duiba&projectId="
+
CFG
.
projectId
+
"&redirectUrl="
;
CFG
.
domain
=
location
.
origin
;
//actPlatforms
CFG
.
actPlatforms
=
getUrlParam
(
"actPlatforms"
)
||
""
;
//actPlatforms
CFG
.
agentCode
=
getUrlParam
(
"agentCode"
)
||
""
;
//actPlatforms
CFG
.
actId
=
getUrlParam
(
"actId"
)
||
""
;
// 特殊的业务员code
CFG
.
spcCode
=
getUrlParam
(
"code"
)
||
""
;
// 业务员code
CFG
.
workerCode
=
getUrlParam
(
"ykCode"
)
||
CFG
.
spcCode
;
// 渠道 1-9
CFG
.
channel
=
getUrlParam
(
"channel"
)
||
"2"
;
// 默认渠道 除了友客渠道,其他统一按照2处理
// CFG.defaultChannel = CFG.channel == 5 ? 5 : CFG.channel == 3 ? 3 : 2;
CFG
.
defaultChannel
=
CFG
.
channel
||
"2"
;
// 助力参数
CFG
.
inviteCode
=
getUrlParam
(
"inviteCode"
);
// 微信授权链接
CFG
.
indexLogin
=
"/wechat/access?apk=4AoRyTuR6XNfjNa4w5exe1bPmqDS&dbredirect="
;
// 普通分享落地页
CFG
.
shareUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/sharepage.html?appID="
+
getUrlParam
(
"appID"
);
// CFG.shareUrl = '/projectx/' + CFG.projectId + '/share.html?appKey=4AoRyTuR6XNfjNa4w5exe1bPmqDS&openBs=openbs&appID=' + CFG.appID;
// 普通分享落地页
CFG
.
fireShareUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/firesharepage.html?appID="
+
getUrlParam
(
"appID"
);
if
(
!
getUrlParam
(
"appID"
))
{
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
...
...
mock/index.ts
View file @
c70332dc
...
...
@@ -25,18 +25,12 @@ export default [
"test_config_02"
:
"111"
,
// 规则长图
"ruleImg"
:
'//yun.duiba.com.cn/polaris/bg.18539c61e0103e01a339dd268558b2559ab178ba.png'
,
shareInfo
:
[
{
"title"
:
'normal'
,
"desc"
:
'2025年“3·15”金融消费者权益保护教育宣传活动'
,
"imgUrl"
:
'//yun.duiba.com.cn/polaris/image.42930d3760a71de0c9b80cb7481767718dca11d3.png'
},
{
"title"
:
'invite'
,
"desc"
:
'2025年“3·15”金融消费者权益保护教育宣传活动'
,
"imgUrl"
:
'//yun.duiba.com.cn/polaris/image%20(1).aba678324b060ee2050bbdaf83c05c8ddb3a3dd2.png'
}
],
shareInfo
:
JSON
.
stringify
({
"title"
:
"许愿迎新春"
,
"content"
:
"参与活动生成你的专属烟花吧~"
,
"thumbnail"
:
"https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg"
,
"imgUrl"
:
"https://yun.duiba.com.cn/polaris/%E6%9C%AA%E6%A0%87%E9%A2%98-1.501ac89a8b4c601209edf8b9c3b67fd5228f1ed8.jpg"
}),
shopUrl
:
'https://'
}
}
...
...
mock/task.ts
View file @
c70332dc
...
...
@@ -106,7 +106,7 @@ export default [
item
:
[
{
buttonText
:
"去完成"
,
code
:
"
browser_zeng_yuan_1
"
,
code
:
"
common_invite
"
,
completedSize
:
1
,
desc
:
null
,
extra
:
'{"answerTimes":0,"drawTimes":0}'
,
...
...
@@ -138,7 +138,7 @@ export default [
ruleId
:
"spPrize@sp_draw_times@1"
,
sendPrize
:
true
,
subTitle
:
"抽奖次数+1抽奖次数+1抽奖次数+1"
,
taskStatus
:
2
,
taskStatus
:
0
,
title
:
"邀请任务"
,
},
{
...
...
src/pages/HomePage/HomePage.tsx
View file @
c70332dc
...
...
@@ -10,7 +10,7 @@ import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import
Rulepop
from
"../../components/rulepop/rulepop.jsx"
;
import
DrawPage
from
"../DrawPage/DrawPage.jsx"
;
import
store
from
'@/store/store'
;
import
Taskpop
from
'@/panels/taskpop/taskpop.js'
;
import
Taskpop
from
'@/panels/taskpop/taskpop.js
x
'
;
import
RankPage
from
'../RankPage/RankPage.js'
;
import
MyPrize
from
'../MyPrize/MyPrize.js'
;
...
...
src/pages/MyPrize/MyPrize.tsx
View file @
c70332dc
...
...
@@ -9,8 +9,8 @@ import { isWeChat } from '@/utils/share';
import
store
from
'@/store/store'
;
import
{
ModalCtrl
}
from
'@/core/ctrls/ModalCtrl'
;
import
SignSucPanel
from
'@/panels/SignSucPanel/SignSucPanel'
;
import
{
Axios
,
AxiosRequestConfig
}
from
'axios'
;
import
FillAddress
from
'@/panels/FillAddress/FillAddress'
;
import
{
Axios
}
from
'axios'
;
import
FillAddress
from
'@/panels/FillAddress/FillAddress
.jsx
'
;
const
apiAxios
=
new
Axios
({
timeout
:
10000
,
});
...
...
src/panels/FillAddress/FillAddress.
t
sx
→
src/panels/FillAddress/FillAddress.
j
sx
View file @
c70332dc
...
...
@@ -4,14 +4,14 @@ import "./FillAddress.less";
import
{
REG_TEL
,
_throttle
}
from
"@/utils/utils.ts"
;
import
{
Toast
}
from
"@grace/ui"
;
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl"
;
import
{
Axios
,
AxiosRequestConfig
}
from
'axios'
;
import
Selectmodal
from
"../selectmodal/selectmodal"
;
import
{
Axios
}
from
'axios'
;
import
Selectmodal
from
"../selectmodal/selectmodal
.jsx
"
;
const
apiAxios
=
new
Axios
({
timeout
:
10000
,
});
// wzjTODO 换皮
@
observer
class
FillAddress
extends
React
.
Component
<
any
,
any
>
{
class
FillAddress
extends
React
.
Component
{
fillMd
=
false
state
=
{
name
:
""
,
...
...
src/panels/longImgPop/longImgPop.
t
sx
→
src/panels/longImgPop/longImgPop.
j
sx
View file @
c70332dc
File moved
src/panels/selectmodal/selectmodal.
t
sx
→
src/panels/selectmodal/selectmodal.
j
sx
View file @
c70332dc
File moved
src/panels/taskpop/taskpop.
t
sx
→
src/panels/taskpop/taskpop.
j
sx
View file @
c70332dc
...
...
@@ -5,12 +5,11 @@ import { observer } from 'mobx-react';
import
'./taskpop.less'
;
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
'@/core/page-visibility-notify.ts'
;
// import { handleLogClick, handleLogExposure } from '../../../MD';
import
{
RES_PATH
}
from
'../../../sparkrc'
;
import
{
_throttle
}
from
'../../utils/utils'
;
//
import { RES_PATH } from '../../../sparkrc';
import
{
_throttle
}
from
'../../utils/utils
.ts
'
;
import
{
TASK_CODE
,
CHANNEL_PARAMS
}
from
'../../utils/constants.ts'
;
import
{
setCookies
}
from
'../../store/fetcher'
;
import
taskStore
from
'../../store/task'
;
import
store
from
'../../store'
;
import
{
setCookies
}
from
'../../store/fetcher.ts'
;
import
taskStore
from
'../../store/task.ts'
;
// import { LOG_KEY, MatterShareOpt, MatterViewOpt, pageView, sensorLog } from '../../utils/sensors';
import
{
ModalCtrl
}
from
'@/core/ctrls/ModalCtrl'
;
import
{
Button
}
from
'@grace/ui'
;
...
...
src/store/share.ts
0 → 100644
View file @
c70332dc
import
{
makeAutoObservable
}
from
"mobx"
;
import
API
from
"../api/index"
;
import
{
showShareGuide
}
from
"@spark/share"
;
import
store
from
"./store"
;
import
{
isIos
,
isWeChat
,
onUpdateShare
}
from
"@/utils/share"
;
import
{
isMiniprogram
,
windowJumpUrl
}
from
"@/utils/utils"
;
// import modalStore from "./modal";
import
{
Toast
}
from
"@grace/ui"
;
function
isEnterpriseWeChat
()
{
//企业微信
const
userAgent
=
navigator
.
userAgent
.
toLowerCase
();
return
/wxwork/
.
test
(
userAgent
);
// 检查是否包含 "wxwork"
}
const
shareStore
=
makeAutoObservable
({
/** 普通分享 */
async
doShare
()
{
const
shareInfo
=
JSON
.
parse
(
store
.
frontVariable
.
shareInfo
);
if
(
isWeChat
())
{
// 微信环境分享
const
_url
=
`
${
CFG
.
domain
}${
CFG
.
indexLogin
}${
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
shareUrl
}${
`&ykCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
||
""
}
`
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)}
`
;
console
.
info
(
"分享链接"
,
_url
);
if
(
isMiniprogram
())
{
const
query
=
JSON
.
stringify
({
imgUrl
:
shareInfo
?.
imgUrl
,
isYKShare
:
"1"
,
link
:
_url
,
title
:
shareInfo
?.
title
,
});
// 小程序
wx
.
miniProgram
.
navigateTo
({
url
:
`/subpackages/h5/miniProgramWebShare/index?YKMiniprogramShare=
${
encodeURIComponent
(
query
)}
`
,
});
}
else
if
(
isEnterpriseWeChat
())
{
//微通 (企业微信)
location
.
href
=
`https://mtest.picclife.cn/refactor-web/index.html?v=
${
Date
.
now
()}
#/duibaSharePage?link=
${
encodeURIComponent
(
_url
)}
&title=
${
shareInfo
?.
title
}
&
desc
=
$
{
shareInfo
?.
content
}
&
imgUrl
=
$
{
shareInfo
?.
imgUrl
}
`;
} else {
showShareGuide();
//H5
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
// app参数
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
shareUrl
}${
`&ykCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
||
""
}
`
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)}
`;
console.info("分享链接", _url);
if (CFG.channel == "1") {
//管家
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
if (CFG.channel == "6") {
//e通
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
url: _url,
thumbImage: shareInfo.thumbnail,
};
window.inAppShare({
type: "shareLink",
activity: "richMan",
params: JSON.stringify(params),
});
}
}
},
/** 邀请好友 */
async doInvite() {
const shareInfo = JSON.parse(store.frontVariable.shareInfo);
const { success, data } = await API.getInviteCode();
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
shareUrl
}${
CFG
.
workerCode
?
`&ykCode=
${
CFG
.
workerCode
}
`
:
""
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
`
+
(
data
?.
inviteCode
?
`&inviteCode=
${
data
.
inviteCode
}
`
:
""
)
+
`&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)}
`;
console.info("分享链接>>>", _url);
// const { success:success2, data:data2 } = await API.getLongLinkQrcode({
// width: 220,
// height: 220,
// content: encodeURIComponent(_url),
// });
// return data2;
if (success) {
if (isWeChat()) {
// 微信环境分享
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
shareUrl
}${
CFG
.
workerCode
?
`&ykCode=
${
CFG
.
workerCode
}
`
:
""
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
`
+
(
data
?.
inviteCode
?
`&inviteCode=
${
data
.
inviteCode
}
`
:
""
)
+
`&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)}
`;
console.info("分享链接>>>", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `
/
subpackages
/
h5
/
miniProgramWebShare
/
index
?
YKMiniprogramShare
=
$
{
encodeURIComponent
(
query
)}
`,
});
} else if (isEnterpriseWeChat()) {
location.href = `
https
:
//m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}
&
title
=
$
{
shareInfo
?.
title
}
&
desc
=
$
{
shareInfo
?.
content
}
&
imgUrl
=
$
{
shareInfo
?.
imgUrl
}
`;
} else {
showShareGuide();
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
shareUrl
}${
CFG
.
workerCode
?
`&ykCode=
${
CFG
.
workerCode
}
`
:
""
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
`
+
(
data
?.
inviteCode
?
`&inviteCode=
${
data
.
inviteCode
}
`
:
""
)
+
`&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)}
`;
console.info("分享链接>>>", _url);
// app参数
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
}
},
/** 助力 */
async doAssist() {
if (!CFG.inviteCode) return false;
console.info("进入助力!!!");
if (sessionStorage.getItem("inviteCode")) return false;
const { success, code, data, message } = await API.doAssist({ inviteCode: CFG.inviteCode });
if (success) {
Toast.show("助力成功~")
// modalStore.pushPop("Assistsuccesspop");
// modalStore.pushPop("AssistSuccess");
} else {
// modalStore.pushPop("AssistFail", {message, code});
// modalStore.pushPop("Assistfailpop", { message, code });
}
sessionStorage.setItem("inviteCode", CFG.inviteCode);
history.replaceState({}, "", location.href.replace(new RegExp(`
[?
&
]
inviteCode
=
[
^&
]
*
`), ""));
},
/** 奖品页唤端 */
goAppPrize() {
// windowJumpUrl(CFG.toAppPrizeUrl);
//CFG.projectId三元判断为真,前面的是正式,需要修改的地方为中间页链接,可咨询东哥链接(奖品页唤端) ios需要多encode一次
const testCustomId = "Did1NTkyODc";
const prodCustomId = "Did1NTk0MzE";
windowJumpUrl(
CFG.projectId == "pafc25ff1"
? "https://lifeapp.picclife.cn/portal/app_manager/downloadapps.html?operate_link=" +
encodeURIComponent(
`
https
:
//lifeapp-api.picclife.cn/lifeapi/lifeapp-svc-gw/api/auth_code/authorize/v1?activity_code=612702&redirect_type=0&redirect_uri=${isIos()
?
encodeURIComponent
(
encodeURIComponent
(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=
${
prodCustomId
}
`
+
`&channel=
${
CFG
.
defaultChannel
}
&agentCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)
)
:
encodeURIComponent
(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=
${
prodCustomId
}
`
+
`&channel=
${
CFG
.
defaultChannel
}
&agentCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)
}
`
) +
"&isBindManager=1&isNeedAuth=1&operate_type=3"
: "https://lifeapp-test.picclife.cn/portal-web/app_manager/downloadapps.html?operate_link=" +
encodeURIComponent(
`
https
:
//lifeapp-api-test.picclife.cn/lifeapi/lifeapp-svc-rel-gw/api/auth_code/authorize/v1?activity_code=612702&redirect_type=0&redirect_uri=${isIos()
?
encodeURIComponent
(
encodeURIComponent
(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=
${
testCustomId
}
`
+
`&channel=
${
CFG
.
defaultChannel
}
&agentCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)
)
:
encodeURIComponent
(
`https://96094.activity-19.m.duiba.com.cn/customShare/share?id=
${
testCustomId
}
`
+
`&channel=
${
CFG
.
defaultChannel
}
&agentCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
`
)
}
`
) +
"&isBindManager=1&isNeedAuth=1&operate_type=3"
);
},
/** 烟花分享 */
async doFireShare(fireType, fireLab, withGuide = true) {
const shareInfo = JSON.parse(store.frontVariable.fireShareInfo);
if (isWeChat()) {
// 微信环境分享
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
fireShareUrl
}${
`&ykCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
||
""
}
`
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
&fireType=
${
fireType
}
&fireLab=
${
encodeURIComponent
(
encodeURIComponent
(
fireLab
))}
`
)}
`;
console.info("分享链接", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `
/
subpackages
/
h5
/
miniProgramWebShare
/
index
?
YKMiniprogramShare
=
$
{
encodeURIComponent
(
query
)}
`,
});
} else if (isEnterpriseWeChat()) {
//微通 (企业微信)
location.href = `
https
:
//m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}
&
title
=
$
{
shareInfo
?.
title
}
&
desc
=
$
{
shareInfo
?.
content
}
&
imgUrl
=
$
{
shareInfo
?.
imgUrl
}
`;
} else {
if(withGuide){
showShareGuide();
}
//H5
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
// app参数
const _url = `
$
{
CFG
.
domain
}
$
{
CFG
.
indexLogin
}
$
{
encodeURIComponent
(
`
${
CFG
.
domain
}${
CFG
.
fireShareUrl
}${
`&ykCode=
${
CFG
.
workerCode
||
CFG
.
agentCode
||
""
}
`
}${
`&channel=
${
CFG
.
defaultChannel
}
`
}
&agentCode=
${
CFG
.
agentCode
}
&actPlatforms=
${
CFG
.
actPlatforms
}
&actId=
${
CFG
.
actId
}
&fireType=
${
fireType
}
&fireLab=
${
encodeURIComponent
(
fireLab
)}
`
)}
`;
console.info("分享链接", _url);
if (CFG.channel == "1") {
//管家
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
if (CFG.channel == "6") {
//e通
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
url: _url,
thumbImage: shareInfo.thumbnail,
};
window.inAppShare({
type: "shareLink",
activity: "richMan",
params: JSON.stringify(params),
});
}
}
},
});
export default shareStore;
src/store/task.ts
View file @
c70332dc
...
...
@@ -3,14 +3,14 @@ import API from "../api/index";
import
store
from
"./store"
;
// import modalStore from "./modal";
import
{
saveCookies
,
setCookies
}
from
"./fetcher"
;
//
import shareStore from "./share";
import
shareStore
from
"./share"
;
// import { handleLogClick } from "../../MD";
import
{
isWeChat
}
from
"../utils/share"
;
import
{
appJump
,
getUrlParam
,
windowJumpUrl
}
from
"../utils/utils"
;
import
{
CHANNEL_PARAMS
,
TASK_CODE
}
from
"../utils/constants"
;
import
{
Toast
}
from
"@grace/ui"
;
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl"
;
import
LongImgPop
from
"@/panels/longImgPop/longImgPop"
;
import
LongImgPop
from
"@/panels/longImgPop/longImgPop
.jsx
"
;
const
taskStore
=
makeAutoObservable
({
/** 当前任务 */
...
...
@@ -47,7 +47,7 @@ const taskStore = makeAutoObservable({
//邀请
case
code
==
TASK_CODE
.
INVITE
:
console
.
info
(
"邀请任务"
);
//
const res = await shareStore.doInvite();
const
res
=
await
shareStore
.
doInvite
();
// modalStore.pushPop("Shareposter", { qrCode: res }, true);
break
;
//增员介绍 海报or视频
...
...
src/utils/share.ts
View file @
c70332dc
/** 判断微信环境 */
export
function
isWeChat
()
{
if
(
typeof
window
===
'undefined'
)
return
false
import
{
start
,
updateShare
,
callShare
,
Weixin
,
}
from
"@spark/share"
/**
* @description: 小程序跳转
* @param {*}
* @return {*}
*/
export
const
miniGoUrl
=
(
url
)
=>
{
wx
.
miniProgram
.
navigateTo
({
url
:
url
});
}
/**
* 判断是否为ios系统
*/
export
function
isIos
()
{
return
navigator
.
userAgent
.
match
(
/iphone|ipod|ipad/gi
)
}
/** 判断微信环境 */
export
function
isWeChat
()
{
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
()
return
ua
.
includes
(
'micromessenger'
)
}
return
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
}
/**
* 初始化分享
*/
export
async
function
onInitShare
(
cb
)
{
await
start
([
Weixin
],
function
(
success
)
{
console
.
log
(
"share result:----"
,
success
)
cb
&&
cb
()
})
}
/**
* 更新分享
* @param {*} shareParams
* @param {*} justUpdate
*/
export
function
onUpdateShare
(
shareParams
)
{
console
.
info
(
"更新分享"
,
shareParams
)
updateShare
(
shareParams
)
}
/**
* 被动分享 - 北京银行
* @param {*} shareParams
*/
export
function
onCallShare
(
shareParams
)
{
console
.
info
(
"分享链接"
,
shareParams
)
callShare
(
shareParams
);
}
/**
* @description: 分享处理中心
* @param {Object} 分享信息
*/
export
const
requireShare
=
(
opts
)
=>
{
const
shareData
=
{
title
:
opts
.
shareTitle
,
content
:
opts
.
shareContent
,
url
:
opts
.
shareUrl
,
images
:
[{
image
:
opts
.
shareThumbnail
,
type
:
"url"
}],
};
console
.
log
(
'分享数据'
,
opts
);
const
shareStr
=
JSON
.
stringify
(
shareData
);
return
shareStr
;
};
/**
* @description: 小程序分享
* @param {*}
* @return {*}
*/
export
const
miniDoShare
=
(
opts
)
=>
{
console
.
log
(
opts
);
wx
.
miniProgram
.
postMessage
({
data
:
{
title
:
opts
.
title
,
// 标题
desc
:
opts
.
desc
,
// 描述
imgUrl
:
opts
.
imgUrl
,
// 图片
link
:
opts
.
link
// 链接
}
});
}
\ No newline at end of file
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