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
e2a5006b
Commit
e2a5006b
authored
Jul 06, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Plain Diff
conflict fix
parents
90fef5e0
9f134c24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
787 additions
and
251 deletions
+787
-251
icon-check.png
assets/icon-check.png
+0
-0
icon-checked.png
assets/icon-checked.png
+0
-0
ClueRouter.dart
lib/ClueModel/ClueRouter.dart
+3
-3
ClueRouterImpl.dart
lib/ClueModel/ClueRouterImpl.dart
+7
-7
PlansCompareFeedItemView.dart
...Model/page/PlansCompareFeed/PlansCompareFeedItemView.dart
+62
-42
PlansCompareFeedPage.dart
...ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
+11
-6
ProjectDetailsPage.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
+9
-17
StickyTabBarDelegate.dart
lib/ClueModel/page/common/StickyTabBarDelegate.dart
+24
-0
LevelOneList.dart
lib/ClueModel/page/levelOne/LevelOneList.dart
+3
-3
LevelOneModel.dart
lib/ClueModel/page/levelOne/LevelOneModel.dart
+2
-0
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+2
-11
LevelTwoModel.dart
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
+33
-77
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+0
-0
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+0
-0
MechanismModel.dart
lib/ClueModel/page/mechanismBox/MechanismModel.dart
+68
-0
PlanModel.dart
lib/ClueModel/page/plan/PlanModel.dart
+7
-1
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+24
-11
TopPage.dart
lib/ClueModel/page/top/TopPage.dart
+10
-3
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+9
-0
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+42
-0
ConsultQuestionsBean.dart
lib/ClueModel/server/entity/ConsultQuestionsBean.dart
+69
-0
PlanBean.dart
lib/ClueModel/server/entity/PlanBean.dart
+39
-17
PlanConsultBean.dart
lib/ClueModel/server/entity/PlanConsultBean.dart
+69
-0
PlanOverviewBean.dart
lib/ClueModel/server/entity/PlanOverviewBean.dart
+217
-0
JumpManager.dart
lib/MainRouter/manager/JumpManager.dart
+10
-0
TestPage.dart
lib/MainRouter/page/test/TestPage.dart
+10
-4
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+47
-43
main.dart
lib/main.dart
+10
-6
No files found.
assets/icon-check.png
0 → 100644
View file @
e2a5006b
952 Bytes
assets/icon-checked.png
0 → 100644
View file @
e2a5006b
1.03 KB
lib/ClueModel/ClueRouter.dart
View file @
e2a5006b
...
...
@@ -10,9 +10,9 @@ import 'package:gm_flutter/ClueModel/ClueRouterImpl.dart';
@Router
(
"ClueRouter"
,
ClueRouterImpl
,
true
)
abstract
class
ClueRouter
implements
RouterBaser
{
Widget
getProjectDetailsPage
();
Widget
getProjectDetailsPage
(
Map
<
String
,
dynamic
>
params
);
Widget
getPlansCompareFeed
();
Widget
getPlansCompareFeed
(
Map
<
String
,
dynamic
>
params
);
Widget
getLevelOnePage
(
Map
<
String
,
dynamic
>
params
);
...
...
@@ -22,5 +22,5 @@ abstract class ClueRouter implements RouterBaser {
Widget
getPlanCompareDetailPage
(
Map
<
String
,
dynamic
>
params
);
Widget
getTopPage
();
Widget
getTopPage
(
Map
<
String
,
dynamic
>
params
);
}
lib/ClueModel/ClueRouterImpl.dart
View file @
e2a5006b
...
...
@@ -5,18 +5,18 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouter.dart'
;
import
'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart'
;
import
'package:gm_flutter/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart'
;
import
'package:gm_flutter/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOnePage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
import
'package:gm_flutter/ClueModel/page/plan/PlanPage.dart'
;
import
'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopPage.dart'
;
class
ClueRouterImpl
implements
ClueRouter
{
@override
Widget
getProjectDetailsPage
()
{
return
ProjectDetailsPage
(
1
);
Widget
getProjectDetailsPage
(
Map
<
String
,
dynamic
>
params
)
{
return
ProjectDetailsPage
(
params
);
}
@override
...
...
@@ -30,8 +30,8 @@ class ClueRouterImpl implements ClueRouter {
}
@override
Widget
getPlansCompareFeed
()
{
return
PlansCompareFeedPage
(
123
,
1
);
Widget
getPlansCompareFeed
(
Map
<
String
,
dynamic
>
params
)
{
return
PlansCompareFeedPage
(
params
);
}
@override
...
...
@@ -45,7 +45,7 @@ class ClueRouterImpl implements ClueRouter {
}
@override
Widget
getTopPage
()
{
return
TopPage
();
Widget
getTopPage
(
Map
<
String
,
dynamic
>
params
)
{
return
TopPage
(
params
);
}
}
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
e2a5006b
...
...
@@ -20,11 +20,9 @@ class PlansCompareFeedItemView extends StatefulWidget {
class
_PlansCompareFeedItemViewState
extends
BaseState
<
PlansCompareFeedItemView
>
{
ImageIcon
_checked
=
ImageIcon
(
AssetImage
(
"assets/icon_compare_select.png"
));
ImageIcon
_unchecked
=
ImageIcon
(
AssetImage
(
"assets/icon_compare_unselect.png"
));
ImageIcon
_icon
=
ImageIcon
(
AssetImage
(
"assets/icon_compare_unselect.png"
));
String
_checked
=
"assets/icon_compare_select.png"
;
String
_unchecked
=
"assets/icon_compare_unselect.png"
;
String
_icon
=
"assets/icon_compare_unselect.png"
;
@override
Widget
buildItem
(
BuildContext
context
)
{
...
...
@@ -48,10 +46,19 @@ class _PlansCompareFeedItemViewState
padding:
EdgeInsets
.
only
(
top:
20
,
bottom:
20
),
child:
Row
(
children:
<
Widget
>[
IconButton
(
icon:
_icon
,
onPressed:
()
=>
onClickCheckBox
(
_icon
),
),
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
onClickCheckBox
(
_icon
),
child:
Container
(
alignment:
Alignment
.
center
,
child:
ClipRRect
(
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
)),
)),
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
ClipRRect
(
...
...
@@ -64,29 +71,33 @@ class _PlansCompareFeedItemViewState
),
),
),
Container
(
height:
50
,
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
top:
2
,
bottom:
5
),
margin:
EdgeInsets
.
only
(
top:
2
,
bottom:
8
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
bold:
true
),
baseText
(
" 好评率 "
,
11
,
Color
(
0xFF282828
)),
baseText
(
widget
.
plan
.
positiveRate
,
14
,
Color
(
0xFFFF5963
),
bold:
true
),
Row
(
children:
<
Widget
>[
baseText
(
"好评率 "
,
11
,
Color
(
0xFF282828
)),
baseText
(
widget
.
plan
.
positiveRate
,
14
,
Color
(
0xFFFF5963
),
bold:
true
)
]),
],
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
)),
baseText
(
" 销量
${widget.plan.salesCount}
"
,
11
,
Color
(
0xFF282828
))
baseText
(
"销量
${widget.plan.salesCount}
"
,
11
,
Color
(
0xFF282828
))
],
)
],
...
...
@@ -105,38 +116,47 @@ class _PlansCompareFeedItemViewState
Container
(
margin:
EdgeInsets
.
only
(
right:
15.0
),
alignment:
Alignment
.
centerLeft
,
child:
IconButton
(
icon:
_icon
,
onPressed:
()
=>
onClickCheckBox
(
_icon
),
),
child:
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
onClickCheckBox
(
_icon
),
child:
Container
(
alignment:
Alignment
.
center
,
child:
ClipRRect
(
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
)),
)),
),
Column
(
c
rossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
top:
13.0
,
bottom:
12
),
child:
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
bold:
true
),
),
Row
(
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
)),
Container
(
width:
160
,
alignment:
Alignment
.
centerRight
,
child:
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
Color
(
0xFF282828
)))
,
]
,
)
,
]
,
Expanded
(
c
hild:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
top:
13.0
,
bottom:
12
),
child:
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
bold:
true
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
))
,
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
Color
(
0xFF282828
))
,
]
,
)
,
]
,
)
,
)
],
),
);
}
onClickCheckBox
(
ImageIcon
icon
)
{
onClickCheckBox
(
String
icon
)
{
if
(
icon
==
_checked
)
{
_icon
=
_unchecked
;
}
else
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
e2a5006b
...
...
@@ -5,11 +5,11 @@
**/
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:gm_flutter/ClueModel/page/PlansCompareFeed/PlansCompareFeedModel.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'CallBackCompareItem.dart'
;
import
'PlansCompareFeedItemView.dart'
;
...
...
@@ -18,7 +18,10 @@ class PlansCompareFeedPage extends StatefulWidget {
int
_planType
;
int
_planId
;
PlansCompareFeedPage
(
this
.
_planType
,
this
.
_planId
);
PlansCompareFeedPage
(
Map
<
String
,
dynamic
>
params
)
{
this
.
_planType
=
params
[
"planType"
];
this
.
_planId
=
params
[
"planId"
];
}
@override
State
<
StatefulWidget
>
createState
()
=>
_PlansCompareFeedState
();
...
...
@@ -75,7 +78,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
}
if
(
item
.
error
!=
0
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{});
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
init
(
widget
.
_planType
,
widget
.
_planId
);
});
}
return
getList
(
item
.
data
.
plans
);
},
...
...
@@ -107,9 +112,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
onClickCompare
()
{
if
(
_compareColor
==
Color
(
0xFFCCCCCC
))
return
;
setState
(()
{
Map
<
String
,
dynamic
>
map
=
{};
map
[
"ids"
]
=
_setCompare
;
FlutterBoost
.
singleton
.
open
(
"sample"
,
urlParams:
map
);
RouterCenterImpl
()
.
findMainRouter
()
.
jumpPage
(
context
,
"pageName"
,
{
"ids"
:
_setCompare
},
false
);
});
}
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
e2a5006b
...
...
@@ -15,7 +15,9 @@ import '../../server/entity/ProjectDetailsItem.dart';
class
ProjectDetailsPage
extends
StatefulWidget
{
int
_planId
;
ProjectDetailsPage
(
this
.
_planId
);
ProjectDetailsPage
(
Map
<
String
,
dynamic
>
params
)
{
this
.
_planId
=
params
[
"planId"
];
}
@override
State
<
StatefulWidget
>
createState
()
=>
_ProjectDetailsState
();
...
...
@@ -62,24 +64,14 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
}
ProjectDetailsItem
item
=
data
.
data
;
if
(
item
==
null
||
item
.
data
==
null
||
item
.
data
.
groups
==
null
)
{
return
emptyItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
);
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
);
}
if
(
item
.
error
!=
0
)
{
return
errorItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
,
()
{});
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
init
(
widget
.
_planId
);
});
}
return
ListView
.
builder
(
itemCount:
item
.
data
.
groups
.
length
,
...
...
lib/ClueModel/page/common/StickyTabBarDelegate.dart
0 → 100644
View file @
e2a5006b
import
'package:flutter/material.dart'
;
class
StickyTabBarDelegate
extends
SliverPersistentHeaderDelegate
{
final
Widget
child
;
StickyTabBarDelegate
({
@required
this
.
child
});
@override
Widget
build
(
BuildContext
context
,
double
shrinkOffset
,
bool
overlapsContent
)
{
return
this
.
child
;
}
@override
double
get
maxExtent
=>
40
;
@override
double
get
minExtent
=>
40
;
@override
bool
shouldRebuild
(
SliverPersistentHeaderDelegate
oldDelegate
)
{
return
true
;
}
}
lib/ClueModel/page/levelOne/LevelOneList.dart
View file @
e2a5006b
...
...
@@ -25,7 +25,7 @@ class LevelOneList extends StatefulWidget {
}
class
LevelOneListState
extends
State
<
LevelOneList
>
with
AutomaticKeepAliveClientMixin
{
with
AutomaticKeepAliveClientMixin
{
LevelOneListModel
_model
=
LevelOneListModel
();
RefreshController
refreshController
=
RefreshController
();
...
...
@@ -83,7 +83,7 @@ class LevelOneListState extends State<LevelOneList>
return
SliverList
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
{
if
(
index
==
_model
.
data
.
length
)
{
if
(
index
==
_model
.
data
.
length
)
{
return
Container
(
height:
40
,
color:
Color
(
0xffF7F6FA
),
...
...
@@ -93,7 +93,7 @@ class LevelOneListState extends State<LevelOneList>
,
lowPrice:
(){
},);
},
childCount:
_model
.
data
.
length
+
1
,
childCount:
_model
.
data
.
length
+
1
,
),
);
},
...
...
lib/ClueModel/page/levelOne/LevelOneModel.dart
View file @
e2a5006b
...
...
@@ -24,6 +24,7 @@ class LevelOneModel extends BaseModel {
List
<
Tabs
>
tabsList
=
[];
int
plan_id
=
0
;
PlanOverData
planoverItem
;
String
imageUrl
=
""
;
void
init
(
VoidCallback
callback
)
{
ClueApiImpl
.
getInstance
()
...
...
@@ -31,6 +32,7 @@ class LevelOneModel extends BaseModel {
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
planoverItem
=
event
.
data
;
imageUrl
=
event
.
data
.
banner
.
imageUrl
;
tabsList
=
event
.
data
.
tabs
;
stateLive
.
notifyView
(
ENDLOADING
);
callback
();
...
...
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
e2a5006b
...
...
@@ -10,18 +10,13 @@ import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
as
extend
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:
flutter/services
.dart'
;
import
'package:
gm_flutter/ClueModel/page/common/StickyTabBarDelegate
.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneList.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneModel.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
import
'package:gm_flutter/commonModel/App.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -54,9 +49,6 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
void
initState
()
{
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
save
(
COOKIE
,
"_gtid=3123e178b91a11eaa2d87e40d376ac134112; sessionid=pq9wf8equ4h26ia3yspzmquqn2rjs6mx; _gm_token=4091a81593419225"
);
DioUtil
.
getInstance
().
setProxy
(
"172.30.8.245"
);
super
.
initState
();
_model
.
plan_id
=
widget
.
planId
;
_model
.
init
(()
{
...
...
@@ -192,8 +184,7 @@ class LevelOneState extends BaseState<LevelOnePage>
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
sliver:
baseSliverAppBar
(
// _model.imageUrl
"https://pic.igengmei.com/2018/09/11/1513/b7e825a4e4c1-w"
)),
_model
.
imageUrl
)),
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
...
...
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
View file @
e2a5006b
...
...
@@ -5,96 +5,52 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/
LevelOneFeedList
.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/
PlanOverViewBean
.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'
;
import
'package:
gm_flutter/commonModel/util/PrintUtil
.dart'
;
class
LevelTwoModel
extends
BaseModel
{
LiveData
<
double
>
appBarLive
=
LiveData
();
LiveData
<
List
<
String
>>
rectLive
=
LiveData
();
LiveData
<
List
<
String
>>
explainLive
=
LiveData
();
LiveData
<
bool
>
showTab
=
LiveData
();
LiveData
<
int
>
topIndexLive
=
new
LiveData
();
LiveData
<
double
>
topScrollLive
=
new
LiveData
();
LiveData
<
bool
>
loadingLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
LiveData
<
Pair
<
int
,
List
<
Cards
>>>
cardsLive
=
LiveData
();
Map
<
int
,
List
<
Cards
>>
data
=
new
Map
();
List
list
=
[
"plan"
,
"hospital"
,
"doctor"
,
"diary"
];
List
pageList
=
[
1
,
1
,
1
,
1
];
List
pageHeightList
=
[
118
,
149
,
118
,
118
];
class
LevelOneModel
extends
BaseModel
{
LiveData
<
int
>
stateLive
=
LiveData
();
LiveData
<
double
>
textLive
=
LiveData
();
void
refreshView
(
bool
clear
,
{
RefreshController
refreshListener
})
{
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
Cards
cards
=
Cards
(
cardType:
"plan"
,
plan:
Plan
(
planName:
"ww"
,
minPrice:
"50"
,
maxPrice:
"500"
));
List
<
Cards
>
a
=
[
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
];
List
<
Cards
>
b
=
[
cards
];
print
(
"INDEX
${currentIndex}
"
);
if
(
currentIndex
==
1
)
{
data
[
currentIndex
]
=
b
;
}
else
{
data
[
currentIndex
]
=
a
;
}
RxDispose
rxDispose
=
RxDispose
();
cardsLive
.
notifyView
(
Pair
(
ENDLOADING
,
data
));
});
// int index = currentIndex;
// if (clear) {
// data.clear();
// pageList = [1, 1, 1, 1];
// }
// ClueApiImpl.getInstance()
// .getLevelOneList(
// DioUtil.getInstance().getDio(), 123, list[index], pageList[index])
// .listen((event) {})
// .addToDispose(rxDispose)
// .onError((err) {});
List
<
Tabs
>
tabsList
=
[];
int
plan_id
=
0
;
PlanOverData
planoverItem
;
void
init
(
VoidCallback
callback
)
{
ClueApiImpl
.
getInstance
()
.
getPlanOverView
(
DioUtil
.
getInstance
().
getDio
(),
plan_id
)
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
planoverItem
=
event
.
data
;
tabsList
=
event
.
data
.
tabs
;
stateLive
.
notifyView
(
ENDLOADING
);
callback
();
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
stateLive
.
notifyView
(
FAIL
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
PrintUtil
.
printBug
(
err
);
stateLive
.
notifyView
(
FAIL
);
});
}
int
currentIndex
=
0
;
@override
void
dispose
()
{
showTab
.
dispost
();
cardsLive
.
dispost
();
appBarLive
.
dispost
();
rectLive
.
dispost
();
topIndexLive
.
dispost
();
topScrollLive
.
dispost
();
loadingLive
.
dispost
();
}
void
selectPage
(
int
index
)
{
if
(
currentIndex
==
index
)
{
return
;
}
currentIndex
=
index
;
if
(
data
[
currentIndex
]
==
null
)
{
cardsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
refreshView
(
true
);
}
else
{
cardsLive
.
notifyView
(
Pair
(
ENDLOADING
,
data
[
currentIndex
]));
}
stateLive
.
dispost
();
textLive
.
dispost
();
}
void
loadMore
(
)
{}
void
selectTab
(
int
index
)
{}
}
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
e2a5006b
This diff is collapsed.
Click to expand it.
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
View file @
e2a5006b
This diff is collapsed.
Click to expand it.
lib/ClueModel/page/mechanismBox/MechanismModel.dart
0 → 100644
View file @
e2a5006b
/*
* @author lsy
* @date 2020/6/29
**/
import
'dart:math'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
class
MechanismModel
extends
BaseModel
{
LiveData
<
List
<
String
>>
questionsLive
=
LiveData
();
LiveData
<
int
>
stateLive
=
LiveData
();
LiveData
messageLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
getQuestions
(
int
plan_id
)
{
ClueApiImpl
.
getInstance
()
.
getConsultQuestions
(
DioUtil
.
getInstance
().
getDio
(),
plan_id
)
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
stateLive
.
notifyView
(
ENDLOADING
);
questionsLive
.
notifyView
(
event
.
data
.
questions
);
}
else
{
stateLive
.
notifyView
(
FAIL
);
questionsLive
.
notifyView
(
null
);
NativeToast
.
showNativeToast
(
event
.
message
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
stateLive
.
notifyView
(
FAIL
);
questionsLive
.
notifyView
(
null
);
PrintUtil
.
printBug
(
err
);
});
}
sendMessage
(
List
<
int
>
doctor_ids
,
String
question
,
int
plan_id
)
{
ClueApiImpl
.
getInstance
()
.
sendMessage
(
DioUtil
.
getInstance
().
getDio
(),
doctor_ids
,
question
,
plan_id
)
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
messageLive
.
notifyView
(
event
.
data
.
success
);
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
PrintUtil
.
printBug
(
err
);
});
}
@override
void
dispose
()
{
questionsLive
.
dispost
();
stateLive
.
dispost
();
rxDispose
.
dispose
();
}
}
lib/ClueModel/page/plan/PlanModel.dart
View file @
e2a5006b
...
...
@@ -14,6 +14,7 @@ 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:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
PlanModel
extends
BaseModel
{
LiveData
<
List
>
managerLive
=
new
LiveData
();
...
...
@@ -46,6 +47,7 @@ class PlanModel extends BaseModel {
ClueApiImpl
.
getInstance
()
.
getPlan
(
DioUtil
.
getInstance
().
getDio
())
.
listen
((
event
)
{
print
(
"ERROR12
${event.error}
"
);
if
(
event
.
error
==
0
)
{
projectData
=
event
.
data
.
tags
;
sortList
=
event
.
data
.
orders
;
...
...
@@ -59,6 +61,7 @@ class PlanModel extends BaseModel {
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
print
(
"ERROR12WCCCCCC
${err.toString()}
"
);
PrintUtil
.
printBug
(
err
);
stateLive
.
notifyView
(
FAIL
);
});
...
...
@@ -73,7 +76,7 @@ class PlanModel extends BaseModel {
refreshFeed
(
true
);
}
void
refreshFeed
(
bool
clear
)
{
void
refreshFeed
(
bool
clear
,
{
RefreshController
controller
}
)
{
if
(
clear
)
{
feedDatas
.
clear
();
}
...
...
@@ -88,15 +91,18 @@ class PlanModel extends BaseModel {
feedDatas
.
addAll
(
event
.
data
.
plans
);
feedsLive
.
notifyView
(
Pair
(
ENDLOADING
,
feedDatas
));
}
controller
?.
refreshCompleted
();
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
feedsLive
.
notifyView
(
Pair
(
FAIL
,
null
));
controller
?.
refreshFailed
();
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
PrintUtil
.
printBug
(
err
);
feedsLive
.
notifyView
(
Pair
(
FAIL
,
null
));
controller
?.
refreshFailed
();
});
}
...
...
lib/ClueModel/page/plan/PlanPage.dart
View file @
e2a5006b
...
...
@@ -17,20 +17,23 @@ import 'package:gm_flutter/ClueModel/page/plan/SortView.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.dart'
;
import
'package:gm_flutter/commonModel/App.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/popMenu/BaseMenuListener.dart'
;
import
'package:gm_flutter/commonModel/popMenu/BasePopMenu.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/WidgetUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'PlanModel.dart'
;
import
'ProjectView.dart'
;
class
PlanPage
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=>
PlanState
();
}
...
...
@@ -51,6 +54,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
void
initState
()
{
DioUtil
.
getInstance
().
setProxy
(
"172.30.8.245"
);
super
.
initState
();
_model
.
init
();
planBarView
=
...
...
@@ -250,13 +254,16 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child:
loadingItem
(),
);
}
else
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
},
return
Container
(
color:
Colors
.
white
,
child:
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
},
),
);
}
else
{
return
Container
(
...
...
@@ -342,7 +349,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child:
baseRefreshView
(
refreshController
,
()
{
_model
.
refreshFeed
(
true
);
_model
.
refreshFeed
(
true
,
controller:
refreshController
);
},
Container
(
width:
0
,
...
...
@@ -381,7 +388,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data
.
data
==
null
?
""
:
data
.
data
[
0
].
icon
??
""
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
//TODO
Map
<
String
,
dynamic
>
map
=
{
"rank_type"
:
"0"
};
RouterCenterImpl
()
.
findMainRouter
()
.
jumpPage
(
context
,
"clueTop"
,
map
,
false
);
});
},
),
...
...
@@ -403,7 +413,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data
.
data
==
null
?
""
:
data
.
data
[
1
].
icon
??
""
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
//TODO
Map
<
String
,
dynamic
>
map
=
{
"rank_type"
:
"1"
};
RouterCenterImpl
()
.
findMainRouter
()
.
jumpPage
(
context
,
"clueTop"
,
map
,
false
);
});
},
),
...
...
lib/ClueModel/page/top/TopPage.dart
View file @
e2a5006b
...
...
@@ -10,7 +10,7 @@ import 'package:flutter/cupertino.dart';
import
'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
as
extend
;
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/ClueModel/page/
levelTwo/LevelTwoPag
e.dart'
;
import
'package:gm_flutter/ClueModel/page/
common/StickyTabBarDelegat
e.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopModel.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
...
...
@@ -23,6 +23,12 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import
'TopList.dart'
;
class
TopPage
extends
StatefulWidget
{
String
rank_type
;
TopPage
(
Map
<
String
,
dynamic
>
map
)
{
this
.
rank_type
=
map
[
"rank_type"
];
}
@override
State
<
StatefulWidget
>
createState
()
=>
TopPageState
();
}
...
...
@@ -35,6 +41,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override
void
initState
()
{
_model
.
rank_type
=
widget
.
rank_type
;
init
();
super
.
initState
();
}
...
...
@@ -136,8 +143,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
List
<
Widget
>
list
=
[];
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
for
(
int
i
=
0
;
i
<
_model
.
tabs
.
length
;
i
++)
{
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
Key
(
"Tab
${i}
"
),
TopList
(
_model
.
tabs
[
i
].
id
,
kToolbarHeight
+
d
)));
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
Key
(
"Tab
${i}
"
),
TopList
(
_model
.
tabs
[
i
].
id
,
kToolbarHeight
+
d
)));
}
return
extend
.
NestedScrollView
(
innerScrollPositionKeyBuilder:
()
{
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
e2a5006b
...
...
@@ -6,9 +6,11 @@ import 'package:flutter_common/Annotations/anno/Get.dart';
import
'package:flutter_common/Annotations/anno/Post.dart'
;
import
'package:flutter_common/Annotations/anno/Query.dart'
;
import
'package:flutter_common/Annotations/anno/ServiceCenter.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ConsultQuestionsBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanConsultBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
...
...
@@ -47,6 +49,13 @@ abstract class ClueApi {
@Query
(
"page"
)
int
page
,
);
@Get
(
"/api/janus/plans/consult_questions"
)
ConsultQuestionsBean
getConsultQuestions
(
@Query
(
"plan_id"
)
int
plan_id
);
@Post
(
"api/janus/plans/plan_consult"
)
PlanConsultBean
sendMessage
(
@Query
(
"doctor_ids"
)
List
<
int
>
doctor_ids
,
@Query
(
"question"
)
String
question
,
@Query
(
"plan_id"
)
int
plan_id
);
@Get
(
"api/janus/plans/rank"
)
PlanBarBean
getPlanBar
(
@Query
(
"rank_type"
)
String
rank_type
);
...
...
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
e2a5006b
...
...
@@ -20,6 +20,8 @@ import 'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ConsultQuestionsBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanConsultBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
...
...
@@ -143,6 +145,38 @@ class ClueApiImpl {
});
}
Stream
<
ConsultQuestionsBean
>
getConsultQuestions
(
Dio
_dio
,
int
plan_id
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'/api/janus/plans/consult_questions'
,
data:
{
'plan_id'
:
plan_id
,
})).
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Stream
.
fromFuture
(
compute
(
parseConsultQuestionsBean
,
value
.
toString
()));
}
else
{
throw
Exception
(
"--未知网络错误--"
);
}
});
}
Stream
<
PlanConsultBean
>
sendMessage
(
Dio
_dio
,
List
<
int
>
doctor_ids
,
String
question
,
int
plan_id
)
{
return
Stream
.
fromFuture
(
post
(
_dio
,
'api/janus/plans/plan_consult'
,
data:
{
'doctor_ids'
:
doctor_ids
,
'question'
:
question
,
'plan_id'
:
plan_id
,
})).
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Stream
.
fromFuture
(
compute
(
parsePlanConsultBean
,
value
.
toString
()));
}
else
{
throw
Exception
(
"--未知网络错误--"
);
}
});
}
Stream
<
PlanBarBean
>
getPlanBar
(
Dio
_dio
,
String
rank_type
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/rank'
,
data:
{
'rank_type'
:
rank_type
,
...
...
@@ -365,6 +399,14 @@ PlanFeedBean parsePlanFeedBean(String value) {
return
PlanFeedBean
.
fromJson
(
json
.
decode
(
value
));
}
ConsultQuestionsBean
parseConsultQuestionsBean
(
String
value
)
{
return
ConsultQuestionsBean
.
fromJson
(
json
.
decode
(
value
));
}
PlanConsultBean
parsePlanConsultBean
(
String
value
)
{
return
PlanConsultBean
.
fromJson
(
json
.
decode
(
value
));
}
PlanBarBean
parsePlanBarBean
(
String
value
)
{
return
PlanBarBean
.
fromJson
(
json
.
decode
(
value
));
}
...
...
lib/ClueModel/server/entity/ConsultQuestionsBean.dart
0 → 100644
View file @
e2a5006b
class
ConsultQuestionsBean
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
Data
data
;
ConsultQuestionsBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
ConsultQuestionsBean
.
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'
]
=
this
.
data
.
toJson
();
}
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
;
}
}
class
Data
{
List
<
String
>
questions
;
Data
({
this
.
questions
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
questions
=
json
[
'questions'
].
cast
<
String
>();
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'questions'
]
=
this
.
questions
;
return
data
;
}
}
lib/ClueModel/server/entity/PlanBean.dart
View file @
e2a5006b
...
...
@@ -10,14 +10,22 @@ class PlanBean {
UserType
userType
;
Data
data
;
PlanBean
({
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanBean
.
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
;
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
}
...
...
@@ -38,16 +46,14 @@ class PlanBean {
}
class
UserType
{
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
}
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
class
Data
{
...
...
@@ -61,19 +67,27 @@ class Data {
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'ranks'
]
!=
null
)
{
ranks
=
new
List
<
Ranks
>();
json
[
'ranks'
].
forEach
((
v
)
{
ranks
.
add
(
new
Ranks
.
fromJson
(
v
));
});
json
[
'ranks'
].
forEach
((
v
)
{
ranks
.
add
(
new
Ranks
.
fromJson
(
v
));
});
}
if
(
json
[
'areas'
]
!=
null
)
{
areas
=
new
List
<
Areas
>();
json
[
'areas'
].
forEach
((
v
)
{
areas
.
add
(
new
Areas
.
fromJson
(
v
));
});
json
[
'areas'
].
forEach
((
v
)
{
areas
.
add
(
new
Areas
.
fromJson
(
v
));
});
}
if
(
json
[
'tags'
]
!=
null
)
{
tags
=
new
List
<
Tags
>();
json
[
'tags'
].
forEach
((
v
)
{
tags
.
add
(
new
Tags
.
fromJson
(
v
));
});
json
[
'tags'
].
forEach
((
v
)
{
tags
.
add
(
new
Tags
.
fromJson
(
v
));
});
}
if
(
json
[
'orders'
]
!=
null
)
{
orders
=
new
List
<
Orders
>();
json
[
'orders'
].
forEach
((
v
)
{
orders
.
add
(
new
Orders
.
fromJson
(
v
));
});
json
[
'orders'
].
forEach
((
v
)
{
orders
.
add
(
new
Orders
.
fromJson
(
v
));
});
}
}
...
...
@@ -96,6 +110,7 @@ class Data {
}
class
Ranks
{
int
id
;
String
name
;
String
gmUrl
;
String
icon
;
...
...
@@ -103,6 +118,7 @@ class Ranks {
Ranks
({
this
.
name
,
this
.
gmUrl
,
this
.
icon
});
Ranks
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
name
=
json
[
'name'
];
gmUrl
=
json
[
'gm_url'
];
icon
=
json
[
'icon'
];
...
...
@@ -111,6 +127,7 @@ class Ranks {
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'name'
]
=
this
.
name
;
data
[
'id'
]
=
this
.
id
;
data
[
'gm_url'
]
=
this
.
gmUrl
;
data
[
'icon'
]
=
this
.
icon
;
return
data
;
...
...
@@ -129,7 +146,9 @@ class Areas {
name
=
json
[
'name'
];
if
(
json
[
'groups'
]
!=
null
)
{
groups
=
new
List
<
Groups
>();
json
[
'groups'
].
forEach
((
v
)
{
groups
.
add
(
new
Groups
.
fromJson
(
v
));
});
json
[
'groups'
].
forEach
((
v
)
{
groups
.
add
(
new
Groups
.
fromJson
(
v
));
});
}
}
...
...
@@ -157,7 +176,9 @@ class Groups {
initial
=
json
[
'initial'
];
if
(
json
[
'cities'
]
!=
null
)
{
cities
=
new
List
<
Cities
>();
json
[
'cities'
].
forEach
((
v
)
{
cities
.
add
(
new
Cities
.
fromJson
(
v
));
});
json
[
'cities'
].
forEach
((
v
)
{
cities
.
add
(
new
Cities
.
fromJson
(
v
));
});
}
title
=
json
[
'title'
];
}
...
...
@@ -207,7 +228,9 @@ class Tags {
id
=
json
[
'id'
].
toString
();
if
(
json
[
'sub_tags'
]
!=
null
)
{
subTags
=
new
List
<
SubTags
>();
json
[
'sub_tags'
].
forEach
((
v
)
{
subTags
.
add
(
new
SubTags
.
fromJson
(
v
));
});
json
[
'sub_tags'
].
forEach
((
v
)
{
subTags
.
add
(
new
SubTags
.
fromJson
(
v
));
});
}
name
=
json
[
'name'
];
}
...
...
@@ -260,4 +283,3 @@ class Orders {
return
data
;
}
}
lib/ClueModel/server/entity/PlanConsultBean.dart
0 → 100644
View file @
e2a5006b
class
PlanConsultBean
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
Data
data
;
PlanConsultBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanConsultBean
.
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'
]
=
this
.
data
.
toJson
();
}
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
;
}
}
class
Data
{
bool
success
;
Data
({
this
.
success
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
success
=
json
[
'success'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'success'
]
=
this
.
success
;
return
data
;
}
}
lib/ClueModel/server/entity/PlanOverviewBean.dart
0 → 100644
View file @
e2a5006b
/*
* @author lsy
* @date 2020/7/3
**/
class
PlanOverViewBean
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
PlanOverData
data
;
PlanOverViewBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanOverViewBean
.
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
PlanOverData
.
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'
]
=
this
.
data
.
toJson
();
}
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
;
}
}
class
PlanOverData
{
Banner
banner
;
String
name
;
String
positiveRate
;
String
salesCount
;
String
planDescription
;
String
guidePrice
;
List
<
OverviewAttrs
>
overviewAttrs
;
List
<
ExplanationAttrs
>
explanationAttrs
;
List
<
Tabs
>
tabs
;
PlanOverData
(
{
this
.
banner
,
this
.
name
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
planDescription
,
this
.
guidePrice
,
this
.
overviewAttrs
,
this
.
explanationAttrs
,
this
.
tabs
});
PlanOverData
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
banner
=
json
[
'banner'
]
!=
null
?
new
Banner
.
fromJson
(
json
[
'banner'
])
:
null
;
name
=
json
[
'name'
];
positiveRate
=
json
[
'positive_rate'
];
salesCount
=
json
[
'sales_count'
];
planDescription
=
json
[
'plan_description'
];
guidePrice
=
json
[
'guide_price'
];
if
(
json
[
'overview_attrs'
]
!=
null
)
{
overviewAttrs
=
new
List
<
OverviewAttrs
>();
json
[
'overview_attrs'
].
forEach
((
v
)
{
overviewAttrs
.
add
(
new
OverviewAttrs
.
fromJson
(
v
));
});
}
if
(
json
[
'explanation_attrs'
]
!=
null
)
{
explanationAttrs
=
new
List
<
ExplanationAttrs
>();
json
[
'explanation_attrs'
].
forEach
((
v
)
{
explanationAttrs
.
add
(
new
ExplanationAttrs
.
fromJson
(
v
));
});
}
if
(
json
[
'tabs'
]
!=
null
)
{
tabs
=
new
List
<
Tabs
>();
json
[
'tabs'
].
forEach
((
v
)
{
tabs
.
add
(
new
Tabs
.
fromJson
(
v
));
});
}
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
banner
!=
null
)
{
data
[
'banner'
]
=
this
.
banner
.
toJson
();
}
data
[
'name'
]
=
this
.
name
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
data
[
'plan_description'
]
=
this
.
planDescription
;
data
[
'guide_price'
]
=
this
.
guidePrice
;
if
(
this
.
overviewAttrs
!=
null
)
{
data
[
'overview_attrs'
]
=
this
.
overviewAttrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
if
(
this
.
explanationAttrs
!=
null
)
{
data
[
'explanation_attrs'
]
=
this
.
explanationAttrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
if
(
this
.
tabs
!=
null
)
{
data
[
'tabs'
]
=
this
.
tabs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
}
class
Banner
{
String
type
;
String
imageUrl
;
String
videoUrl
;
Banner
({
this
.
type
,
this
.
imageUrl
,
this
.
videoUrl
});
Banner
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
type
=
json
[
'type'
];
imageUrl
=
json
[
'image_url'
];
videoUrl
=
json
[
'video_url'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'type'
]
=
this
.
type
;
data
[
'image_url'
]
=
this
.
imageUrl
;
data
[
'video_url'
]
=
this
.
videoUrl
;
return
data
;
}
}
class
OverviewAttrs
{
int
attrId
;
String
attrName
;
String
attrValue
;
OverviewAttrs
({
this
.
attrId
,
this
.
attrName
,
this
.
attrValue
});
OverviewAttrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrId
=
json
[
'attr_id'
];
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_id'
]
=
this
.
attrId
;
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
}
}
class
Tabs
{
String
tabType
;
String
name
;
Tabs
({
this
.
tabType
,
this
.
name
});
Tabs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
tabType
=
json
[
'tab_type'
];
name
=
json
[
'name'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'tab_type'
]
=
this
.
tabType
;
data
[
'name'
]
=
this
.
name
;
return
data
;
}
}
class
ExplanationAttrs
{
int
attrId
;
String
attrName
;
String
attrValue
;
ExplanationAttrs
({
this
.
attrId
,
this
.
attrName
,
this
.
attrValue
});
ExplanationAttrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrId
=
json
[
'attr_id'
];
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_id'
]
=
this
.
attrId
;
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
}
}
lib/MainRouter/manager/JumpManager.dart
View file @
e2a5006b
...
...
@@ -6,6 +6,8 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_common/commonModel/util/JumpUtil.dart'
;
import
'package:gm_flutter/MainRouter/manager/MainManager.dart'
;
import
'package:gm_flutter/commonModel/App.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
class
JumpManager
{
...
...
@@ -25,6 +27,8 @@ class JumpManager {
String
pageNameWrap
=
nativePage
?
"gm://
${pageName}
"
:
"flutter://
${pageName}
"
;
if
(!
MainManager
.
getInstance
().
isInit
)
{
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
save
(
COOKIE
,
"_gtid=3123e178b91a11eaa2d87e40d376ac134112; sessionid=pq9wf8equ4h26ia3yspzmquqn2rjs6mx; _gm_token=4091a81593419225"
);
JumpUtil
.
jumpToPageRight
(
context
,
initMap
(
params
)[
pageNameWrap
]);
}
else
{
FlutterBoost
.
singleton
.
open
(
pageName
,
urlParams:
params
);
...
...
@@ -35,6 +39,12 @@ class JumpManager {
return
{
"flutter://clueLevelOne"
:
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
),
"flutter://clueProjectDetails"
:
RouterCenterImpl
().
findClueRouter
().
getProjectDetailsPage
(
params
),
"flutter://cluePlansCompareFeed"
:
RouterCenterImpl
().
findClueRouter
().
getPlansCompareFeed
(
params
),
"flutter://cluePlan"
:
RouterCenterImpl
().
findClueRouter
().
getPlanPage
(),
"flutter://clueTop"
:
RouterCenterImpl
().
findClueRouter
().
getTopPage
(
params
),
};
}
}
lib/MainRouter/page/test/TestPage.dart
View file @
e2a5006b
...
...
@@ -51,15 +51,21 @@ class TestState extends BaseState<TestPage> {
}));
list
.
add
(
listItem
(
"项目说明"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getProjectDetailsPage
());
context
,
RouterCenterImpl
()
.
findClueRouter
()
.
getProjectDetailsPage
({
"planId"
:
1
}));
}));
list
.
add
(
listItem
(
"方案对比"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getPlansCompareFeed
());
context
,
RouterCenterImpl
()
.
findClueRouter
()
.
getPlansCompareFeed
({
"planId"
:
1
,
"planType"
:
1
}));
}));
list
.
add
(
listItem
(
"榜单"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getTopPage
(
));
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getTopPage
({
"rank_type"
:
"0"
}
));
}));
list
.
add
(
listItem
(
"弹窗"
,
()
{
DiscussLowPricePopView
.
showPopView
(
context
);
...
...
lib/commonModel/base/BaseComponent.dart
View file @
e2a5006b
...
...
@@ -144,11 +144,11 @@ Widget loadingItem({bool needBackground = false}) {
Widget
netErrorItem
(
)
{}
Widget
errorItem
(
double
width
,
double
height
,
VoidCallback
retry
,
{
String
errorText
,
String
retryText
,
double
paddingTop
})
{
{
String
errorText
,
String
retryText
,
double
paddingTop
})
{
return
Container
(
width:
width
,
height:
height
,
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
alignment:
Alignment
.
topCenter
,
child:
Container
(
width:
180
,
...
...
@@ -377,46 +377,46 @@ Widget normalRefreshHeader() {
);
}
Widget
emptyItem
(
double
width
,
double
height
,
{
String
detail
,
double
paddingTop
})
{
Widget
emptyItem
(
double
width
,
double
height
,
{
String
detail
,
double
paddingTop
})
{
return
Container
(
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
width:
width
,
height:
height
,
color:
Colors
.
white
,
alignment:
Alignment
.
topCenter
,
child:
Container
(
width:
175
,
height:
188
,
margin:
EdgeInsets
.
only
(
top:
62.5
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Container
(
width:
175
,
height:
188
,
child:
Stack
(
alignment:
AlignmentDirectional
.
bottomCenter
,
children:
<
Widget
>[
Container
(
width:
175
,
height:
188
,
child:
Image
.
asset
(
"assets/empty.png"
),
),
Positioned
(
bottom:
17
,
child:
baseText
(
detail
??
"此处太寂寥,转转别处吧"
,
15
,
Color
(
0xff666666
)),
)
],
width:
175
,
height:
188
,
margin:
EdgeInsets
.
only
(
top:
62.5
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Container
(
width:
175
,
height:
188
,
child:
Stack
(
alignment:
AlignmentDirectional
.
bottomCenter
,
children:
<
Widget
>[
Container
(
width:
175
,
height:
188
,
child:
Image
.
asset
(
"assets/empty.png"
),
),
Positioned
(
bottom:
17
,
child:
baseText
(
detail
??
"此处太寂寥,转转别处吧"
,
15
,
Color
(
0xff666666
)),
)
],
),
),
),
Container
(
height:
0
,
color:
Colors
.
white
,
)
],
)
),
Container
(
height:
0
,
color:
Colors
.
white
,
)
],
)),
);
}
...
...
@@ -453,7 +453,8 @@ Widget baseTabBarItem(String text,
);
}
Widget
baseSliverAppBar
(
String
url
,
{
double
height
,
double
elevation
})
{
Widget
baseSliverAppBar
(
String
url
,
{
double
height
,
double
elevation
,
bool
needpic
=
true
})
{
return
SliverAppBar
(
pinned:
true
,
centerTitle:
true
,
...
...
@@ -461,10 +462,12 @@ Widget baseSliverAppBar(String url, {double height, double elevation}) {
expandedHeight:
height
??
200
,
automaticallyImplyLeading:
false
,
flexibleSpace:
FlexibleSpaceBar
(
background:
Image
.
network
(
url
??
''
,
fit:
BoxFit
.
cover
,
),
background:
needpic
?
Image
.
network
(
url
??
''
,
fit:
BoxFit
.
cover
,
)
:
Container
(),
),
);
}
...
...
@@ -510,7 +513,8 @@ Widget baseSliverTitle(String text, double width, LiveData liveData) {
}
Widget
baseStateView
(
double
width
,
double
height
,
LiveData
<
int
>
stateLive
,
Widget
home
,
VoidCallback
retry
,{
double
paddingTop
})
{
Widget
home
,
VoidCallback
retry
,
{
double
paddingTop
})
{
return
StreamBuilder
(
stream:
stateLive
.
stream
,
initialData:
stateLive
.
data
??
LOADING
,
...
...
@@ -518,9 +522,9 @@ Widget baseStateView(double width, double height, LiveData<int> stateLive,
if
(
data
.
data
==
LOADING
)
{
return
loadingItem
();
}
else
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
width
,
height
,
retry
,
paddingTop:
paddingTop
);
return
errorItem
(
width
,
height
,
retry
,
paddingTop:
paddingTop
);
}
else
if
(
data
.
data
==
EMPTY
)
{
return
emptyItem
(
width
,
height
,
paddingTop:
paddingTop
);
return
emptyItem
(
width
,
height
,
paddingTop:
paddingTop
);
}
return
home
;
},
...
...
lib/main.dart
View file @
e2a5006b
...
...
@@ -58,12 +58,16 @@ class MyApp extends State<MyAppWidget> {
void
initState
()
{
super
.
initState
();
FlutterBoost
.
singleton
.
registerPageBuilders
({
'clueLevelOne'
:
(
pageName
,
params
,
_
)
{
return
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
);
},
'demoPage1'
:
(
pageName
,
params
,
_
)
{
return
DemoPage1
();
},
'clueLevelOne'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
),
'clueProjectDetails'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getProjectDetailsPage
(
params
),
'cluePlansCompareFeed'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getPlansCompareFeed
(
params
),
'cluePlan'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getPlanPage
(),
'clueTop'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getTopPage
(
params
),
});
FlutterBoost
.
singleton
.
addBoostContainerLifeCycleObserver
((
state
,
settings
)
{
...
...
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