Commit 148509b6 authored by 杜欣's avatar 杜欣

默认选中一个机构

parent ce97a652
...@@ -173,8 +173,11 @@ class MechanismBox implements IBottomPicker { ...@@ -173,8 +173,11 @@ class MechanismBox implements IBottomPicker {
// 机构列表 // 机构列表
Widget mechanismList(mq, keyHeight) { Widget mechanismList(mq, keyHeight) {
Hospital firstHospital = _levelModel.cardsLive.data[0].hospital;
firstHospital.isCheck = true;
doctor_ids.add(firstHospital.doctorId);
return Container( return Container(
height: mq.size.height - 140 - 96 - 50 - keyHeight, height: mq.size.height - 286 - keyHeight,
width: mq.size.width, width: mq.size.width,
padding: EdgeInsets.only(left: 15, right: 15), padding: EdgeInsets.only(left: 15, right: 15),
child: baseRefreshView(refreshController, () {}, null, null, child: baseRefreshView(refreshController, () {}, null, null,
...@@ -201,7 +204,7 @@ class MechanismBox implements IBottomPicker { ...@@ -201,7 +204,7 @@ class MechanismBox implements IBottomPicker {
} }
if (_levelModel.data[index].cardType == 'hospital') { if (_levelModel.data[index].cardType == 'hospital') {
return HospitalItem( return HospitalItem(
_levelModel.data[index].hospital); _levelModel.data[index].hospital, index);
} else { } else {
return Container(); return Container();
} }
...@@ -218,11 +221,11 @@ class MechanismBox implements IBottomPicker { ...@@ -218,11 +221,11 @@ class MechanismBox implements IBottomPicker {
} }
// 机构卡片 // 机构卡片
Widget HospitalItem(Hospital hospital) { Widget HospitalItem(Hospital hospital, index) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (doctor_ids.indexOf(hospital.doctorId) != -1) { if (doctor_ids.contains(hospital.doctorId)) {
doctor_ids.remove(hospital.doctorId); doctor_ids.remove(hospital.doctorId);
} else { } else {
doctor_ids.add(hospital.doctorId); doctor_ids.add(hospital.doctorId);
...@@ -230,6 +233,9 @@ class MechanismBox implements IBottomPicker { ...@@ -230,6 +233,9 @@ class MechanismBox implements IBottomPicker {
hospital.isCheck = !hospital.isCheck; hospital.isCheck = !hospital.isCheck;
focusNode.unfocus(); focusNode.unfocus();
_levelModel.cardsLive.notifyView(_levelModel.cardsLive.data); _levelModel.cardsLive.notifyView(_levelModel.cardsLive.data);
if (doctor_ids.length > 3 || doctor_ids.length == 0) {
NativeToast.showNativeToast('请选择1-3个机构咨询');
}
}, },
child: Container( child: Container(
height: 91.5, height: 91.5,
......
...@@ -30,12 +30,12 @@ class TestState extends BaseState<TestPage> { ...@@ -30,12 +30,12 @@ class TestState extends BaseState<TestPage> {
list.add(listItem("一级列表页", () { list.add(listItem("一级列表页", () {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "level_one_plan_detail", {"planId": 137}, false); .jumpPage(context, "level_one_plan_detail", {"planId": 647}, false);
})); }));
list.add(listItem("二级列表页", () { list.add(listItem("二级列表页", () {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "level_two_plan_deatil", {"planId": 192}, false); .jumpPage(context, "level_two_plan_deatil", {"planId": 696}, false);
})); }));
list.add(listItem("项目首页", () { list.add(listItem("项目首页", () {
RouterCenterImpl() RouterCenterImpl()
...@@ -77,7 +77,7 @@ class TestState extends BaseState<TestPage> { ...@@ -77,7 +77,7 @@ class TestState extends BaseState<TestPage> {
@override @override
Widget buildItem(BuildContext context) { Widget buildItem(BuildContext context) {
CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE, CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
"_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393"); "_gtid=c14659b0c25b11ea80d77a872bf3b5437841;sessionid=0r8emll1qcqay0vz44hhgf4j1014vgxq;_gm_token=ba7e621594369445;");
return Scaffold( return Scaffold(
appBar: baseAppBar( appBar: baseAppBar(
title: "测试页面", title: "测试页面",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment