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
9a71c9e9
Commit
9a71c9e9
authored
Jul 11, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
w
parent
1c22b115
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
74 deletions
+133
-74
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+34
-30
PlansCompareFeedItemView.dart
...Model/page/PlansCompareFeed/PlansCompareFeedItemView.dart
+14
-3
PlanCompareDetail.dart
lib/ClueModel/server/entity/PlanCompareDetail.dart
+12
-3
FiveStarView.dart
lib/ClueModel/view/FiveStarView.dart
+56
-20
MainRouter.dart
lib/MainRouter/MainRouter.dart
+4
-1
MainRouterImpl.dart
lib/MainRouter/MainRouterImpl.dart
+5
-0
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+6
-15
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+2
-2
No files found.
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
9a71c9e9
...
...
@@ -267,11 +267,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return
Container
(
height:
170
,
child:
Stack
(
children:
<
Widget
>[
//
Positioned(
//
right: 20,
//
top: 0,
//
child: baseText(plan.positiveRate, 21, Color(0xff3FB5AF),
//
bold: true)),
Positioned
(
right:
20
,
top:
0
,
child:
baseText
(
plan
.
positiveRate
,
21
,
Color
(
0xff3FB5AF
),
bold:
true
)),
Positioned
(
right:
20
,
top:
24
,
...
...
@@ -280,14 +280,18 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned
(
right:
20
,
top:
46
,
child:
FiveStarView
(
3
,
5
,
starAssets:
'assets/plan_compare_detail_green_star_all.png'
),
child:
FiveStarView
(
plan
.
planStart
,
5
,
starAssets:
'assets/plan_compare_detail_green_star_all.png'
,
isForward:
true
,
),
),
Positioned
(
right:
20
,
top:
84
,
child:
baseText
(
plan
.
salesCount
,
21
,
Color
(
0xff3FB5AF
),
bold:
true
),
),
// Positioned(
// right: 20,
// top: 84,
// child: baseText(plan.salesCount, 21, Color(0xff3FB5AF), bold: true),
// ),
Positioned
(
right:
20
,
top:
108
,
...
...
@@ -333,11 +337,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return
Container
(
height:
170
,
child:
Stack
(
children:
<
Widget
>[
//
Positioned(
//
left: 20,
//
top: 0,
//
child: baseText(plan.positiveRate, 21, Color(0xffF25874),
//
bold: true)),
Positioned
(
left:
20
,
top:
0
,
child:
baseText
(
plan
.
positiveRate
,
21
,
Color
(
0xffF25874
),
bold:
true
)),
Positioned
(
left:
20
,
top:
24
,
...
...
@@ -350,16 +354,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
height:
13
,
width:
81
,
child:
FiveStarView
(
3
,
plan
.
planStart
,
5
,
starAssets:
'assets/plan_compare_detail_red_star_all.png'
,
),
)),
//
Positioned(
//
left: 20,
//
top: 84,
//
child: baseText(plan.salesCount, 21, Color(0xffF25874), bold: true),
//
),
Positioned
(
left:
20
,
top:
84
,
child:
baseText
(
plan
.
salesCount
,
21
,
Color
(
0xffF25874
),
bold:
true
),
),
Positioned
(
left:
20
,
top:
108
,
...
...
@@ -477,12 +481,12 @@ 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;
//
}
int
salesCount
=
int
.
parse
(
plans
.
salesCount
);
int
anSalesCount
=
int
.
parse
(
plans
.
salesCount
);
if
(
salesCount
>=
anSalesCount
)
{
return
1.0
;
}
else
{
return
anSalesCount
/
salesCount
;
}
}
}
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
9a71c9e9
...
...
@@ -48,6 +48,8 @@ class _PlansCompareFeedItemViewState
}
getFirstLevelItem
()
{
String
price
=
NumPlanUtil
.
getPrice
(
widget
.
plan
.
minPrice
,
widget
.
plan
.
maxPrice
);
return
Container
(
width:
double
.
maxFinite
,
height:
80
,
...
...
@@ -109,10 +111,19 @@ class _PlansCompareFeedItemViewState
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
)),
price
==
"暂无报价"
?
Container
(
width:
0
,
height:
0
,
)
:
baseText
(
"¥"
,
12
,
Color
(
0xFFFF5963
)),
baseText
(
price
,
price
==
"暂无报价"
?
13
:
15
,
price
==
"暂无报价"
?
Color
(
0xFF666666
)
:
Color
(
0xFFFF5963
),
bold:
price
!=
"暂无报价"
),
Expanded
(
child:
Container
(),
),
baseText
(
"销量
${widget.plan.salesCount}
"
,
11
,
Color
(
0xFF666666
))
],
...
...
lib/ClueModel/server/entity/PlanCompareDetail.dart
View file @
9a71c9e9
...
...
@@ -9,7 +9,7 @@ class PlanCompareDetail {
String
message
;
Map
extra
;
int
errorCode
;
Map
errorExtra
;
Map
errorExtra
;
Data
data
;
UserType
userType
;
...
...
@@ -89,9 +89,9 @@ class PlansInfoDetail {
String
planName
;
String
price
;
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
price
});
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
price
});
PlansInfoDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
PlansInfoDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
planName
=
json
[
'plan_name'
];
price
=
json
[
'price'
];
...
...
@@ -138,11 +138,17 @@ class Groups {
class
Plans
{
int
planId
;
List
<
Attrs
>
attrs
;
String
positiveRate
;
String
salesCount
;
int
planStart
;
Plans
({
this
.
planId
,
this
.
attrs
});
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
positiveRate
=
json
[
'positive_rate'
];
salesCount
=
json
[
'sales_count'
];
planStart
=
json
[
'plan_start'
];
if
(
json
[
'attrs'
]
!=
null
)
{
attrs
=
new
List
<
Attrs
>();
json
[
'attrs'
].
forEach
((
v
)
{
...
...
@@ -154,6 +160,9 @@ class Plans {
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
data
[
'plan_start'
]
=
this
.
planStart
;
if
(
this
.
attrs
!=
null
)
{
data
[
'attrs'
]
=
this
.
attrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
...
...
lib/ClueModel/view/FiveStarView.dart
View file @
9a71c9e9
...
...
@@ -8,36 +8,72 @@ class FiveStarView extends StatelessWidget {
final
int
allStarCount
;
final
int
lightStarCount
;
String
starAssets
;
bool
isForward
=
false
;
FiveStarView
(
this
.
lightStarCount
,
this
.
allStarCount
,
{
this
.
starAssets
});
FiveStarView
(
this
.
lightStarCount
,
this
.
allStarCount
,
{
this
.
starAssets
,
this
.
isForward
})
{
if
(
isForward
==
null
)
{
isForward
=
false
;
}
}
@override
Widget
build
(
BuildContext
context
)
{
List
<
Widget
>
list
=
new
List
();
for
(
int
i
=
0
;
i
<
allStarCount
;
i
++)
{
if
(
i
<=
lightStarCount
)
{
list
.
add
(
Container
(
height:
13
,
width:
13
,
child:
Image
.
asset
(
starAssets
??
"assets/sel_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
if
(
isForward
)
{
for
(
int
i
=
0
;
i
<
allStarCount
;
i
++)
{
if
(
i
>=
allStarCount
-
lightStarCount
)
{
list
.
add
(
Container
(
height:
13
,
width:
13
,
child:
Image
.
asset
(
starAssets
??
"assets/sel_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
));
}
}
else
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
height:
13
,
width:
13
,
child:
Image
.
asset
(
"assets/normal_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
));
}
}
}
else
{
list
.
add
(
Container
(
height:
13
,
width:
13
,
child:
Image
.
asset
(
"assets/normal_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
}
}
else
{
for
(
int
i
=
0
;
i
<
allStarCount
;
i
++)
{
if
(
i
<
lightStarCount
)
{
list
.
add
(
Container
(
height:
13
,
width:
13
,
child:
Image
.
asset
(
starAssets
??
"assets/sel_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
));
}
}
else
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
height:
13
,
width:
13
,
child:
Image
.
asset
(
"assets/normal_star.png"
),
));
if
(
i
!=
allStarCount
-
1
)
{
list
.
add
(
Container
(
height:
1
,
width:
2
,
));
}
}
}
}
...
...
lib/MainRouter/MainRouter.dart
View file @
9a71c9e9
...
...
@@ -15,11 +15,14 @@ abstract class MainRouter extends RouterBaser {
void
buriedEvent
(
String
name
,
Map
<
String
,
dynamic
>
map
);
void
jumpPage
(
BuildContext
context
,
String
pageName
,
Map
<
String
,
dynamic
>
params
,
bool
nativePage
);
void
jumpPage
(
BuildContext
context
,
String
pageName
,
Map
<
String
,
dynamic
>
params
,
bool
nativePage
);
Widget
getProxyPage
();
void
catchErrorToBugly
(
String
err
);
bool
isWithNative
();
void
jumpToSetting
();
}
lib/MainRouter/MainRouterImpl.dart
View file @
9a71c9e9
...
...
@@ -47,4 +47,9 @@ class MainRouterImpl implements MainRouter {
bool
isWithNative
()
{
return
MainManager
.
getInstance
().
isInit
;
}
@override
void
jumpToSetting
()
{
MainManager
.
getInstance
().
jumpToSetting
();
}
}
lib/MainRouter/manager/MainManager.dart
View file @
9a71c9e9
...
...
@@ -118,21 +118,12 @@ class MainManager {
}
}
void
getInitParams
(
VoidCallback
callback
)
{
if
(
isInit
)
{
if
(
flutterChannel
!=
null
)
{
flutterChannel
.
invokeMethod
(
"get_common_params"
).
then
((
data
)
{
if
(
data
is
Map
)
{
var
map
=
Map
<
String
,
dynamic
>.
from
(
data
);
initParams
(
map
,
callback:
callback
);
}
}).
whenComplete
(()
{
// callback();
});
return
;
}
void
jumpToSetting
()
{
if
(!
isInit
)
{
return
;
}
if
(
flutterChannel
!=
null
)
{
flutterChannel
.
invokeMethod
(
"check_system_settings"
,
""
);
}
callback
();
}
}
lib/commonModel/base/BaseComponent.dart
View file @
9a71c9e9
...
...
@@ -3,7 +3,6 @@
* @date 2019-10-13
**/
import
'package:app_settings/app_settings.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -11,6 +10,7 @@ import 'package:flutter_common/commonModel/live/LiveData.dart';
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/view/baseTabIndicator.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:lottie/lottie.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -211,7 +211,7 @@ Widget errorItem(double width, double height, VoidCallback retry,
alignment:
Alignment
.
center
,
child:
baseText
(
"检查网络设置"
,
16
,
Color
(
0xffFF5963
)),
).
gestureDetector
(()
{
AppSettings
.
openWIFISettings
();
RouterCenterImpl
().
findMainRouter
().
jumpToSetting
();
}),
],
)));
...
...
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