future 1 year ago
parent
commit
67e09893dd

+ 4 - 4
assets/resources/prefab/run/long_story_list_item.prefab

@@ -2572,7 +2572,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 444.681,
-      "y": 218.658,
+      "y": 216.658,
       "z": 0
     },
     "_lrot": {
@@ -3541,7 +3541,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -439.594,
-      "y": 232.579,
+      "y": 201.579,
       "z": 0
     },
     "_lrot": {
@@ -3582,7 +3582,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 350,
-      "height": 200
+      "height": 260
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -4510,7 +4510,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 474.933,
-      "y": 210.617,
+      "y": 206.617,
       "z": 0
     },
     "_lrot": {

+ 6 - 6
assets/scene/game.scene

@@ -16763,8 +16763,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -128.60104824676273,
-      "y": 794,
+      "x": -160.60104824676273,
+      "y": 789,
       "z": 0
     },
     "_lrot": {
@@ -17038,7 +17038,7 @@
     "_target": null,
     "_left": 0,
     "_right": 0,
-    "_top": 75,
+    "_top": 80,
     "_bottom": 1689.535960196038,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,
@@ -17085,8 +17085,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 155,
-      "y": 792,
+      "x": 126,
+      "y": 788,
       "z": 0
     },
     "_lrot": {
@@ -17360,7 +17360,7 @@
     "_target": null,
     "_left": 0,
     "_right": 0,
-    "_top": 77,
+    "_top": 81,
     "_bottom": 0,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,

+ 27 - 1
assets/script/run/game_list_view/long_story_list.ts

@@ -45,6 +45,9 @@ export class long_story_list extends Component {
     }
 
     onScrollToTop() {
+        if(this.data_list.length<=0) {
+            return
+        }
         if(this.is_loading_data) { 
             return 
         }
@@ -57,6 +60,9 @@ export class long_story_list extends Component {
     }
 
     onScrollToBottom() {
+        if(this.data_list.length<=0) {
+            return
+        }
         if(this.is_can_request==false) { 
             return
         }
@@ -82,7 +88,6 @@ export class long_story_list extends Component {
         // console.log('cache_page=',cache_page)
         this.cur_min_page = cache_page
         this.cur_page = this.cur_min_page
-        this.requestData(false)
     }
 
     initView(data:LongStoryListData, click_back_level_cb, click_item_goto_game_success_cb) {
@@ -91,6 +96,27 @@ export class long_story_list extends Component {
         this.m_click_item_goto_game_success_cb = click_item_goto_game_success_cb
 
         this.init()
+        gameManager.Singleton.showLoadingLevel()
+        this.unLockFirstLevel(()=>{
+            setTimeout(()=>{
+                gameManager.Singleton.hideLoadingLevel()
+            },100)
+            this.requestData(false)
+        })
+    }
+
+    private unLockFirstLevel(cb) {
+        let url = http.getPlatformLevelsList(config.LevelType.LONG_STORY,this.m_long_story_list_data.id,SdkUtil.getPlatformIdentify(), 1, 2)
+        http.run_get_static(url,(err,data)=>{
+            if(!err){
+                let msg:LevelMessage = JSON.parse(data)
+                // console.log('msg=',msg)
+                if(msg.content.list.length>0) {
+                    gameManager.Singleton.unLockLevel(msg.content.list[0].id)
+                }
+            }
+            cb && cb()
+        })
     }
 
     private requestData(is_scroll_bottom:boolean, cb=null) {