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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
253 additions
and
223 deletions
+253
-223
PlanCompareDetailModel.dart
...eModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
+0
-2
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+0
-0
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 {
}
else
{
stateLive
.
notifyView
(
FAIL
);
NativeToast
.
showNativeToast
(
event
.
message
);
detailLive
.
notifyView
(
Pair
(
FAIL
,
null
));
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
stateLive
.
notifyView
(
FAIL
);
detailLive
.
notifyView
(
Pair
(
FAIL
,
null
));
NativeToast
.
showNativeToast
(
err
.
message
);
});
}
...
...
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
4759f490
This diff is collapsed.
Click to expand it.
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
4759f490
...
...
@@ -128,25 +128,23 @@ class _PlansCompareFeedItemViewState
}
getSecondLevelItem
()
{
String
price
=
NumPlanUtil
.
getPrice
(
widget
.
plan
.
minPrice
,
widget
.
plan
.
maxPrice
);
return
Container
(
height:
77
,
child:
Row
(
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
right:
15.0
),
alignment:
Alignment
.
centerLeft
,
child:
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
onClickCheckBox
(
_icon
),
child:
Container
(
alignment:
Alignment
.
center
,
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
))),
),
margin:
EdgeInsets
.
only
(
right:
15.0
),
alignment:
Alignment
.
centerLeft
,
child:
Container
(
alignment:
Alignment
.
center
,
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
))),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -159,10 +157,25 @@ class _PlansCompareFeedItemViewState
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
)),
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
Color
(
0xFF666666
)),
Row
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
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
)
],
),
);
).
gestureDetector
(()
{
onClickCheckBox
(
_icon
);
});
}
onClickCheckBox
(
String
icon
)
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
4759f490
...
...
@@ -52,20 +52,20 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
@override
Widget
buildItem
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
baseAppBar
(
title:
"方案对比"
,
centerTitle:
true
,
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
()
)
{
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
body:
Center
(
child:
getBody
(),
),
);
backgroundColor:
Colors
.
white
,
appBar:
baseAppBar
(
title:
"方案对比"
,
centerTitle:
true
,
backClick:
(
)
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
body:
SafeArea
(
child:
getBody
(
),
)
);
}
getBody
()
{
...
...
@@ -93,36 +93,32 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
}
getList
(
List
<
Plans
>
plans
)
{
return
Stack
(
alignment:
Alignment
.
bottomCenter
,
children:
<
Widget
>[
ListView
.
builder
(
itemCount:
plans
.
length
,
itemBuilder:
(
BuildContext
context
,
int
position
)
{
return
PlansCompareFeedItemView
(
plans
[
position
],
this
,
_setCompare
);
}),
GestureDetector
(
return
Column
(
children:
<
Widget
>[
Expanded
(
child:
ListView
.
builder
(
itemCount:
plans
.
length
,
itemBuilder:
(
BuildContext
context
,
int
position
)
{
return
PlansCompareFeedItemView
(
plans
[
position
],
this
,
_setCompare
);
}),
),
Divider
(
height:
0.5
,
color:
Color
(
0xFFE5E5E5
)),
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
onClickCompare
(),
child:
Container
(
color:
Colors
.
white
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Divider
(
height:
0.5
,
color:
Color
(
0xFFE5E5E5
)),
Container
(
margin:
EdgeInsets
.
only
(
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
),
)
],
),
))
]);
margin:
EdgeInsets
.
only
(
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
()
{
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
4759f490
...
...
@@ -48,9 +48,9 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
title:
"项目说明"
,
centerTitle:
true
,
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
...
...
@@ -66,7 +66,8 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
initialData:
_model
.
liveData
.
data
??
null
,
builder:
(
c
,
data
)
{
if
(
_model
.
liveData
.
data
==
null
)
{
return
loadingItem
();
// return loadingItem();
return
Container
();
}
ProjectDetailsItem
item
=
data
.
data
;
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';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.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/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/NumberUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
class
LevelOneItem
extends
StatelessWidget
{
...
...
@@ -20,6 +22,7 @@ class LevelOneItem extends StatelessWidget {
Function
(
int
planId
)
gotoPlan
;
int
position
;
String
tabName
;
LevelOneItem
(
this
.
cards
,
{
this
.
lowPrice
,
this
.
ask
,
...
...
@@ -301,16 +304,8 @@ class LevelOneItem extends StatelessWidget {
if
(
cards
.
plan
==
null
&&
isDebug
)
{
throw
new
Exception
();
}
String
price
;
if
(
cards
.
plan
.
minPrice
.
empty
()
&&
cards
.
plan
.
maxPrice
.
empty
())
{
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}
"
;
}
String
price
=
NumPlanUtil
.
getPrice
(
cards
.
plan
.
minPrice
,
cards
.
plan
.
maxPrice
);
return
Container
(
height:
118
,
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 {
boxShadow:
[
BoxShadow
(
color:
Colors
.
black12
,
offset:
Offset
(
0.0
,
2.0
),
blurRadius:
0.5
,
spreadRadius:
0.5
)
...
...
lib/ClueModel/server/entity/PlanCompareDetail.dart
View file @
4759f490
...
...
@@ -5,184 +5,188 @@
* @Last Modified time: 2020-07-01 20:31:42
*/
class
PlanCompareDetail
{
int
error
;
String
message
;
Map
extra
;
int
error
;
String
message
;
Map
extra
;
int
errorCode
;
Map
errorExtra
;
UserType
userType
;
Data
data
;
PlanCompareDetail
({
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanCompareDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
message
=
json
[
'message'
];
extra
=
json
[
'extra'
];
errorExtra
=
json
[
'error_extra'
];
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'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_extra'
]
=
this
.
errorExtra
;
if
(
this
.
userType
!=
null
)
{
data
[
'user_type'
]
=
this
.
userType
.
toJson
();
}
if
(
this
.
data
!=
null
)
{
Data
data
;
UserType
userType
;
PlanCompareDetail
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorCode
,
this
.
errorExtra
,
this
.
data
,
this
.
userType
});
PlanCompareDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
message
=
json
[
'message'
];
extra
=
json
[
'extra'
];
errorCode
=
json
[
'error_code'
];
errorExtra
=
json
[
'error_extra'
];
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
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
();
}
return
data
;
}
if
(
this
.
userType
!=
null
)
{
data
[
'user_type'
]
=
this
.
userType
.
toJson
();
}
return
data
;
}
}
class
UserType
{
UserType
();
class
Data
{
List
<
PlansInfoDetail
>
plansInfo
;
List
<
Groups
>
groups
;
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
}
Data
({
this
.
plansInfo
,
this
.
groups
});
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
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
));
});
}
}
class
Data
{
List
<
PlansInfoDetail
>
plansInfo
;
List
<
Groups
>
groups
;
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
)
{
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
();
}
if
(
this
.
groups
!=
null
)
{
if
(
this
.
groups
!=
null
)
{
data
[
'groups'
]
=
this
.
groups
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
return
data
;
}
}
class
PlansInfoDetail
{
int
planId
;
String
planName
;
String
minPrice
;
String
maxPrice
;
int
planId
;
String
planName
;
String
price
;
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
minPrice
,
this
.
maxP
rice
});
PlansInfoDetail
({
this
.
planId
,
this
.
planName
,
this
.
p
rice
});
PlansInfoDetail
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
planName
=
json
[
'plan_name'
];
minPrice
=
json
[
'min_price'
];
maxPrice
=
json
[
'max_price'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'plan_name'
]
=
this
.
planName
;
data
[
'min_price'
]
=
this
.
minPrice
;
data
[
'max_price'
]
=
this
.
maxPrice
;
return
data
;
}
planId
=
json
[
'plan_id'
];
planName
=
json
[
'plan_name'
];
price
=
json
[
'price'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'plan_name'
]
=
this
.
planName
;
data
[
'price'
]
=
this
.
price
;
return
data
;
}
}
class
Groups
{
String
groupType
;
String
groupName
;
List
<
Plans
>
plans
;
Groups
({
this
.
groupType
,
this
.
groupName
,
this
.
plans
});
Groups
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
groupType
=
json
[
'group_type'
];
groupName
=
json
[
'group_name'
];
if
(
json
[
'plans'
]
!=
null
)
{
plans
=
new
List
<
Plans
>();
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
;
data
[
'group_name'
]
=
this
.
groupName
;
if
(
this
.
plans
!=
null
)
{
String
groupType
;
String
groupName
;
List
<
Plans
>
plans
;
Groups
({
this
.
groupType
,
this
.
groupName
,
this
.
plans
});
Groups
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
groupType
=
json
[
'group_type'
];
groupName
=
json
[
'group_name'
];
if
(
json
[
'plans'
]
!=
null
)
{
plans
=
new
List
<
Plans
>();
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
;
data
[
'group_name'
]
=
this
.
groupName
;
if
(
this
.
plans
!=
null
)
{
data
[
'plans'
]
=
this
.
plans
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
return
data
;
}
}
class
Plans
{
int
planId
;
String
positiveRate
;
String
salesCount
;
List
<
Attrs
>
attrs
;
Plans
({
this
.
planId
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
attrs
});
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
positiveRate
=
json
[
'positive_rate'
];
salesCount
=
json
[
'sales_count'
];
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
>();
data
[
'plan_id'
]
=
this
.
planId
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
if
(
this
.
attrs
!=
null
)
{
int
planId
;
List
<
Attrs
>
attrs
;
Plans
({
this
.
planId
,
this
.
attrs
});
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
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
>();
data
[
'plan_id'
]
=
this
.
planId
;
if
(
this
.
attrs
!=
null
)
{
data
[
'attrs'
]
=
this
.
attrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
return
data
;
}
}
class
Attrs
{
String
attrName
;
String
attrValue
;
Attrs
({
this
.
attrName
,
this
.
attrValue
});
Attrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
}
String
attrName
;
String
attrValue
;
Attrs
({
this
.
attrName
,
this
.
attrValue
});
Attrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
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 @@
* @date 2020/7/10
**/
import
'package:common_utils/common_utils.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
class
NumPlanUtil
{
static
String
getSale
(
String
sale
)
{
...
...
@@ -24,4 +25,20 @@ class NumPlanUtil {
static
formatNum
(
double
num
,
int
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,
{
bool
bold
=
false
,
TextAlign
textAlign
,
int
maxLines
=
1
,
TextOverflow
overflow
})
{
TextOverflow
overflow
,
bool
isWarp
=
false
})
{
return
Text
(
text
,
textAlign:
textAlign
??
TextAlign
.
start
,
textScaleFactor:
1.0
,
softWrap:
isWarp
,
style:
TextStyle
(
decoration:
TextDecoration
.
none
,
fontSize:
fontSize
,
...
...
@@ -432,6 +434,7 @@ Widget baseTabBar(
boxShadow:
[
BoxShadow
(
color:
Colors
.
black12
,
offset:
Offset
(
0.0
,
2.0
),
blurRadius:
0.5
,
spreadRadius:
0.5
)
...
...
lib/commonModel/net/DioInterceptor.dart
View file @
4759f490
...
...
@@ -123,7 +123,7 @@ class DioInterceptorManager {
print
(
"请求之前 onRequest
${opt.uri}${opt.queryParameters}${opt.headers}
"
);
},
onResponse:
(
response
)
{
print
(
"响应之前
onResponse
${response}
"
);
print
(
"响应之前 "
);
},
onError:
(
e
)
{
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