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
d8bc4810
Commit
d8bc4810
authored
Jul 01, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对比详情
parent
074d8756
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
22 deletions
+79
-22
PlanCompareDetailModel.dart
...eModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
+16
-9
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+0
-0
PlanCompareDetail.dart
lib/ClueModel/server/entity/PlanCompareDetail.dart
+63
-13
No files found.
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
View file @
d8bc4810
...
...
@@ -2,27 +2,33 @@
* @Author: zx
* @Date: 2020-06-30 17:43:13
* @Last Modified by: zx
* @Last Modified time: 2020-0
6-30 22:01:01
* @Last Modified time: 2020-0
7-01 20:04:23
*/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
PlanCompareDetailModel
extends
BaseModel
{
LiveData
<
PlanCompareDetail
>
detailLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
void
init
()
{
ClueApiImpl
.
getInstance
()
.
getPlanCompareDetail
(
DioUtil
.
getInstance
().
getDio
(),
[
1
,
2
])
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
detailLive
.
notifyView
(
event
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{});
}
@override
void
dispose
()
{
// showTab.dispost();
// cardsLive.dispost();
// appBarLive.dispost();
// rectLive.dispost();
// topIndexLive.dispost();
// topScrollLive.dispost();
detailLive
.
dispost
();
}
}
\ No newline at end of file
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
d8bc4810
This diff is collapsed.
Click to expand it.
lib/ClueModel/server/entity/PlanCompareDetail.dart
View file @
d8bc4810
...
...
@@ -2,7 +2,7 @@
* @Author: zx
* @Date: 2020-06-30 19:31:32
* @Last Modified by: zx
* @Last Modified time: 2020-0
6-30 21:51:15
* @Last Modified time: 2020-0
7-01 20:31:42
*/
...
...
@@ -11,13 +11,19 @@ import 'dart:convert';
class
PlanCompareDetail
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
Data
data
;
PlanCompareDetail
({
this
.
error
,
this
.
message
,
this
.
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
;
}
...
...
@@ -25,6 +31,11 @@ class PlanCompareDetail {
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'
]
=
this
.
data
.
toJson
();
}
...
...
@@ -32,12 +43,31 @@ class PlanCompareDetail {
}
}
class
UserType
{
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
class
Data
{
List
<
PlansInfo
>
plansInfo
;
List
<
Groups
>
groups
;
Data
({
this
.
groups
});
Data
({
this
.
plansInfo
,
this
.
groups
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'plans_info'
]
!=
null
)
{
plansInfo
=
new
List
<
PlansInfo
>();
json
[
'plans_info'
].
forEach
((
v
)
{
plansInfo
.
add
(
new
PlansInfo
.
fromJson
(
v
));
});
}
if
(
json
[
'groups'
]
!=
null
)
{
groups
=
new
List
<
Groups
>();
json
[
'groups'
].
forEach
((
v
)
{
groups
.
add
(
new
Groups
.
fromJson
(
v
));
});
...
...
@@ -46,6 +76,9 @@ class Data {
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
)
{
data
[
'groups'
]
=
this
.
groups
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
...
...
@@ -53,6 +86,31 @@ class Data {
}
}
class
PlansInfo
{
int
planId
;
String
planName
;
String
minPrice
;
String
maxPrice
;
PlansInfo
({
this
.
planId
,
this
.
planName
,
this
.
minPrice
,
this
.
maxPrice
});
PlansInfo
.
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
;
}
}
class
Groups
{
String
groupType
;
String
groupName
;
...
...
@@ -82,20 +140,14 @@ class Groups {
class
Plans
{
int
planId
;
String
planName
;
String
minPrice
;
String
maxPrice
;
String
positiveRate
;
String
salesCount
;
List
<
Attrs
>
attrs
;
Plans
({
this
.
planId
,
this
.
p
lanName
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
p
ositiveRate
,
this
.
salesCount
,
this
.
attrs
});
Plans
({
this
.
planId
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
attrs
});
Plans
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planId
=
json
[
'plan_id'
];
planName
=
json
[
'plan_name'
];
minPrice
=
json
[
'min_price'
];
maxPrice
=
json
[
'max_price'
];
positiveRate
=
json
[
'positive_rate'
];
salesCount
=
json
[
'sales_count'
];
if
(
json
[
'attrs'
]
!=
null
)
{
...
...
@@ -107,9 +159,6 @@ class Plans {
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
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
if
(
this
.
attrs
!=
null
)
{
...
...
@@ -140,3 +189,4 @@ class Attrs {
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