Exemple #1
0
    protected override void Init()
    {
        base.Init();

        EventListener.Get(BtnQuickTaskAdd.gameObject).onClick = OnQuickTaskAdd;
        PlanListView.OnItemClicked = OnTaskClicked;
        EventListener.Get(ShowComplatedTask.gameObject).onClick = ShowComplatedTaskClicked;

        UserSearch = this.GetPar <EUserSearch>(0);
        if (UserSearch != null)
        {
            PageTitle.Init(UserSearch.Name, App.Instance.Theme.TitleBgColor, App.Instance.Theme.TitleFontColor, null, MenuClicked);
            PageTitle.AddButton("", App.Instance.ImageManger.ImageList[0], TaskSearch);
            BindData();
        }
        else
        {
            UserSearch_Service.GetDefault(t =>
            {
                UserSearch = t.GetData() as EUserSearch;
                if (UserSearch == null)
                {
                    PageTitle.Init("全部任务", App.Instance.Theme.TitleBgColor, App.Instance.Theme.TitleFontColor, null, MenuClicked);
                }
                else
                {
                    PageTitle.Init(UserSearch.Name, App.Instance.Theme.TitleBgColor, App.Instance.Theme.TitleFontColor, null, MenuClicked);
                }
                PageTitle.AddButton("", App.Instance.ImageManger.ImageList[0], TaskSearch);
                BindData();
            });
        }
    }
Exemple #2
0
    void OnSetDefaultClicked(GameObject g)
    {
        string idstr = g.transform.parent.name.Split('_')[1];

        UserSearch_Service.SetDefault(int.Parse(idstr), t =>
        {
            BindData();
        });
    }
Exemple #3
0
    void OnItemClicked(GameObject g)
    {
        string idstr = g.name.Split('_')[1];

        UserSearch_Service.GetByID(int.Parse(idstr), c =>
        {
            EUserSearch uSearch = c.GetData() as EUserSearch;
            App.Instance.PageGroup.ShowPage("Page_Task", true, uSearch);
        });
    }
Exemple #4
0
    void BindData()
    {
        UserSearch_Service.ListMy(t =>
        {
            List <EUserSearch> plist = t.GetData() as List <EUserSearch>;
            SearchList.BindData <EUserSearch>("SeachTaskItem", plist, (i, e) =>
            {
                i.name = "SeachTaskItem_" + e.ID.ToString();
                i.transform.Find("Name").GetComponent <Text>().text = e.Name;

                GameObject delBtn = i.transform.Find("NavIcon").gameObject;
                if (IsEdit)
                {
                    delBtn.SetActive(true);
                }
                else
                {
                    delBtn.SetActive(false);
                }
                EventListener.Get(delBtn).onClick = OnDelClicked;

                GameObject defaultBtn = i.transform.Find("Icon").gameObject;
                if (e.IsDefault)
                {
                    defaultBtn.GetComponent <RawImage>().color = Color.green;
                    EventListener.Get(defaultBtn).onClick      = null;
                }
                else
                {
                    defaultBtn.GetComponent <RawImage>().color = Color.white;
                    EventListener.Get(defaultBtn).onClick      = OnSetDefaultClicked;
                }
            }, true);
            SearchList.OnItemClicked = OnItemClicked;
        });
    }