Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
gm_flutter
Commits
b017fb10
Commit
b017fb10
authored
Jul 07, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
销量展示规则
parent
1794906e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+26
-5
No files found.
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
b017fb10
...
...
@@ -4,6 +4,9 @@
* @Last Modified by: zx
* @Last Modified time: 2020-07-03 13:47:57
*/
import
'dart:ffi'
;
import
'dart:math'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart'
;
...
...
@@ -242,12 +245,13 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return
Container
(
height:
170
,
child:
Row
(
children:
<
Widget
>[
Expanded
(
flex:
1
,
child:
planPopularityLeftItem
(
groups
.
plans
[
0
])),
Expanded
(
flex:
1
,
child:
planPopularityLeftItem
(
groups
.
plans
[
0
],
groups
)),
Expanded
(
flex:
1
,
child:
planPopularityRightItem
(
groups
.
plans
[
1
]))
]));
}
Widget
planPopularityLeftItem
(
Plans
plan
)
{
Widget
planPopularityLeftItem
(
Plans
plan
,
Groups
groups
)
{
return
Container
(
height:
170
,
child:
Stack
(
children:
<
Widget
>[
...
...
@@ -299,7 +303,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned
(
right:
0
,
top:
0
,
width:
95
*
0.7
,
width:
95
*
sellCount
(
0
,
groups
.
plans
[
1
])
,
height:
7
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
3.5
),
...
...
@@ -313,7 +317,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
]));
}
Widget
planPopularityRightItem
(
Plans
plan
)
{
Widget
planPopularityRightItem
(
Plans
plan
,
Groups
groups
)
{
return
Container
(
height:
170
,
child:
Stack
(
children:
<
Widget
>[
...
...
@@ -371,7 +375,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned
(
left:
0
,
top:
0
,
width:
95
*
0.3
,
width:
95
*
sellCount
(
0
,
groups
.
plans
[
1
])
,
height:
7
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
3.5
),
...
...
@@ -442,3 +446,20 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
),
]));
}
double
starCount
()
{
return
5.0
;
}
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
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment