Commit c5bc555a authored by cc's avatar cc

update

parent 31be8815
......@@ -12,7 +12,7 @@ import musicStore from "@/store/musicStore.ts";
import {initWx} from "@/built-in/share/weixin/weixin.ts";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
import { PageCtrl } from "@/core/ctrls/PageCtrl.tsx";
import { GetCurrSkinId, getCustomShareId, isMiniprogram, waitTime } from "@/utils/utils.ts";
import { GetCurrSkinId, getCustomShareId, getUrlParam, isMiniprogram, waitTime } from "@/utils/utils.ts";
import MyPrize from "@/pages/MyPrize/MyPrize.jsx";
import LoadingDemo from "@/pages/LoadingDemo/LoadingDemo.tsx";
......@@ -21,7 +21,7 @@ import GamePage from "@/pages/GamePage/GamePage.tsx";
import HomePage from './pages/HomePage/HomePage.tsx';
import AgentSharepage from './pages/agentSharepage/sharepage.jsx';
import SharePage from './pages/sharepage/sharepage.jsx';
import { onInitShare } from './utils/share.js';
import { onInitShare, onUpdateShare } from './utils/share.js';
import { domain, ensureDomain } from "@spark/dbdomain";
import shareStore from './store/share.js';
......@@ -58,8 +58,35 @@ class App extends Component {
if(isMiniprogram()){ //小程序域名写死
CFG.domain = "https://96094-2-activity.dexfu.cn";
}
await waitTime(1)
shareStore.initShare()
// await waitTime(0)
// shareStore.initShare()
setTimeout(()=>{
const shareInfo = JSON.parse(store.frontVariable.shareInfo);
if (skinId == 'index') { // 首页
console.info('首页');
let shareUrl = `${CFG.domain}${CFG.shareUrl}`;
shareUrl += `&ykCode=${CFG.workerCode || CFG.agentCode || ""}`
shareUrl += `&channel=${CFG.defaultChannel}&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""}&actId=${CFG.actId || ""}`
onUpdateShare({
title: shareInfo?.title,
content: shareInfo?.content,
thumbnail: shareInfo?.thumbnail,
url: `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(shareUrl)}`
});
} else {
console.info('非首页');
const inviteCode = getUrlParam("inviteCode");
let shareUrl = `${CFG.domain}${CFG.shareUrl}${getUrlParam("inviteCode") ? '&inviteCode=' + getUrlParam("inviteCode") : ""}`;
shareUrl += `&ykCode=${CFG.workerCode || CFG.agentCode || ""}`
if (CFG.channel) shareUrl += `&channel=${CFG.defaultChannel}&agentCode=${CFG.agentCode || ""}&actPlatforms=${CFG.actPlatforms || ""}&actId=${CFG.actId || ""}`
onUpdateShare({
title: inviteCode && inviteCode != '' ? shareInfo?.titleInvite : shareInfo?.title,
content: inviteCode && inviteCode != '' ? shareInfo?.contentInvite : shareInfo?.content,
thumbnail: shareInfo?.thumbnail,
url: `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(shareUrl)}`
});
}
},0)
}
componentWillUnmount() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment