Commit b78776e8 authored by 俞嘉婷's avatar 俞嘉婷

feat: 未登录拦截 按钮级别

parent 8128d88b
......@@ -191,7 +191,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 649.8014888337469,
"_orthoHeight": 511.2592592592593,
"_near": 1,
"_far": 2000,
"_color": {
......@@ -484,7 +484,7 @@
"y": -180,
"z": -12.000012657215834
},
"_id": "33cdppi3RCh6+w/MwU4Y5p"
"_id": "66zHPKca5AuKXji48gOV01"
},
{
"__type__": "cc.UITransform",
......@@ -506,7 +506,7 @@
"x": 0,
"y": 1
},
"_id": "a2YJ7xiCVLUasHmSrWY4oR"
"_id": "74Ar5zmjxPWqOaxvK4VMfJ"
},
{
"__type__": "cc.Sprite",
......@@ -542,7 +542,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "a65LTbrRtKE5a7azKPdLqY"
"_id": "32+9E1Y81Hhbr7Qv2NOOU5"
},
{
"__type__": "cc.Node",
......@@ -590,7 +590,7 @@
"y": -180,
"z": -11.00000220913452
},
"_id": "48uc236PpNQKSETdHkl4GU"
"_id": "25LltY72NPvKRjFc0VvIPy"
},
{
"__type__": "cc.UITransform",
......@@ -612,7 +612,7 @@
"x": 0,
"y": 1
},
"_id": "63YjKzt31E1Z/iKSfWcG/7"
"_id": "11kfEKv0JAwIbTwxpN6CVs"
},
{
"__type__": "cc.Sprite",
......@@ -648,7 +648,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "d0eY8/KMFDCY3y4lKKYuJ5"
"_id": "b1IJQxdxdJgZkRsqjuA0Lj"
},
{
"__type__": "cc.Node",
......@@ -696,7 +696,7 @@
"y": -180,
"z": -64.00000614258742
},
"_id": "43AedY7YVKSZRUl19pk1Wm"
"_id": "667xSBwhBH+ol8Sfn9NF0y"
},
{
"__type__": "cc.UITransform",
......@@ -718,7 +718,7 @@
"x": 0,
"y": 1
},
"_id": "8bohUlN4pKQb5+bQbEBZMx"
"_id": "5bPVzE6fRPU4HyniApMuKU"
},
{
"__type__": "cc.Sprite",
......@@ -754,7 +754,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "3fEmXm5j1Fc5Iuy5id3pUs"
"_id": "b46OUzX3VA67Fxagjz3adu"
},
{
"__type__": "cc.Node",
......@@ -802,7 +802,7 @@
"y": 180,
"z": 25.99999385741257
},
"_id": "7d1CkhdfRFMqlacS8mAsI8"
"_id": "57v3STW2tGzYwjNSNA9FVW"
},
{
"__type__": "cc.UITransform",
......@@ -824,7 +824,7 @@
"x": 0,
"y": 1
},
"_id": "c6qbIyj3FP8ZA4XwU69q+q"
"_id": "d2Ln3+fhJHsa3kOUODkdmL"
},
{
"__type__": "cc.Sprite",
......@@ -860,7 +860,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "efoD4VqvBElLRM4l81tvSq"
"_id": "5dPaXrbiBPlKQNN7q+BejP"
},
{
"__type__": "cc.UITransform",
......@@ -7244,7 +7244,7 @@
"__id__": 2
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 188
......
......@@ -88,6 +88,7 @@ export default class SignPanel extends Panel {
}
doSign = _asyncThrottle(async () => {
if (!store.judgeLogin()) return;
const { success, data } = await sendWebNetWithToken(WebNetName.doSign);
if (success) {
showPanel(SignSucPanel, { prizeInfo: data });
......
......@@ -76,6 +76,7 @@ export class HomeScene extends Scene {
? "https://yun.duiba.com.cn/polaris/img.546cbcd3811aa2265e50d495c078108a217450b7.png"
: "https://yun.duiba.com.cn/polaris/%E9%BB%84%E8%89%B2user_img.7a7a3f11540b4fdb4645860ec3517c31564804bb.png";
/**
doLogin() {
// 赵一鸣:
// path: package/pages/login/index
......@@ -95,6 +96,7 @@ export class HomeScene extends Scene {
// @ts-ignore
wx.miniProgram.navigateTo({ url: url });
}
*/
onLoad() {
this.startBtn.on(Button.EventType.CLICK, this.clickStart, this);
......@@ -108,7 +110,9 @@ export class HomeScene extends Scene {
this.bagBtn.on(Button.EventType.CLICK, this.clickMyBag, this);
this.shareBtn.on(Button.EventType.CLICK, this.clickShare, this);
this.userInfo.on(Button.EventType.CLICK, this.clickUserInfo, this);
/**
this.noLoginMask.on(Button.EventType.CLICK, this.doLogin, this);
*/
}
async start() {
......@@ -169,7 +173,9 @@ export class HomeScene extends Scene {
boolNotLogin,
} = store.homeInfo || {};
/**
this.noLoginMask.active = boolNotLogin;
*/
this.userName.string = strFormat(nickname || "微信用户", 8);
this.pointNum.string = `${creditsNum > 999999 ? "999999+" : creditsNum}`;
......@@ -201,6 +207,7 @@ export class HomeScene extends Scene {
clickStart = _asyncThrottle(async () => {
sendLog(LOG_TYPE.CLICK, 5);
if (!store.judgeLogin()) return;
if (!store.checkActTime()) return;
await gameStore.startGame();
......@@ -216,6 +223,7 @@ export class HomeScene extends Scene {
clickRank = _asyncThrottle(async () => {
sendLog(LOG_TYPE.CLICK, 4);
if (!store.judgeLogin()) return;
if (!store.checkActTime()) return;
await changeScene(RankScence);
......@@ -228,6 +236,7 @@ export class HomeScene extends Scene {
showToast("暂未开启");
return;
}
if (!store.judgeLogin()) return;
await changeScene(BlessingBagPage);
});
......@@ -238,6 +247,7 @@ export class HomeScene extends Scene {
});
clickMyBag = _asyncThrottle(async () => {
if (!store.judgeLogin()) return;
if (!store.checkActTime(true)) return;
store.homeInfo.bagLightFlag = false;
showPanel(MyBagPanel);
......@@ -251,18 +261,21 @@ export class HomeScene extends Scene {
});
clickDetail = _asyncThrottle(async () => {
if (!store.judgeLogin()) return;
if (!store.checkActTime()) return;
await changeScene(PointDetailScene, { ifFrom: HomeScene });
});
clickShare = _asyncThrottle(async () => {
sendLog(LOG_TYPE.CLICK, 2);
if (!store.judgeLogin()) return;
if (!store.checkActTime()) return;
shareStore.doShare(true);
});
clickUserInfo = _asyncThrottle(async () => {
if (!store.judgeLogin()) return;
if (store.homeInfo.avatarGuide) {
sendWebNet(WebNetName.avatarGuide, null, {
hideMsg: true,
......
......@@ -77,6 +77,7 @@ export class PropPage extends Scene {
/** 点击积分按钮*/
clickToChange() {
if (!store.judgeLogin()) return;
changeScene(PointDetailScene, { ifFrom: PropPage, back: this.data.isFrom });
}
......@@ -91,6 +92,7 @@ export class PropPage extends Scene {
};
clickToConfirm = async (item) => {
if (!store.judgeLogin()) return;
const { consumeCreditsNum, } = item;
if (store.exchangeInfo.remainCredits < consumeCreditsNum) {
......
import mobx from "mobx";
import { sendWebNet, sendWebNetWithToken, WebNetName } from "../Utils/WebNet/WebNet";
import { getProjectId, sendWebNet, sendWebNetWithToken, WebNetName } from "../Utils/WebNet/WebNet";
import { showPanel, showToast } from "../../Module/UIFast";
import RankPrizePanel from "../Panels/RankPrizePanel";
import { getUrlParams } from "../Utils/WebNet/web/webTools";
......@@ -134,6 +134,34 @@ class Store {
}
}
// 判断是否登录状态
judgeLogin = () => {
const { boolNotLogin } = store.homeInfo || {};
if (boolNotLogin) {
this.doLogin()
return false
}
return true
}
doLogin() {
// 赵一鸣:
// path: package/pages/login/index
// appid: wxf7010270499c9a16
// 零食很忙:
// path: package/pages/login/index
// appid:wxb7d4a6d67d4ca5e1
const type = getUrlParams("type") || "1";
const loginId = getProjectId() == "p8ec64a64"
? "Did1NTg5NTE"
: "Did1NTkzNDM";
const centerUrl = `https://98112-activity.dexfu.cn/customShare/share?id=${loginId}&type=${type}`;
const url = "/package/pages/login/index?callback=" + encodeURIComponent(centerUrl);
// @ts-ignore
wx.miniProgram.navigateTo({ url: url });
}
checkActTime = (isAllow = false) => {
......
......@@ -98,14 +98,14 @@
</style>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/assets/plugin/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/assets/plugin/declare-process.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/assets/plugin/SVGA.Lite.v2.1.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/assets/plugin/jszip.min.v3.10.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/assets/plugin/rem.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/assets/plugin/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/assets/plugin/declare-process.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/assets/plugin/SVGA.Lite.v2.1.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/assets/plugin/jszip.min.v3.10.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/assets/plugin/rem.min.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/style.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/custom.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/style.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/custom.css" />-->
<!-- <script src="//yun-duiba-credits-test.duibatest.com.cn/TNGD_GAMES/libs/eruda.min.js"></script>-->
<!-- <script>eruda.init()</script>-->
......@@ -118,20 +118,20 @@
</div>
<!-- Polyfills bundle. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/polyfills.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/polyfills.bundle.js" charset="utf-8"></script>
<!-- SystemJS support. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/system.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/system.bundle.js" charset="utf-8"></script>
<!-- Import map -->
<!--<script src="https://yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>-->
<!--<script src="https://yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>-->
<script type="systemjs-importmap" charset="utf-8">
{"imports":{"cc":"//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/cocos-js/cc.js"}}
{"imports":{"cc":"//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/cocos-js/cc.js"}}
</script>
<script>
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1747819269177/index.js').catch(function (err) {
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1747884550947/index.js').catch(function (err) {
console.error(err);
})
</script>
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,6 +7,7 @@
"name": "cocos-template-3d",
"hasInstallScript": true,
"dependencies": {
"@cocos/creator-types": "^3.8.4",
"@types/crypto-js": "^4.2.2",
"@types/zepto": "^1.0.36",
"crypto-js": "^4.2.0",
......@@ -16,6 +17,12 @@
"node-xlsx": "^0.24.0"
}
},
"node_modules/@cocos/creator-types": {
"version": "3.8.6",
"resolved": "http://npm.dui88.com:80/@cocos%2fcreator-types/-/creator-types-3.8.6.tgz",
"integrity": "sha512-hyZ4aoqqLxoRtKbBLSJM5RgtK3oGOlTEryHDcyH4znq3h9cFk+MSbQC2aJHvK5/bMlJzsZ641/hD77RGSrvo8Q==",
"license": "ISC"
},
"node_modules/@types/crypto-js": {
"version": "4.2.2",
"resolved": "http://npm.dui88.com:80/@types%2fcrypto-js/-/crypto-js-4.2.2.tgz",
......@@ -119,6 +126,11 @@
}
},
"dependencies": {
"@cocos/creator-types": {
"version": "3.8.6",
"resolved": "http://npm.dui88.com:80/@cocos%2fcreator-types/-/creator-types-3.8.6.tgz",
"integrity": "sha512-hyZ4aoqqLxoRtKbBLSJM5RgtK3oGOlTEryHDcyH4znq3h9cFk+MSbQC2aJHvK5/bMlJzsZ641/hD77RGSrvo8Q=="
},
"@types/crypto-js": {
"version": "4.2.2",
"resolved": "http://npm.dui88.com:80/@types%2fcrypto-js/-/crypto-js-4.2.2.tgz",
......
......@@ -45,8 +45,8 @@
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-5-21 17:21:51 build success in 43 s!",
"detailMessage": "builder:build-project-total (43479ms)\r",
"message": "2025-5-22 11:33:59 build success in 4 min 49 s!",
"detailMessage": "builder:build-project-total (288461ms)\r",
"options": {
"name": "cocos-template-3d",
"server": "",
......@@ -112,7 +112,7 @@
"mangleProperties": false,
"inlineEnum": true
},
"time": "2025-5-21 17:21:08",
"time": "5-22-2025 11:29:10",
"dirty": false
}
}
......
......@@ -7,7 +7,7 @@
"enable": true,
"customSplash": {
"complete": true,
"form": "https://creator-api.cocos.com/api/form/show?sid=441e6f8e3e7ba0c9581ed7936daee45d"
"form": "https://creator-api.cocos.com/api/form/show?sid=0cabb9f83b4ae7b4476456a30932ea05"
}
},
"removeSplash": {
......@@ -16,7 +16,7 @@
"enable": true,
"removeSplash": {
"complete": true,
"form": "https://creator-api.cocos.com/api/form/show?sid=441e6f8e3e7ba0c9581ed7936daee45d"
"form": "https://creator-api.cocos.com/api/form/show?sid=0cabb9f83b4ae7b4476456a30932ea05"
}
}
}
......
......@@ -3,9 +3,9 @@
"@cocos/creator-types@^3.8.4":
version "3.8.4"
resolved "https://registry.npmmirror.com/@cocos/creator-types/-/creator-types-3.8.4.tgz#a4486dcfe58d30b348c030eaaf30e3e09a59ccd9"
integrity sha512-z+8qx726Zl/8rUUpbLjVAiNPn4XweRACEaY1vHeR3EHIcSQ9wtFlIFd2SZX5rOE8lt1S95nxv8OeLYXfbN4/2Q==
version "3.8.6"
resolved "http://npm.dui88.com:80/@cocos%2fcreator-types/-/creator-types-3.8.6.tgz"
integrity sha512-hyZ4aoqqLxoRtKbBLSJM5RgtK3oGOlTEryHDcyH4znq3h9cFk+MSbQC2aJHvK5/bMlJzsZ641/hD77RGSrvo8Q==
"@types/crypto-js@^4.2.2":
version "4.2.2"
......
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