|
@@ -31,7 +31,7 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
{
|
|
{
|
|
CoursType.中药检索,
|
|
CoursType.中药检索,
|
|
CoursType.中药学古文献,
|
|
CoursType.中药学古文献,
|
|
- CoursType.药物采集,
|
|
|
|
|
|
+ CoursType.药物采集与加工,
|
|
CoursType.药物炮制,
|
|
CoursType.药物炮制,
|
|
CoursType.药物化学,
|
|
CoursType.药物化学,
|
|
CoursType.药物药理,
|
|
CoursType.药物药理,
|
|
@@ -48,7 +48,7 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
_Model.currentPageIndex.Value = 1;
|
|
_Model.currentPageIndex.Value = 1;
|
|
refreshCourseList();
|
|
refreshCourseList();
|
|
ToggleGroupAddListener();
|
|
ToggleGroupAddListener();
|
|
- _Model.Bind(_View.nextPageBtn,NextBtnClick);
|
|
|
|
|
|
+ _Model.Bind(_View.nextPageBtn, NextBtnClick);
|
|
_Model.Bind(_View.lastPageBtn, LastBtnClick);
|
|
_Model.Bind(_View.lastPageBtn, LastBtnClick);
|
|
}
|
|
}
|
|
public override void OpenView()
|
|
public override void OpenView()
|
|
@@ -78,12 +78,12 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
void NextBtnClick()
|
|
void NextBtnClick()
|
|
{
|
|
{
|
|
_Model.currentPageIndex.Value++;
|
|
_Model.currentPageIndex.Value++;
|
|
- refreshCourseList() ;
|
|
|
|
|
|
+ refreshCourseList();
|
|
}
|
|
}
|
|
void LastBtnClick()
|
|
void LastBtnClick()
|
|
{
|
|
{
|
|
_Model.currentPageIndex.Value--;
|
|
_Model.currentPageIndex.Value--;
|
|
- refreshCourseList() ;
|
|
|
|
|
|
+ refreshCourseList();
|
|
}
|
|
}
|
|
/// <summary> 刷新页面数据 </summary>
|
|
/// <summary> 刷新页面数据 </summary>
|
|
void refreshCourseList()
|
|
void refreshCourseList()
|
|
@@ -91,15 +91,15 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
ReferenceCollector[] rcArray = _View.group.GetComponentsInChildren<ReferenceCollector>();
|
|
ReferenceCollector[] rcArray = _View.group.GetComponentsInChildren<ReferenceCollector>();
|
|
for (int i = 0; i < rcArray.Length; i++)
|
|
for (int i = 0; i < rcArray.Length; i++)
|
|
{
|
|
{
|
|
- int courseIndex = (_Model.currentPageIndex.Value - 1)*6+i;
|
|
|
|
- if (courseIndex>=courses.Count)
|
|
|
|
|
|
+ int courseIndex = (_Model.currentPageIndex.Value - 1) * 6 + i;
|
|
|
|
+ if (courseIndex >= courses.Count)
|
|
{
|
|
{
|
|
rcArray[i].GetComponent<CanvasGroup>().alpha = 0;
|
|
rcArray[i].GetComponent<CanvasGroup>().alpha = 0;
|
|
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- rcArray[i].GetComponent<CanvasGroup>().alpha=1;
|
|
|
|
|
|
+ rcArray[i].GetComponent<CanvasGroup>().alpha = 1;
|
|
rcArray[i].GetComponent<TextMeshProUGUI>("Index").text = courseIndex.ToString();
|
|
rcArray[i].GetComponent<TextMeshProUGUI>("Index").text = courseIndex.ToString();
|
|
rcArray[i].GetComponent<TextMeshProUGUI>("CourseName").text = courses[courseIndex].ToString();
|
|
rcArray[i].GetComponent<TextMeshProUGUI>("CourseName").text = courses[courseIndex].ToString();
|
|
currentPageCourse[i] = (CoursType)courseIndex;
|
|
currentPageCourse[i] = (CoursType)courseIndex;
|
|
@@ -123,11 +123,11 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
}
|
|
}
|
|
|
|
|
|
Color color;
|
|
Color color;
|
|
- ColorUtility.TryParseHtmlString("#FFDC63",out color);
|
|
|
|
- rc.GetComponent<TextMeshProUGUI>("Index").color=isOn?color:Color.black;
|
|
|
|
|
|
+ ColorUtility.TryParseHtmlString("#FFDC63", out color);
|
|
|
|
+ rc.GetComponent<TextMeshProUGUI>("Index").color = isOn ? color : Color.black;
|
|
rc.GetComponent<TextMeshProUGUI>("CourseName").color = isOn ? color : Color.black;
|
|
rc.GetComponent<TextMeshProUGUI>("CourseName").color = isOn ? color : Color.black;
|
|
rc.Get<GameObject>("EnterBtn").SetActive(isOn);
|
|
rc.Get<GameObject>("EnterBtn").SetActive(isOn);
|
|
- toggles[index].GetComponent<Canvas>().sortingOrder = isOn?1001:1000;
|
|
|
|
|
|
+ toggles[index].GetComponent<Canvas>().sortingOrder = isOn ? 1001 : 1000;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
toggles[0].isOn = true;
|
|
toggles[0].isOn = true;
|
|
@@ -135,7 +135,7 @@ public class MainMenuController : Controller<MainMenuView, MainMenuModel>
|
|
void OnEnterBtnClick()
|
|
void OnEnterBtnClick()
|
|
{
|
|
{
|
|
Debug.Log(_Model.onSelectCourse.Value);
|
|
Debug.Log(_Model.onSelectCourse.Value);
|
|
- if (_Model.onSelectCourse.Value==CoursType.中药检索)
|
|
|
|
|
|
+ if (_Model.onSelectCourse.Value == CoursType.中药检索)
|
|
{
|
|
{
|
|
SearchViewController searchView = FacadeComponent.Instance.CreateController<SearchViewController>();
|
|
SearchViewController searchView = FacadeComponent.Instance.CreateController<SearchViewController>();
|
|
searchView.OpenView();
|
|
searchView.OpenView();
|