Commit 1af25d1f authored by 林生雨's avatar 林生雨

w

parent 98aae461
...@@ -303,33 +303,32 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -303,33 +303,32 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
child: Container( child: Container(
height: 7, height: 7,
width: 95, width: 95,
child: Stack(children: <Widget>[ child: ClipRRect(
Positioned( borderRadius: BorderRadius.circular(3.5),
left: 0, child: Container(
top: 0, color: Color(0xffF7F6FA),
width: 95,
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xffF7F6FA),
),
),
),
Positioned(
right: 0,
top: 0,
width: 95 * sellCount(0, groups.plans[1]),
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xff3FB5AF),
),
),
), ),
]), ),
)), )),
Positioned(
right: 20,
bottom: 30,
child: Container(
width: 95 *
sellCount(
0,
plan,
max(int.parse(groups.plans[0].salesCount),
int.parse(groups.plans[1].salesCount))),
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xff3FB5AF),
),
),
),
)
])); ]));
} }
...@@ -375,33 +374,32 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -375,33 +374,32 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
child: Container( child: Container(
height: 7, height: 7,
width: 95, width: 95,
child: Stack(children: <Widget>[ child: ClipRRect(
Positioned( borderRadius: BorderRadius.circular(3.5),
left: 0, child: Container(
top: 0, color: Color(0xffF7F6FA),
width: 95,
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xffF7F6FA),
),
),
),
Positioned(
left: 0,
top: 0,
width: 95 * sellCount(1, groups.plans[0]),
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xffF25874),
),
),
), ),
]), ),
)), )),
Positioned(
left: 20,
bottom: 30,
child: Container(
width: 95 *
sellCount(
1,
plan,
max(int.parse(groups.plans[0].salesCount),
int.parse(groups.plans[1].salesCount))),
height: 7,
child: ClipRRect(
borderRadius: BorderRadius.circular(3.5),
child: Container(
color: Color(0xffF25874),
),
),
),
)
])); ]));
} }
...@@ -478,15 +476,8 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -478,15 +476,8 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
]); ]);
} }
double sellCount(int index, Plans anotherPlans) { double sellCount(int index, Plans anotherPlans, int max) {
Groups popularity = _model.detailLive.data.second[0]; int salesCount = int.parse(anotherPlans.salesCount);
Plans plans = popularity.plans[index]; return salesCount / max / 1.0;
int salesCount = int.parse(plans.salesCount);
int anSalesCount = int.parse(plans.salesCount);
if (salesCount >= anSalesCount) {
return 1.0;
} else {
return anSalesCount / salesCount;
}
} }
} }
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