From d7d34fba676269742e50a07b3702f79368df6ddb Mon Sep 17 00:00:00 2001 From: TJH Date: Tue, 3 Feb 2026 16:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Game/scripts/game/History.ts | 10 +++++++-- assets/Game/scripts/game/HistoryDetail.ts | 1 + assets/Game/scripts/game/ScrollControl.ts | 26 ++++++++++++++++++----- assets/Loading/game.scene | 2 +- assets/Loading/scripts/comm.ts | 2 +- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/assets/Game/scripts/game/History.ts b/assets/Game/scripts/game/History.ts index 349847b..36caf2d 100644 --- a/assets/Game/scripts/game/History.ts +++ b/assets/Game/scripts/game/History.ts @@ -44,6 +44,7 @@ export class History extends Component { holdOn = false finish = false + clickLock = false sel_idx: HISTORY_TYPE = HISTORY_TYPE.TODAY @@ -397,7 +398,10 @@ export class History extends Component { async clickItem(event: Event, roundId: string) { - + if (this.clickLock) { + return + } + this.clickLock = true // console.log("clickItem, roundId = ", roundId) const history_detail = instantiate(this.history_detail) @@ -416,7 +420,9 @@ export class History extends Component { self.scheduleOnce(() => { comp.entryFinish() }) }) .start() - + this.scheduleOnce(() => { + this.clickLock = false + }, 1) } diff --git a/assets/Game/scripts/game/HistoryDetail.ts b/assets/Game/scripts/game/HistoryDetail.ts index b829645..e4c6af6 100644 --- a/assets/Game/scripts/game/HistoryDetail.ts +++ b/assets/Game/scripts/game/HistoryDetail.ts @@ -591,6 +591,7 @@ export class HistoryDetail extends Component { this.showLoading() await this.loadDetailList() + this.scrollControl.setTouchEnable(true) } removeReturnBtn() { diff --git a/assets/Game/scripts/game/ScrollControl.ts b/assets/Game/scripts/game/ScrollControl.ts index 2b1a937..cc53319 100644 --- a/assets/Game/scripts/game/ScrollControl.ts +++ b/assets/Game/scripts/game/ScrollControl.ts @@ -46,12 +46,12 @@ export class ScrollControl extends Component { onLoad() { this.node_history_detail = this.node.parent - this.node.on(Node.EventType.TOUCH_START, this._onTouchStart, this); - this.node.on(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); - this.node.on(Node.EventType.TOUCH_END, this._onTouchEnd, this); - this.node.on(Node.EventType.TOUCH_CANCEL, this._onTouchEnd, this); + // this.node.on(Node.EventType.TOUCH_START, this._onTouchStart, this); + // this.node.on(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); + // this.node.on(Node.EventType.TOUCH_END, this._onTouchEnd, this); + // this.node.on(Node.EventType.TOUCH_CANCEL, this._onTouchEnd, this); - this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); + // this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); } onDisable() { @@ -322,6 +322,22 @@ export class ScrollControl extends Component { this.vert_scrollView.scrollToOffset(vec2, 0.1, true); } + setTouchEnable(enbaled) { + if (enbaled) { + this.node.on(Node.EventType.TOUCH_START, this._onTouchStart, this); + this.node.on(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); + this.node.on(Node.EventType.TOUCH_END, this._onTouchEnd, this); + this.node.on(Node.EventType.TOUCH_CANCEL, this._onTouchEnd, this); + this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); + } else { + this.node.off(Node.EventType.TOUCH_START, this._onTouchStart, this); + this.node.off(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); + this.node.off(Node.EventType.TOUCH_END, this._onTouchEnd, this); + this.node.off(Node.EventType.TOUCH_CANCEL, this._onTouchEnd, this); + this.node.off(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); + } + } + // 判断触摸点是否在节点矩形内 isTouchOnNode(node: Node, touchPos: Readonly): boolean { const uiTransform = node.getComponent(UITransform); diff --git a/assets/Loading/game.scene b/assets/Loading/game.scene index d6cd0ae..cfafd62 100644 --- a/assets/Loading/game.scene +++ b/assets/Loading/game.scene @@ -184,7 +184,7 @@ "_priority": 0, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 960.0000000000001, + "_orthoHeight": 960, "_near": 0, "_far": 2000, "_color": { diff --git a/assets/Loading/scripts/comm.ts b/assets/Loading/scripts/comm.ts index c357235..27a0169 100644 --- a/assets/Loading/scripts/comm.ts +++ b/assets/Loading/scripts/comm.ts @@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env" const gameId = "rp_11001"; // let apiaddr = "https://rpgames-api.rpfafafahkdev.com"; let apiaddr = ""; -let token = "eyJQIjoxMDM0NTAsIkUiOjE3Njk4ODc2NzEsIlMiOjk5OSwiRCI6InJwXzExMDAxIn0.xZTrzpsrV_Cyrrl9oRGjDcKRTWf3Xzps-y0nMCpSOMs"; +let token = "eyJQIjoxMDA5NDksIkUiOjE3NzAxNTA3OTgsIlMiOjk5NywiRCI6InJwXzExMDAxIn0.FERDo2kkrNmbh_bdo-pEavL81qFzMay0yTVqZRiXpuM"; let language = "en" let currency = "THB"