Commit cf74aa03 authored by 徐士卿's avatar 徐士卿

Merge branch 'master' of gitlab2.dui88.com:sparkprojects/rb_strongestbrain_250520

parents 720b60e9 e5ed2221
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
} }
</script> </script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script> <script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script> <script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script>
<script> <script>
var CFG = CFG || {}; var CFG = CFG || {};
...@@ -102,10 +102,10 @@ ...@@ -102,10 +102,10 @@
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。") // alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
} }
</script> </script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/index-uFdykkeP.js"></script> <script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/index-DqB_LzPR.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/vendor-BJar7ySo.js"> <link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/vendor-DvLFc5g7.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/vendor-NZxPxbcK.css"> <link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/vendor-NZxPxbcK.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/index--VpasE-9.css"> <link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/index-CTzjUCWK.css">
<script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script> <script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script> <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head> </head>
...@@ -113,8 +113,8 @@ ...@@ -113,8 +113,8 @@
<body> <body>
<div id="root"></div> <div id="root"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script> <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/polyfills-legacy-C2MhNPfJ.js"></script> <script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1748416515495/assets/index-legacy-CGjy4lnj.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script> <script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1748425197630/assets/index-legacy-DaRtJGQh.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
} }
</script> </script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script> <script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script> <script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script>
<script> <script>
var CFG = CFG || {}; var CFG = CFG || {};
......
...@@ -12,7 +12,7 @@ import musicStore from "@/store/musicStore.ts"; ...@@ -12,7 +12,7 @@ import musicStore from "@/store/musicStore.ts";
import {initWx} from "@/built-in/share/weixin/weixin.ts"; import {initWx} from "@/built-in/share/weixin/weixin.ts";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx"; import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
import { PageCtrl } from "@/core/ctrls/PageCtrl.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 MyPrize from "@/pages/MyPrize/MyPrize.jsx";
import LoadingDemo from "@/pages/LoadingDemo/LoadingDemo.tsx"; import LoadingDemo from "@/pages/LoadingDemo/LoadingDemo.tsx";
...@@ -21,7 +21,7 @@ import GamePage from "@/pages/GamePage/GamePage.tsx"; ...@@ -21,7 +21,7 @@ import GamePage from "@/pages/GamePage/GamePage.tsx";
import HomePage from './pages/HomePage/HomePage.tsx'; import HomePage from './pages/HomePage/HomePage.tsx';
import AgentSharepage from './pages/agentSharepage/sharepage.jsx'; import AgentSharepage from './pages/agentSharepage/sharepage.jsx';
import SharePage from './pages/sharepage/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 { domain, ensureDomain } from "@spark/dbdomain";
import shareStore from './store/share.js'; import shareStore from './store/share.js';
...@@ -36,10 +36,10 @@ class App extends Component { ...@@ -36,10 +36,10 @@ class App extends Component {
showDefaultPage = () => { showDefaultPage = () => {
const skinId = GetCurrSkinId() || getCustomShareId(); const skinId = GetCurrSkinId() || getCustomShareId();
const defaultPage = { const defaultPage = {
myPrize: MyPrize, // TODO 举例子 新宿台奖品页 prize: MyPrize, // TODO 举例子 新宿台奖品页
index: HomePage, index: HomePage,
sharepage:SharePage, sharepage:SharePage,
}[skinId] || SharePage; }[skinId] || HomePage;
PageCtrl.changePage(CFG.agentShare == "1" ? AgentSharepage : defaultPage); PageCtrl.changePage(CFG.agentShare == "1" ? AgentSharepage : defaultPage);
} }
...@@ -52,14 +52,41 @@ class App extends Component { ...@@ -52,14 +52,41 @@ class App extends Component {
this.showDefaultPage(); this.showDefaultPage();
await store.getFrontVariable(); await store.getFrontVariable();
await onInitShare();
await ensureDomain(); await ensureDomain();
CFG.domain = domain; CFG.domain = domain;
if(isMiniprogram()){ //小程序域名写死 if(isMiniprogram()){ //小程序域名写死
CFG.domain = "https://96094-activity.dexfu.cn"; CFG.domain = "https://96094-2-activity.dexfu.cn";
} }
await waitTime(1) // await waitTime(0)
shareStore.initShare() // 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() { componentWillUnmount() {
......
...@@ -21,6 +21,7 @@ import { CHANNEL_PARAMS, extranceName } from '@/utils/constants.js'; ...@@ -21,6 +21,7 @@ import { CHANNEL_PARAMS, extranceName } from '@/utils/constants.js';
import gameStore from "@/store/gameStore.ts"; import gameStore from "@/store/gameStore.ts";
import GamePage from "@/pages/GamePage/GamePage.tsx"; import GamePage from "@/pages/GamePage/GamePage.tsx";
import MusicBtn from '@/core/components/MusicBtn/MusicBtn.tsx'; import MusicBtn from '@/core/components/MusicBtn/MusicBtn.tsx';
import { onInitShare } from '@/utils/share.ts';
@observer @observer
class Homepage extends React.Component { class Homepage extends React.Component {
...@@ -34,6 +35,7 @@ class Homepage extends React.Component { ...@@ -34,6 +35,7 @@ class Homepage extends React.Component {
if (isWeiXin()) { if (isWeiXin()) {
if (!await store.checkBindStatus()) return; if (!await store.checkBindStatus()) return;
} }
await onInitShare();
await shareStore.doAssist(); await shareStore.doAssist();
await store.updateIndex(); await store.updateIndex();
this.initSensor(); this.initSensor();
......
...@@ -8,6 +8,7 @@ import { PageCtrl } from "@/core/ctrls/PageCtrl.tsx"; ...@@ -8,6 +8,7 @@ import { PageCtrl } from "@/core/ctrls/PageCtrl.tsx";
import { isWeChat } from '@/utils/share.ts'; import { isWeChat } from '@/utils/share.ts';
import store from '@/store/store'; import store from '@/store/store';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl'; import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import HomePage from '../HomePage/HomePage.tsx';
import {Axios} from 'axios'; import {Axios} from 'axios';
import FillAddress from '@/panels/FillAddress/FillAddress.jsx'; import FillAddress from '@/panels/FillAddress/FillAddress.jsx';
import { LOG_KEY, MatterShareOpt, MatterViewOpt, pageView, sensorLog,MatterViewDuration } from '../../utils/sensors.js'; import { LOG_KEY, MatterShareOpt, MatterViewOpt, pageView, sensorLog,MatterViewDuration } from '../../utils/sensors.js';
...@@ -211,7 +212,8 @@ class MyPrize extends React.Component { ...@@ -211,7 +212,8 @@ class MyPrize extends React.Component {
page_name: "我的奖品页", page_name: "我的奖品页",
button_name: "返回按钮", button_name: "返回按钮",
}); });
PageCtrl.backPage(); // PageCtrl.backPage();
PageCtrl.changePage(HomePage);
} }
......
...@@ -11,6 +11,7 @@ import API from "@/api"; ...@@ -11,6 +11,7 @@ import API from "@/api";
// import modalStore from "@src/store/modal"; // import modalStore from "@src/store/modal";
import { handleLogClick, handleLogExposure } from "../../MD"; import { handleLogClick, handleLogExposure } from "../../MD";
import { LOG_KEY, MatterViewDuration, MatterViewOpt, sensorLog } from "../../utils/sensors.js"; import { LOG_KEY, MatterViewDuration, MatterViewOpt, sensorLog } from "../../utils/sensors.js";
import { _throttle } from "@/utils/utils.js";
@observer @observer
class Sharepage extends React.Component { class Sharepage extends React.Component {
...@@ -27,7 +28,7 @@ class Sharepage extends React.Component { ...@@ -27,7 +28,7 @@ class Sharepage extends React.Component {
async componentDidMount() { async componentDidMount() {
// accessLog(506) // accessLog(506)
// await store.checkBindStatus(); await store.checkBindStatus();
await this.getShareInfo(); await this.getShareInfo();
MatterViewOpt("b14316", { MatterViewOpt("b14316", {
page_name: "落地页", page_name: "落地页",
...@@ -71,7 +72,7 @@ class Sharepage extends React.Component { ...@@ -71,7 +72,7 @@ class Sharepage extends React.Component {
}; };
/** 跳转微信端活动 */ /** 跳转微信端活动 */
toWeActHandle = () => { toWeActHandle = _throttle(() => {
console.warn("toWeActHandle") console.warn("toWeActHandle")
...@@ -91,7 +92,7 @@ class Sharepage extends React.Component { ...@@ -91,7 +92,7 @@ class Sharepage extends React.Component {
} }
CFG.workerCode = getUrlParam("ykCode"); CFG.workerCode = getUrlParam("ykCode");
if (isMiniprogram()) { //小程序域名写死 if (isMiniprogram()) { //小程序域名写死
CFG.domain = "https://96094-activity.dexfu.cn"; CFG.domain = "https://96094-2-activity.dexfu.cn";
} else { } else {
CFG.domain = location.origin CFG.domain = location.origin
} }
...@@ -110,7 +111,7 @@ class Sharepage extends React.Component { ...@@ -110,7 +111,7 @@ class Sharepage extends React.Component {
setTimeout(() => { setTimeout(() => {
location.href = url; location.href = url;
}, 500) }, 500)
}; });
render() { render() {
const { actStartTimestamp, actEndTimestamp } = this.state?.shareInfo || {}; const { actStartTimestamp, actEndTimestamp } = this.state?.shareInfo || {};
......
...@@ -14,6 +14,7 @@ function isEnterpriseWeChat() { ...@@ -14,6 +14,7 @@ function isEnterpriseWeChat() {
const shareStore = makeAutoObservable({ const shareStore = makeAutoObservable({
// 初始化分享 // 初始化分享
initShare(){ initShare(){
console.info('time-initShare',new Date().getTime())
const skinId = GetCurrSkinId() || getCustomShareId() || 'index'; const skinId = GetCurrSkinId() || getCustomShareId() || 'index';
console.log("分享默认渠道===", CFG.defaultChannel); console.log("分享默认渠道===", CFG.defaultChannel);
const shareInfo = JSON.parse(store.frontVariable.shareInfo); const shareInfo = JSON.parse(store.frontVariable.shareInfo);
...@@ -223,13 +224,13 @@ const shareStore = makeAutoObservable({ ...@@ -223,13 +224,13 @@ const shareStore = makeAutoObservable({
`https://lifeapp-api.picclife.cn/lifeapi/lifeapp-svc-gw/api/auth_code/authorize/v1?activity_code=613402&redirect_type=0&redirect_uri=${isIos() `https://lifeapp-api.picclife.cn/lifeapi/lifeapp-svc-gw/api/auth_code/authorize/v1?activity_code=613402&redirect_type=0&redirect_uri=${isIos()
? encodeURIComponent( ? encodeURIComponent(
encodeURIComponent( encodeURIComponent(
`https://96094-activity.dexfu.cn/customShare/share?id=${prodCustomId}` + `${location.origin}/customShare/share?id=${prodCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms `&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}` }&actId=${CFG.actId}`
) )
) )
: encodeURIComponent( : encodeURIComponent(
`https://96094-activity.dexfu.cn/customShare/share?id=${prodCustomId}` + `${location.origin}/customShare/share?id=${prodCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms `&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}` }&actId=${CFG.actId}`
) )
...@@ -241,13 +242,13 @@ const shareStore = makeAutoObservable({ ...@@ -241,13 +242,13 @@ const shareStore = makeAutoObservable({
`https://lifeapp-api-test.picclife.cn/lifeapi/lifeapp-svc-rel-gw/api/auth_code/authorize/v1?activity_code=613402&redirect_type=0&redirect_uri=${isIos() `https://lifeapp-api-test.picclife.cn/lifeapi/lifeapp-svc-rel-gw/api/auth_code/authorize/v1?activity_code=613402&redirect_type=0&redirect_uri=${isIos()
? encodeURIComponent( ? encodeURIComponent(
encodeURIComponent( encodeURIComponent(
`https://96094-activity.dexfu.cn/customShare/share?id=${testCustomId}` + `${location.origin}/customShare/share?id=${testCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms `&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}` }&actId=${CFG.actId}`
) )
) )
: encodeURIComponent( : encodeURIComponent(
`https://96094-activity.dexfu.cn/customShare/share?id=${testCustomId}` + `${location.origin}/customShare/share?id=${testCustomId}` +
`&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms `&channel=${CFG.defaultChannel}&agentCode=${CFG.workerCode || CFG.agentCode}&actPlatforms=${CFG.actPlatforms
}&actId=${CFG.actId}` }&actId=${CFG.actId}`
) )
......
...@@ -49,6 +49,7 @@ class Store { ...@@ -49,6 +49,7 @@ class Store {
/** 获取前端配置项 */ /** 获取前端配置项 */
async getFrontVariable() { async getFrontVariable() {
// 获取前端开发配置 // 获取前端开发配置
console.info('time',new Date().getTime())
const { data } = await API.getFrontVariable(); const { data } = await API.getFrontVariable();
this.frontVariable = data || {}; this.frontVariable = data || {};
console.log('前端开发配置', data) console.log('前端开发配置', data)
......
...@@ -29,17 +29,23 @@ import { ...@@ -29,17 +29,23 @@ import {
/** /**
* 初始化分享 * 初始化分享
*/ */
Weixin.debugMode = true;
export async function onInitShare(cb?) { export async function onInitShare(cb?) {
// await start([Weixin], function (success) { // await start([Weixin], function (success) {
// console.log("share result:----", success) // console.log("share result:----", success)
// cb && cb() // cb && cb()
// }) // })
console.info('time-onInitShare',new Date().getTime())
await start([Weixin], function (success) { await start([Weixin], function (success) {
console.log("share result:----", success) console.log("share result:----", success)
cb && cb() cb && cb()
if(!success){
onInitShare()
}
}, { }, {
isMiniApp: true, isMiniApp: true,
apk: '3n5TgKxmMy1kYhuddr2K84o1YyHm' apk: '4AoRyTuR6XNfjNa4w5exe1bPmqDS'
// apk: '3n5TgKxmMy1kYhuddr2K84o1YyHm'
}) })
} }
/** /**
......
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