|
@@ -18,18 +18,28 @@ export class edit_event_view extends Component {
|
|
|
@property(Node) type_content:Node = null;
|
|
|
@property(Node) type_btn:Node = null;
|
|
|
@property(Node) search_node:Node = null;
|
|
|
- @property(Node) search_editbox:Node = null;
|
|
|
- @property(Node) search_btn_search:Node = null;
|
|
|
+ @property(Node) search_id_editbox:Node = null;
|
|
|
+ @property(Node) search_id_btn:Node = null;
|
|
|
+ @property(Node) search_content_editbox:Node = null;
|
|
|
+ @property(Node) search_content_btn:Node = null;
|
|
|
private m_cur_select_type:number = -1;
|
|
|
private m_search_item_list:event_item[] = []
|
|
|
protected start(): void {
|
|
|
- this.search_btn_search.on(Node.EventType.TOUCH_END, ()=> {
|
|
|
- let id_string = tools.trimLeftAndRightblank(this.search_editbox.getComponent(EditBox).string)
|
|
|
- this.search_editbox.getComponent(EditBox).string = id_string
|
|
|
- if(id_string.length<0) {
|
|
|
+ this.search_id_btn.on(Node.EventType.TOUCH_END, ()=> {
|
|
|
+ let id_string = tools.trimLeftAndRightblank(this.search_id_editbox.getComponent(EditBox).string)
|
|
|
+ this.search_id_editbox.getComponent(EditBox).string = id_string
|
|
|
+ if(id_string.length<=0) {
|
|
|
return tools.showToast('请输入id')
|
|
|
}
|
|
|
- this.searchAction(id_string)
|
|
|
+ this.searchAction(id_string,true)
|
|
|
+ },this)
|
|
|
+ this.search_content_btn.on(Node.EventType.TOUCH_END, ()=> {
|
|
|
+ let content_string = tools.trimLeftAndRightblank(this.search_content_editbox.getComponent(EditBox).string)
|
|
|
+ this.search_content_editbox.getComponent(EditBox).string = content_string
|
|
|
+ if(content_string.length<=0) {
|
|
|
+ return tools.showToast('请输入内容')
|
|
|
+ }
|
|
|
+ this.searchAction(content_string,false)
|
|
|
},this)
|
|
|
}
|
|
|
public show(){
|
|
@@ -123,12 +133,32 @@ export class edit_event_view extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- searchAction(idString:string) {
|
|
|
- // console.log('idString=',idString)
|
|
|
- tools.showToast('暂未开放'+'搜索id:'+idString)
|
|
|
- // this.m_search_item_list.splice(0, this.m_search_item_list.length)
|
|
|
- // this.searchData(parseInt(idString))
|
|
|
- // this.searchCreateItem()
|
|
|
+ searchAction(string:string, isSearchID:boolean) {
|
|
|
+ // console.log('string=',string)
|
|
|
+ tools.showToast('暂未开放 暂未开放 暂未开放')
|
|
|
+ return
|
|
|
+ this.m_search_item_list.splice(0, this.m_search_item_list.length)
|
|
|
+ if(isSearchID) {
|
|
|
+ this.searchData(parseInt(string))
|
|
|
+ } else {
|
|
|
+ let check_yes = false
|
|
|
+ let list = Attributes.Singleton.getEventList()
|
|
|
+ for(let i=0; i<list.length; i++) {
|
|
|
+ const element = list[i]
|
|
|
+ if(element.event_name.indexOf(string)!=-1) {
|
|
|
+ if(element.event_id!=0) {
|
|
|
+ this.searchData(element.event_id)
|
|
|
+ check_yes = true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(check_yes==false) {
|
|
|
+ tools.showToast('搜索的内容不存在')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.searchCreateItem()
|
|
|
}
|
|
|
|
|
|
private searchData(id:number) {
|