Commit f719b3cd authored by haiyoucuv's avatar haiyoucuv

整理一下代码

parent 602d0530
import { sendWebNet, sendWebNetWithToken, WebNetName } from "./Utils/WebNet/WebNet";
import { hideWaiting, showPanel, showWaiting } from "db://assets/Module/UIFast";
import { changeScene, hideWaiting, showPanel, showWaiting } from "db://assets/Module/UIFast";
import BoxPanel from "db://assets/Scripts/Panels/BoxPanel";
import NoBoxPanel from "db://assets/Scripts/Panels/NoBoxPanel";
import PrizePanel from "db://assets/Scripts/Panels/PrizePanel";
import NoPrizePanel from "db://assets/Scripts/Panels/NoPrizePanel";
import { HomeScene } from "./Scenes/HomeScene";
export default class GameMgr {
......@@ -90,7 +91,10 @@ export default class GameMgr {
const {success, data} = await sendWebNetWithToken(WebNetName.submit, params);
hideWaiting();
if (!success) return false;
if (!success) {
changeScene(HomeScene);
return false;
}
const {
ifReachTarget, scoreSum,
......
......@@ -90,6 +90,7 @@ export class HomeScene extends Scene {
// 因为助力成功也会给助力者发放次数 所以在首页接口前调用
await ShareCenter.ins.doAssist()
store.updateIndex();
ShareCenter.ins.getInviteCode();
}
@render
......
......@@ -30,7 +30,7 @@ export default class ShareCenter {
* @param type 分享类型
*/
async doShare(type: string) {
await this.getInviteCode()
await this.getInviteCode();
if (!this.inviteCode) return false
const { shareInfo, appKey, shareOrigin } = getWebData(WebNetName.getFrontVariable).data
let shareData = shareInfo ? JSON.parse(shareInfo) : {}
......
......@@ -19,7 +19,7 @@ const beforeDoComplete = (item: any, func: Function) => {
if (hasBtnText) {
showToast(item?.buttonText);
}
setTimeout(() => {
setTimeout(() => {
!!func && func();
}, time);
}
......@@ -40,7 +40,7 @@ export default class TaskCenter {
const jumpUrl = url?.split("$$$")?.[1];
/** 邀请任务 */
if (code?.startsWith("it_")) {
if (code?.startsWith("it")) {
beforeDoComplete(item, () => {
ShareCenter.ins.doShare(SHARE_TYPE.INVITE);
});
......
......@@ -39,7 +39,7 @@
<script src="//yun.duiba.com.cn/polaris/SVGA.Lite.v2.1.1.d3a67cbc13c591c53c6f87ab34c57ce387010374.js" crossorigin="anonymous"></script>
<script src="//yun.duiba.com.cn/aurora/assets/2403d1edf2acd15b179306b6ddaa5f0967d78a8f.js"></script>
<link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718938753520/style.css"/>
<link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718953368452/style.css"/>
<style>
.sui-captcha {
......@@ -94,17 +94,17 @@
</div>
<!-- Polyfills bundle. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718938753520/src/polyfills.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718953368452/src/polyfills.bundle.js" charset="utf-8"></script>
<!-- SystemJS support. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718938753520/src/system.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718953368452/src/system.bundle.js" charset="utf-8"></script>
<!-- Import map -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718938753520/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1718953368452/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>
<script>
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1718938753520/index.js').catch(function (err) {
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1718953368452/index.js').catch(function (err) {
console.error(err);
})
</script>
......
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