future 1 year ago
parent
commit
1eb962fc55
2 changed files with 11 additions and 11 deletions
  1. 4 4
      assets/scene/game.scene
  2. 7 7
      assets/script/run/game_list_view/game_list.ts

+ 4 - 4
assets/scene/game.scene

@@ -14963,7 +14963,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 960,
+      "y": 959.9999999999999,
       "z": 0
     },
     "_lrot": {
@@ -15014,7 +15014,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -960,
+      "y": -959.9999999999999,
       "z": 0
     },
     "_lrot": {
@@ -15053,7 +15053,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -15807,7 +15807,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 7 - 7
assets/script/run/game_list_view/game_list.ts

@@ -23,11 +23,12 @@ export class game_list extends Component {
     private m_data:LevelMessage = null;
     private x_len:number = 0;
     private onTouchActive:boolean = true;
-    private onClickItem:boolean = false;
+    private content_original_pos:Vec3 = Vec3.ZERO;
     private start_pos:Vec2 = Vec2.ZERO;
     private page_limit_count:number = 6
     
     protected start(): void {
+        this.content_original_pos = this.content.getPosition()
         if(SdkUtil.KS_GAME) {
             let p = this.btn_back.getPosition()
             this.btn_back.setPosition(p.x,p.y-120,p.z)
@@ -119,21 +120,22 @@ export class game_list extends Component {
             this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
         })
         this.content.on(Node.EventType.TOUCH_END,()=>{
-            if(this.onClickItem) { return }
             this.x_len = 0
             this.touchContentScroll()
-            this.content.position = new Vec3(-19,this.content.position.y)
+            this.content.position = new Vec3(this.content_original_pos.x,this.content.position.y)
         })
         this.content.on(Node.EventType.TOUCH_CANCEL,()=>{
-            if(this.onClickItem) { return }
             this.x_len = 0
             this.touchContentScroll()
-            this.content.position = new Vec3(-19,this.content.position.y)
+            this.content.position = new Vec3(this.content_original_pos.x,this.content.position.y)
         })
     }
 
     touchContentScroll() {
         this.onTouchActive = true
+        if(this.content.position.x==this.content_original_pos.x) {
+            return
+        }
         if(this.content.position.x < 0) { // 向左滑动
             this.onNextPage()
         }
@@ -233,9 +235,7 @@ export class game_list extends Component {
         let call = ()=>{
             let url = http.get_level_info(item.getData().id)
             gameManager.Singleton.showLoadingLevel()
-            this.onClickItem = true
             http.run_get_static(url,(err,data)=>{
-                this.onClickItem = false
                 if(!err){
                     let _data:LevelInfoMessage = JSON.parse(data)
                     if(_data.code===config.MSG_CODE.SUCCESS){