first commit

This commit is contained in:
2026-03-30 09:39:59 +08:00
parent 6c52425fca
commit 5ac73d3c6d
4484 changed files with 1144395 additions and 0 deletions

View File

@@ -0,0 +1,502 @@
[
{
"__type__": "cc.Prefab",
"_name": "AppInit",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "AppInit",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 10
}
],
"_active": true,
"_components": [
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
}
],
"_prefab": {
"__id__": 24
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 1334
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1bUhFF79dG46Ne46ZRxKpC"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 227,
"g": 235,
"b": 228,
"a": 255
},
"_spriteFrame": {
"__uuid__": "a4cadc68-5c93-4683-8ee0-cf3bb6acb132@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f0x+xHB+BD77gwz9qesmbl"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 2,
"_originalHeight": 2,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fd5ETT07RFqrFUq6p6ErCa"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "0fJ7SovSVCVawCNYpB3WTW",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "logo",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 15
}
],
"_prefab": {
"__id__": 17
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 400
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "830VxCeINAa7bLC2kyd2Db"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "2a89c2f6-f894-47db-88e9-1017df6fbf0d@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fdljxQ6hREBoCDN2bRrUnW"
},
{
"__type__": "cc.UIOpacity",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_opacity": 255,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8foH2eGy5DX4TvPYTKru5b"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8cWbsI+kdMYYPLYQrEFecs",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 1334
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fdxpU8hWdAMIljPcrHWSD1"
},
{
"__type__": "598f2EhUohEebUzsqwXHool",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"logo": {
"__id__": 10
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ffhkucpqlE+aHYz+nafs1t"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "10GYyo4FNMU6BKnnXpm7FG"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7aBxAgUy9NRJNTrHNH6/6R",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "19a93f71-0300-44b3-9bd9-efbc15271e7d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "AppInit"
}
}

View File

@@ -0,0 +1,98 @@
import { Node, UIOpacity, _decorator, tween } from 'cc';
import BaseAppInit from '../../../extensions/app/assets/base/BaseAppInit';
import { LOGIN_TOKEN } from '../../res-native/network/HttpRequest';
import { Tools } from '../../res-native/tools/Tools';
import { app } from '../../app/app';
import { USERDATA } from '../../res-native/data/UserData';
import { LANG_SET, LANG_STRING, LangSet } from '../../res-native/setting/LangSet';
const { ccclass, property } = _decorator;
@ccclass('AppInit')
export class AppInit extends BaseAppInit {
@property(Node)
private logo: Node;
/**
* 获得用户资源总量这里返回几就需要用户自行调用几次nextInit
*/
protected getUserAssetNum(): number {
return 1;
}
protected onLoad() {
this.initToken();
if (LOGIN_TOKEN.access_token == "" || LOGIN_TOKEN.access_token == undefined) {
//app.manager.ui.showToast("token init failed")
return
}
Tools.httpReq("user/info", {}, (res:any) => {
USERDATA.setUserData(res);
this.nextInit();
})
// // 执行初始化操作
// const opacity = this.logo.getComponent(UIOpacity);
// opacity.opacity = 0;
// tween(opacity)
// .to(0.5, { opacity: 255 })
// .delay(1)
// .to(0.5, { opacity: 0 })
// .call(() => {
// Tools.httpReq("prize-list", {}, (res:any) => {
// USERDATA.setUserData(res);
// this.nextInit();
// })
// })
// .start();
// Tools.httpReq("user/Login", {
// username: "+60123456789",
// password: "123456",
// coin: 2000,
// time: 1772692089
// }, (res:any) => {
// LOGIN_TOKEN.setToken(res.token, res.token, "", "")
// Tools.httpReq("user/info", {}, (res:any) => {
// USERDATA.setUserData(res);
// this.nextInit();
// })
// })
}
/** 根据参数初始化TOKEN */
initToken(){
let str = window.location.search.slice(1)
const pairs = str.split('&');
const params: { [key: string]: string } = {};
pairs.forEach(pair => {
const [key, value] = pair.split('=');
params[decodeURIComponent(key)] = decodeURIComponent(value || '');
});
// const at = Tools.parseJWT(params.access_token)
// const actualKey = 'xyxfz83d'.substring(0, 8); // 取前8个字符
// // 解密appkey
// const appkey = Tools.desEcbDecrypt(at.extend.channel, actualKey);
// // 如果解密失败,尝试原始值
// if (!appkey) {
// console.log('Failed to decrypt token, using original value');
// }
LOGIN_TOKEN.setToken(params.token, params.token, "", "")
LANG_SET.langIndex = LANG_STRING[params.lang as keyof typeof LANG_STRING]
}
// BaseAppInit中使用start方法作为初始化入口如果重写start方法请注意调用父类方法
// protected start() { }
protected onFinish() {
// 执行完成操作
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "598f2121-5288-4479-b533-b2ac171e8a25",
"files": [],
"subMetas": {},
"userData": {}
}