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
0ccb66e1
Commit
0ccb66e1
authored
Jul 03, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商议低价 bean
parent
925063f7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
2 deletions
+142
-2
DiscussLowPriceModel.dart
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
+14
-0
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+8
-0
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+22
-0
DiscussLowPriceModelBean.dart
lib/ClueModel/server/entity/DiscussLowPriceModelBean.dart
+97
-0
TestPage.dart
lib/MainRouter/page/test/TestPage.dart
+1
-2
No files found.
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
0 → 100644
View file @
0ccb66e1
/*
* @Author: zx
* @Date: 2020-07-03 20:54:59
* @Last Modified by: zx
* @Last Modified time: 2020-07-03 20:54:59
*/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
lib/ClueModel/server/api/ClueApi.dart
View file @
0ccb66e1
...
...
@@ -12,6 +12,7 @@ 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'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
@ServiceCenter
()
abstract
class
ClueApi
{
...
...
@@ -45,4 +46,11 @@ abstract class ClueApi {
@Get
(
"api/janus/plans/rank"
)
PlanBarBean
getPlanBar
(
@Query
(
"rank_type"
)
String
rank_type
);
@Get
(
"api/janus/plans/compare"
)
DiscussLowPriceModelBean
getPopviewData
(
@Query
(
"plan_id"
)
String
plan_id
,
@Query
(
"hospital_id"
)
String
hospital_id
,
@Query
(
"doctor_id"
)
String
doctor_id
,
);
}
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
0ccb66e1
...
...
@@ -21,6 +21,7 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
const
bool
inProduction
=
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
...
...
@@ -153,6 +154,23 @@ class ClueApiImpl {
});
}
Stream
<
DiscussLowPriceModelBean
>
getPopviewData
(
Dio
_dio
,
String
plan_id
,
String
hospital_id
,
String
doctor_id
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/compare'
,
data:
{
'plan_id'
:
plan_id
,
'hospital_id'
:
hospital_id
,
'doctor_id'
:
doctor_id
,
})).
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Stream
.
fromFuture
(
compute
(
parseDiscussLowPriceModelBean
,
value
.
toString
()));
}
else
{
throw
Exception
(
"--未知网络错误--"
);
}
});
}
///==================base method==================
Future
<
Response
>
get
(
Dio
_dio
,
url
,
{
data
,
options
,
cancelToken
})
async
{
...
...
@@ -317,3 +335,7 @@ PlanFeedBean parsePlanFeedBean(String value) {
PlanBarBean
parsePlanBarBean
(
String
value
)
{
return
PlanBarBean
.
fromJson
(
json
.
decode
(
value
));
}
DiscussLowPriceModelBean
parseDiscussLowPriceModelBean
(
String
value
)
{
return
DiscussLowPriceModelBean
.
fromJson
(
json
.
decode
(
value
));
}
lib/ClueModel/server/entity/DiscussLowPriceModelBean.dart
0 → 100644
View file @
0ccb66e1
/*
* @Author: zx
* @Date: 2020-07-03 20:56:15
* @Last Modified by: zx
* @Last Modified time: 2020-07-03 20:57:44
*/
class
DiscussLowPriceModelBean
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
Data
data
;
DiscussLowPriceModelBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
DiscussLowPriceModelBean
.
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
{
int
leadPhoneRequestId
;
int
authorizeType
;
String
icon
;
String
tip
;
String
title
;
String
authorizePhone
;
Data
(
{
this
.
leadPhoneRequestId
,
this
.
authorizeType
,
this
.
icon
,
this
.
tip
,
this
.
title
,
this
.
authorizePhone
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
leadPhoneRequestId
=
json
[
'lead_phone_request_id'
];
authorizeType
=
json
[
'authorize_type'
];
icon
=
json
[
'icon'
];
tip
=
json
[
'tip'
];
title
=
json
[
'title'
];
authorizePhone
=
json
[
'authorize_phone'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'lead_phone_request_id'
]
=
this
.
leadPhoneRequestId
;
data
[
'authorize_type'
]
=
this
.
authorizeType
;
data
[
'icon'
]
=
this
.
icon
;
data
[
'tip'
]
=
this
.
tip
;
data
[
'title'
]
=
this
.
title
;
data
[
'authorize_phone'
]
=
this
.
authorizePhone
;
return
data
;
}
}
lib/MainRouter/page/test/TestPage.dart
View file @
0ccb66e1
...
...
@@ -9,8 +9,7 @@ import 'package:gm_flutter/MainRouter/page/proxy/NetProxyPage.dart';
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:gm_flutter/ClueModel/view/DiscussLowPricePopView.dart'
;
import
'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart'
;
import
'TP.dart'
;
class
TestPage
extends
StatefulWidget
{
...
...
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