|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, Component, instantiate, Label, Layers, Layout, Node, Prefab, ScrollView } from 'cc';
|
|
|
+import { _decorator, Component, instantiate, Label, Layers, Layout, Node, Prefab, ScrollView, Vec2, Vec3 } from 'cc';
|
|
|
import { tools } from '../../tools';
|
|
|
import { edit_scene } from '../edit_scene';
|
|
|
import { ClientEvent } from '../../clientEvent';
|
|
@@ -8,6 +8,7 @@ import { event_item_view } from '../event/event_item_view';
|
|
|
import { task_zhao_xi_jie } from './task_zhao_xi_jie';
|
|
|
import { task_guo_ren_wu } from './task_guo_ren_wu';
|
|
|
import { task_da_boss } from './task_da_boss';
|
|
|
+import { Search } from '../search/Search';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('scene_task')
|
|
@@ -22,6 +23,7 @@ export class scene_task extends Component {
|
|
|
@property(Node) task_zhao_xi_jie:Node = null;
|
|
|
@property(Node) task_guo_ju_qing:Node = null;
|
|
|
@property(Node) task_da_guai:Node = null;
|
|
|
+ @property(Node) search_node:Node = null;
|
|
|
private m_edit_scene:edit_scene = null;
|
|
|
private isUpdateStatus:boolean = false;
|
|
|
protected start(): void {
|
|
@@ -51,6 +53,12 @@ export class scene_task extends Component {
|
|
|
this.btn_edit_event.on(Node.EventType.TOUCH_END,()=>{
|
|
|
tools.show_edit_event_view()
|
|
|
})
|
|
|
+
|
|
|
+ this.search_node.getComponent(Search).searchClick((id: string)=> {
|
|
|
+ this.searchContentLocationList(true,id)
|
|
|
+ }, (text: string)=> {
|
|
|
+ this.searchContentLocationList(false,text)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
|
|
@@ -255,6 +263,34 @@ export class scene_task extends Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ searchContentLocationList(isId: boolean, string: string) {
|
|
|
+ let task_data = this.getTaskData()
|
|
|
+ let data_list = task_data.event_list
|
|
|
+ let check_yes = false
|
|
|
+ for (let index = 0; index < data_list.length; index++) {
|
|
|
+ const element = data_list[index];
|
|
|
+ if(isId) {
|
|
|
+ if(element.event_id.toString() == string) {
|
|
|
+ check_yes = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(element.event_name.indexOf(string) != -1) {
|
|
|
+ check_yes = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(check_yes) {
|
|
|
+ let c_index = (data_list.length-1)-index
|
|
|
+ let c_row = Math.round(c_index / 2)
|
|
|
+ let c_spacing_y = c_row * 50
|
|
|
+ let c_item_height = (c_row - 1) * 300
|
|
|
+ let c_offset_y = c_spacing_y + c_item_height + 1100
|
|
|
+ this.node.getComponent(ScrollView).scrollToOffset(new Vec2(0, c_offset_y))
|
|
|
+ this.search_node.getComponent(Search).showTip(element.event_id.toString())
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|