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

w

parent 0e864ab7
......@@ -22,6 +22,7 @@ class LevelOneItem extends StatelessWidget {
Function(int planId) gotoPlan;
int position;
String tabName;
int allSize;
LevelOneItem(this.cards,
{this.lowPrice,
......@@ -29,7 +30,8 @@ class LevelOneItem extends StatelessWidget {
this.compare,
this.gotoPlan,
this.position,
this.tabName});
this.tabName,
this.allSize});
@override
Widget build(BuildContext context) {
......@@ -100,11 +102,6 @@ class LevelOneItem extends StatelessWidget {
),
),
),
Positioned(
left: 57,
top: 48,
child: FiveStarView(int.parse(cards.doctor.star), 5),
),
Positioned(
left: 57,
top: 17,
......@@ -124,8 +121,16 @@ class LevelOneItem extends StatelessWidget {
),
Positioned(
top: 42,
right: 0,
left: 57,
child: Container(
width: MediaQuery.of(context).size.width - 30 - 57,
child: Row(
children: <Widget>[
FiveStarView(int.parse(cards.doctor.star), 5),
Expanded(
child: Container(),
),
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
mainAxisSize: MainAxisSize.min,
......@@ -136,12 +141,18 @@ class LevelOneItem extends StatelessWidget {
height: 0,
)
: baseText("¥", 12, Color(0xffFF5963)),
baseText(price, price == "暂无报价" ? 13 : 15,
price == "暂无报价" ? Color(0xff999999) : Color(0xffFF5963),
baseText(
price,
price == "暂无报价" ? 13 : 15,
price == "暂无报价"
? Color(0xff999999)
: Color(0xffFF5963),
bold: price != "暂无报价")
],
),
],
),
)),
Positioned(
left: 57,
bottom: 15,
......@@ -150,33 +161,18 @@ class LevelOneItem extends StatelessWidget {
child: Row(
children: <Widget>[
Expanded(
child: askWidget(),
child: askWidget(margin: true),
),
Container(
width: 15,
),
Expanded(
child: lowPriceWidget(),
child: lowPriceWidget(margin: true),
)
],
),
),
),
// Positioned(
// bottom: 15,
// right: 0,
// child: lowPriceWidget(),
// ),
// Positioned(
// bottom: 15,
// right: 137,
// child: askWidget(),
// ),
// Positioned(
// left: 4.5,
// bottom: 25,
// child: compareWidget(),
// ),
Positioned(
left: 0,
bottom: 0,
......@@ -241,8 +237,19 @@ class LevelOneItem extends StatelessWidget {
),
Positioned(
top: 42.5,
right: 0,
left: 57,
child: Container(
width: MediaQuery.of(context).size.width - 30 - 57,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
FiveStarView(int.parse(cards.hospital.star), 5),
Expanded(
child: Container(
height: 0,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
mainAxisSize: MainAxisSize.min,
......@@ -253,12 +260,17 @@ class LevelOneItem extends StatelessWidget {
height: 0,
)
: baseText("¥", 12, Color(0xffFF5963)),
baseText(price, price == "暂无报价" ? 13 : 15,
price == "暂无报价" ? Color(0xff999999) : Color(0xffFF5963),
baseText(
price,
price == "暂无报价" ? 13 : 15,
price == "暂无报价"
? Color(0xff999999)
: Color(0xffFF5963),
bold: price != "暂无报价")
],
),
),
],
))),
Positioned(
bottom: 15,
left: 57,
......@@ -267,33 +279,18 @@ class LevelOneItem extends StatelessWidget {
child: Row(
children: <Widget>[
Expanded(
child: askWidget(),
child: askWidget(margin: true),
),
Container(
width: 15,
),
Expanded(
child: lowPriceWidget(),
child: lowPriceWidget(margin: true),
)
],
),
),
),
// Positioned(
// bottom: 15,
// right: 0,
// child: lowPriceWidget(),
// ),
// Positioned(
// bottom: 15,
// right: 137,
// child: askWidget(),
// ),
// Positioned(
// left: 4.5,
// bottom: 25,
// child: compareWidget(),
// ),
Positioned(
bottom: 63.5,
left: 57,
......@@ -303,11 +300,11 @@ class LevelOneItem extends StatelessWidget {
baseText(cards.hospital.address, 12, Color(0xff666666)),
),
),
Positioned(
left: 57,
top: 47,
child: FiveStarView(int.parse(cards.hospital.star), 5),
),
// Positioned(
// left: 57,
// top: 47,
// child: FiveStarView(int.parse(cards.hospital.star), 5),
// ),
Positioned(
left: 0,
bottom: 0,
......@@ -328,28 +325,33 @@ class LevelOneItem extends StatelessWidget {
}
String price =
NumPlanUtil.getPrice(cards.plan.minPrice, cards.plan.maxPrice);
return Container(
height: 118,
return Column(
children: <Widget>[
Container(
height: 117.5,
margin: EdgeInsets.only(left: 15, right: 15),
child: Stack(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Positioned(
left: 0,
top: 15,
child: Container(
width: 210,
child: baseText(cards.plan.planName, 15, Color(0xff282828),
bold: true),
),
Container(
height: 11,
),
Positioned(
right: 0,
top: 15,
child: Row(
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
Container(
constraints: BoxConstraints(
maxWidth:
MediaQuery.of(context).size.width - 15 - 130),
child: baseText(
cards.plan.planName, 15, Color(0xff282828),
bold: true),
),
Expanded(
child: Container(),
),
price == "暂无报价"
? Container(
width: 0,
......@@ -361,36 +363,29 @@ class LevelOneItem extends StatelessWidget {
bold: price != "暂无报价")
],
),
),
Positioned(
left: 4.5,
bottom: 25,
child: compareWidget(),
),
Positioned(bottom: 15, right: 0, child: lowPriceWidget()),
Positioned(
right: 137,
bottom: 15,
child: askWidget(),
),
Positioned(
top: 40,
right: 0,
Container(
margin: EdgeInsets.only(top: 7),
alignment: Alignment.centerRight,
child: baseText("指导价:${cards.plan.guide_price ?? "暂无报价"}", 11,
Color(0xff666666)),
),
Positioned(
left: 0,
bottom: 0,
child: Container(
width: MediaQuery.of(context).size.width - 30,
height: 0.5,
color: Color(0xffE5E5E5),
Container(
margin: EdgeInsets.only(top: 11),
height: 37,
child: Row(
children: <Widget>[
compareWidget(),
Expanded(
child: askWidget(),
),
Expanded(
child: lowPriceWidget(),
)
],
),
).gestureDetector(() {
)
],
)).gestureDetector(() {
buried_on_click_card(
position, tabName, "level_two_plan", "${cards.plan.plan_id}");
Map<String, dynamic> map = {
......@@ -401,15 +396,26 @@ class LevelOneItem extends StatelessWidget {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "level_two_plan_deatil", map, false);
});
}),
allSize != null && position != null && position < allSize - 1
? Container(
width: MediaQuery.of(context).size.width - 30,
height: 0.5,
color: Color(0xffE5E5E5),
)
: Container(
height: 0.5,
),
],
);
}
Widget lowPriceWidget() {
Widget lowPriceWidget({bool margin = false}) {
return GestureDetector(
onTap: lowPrice,
behavior: HitTestBehavior.opaque,
child: Container(
width: 122,
margin: EdgeInsets.only(left: margin ? 0.0 : 15),
height: 37,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18.5),
......@@ -420,12 +426,12 @@ class LevelOneItem extends StatelessWidget {
);
}
Widget askWidget() {
Widget askWidget({bool margin = false}) {
return GestureDetector(
onTap: ask,
behavior: HitTestBehavior.opaque,
child: Container(
width: 122,
margin: EdgeInsets.only(left: margin ? 0 : 15),
height: 37,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18.5),
......@@ -437,7 +443,10 @@ class LevelOneItem extends StatelessWidget {
}
Widget compareWidget() {
return Row(
return Container(
height: 30,
width: 71,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
......@@ -453,7 +462,8 @@ class LevelOneItem extends StatelessWidget {
],
).gestureDetector(() {
compare(cards.plan.plan_id);
});
}),
);
}
Widget DiaryItem(BuildContext context) {
......
......@@ -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