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
675666c2
Commit
675666c2
authored
Jul 06, 2020
by
杜欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二级方案
parent
478d8063
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
203 additions
and
49 deletions
+203
-49
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+1
-1
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+72
-20
LevelOneFeedList.dart
lib/ClueModel/server/entity/LevelOneFeedList.dart
+128
-26
Api.dart
lib/commonModel/net/Api.dart
+2
-2
No files found.
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
675666c2
/*
* @author
lsy
* @author
dx
* @date 2020/6/29
**/
import
'dart:async'
;
...
...
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
View file @
675666c2
...
...
@@ -2,10 +2,13 @@ import 'package:cached_network_image/cached_network_image.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.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'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
MechanismBox
implements
IBottomPicker
{
VoidCallback
dismissCall
;
...
...
@@ -13,6 +16,11 @@ class MechanismBox implements IBottomPicker {
MechanismModel
_model
=
new
MechanismModel
();
List
<
int
>
doctor_ids
=
new
List
();
LevelOneListModel
_levelModel
=
LevelOneListModel
();
RefreshController
refreshController
=
RefreshController
();
Function
(
String
str
)
refresh
;
@required
final
int
plan_id
;
...
...
@@ -22,6 +30,11 @@ class MechanismBox implements IBottomPicker {
initState
(
dismissCall
,
BuildContext
context
)
{
this
.
dismissCall
=
dismissCall
;
_model
.
getQuestions
(
plan_id
);
_levelModel
.
refreshView
(
true
);
refresh
=
(
str
)
{
_levelModel
.
stateLive
.
notifyView
(
LOADING
);
_levelModel
.
refreshView
(
true
);
};
}
Widget
build
(
BuildContext
context
)
{
...
...
@@ -56,6 +69,9 @@ class MechanismBox implements IBottomPicker {
@override
void
dispose
()
{
textController
.
dispose
();
refreshController
.
dispose
();
_levelModel
.
dispose
();
_model
.
dispose
();
}
setupHome
(
mq
,
keyHeight
)
{
...
...
@@ -114,21 +130,57 @@ class MechanismBox implements IBottomPicker {
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
));
},
));
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
??
[],
builder:
(
c
,
data
)
{
if
(
data
.
data
.
isEmpty
&&
_levelModel
.
page
>
1
)
{
refreshController
.
loadNoData
();
}
else
{
refreshController
.
loadComplete
();
}
return
SliverList
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
{
if
(
index
==
_levelModel
.
data
.
length
)
{
return
Container
(
height:
40
,
color:
Color
(
0xffF7F6FA
),
);
}
dynamic
hospital
=
_levelModel
.
data
[
index
].
hospital
;
hospital
[
"checked"
]
=
false
;
return
HospitalItem
(
hospital
);
},
childCount:
_levelModel
.
data
.
length
+
1
,
),
);
},
),
],
),
onLoading:
()
{
_levelModel
.
loadMore
();
},
pullDown:
false
,
pullUp:
true
));
}
// 机构卡片
Widget
HospitalItem
(
BuildContext
context
,
int
index
)
{
Widget
HospitalItem
(
hospital
)
{
print
(
'object'
);
print
(
hospital
.
toString
());
return
GestureDetector
(
onTap:
()
{},
onTap:
()
{
hospital
.
checked
=
true
;
doctor_ids
.
add
(
hospital
.
hosiptalId
);
},
child:
Container
(
height:
94.5
,
child:
Stack
(
...
...
@@ -139,7 +191,7 @@ class MechanismBox implements IBottomPicker {
child:
Container
(
height:
17
,
width:
17
,
child:
true
child:
hospital
.
checked
?
Image
.
asset
(
"assets/icon-checked.png"
)
:
Image
.
asset
(
"assets/icon-check.png"
),
)),
...
...
@@ -151,10 +203,8 @@ class MechanismBox implements IBottomPicker {
height:
45
,
child:
ClipOval
(
child:
CachedNetworkImage
(
// imageUrl: cards.hospital.portrait,
imageUrl:
'https://img1.gamersky.com/image2019/07/20190725_ll_red_136_2/gamersky_07small_14_201972510258D0.jpg'
,
),
// imageUrl: cards.hospital.portrait,
imageUrl:
hospital
.
portrait
),
),
),
),
...
...
@@ -163,7 +213,8 @@ class MechanismBox implements IBottomPicker {
top:
17.5
,
// child: baseText(cards.hospital.name, 15, Color(0xff333333),
// bold: true),
child:
baseText
(
'22222'
,
15
,
Color
(
0xff333333
),
bold:
true
),
child:
baseText
(
hospital
.
name
,
15
,
Color
(
0xff333333
),
bold:
true
),
),
Positioned
(
top:
42.5
,
...
...
@@ -173,7 +224,8 @@ class MechanismBox implements IBottomPicker {
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
baseText
(
"¥"
,
12
,
Color
(
0xffFF5963
)),
baseText
(
"
${1}
-
${2}
"
,
15
,
Color
(
0xffFF5963
)),
baseText
(
"
${hospital.minPrice}
-
${hospital.maxPrice}
"
,
15
,
Color
(
0xffFF5963
)),
],
),
),
...
...
@@ -181,12 +233,12 @@ class MechanismBox implements IBottomPicker {
bottom:
21
,
left:
89
,
// child: baseText(cards.hospital.address, 12, Color(0xff666666)),
child:
baseText
(
'dsssssssss'
,
12
,
Color
(
0xff666666
)),
child:
baseText
(
hospital
.
address
,
12
,
Color
(
0xff666666
)),
),
Positioned
(
left:
89
,
top:
38.5
,
child:
FiveStarView
(
2
,
5
),
child:
FiveStarView
(
int
.
parse
(
hospital
.
star
)
,
5
),
)
],
),
...
...
lib/ClueModel/server/entity/LevelOneFeedList.dart
View file @
675666c2
...
...
@@ -10,14 +10,22 @@ class LevelOneFeedList {
UserType
userType
;
Data
data
;
LevelOneFeedList
({
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
LevelOneFeedList
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
LevelOneFeedList
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
message
=
json
[
'message'
];
extra
=
json
[
'extra'
];
errorExtra
=
json
[
'error_extra'
];
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
}
...
...
@@ -38,17 +46,14 @@ class LevelOneFeedList {
}
class
UserType
{
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
}
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
class
Data
{
...
...
@@ -59,7 +64,9 @@ class Data {
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'cards'
]
!=
null
)
{
cards
=
new
List
<
Cards
>();
json
[
'cards'
].
forEach
((
v
)
{
cards
.
add
(
new
Cards
.
fromJson
(
v
));
});
json
[
'cards'
].
forEach
((
v
)
{
cards
.
add
(
new
Cards
.
fromJson
(
v
));
});
}
}
...
...
@@ -84,8 +91,11 @@ class Cards {
Cards
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
cardType
=
json
[
'card_type'
];
plan
=
json
[
'plan'
]
!=
null
?
new
Plan
.
fromJson
(
json
[
'plan'
])
:
null
;
hospital
=
json
[
'hospital'
]
!=
null
?
new
Hospital
.
fromJson
(
json
[
'hospital'
])
:
null
;
doctor
=
json
[
'doctor'
]
!=
null
?
new
Doctor
.
fromJson
(
json
[
'doctor'
])
:
null
;
hospital
=
json
[
'hospital'
]
!=
null
?
new
Hospital
.
fromJson
(
json
[
'hospital'
])
:
null
;
doctor
=
json
[
'doctor'
]
!=
null
?
new
Doctor
.
fromJson
(
json
[
'doctor'
])
:
null
;
diary
=
json
[
'diary'
]
!=
null
?
new
Diary
.
fromJson
(
json
[
'diary'
])
:
null
;
}
...
...
@@ -119,7 +129,16 @@ class Plan {
String
consultType
;
String
messageUrl
;
Plan
({
this
.
planName
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
baseAttrs
,
this
.
projectImage
,
this
.
consultType
,
this
.
messageUrl
});
Plan
(
{
this
.
planName
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
baseAttrs
,
this
.
projectImage
,
this
.
consultType
,
this
.
messageUrl
});
Plan
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
planName
=
json
[
'plan_name'
];
...
...
@@ -129,7 +148,9 @@ class Plan {
salesCount
=
json
[
'sales_count'
];
if
(
json
[
'base_attrs'
]
!=
null
)
{
baseAttrs
=
new
List
<
BaseAttrs
>();
json
[
'base_attrs'
].
forEach
((
v
)
{
baseAttrs
.
add
(
new
BaseAttrs
.
fromJson
(
v
));
});
json
[
'base_attrs'
].
forEach
((
v
)
{
baseAttrs
.
add
(
new
BaseAttrs
.
fromJson
(
v
));
});
}
projectImage
=
json
[
'project_image'
];
consultType
=
json
[
'consult_type'
];
...
...
@@ -174,6 +195,7 @@ class BaseAttrs {
class
Hospital
{
String
portrait
;
String
hosiptalId
;
String
name
;
String
minPrice
;
String
maxPrice
;
...
...
@@ -182,10 +204,19 @@ class Hospital {
String
consultType
;
String
messageUrl
;
Hospital
({
this
.
portrait
,
this
.
name
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
star
,
this
.
address
,
this
.
consultType
,
this
.
messageUrl
});
Hospital
(
{
this
.
portrait
,
this
.
name
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
star
,
this
.
address
,
this
.
consultType
,
this
.
messageUrl
});
Hospital
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
portrait
=
json
[
'portrait'
];
hosiptalId
=
json
[
'hosiptal_id'
];
name
=
json
[
'name'
];
minPrice
=
json
[
'min_price'
];
maxPrice
=
json
[
'max_price'
];
...
...
@@ -198,6 +229,7 @@ class Hospital {
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'portrait'
]
=
this
.
portrait
;
data
[
'hosiptal_id'
]
=
this
.
hosiptalId
;
data
[
'name'
]
=
this
.
name
;
data
[
'min_price'
]
=
this
.
minPrice
;
data
[
'max_price'
]
=
this
.
maxPrice
;
...
...
@@ -219,7 +251,15 @@ class Doctor {
String
consultType
;
String
messageUrl
;
Doctor
({
this
.
portrait
,
this
.
name
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
star
,
this
.
title
,
this
.
consultType
,
this
.
messageUrl
});
Doctor
(
{
this
.
portrait
,
this
.
name
,
this
.
minPrice
,
this
.
maxPrice
,
this
.
star
,
this
.
title
,
this
.
consultType
,
this
.
messageUrl
});
Doctor
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
portrait
=
json
[
'portrait'
];
...
...
@@ -285,7 +325,44 @@ class Diary {
UserLevel
userLevel
;
int
serviceId
;
Diary
({
this
.
diaryNum
,
this
.
videoUrl
,
this
.
isIdentification
,
this
.
isLiked
,
this
.
titleStyleType
,
this
.
replyNum
,
this
.
lasestTopicCreatedTime
,
this
.
images
,
this
.
relationServiceSku
,
this
.
createdTime
,
this
.
latestTopicId
,
this
.
id
,
this
.
city
,
this
.
userId
,
this
.
title
,
this
.
isVoted
,
this
.
diaryId
,
this
.
preImageList
,
this
.
voteNum
,
this
.
tagsNewEra
,
this
.
content
,
this
.
videoPic
,
this
.
shortVideoUrl
,
this
.
diaryAmount
,
this
.
diaryTitle
,
this
.
authorType
,
this
.
tags
,
this
.
contentLevel
,
this
.
lastModified
,
this
.
user
,
this
.
isOnline
,
this
.
date
,
this
.
membershipLevel
,
this
.
viewNum
,
this
.
postImageList
,
this
.
userLevel
,
this
.
serviceId
});
Diary
(
{
this
.
diaryNum
,
this
.
videoUrl
,
this
.
isIdentification
,
this
.
isLiked
,
this
.
titleStyleType
,
this
.
replyNum
,
this
.
lasestTopicCreatedTime
,
this
.
images
,
this
.
relationServiceSku
,
this
.
createdTime
,
this
.
latestTopicId
,
this
.
id
,
this
.
city
,
this
.
userId
,
this
.
title
,
this
.
isVoted
,
this
.
diaryId
,
this
.
preImageList
,
this
.
voteNum
,
this
.
tagsNewEra
,
this
.
content
,
this
.
videoPic
,
this
.
shortVideoUrl
,
this
.
diaryAmount
,
this
.
diaryTitle
,
this
.
authorType
,
this
.
tags
,
this
.
contentLevel
,
this
.
lastModified
,
this
.
user
,
this
.
isOnline
,
this
.
date
,
this
.
membershipLevel
,
this
.
viewNum
,
this
.
postImageList
,
this
.
userLevel
,
this
.
serviceId
});
Diary
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
diaryNum
=
json
[
'diary_num'
];
...
...
@@ -297,9 +374,13 @@ class Diary {
lasestTopicCreatedTime
=
json
[
'lasest_topic_created_time'
];
if
(
json
[
'images'
]
!=
null
)
{
images
=
new
List
<
Images
>();
json
[
'images'
].
forEach
((
v
)
{
images
.
add
(
new
Images
.
fromJson
(
v
));
});
json
[
'images'
].
forEach
((
v
)
{
images
.
add
(
new
Images
.
fromJson
(
v
));
});
}
relationServiceSku
=
json
[
'relation_service_sku'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'relation_service_sku'
])
:
null
;
relationServiceSku
=
json
[
'relation_service_sku'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'relation_service_sku'
])
:
null
;
createdTime
=
json
[
'created_time'
];
latestTopicId
=
json
[
'latest_topic_id'
];
id
=
json
[
'id'
];
...
...
@@ -312,7 +393,9 @@ class Diary {
voteNum
=
json
[
'vote_num'
];
if
(
json
[
'tags_new_era'
]
!=
null
)
{
tagsNewEra
=
new
List
<
TagsNewEra
>();
json
[
'tags_new_era'
].
forEach
((
v
)
{
tagsNewEra
.
add
(
new
TagsNewEra
.
fromJson
(
v
));
});
json
[
'tags_new_era'
].
forEach
((
v
)
{
tagsNewEra
.
add
(
new
TagsNewEra
.
fromJson
(
v
));
});
}
content
=
json
[
'content'
];
videoPic
=
json
[
'video_pic'
];
...
...
@@ -322,7 +405,9 @@ class Diary {
authorType
=
json
[
'author_type'
];
if
(
json
[
'tags'
]
!=
null
)
{
tags
=
new
List
<
Tags
>();
json
[
'tags'
].
forEach
((
v
)
{
tags
.
add
(
new
Tags
.
fromJson
(
v
));
});
json
[
'tags'
].
forEach
((
v
)
{
tags
.
add
(
new
Tags
.
fromJson
(
v
));
});
}
contentLevel
=
json
[
'content_level'
];
lastModified
=
json
[
'last_modified'
];
...
...
@@ -332,7 +417,9 @@ class Diary {
membershipLevel
=
json
[
'membership_level'
];
viewNum
=
json
[
'view_num'
];
postImageList
=
json
[
'post_image_list'
].
cast
<
String
>();
userLevel
=
json
[
'user_level'
]
!=
null
?
new
UserLevel
.
fromJson
(
json
[
'user_level'
])
:
null
;
userLevel
=
json
[
'user_level'
]
!=
null
?
new
UserLevel
.
fromJson
(
json
[
'user_level'
])
:
null
;
serviceId
=
json
[
'service_id'
];
}
...
...
@@ -402,7 +489,16 @@ class Images {
String
imageHalf
;
String
desc
;
Images
({
this
.
imageWide
,
this
.
imageType
,
this
.
image
,
this
.
sImagePlatform
,
this
.
imageSlimwidth
,
this
.
smallWide
,
this
.
imageThumb
,
this
.
imageHalf
,
this
.
desc
});
Images
(
{
this
.
imageWide
,
this
.
imageType
,
this
.
image
,
this
.
sImagePlatform
,
this
.
imageSlimwidth
,
this
.
smallWide
,
this
.
imageThumb
,
this
.
imageHalf
,
this
.
desc
});
Images
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
imageWide
=
json
[
'image_wide'
];
...
...
@@ -465,7 +561,14 @@ class User {
String
userName
;
String
membershipLevel
;
User
({
this
.
city
,
this
.
userId
,
this
.
topicNumPosted
,
this
.
voteNumGained
,
this
.
portrait
,
this
.
userName
,
this
.
membershipLevel
});
User
(
{
this
.
city
,
this
.
userId
,
this
.
topicNumPosted
,
this
.
voteNumGained
,
this
.
portrait
,
this
.
userName
,
this
.
membershipLevel
});
User
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
city
=
json
[
'city'
];
...
...
@@ -536,4 +639,3 @@ class Tags {
return
data
;
}
}
lib/commonModel/net/Api.dart
View file @
675666c2
...
...
@@ -19,8 +19,8 @@ const String APP_HOST_RELEASE = "https://x6cgr5y5-gengmei.mock.coding.io";
*/
//const String APP_HOST_DEBUG = "http://backend.paas-merchant.envs";
//const String APP_HOST_DEBUG = "http://doctor.paas-merchant.env";
//
const String APP_HOST_DEBUG = "https://x6cgr5y5-gengmei.mock.coding.io";
const
String
APP_HOST_DEBUG
=
"http://backend.paas-merchant.env"
;
const
String
APP_HOST_DEBUG
=
"https://x6cgr5y5-gengmei.mock.coding.io"
;
//
const String APP_HOST_DEBUG = "http://backend.paas-merchant.env";
//const String APP_HOST_DEBUG = "http://janus.paas-merchant.env";
/**
...
...
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