|
@@ -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) {
|