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
5e5d3b5b
Commit
5e5d3b5b
authored
Jul 07, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'featrue/duxin' into 'test'
Featrue/duxin See merge request
!21
parents
6bb7b838
0a9364ca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
49 deletions
+83
-49
LevelOneModel.dart
lib/ClueModel/page/levelOne/LevelOneModel.dart
+2
-0
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+8
-6
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+68
-38
MechanismModel.dart
lib/ClueModel/page/mechanismBox/MechanismModel.dart
+2
-1
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+0
-1
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+1
-1
LevelOneFeedList.dart
lib/ClueModel/server/entity/LevelOneFeedList.dart
+2
-2
No files found.
lib/ClueModel/page/levelOne/LevelOneModel.dart
View file @
5e5d3b5b
...
...
@@ -26,6 +26,7 @@ class LevelOneModel extends BaseModel {
int
plan_id
=
0
;
PlanOverData
planoverItem
;
String
imageUrl
=
""
;
String
name
=
""
;
void
init
(
VoidCallback
callback
)
{
ClueTApiImpl
.
getInstance
()
...
...
@@ -33,6 +34,7 @@ class LevelOneModel extends BaseModel {
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
planoverItem
=
event
.
data
;
name
=
event
.
data
.
name
;
imageUrl
=
event
.
data
.
banner
.
imageUrl
;
tabsList
=
event
.
data
.
tabs
;
stateLive
.
notifyView
(
ENDLOADING
);
...
...
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
5e5d3b5b
...
...
@@ -53,6 +53,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
@override
void
initState
()
{
// DioUtil.getInstance().setProxy("172.30.8.245");
super
.
initState
();
_model
.
plan_id
=
widget
.
planId
;
_model
.
init
(()
{
...
...
@@ -166,11 +167,12 @@ class LevelTwoState extends BaseState<LevelTwoPage>
child:
newHome
(),
)),
Positioned
(
top:
57
,
top:
44
,
left:
60
,
child:
Container
(
alignment:
Alignment
.
center
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
baseText
(
"文案"
,
18
,
Color
(
0xff333333
)),
width:
MediaQuery
.
of
(
context
).
size
.
width
-
100
,
child:
baseText
(
_model
.
name
,
18
,
Color
(
0xff333333
)),
),
),
baseSliverBack
(()
{
...
...
@@ -202,7 +204,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
sliver:
baseSliverAppBar
(
_model
.
imageUrl
,
height:
pinnedHeaderHeight
,
needpic:
false
)),
height:
0
,
needpic:
false
)),
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
...
...
@@ -256,7 +258,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
);
}
return
Padding
(
padding:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
top:
8.0
,
bottom:
20
),
padding:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
bottom:
20
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
max
,
...
...
@@ -438,7 +440,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
{
BaseBottomPicker
()
..
setPicker
(
MechanismBox
(
12
))
..
setPicker
(
MechanismBox
(
widget
.
planId
))
..
show
(
context
);
},
child:
Container
(
...
...
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
View file @
5e5d3b5b
...
...
@@ -8,6 +8,7 @@ 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'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -15,13 +16,15 @@ class MechanismBox implements IBottomPicker {
VoidCallback
dismissCall
;
TextEditingController
textController
=
TextEditingController
();
MechanismModel
_model
=
new
MechanismModel
();
List
doctor_ids
=
new
List
();
List
<
String
>
doctor_ids
=
new
List
();
LevelOneListModel
_levelModel
=
LevelOneListModel
();
RefreshController
refreshController
=
RefreshController
();
Function
(
String
str
)
refresh
;
DateTime
_dateTime
=
DateTime
.
now
();
@required
final
int
plan_id
;
...
...
@@ -29,21 +32,9 @@ class MechanismBox implements IBottomPicker {
@override
initState
(
dismissCall
,
BuildContext
context
)
{
Map
<
String
,
dynamic
>
map
=
{
"business_id"
:
"level_two_plan_compare_deatil"
,
"page_name"
:
""
,
"referrer"
:
""
,
"referrer_id"
:
""
,
"referrer_link"
:
[],
"referrer_tab_name"
:
""
,
"in"
:
""
,
"out"
:
""
,
"is_push"
:
1
,
"fake"
:
1
,
"is_first"
:
1
};
RouterCenterImpl
().
findMainRouter
().
buriedEvent
(
"page_view"
,
map
);
this
.
dismissCall
=
dismissCall
;
_levelModel
.
plan_id
=
plan_id
;
_levelModel
.
tab_type
=
"hospital"
;
_model
.
getQuestions
(
plan_id
);
_levelModel
.
refreshView
(
true
);
refresh
=
(
str
)
{
...
...
@@ -75,7 +66,7 @@ class MechanismBox implements IBottomPicker {
if
(
data
.
data
==
LOADING
)
{
return
loadingItem
();
}
return
setupHome
(
mq
,
keyHeight
);
return
setupHome
(
mq
,
keyHeight
,
context
);
},
)),
);
...
...
@@ -83,18 +74,55 @@ class MechanismBox implements IBottomPicker {
@override
void
dispose
()
{
Map
<
String
,
dynamic
>
map
=
{
"business_id"
:
"level_two_plan_compare_deatil"
,
"page_name"
:
""
,
"referrer"
:
""
,
"referrer_id"
:
""
,
"referrer_link"
:
[],
"referrer_tab_name"
:
""
,
"in"
:
_dateTime
,
"out"
:
DateTime
.
now
(),
"is_push"
:
1
,
"fake"
:
1
,
"is_first"
:
1
};
RouterCenterImpl
().
findMainRouter
().
buriedEvent
(
"page_view"
,
map
);
textController
.
dispose
();
refreshController
.
dispose
();
_levelModel
.
dispose
();
_model
.
dispose
();
}
setupHome
(
mq
,
keyHeight
)
{
setupHome
(
mq
,
keyHeight
,
BuildContext
context
)
{
return
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
title
(
mq
),
mechanismList
(
mq
,
keyHeight
),
StreamBuilder
(
stream:
_levelModel
.
stateLive
.
stream
,
initialData:
_levelModel
.
stateLive
.
data
??
LOADING
,
builder:
(
c
,
data
)
{
if
(
data
.
data
==
LOADING
)
{
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
mq
.
size
.
height
-
140
-
96
-
50
-
keyHeight
,
child:
loadingItem
(),
);
}
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
mq
.
size
.
height
-
140
-
96
-
50
-
keyHeight
,
()
{
_levelModel
.
refreshView
(
true
);
});
}
if
(
data
.
data
==
EMPTY
)
{
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
mq
.
size
.
height
-
140
-
96
-
50
-
keyHeight
);
}
return
mechanismList
(
mq
,
keyHeight
);
},
),
bottomMessage
()
],
);
...
...
@@ -147,13 +175,8 @@ class MechanismBox implements IBottomPicker {
padding:
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
baseRefreshView
(
refreshController
,
()
{},
null
,
null
,
customScrollView:
CustomScrollView
(
// physics: NeverScrollableScrollPhysics(),
physics:
ClampingScrollPhysics
(),
// shrinkWrap: true,
slivers:
<
Widget
>[
// SliverOverlapInjector(
// handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
// ),
StreamBuilder
<
List
<
Cards
>>(
stream:
_levelModel
.
cardsLive
.
stream
,
initialData:
_levelModel
.
cardsLive
.
data
??
[],
...
...
@@ -173,9 +196,8 @@ class MechanismBox implements IBottomPicker {
);
}
if
(
_levelModel
.
data
[
index
].
cardType
==
'hospital'
)
{
Hospital
hospital
=
_levelModel
.
data
[
index
].
hospital
;
return
HospitalItem
(
hospital
);
return
HospitalItem
(
_levelModel
.
data
[
index
].
hospital
);
}
else
{
return
Container
();
}
...
...
@@ -194,7 +216,9 @@ class MechanismBox implements IBottomPicker {
// 机构卡片
Widget
HospitalItem
(
Hospital
hospital
)
{
return
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
{
print
(
hospital
.
toJson
());
if
(
doctor_ids
.
indexOf
(
hospital
.
hosiptalId
)
!=
-
1
)
{
doctor_ids
.
remove
(
hospital
.
hosiptalId
);
}
else
{
...
...
@@ -204,7 +228,10 @@ class MechanismBox implements IBottomPicker {
_levelModel
.
cardsLive
.
notifyView
(
_levelModel
.
cardsLive
.
data
);
},
child:
Container
(
height:
94.5
,
height:
91.5
,
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
width:
1
,
color:
Color
(
0xffE5E5E5
)))),
child:
Stack
(
children:
<
Widget
>[
Positioned
(
...
...
@@ -224,22 +251,18 @@ class MechanismBox implements IBottomPicker {
width:
45
,
height:
45
,
child:
ClipOval
(
child:
CachedNetworkImage
(
// imageUrl: cards.hospital.portrait,
imageUrl:
hospital
.
portrait
),
child:
CachedNetworkImage
(
imageUrl:
hospital
.
portrait
),
),
),
),
Positioned
(
left:
89
,
top:
17.5
,
// child: baseText(cards.hospital.name, 15, Color(0xff333333),
// bold: true),
top:
15
,
child:
baseText
(
hospital
.
name
,
15
,
Color
(
0xff333333
),
bold:
true
),
),
Positioned
(
top:
42.5
,
top:
38
,
right:
0
,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
...
...
@@ -254,8 +277,10 @@ class MechanismBox implements IBottomPicker {
Positioned
(
bottom:
21
,
left:
89
,
// child: baseText(cards.hospital.address, 12, Color(0xff666666)),
child:
baseText
(
hospital
.
address
,
12
,
Color
(
0xff666666
)),
child:
Container
(
width:
230
,
child:
baseText
(
hospital
.
address
,
12
,
Color
(
0xff666666
)),
),
),
Positioned
(
left:
89
,
...
...
@@ -353,8 +378,13 @@ class MechanismBox implements IBottomPicker {
if
(
doctor_ids
.
length
>
3
||
doctor_ids
.
length
<
1
)
{
NativeToast
.
showNativeToast
(
'请选择1-3个机构咨询'
);
}
else
{
if
(
txt
!=
''
)
{
_model
.
sendMessage
(
doctor_ids
,
txt
,
plan_id
,
(
i
)
{
if
(
txt
.
isNotEmpty
)
{
print
(
doctor_ids
.
join
(
','
));
_model
.
sendMessage
(
doctor_ids
.
join
(
','
),
txt
,
plan_id
,
(
i
)
{
print
(
doctor_ids
);
print
(
txt
);
print
(
plan_id
);
if
(
i
==
0
)
{
dismissCall
();
textController
.
text
=
''
;
...
...
lib/ClueModel/page/mechanismBox/MechanismModel.dart
View file @
5e5d3b5b
...
...
@@ -42,12 +42,13 @@ class MechanismModel extends BaseModel {
});
}
sendMessage
(
List
<
int
>
doctor_ids
,
String
question
,
int
plan_id
,
sendMessage
(
String
doctor_ids
,
String
question
,
int
plan_id
,
Function
(
int
state
)
func
)
{
ClueApiImpl
.
getInstance
()
.
sendMessage
(
DioUtil
.
getInstance
().
getDio
(),
doctor_ids
,
question
,
plan_id
)
.
listen
((
event
)
{
print
(
event
.
toJson
());
if
(
event
.
error
==
0
)
{
func
(
0
);
messageLive
.
notifyView
(
event
.
data
.
success
);
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
5e5d3b5b
...
...
@@ -11,7 +11,6 @@ import 'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanConsultBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
...
...
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
5e5d3b5b
...
...
@@ -160,7 +160,7 @@ class ClueApiImpl {
}
Stream
<
PlanConsultBean
>
sendMessage
(
Dio
_dio
,
List
<
int
>
doctor_ids
,
String
question
,
int
plan_id
)
{
Dio
_dio
,
String
doctor_ids
,
String
question
,
int
plan_id
)
{
return
Stream
.
fromFuture
(
post
(
_dio
,
'api/janus/plans/plan_consult'
,
data:
{
'doctor_ids'
:
doctor_ids
,
'question'
:
question
,
...
...
lib/ClueModel/server/entity/LevelOneFeedList.dart
View file @
5e5d3b5b
...
...
@@ -217,7 +217,7 @@ class Hospital {
Hospital
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
portrait
=
json
[
'portrait'
];
hosiptalId
=
json
[
'hos
ip
tal_id'
];
hosiptalId
=
json
[
'hos
pi
tal_id'
];
name
=
json
[
'name'
];
minPrice
=
json
[
'min_price'
];
maxPrice
=
json
[
'max_price'
];
...
...
@@ -230,7 +230,7 @@ class Hospital {
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'portrait'
]
=
this
.
portrait
;
data
[
'hos
ip
tal_id'
]
=
this
.
hosiptalId
;
data
[
'hos
pi
tal_id'
]
=
this
.
hosiptalId
;
data
[
'name'
]
=
this
.
name
;
data
[
'min_price'
]
=
this
.
minPrice
;
data
[
'max_price'
]
=
this
.
maxPrice
;
...
...
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