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
4759f490
Commit
4759f490
authored
Jul 11, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
w
parent
a8635992
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
375 additions
and
336 deletions
+375
-336
PlanCompareDetailModel.dart
...eModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
+0
-2
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+122
-113
PlansCompareFeedItemView.dart
...Model/page/PlansCompareFeed/PlansCompareFeedItemView.dart
+34
-19
PlansCompareFeedPage.dart
...ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
+37
-41
ProjectDetailsPage.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
+4
-3
LevelOneItem.dart
lib/ClueModel/page/levelOne/LevelOneItem.dart
+5
-10
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+1
-0
PlanCompareDetail.dart
lib/ClueModel/server/entity/PlanCompareDetail.dart
+150
-146
NumPlanUtil.dart
lib/ClueModel/util/NumPlanUtil.dart
+17
-0
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+4
-1
DioInterceptor.dart
lib/commonModel/net/DioInterceptor.dart
+1
-1
No files found.
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
View file @
4759f490
...
@@ -38,13 +38,11 @@ class PlanCompareDetailModel extends BaseModel {
...
@@ -38,13 +38,11 @@ class PlanCompareDetailModel extends BaseModel {
}
else
{
}
else
{
stateLive
.
notifyView
(
FAIL
);
stateLive
.
notifyView
(
FAIL
);
NativeToast
.
showNativeToast
(
event
.
message
);
NativeToast
.
showNativeToast
(
event
.
message
);
detailLive
.
notifyView
(
Pair
(
FAIL
,
null
));
}
}
})
})
.
addToDispose
(
rxDispose
)
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
.
onError
((
err
)
{
stateLive
.
notifyView
(
FAIL
);
stateLive
.
notifyView
(
FAIL
);
detailLive
.
notifyView
(
Pair
(
FAIL
,
null
));
NativeToast
.
showNativeToast
(
err
.
message
);
NativeToast
.
showNativeToast
(
err
.
message
);
});
});
}
}
...
...
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
4759f490
...
@@ -17,6 +17,7 @@ import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
...
@@ -17,6 +17,7 @@ import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'dart:convert'
;
import
'dart:convert'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
...
@@ -99,13 +100,6 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -99,13 +100,6 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
stream:
_model
.
detailLive
.
stream
,
stream:
_model
.
detailLive
.
stream
,
initialData:
_model
.
detailLive
.
data
??
Pair
(
LOADING
,
null
),
initialData:
_model
.
detailLive
.
data
??
Pair
(
LOADING
,
null
),
builder:
(
c
,
data
)
{
builder:
(
c
,
data
)
{
if
(
data
.
data
.
first
==
FAIL
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
(
widget
.
_planIds
);
});
}
if
(
data
.
data
.
first
==
EMPTY
)
{
if
(
data
.
data
.
first
==
EMPTY
)
{
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
);
MediaQuery
.
of
(
context
).
size
.
height
);
...
@@ -129,17 +123,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -129,17 +123,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget
widget
;
Widget
widget
;
if
(
group
.
groupType
==
'hot'
)
{
if
(
group
.
groupType
==
'hot'
)
{
widget
=
planPopularityView
(
group
);
widget
=
planPopularityView
(
group
);
// height: 100,
// alignment: Alignment.center,
// child: baseText("第一个", 15, Colors.black),
}
else
if
(
group
.
groupType
==
'normal_attrs'
)
{
}
else
if
(
group
.
groupType
==
'normal_attrs'
)
{
widget
=
Container
(
widget
=
planNormalEffectiveAttrsView
(
group
);
child:
planNormalEffectiveAttrsView
(
group
),
);
}
else
if
(
group
.
groupType
==
'effective_attrs'
)
{
}
else
if
(
group
.
groupType
==
'effective_attrs'
)
{
widget
=
Container
(
widget
=
planNormalEffectiveAttrsView
(
group
);
child:
planNormalEffectiveAttrsView
(
group
),
);
}
else
{
}
else
{
widget
=
planNormalEffectiveAttrsView
(
group
);
widget
=
planNormalEffectiveAttrsView
(
group
);
}
}
...
@@ -158,23 +145,34 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -158,23 +145,34 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget
head
()
{
Widget
head
()
{
return
Container
(
return
Container
(
// key: keyTop,
decoration:
BoxDecoration
(
width:
screenWidth
,
boxShadow:
[
height:
105
,
BoxShadow
(
alignment:
Alignment
.
topLeft
,
color:
Colors
.
black12
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
offset:
Offset
(
0.0
,
2.0
),
child:
Row
(
children:
<
Widget
>[
blurRadius:
0.5
,
// 根据 flex系数,分配剩余空间
spreadRadius:
0.5
)
Expanded
(
flex:
1
,
child:
headItem
(
0
)),
],
Expanded
(
flex:
1
,
child:
headItem
(
1
))
color:
Colors
.
white
,
]),
),
);
// key: keyTop,
width:
screenWidth
,
height:
98
,
alignment:
Alignment
.
topLeft
,
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
Row
(
children:
<
Widget
>[
// 根据 flex系数,分配剩余空间
Expanded
(
flex:
1
,
child:
headItem
(
0
)),
Expanded
(
flex:
1
,
child:
headItem
(
1
))
]),
));
}
}
Widget
headItem
(
int
index
)
{
Widget
headItem
(
int
index
)
{
return
StreamBuilder
<
List
<
PlansInfoDetail
>>(
return
StreamBuilder
<
List
<
PlansInfoDetail
>>(
stream:
_model
.
headerLive
.
stream
,
stream:
_model
.
headerLive
.
stream
,
initialData:
_model
.
headerLive
.
data
??
null
,
initialData:
_model
.
headerLive
.
data
,
builder:
(
c
,
data
)
{
builder:
(
c
,
data
)
{
if
(
data
.
data
==
null
||
data
.
data
.
length
!=
2
)
{
if
(
data
.
data
==
null
||
data
.
data
.
length
!=
2
)
{
return
Container
();
return
Container
();
...
@@ -196,19 +194,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -196,19 +194,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned
(
Positioned
(
left:
12
,
left:
12
,
top:
24
,
top:
24
,
child:
baseText
(
data
.
data
[
index
].
planName
,
15
,
Color
(
0xff333333
),
child:
Container
(
bold:
true
),
width:
(
screenWidth
-
30
-
11
)
/
2
,
child:
baseText
(
data
.
data
[
index
].
planName
,
15
,
Color
(
0xff333333
),
bold:
true
),
),
),
),
Positioned
(
Positioned
(
left:
12
,
left:
12
,
top:
48
,
top:
56
,
child:
baseText
(
child:
baseText
(
'
${data.data[index].price}
'
,
14
,
Colors
.
red
,
'¥'
+
data
.
data
[
index
].
minPrice
+
'-'
+
data
.
data
[
index
].
maxPrice
,
14
,
Colors
.
red
,
bold:
true
),
bold:
true
),
),
),
]));
]));
...
@@ -218,9 +213,9 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -218,9 +213,9 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget
titleView
(
String
title
)
{
Widget
titleView
(
String
title
)
{
return
Container
(
return
Container
(
height:
7
5
,
height:
2
5
,
width:
screenWidth
,
width:
screenWidth
,
margin:
EdgeInsets
.
fromLTRB
(
0
,
30
,
0
,
2
0
),
margin:
EdgeInsets
.
fromLTRB
(
0
,
30
,
0
,
2
5
),
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Container
(
child:
Container
(
width:
90
,
width:
90
,
...
@@ -260,8 +255,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -260,8 +255,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget
planPopularityBodyView
(
Groups
groups
)
{
Widget
planPopularityBodyView
(
Groups
groups
)
{
return
Container
(
return
Container
(
height:
170
,
height:
170
,
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Expanded
(
Expanded
(
flex:
1
,
child:
planPopularityLeftItem
(
groups
.
plans
[
0
],
groups
)),
flex:
1
,
child:
planPopularityLeftItem
(
groups
.
plans
[
0
],
groups
)),
Expanded
(
Expanded
(
...
@@ -273,11 +267,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -273,11 +267,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return
Container
(
return
Container
(
height:
170
,
height:
170
,
child:
Stack
(
children:
<
Widget
>[
child:
Stack
(
children:
<
Widget
>[
Positioned
(
//
Positioned(
right:
20
,
//
right: 20,
top:
0
,
//
top: 0,
child:
baseText
(
plan
.
positiveRate
,
21
,
Color
(
0xff3FB5AF
),
//
child: baseText(plan.positiveRate, 21, Color(0xff3FB5AF),
bold:
true
)),
//
bold: true)),
Positioned
(
Positioned
(
right:
20
,
right:
20
,
top:
24
,
top:
24
,
...
@@ -289,11 +283,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -289,11 +283,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
child:
FiveStarView
(
3
,
5
,
child:
FiveStarView
(
3
,
5
,
starAssets:
'assets/plan_compare_detail_green_star_all.png'
),
starAssets:
'assets/plan_compare_detail_green_star_all.png'
),
),
),
Positioned
(
//
Positioned(
right:
20
,
//
right: 20,
top:
84
,
//
top: 84,
child:
baseText
(
plan
.
salesCount
,
21
,
Color
(
0xff3FB5AF
),
bold:
true
),
//
child: baseText(plan.salesCount, 21, Color(0xff3FB5AF), bold: true),
),
//
),
Positioned
(
Positioned
(
right:
20
,
right:
20
,
top:
108
,
top:
108
,
...
@@ -339,11 +333,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -339,11 +333,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return
Container
(
return
Container
(
height:
170
,
height:
170
,
child:
Stack
(
children:
<
Widget
>[
child:
Stack
(
children:
<
Widget
>[
Positioned
(
//
Positioned(
left:
20
,
//
left: 20,
top:
0
,
//
top: 0,
child:
baseText
(
plan
.
positiveRate
,
21
,
Color
(
0xffF25874
),
//
child: baseText(plan.positiveRate, 21, Color(0xffF25874),
bold:
true
)),
//
bold: true)),
Positioned
(
Positioned
(
left:
20
,
left:
20
,
top:
24
,
top:
24
,
...
@@ -361,11 +355,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -361,11 +355,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
starAssets:
'assets/plan_compare_detail_red_star_all.png'
,
starAssets:
'assets/plan_compare_detail_red_star_all.png'
,
),
),
)),
)),
Positioned
(
//
Positioned(
left:
20
,
//
left: 20,
top:
84
,
//
top: 84,
child:
baseText
(
plan
.
salesCount
,
21
,
Color
(
0xffF25874
),
bold:
true
),
//
child: baseText(plan.salesCount, 21, Color(0xffF25874), bold: true),
),
//
),
Positioned
(
Positioned
(
left:
20
,
left:
20
,
top:
108
,
top:
108
,
...
@@ -410,9 +404,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -410,9 +404,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Widget
planNormalEffectiveAttrsView
(
Groups
groups
)
{
Widget
planNormalEffectiveAttrsView
(
Groups
groups
)
{
List
<
Widget
>
list
=
new
List
();
List
<
Widget
>
list
=
new
List
();
list
.
add
(
titleView
(
groups
.
groupName
));
list
.
add
(
titleView
(
groups
.
groupName
));
groups
.
plans
.
forEach
((
element
)
{
if
(
groups
.
plans
!=
null
&&
groups
.
plans
.
length
==
2
)
{
list
.
add
(
planBaseAttrsView
(
element
));
for
(
int
i
=
0
;
});
i
<
max
(
groups
.
plans
[
0
].
attrs
.
length
,
groups
.
plans
[
1
].
attrs
.
length
);
i
++)
{
list
.
add
(
planBaseAttrsView
(
groups
.
plans
[
0
],
groups
.
plans
[
1
],
i
));
}
}
list
.
add
(
Container
(
height:
6
,
));
return
Container
(
return
Container
(
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
...
@@ -420,60 +421,68 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
...
@@ -420,60 +421,68 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
children:
list
));
children:
list
));
}
}
Widget
planBaseAttrsView
(
Plans
plans
)
{
Widget
planBaseAttrsView
(
Plans
plan1
,
Plans
plan2
,
int
index
)
{
return
Container
(
return
Column
(
height:
56
,
mainAxisSize:
MainAxisSize
.
min
,
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Expanded
(
flex:
1
,
child:
planBaseAttrsLeftView
(
plans
)),
planItem
(
Expanded
(
flex:
1
,
child:
planBaseAttrsRightView
(
plans
))
index
>
plan1
.
attrs
.
length
-
1
]));
?
"无"
}
:
"
${plan1.attrs[index].attrValue}
"
,
index
>
plan2
.
attrs
.
length
-
1
Widget
planBaseAttrsLeftView
(
Plans
plan
)
{
?
"无"
return
Container
(
:
"
${plan2.attrs[index].attrValue}
"
,
height:
56
,
false
),
child:
Stack
(
children:
<
Widget
>[
Container
(
Positioned
(
height:
6
,
right:
20
,
),
top:
0
,
planItem
(
child:
baseText
(
plan
.
attrs
[
0
].
attrValue
,
14
,
Color
(
0xff3FB5AF
),
index
>
plan1
.
attrs
.
length
-
1
bold:
true
)),
?
"无"
Positioned
(
:
"
${plan1.attrs[index].attrName}
"
,
top:
20
,
index
>
plan2
.
attrs
.
length
-
1
right:
20
,
?
"无"
child:
baseText
(
plan
.
attrs
[
0
].
attrName
,
12
,
Color
(
0xff666666
),
:
"
${plan2.attrs[index].attrName}
"
,
bold:
false
),
true
),
),
Container
(
]));
height:
24
,
)
],
);
;
}
}
Widget
planBaseAttrsRightView
(
Plans
plan
)
{
Widget
planItem
(
String
left
,
String
right
,
bool
isName
)
{
return
Container
(
return
Row
(
children:
<
Widget
>[
height:
56
,
Expanded
(
child:
Stack
(
children:
<
Widget
>[
flex:
1
,
Positioned
(
child:
baseText
(
left
.
empty
()
?
"无"
:
left
,
14
,
left:
20
,
isName
?
Color
(
0xff666666
)
:
Color
(
0xff3FB5AF
),
top:
0
,
bold:
true
,
maxLines:
100
,
isWarp:
true
,
textAlign:
TextAlign
.
end
),
child:
baseText
(
plan
.
attrs
[
0
].
attrValue
,
14
,
Color
(
0xffF25874
),
),
bold:
true
)),
Container
(
Positioned
(
width:
40
,
left:
20
,
),
top:
20
,
Expanded
(
child:
baseText
(
plan
.
attrs
[
0
].
attrName
,
12
,
Color
(
0xff666666
),
flex:
1
,
bold:
false
),
child:
baseText
(
right
.
empty
()
?
"无"
:
right
,
14
,
),
isName
?
Color
(
0xff666666
)
:
Color
(
0xffF25874
),
]));
bold:
true
,
maxLines:
100
,
isWarp:
true
,
textAlign:
TextAlign
.
start
))
]);
}
}
double
sellCount
(
int
index
,
Plans
anotherPlans
)
{
double
sellCount
(
int
index
,
Plans
anotherPlans
)
{
Groups
popularity
=
_model
.
detailLive
.
data
.
second
[
0
];
Groups
popularity
=
_model
.
detailLive
.
data
.
second
[
0
];
Plans
plans
=
popularity
.
plans
[
index
];
Plans
plans
=
popularity
.
plans
[
index
];
int
salesCount
=
int
.
parse
(
plans
.
salesCount
);
//
int salesCount = int.parse(plans.salesCount);
int
anSalesCount
=
int
.
parse
(
plans
.
salesCount
);
//
int anSalesCount = int.parse(plans.salesCount);
if
(
salesCount
>=
anSalesCount
)
{
//
if (salesCount >= anSalesCount) {
return
1.0
;
//
return 1.0;
}
else
{
//
} else {
return
anSalesCount
/
salesCount
;
//
return anSalesCount / salesCount;
}
//
}
}
}
}
}
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
4759f490
...
@@ -128,25 +128,23 @@ class _PlansCompareFeedItemViewState
...
@@ -128,25 +128,23 @@ class _PlansCompareFeedItemViewState
}
}
getSecondLevelItem
()
{
getSecondLevelItem
()
{
String
price
=
NumPlanUtil
.
getPrice
(
widget
.
plan
.
minPrice
,
widget
.
plan
.
maxPrice
);
return
Container
(
return
Container
(
height:
77
,
height:
77
,
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
margin:
EdgeInsets
.
only
(
right:
15.0
),
margin:
EdgeInsets
.
only
(
right:
15.0
),
alignment:
Alignment
.
centerLeft
,
alignment:
Alignment
.
centerLeft
,
child:
GestureDetector
(
child:
Container
(
behavior:
HitTestBehavior
.
opaque
,
alignment:
Alignment
.
center
,
onTap:
()
=>
onClickCheckBox
(
_icon
),
child:
Image
.
asset
(
child:
Container
(
_icon
,
alignment:
Alignment
.
center
,
width:
17
,
child:
Image
.
asset
(
height:
17
,
_icon
,
fit:
BoxFit
.
fill
,
width:
17
,
))),
height:
17
,
fit:
BoxFit
.
fill
,
))),
),
Expanded
(
Expanded
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -159,10 +157,25 @@ class _PlansCompareFeedItemViewState
...
@@ -159,10 +157,25 @@ class _PlansCompareFeedItemViewState
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
Row
(
13
,
Color
(
0xFFFF5963
)),
mainAxisSize:
MainAxisSize
.
min
,
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
Color
(
0xFF666666
)),
children:
<
Widget
>[
price
==
"暂无报价"
?
Container
(
width:
0
,
height:
0
,
)
:
baseText
(
"¥"
,
12
,
Color
(
0xFFFF5963
)),
baseText
(
price
,
price
==
"暂无报价"
?
13
:
15
,
price
==
"暂无报价"
?
Color
(
0xFF666666
)
:
Color
(
0xFFFF5963
),
bold:
price
!=
"暂无报价"
)
],
),
],
],
),
),
],
],
...
@@ -170,7 +183,9 @@ class _PlansCompareFeedItemViewState
...
@@ -170,7 +183,9 @@ class _PlansCompareFeedItemViewState
)
)
],
],
),
),
);
).
gestureDetector
(()
{
onClickCheckBox
(
_icon
);
});
}
}
onClickCheckBox
(
String
icon
)
{
onClickCheckBox
(
String
icon
)
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
4759f490
...
@@ -52,20 +52,20 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
...
@@ -52,20 +52,20 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
@override
@override
Widget
buildItem
(
BuildContext
context
)
{
Widget
buildItem
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
baseAppBar
(
backgroundColor:
Colors
.
white
,
title:
"方案对比"
,
appBar:
baseAppBar
(
centerTitle:
true
,
title:
"方案对比"
,
backClick:
()
{
centerTitle:
true
,
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
()
)
{
backClick:
(
)
{
FlutterBoost
.
singleton
.
closeCurrent
();
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
}
else
{
FlutterBoost
.
singleton
.
closeCurrent
();
Navigator
.
of
(
context
).
pop
();
}
else
{
}
Navigator
.
of
(
context
).
pop
();
}),
}
body:
Center
(
}),
child:
getBody
(),
body:
SafeArea
(
),
child:
getBody
(
),
);
)
);
}
}
getBody
()
{
getBody
()
{
...
@@ -93,36 +93,32 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
...
@@ -93,36 +93,32 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
}
}
getList
(
List
<
Plans
>
plans
)
{
getList
(
List
<
Plans
>
plans
)
{
return
Stack
(
alignment:
Alignment
.
bottomCenter
,
children:
<
Widget
>[
return
Column
(
ListView
.
builder
(
children:
<
Widget
>[
itemCount:
plans
.
length
,
Expanded
(
itemBuilder:
(
BuildContext
context
,
int
position
)
{
child:
ListView
.
builder
(
return
PlansCompareFeedItemView
(
plans
[
position
],
this
,
_setCompare
);
itemCount:
plans
.
length
,
}),
itemBuilder:
(
BuildContext
context
,
int
position
)
{
GestureDetector
(
return
PlansCompareFeedItemView
(
plans
[
position
],
this
,
_setCompare
);
}),
),
Divider
(
height:
0.5
,
color:
Color
(
0xFFE5E5E5
)),
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
onClickCompare
(),
onTap:
()
=>
onClickCompare
(),
child:
Container
(
child:
Container
(
color:
Colors
.
white
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
top:
7.5
,
bottom:
7.5
),
child:
Column
(
width:
double
.
maxFinite
,
mainAxisSize:
MainAxisSize
.
min
,
height:
40
,
children:
<
Widget
>[
decoration:
BoxDecoration
(
Divider
(
height:
0.5
,
color:
Color
(
0xFFE5E5E5
)),
color:
_compareColor
,
borderRadius:
BorderRadius
.
circular
(
20
)),
Container
(
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
child:
baseText
(
"对比"
,
14
,
Colors
.
white
,
bold:
true
),
left:
15
,
right:
15
,
top:
7.5
,
bottom:
7.5
),
),
width:
double
.
maxFinite
,
)
height:
40
,
],
decoration:
BoxDecoration
(
);
color:
_compareColor
,
borderRadius:
BorderRadius
.
circular
(
20
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"对比"
,
14
,
Colors
.
white
,
bold:
true
),
)
],
),
))
]);
}
}
onClickCompare
()
{
onClickCompare
()
{
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
4759f490
...
@@ -48,9 +48,9 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
...
@@ -48,9 +48,9 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
title:
"项目说明"
,
title:
"项目说明"
,
centerTitle:
true
,
centerTitle:
true
,
backClick:
()
{
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
FlutterBoost
.
singleton
.
closeCurrent
();
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
}
else
{
Navigator
.
of
(
context
).
pop
();
Navigator
.
of
(
context
).
pop
();
}
}
}),
}),
...
@@ -66,7 +66,8 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
...
@@ -66,7 +66,8 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
initialData:
_model
.
liveData
.
data
??
null
,
initialData:
_model
.
liveData
.
data
??
null
,
builder:
(
c
,
data
)
{
builder:
(
c
,
data
)
{
if
(
_model
.
liveData
.
data
==
null
)
{
if
(
_model
.
liveData
.
data
==
null
)
{
return
loadingItem
();
// return loadingItem();
return
Container
();
}
}
ProjectDetailsItem
item
=
data
.
data
;
ProjectDetailsItem
item
=
data
.
data
;
if
(
item
==
null
||
item
.
data
==
null
||
item
.
data
.
groups
==
null
)
{
if
(
item
==
null
||
item
.
data
==
null
||
item
.
data
.
groups
==
null
)
{
...
...
lib/ClueModel/page/levelOne/LevelOneItem.dart
View file @
4759f490
...
@@ -6,10 +6,12 @@ import 'package:cached_network_image/cached_network_image.dart';
...
@@ -6,10 +6,12 @@ import 'package:cached_network_image/cached_network_image.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/util/NumPlanUtil.dart'
;
import
'package:gm_flutter/ClueModel/view/FiveStarView.dart'
;
import
'package:gm_flutter/ClueModel/view/FiveStarView.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/NumberUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
class
LevelOneItem
extends
StatelessWidget
{
class
LevelOneItem
extends
StatelessWidget
{
...
@@ -20,6 +22,7 @@ class LevelOneItem extends StatelessWidget {
...
@@ -20,6 +22,7 @@ class LevelOneItem extends StatelessWidget {
Function
(
int
planId
)
gotoPlan
;
Function
(
int
planId
)
gotoPlan
;
int
position
;
int
position
;
String
tabName
;
String
tabName
;
LevelOneItem
(
this
.
cards
,
LevelOneItem
(
this
.
cards
,
{
this
.
lowPrice
,
{
this
.
lowPrice
,
this
.
ask
,
this
.
ask
,
...
@@ -301,16 +304,8 @@ class LevelOneItem extends StatelessWidget {
...
@@ -301,16 +304,8 @@ class LevelOneItem extends StatelessWidget {
if
(
cards
.
plan
==
null
&&
isDebug
)
{
if
(
cards
.
plan
==
null
&&
isDebug
)
{
throw
new
Exception
();
throw
new
Exception
();
}
}
String
price
;
String
price
=
if
(
cards
.
plan
.
minPrice
.
empty
()
&&
cards
.
plan
.
maxPrice
.
empty
())
{
NumPlanUtil
.
getPrice
(
cards
.
plan
.
minPrice
,
cards
.
plan
.
maxPrice
);
price
=
"暂无报价"
;
}
else
if
(
cards
.
plan
.
minPrice
.
empty
()
&&
!
cards
.
plan
.
maxPrice
.
empty
())
{
price
=
"
${cards.plan.maxPrice}
"
;
}
else
if
(!
cards
.
plan
.
minPrice
.
empty
()
&&
cards
.
plan
.
maxPrice
.
empty
())
{
price
=
"
${cards.plan.minPrice}
"
;
}
else
{
price
=
"
${cards.plan.minPrice}
-
${cards.plan.maxPrice}
"
;
}
return
Container
(
return
Container
(
height:
118
,
height:
118
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
...
...
lib/ClueModel/page/plan/PlanPage.dart
View file @
4759f490
...
@@ -497,6 +497,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
...
@@ -497,6 +497,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
boxShadow:
[
boxShadow:
[
BoxShadow
(
BoxShadow
(
color:
Colors
.
black12
,
color:
Colors
.
black12
,
offset:
Offset
(
0.0
,
2.0
),
blurRadius:
0.5
,
blurRadius:
0.5
,
spreadRadius:
0.5
spreadRadius:
0.5
)
)
...
...
lib/ClueModel/server/entity/PlanCompareDetail.dart
View file @
4759f490
...
@@ -5,184 +5,188 @@
...
@@ -5,184 +5,188 @@
* @Last Modified time: 2020-07-01 20:31:42
* @Last Modified time: 2020-07-01 20:31:42
*/
*/
class
PlanCompareDetail
{
class
PlanCompareDetail
{
int
error
;
int
error
;
String
message
;
String
message
;
Map
extra
;
Map
extra
;
int
errorCode
;
Map
errorExtra
;
Map
errorExtra
;
UserType
userType
;
Data
data
;
Data
data
;
UserType
userType
;
PlanCompareDetail
({
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanCompareDetail
(
{
this
.
error
,
PlanCompareDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
this
.
message
,
error
=
json
[
'error'
];
this
.
extra
,
message
=
json
[
'message'
];
this
.
errorCode
,
extra
=
json
[
'extra'
];
this
.
errorExtra
,
errorExtra
=
json
[
'error_extra'
];
this
.
data
,
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
this
.
userType
});
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
}
PlanCompareDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
Map
<
String
,
dynamic
>
toJson
()
{
message
=
json
[
'message'
];
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
extra
=
json
[
'extra'
];
data
[
'error'
]
=
this
.
error
;
errorCode
=
json
[
'error_code'
];
data
[
'message'
]
=
this
.
message
;
errorExtra
=
json
[
'error_extra'
];
data
[
'extra'
]
=
this
.
extra
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
data
[
'error_extra'
]
=
this
.
errorExtra
;
userType
=
json
[
'user_type'
]
!=
null
if
(
this
.
userType
!=
null
)
{
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
data
[
'user_type'
]
=
this
.
userType
.
toJson
();
:
null
;
}
}
if
(
this
.
data
!=
null
)
{
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'error'
]
=
this
.
error
;
data
[
'message'
]
=
this
.
message
;
data
[
'extra'
]
=
this
.
extra
;
data
[
'error_code'
]
=
this
.
errorCode
;
data
[
'error_extra'
]
=
this
.
errorExtra
;
if
(
this
.
data
!=
null
)
{
data
[
'data'
]
=
this
.
data
.
toJson
();
data
[
'data'
]
=
this
.
data
.
toJson
();
}
}
return
data
;
if
(
this
.
userType
!=
null
)
{
}
data
[
'user_type'
]
=
this
.
userType
.
toJson
();
}
return
data
;
}
}
}
class
UserType
{
class
Data
{
List
<
PlansInfoDetail
>
plansInfo
;
List
<
Groups
>
groups
;
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Data
({
this
.
plansInfo
,
this
.
groups
});
}
Map
<
String
,
dynamic
>
toJson
()
{
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
json
[
'plans_info'
]
!=
null
)
{
return
data
;
plansInfo
=
new
List
<
PlansInfoDetail
>();
}
json
[
'plans_info'
].
forEach
((
v
)
{
}
plansInfo
.
add
(
new
PlansInfoDetail
.
fromJson
(
v
));
});
}
if
(
json
[
'groups'
]
!=
null
)
{
groups
=
new
List
<
Groups
>();
json
[
'groups'
].
forEach
((
v
)
{
groups
.
add
(
new
Groups
.
fromJson
(
v
));
});
}
}
class
Data
{
Map
<
String
,
dynamic
>
toJson
()
{
List
<
PlansInfoDetail
>
plansInfo
;
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
List
<
Groups
>
groups
;
if
(
this
.
plansInfo
!=
null
)
{
Data
({
this
.
plansInfo
,
this
.
groups
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'plans_info'
]
!=
null
)
{
plansInfo
=
new
List
<
PlansInfoDetail
>();
json
[
'plans_info'
].
forEach
((
v
)
{
plansInfo
.
add
(
new
PlansInfoDetail
.
fromJson
(
v
));
});
}
if
(
json
[
'groups'
]
!=
null
)
{
groups
=
new
List
<
Groups
>();
json
[
'groups'
].
forEach
((
v
)
{
groups
.
add
(
new
Groups
.
fromJson
(
v
));
});
}
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
plansInfo
!=
null
)
{
data
[
'plans_info'
]
=
this
.
plansInfo
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
data
[
'plans_info'
]
=
this
.
plansInfo
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
}
if
(
this
.
groups
!=
null
)
{
if
(
this
.
groups
!=
null
)
{
data
[
'groups'
]
=
this
.
groups
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
data
[
'groups'
]
=
this
.
groups
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
}
return
data
;
return
data
;
}
}
}
}
class
PlansInfoDetail
{
class
PlansInfoDetail
{
int
planId
;
int
planId
;
String
planName
;
String
planName
;
String
minPrice
;
String
price
;
String
maxPrice
;
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
minPrice
,
this
.
maxP
rice
});
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
p
rice
});
PlansInfoDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
PlansInfoDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
planId
=
json
[
'plan_id'
];
planName
=
json
[
'plan_name'
];
planName
=
json
[
'plan_name'
];
minPrice
=
json
[
'min_price'
];
price
=
json
[
'price'
];
maxPrice
=
json
[
'max_price'
];
}
}
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'plan_name'
]
=
this
.
planName
;
data
[
'plan_name'
]
=
this
.
planName
;
data
[
'price'
]
=
this
.
price
;
data
[
'min_price'
]
=
this
.
minPrice
;
return
data
;
data
[
'max_price'
]
=
this
.
maxPrice
;
}
return
data
;
}
}
}
class
Groups
{
class
Groups
{
String
groupType
;
String
groupType
;
String
groupName
;
String
groupName
;
List
<
Plans
>
plans
;
List
<
Plans
>
plans
;
Groups
({
this
.
groupType
,
this
.
groupName
,
this
.
plans
});
Groups
({
this
.
groupType
,
this
.
groupName
,
this
.
plans
});
Groups
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Groups
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
groupType
=
json
[
'group_type'
];
groupType
=
json
[
'group_type'
];
groupName
=
json
[
'group_name'
];
groupName
=
json
[
'group_name'
];
if
(
json
[
'plans'
]
!=
null
)
{
if
(
json
[
'plans'
]
!=
null
)
{
plans
=
new
List
<
Plans
>();
plans
=
new
List
<
Plans
>();
json
[
'plans'
].
forEach
((
v
)
{
plans
.
add
(
new
Plans
.
fromJson
(
v
));
});
json
[
'plans'
].
forEach
((
v
)
{
}
plans
.
add
(
new
Plans
.
fromJson
(
v
));
}
});
}
Map
<
String
,
dynamic
>
toJson
()
{
}
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'group_type'
]
=
this
.
groupType
;
Map
<
String
,
dynamic
>
toJson
()
{
data
[
'group_name'
]
=
this
.
groupName
;
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
plans
!=
null
)
{
data
[
'group_type'
]
=
this
.
groupType
;
data
[
'group_name'
]
=
this
.
groupName
;
if
(
this
.
plans
!=
null
)
{
data
[
'plans'
]
=
this
.
plans
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
data
[
'plans'
]
=
this
.
plans
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
}
return
data
;
return
data
;
}
}
}
}
class
Plans
{
class
Plans
{
int
planId
;
int
planId
;
String
positiveRate
;
List
<
Attrs
>
attrs
;
String
salesCount
;
List
<
Attrs
>
attrs
;
Plans
({
this
.
planId
,
this
.
attrs
});
Plans
({
this
.
planId
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
attrs
});
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'attrs'
]
!=
null
)
{
planId
=
json
[
'plan_id'
];
attrs
=
new
List
<
Attrs
>();
positiveRate
=
json
[
'positive_rate'
];
json
[
'attrs'
].
forEach
((
v
)
{
salesCount
=
json
[
'sales_count'
];
attrs
.
add
(
new
Attrs
.
fromJson
(
v
));
if
(
json
[
'attrs'
]
!=
null
)
{
});
attrs
=
new
List
<
Attrs
>();
}
json
[
'attrs'
].
forEach
((
v
)
{
attrs
.
add
(
new
Attrs
.
fromJson
(
v
));
});
}
}
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
Map
<
String
,
dynamic
>
toJson
()
{
data
[
'plan_id'
]
=
this
.
planId
;
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
attrs
!=
null
)
{
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
if
(
this
.
attrs
!=
null
)
{
data
[
'attrs'
]
=
this
.
attrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
data
[
'attrs'
]
=
this
.
attrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
}
return
data
;
return
data
;
}
}
}
}
class
Attrs
{
class
Attrs
{
String
attrName
;
String
attrName
;
String
attrValue
;
String
attrValue
;
Attrs
({
this
.
attrName
,
this
.
attrValue
});
Attrs
({
this
.
attrName
,
this
.
attrValue
});
Attrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Attrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrName
=
json
[
'attr_name'
];
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
attrValue
=
json
[
'attr_value'
];
}
}
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
return
data
;
}
}
}
}
class
UserType
{
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
lib/ClueModel/util/NumPlanUtil.dart
View file @
4759f490
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
* @date 2020/7/10
* @date 2020/7/10
**/
**/
import
'package:common_utils/common_utils.dart'
;
import
'package:common_utils/common_utils.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
class
NumPlanUtil
{
class
NumPlanUtil
{
static
String
getSale
(
String
sale
)
{
static
String
getSale
(
String
sale
)
{
...
@@ -24,4 +25,20 @@ class NumPlanUtil {
...
@@ -24,4 +25,20 @@ class NumPlanUtil {
static
formatNum
(
double
num
,
int
postion
)
{
static
formatNum
(
double
num
,
int
postion
)
{
return
(
NumUtil
.
getNumByValueDouble
(
num
,
postion
)).
toStringAsFixed
(
postion
);
return
(
NumUtil
.
getNumByValueDouble
(
num
,
postion
)).
toStringAsFixed
(
postion
);
}
}
static
String
getPrice
(
String
min
,
String
max
)
{
String
price
;
if
(
min
.
empty
()
&&
max
.
empty
())
{
price
=
"暂无报价"
;
}
else
if
(
min
.
empty
()
&&
!
max
.
empty
())
{
price
=
"
${max}
"
;
}
else
if
(!
min
.
empty
()
&&
max
.
empty
())
{
price
=
"
${min}
"
;
}
else
if
(
min
==
max
)
{
price
=
"
${max}
"
;
}
else
{
price
=
"
${min}
-
${max}
"
;
}
return
price
;
}
}
}
lib/commonModel/base/BaseComponent.dart
View file @
4759f490
...
@@ -84,11 +84,13 @@ Text baseText(String text, double fontSize, Color color,
...
@@ -84,11 +84,13 @@ Text baseText(String text, double fontSize, Color color,
{
bool
bold
=
false
,
{
bool
bold
=
false
,
TextAlign
textAlign
,
TextAlign
textAlign
,
int
maxLines
=
1
,
int
maxLines
=
1
,
TextOverflow
overflow
})
{
TextOverflow
overflow
,
bool
isWarp
=
false
})
{
return
Text
(
return
Text
(
text
,
text
,
textAlign:
textAlign
??
TextAlign
.
start
,
textAlign:
textAlign
??
TextAlign
.
start
,
textScaleFactor:
1.0
,
textScaleFactor:
1.0
,
softWrap:
isWarp
,
style:
TextStyle
(
style:
TextStyle
(
decoration:
TextDecoration
.
none
,
decoration:
TextDecoration
.
none
,
fontSize:
fontSize
,
fontSize:
fontSize
,
...
@@ -432,6 +434,7 @@ Widget baseTabBar(
...
@@ -432,6 +434,7 @@ Widget baseTabBar(
boxShadow:
[
boxShadow:
[
BoxShadow
(
BoxShadow
(
color:
Colors
.
black12
,
color:
Colors
.
black12
,
offset:
Offset
(
0.0
,
2.0
),
blurRadius:
0.5
,
blurRadius:
0.5
,
spreadRadius:
0.5
spreadRadius:
0.5
)
)
...
...
lib/commonModel/net/DioInterceptor.dart
View file @
4759f490
...
@@ -123,7 +123,7 @@ class DioInterceptorManager {
...
@@ -123,7 +123,7 @@ class DioInterceptorManager {
print
(
"请求之前 onRequest
${opt.uri}${opt.queryParameters}${opt.headers}
"
);
print
(
"请求之前 onRequest
${opt.uri}${opt.queryParameters}${opt.headers}
"
);
},
onResponse:
(
response
)
{
},
onResponse:
(
response
)
{
print
(
"响应之前
onResponse
${response}
"
);
print
(
"响应之前 "
);
},
onError:
(
e
)
{
},
onError:
(
e
)
{
print
(
"网络错误
$e
message
${e.message}
"
);
print
(
"网络错误
$e
message
${e.message}
"
);
});
});
...
...
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