Commit 57f00a4b authored by 王勇霞's avatar 王勇霞

build: 浏览任务

parent bed1ff12
......@@ -68,10 +68,10 @@
}
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-CCnSF8s1.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/vendor-q7KuhzMH.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/vendor-BQh5NVNk.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-DeczUGUj.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-06iAz5R7.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/vendor-q7KuhzMH.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/vendor-BQh5NVNk.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-jvOlBUC_.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">!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>
......@@ -79,8 +79,8 @@
<body>
<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 crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/polyfills-legacy-DTQxxLmk.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-legacy-CO0V2hWh.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/polyfills-legacy-DTQxxLmk.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-legacy-CwwbXrLB.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
\ No newline at end of file
......@@ -93,6 +93,19 @@ export default [
"currentTime": new Date().getTime(),
"black": false,
"lcGradeIcon": true,
"signPopInfo": {
"ruleId": "voluptate qui id do proident",
"url": "dolore ad eu pariatur",
"userRecordId": -61652610.372493036,
"prizeType": -44199772,
"prizeId": "dolore fugiat",
"optionImg": "https://picsum.photos/200/200",
"optionName": "100元",
"optionId": "eiusmod",
"sendCount": 15610138.453658357,
"position": 34910431,
"extra": "nostrud Excepteur sint et pariatur"
}
}
}
},
......
......@@ -68,10 +68,10 @@
}
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-CCnSF8s1.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/vendor-q7KuhzMH.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/vendor-BQh5NVNk.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-DeczUGUj.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-06iAz5R7.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/vendor-q7KuhzMH.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/vendor-BQh5NVNk.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-jvOlBUC_.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">!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>
......@@ -79,8 +79,8 @@
<body>
<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 crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/polyfills-legacy-DTQxxLmk.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1766574254055/assets/index-legacy-CO0V2hWh.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/polyfills-legacy-DTQxxLmk.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1766660505208/assets/index-legacy-CwwbXrLB.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
\ No newline at end of file
......@@ -11,7 +11,6 @@ import API from '@/api';
import SignTaskPop from '@/panels/signTaskPop';
import { weekList } from "@/contants"
import classNames from 'classnames';
import SignSuccessPop from '@/panels/signSuccessPop';
@observer
class SignCom extends React.Component {
......@@ -20,27 +19,27 @@ class SignCom extends React.Component {
this.state = {
currentWeek: new Date().getDay(), // 当前周几
signInfo: {},
isJump: false,
// isJump: false,
}
}
componentDidMount() {
this.getSignInfo();
window.addEventListener('visibilitychange', this.handleVisibilityChange);
}
// componentDidMount() {
// this.getSignInfo();
// window.addEventListener('visibilitychange', this.handleVisibilityChange);
// }
componentWillUnmount() {
window.removeEventListener('visibilitychange', this.handleVisibilityChange);
}
// componentWillUnmount() {
// window.removeEventListener('visibilitychange', this.handleVisibilityChange);
// }
handleVisibilityChange = () => {
if (document.visibilityState === 'visible') {
console.log('页面可见');
if (this.state.isJump) {
this.signPrizeHandle()
}
}
}
// handleVisibilityChange = () => {
// if (document.visibilityState === 'visible') {
// console.log('页面可见');
// if (this.state.isJump) {
// this.signPrizeHandle()
// }
// }
// }
/** 获取签到信息 */
async getSignInfo() {
......@@ -57,11 +56,11 @@ class SignCom extends React.Component {
}
// 跳转前进行打标
jumpToSing = () => {
this.setState({
isJump: true,
})
}
// jumpToSing = () => {
// this.setState({
// isJump: true,
// })
// }
/** 签到 */
signHandle = _asyncThrottle(async () => {
......@@ -79,8 +78,8 @@ class SignCom extends React.Component {
if(signInfo?.prizeDays?.includes(`${currentWeek}`)) {
ModalCtrl.showModal(SignTaskPop, {
otherPrizeInfo: data.otherPrizeInfo || {},
callback: () => {
this.signPrizeHandle()
callback: async() => {
await this.signPrizeHandle()
// this.jumpToSing();
}
})
......@@ -90,13 +89,13 @@ class SignCom extends React.Component {
/** 签到-领奖 */
signPrizeHandle = _asyncThrottle(async () => {
if (!store.judgeActTime()) return
const { success, data } = await API.completeSignView();
const { success } = await API.completeSignView();
if(success) {
store.updateIndex();
this.setState({ isJump: false })
ModalCtrl.showModal(SignSuccessPop, {
prizeInfo: data || {},
})
// this.setState({ isJump: false })
// ModalCtrl.showModal(SignSuccessPop, {
// prizeInfo: data || {},
// })
}
})
......
......@@ -14,7 +14,9 @@ class SignTaskPop extends React.Component {
}
handleToLink = _asyncThrottle(async () => {
this.props.callback?.();
if(this.props.callback) {
await this.props.callback();
}
setTimeout(() => {
ModalCtrl.closeModal();
}, 300)
......
......@@ -12,6 +12,7 @@ import EndPop from '@/panels/endPop';
import { PrizePanel } from '@/panels/PrizePanel/PrizePanel';
import FirstPop from '@/panels/firstPop/firstPop';
import SetupSuccessPop from '@/panels/setupSuccessPop'
import SignSuccessPop from '@/panels/signSuccessPop';
class Store {
......@@ -170,7 +171,7 @@ class Store {
// resData.currentTime = timeStamp;
this.indexData = resData;
const { black, giftPop, lastMonthRankPop, overallRankPop, firstMoneyPop, codeList } = resData
const { black, giftPop, lastMonthRankPop, overallRankPop, firstMoneyPop, codeList, signPopInfo } = resData
// 更新产品信息
if (codeList?.length) {
......@@ -206,6 +207,13 @@ class Store {
optionName: overallRankPop.prizeName,
});
}
// 处理浏览任务
if (signPopInfo) {
ModalCtrl.showModal(SignSuccessPop, {
prizeInfo: signPopInfo || {},
})
}
}
judgeActTime(brakeStart = true, brakeEnd = true) {
......
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