|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, Component, EventTouch, instantiate, JsonAsset, Label, Layout, Node, Prefab, Sprite, sys, UITransform, Vec2, Vec3 } from 'cc';
|
|
|
+import { _decorator, Component, EventTouch, instantiate, JsonAsset, Label, Layout, Node, Prefab, ScrollView, Sprite, sys, UITransform, Vec2, Vec3 } from 'cc';
|
|
|
import { http } from '../../http';
|
|
|
import { gameManager } from '../gameManager';
|
|
|
import { LevelInfoMessage, LevelItemData, LevelMessage, scene_item_data } from '../../../data/data';
|
|
@@ -22,6 +22,7 @@ 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 start_pos:Vec2 = Vec2.ZERO;
|
|
|
private page_limit_count:number = 6
|
|
|
|
|
@@ -117,11 +118,13 @@ 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(0,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(0,this.content.position.y)
|
|
@@ -180,7 +183,7 @@ export class game_list extends Component {
|
|
|
}
|
|
|
|
|
|
onItemClick(item:level_list_item){
|
|
|
- if(!this.onTouchActive){
|
|
|
+ if(this.onTouchActive==false){
|
|
|
return
|
|
|
}
|
|
|
gameManager.Singleton.sys_click_button_music()
|
|
@@ -229,7 +232,9 @@ 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){
|