Commit a0a0bbdf authored by 朱璇's avatar 朱璇

对比详情

parent d1df55f1
......@@ -2,7 +2,7 @@
* @Author: zx
* @Date: 2020-06-30 17:40:43
* @Last Modified by: zx
* @Last Modified time: 2020-07-02 18:44:20
* @Last Modified time: 2020-07-02 21:43:07
*/
import 'package:cached_network_image/cached_network_image.dart';
......@@ -91,7 +91,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
if (data.data.first == FAIL) {
return errorItem(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, () {
//TODO
_model.init([1, 2]);
});
}
return ListView.builder(
......@@ -113,9 +113,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget widget;
if (group.groupType == 'hot') {
widget = Container(
height: 100,
alignment: Alignment.center,
child: baseText("第一个", 15, Colors.black),
child: planPopularityView(group),
// height: 100,
// alignment: Alignment.center,
// child: baseText("第一个", 15, Colors.black),
);
} else if (group.groupType == 'normal_attrs') {
widget = Container(
......@@ -164,6 +165,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
if (data.data == null) {
return Container();
}
PlansInfo planinfo = data.data.second[index];
return Container(
child: Stack(children: <Widget>[
Positioned(
......@@ -173,7 +175,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
height: 75,
width: (screenWidth - 30 - 11) / 2,
child: ClipRRect(
borderRadius: BorderRadius.circular(15),
borderRadius: BorderRadius.circular(7),
child: Image.asset('assets/plan_compare_detail_info_bg.png',
fit: BoxFit.cover),
),
......@@ -181,12 +183,15 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned(
left: 12,
top: 24,
child: baseText('11111', 15, Color(0xff333333), bold: true),
child:
baseText(planinfo.planName, 15, Color(0xff333333), bold: true),
),
Positioned(
left: 12,
top: 48,
child: baseText('¥¥¥¥¥¥¥¥¥¥', 14, Colors.red, bold: true),
child: baseText('¥' + planinfo.minPrice + '-' + planinfo.maxPrice,
14, Colors.red,
bold: true),
),
]));
},
......@@ -223,104 +228,109 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
);
}
Widget planPopularityView(List<PlansInfo> planInfo) {
Widget planPopularityView(Groups groups) {
return Container(
height: 265,
child: Container(
child: Column(children: <Widget>[
titleView('111111'),
Row(children: <Widget>[
Expanded(flex: 1, child: planPopularityLeftItem(planInfo[0])),
Expanded(flex: 1, child: planPopularityRightItem(planInfo[1]))
])
])),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
titleView(groups.groupName),
Container(child: planPopularityBodyView(groups)),
Container()
]),
);
}
Widget planPopularityLeftItem(PlansInfo plan) {
Widget planPopularityBodyView(Groups groups) {
return Container(
color: Colors.red,
// height: 80,
child: Expanded(
child: Stack(children: <Widget>[
height: 170,
child: Row(children: <Widget>[
Expanded(flex: 1, child: planPopularityLeftItem(groups.plans[0])),
Expanded(flex: 1, child: planPopularityRightItem(groups.plans[1]))
]));
}
Widget planPopularityLeftItem(Plans plan) {
return Container(
height: 170,
child: Stack(children: <Widget>[
Positioned(
right: 20,
top: 12,
child: baseText('99%', 21, Color(0xffF25874), bold: true)),
top: 0,
child: baseText(plan.positiveRate, 21, Color(0xff3FB5AF),
bold: true)),
Positioned(
right: 20,
top: 33,
// bottom: 12,
top: 24,
child: baseText('好评率', 12, Color(0xff666666), bold: false),
),
Positioned(
right: 20,
top: 55,
// bottom: 12,
top: 41,
child: FiveStarView(3, 5),
),
Positioned(
right: 20,
top: 98,
bottom: 12,
child: baseText('13679个', 21, Color(0xffF25874), bold: true),
top: 84,
child: baseText(plan.salesCount, 21, Color(0xff3FB5AF), bold: true),
),
Positioned(
right: 20,
top: 112,
bottom: 12,
top: 108,
child: baseText('销量', 12, Color(0xff666666), bold: false),
),
Positioned(
right: 20,
top: 132,
bottom: 12,
child: baseText('', 12, Color(0xff666666), bold: false),
),
])));
right: 20,
bottom: 30,
child: Container(
color: Colors.red,
height: 14,
width: 95,
)),
]));
}
Widget planPopularityRightItem(PlansInfo plan) {
Widget planPopularityRightItem(Plans plan) {
return Container(
color: Colors.red,
// height: 80,
child: Expanded(
child: Stack(children: <Widget>[
height: 170,
child: Stack(children: <Widget>[
Positioned(
left: 20,
top: 12,
child: baseText('99%', 21, Color(0xffF25874), bold: true)),
top: 0,
child: baseText(plan.positiveRate, 21, Color(0xffF25874),
bold: true)),
Positioned(
left: 20,
top: 33,
// bottom: 12,
top: 24,
child: baseText('好评率', 12, Color(0xff666666), bold: false),
),
Positioned(
left: 20,
top: 55,
// bottom: 12,
child: FiveStarView(3, 5),
),
left: 20,
top: 41,
child: Container(
height: 13,
width: 81,
child: FiveStarView(3, 5),
)),
Positioned(
left: 20,
top: 98,
bottom: 12,
child: baseText('13679个', 21, Color(0xffF25874), bold: true),
top: 84,
child: baseText(plan.salesCount, 21, Color(0xffF25874), bold: true),
),
Positioned(
left: 20,
top: 112,
bottom: 12,
top: 108,
child: baseText('销量', 12, Color(0xff666666), bold: false),
),
Positioned(
left: 20,
top: 132,
bottom: 12,
child: baseText('', 12, Color(0xff666666), bold: false),
),
])));
left: 20,
bottom: 30,
child: Container(
color: Colors.red,
height: 14,
width: 95,
)),
]));
}
Widget planNormalEffectiveAttrsView(Groups groups) {
......@@ -333,26 +343,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: list
// <Widget>[
// Expanded(
// child: Stack(children: <Widget>[
// ,
// Expanded(
// child: Container(
// margin: EdgeInsets.fromLTRB(0, 68, 0, 0),
// child:
// ListView.builder(
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemBuilder: (c, index) {
// return planBaseAttrsView(groups.plans);
// },
// itemCount: 5,
// )))
// ]))
));
children: list));
}
Widget planBaseAttrsView(Plans plans) {
......
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