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

w

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