Commit 376e160a authored by 林生雨's avatar 林生雨

w

parent 0e864ab7
......@@ -101,8 +101,11 @@ class LevelOneListState extends State<LevelOneList>
color: Color(0xffF7F6FA),
);
}
return LevelOneItem(
return Container(
color: Colors.white,
child: LevelOneItem(
_model.data[index],
allSize: _model.data.length,
lowPrice: () {
if (CacheManager.getInstance()
.get(MEMORY_CACHE)
......@@ -111,19 +114,18 @@ class LevelOneListState extends State<LevelOneList>
RouterCenterImpl()
.findMainRouter()
.isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
RouterCenterImpl().findMainRouter().jumpPage(
context, "show_login", null, true);
return;
}
var data2 = _model.data[index];
if (data2.cardType == "doctor") {
buried_on_click_button(index, "bargain", "doctor",
data2.doctor.doctor_id);
buried_on_click_button(index, "bargain",
"doctor", data2.doctor.doctor_id);
} else if (data2.cardType == "hospital") {
buried_on_click_button(index, "bargain", "hospital",
data2.hospital.hosiptalId);
buried_on_click_button(index, "bargain",
"hospital", data2.hospital.hosiptalId);
} else if (data2.cardType == "plan") {
buried_on_click_button(index, "bargain",
"level_two_plan", "${data2.plan.plan_id}");
......@@ -146,19 +148,25 @@ class LevelOneListState extends State<LevelOneList>
NativeToast.showNativeToast("该机构未开通私信功能");
return;
}
buried_on_click_button(index, "consult", "doctor",
data2.doctor.doctor_id);
buried_on_click_button(index, "consult",
"doctor", data2.doctor.doctor_id);
RouterCenterImpl().findMainRouter().jumpPage(
context, data2.doctor.messageUrl, null, true);
context,
data2.doctor.messageUrl,
null,
true);
} else if (data2.cardType == "hospital") {
if (!data2.hospital.accept_private_msg) {
NativeToast.showNativeToast("该机构未开通私信功能");
return;
}
buried_on_click_button(index, "consult", "hospital",
data2.hospital.hosiptalId);
buried_on_click_button(index, "consult",
"hospital", data2.hospital.hosiptalId);
RouterCenterImpl().findMainRouter().jumpPage(
context, data2.hospital.messageUrl, null, true);
context,
data2.hospital.messageUrl,
null,
true);
} else if (data2.cardType == "plan") {
if (CacheManager.getInstance()
.get(MEMORY_CACHE)
......@@ -167,9 +175,8 @@ class LevelOneListState extends State<LevelOneList>
RouterCenterImpl()
.findMainRouter()
.isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
RouterCenterImpl().findMainRouter().jumpPage(
context, "show_login", null, true);
return;
}
buried_on_click_button(index, "consult",
......@@ -183,11 +190,11 @@ class LevelOneListState extends State<LevelOneList>
compare: (int planId) {
var data2 = _model.data[index];
if (data2.cardType == "doctor") {
buried_on_click_button(index, "compare", "doctor",
data2.doctor.doctor_id);
buried_on_click_button(index, "compare",
"doctor", data2.doctor.doctor_id);
} else if (data2.cardType == "hospital") {
buried_on_click_button(index, "compare", "hospital",
data2.hospital.hosiptalId);
buried_on_click_button(index, "compare",
"hospital", data2.hospital.hosiptalId);
} else if (data2.cardType == "plan") {
buried_on_click_button(index, "compare",
"level_two_plan", "${data2.plan.plan_id}");
......@@ -209,7 +216,7 @@ class LevelOneListState extends State<LevelOneList>
},
tabName: widget.tabName,
position: index,
);
));
},
childCount: _model.data.length + 1,
),
......
......@@ -221,7 +221,8 @@ class LevelOneState extends BaseState<LevelOnePage>
SliverOverlapAbsorber(
handle: extend.NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: baseSliverAppBar(_model.imageUrl)),
sliver: baseSliverAppBar(_model.imageUrl,
height: ScreenUtil().setHeight(200))),
SliverList(
delegate: SliverChildBuilderDelegate((BuildContext c, int i) {
if (i == 0) {
......@@ -246,15 +247,17 @@ class LevelOneState extends BaseState<LevelOnePage>
),
];
},
body: TabBarView(controller: tabController, children: list));
body: Container(
color: Color(0xffF7F6FA),
child: TabBarView(controller: tabController, children: list)));
}
List<Widget> getTabs() {
List<Widget> list = [];
for (int i = 0; i < _model.tabsList.length; i++) {
list.add(baseTabBarItem(_model.tabsList[i].name,
leftPadding: i == 0 ? 24 : 28,
rightPadding: i == _model.tabsList.length - 1 ? 24 : 28));
leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabsList.length - 1 ? 21.5 : 14));
}
return list;
}
......@@ -283,7 +286,7 @@ class LevelOneState extends BaseState<LevelOnePage>
return Container(
width: MediaQuery.of(context).size.width,
height: 54,
margin: EdgeInsets.only(top: 14, bottom: 12),
margin: EdgeInsets.only(top: 19, bottom: 12),
child: Stack(
children: <Widget>[
Positioned(
......@@ -293,7 +296,7 @@ class LevelOneState extends BaseState<LevelOnePage>
bold: true),
),
Positioned(
bottom: 6,
bottom: 3.5,
left: 15,
child: Container(
width: MediaQuery.of(context).size.width - 30 - 100,
......@@ -411,11 +414,9 @@ class LevelOneState extends BaseState<LevelOnePage>
Widget explain() {
List<Widget> list = [];
list.add(Container(
height: 31,
child: Row(
list.add(Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828)),
baseText("项目说明", 15, Color(0xff282828), bold: true),
Expanded(
child: Container(),
),
......@@ -434,12 +435,14 @@ class LevelOneState extends BaseState<LevelOnePage>
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
),
));
list.add(Container(
height: 11,
));
if (_model.planoverItem != null) {
_model.planoverItem.explanationAttrs.forEach((element) {
list.add(Container(
margin: EdgeInsets.only(bottom: 15),
margin: EdgeInsets.only(bottom: 10),
child: Row(
children: <Widget>[
Container(
......@@ -489,7 +492,7 @@ class LevelOneState extends BaseState<LevelOnePage>
});
}
return Container(
margin: EdgeInsets.only(left: 15, right: 15, bottom: 20),
margin: EdgeInsets.only(left: 15, right: 15, bottom: 9),
child: Column(
mainAxisSize: MainAxisSize.min,
children: list,
......
......@@ -256,8 +256,8 @@ class LevelTwoState extends BaseState<LevelTwoPage>
List<Widget> list = [];
for (int i = 0; i < _model.tabsList.length; i++) {
list.add(baseTabBarItem(_model.tabsList[i].name,
leftPadding: i == 0 ? 24 : 28,
rightPadding: i == _model.tabsList.length - 1 ? 24 : 28));
leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabsList.length - 1 ? 21.5 : 14));
}
return list;
}
......@@ -372,7 +372,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
),
width: double.maxFinite,
height: 62,
margin: EdgeInsets.only(left: 15, right: 15, bottom: 12),
margin: EdgeInsets.only(left: 15, right: 15, bottom: 17),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: list,
......@@ -382,12 +382,9 @@ class LevelTwoState extends BaseState<LevelTwoPage>
Widget explain() {
List<Widget> list = [];
list.add(Container(
margin: EdgeInsets.only(bottom: 4),
height: 31,
child: Row(
list.add(Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828), bold: true),
baseText("项目说明", 15, Color(0xff282828),bold: true),
Expanded(
child: Container(),
),
......@@ -406,7 +403,9 @@ class LevelTwoState extends BaseState<LevelTwoPage>
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
),
));
list.add(Container(
height: 11,
));
if (_model.planoverItem != null) {
_model.planoverItem.explanationAttrs.forEach((element) {
......@@ -456,7 +455,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
});
}
return Container(
margin: EdgeInsets.only(left: 15, right: 15, bottom: 3),
margin: EdgeInsets.only(left: 15, right: 15, bottom: 9),
child: Column(
mainAxisSize: MainAxisSize.min,
children: list,
......
......@@ -139,7 +139,7 @@ class PlanItem extends StatelessWidget {
left: 91,
bottom: 12,
child: Container(
width: MediaQuery.of(context).size.width - 30 - 91 - 10,
width: MediaQuery.of(context).size.width - 30 - 91 - 4,
child: Row(
textBaseline: TextBaseline.alphabetic,
crossAxisAlignment: CrossAxisAlignment.baseline,
......
......@@ -199,8 +199,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
List<Widget> list = [];
for (int i = 0; i < _model.tabs.length; i++) {
list.add(baseTabBarItem(_model.tabs[i].name,
leftPadding: i == 0 ? 24 : 28,
rightPadding: i == _model.tabs.length - 1 ? 24 : 28));
leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabs.length - 1 ? 21.5 : 14));
}
return list;
}
......
......@@ -458,17 +458,30 @@ Widget baseTabBar(
Widget baseTabBarItem(String text,
{double leftPadding, double rightPadding, double wantWidth}) {
leftPadding = leftPadding ?? 28.0;
rightPadding = rightPadding ?? 28.0;
double width = leftPadding + text.length * 16.0 + rightPadding;
return Container(
height: 40.0,
width: wantWidth ?? width,
alignment: Alignment.center,
child: Tab(
leftPadding = leftPadding ?? 14.0;
rightPadding = rightPadding ?? 14.0;
return Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: leftPadding,
),
Tab(
text: text,
),
Container(
width: rightPadding,
)
],
);
// Container(
// height: 40.0,
// width: wantWidth ?? width,
// alignment: Alignment.center,
// child: Tab(
// text: text,
// ),
// );
}
Widget baseSliverAppBar(String url,
......@@ -485,8 +498,7 @@ Widget baseSliverAppBar(String url,
imageUrl: url ?? '',
fit: BoxFit.cover,
)
: Container(
),
: Container(),
),
);
}
......
......@@ -120,7 +120,7 @@ class Home extends StatefulWidget {
class HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
ScreenUtil.init(context, width: 375, height: 810);
ScreenUtil.init(context, width: 375, height: 667);
return isDebug
? RouterCenterImpl().findMainRouter().getTestPage()
: Container(
......
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