HarProcess.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. using TMPro;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using WS;
  5. using static MedicineAllConfig;
  6. /// <summary>
  7. /// 采集 与加工
  8. /// </summary>
  9. public enum HarProcessType
  10. {
  11. 基础信息,
  12. 产地与生境,
  13. 采集方法,
  14. 加工方法,
  15. Count,
  16. }
  17. /// <summary>
  18. /// 古文献
  19. /// </summary>
  20. public enum GuWenXianType
  21. {
  22. 鲜地黄,
  23. 生地黄,
  24. 熟地黄,
  25. 熟地黄炭,
  26. Count,
  27. }
  28. /// <summary>
  29. /// 药物炮制
  30. /// </summary>
  31. public enum YaoWuPaoZhiType
  32. {
  33. 鲜地黄采集与加工,
  34. 生地黄_切制,
  35. 熟地黄_切制,
  36. 熟地黄,
  37. 熟地黄炭,
  38. Count,
  39. }
  40. /// <summary>
  41. /// 资源与鉴定
  42. /// </summary>
  43. public enum ResCheckType
  44. {
  45. 资源分别,
  46. 生地黄结构,
  47. 熟地黄形态,
  48. 熟地黄炭形态,
  49. Count,
  50. }
  51. public class HarProcessController : Controller<HarProcessView, HarProcessModel>
  52. {
  53. public override void Dispose()
  54. {
  55. base.Dispose();
  56. }
  57. public void ShowUI(int medicineId)
  58. {
  59. }
  60. protected override void BindingViewModel()
  61. {
  62. this._Model.Bind(this._View.btnBack, () =>
  63. {
  64. Debug.Log("返回主页面");
  65. FacadeComponent.Instance.CreateController<SearchTypeEntryController>().OpenView();
  66. CloseView();
  67. });
  68. //https://ar-1303083714.cos.ap-nanjing.myqcloud.com/tet.mp4
  69. //生成事件sliderz
  70. this._View.toggleHelp.TogCreateBindEvent((idx, on, off) =>
  71. {
  72. on.transform.Find("txt").GetComponent<TextMeshProUGUI>().text = ((HarProcessType)idx).ToString();
  73. off.transform.Find("txt").GetComponent<TextMeshProUGUI>().text = ((HarProcessType)idx).ToString();
  74. }, (idx) =>
  75. {
  76. switch (((HarProcessType)idx))
  77. {
  78. case HarProcessType.基础信息:
  79. Debug.Log("展示基础信息!");
  80. break;
  81. case HarProcessType.产地与生境:
  82. Debug.Log("产地与生境!");
  83. break;
  84. case HarProcessType.采集方法:
  85. Debug.Log("采集方法!");
  86. break;
  87. case HarProcessType.加工方法:
  88. Debug.Log("加工方法!");
  89. break;
  90. case HarProcessType.Count:
  91. break;
  92. default:
  93. break;
  94. }
  95. }, (int)HarProcessType.Count);
  96. this._View.toggleHelp.TogInitUI();
  97. }
  98. }
  99. public class HarProcessModel : Model
  100. {
  101. public CoursType curCourstype;
  102. public MedicineEle medicine;
  103. public override void InitProperty()
  104. {
  105. }
  106. }
  107. public class HarProcessView : View
  108. {
  109. public TMPro.TMP_InputField ifMedcineSeach;
  110. public ScrollRect svSeach;
  111. public ScrollRect svMedcineAll;
  112. public TMPro.TextMeshProUGUI txtMedcineDes;
  113. public TMPro.TextMeshProUGUI txtMedcineName;
  114. public TMPro.TextMeshProUGUI txtTitle;
  115. public Button btnEnterClass;
  116. public Button btnBack;
  117. public ToggleHelp toggleHelp;
  118. public override void LoadInit()
  119. {
  120. ShowModeType = ViewShowModeType.Screen;
  121. ReferenceCollector rc = UIGameObject.GetComponent<ReferenceCollector>();
  122. ifMedcineSeach = rc.GetComponent<TMP_InputField>("ifMedcineSeach");
  123. svSeach = rc.GetComponent<ScrollRect>("svSeach");
  124. svMedcineAll = rc.GetComponent<ScrollRect>("svMedcineAll");
  125. txtMedcineName = rc.GetComponent<TextMeshProUGUI>("txtMedcineName");
  126. txtMedcineDes = rc.GetComponent<TextMeshProUGUI>("txtMedcineDes");
  127. txtTitle = rc.GetComponent<TextMeshProUGUI>("txtTitle");
  128. btnEnterClass = rc.GetComponent<Button>("btnEnterClass");
  129. btnBack = rc.GetComponent<Button>("btnBack");
  130. toggleHelp = rc.GetComponent<ToggleHelp>("cttTog");
  131. }
  132. }