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
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1423 additions
and
846 deletions
+1423
-846
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
+377
-435
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+259
-160
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';
...
@@ -10,9 +10,9 @@ import 'package:gm_flutter/ClueModel/ClueRouterImpl.dart';
@Router
(
"ClueRouter"
,
ClueRouterImpl
,
true
)
@Router
(
"ClueRouter"
,
ClueRouterImpl
,
true
)
abstract
class
ClueRouter
implements
RouterBaser
{
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
);
Widget
getLevelOnePage
(
Map
<
String
,
dynamic
>
params
);
...
@@ -22,5 +22,5 @@ abstract class ClueRouter implements RouterBaser {
...
@@ -22,5 +22,5 @@ abstract class ClueRouter implements RouterBaser {
Widget
getPlanCompareDetailPage
(
Map
<
String
,
dynamic
>
params
);
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 @@
...
@@ -5,18 +5,18 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:gm_flutter/ClueModel/ClueRouter.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/PlansCompareFeed/PlansCompareFeedPage.dart'
;
import
'package:gm_flutter/ClueModel/page/ProjectDetails/ProjectDetailsPage.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/levelOne/LevelOnePage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.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/plan/PlanPage.dart'
;
import
'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopPage.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopPage.dart'
;
class
ClueRouterImpl
implements
ClueRouter
{
class
ClueRouterImpl
implements
ClueRouter
{
@override
@override
Widget
getProjectDetailsPage
()
{
Widget
getProjectDetailsPage
(
Map
<
String
,
dynamic
>
params
)
{
return
ProjectDetailsPage
(
1
);
return
ProjectDetailsPage
(
params
);
}
}
@override
@override
...
@@ -30,8 +30,8 @@ class ClueRouterImpl implements ClueRouter {
...
@@ -30,8 +30,8 @@ class ClueRouterImpl implements ClueRouter {
}
}
@override
@override
Widget
getPlansCompareFeed
()
{
Widget
getPlansCompareFeed
(
Map
<
String
,
dynamic
>
params
)
{
return
PlansCompareFeedPage
(
123
,
1
);
return
PlansCompareFeedPage
(
params
);
}
}
@override
@override
...
@@ -45,7 +45,7 @@ class ClueRouterImpl implements ClueRouter {
...
@@ -45,7 +45,7 @@ class ClueRouterImpl implements ClueRouter {
}
}
@override
@override
Widget
getTopPage
()
{
Widget
getTopPage
(
Map
<
String
,
dynamic
>
params
)
{
return
TopPage
();
return
TopPage
(
params
);
}
}
}
}
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
e2a5006b
...
@@ -20,11 +20,9 @@ class PlansCompareFeedItemView extends StatefulWidget {
...
@@ -20,11 +20,9 @@ class PlansCompareFeedItemView extends StatefulWidget {
class
_PlansCompareFeedItemViewState
class
_PlansCompareFeedItemViewState
extends
BaseState
<
PlansCompareFeedItemView
>
{
extends
BaseState
<
PlansCompareFeedItemView
>
{
ImageIcon
_checked
=
ImageIcon
(
AssetImage
(
"assets/icon_compare_select.png"
));
String
_checked
=
"assets/icon_compare_select.png"
;
String
_unchecked
=
"assets/icon_compare_unselect.png"
;
ImageIcon
_unchecked
=
String
_icon
=
"assets/icon_compare_unselect.png"
;
ImageIcon
(
AssetImage
(
"assets/icon_compare_unselect.png"
));
ImageIcon
_icon
=
ImageIcon
(
AssetImage
(
"assets/icon_compare_unselect.png"
));
@override
@override
Widget
buildItem
(
BuildContext
context
)
{
Widget
buildItem
(
BuildContext
context
)
{
...
@@ -48,10 +46,19 @@ class _PlansCompareFeedItemViewState
...
@@ -48,10 +46,19 @@ class _PlansCompareFeedItemViewState
padding:
EdgeInsets
.
only
(
top:
20
,
bottom:
20
),
padding:
EdgeInsets
.
only
(
top:
20
,
bottom:
20
),
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
IconButton
(
GestureDetector
(
icon:
_icon
,
behavior:
HitTestBehavior
.
opaque
,
onPressed:
()
=>
onClickCheckBox
(
_icon
),
onTap:
()
=>
onClickCheckBox
(
_icon
),
),
child:
Container
(
alignment:
Alignment
.
center
,
child:
ClipRRect
(
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
)),
)),
Container
(
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
ClipRRect
(
child:
ClipRRect
(
...
@@ -64,29 +71,33 @@ class _PlansCompareFeedItemViewState
...
@@ -64,29 +71,33 @@ class _PlansCompareFeedItemViewState
),
),
),
),
),
),
Container
(
Expanded
(
height:
50
,
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
margin:
EdgeInsets
.
only
(
top:
2
,
bottom:
5
),
margin:
EdgeInsets
.
only
(
top:
2
,
bottom:
8
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
children:
<
Widget
>[
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
bold:
true
),
bold:
true
),
baseText
(
" 好评率 "
,
11
,
Color
(
0xFF282828
)),
Row
(
children:
<
Widget
>[
baseText
(
widget
.
plan
.
positiveRate
,
14
,
Color
(
0xFFFF5963
),
baseText
(
"好评率 "
,
11
,
Color
(
0xFF282828
)),
bold:
true
),
baseText
(
widget
.
plan
.
positiveRate
,
14
,
Color
(
0xFFFF5963
),
bold:
true
)
]),
],
],
),
),
),
),
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
children:
<
Widget
>[
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
13
,
Color
(
0xFFFF5963
)),
13
,
Color
(
0xFFFF5963
)),
baseText
(
" 销量
${widget.plan.salesCount}
"
,
11
,
baseText
(
Color
(
0xFF282828
))
"销量
${widget.plan.salesCount}
"
,
11
,
Color
(
0xFF282828
))
],
],
)
)
],
],
...
@@ -105,38 +116,47 @@ class _PlansCompareFeedItemViewState
...
@@ -105,38 +116,47 @@ class _PlansCompareFeedItemViewState
Container
(
Container
(
margin:
EdgeInsets
.
only
(
right:
15.0
),
margin:
EdgeInsets
.
only
(
right:
15.0
),
alignment:
Alignment
.
centerLeft
,
alignment:
Alignment
.
centerLeft
,
child:
IconButton
(
child:
GestureDetector
(
icon:
_icon
,
behavior:
HitTestBehavior
.
opaque
,
onPressed:
()
=>
onClickCheckBox
(
_icon
),
onTap:
()
=>
onClickCheckBox
(
_icon
),
),
child:
Container
(
alignment:
Alignment
.
center
,
child:
ClipRRect
(
child:
Image
.
asset
(
_icon
,
width:
17
,
height:
17
,
fit:
BoxFit
.
fill
,
)),
)),
),
),
Column
(
Expanded
(
c
rossAxisAlignment:
CrossAxisAlignment
.
start
,
c
hild:
Column
(
children:
<
Widget
>[
crossAxisAlignment:
CrossAxisAlignment
.
start
,
Container
(
children:
<
Widget
>[
margin:
EdgeInsets
.
only
(
top:
13.0
,
bottom:
12
),
Container
(
child:
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
margin:
EdgeInsets
.
only
(
top:
13.0
,
bottom:
12
),
bold:
true
),
child:
baseText
(
widget
.
plan
.
name
,
14
,
Color
(
0xFF282828
),
),
bold:
true
),
Row
(
),
children:
<
Widget
>[
Row
(
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
13
,
Color
(
0xFFFF5963
)),
children:
<
Widget
>[
Container
(
baseText
(
'¥
${widget.plan.minPrice}
-
${widget.plan.maxPrice}
'
,
width:
160
,
13
,
Color
(
0xFFFF5963
))
,
alignment:
Alignment
.
centerRight
,
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
child:
baseText
(
"指导价:¥
${widget.plan.guidePrice}
"
,
11
,
Color
(
0xFF282828
))
,
Color
(
0xFF282828
)))
,
]
,
]
,
)
,
)
,
]
,
]
,
)
,
)
)
],
],
),
),
);
);
}
}
onClickCheckBox
(
ImageIcon
icon
)
{
onClickCheckBox
(
String
icon
)
{
if
(
icon
==
_checked
)
{
if
(
icon
==
_checked
)
{
_icon
=
_unchecked
;
_icon
=
_unchecked
;
}
else
{
}
else
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
e2a5006b
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
**/
**/
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.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/page/PlansCompareFeed/PlansCompareFeedModel.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
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/main.mark.dart'
;
import
'CallBackCompareItem.dart'
;
import
'CallBackCompareItem.dart'
;
import
'PlansCompareFeedItemView.dart'
;
import
'PlansCompareFeedItemView.dart'
;
...
@@ -18,7 +18,10 @@ class PlansCompareFeedPage extends StatefulWidget {
...
@@ -18,7 +18,10 @@ class PlansCompareFeedPage extends StatefulWidget {
int
_planType
;
int
_planType
;
int
_planId
;
int
_planId
;
PlansCompareFeedPage
(
this
.
_planType
,
this
.
_planId
);
PlansCompareFeedPage
(
Map
<
String
,
dynamic
>
params
)
{
this
.
_planType
=
params
[
"planType"
];
this
.
_planId
=
params
[
"planId"
];
}
@override
@override
State
<
StatefulWidget
>
createState
()
=>
_PlansCompareFeedState
();
State
<
StatefulWidget
>
createState
()
=>
_PlansCompareFeedState
();
...
@@ -75,7 +78,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
...
@@ -75,7 +78,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
}
}
if
(
item
.
error
!=
0
)
{
if
(
item
.
error
!=
0
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
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
);
return
getList
(
item
.
data
.
plans
);
},
},
...
@@ -107,9 +112,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
...
@@ -107,9 +112,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
onClickCompare
()
{
onClickCompare
()
{
if
(
_compareColor
==
Color
(
0xFFCCCCCC
))
return
;
if
(
_compareColor
==
Color
(
0xFFCCCCCC
))
return
;
setState
(()
{
setState
(()
{
Map
<
String
,
dynamic
>
map
=
{};
RouterCenterImpl
()
map
[
"ids"
]
=
_setCompare
;
.
findMainRouter
()
FlutterBoost
.
singleton
.
open
(
"sample"
,
urlParams:
map
);
.
jumpPage
(
context
,
"pageName"
,
{
"ids"
:
_setCompare
},
false
);
});
});
}
}
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
e2a5006b
...
@@ -15,7 +15,9 @@ import '../../server/entity/ProjectDetailsItem.dart';
...
@@ -15,7 +15,9 @@ import '../../server/entity/ProjectDetailsItem.dart';
class
ProjectDetailsPage
extends
StatefulWidget
{
class
ProjectDetailsPage
extends
StatefulWidget
{
int
_planId
;
int
_planId
;
ProjectDetailsPage
(
this
.
_planId
);
ProjectDetailsPage
(
Map
<
String
,
dynamic
>
params
)
{
this
.
_planId
=
params
[
"planId"
];
}
@override
@override
State
<
StatefulWidget
>
createState
()
=>
_ProjectDetailsState
();
State
<
StatefulWidget
>
createState
()
=>
_ProjectDetailsState
();
...
@@ -62,24 +64,14 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
...
@@ -62,24 +64,14 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
}
}
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
)
{
return
emptyItem
(
MediaQuery
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
.
of
(
context
)
MediaQuery
.
of
(
context
).
size
.
height
);
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
);
}
}
if
(
item
.
error
!=
0
)
{
if
(
item
.
error
!=
0
)
{
return
errorItem
(
MediaQuery
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
.
of
(
context
)
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
.
size
_model
.
init
(
widget
.
_planId
);
.
width
,
});
MediaQuery
.
of
(
context
)
.
size
.
height
,
()
{});
}
}
return
ListView
.
builder
(
return
ListView
.
builder
(
itemCount:
item
.
data
.
groups
.
length
,
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 {
...
@@ -25,7 +25,7 @@ class LevelOneList extends StatefulWidget {
}
}
class
LevelOneListState
extends
State
<
LevelOneList
>
class
LevelOneListState
extends
State
<
LevelOneList
>
with
AutomaticKeepAliveClientMixin
{
with
AutomaticKeepAliveClientMixin
{
LevelOneListModel
_model
=
LevelOneListModel
();
LevelOneListModel
_model
=
LevelOneListModel
();
RefreshController
refreshController
=
RefreshController
();
RefreshController
refreshController
=
RefreshController
();
...
@@ -83,7 +83,7 @@ class LevelOneListState extends State<LevelOneList>
...
@@ -83,7 +83,7 @@ class LevelOneListState extends State<LevelOneList>
return
SliverList
(
return
SliverList
(
delegate:
SliverChildBuilderDelegate
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
{
(
BuildContext
context
,
int
index
)
{
if
(
index
==
_model
.
data
.
length
)
{
if
(
index
==
_model
.
data
.
length
)
{
return
Container
(
return
Container
(
height:
40
,
height:
40
,
color:
Color
(
0xffF7F6FA
),
color:
Color
(
0xffF7F6FA
),
...
@@ -93,7 +93,7 @@ class LevelOneListState extends State<LevelOneList>
...
@@ -93,7 +93,7 @@ class LevelOneListState extends State<LevelOneList>
,
lowPrice:
(){
,
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 {
...
@@ -24,6 +24,7 @@ class LevelOneModel extends BaseModel {
List
<
Tabs
>
tabsList
=
[];
List
<
Tabs
>
tabsList
=
[];
int
plan_id
=
0
;
int
plan_id
=
0
;
PlanOverData
planoverItem
;
PlanOverData
planoverItem
;
String
imageUrl
=
""
;
void
init
(
VoidCallback
callback
)
{
void
init
(
VoidCallback
callback
)
{
ClueApiImpl
.
getInstance
()
ClueApiImpl
.
getInstance
()
...
@@ -31,6 +32,7 @@ class LevelOneModel extends BaseModel {
...
@@ -31,6 +32,7 @@ class LevelOneModel extends BaseModel {
.
listen
((
event
)
{
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
if
(
event
.
error
==
0
)
{
planoverItem
=
event
.
data
;
planoverItem
=
event
.
data
;
imageUrl
=
event
.
data
.
banner
.
imageUrl
;
tabsList
=
event
.
data
.
tabs
;
tabsList
=
event
.
data
.
tabs
;
stateLive
.
notifyView
(
ENDLOADING
);
stateLive
.
notifyView
(
ENDLOADING
);
callback
();
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'
...
@@ -10,18 +10,13 @@ import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
as
extend
;
as
extend
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.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/LevelOneList.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneModel.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/GMBase.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
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/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.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/commonModel/view/baseRefreshIndicator.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
@@ -54,9 +49,6 @@ class LevelOneState extends BaseState<LevelOnePage>
...
@@ -54,9 +49,6 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
@override
void
initState
()
{
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
();
super
.
initState
();
_model
.
plan_id
=
widget
.
planId
;
_model
.
plan_id
=
widget
.
planId
;
_model
.
init
(()
{
_model
.
init
(()
{
...
@@ -192,8 +184,7 @@ class LevelOneState extends BaseState<LevelOnePage>
...
@@ -192,8 +184,7 @@ class LevelOneState extends BaseState<LevelOnePage>
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
context
),
sliver:
baseSliverAppBar
(
sliver:
baseSliverAppBar
(
// _model.imageUrl
_model
.
imageUrl
)),
"https://pic.igengmei.com/2018/09/11/1513/b7e825a4e4c1-w"
)),
SliverList
(
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
...
...
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
View file @
e2a5006b
...
@@ -5,96 +5,52 @@
...
@@ -5,96 +5,52 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.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/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/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.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
{
class
LevelOneModel
extends
BaseModel
{
LiveData
<
double
>
appBarLive
=
LiveData
();
LiveData
<
int
>
stateLive
=
LiveData
();
LiveData
<
List
<
String
>>
rectLive
=
LiveData
();
LiveData
<
double
>
textLive
=
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
];
void
refreshView
(
bool
clear
,
{
RefreshController
refreshListener
})
{
RxDispose
rxDispose
=
RxDispose
();
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
;
}
cardsLive
.
notifyView
(
Pair
(
ENDLOADING
,
data
));
List
<
Tabs
>
tabsList
=
[];
});
int
plan_id
=
0
;
// int index = currentIndex;
PlanOverData
planoverItem
;
// if (clear) {
// data.clear();
void
init
(
VoidCallback
callback
)
{
// pageList = [1, 1, 1, 1];
ClueApiImpl
.
getInstance
()
// }
.
getPlanOverView
(
DioUtil
.
getInstance
().
getDio
(),
plan_id
)
// ClueApiImpl.getInstance()
.
listen
((
event
)
{
// .getLevelOneList(
if
(
event
.
error
==
0
)
{
// DioUtil.getInstance().getDio(), 123, list[index], pageList[index])
planoverItem
=
event
.
data
;
// .listen((event) {})
tabsList
=
event
.
data
.
tabs
;
// .addToDispose(rxDispose)
stateLive
.
notifyView
(
ENDLOADING
);
// .onError((err) {});
callback
();
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
stateLive
.
notifyView
(
FAIL
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
PrintUtil
.
printBug
(
err
);
stateLive
.
notifyView
(
FAIL
);
});
}
}
int
currentIndex
=
0
;
int
currentIndex
=
0
;
@override
@override
void
dispose
()
{
void
dispose
()
{
showTab
.
dispost
();
stateLive
.
dispost
();
cardsLive
.
dispost
();
textLive
.
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
]));
}
}
}
void
loadMore
(
)
{}
void
selectTab
(
int
index
)
{}
}
}
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
e2a5006b
/*
/*
* @author
dx
* @author
lsy
* @date
2020-06-
29
* @date
2020/6/
29
**/
**/
import
'dart:async'
;
import
'dart:math'
;
import
'dart:math'
;
import
'dart:ui'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
import
'package:flutter/gestures.dart'
;
as
extend
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneItem.dart'
;
import
'package:gm_flutter/ClueModel/page/common/StickyTabBarDelegate.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoModel.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/mechanismBox/MechanismBoxPage.dart'
;
import
'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/view/FiveStarView.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.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'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
class
LevelTwoPage
extends
StatefulWidget
{
class
LevelTwoPage
extends
StatefulWidget
{
@override
@override
_LevelTwoPageState
createState
()
=>
_LevelTwoPage
State
();
State
<
StatefulWidget
>
createState
()
=>
LevelTwo
State
();
}
}
class
_LevelTwoPageState
extends
BaseState
<
LevelTwoPage
>
class
LevelTwoState
extends
BaseState
<
LevelTwoPage
>
with
SingleTickerProviderStateMixin
{
with
TickerProviderStateMixin
{
LevelTwoModel
_model
=
new
LevelTwoModel
();
int
planId
=
10
;
LevelOneModel
_model
=
new
LevelOneModel
();
RefreshController
_refreshController
=
RefreshController
();
RefreshController
_refreshController
=
RefreshController
();
PageController
pageController
=
new
PageController
();
GlobalKey
keyTop
=
new
GlobalKey
();
GlobalKey
key1
=
new
GlobalKey
();
double
screenWidth
;
List
<
Widget
>
oneList
=
new
List
();
int
lastPageIndex
=
0
;
TabController
tabController
;
TabController
tabController
;
int
index
=
0
;
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
this
.
tabController
=
TabController
(
length:
2
,
vsync:
this
);
_model
.
init
(()
{
_initTabBar
();
});
}
void
_initTabBar
()
{
if
(
tabController
!=
null
)
{
tabController
.
removeListener
(
tabControlerListener
);
}
tabController
=
TabController
(
initialIndex:
index
,
length:
_model
.
tabsList
.
length
,
vsync:
this
);
tabController
.
addListener
(
tabControlerListener
);
setState
(()
{});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
tabController
?.
removeListener
(
tabControlerListener
);
tabController
?.
dispose
();
_model
.
dispose
();
_model
.
dispose
();
pageController
.
dispose
();
_refreshController
.
dispose
();
_refreshController
.
dispose
();
super
.
dispose
();
super
.
dispose
();
}
}
void
tabControlerListener
()
{
if
(
index
!=
tabController
.
index
)
{
index
=
tabController
.
index
;
}
}
@override
@override
Widget
buildItem
(
BuildContext
context
)
{
Widget
buildItem
(
BuildContext
context
)
{
oneList
.
clear
();
oneList
.
add
(
good
());
oneList
.
add
(
rect
());
oneList
.
add
(
explain
());
oneList
.
add
(
Container
(
height:
5
,
color:
Color
(
0xffF7F6FA
),
));
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
Scaffold
(
return
Scaffold
(
body:
Stack
(
backgroundColor:
Colors
.
white
,
body:
SafeArea
(
top:
false
,
child:
baseStateView
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
_model
.
stateLive
,
Container
(
child:
BaseNestedScrollViewRefreshIndicator
(
onRefresh:
()
async
{
Completer
completer
=
new
Completer
();
_model
.
init
(()
{
_initTabBar
();
SimpleEventBus
.
instance
()
.
notifyListener
(
"LevelOneList"
,
""
);
completer
.
complete
();
});
return
completer
.
future
;
},
child:
newHomeWarp
()),
),
()
{
_model
.
init
(()
{
_initTabBar
();
});
})));
}
Widget
newHomeWarp
()
{
return
Stack
(
children:
<
Widget
>[
children:
<
Widget
>[
CustomScrollView
(
slivers:
<
Widget
>[
Container
(
SliverAppBar
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
pinned:
true
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
elevation:
0
,
child:
NotificationListener
(
expandedHeight:
0
,
onNotification:
(
scrollNotification
)
{
flexibleSpace:
FlexibleSpaceBar
(
title:
Text
(
'二级方案'
)),
if
(
scrollNotification
is
KeepAliveNotification
||
),
scrollNotification
is
OverscrollIndicatorNotification
)
{
SliverToBoxAdapter
(
return
false
;
child:
Column
(
}
crossAxisAlignment:
CrossAxisAlignment
.
start
,
if
(
scrollNotification
is
ScrollUpdateNotification
&&
mainAxisSize:
MainAxisSize
.
max
,
scrollNotification
.
metrics
.
axisDirection
.
index
==
2
)
{}
children:
<
Widget
>[
good
(),
rect
(),
explain
()],
if
(
scrollNotification
.
depth
==
0
)
{
)),
if
(
scrollNotification
.
metrics
.
pixels
>
80
)
{
SliverPersistentHeader
(
_model
.
textLive
.
notifyView
(
pinned:
true
,
(
scrollNotification
.
metrics
.
pixels
-
80
)
/
40
>
1.0
delegate:
StickyTabBarDelegate
(
?
1.0
child:
baseTabBar
(
tabController
,
:
(
scrollNotification
.
metrics
.
pixels
-
80
)
/
40
);
[
baseTabBarItem
(
"医院"
),
baseTabBarItem
(
"医生"
)],
(
index
)
{},
}
else
{
scroll:
false
),
_model
.
textLive
.
notifyView
(
0.0
);
),
}
}
else
if
(
scrollNotification
.
depth
==
2
)
{
if
(
scrollNotification
.
metrics
.
pixels
<
50
&&
scrollNotification
.
metrics
.
pixels
>
0
)
{
_model
.
textLive
.
notifyView
(
1.0
);
}
}
return
false
;
},
child:
newHome
(),
)),
Positioned
(
top:
57
,
child:
Container
(
alignment:
Alignment
.
center
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
baseText
(
"文案"
,
18
,
Color
(
0xff333333
)),
),
),
SliverFillRemaining
(
),
child:
TabBarView
(
baseSliverBack
(()
{
controller:
this
.
tabController
,
Navigator
.
of
(
context
).
pop
();
children:
<
Widget
>[
pages
(),
pages
()]))
}),
]),
bottomWidget
()
Positioned
(
left:
0
,
right:
0
,
bottom:
0
,
child:
bottomWidget
())
],
],
)
)
;
);
}
}
Widget
good
()
{
Widget
newHome
()
{
return
StreamBuilder
(
List
<
Widget
>
list
=
[];
stream:
_model
.
rectLive
.
stream
,
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
initialData:
[
"w"
,
"w"
,
"q"
,
"w"
],
for
(
int
i
=
0
;
i
<
_model
.
tabsList
.
length
;
i
++)
{
builder:
(
context
,
data
)
{
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
return
Padding
(
Key
(
"Tab
${i}
"
),
padding:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
top:
8.0
),
LevelOneList
(
child:
Row
(
planId
,
_model
.
tabsList
[
i
].
tabType
,
kToolbarHeight
+
d
)));
crossAxisAlignment:
CrossAxisAlignment
.
start
,
}
mainAxisSize:
MainAxisSize
.
max
,
final
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
children:
<
Widget
>[
final
double
pinnedHeaderHeight
=
statusBarHeight
+
kToolbarHeight
;
ClipRRect
(
return
extend
.
NestedScrollView
(
borderRadius:
BorderRadius
.
circular
(
6
),
innerScrollPositionKeyBuilder:
()
{
String
index
=
'Tab
${tabController.index.toString()}
'
;
return
Key
(
index
);
},
headerSliverBuilder:
(
BuildContext
context
,
bool
innerBoxIsScrolled
)
{
return
<
Widget
>[
SliverOverlapAbsorber
(
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
sliver:
baseSliverAppBar
(
_model
.
imageUrl
,
height:
pinnedHeaderHeight
,
needpic:
false
)),
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
return
Container
(
height:
pinnedHeaderHeight
,
);
}
return
oneList
[
i
-
1
];
},
childCount:
oneList
.
length
+
1
)),
SliverPersistentHeader
(
pinned:
true
,
delegate:
StickyTabBarDelegate
(
child:
Container
(
child:
Container
(
decoration:
BoxDecoration
(
height:
40
,
borderRadius:
BorderRadius
.
circular
(
17
),
color:
Colors
.
white
,
border:
Border
.
all
(
color:
Color
(
0xffF9F8FB
),
width:
1
)),
child:
baseTabBar
(
tabController
,
getTabs
(),
(
index
)
{
child:
Image
.
network
(
_model
.
selectTab
(
index
);
'https://img1.gamersky.com/image2019/07/20190725_ll_red_136_2/gamersky_07small_14_201972510258D0.jpg'
,
},
scroll:
false
),
width:
86
,
)),
height:
86
,
),
fit:
BoxFit
.
cover
,
];
),
},
)),
body:
TabBarView
(
controller:
tabController
,
children:
list
));
Padding
(
}
padding:
EdgeInsets
.
only
(
left:
12
,
top:
5
),
child:
Column
(
List
<
Widget
>
getTabs
()
{
List
<
Widget
>
list
=
[];
for
(
int
i
=
0
;
i
<
_model
.
tabsList
.
length
;
i
++)
{
list
.
add
(
baseTabBarItem
(
_model
.
tabsList
[
i
].
name
,
leftPadding:
i
==
0
?
24
:
28
,
rightPadding:
i
==
_model
.
tabsList
.
length
-
1
?
24
:
28
));
}
return
list
;
}
Widget
good
()
{
if
(
_model
.
planoverItem
==
null
)
{
return
Container
(
height:
54
,
);
}
return
Padding
(
padding:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
top:
8.0
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
6
),
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
17
),
border:
Border
.
all
(
color:
Color
(
0xffF9F8FB
),
width:
1
)),
child:
Image
.
network
(
_model
.
planoverItem
.
banner
.
imageUrl
,
width:
86
,
height:
86
,
fit:
BoxFit
.
cover
,
),
)),
Padding
(
padding:
EdgeInsets
.
only
(
left:
12
,
top:
5
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Text
(
_model
.
planoverItem
.
name
,
style:
TextStyle
(
color:
Color
(
0xff333333
),
fontSize:
15
,
fontWeight:
FontWeight
.
bold
)),
Padding
(
padding:
EdgeInsets
.
only
(
top:
5
)),
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
max
,
verticalDirection:
VerticalDirection
.
up
,
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
'
乔雅登玻尿酸(药品类)
'
,
Text
(
'
指导价:
'
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xff333333
),
color:
Color
(
0xff999999
),
fontSize:
12
)),
fontSize:
15
,
Text
(
fontWeight:
FontWeight
.
bold
)),
'¥'
+
_model
.
planoverItem
.
guidePrice
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
5
)),
style:
Row
(
TextStyle
(
color:
Color
(
0xffFF5963
),
fontSize:
12
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
verticalDirection:
VerticalDirection
.
up
,
children:
<
Widget
>[
Text
(
'指导价:'
,
style:
TextStyle
(
color:
Color
(
0xff999999
),
fontSize:
12
)),
Text
(
'¥2000-5000'
,
style:
TextStyle
(
color:
Color
(
0xffFF5963
),
fontSize:
12
),
)
],
)
)
],
],
)
),
)
],
],
),
)
),
);
],
}
,
)
,
);
);
}
}
Widget
rect
()
{
Widget
rect
()
{
return
Padding
(
if
(
_model
.
planoverItem
==
null
)
{
padding:
EdgeInsets
.
only
(
top:
20
),
return
Container
(
child:
StreamBuilder
<
List
<
String
>>(
height:
62
,
stream:
_model
.
rectLive
.
stream
,
);
initialData:
[
"w"
,
"w"
,
"q"
,
"w"
,
"w"
,
"w"
,
"q"
,
"w"
],
}
builder:
(
c
,
data
)
{
List
<
Widget
>
list
=
List
();
List
<
Widget
>
list
=
List
();
int
i
=
0
;
for
(
int
i
=
0
;
i
<
data
.
data
.
length
;
i
+=
2
)
{
_model
.
planoverItem
.
overviewAttrs
.
forEach
((
element
)
{
list
.
add
(
Expanded
(
list
.
add
(
Expanded
(
child:
Container
(
child:
Container
(
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
children:
<
Widget
>[
baseText
(
data
.
data
[
i
],
14
,
Color
(
0xff282828
),
bold:
true
),
baseText
(
element
.
attrName
,
14
,
Color
(
0xff282828
),
bold:
true
),
baseText
(
data
.
data
[
i
+
1
],
11
,
Color
(
0xff999999
)),
baseText
(
element
.
attrValue
,
11
,
Color
(
0xff999999
)),
],
],
),
),
),
),
));
));
if
(
i
<
data
.
data
.
length
-
2
)
{
if
(
i
!=
_model
.
planoverItem
?.
overviewAttrs
.
length
-
1
)
{
list
.
add
(
Container
(
list
.
add
(
Container
(
width:
0.5
,
width:
0.5
,
height:
18
,
height:
18
,
color:
Color
(
0xFFE5E5E5
),
color:
Color
(
0xFFE5E5E5
),
));
));
}
}
}
i
++;
return
Container
(
});
decoration:
BoxDecoration
(
return
Container
(
borderRadius:
BorderRadius
.
circular
(
4
),
decoration:
BoxDecoration
(
color:
Color
(
0xffF9F8FB
),
borderRadius:
BorderRadius
.
circular
(
4
),
),
color:
Color
(
0xffF9F8FB
),
width:
double
.
maxFinite
,
),
height:
62
,
width:
double
.
maxFinite
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
bottom:
20
),
height:
62
,
child:
Row
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
bottom:
20
),
crossAxisAlignment:
CrossAxisAlignment
.
center
,
child:
Row
(
children:
list
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
),
children:
list
,
);
},
),
),
);
);
}
}
Widget
explain
()
{
Widget
explain
()
{
return
StreamBuilder
<
List
<
String
>>(
List
<
Widget
>
list
=
[];
stream:
_model
.
explainLive
.
stream
,
list
.
add
(
Container
(
initialData:
[
"www"
,
"www"
,
"www"
,
"??"
],
height:
31
,
builder:
(
c
,
data
)
{
child:
Row
(
List
<
Widget
>
list
=
[];
children:
<
Widget
>[
baseText
(
"项目说明"
,
15
,
Color
(
0xff282828
)),
Expanded
(
child:
Container
(),
),
GestureDetector
(
onTap:
()
{
//TODO
Map
<
String
,
dynamic
>
map
=
{};
map
[
"page_name"
]
=
"plan_home"
;
map
[
"referrer_link"
]
=
[];
RouterCenterImpl
()
.
findMainRouter
()
.
buriedEvent
(
"on_click_navbar_search"
,
map
);
},
behavior:
HitTestBehavior
.
opaque
,
child:
baseText
(
"了解更多"
,
12
,
Color
(
0xff3FB5AF
)),
)
],
),
));
if
(
_model
.
planoverItem
!=
null
)
{
_model
.
planoverItem
.
explanationAttrs
.
forEach
((
element
)
{
list
.
add
(
Container
(
list
.
add
(
Container
(
height:
31
,
height:
28
,
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
baseText
(
"项目说明"
,
15
,
Color
(
0xff282828
)),
baseText
(
element
.
attrName
,
13
,
Color
(
0xff999999
)),
Expanded
(
Container
(
child:
Container
(),
margin:
EdgeInsets
.
only
(
left:
12
),
),
child:
baseText
(
element
.
attrValue
,
13
,
Color
(
0xff666666
)),
GestureDetector
(
onTap:
()
{
//TODO
},
behavior:
HitTestBehavior
.
opaque
,
child:
baseText
(
"了解更多"
,
12
,
Color
(
0xff3FB5AF
)),
)
)
],
],
),
),
));
));
for
(
int
i
=
0
;
i
<
data
.
data
.
length
;
i
+=
2
)
{
});
list
.
add
(
Container
(
}
height:
28
,
child:
Row
(
children:
<
Widget
>[
baseText
(
data
.
data
[
i
],
13
,
Color
(
0xff999999
)),
Container
(
margin:
EdgeInsets
.
only
(
left:
12
),
child:
baseText
(
data
.
data
[
i
+
1
],
13
,
Color
(
0xff666666
)),
)
],
),
));
}
return
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
bottom:
20
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
list
,
),
);
},
);
}
Widget
bottomWidget
()
{
return
Container
(
return
Container
(
width:
double
.
maxFinite
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
bottom:
20
),
height:
55
,
child:
Column
(
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
list
,
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
left:
18
),
width:
30
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Container
(
width:
22
,
height:
22
,
child:
Image
.
asset
(
"assets/vs_black.png"
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
3
),
child:
baseText
(
"去比较"
,
10
,
Color
(
0xff282828
)),
)
],
),
),
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
{
BaseBottomPicker
()
..
setPicker
(
MechanismBox
())
..
show
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
15
),
width:
135
,
height:
40
,
decoration:
BoxDecoration
(
color:
Color
(
0xff51CDC7
),
borderRadius:
BorderRadius
.
circular
(
20
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"咨询"
,
14
,
Colors
.
white
,
bold:
true
),
)),
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
{},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
15
),
width:
135
,
height:
40
,
decoration:
BoxDecoration
(
color:
Color
(
0xffF96079
),
borderRadius:
BorderRadius
.
circular
(
20
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"获取底价"
,
14
,
Colors
.
white
,
bold:
true
),
)),
Expanded
(
child:
Container
(),
)
],
),
),
);
);
}
}
Widget
pages
()
{
// 底部按钮
return
Container
(
Widget
bottomWidget
()
{
margin:
EdgeInsets
.
only
(
top:
5
),
return
Align
(
width:
double
.
maxFinite
,
alignment:
Alignment
.
bottomCenter
,
child:
ListView
.
builder
(
child:
Container
(
physics:
NeverScrollableScrollPhysics
(),
width:
double
.
maxFinite
,
itemBuilder:
(
c
,
index
)
{
height:
55
,
return
Text
(
'
$index
'
);
color:
Colors
.
white
,
},
child:
Row
(
itemCount:
5
,
mainAxisSize:
MainAxisSize
.
min
,
));
crossAxisAlignment:
CrossAxisAlignment
.
center
,
}
children:
<
Widget
>[
}
Container
(
margin:
EdgeInsets
.
only
(
left:
18
),
Widget
DoctorItem
(
BuildContext
context
,
cards
)
{
width:
30
,
if
(
cards
.
doctor
==
null
&&
isDebug
)
{
child:
Column
(
throw
new
Exception
();
mainAxisSize:
MainAxisSize
.
min
,
}
children:
<
Widget
>[
return
GestureDetector
(
Container
(
child:
Container
(
width:
22
,
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
height:
22
,
height:
127
,
child:
Image
.
asset
(
"assets/vs_black.png"
),
child:
Stack
(
),
children:
<
Widget
>[
Container
(
Positioned
(
margin:
EdgeInsets
.
only
(
top:
3
),
top:
15
,
child:
baseText
(
"去比较"
,
10
,
Color
(
0xff282828
)),
child:
Container
(
)
width:
45
,
],
height:
45
,
child:
ClipOval
(
child:
CachedNetworkImage
(
imageUrl:
cards
.
doctor
.
portrait
,
),
),
),
),
),
GestureDetector
(
),
behavior:
HitTestBehavior
.
opaque
,
Positioned
(
onTap:
()
{
left:
57
,
BaseBottomPicker
()
top:
18
,
..
setPicker
(
MechanismBox
(
12
))
child:
Row
(
..
show
(
context
);
mainAxisSize:
MainAxisSize
.
min
,
},
crossAxisAlignment:
CrossAxisAlignment
.
end
,
child:
Container
(
children:
<
Widget
>[
margin:
EdgeInsets
.
only
(
left:
15
),
baseText
(
cards
.
doctor
.
name
,
15
,
Color
(
0xff333333
),
bold:
true
),
width:
135
,
Container
(
height:
40
,
margin:
EdgeInsets
.
only
(
left:
4
),
decoration:
BoxDecoration
(
child:
baseText
(
cards
.
doctor
.
name
,
15
,
Color
(
0xff333333
),
color:
Color
(
0xff51CDC7
),
bold:
true
),
borderRadius:
BorderRadius
.
circular
(
20
)),
)
alignment:
Alignment
.
center
,
],
child:
baseText
(
"咨询"
,
14
,
Colors
.
white
,
bold:
true
),
),
)),
),
GestureDetector
(
Positioned
(
behavior:
HitTestBehavior
.
opaque
,
top:
42
,
onTap:
()
{},
right:
0
,
child:
Container
(
child:
Row
(
margin:
EdgeInsets
.
only
(
left:
15
),
crossAxisAlignment:
CrossAxisAlignment
.
end
,
width:
135
,
mainAxisSize:
MainAxisSize
.
min
,
height:
40
,
children:
<
Widget
>[
decoration:
BoxDecoration
(
baseText
(
"¥"
,
12
,
Color
(
0xffFF5963
)),
color:
Color
(
0xffF96079
),
baseText
(
"
${cards.doctor.minPrice}
-
${cards.doctor.maxPrice}
"
,
borderRadius:
BorderRadius
.
circular
(
20
)),
15
,
Color
(
0xffFF5963
)),
alignment:
Alignment
.
center
,
],
child:
baseText
(
"获取底价"
,
14
,
Colors
.
white
,
bold:
true
),
),
)),
),
Expanded
(
Positioned
(
child:
Container
(),
bottom:
15
,
)
right:
0
,
],
child:
lowPriceWidget
(),
),
Positioned
(
bottom:
15
,
right:
187
,
child:
askWidget
(),
),
),
],
));
),
),
);
}
Widget
HospitalItem
(
BuildContext
context
,
cards
)
{
if
(
cards
.
hospital
==
null
&&
isDebug
)
{
throw
new
Exception
();
}
return
GestureDetector
(
onTap:
()
{},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
height:
149
,
child:
Stack
(
children:
<
Widget
>[
Positioned
(
left:
0
,
top:
15
,
child:
Container
(
width:
45
,
height:
45
,
child:
ClipOval
(
child:
CachedNetworkImage
(
imageUrl:
cards
.
hospital
.
portrait
,
),
),
),
),
Positioned
(
left:
57
,
top:
17.5
,
child:
baseText
(
cards
.
hospital
.
name
,
15
,
Color
(
0xff333333
),
bold:
true
),
),
Positioned
(
top:
42.5
,
right:
0
,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
baseText
(
"¥"
,
12
,
Color
(
0xffFF5963
)),
baseText
(
"
${cards.hospital.minPrice}
-
${cards.hospital.maxPrice}
"
,
15
,
Color
(
0xffFF5963
)),
],
),
),
Positioned
(
bottom:
15
,
right:
0
,
child:
lowPriceWidget
(),
),
Positioned
(
bottom:
15
,
right:
187
,
child:
askWidget
(),
),
Positioned
(
bottom:
67
,
left:
57
,
child:
baseText
(
cards
.
hospital
.
address
,
12
,
Color
(
0xff666666
)),
),
Positioned
(
left:
57
,
top:
43.5
,
child:
FiveStarView
(
cards
.
hospital
.
star
,
5
),
)
],
),
));
}
Widget
lowPriceWidget
(
)
{
return
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
child:
Container
(
width:
122
,
height:
37
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
18.5
),
color:
Color
(
0xffFFF5F5
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"获取底价"
,
14
,
Color
(
0xffFF5963
),
bold:
true
),
),
);
}
Widget
askWidget
(
)
{
return
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
child:
Container
(
width:
122
,
height:
37
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
18.5
),
color:
Color
(
0xffEEFDFD
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"咨询"
,
14
,
Color
(
0xff3FB5AF
),
bold:
true
),
),
);
}
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/mechanismBox/MechanismBoxPage.dart
View file @
e2a5006b
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/view/FiveStarView.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/ClueModel/page/mechanismBox/MechanismModel.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
class
MechanismBox
implements
IBottomPicker
{
class
MechanismBox
implements
IBottomPicker
{
VoidCallback
dismissCall
;
VoidCallback
dismissCall
;
TextEditingController
textController
=
TextEditingController
();
TextEditingController
textController
=
TextEditingController
();
MechanismModel
_model
=
new
MechanismModel
();
List
<
int
>
doctor_ids
=
new
List
();
@required
final
int
plan_id
;
MechanismBox
(
this
.
plan_id
)
:
super
();
@override
@override
initState
(
dismissCall
,
BuildContext
context
)
{
initState
(
dismissCall
,
BuildContext
context
)
{
this
.
dismissCall
=
dismissCall
;
this
.
dismissCall
=
dismissCall
;
_model
.
getQuestions
(
plan_id
);
}
}
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -19,104 +34,205 @@ class MechanismBox implements IBottomPicker {
...
@@ -19,104 +34,205 @@ class MechanismBox implements IBottomPicker {
width:
mq
.
size
.
width
,
width:
mq
.
size
.
width
,
height:
mq
.
size
.
height
-
140
,
height:
mq
.
size
.
height
-
140
,
color:
Colors
.
white
,
color:
Colors
.
white
,
child:
StreamBuilder
(
stream:
_model
.
stateLive
.
stream
,
initialData:
_model
.
stateLive
.
data
??
LOADING
,
builder:
(
c
,
data
)
{
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
getQuestions
(
plan_id
);
});
}
if
(
data
.
data
==
LOADING
)
{
return
loadingItem
();
}
return
setupHome
(
mq
,
keyHeight
);
},
)),
);
}
@override
void
dispose
()
{
textController
.
dispose
();
}
setupHome
(
mq
,
keyHeight
)
{
return
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
title
(
mq
),
mechanismList
(
mq
,
keyHeight
),
bottomMessage
()
],
);
}
// 弹窗标题
Widget
title
(
mq
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
left:
20
,
right:
20
),
width:
mq
.
size
.
width
,
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
width:
1
,
color:
Color
(
0xffE5E5E5
)))),
height:
50
,
child:
Stack
(
alignment:
Alignment
.
center
,
children:
<
Widget
>[
Container
(
child:
Text
(
'请选择要咨询的机构'
,
style:
TextStyle
(
color:
Color
(
0xff282828
),
fontSize:
17
,
fontWeight:
FontWeight
.
bold
),
),
),
Positioned
(
right:
0
,
top:
16.0
,
child:
GestureDetector
(
onTap:
()
{
dismissCall
();
},
child:
Container
(
width:
14
,
height:
14
,
child:
Image
.
asset
(
"assets/close-btn.png"
),
),
))
],
),
);
}
// 机构列表
Widget
mechanismList
(
mq
,
keyHeight
)
{
return
Container
(
height:
mq
.
size
.
height
-
140
-
96
-
50
-
keyHeight
,
width:
mq
.
size
.
width
,
padding:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
ListView
.
separated
(
itemCount:
100
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
HospitalItem
(
context
,
index
);
},
separatorBuilder:
(
BuildContext
context
,
int
index
)
{
return
Divider
(
color:
Color
(
0xffE5E5E5
));
},
));
}
// 机构卡片
Widget
HospitalItem
(
BuildContext
context
,
int
index
)
{
return
GestureDetector
(
onTap:
()
{},
child:
Container
(
height:
94.5
,
child:
Stack
(
child:
Stack
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Positioned
(
margin:
EdgeInsets
.
only
(
left:
20
,
right:
20
),
left:
0
,
width:
mq
.
size
.
width
,
top:
35
,
decoration:
BoxDecoration
(
child:
Container
(
border:
Border
(
height:
17
,
bottom:
width:
17
,
BorderSide
(
width:
1
,
color:
Color
(
0xffE5E5E5
)))),
child:
true
height:
50
,
?
Image
.
asset
(
"assets/icon-checked.png"
)
child:
Stack
(
:
Image
.
asset
(
"assets/icon-check.png"
),
alignment:
Alignment
.
center
,
)),
children:
<
Widget
>[
Positioned
(
Container
(
left:
32
,
child:
Text
(
top:
21
,
'请选择要咨询的机构'
,
child:
Container
(
style:
TextStyle
(
width:
45
,
color:
Color
(
0xff282828
),
height:
45
,
fontSize:
17
,
child:
ClipOval
(
fontWeight:
FontWeight
.
bold
),
child:
CachedNetworkImage
(
),
// imageUrl: cards.hospital.portrait,
imageUrl:
'https://img1.gamersky.com/image2019/07/20190725_ll_red_136_2/gamersky_07small_14_201972510258D0.jpg'
,
),
),
Positioned
(
),
right:
0
,
),
top:
16.0
,
),
child:
GestureDetector
(
Positioned
(
onTap:
()
{
left:
89
,
dismissCall
();
top:
17.5
,
},
// child: baseText(cards.hospital.name, 15, Color(0xff333333),
child:
Container
(
// bold: true),
width:
14
,
child:
baseText
(
'22222'
,
15
,
Color
(
0xff333333
),
bold:
true
),
height:
14
,
),
child:
Image
.
asset
(
"assets/close-btn.png"
),
Positioned
(
),
top:
42.5
,
))
right:
0
,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
baseText
(
"¥"
,
12
,
Color
(
0xffFF5963
)),
baseText
(
"
${1}
-
${2}
"
,
15
,
Color
(
0xffFF5963
)),
],
],
),
),
),
),
Container
(
height:
mq
.
size
.
height
-
140
-
96
-
50
,
width:
mq
.
size
.
width
,
margin:
EdgeInsets
.
only
(
top:
50
),
padding:
EdgeInsets
.
only
(
left:
20
,
right:
20
),
child:
ListView
.
separated
(
itemCount:
100
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
ListTile
(
title:
Text
(
"
$index
"
));
},
separatorBuilder:
(
BuildContext
context
,
int
index
)
{
return
Divider
(
color:
Color
(
0xffE5E5E5
));
},
)),
Positioned
(
Positioned
(
bottom:
keyHeight
==
0
?
0
:
keyHeight
,
bottom:
21
,
left:
0
,
left:
89
,
width:
double
.
maxFinite
,
// child: baseText(cards.hospital.address, 12, Color(0xff666666)),
height:
96
,
child:
baseText
(
'dsssssssss'
,
12
,
Color
(
0xff666666
)),
child:
Container
(
),
height:
96
,
Positioned
(
color:
Color
(
0xffF9F8FB
),
left:
89
,
child:
Column
(
top:
38.5
,
children:
<
Widget
>[
child:
FiveStarView
(
2
,
5
),
Container
(
)
height:
25
,
],
color:
Colors
.
black
,
),
width:
double
.
maxFinite
,
));
margin:
EdgeInsets
.
only
(
top:
12
),
}
child:
ListView
(
// 底部输入框部分
Widget
bottomMessage
()
{
return
Container
(
height:
96
,
color:
Color
(
0xffF9F8FB
),
child:
Column
(
children:
<
Widget
>[
Container
(
height:
25
,
width:
double
.
maxFinite
,
margin:
EdgeInsets
.
only
(
top:
12
),
child:
Row
(
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
8
),
height:
25
,
child:
Text
(
'我想'
,
style:
TextStyle
(
height:
2
,
color:
Color
(
0xff666666
),
fontSize:
12
),
)),
Expanded
(
child:
StreamBuilder
<
List
<
String
>>(
stream:
_model
.
questionsLive
.
stream
,
initialData:
_model
.
questionsLive
.
data
??
null
,
builder:
(
c
,
e
)
{
if
(
e
.
data
==
null
)
{
return
Container
();
}
List
<
String
>
questions
=
e
.
data
;
return
ListView
.
builder
(
scrollDirection:
Axis
.
horizontal
,
//横向滚动
scrollDirection:
Axis
.
horizontal
,
//横向滚动
children:
<
Widget
>[
itemBuilder:
(
c
,
index
)
{
Container
(
return
GestureDetector
(
margin:
EdgeInsets
.
only
(
left:
15
,
right:
8
),
onTap:
()
{
height:
25
,
textController
.
text
+=
questions
[
index
];
child:
Text
(
},
'我想'
,
child:
Container
(
style:
TextStyle
(
height:
2
,
color:
Color
(
0xff666666
),
fontSize:
12
),
)),
Container
(
height:
25
,
margin:
EdgeInsets
.
only
(
right:
12
),
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Color
(
0xffE5E5E5
),
width:
0.5
),
color:
Color
(
0xffffffff
),
borderRadius:
BorderRadius
.
circular
(
20
)),
child:
Text
(
'有优惠活动吗?'
,
style:
TextStyle
(
fontSize:
12
,
color:
Color
(
0xff666666
),
height:
1.8
),
),
),
Container
(
height:
25
,
height:
25
,
margin:
EdgeInsets
.
only
(
right:
12
),
margin:
EdgeInsets
.
only
(
right:
12
),
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
),
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
),
...
@@ -128,79 +244,62 @@ class MechanismBox implements IBottomPicker {
...
@@ -128,79 +244,62 @@ class MechanismBox implements IBottomPicker {
borderRadius:
borderRadius:
BorderRadius
.
circular
(
20
)),
BorderRadius
.
circular
(
20
)),
child:
Text
(
child:
Text
(
'111有优惠活动吗?'
,
questions
[
index
]
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
12
,
fontSize:
12
,
color:
Color
(
0xff666666
),
color:
Color
(
0xff666666
),
height:
1.8
),
height:
1.8
),
)),
),
Container
(
),
height:
25
,
);
margin:
EdgeInsets
.
only
(
right:
12
),
},
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
),
itemCount:
questions
.
length
,
decoration:
BoxDecoration
(
);
border:
Border
.
all
(
}),
color:
Color
(
0xffE5E5E5
),
)
width:
0.5
),
],
color:
Color
(
0xffffffff
),
)),
borderRadius:
Container
(
BorderRadius
.
circular
(
20
)),
height:
35
,
child:
Text
(
width:
double
.
maxFinite
,
'111有优惠活动吗?'
,
margin:
EdgeInsets
.
only
(
top:
12
,
left:
15
,
right:
15
),
style:
TextStyle
(
decoration:
BoxDecoration
(
fontSize:
12
,
border:
Border
.
all
(
color:
Color
(
0xffE5E5E5
),
width:
0.5
),
color:
Color
(
0xff666666
),
color:
Color
(
0xffffffff
),
height:
1.8
),
borderRadius:
BorderRadius
.
circular
(
35
)),
)),
child:
StreamBuilder
(
Container
(
stream:
_model
.
messageLive
.
stream
,
height:
25
,
initialData:
_model
.
messageLive
.
data
??
null
,
margin:
EdgeInsets
.
only
(
right:
12
),
builder:
(
context
,
snapshot
)
{
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
),
return
TextField
(
decoration:
BoxDecoration
(
controller:
textController
,
border:
Border
.
all
(
keyboardType:
TextInputType
.
text
,
color:
Color
(
0xffE5E5E5
),
textInputAction:
TextInputAction
.
send
,
width:
0.5
),
onSubmitted:
(
txt
)
{
color:
Color
(
0xffffffff
),
if
(!(
doctor_ids
.
length
>
3
||
borderRadius:
doctor_ids
.
length
<
1
))
{
BorderRadius
.
circular
(
20
)),
NativeToast
.
showNativeToast
(
'请选择1-3个机构咨询'
);
child:
Text
(
}
else
{
'111有优惠活动吗?'
,
if
(
txt
==
''
)
{
style:
TextStyle
(
NativeToast
.
showNativeToast
(
'text'
);
fontSize:
12
,
}
else
{
color:
Color
(
0xff666666
),
_model
.
sendMessage
(
doctor_ids
,
txt
,
plan_id
);
height:
1.8
),
dismissCall
();
))
textController
.
text
=
''
;
],
NativeToast
.
showNativeToast
(
'消息已发送成功'
);
),
}
),
}
Container
(
},
height:
35
,
style:
TextStyle
(
fontSize:
12
),
margin:
maxLines:
1
,
EdgeInsets
.
only
(
top:
12
,
left:
15
,
right:
15
),
decoration:
InputDecoration
(
decoration:
BoxDecoration
(
contentPadding:
EdgeInsets
.
only
(
border:
Border
.
all
(
left:
16
,
top:
0
,
bottom:
12
,
right:
16
),
color:
Color
(
0xffE5E5E5
),
width:
0.5
),
hintText:
'请输入您想了解的问题'
,
color:
Color
(
0xffffffff
),
border:
InputBorder
.
none
));
borderRadius:
BorderRadius
.
circular
(
35
)),
},
child:
TextField
(
))
controller:
textController
,
],
keyboardType:
TextInputType
.
text
,
));
textInputAction:
TextInputAction
.
send
,
onSubmitted:
(
txt
)
{},
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
16.0
),
labelText:
'文案文案文案不知道文案是啥'
,
border:
InputBorder
.
none
)),
)
],
)))
],
)),
);
}
@override
void
dispose
()
{
textController
.
dispose
();
}
}
}
}
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';
...
@@ -14,6 +14,7 @@ import 'package:gm_flutter/commonModel/GMBase.dart';
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
PlanModel
extends
BaseModel
{
class
PlanModel
extends
BaseModel
{
LiveData
<
List
>
managerLive
=
new
LiveData
();
LiveData
<
List
>
managerLive
=
new
LiveData
();
...
@@ -46,6 +47,7 @@ class PlanModel extends BaseModel {
...
@@ -46,6 +47,7 @@ class PlanModel extends BaseModel {
ClueApiImpl
.
getInstance
()
ClueApiImpl
.
getInstance
()
.
getPlan
(
DioUtil
.
getInstance
().
getDio
())
.
getPlan
(
DioUtil
.
getInstance
().
getDio
())
.
listen
((
event
)
{
.
listen
((
event
)
{
print
(
"ERROR12
${event.error}
"
);
if
(
event
.
error
==
0
)
{
if
(
event
.
error
==
0
)
{
projectData
=
event
.
data
.
tags
;
projectData
=
event
.
data
.
tags
;
sortList
=
event
.
data
.
orders
;
sortList
=
event
.
data
.
orders
;
...
@@ -59,6 +61,7 @@ class PlanModel extends BaseModel {
...
@@ -59,6 +61,7 @@ class PlanModel extends BaseModel {
})
})
.
addToDispose
(
rxDispose
)
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
.
onError
((
err
)
{
print
(
"ERROR12WCCCCCC
${err.toString()}
"
);
PrintUtil
.
printBug
(
err
);
PrintUtil
.
printBug
(
err
);
stateLive
.
notifyView
(
FAIL
);
stateLive
.
notifyView
(
FAIL
);
});
});
...
@@ -73,7 +76,7 @@ class PlanModel extends BaseModel {
...
@@ -73,7 +76,7 @@ class PlanModel extends BaseModel {
refreshFeed
(
true
);
refreshFeed
(
true
);
}
}
void
refreshFeed
(
bool
clear
)
{
void
refreshFeed
(
bool
clear
,
{
RefreshController
controller
}
)
{
if
(
clear
)
{
if
(
clear
)
{
feedDatas
.
clear
();
feedDatas
.
clear
();
}
}
...
@@ -88,15 +91,18 @@ class PlanModel extends BaseModel {
...
@@ -88,15 +91,18 @@ class PlanModel extends BaseModel {
feedDatas
.
addAll
(
event
.
data
.
plans
);
feedDatas
.
addAll
(
event
.
data
.
plans
);
feedsLive
.
notifyView
(
Pair
(
ENDLOADING
,
feedDatas
));
feedsLive
.
notifyView
(
Pair
(
ENDLOADING
,
feedDatas
));
}
}
controller
?.
refreshCompleted
();
}
else
{
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
NativeToast
.
showNativeToast
(
event
.
message
);
feedsLive
.
notifyView
(
Pair
(
FAIL
,
null
));
feedsLive
.
notifyView
(
Pair
(
FAIL
,
null
));
controller
?.
refreshFailed
();
}
}
})
})
.
addToDispose
(
rxDispose
)
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
.
onError
((
err
)
{
PrintUtil
.
printBug
(
err
);
PrintUtil
.
printBug
(
err
);
feedsLive
.
notifyView
(
Pair
(
FAIL
,
null
));
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';
...
@@ -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/PlanBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.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/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/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/BaseMenuListener.dart'
;
import
'package:gm_flutter/commonModel/popMenu/BasePopMenu.dart'
;
import
'package:gm_flutter/commonModel/popMenu/BasePopMenu.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/WidgetUtil.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
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'PlanModel.dart'
;
import
'PlanModel.dart'
;
import
'ProjectView.dart'
;
import
'ProjectView.dart'
;
class
PlanPage
extends
StatefulWidget
{
class
PlanPage
extends
StatefulWidget
{
@override
@override
State
<
StatefulWidget
>
createState
()
=>
PlanState
();
State
<
StatefulWidget
>
createState
()
=>
PlanState
();
}
}
...
@@ -51,6 +54,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
...
@@ -51,6 +54,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
@override
void
initState
()
{
void
initState
()
{
DioUtil
.
getInstance
().
setProxy
(
"172.30.8.245"
);
super
.
initState
();
super
.
initState
();
_model
.
init
();
_model
.
init
();
planBarView
=
planBarView
=
...
@@ -250,13 +254,16 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
...
@@ -250,13 +254,16 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child:
loadingItem
(),
child:
loadingItem
(),
);
);
}
else
if
(
data
.
data
==
FAIL
)
{
}
else
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
return
Container
(
MediaQuery
.
of
(
context
).
size
.
width
,
color:
Colors
.
white
,
MediaQuery
.
of
(
context
).
size
.
height
,
child:
errorItem
(
()
{
MediaQuery
.
of
(
context
).
size
.
width
,
_model
.
stateLive
.
notifyView
(
LOADING
);
MediaQuery
.
of
(
context
).
size
.
height
,
_model
.
init
();
()
{
},
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
},
),
);
);
}
else
{
}
else
{
return
Container
(
return
Container
(
...
@@ -342,7 +349,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
...
@@ -342,7 +349,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child:
baseRefreshView
(
child:
baseRefreshView
(
refreshController
,
refreshController
,
()
{
()
{
_model
.
refreshFeed
(
true
);
_model
.
refreshFeed
(
true
,
controller:
refreshController
);
},
},
Container
(
Container
(
width:
0
,
width:
0
,
...
@@ -381,7 +388,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
...
@@ -381,7 +388,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data
.
data
==
null
?
""
:
data
.
data
[
0
].
icon
??
""
,
data
.
data
==
null
?
""
:
data
.
data
[
0
].
icon
??
""
,
fit:
BoxFit
.
cover
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
)).
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 {
...
@@ -403,7 +413,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data
.
data
==
null
?
""
:
data
.
data
[
1
].
icon
??
""
,
data
.
data
==
null
?
""
:
data
.
data
[
1
].
icon
??
""
,
fit:
BoxFit
.
cover
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
)).
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';
...
@@ -10,7 +10,7 @@ import 'package:flutter/cupertino.dart';
import
'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
import
'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
as
extend
;
as
extend
;
import
'package:flutter/material.dart'
;
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/page/top/TopModel.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
...
@@ -23,6 +23,12 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
...
@@ -23,6 +23,12 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import
'TopList.dart'
;
import
'TopList.dart'
;
class
TopPage
extends
StatefulWidget
{
class
TopPage
extends
StatefulWidget
{
String
rank_type
;
TopPage
(
Map
<
String
,
dynamic
>
map
)
{
this
.
rank_type
=
map
[
"rank_type"
];
}
@override
@override
State
<
StatefulWidget
>
createState
()
=>
TopPageState
();
State
<
StatefulWidget
>
createState
()
=>
TopPageState
();
}
}
...
@@ -35,6 +41,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -35,6 +41,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override
@override
void
initState
()
{
void
initState
()
{
_model
.
rank_type
=
widget
.
rank_type
;
init
();
init
();
super
.
initState
();
super
.
initState
();
}
}
...
@@ -136,8 +143,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -136,8 +143,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
List
<
Widget
>
list
=
[];
List
<
Widget
>
list
=
[];
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
for
(
int
i
=
0
;
i
<
_model
.
tabs
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
_model
.
tabs
.
length
;
i
++)
{
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
Key
(
"Tab
${i}
"
),
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
TopList
(
_model
.
tabs
[
i
].
id
,
kToolbarHeight
+
d
)));
Key
(
"Tab
${i}
"
),
TopList
(
_model
.
tabs
[
i
].
id
,
kToolbarHeight
+
d
)));
}
}
return
extend
.
NestedScrollView
(
return
extend
.
NestedScrollView
(
innerScrollPositionKeyBuilder:
()
{
innerScrollPositionKeyBuilder:
()
{
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
e2a5006b
...
@@ -6,9 +6,11 @@ import 'package:flutter_common/Annotations/anno/Get.dart';
...
@@ -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/Post.dart'
;
import
'package:flutter_common/Annotations/anno/Query.dart'
;
import
'package:flutter_common/Annotations/anno/Query.dart'
;
import
'package:flutter_common/Annotations/anno/ServiceCenter.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/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.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/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/PlanOverViewBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
...
@@ -47,6 +49,13 @@ abstract class ClueApi {
...
@@ -47,6 +49,13 @@ abstract class ClueApi {
@Query
(
"page"
)
int
page
,
@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"
)
@Get
(
"api/janus/plans/rank"
)
PlanBarBean
getPlanBar
(
@Query
(
"rank_type"
)
String
rank_type
);
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';
...
@@ -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/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.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/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/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
...
@@ -143,6 +145,38 @@ class ClueApiImpl {
...
@@ -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
)
{
Stream
<
PlanBarBean
>
getPlanBar
(
Dio
_dio
,
String
rank_type
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/rank'
,
data:
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/rank'
,
data:
{
'rank_type'
:
rank_type
,
'rank_type'
:
rank_type
,
...
@@ -365,6 +399,14 @@ PlanFeedBean parsePlanFeedBean(String value) {
...
@@ -365,6 +399,14 @@ PlanFeedBean parsePlanFeedBean(String value) {
return
PlanFeedBean
.
fromJson
(
json
.
decode
(
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
)
{
PlanBarBean
parsePlanBarBean
(
String
value
)
{
return
PlanBarBean
.
fromJson
(
json
.
decode
(
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 {
...
@@ -10,14 +10,22 @@ class PlanBean {
UserType
userType
;
UserType
userType
;
Data
data
;
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
)
{
PlanBean
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
error
=
json
[
'error'
];
message
=
json
[
'message'
];
message
=
json
[
'message'
];
extra
=
json
[
'extra'
];
extra
=
json
[
'extra'
];
errorExtra
=
json
[
'error_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
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
}
}
...
@@ -38,16 +46,14 @@ class PlanBean {
...
@@ -38,16 +46,14 @@ class PlanBean {
}
}
class
UserType
{
class
UserType
{
UserType
();
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{}
}
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
>();
return
data
;
return
data
;
}
}
}
}
class
Data
{
class
Data
{
...
@@ -61,19 +67,27 @@ class Data {
...
@@ -61,19 +67,27 @@ class Data {
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'ranks'
]
!=
null
)
{
if
(
json
[
'ranks'
]
!=
null
)
{
ranks
=
new
List
<
Ranks
>();
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
)
{
if
(
json
[
'areas'
]
!=
null
)
{
areas
=
new
List
<
Areas
>();
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
)
{
if
(
json
[
'tags'
]
!=
null
)
{
tags
=
new
List
<
Tags
>();
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
)
{
if
(
json
[
'orders'
]
!=
null
)
{
orders
=
new
List
<
Orders
>();
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 {
...
@@ -96,6 +110,7 @@ class Data {
}
}
class
Ranks
{
class
Ranks
{
int
id
;
String
name
;
String
name
;
String
gmUrl
;
String
gmUrl
;
String
icon
;
String
icon
;
...
@@ -103,6 +118,7 @@ class Ranks {
...
@@ -103,6 +118,7 @@ class Ranks {
Ranks
({
this
.
name
,
this
.
gmUrl
,
this
.
icon
});
Ranks
({
this
.
name
,
this
.
gmUrl
,
this
.
icon
});
Ranks
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Ranks
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
name
=
json
[
'name'
];
name
=
json
[
'name'
];
gmUrl
=
json
[
'gm_url'
];
gmUrl
=
json
[
'gm_url'
];
icon
=
json
[
'icon'
];
icon
=
json
[
'icon'
];
...
@@ -111,6 +127,7 @@ class Ranks {
...
@@ -111,6 +127,7 @@ class Ranks {
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
[
'name'
]
=
this
.
name
;
data
[
'name'
]
=
this
.
name
;
data
[
'id'
]
=
this
.
id
;
data
[
'gm_url'
]
=
this
.
gmUrl
;
data
[
'gm_url'
]
=
this
.
gmUrl
;
data
[
'icon'
]
=
this
.
icon
;
data
[
'icon'
]
=
this
.
icon
;
return
data
;
return
data
;
...
@@ -129,7 +146,9 @@ class Areas {
...
@@ -129,7 +146,9 @@ class Areas {
name
=
json
[
'name'
];
name
=
json
[
'name'
];
if
(
json
[
'groups'
]
!=
null
)
{
if
(
json
[
'groups'
]
!=
null
)
{
groups
=
new
List
<
Groups
>();
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 {
...
@@ -157,7 +176,9 @@ class Groups {
initial
=
json
[
'initial'
];
initial
=
json
[
'initial'
];
if
(
json
[
'cities'
]
!=
null
)
{
if
(
json
[
'cities'
]
!=
null
)
{
cities
=
new
List
<
Cities
>();
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'
];
title
=
json
[
'title'
];
}
}
...
@@ -207,7 +228,9 @@ class Tags {
...
@@ -207,7 +228,9 @@ class Tags {
id
=
json
[
'id'
].
toString
();
id
=
json
[
'id'
].
toString
();
if
(
json
[
'sub_tags'
]
!=
null
)
{
if
(
json
[
'sub_tags'
]
!=
null
)
{
subTags
=
new
List
<
SubTags
>();
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'
];
name
=
json
[
'name'
];
}
}
...
@@ -260,4 +283,3 @@ class Orders {
...
@@ -260,4 +283,3 @@ class Orders {
return
data
;
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';
...
@@ -6,6 +6,8 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_common/commonModel/util/JumpUtil.dart'
;
import
'package:flutter_common/commonModel/util/JumpUtil.dart'
;
import
'package:gm_flutter/MainRouter/manager/MainManager.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'
;
import
'package:gm_flutter/main.mark.dart'
;
class
JumpManager
{
class
JumpManager
{
...
@@ -25,6 +27,8 @@ class JumpManager {
...
@@ -25,6 +27,8 @@ class JumpManager {
String
pageNameWrap
=
String
pageNameWrap
=
nativePage
?
"gm://
${pageName}
"
:
"flutter://
${pageName}
"
;
nativePage
?
"gm://
${pageName}
"
:
"flutter://
${pageName}
"
;
if
(!
MainManager
.
getInstance
().
isInit
)
{
if
(!
MainManager
.
getInstance
().
isInit
)
{
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
save
(
COOKIE
,
"_gtid=3123e178b91a11eaa2d87e40d376ac134112; sessionid=pq9wf8equ4h26ia3yspzmquqn2rjs6mx; _gm_token=4091a81593419225"
);
JumpUtil
.
jumpToPageRight
(
context
,
initMap
(
params
)[
pageNameWrap
]);
JumpUtil
.
jumpToPageRight
(
context
,
initMap
(
params
)[
pageNameWrap
]);
}
else
{
}
else
{
FlutterBoost
.
singleton
.
open
(
pageName
,
urlParams:
params
);
FlutterBoost
.
singleton
.
open
(
pageName
,
urlParams:
params
);
...
@@ -35,6 +39,12 @@ class JumpManager {
...
@@ -35,6 +39,12 @@ class JumpManager {
return
{
return
{
"flutter://clueLevelOne"
:
"flutter://clueLevelOne"
:
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
),
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> {
...
@@ -51,15 +51,21 @@ class TestState extends BaseState<TestPage> {
}));
}));
list
.
add
(
listItem
(
"项目说明"
,
()
{
list
.
add
(
listItem
(
"项目说明"
,
()
{
JumpUtil
.
jumpToPageRight
(
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getProjectDetailsPage
());
context
,
RouterCenterImpl
()
.
findClueRouter
()
.
getProjectDetailsPage
({
"planId"
:
1
}));
}));
}));
list
.
add
(
listItem
(
"方案对比"
,
()
{
list
.
add
(
listItem
(
"方案对比"
,
()
{
JumpUtil
.
jumpToPageRight
(
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getPlansCompareFeed
());
context
,
RouterCenterImpl
()
.
findClueRouter
()
.
getPlansCompareFeed
({
"planId"
:
1
,
"planType"
:
1
}));
}));
}));
list
.
add
(
listItem
(
"榜单"
,
()
{
list
.
add
(
listItem
(
"榜单"
,
()
{
JumpUtil
.
jumpToPageRight
(
JumpUtil
.
jumpToPageRight
(
context
,
context
,
RouterCenterImpl
().
findClueRouter
().
getTopPage
(
));
RouterCenterImpl
().
findClueRouter
().
getTopPage
({
"rank_type"
:
"0"
}
));
}));
}));
list
.
add
(
listItem
(
"弹窗"
,
()
{
list
.
add
(
listItem
(
"弹窗"
,
()
{
DiscussLowPricePopView
.
showPopView
(
context
);
DiscussLowPricePopView
.
showPopView
(
context
);
...
...
lib/commonModel/base/BaseComponent.dart
View file @
e2a5006b
...
@@ -144,11 +144,11 @@ Widget loadingItem({bool needBackground = false}) {
...
@@ -144,11 +144,11 @@ Widget loadingItem({bool needBackground = false}) {
Widget
netErrorItem
(
)
{}
Widget
netErrorItem
(
)
{}
Widget
errorItem
(
double
width
,
double
height
,
VoidCallback
retry
,
Widget
errorItem
(
double
width
,
double
height
,
VoidCallback
retry
,
{
String
errorText
,
String
retryText
,
double
paddingTop
})
{
{
String
errorText
,
String
retryText
,
double
paddingTop
})
{
return
Container
(
return
Container
(
width:
width
,
width:
width
,
height:
height
,
height:
height
,
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
alignment:
Alignment
.
topCenter
,
alignment:
Alignment
.
topCenter
,
child:
Container
(
child:
Container
(
width:
180
,
width:
180
,
...
@@ -377,46 +377,46 @@ Widget normalRefreshHeader() {
...
@@ -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
(
return
Container
(
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
width:
width
,
width:
width
,
height:
height
,
height:
height
,
color:
Colors
.
white
,
color:
Colors
.
white
,
alignment:
Alignment
.
topCenter
,
alignment:
Alignment
.
topCenter
,
child:
Container
(
child:
Container
(
width:
175
,
width:
175
,
height:
188
,
height:
188
,
margin:
EdgeInsets
.
only
(
top:
62.5
),
margin:
EdgeInsets
.
only
(
top:
62.5
),
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
175
,
width:
175
,
height:
188
,
height:
188
,
child:
Stack
(
child:
Stack
(
alignment:
AlignmentDirectional
.
bottomCenter
,
alignment:
AlignmentDirectional
.
bottomCenter
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
175
,
width:
175
,
height:
188
,
height:
188
,
child:
Image
.
asset
(
"assets/empty.png"
),
child:
Image
.
asset
(
"assets/empty.png"
),
),
),
Positioned
(
Positioned
(
bottom:
17
,
bottom:
17
,
child:
baseText
(
detail
??
"此处太寂寥,转转别处吧"
,
15
,
Color
(
0xff666666
)),
child:
baseText
(
)
detail
??
"此处太寂寥,转转别处吧"
,
15
,
Color
(
0xff666666
)),
],
)
],
),
),
),
),
Container
(
Container
(
height:
0
,
height:
0
,
color:
Colors
.
white
,
color:
Colors
.
white
,
)
)
],
],
)),
)
),
);
);
}
}
...
@@ -453,7 +453,8 @@ Widget baseTabBarItem(String text,
...
@@ -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
(
return
SliverAppBar
(
pinned:
true
,
pinned:
true
,
centerTitle:
true
,
centerTitle:
true
,
...
@@ -461,10 +462,12 @@ Widget baseSliverAppBar(String url, {double height, double elevation}) {
...
@@ -461,10 +462,12 @@ Widget baseSliverAppBar(String url, {double height, double elevation}) {
expandedHeight:
height
??
200
,
expandedHeight:
height
??
200
,
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
flexibleSpace:
FlexibleSpaceBar
(
flexibleSpace:
FlexibleSpaceBar
(
background:
Image
.
network
(
background:
needpic
url
??
''
,
?
Image
.
network
(
fit:
BoxFit
.
cover
,
url
??
''
,
),
fit:
BoxFit
.
cover
,
)
:
Container
(),
),
),
);
);
}
}
...
@@ -510,7 +513,8 @@ Widget baseSliverTitle(String text, double width, LiveData liveData) {
...
@@ -510,7 +513,8 @@ Widget baseSliverTitle(String text, double width, LiveData liveData) {
}
}
Widget
baseStateView
(
double
width
,
double
height
,
LiveData
<
int
>
stateLive
,
Widget
baseStateView
(
double
width
,
double
height
,
LiveData
<
int
>
stateLive
,
Widget
home
,
VoidCallback
retry
,{
double
paddingTop
})
{
Widget
home
,
VoidCallback
retry
,
{
double
paddingTop
})
{
return
StreamBuilder
(
return
StreamBuilder
(
stream:
stateLive
.
stream
,
stream:
stateLive
.
stream
,
initialData:
stateLive
.
data
??
LOADING
,
initialData:
stateLive
.
data
??
LOADING
,
...
@@ -518,9 +522,9 @@ Widget baseStateView(double width, double height, LiveData<int> stateLive,
...
@@ -518,9 +522,9 @@ Widget baseStateView(double width, double height, LiveData<int> stateLive,
if
(
data
.
data
==
LOADING
)
{
if
(
data
.
data
==
LOADING
)
{
return
loadingItem
();
return
loadingItem
();
}
else
if
(
data
.
data
==
FAIL
)
{
}
else
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
width
,
height
,
retry
,
paddingTop:
paddingTop
);
return
errorItem
(
width
,
height
,
retry
,
paddingTop:
paddingTop
);
}
else
if
(
data
.
data
==
EMPTY
)
{
}
else
if
(
data
.
data
==
EMPTY
)
{
return
emptyItem
(
width
,
height
,
paddingTop:
paddingTop
);
return
emptyItem
(
width
,
height
,
paddingTop:
paddingTop
);
}
}
return
home
;
return
home
;
},
},
...
...
lib/main.dart
View file @
e2a5006b
...
@@ -58,12 +58,16 @@ class MyApp extends State<MyAppWidget> {
...
@@ -58,12 +58,16 @@ class MyApp extends State<MyAppWidget> {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
FlutterBoost
.
singleton
.
registerPageBuilders
({
FlutterBoost
.
singleton
.
registerPageBuilders
({
'clueLevelOne'
:
(
pageName
,
params
,
_
)
{
'clueLevelOne'
:
(
pageName
,
params
,
_
)
=>
return
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
);
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
(
params
),
},
'clueProjectDetails'
:
(
pageName
,
params
,
_
)
=>
'demoPage1'
:
(
pageName
,
params
,
_
)
{
RouterCenterImpl
().
findClueRouter
().
getProjectDetailsPage
(
params
),
return
DemoPage1
();
'cluePlansCompareFeed'
:
(
pageName
,
params
,
_
)
=>
},
RouterCenterImpl
().
findClueRouter
().
getPlansCompareFeed
(
params
),
'cluePlan'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getPlanPage
(),
'clueTop'
:
(
pageName
,
params
,
_
)
=>
RouterCenterImpl
().
findClueRouter
().
getTopPage
(
params
),
});
});
FlutterBoost
.
singleton
FlutterBoost
.
singleton
.
addBoostContainerLifeCycleObserver
((
state
,
settings
)
{
.
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