|
@@ -1,6 +1,7 @@
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using ScrollViewUI;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using TMPro;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
@@ -16,6 +17,14 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
|
|
|
{
|
|
|
base.Dispose();
|
|
|
}
|
|
|
+ public void ShowUI(string type)
|
|
|
+ {
|
|
|
+ this._View.txtTitle.text = type.ToString();
|
|
|
+
|
|
|
+
|
|
|
+ this._View.txtTitlePin.text = type.ToString();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
protected override void BindingViewModel()
|
|
|
{
|
|
@@ -24,19 +33,19 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
|
|
|
{
|
|
|
Debug.Log("返回主页面");
|
|
|
|
|
|
- FacadeComponent.Instance.CreateController<SearchTypeEntryController>().OpenView();
|
|
|
+ FacadeComponent.Instance.CreateController<MainMenuController>().OpenView();
|
|
|
|
|
|
FacadeComponent.Instance.CloseView(this._View, null);
|
|
|
});
|
|
|
|
|
|
this._Model.Bind(this._View.btnEnterClass, () =>
|
|
|
{
|
|
|
-
|
|
|
+ Debug.Log("进入相应的课程");
|
|
|
|
|
|
});
|
|
|
this._Model.Bind(this._View.ifMedcineSeach, this._Model.txtMedcineSeach, (str) =>
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
bool isShowMedcine = string.IsNullOrEmpty(str);
|
|
|
this._View.ifMedcineSeach.text = str;
|
|
|
this._View.rtMedcineAllParent.gameObject.SetActive(isShowMedcine);
|
|
@@ -147,33 +156,30 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
|
|
|
go.SetActive(id != 0);
|
|
|
if (id == 0) return;
|
|
|
|
|
|
- var txt = go.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
+ var txt = go.transform.Find("txt").GetComponent<TextMeshProUGUI>();
|
|
|
+ var txtWord = go.transform.Find("txtWord").GetComponent<TextMeshProUGUI>();
|
|
|
var img = go.GetComponent<Image>();
|
|
|
var btn = go.GetComponent<Button>();
|
|
|
-
|
|
|
+ txt.gameObject.SetActive(id > 0);
|
|
|
+ txtWord.gameObject.SetActive(id < 0);
|
|
|
+ btn.enabled = id > 0;
|
|
|
+ img.color = new Color(1, 1, 1, 0);
|
|
|
if (id < 0)
|
|
|
{
|
|
|
- txt.text = (char)Mathf.Abs(id) + ":";
|
|
|
-
|
|
|
- btn.enabled = false;
|
|
|
- img.enabled = false;
|
|
|
+ txtWord.text = (char)Mathf.Abs(id) + ".";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- btn.enabled = true;
|
|
|
- img.enabled = true;
|
|
|
- var ele = this._Model.mdAllconfig.Get(id);
|
|
|
|
|
|
+ var ele = this._Model.mdAllconfig.Get(id);
|
|
|
|
|
|
|
|
|
txt.text = ele.name;
|
|
|
|
|
|
- img.color = Color.yellow;
|
|
|
-
|
|
|
|
|
|
if (this._View.curClickGO.id == ele.id)
|
|
|
{
|
|
|
- img.color = Color.red;
|
|
|
+ img.color = Color.white;
|
|
|
this._View.curClickGO.img = img;
|
|
|
|
|
|
}
|
|
@@ -183,11 +189,11 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
|
|
|
{
|
|
|
if (this._View.curClickGO.img != null)
|
|
|
{
|
|
|
- this._View.curClickGO.img.color = Color.yellow;
|
|
|
+ this._View.curClickGO.img.color = new Color(1, 1, 1, 0);
|
|
|
}
|
|
|
this._View.curClickGO.id = ele.id;
|
|
|
this._View.curClickGO.img = img;
|
|
|
- img.color = Color.red;
|
|
|
+ img.color = Color.white;
|
|
|
UpdateChoose();
|
|
|
});
|
|
|
}
|
|
@@ -209,48 +215,51 @@ public class SearchTypeEntryController : Controller<SearchTypeEntryView, SearchT
|
|
|
{
|
|
|
|
|
|
|
|
|
- //this._Model.dicIndexId
|
|
|
+ this._Model.listSeach = this._Model.mdAllconfig.list.Where(x => x.name.Contains(str)).ToList();
|
|
|
//默认选中的
|
|
|
-
|
|
|
-
|
|
|
- this._View.curClickGO.id = this._Model.listSeach[0].id;
|
|
|
-
|
|
|
- this._View.scvSeach.SetData(this._Model.listSeach.Count, (idx, go) =>
|
|
|
+ if (this._Model.listSeach.Count > 0)
|
|
|
{
|
|
|
- var txt = go.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
- var img = go.GetComponent<Image>();
|
|
|
- var btn = go.GetComponent<Button>();
|
|
|
-
|
|
|
+ this._View.curClickGO.id = this._Model.listSeach[0].id;
|
|
|
+ UpdateChoose();
|
|
|
+ }
|
|
|
+ this._View.scvSeach.SetData(this._Model.listSeach.Count, (idx, go) =>
|
|
|
+ {
|
|
|
+ var txt = go.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
+ var img = go.GetComponent<Image>();
|
|
|
+ var btn = go.GetComponent<Button>();
|
|
|
|
|
|
- var ele = this._Model.listSeach[idx];
|
|
|
|
|
|
+ var ele = this._Model.listSeach[idx];
|
|
|
|
|
|
+ img.color = new Color(1, 1, 1, 0);
|
|
|
|
|
|
- txt.text = ele.name;
|
|
|
|
|
|
- img.color = Color.yellow;
|
|
|
+ txt.text = ele.name;
|
|
|
|
|
|
|
|
|
- if (this._View.curClickGO.id == ele.id)
|
|
|
- {
|
|
|
- img.color = Color.red;
|
|
|
- this._View.curClickGO.img = img;
|
|
|
+ if (this._View.curClickGO.id == ele.id)
|
|
|
+ {
|
|
|
+ img.color = Color.white;
|
|
|
+ this._View.curClickGO.img = img;
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- btn.onClick.RemoveAllListeners();
|
|
|
- btn.onClick.AddListener(() =>
|
|
|
- {
|
|
|
- if (this._View.curClickGO.img != null)
|
|
|
+ btn.onClick.RemoveAllListeners();
|
|
|
+ btn.onClick.AddListener(() =>
|
|
|
{
|
|
|
- this._View.curClickGO.img.color = Color.yellow;
|
|
|
- }
|
|
|
- this._View.curClickGO.id = ele.id;
|
|
|
- this._View.curClickGO.img = img;
|
|
|
- img.color = Color.red;
|
|
|
- UpdateChoose();
|
|
|
+ if (this._View.curClickGO.img != null)
|
|
|
+ {
|
|
|
+ this._View.curClickGO.img.color = new Color(1, 1, 1, 0);
|
|
|
+ }
|
|
|
+ this._View.curClickGO.id = ele.id;
|
|
|
+ this._View.curClickGO.img = img;
|
|
|
+ img.color = Color.white;
|
|
|
+ UpdateChoose();
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
@@ -318,6 +327,7 @@ public class SearchTypeEntryView : View
|
|
|
public TMPro.TextMeshProUGUI txtMedcineDes;
|
|
|
public TMPro.TextMeshProUGUI txtMedcineName;
|
|
|
public TMPro.TextMeshProUGUI txtTitle;
|
|
|
+ public TMPro.TextMeshProUGUI txtTitlePin;
|
|
|
public Button btnEnterClass;
|
|
|
public Button btnBack;
|
|
|
|
|
@@ -325,6 +335,7 @@ public class SearchTypeEntryView : View
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public override void LoadInit()
|
|
|
{
|
|
|
|
|
@@ -359,6 +370,7 @@ public class SearchTypeEntryView : View
|
|
|
txtMedcineName = rc.GetComponent<TextMeshProUGUI>("txtMedcineName");
|
|
|
txtMedcineDes = rc.GetComponent<TextMeshProUGUI>("txtMedcineDes");
|
|
|
txtTitle = rc.GetComponent<TextMeshProUGUI>("txtTitle");
|
|
|
+ txtTitlePin = rc.GetComponent<TextMeshProUGUI>("txtTitlePin");
|
|
|
btnEnterClass = rc.GetComponent<Button>("btnEnterClass");
|
|
|
btnBack = rc.GetComponent<Button>("btnBack");
|
|
|
|