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

w

parent 0e864ab7
......@@ -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,35 +414,35 @@ class LevelOneState extends BaseState<LevelOnePage>
Widget explain() {
List<Widget> list = [];
list.add(Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828), bold: true),
Expanded(
child: Container(),
),
GestureDetector(
onTap: () {
Map<String, dynamic> map = {
"business_id": "${widget.planId}",
"planId": widget.planId,
"referrer_tab_name": _model.tabsList[tabController.index].name
};
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "level_one_plan_instruction", map, false);
},
behavior: HitTestBehavior.opaque,
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
));
list.add(Container(
height: 31,
child: Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828)),
Expanded(
child: Container(),
),
GestureDetector(
onTap: () {
Map<String, dynamic> map = {
"business_id": "${widget.planId}",
"planId": widget.planId,
"referrer_tab_name": _model.tabsList[tabController.index].name
};
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "level_one_plan_instruction", map, false);
},
behavior: HitTestBehavior.opaque,
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
),
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,31 +382,30 @@ class LevelTwoState extends BaseState<LevelTwoPage>
Widget explain() {
List<Widget> list = [];
list.add(Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828),bold: true),
Expanded(
child: Container(),
),
GestureDetector(
onTap: () {
Map<String, dynamic> map = {
"business_id": "${widget.planId}",
"referrer_tab_name": _model.tabsList[tabController.index].name,
"planId": widget.planId
};
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "level_two_plan_instruction", map, false);
},
behavior: HitTestBehavior.opaque,
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
));
list.add(Container(
margin: EdgeInsets.only(bottom: 4),
height: 31,
child: Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828), bold: true),
Expanded(
child: Container(),
),
GestureDetector(
onTap: () {
Map<String, dynamic> map = {
"business_id": "${widget.planId}",
"referrer_tab_name": _model.tabsList[tabController.index].name,
"planId": widget.planId
};
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "level_two_plan_instruction", map, false);
},
behavior: HitTestBehavior.opaque,
child: baseText("了解更多", 12, Color(0xff3FB5AF)),
)
],
),
height: 11,
));
if (_model.planoverItem != null) {
_model.planoverItem.explanationAttrs.forEach((element) {
......@@ -417,9 +416,9 @@ class LevelTwoState extends BaseState<LevelTwoPage>
Container(
width: 55,
child: Text(
element.attrName.length == 2
? "${element.attrName.substring(0, 1)} ${element.attrName.substring(1, 2)}"
: element.attrName,
element.attrName.length == 2
? "${element.attrName.substring(0, 1)} ${element.attrName.substring(1, 2)}"
: element.attrName,
textScaleFactor: 1.0,
softWrap: true,
maxLines: 1,
......@@ -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(
text: text,
),
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