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
d4498ff3
Commit
d4498ff3
authored
Jul 04, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一键授权接口调试
parent
fedb5de6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
13 deletions
+62
-13
DiscussLowPriceModel.dart
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
+22
-1
DiscussLowPricePopView.dart
...lueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart
+4
-2
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+5
-0
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+21
-0
main.mark.dart
lib/main.mark.dart
+10
-10
No files found.
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
View file @
d4498ff3
...
...
@@ -2,7 +2,7 @@
* @Author: zx
* @Date: 2020-07-03 20:54:59
* @Last Modified by: zx
* @Last Modified time: 2020-07-04 1
1:38:20
* @Last Modified time: 2020-07-04 1
2:20:45
*/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
...
...
@@ -12,9 +12,12 @@ import 'package:gm_flutter/commonModel/rx/RxDispose.dart';
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
class
DiscussLowPriceModel
extends
BaseModel
{
LiveData
<
Pair
<
int
,
DiscussLowPriceModelBean
>>
popViewLive
=
LiveData
();
LiveData
<
bool
>
phoneAuthLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
fetchPopviewData
(
String
planId
,
String
hospitalId
,
String
doctorId
)
{
...
...
@@ -40,6 +43,24 @@ class DiscussLowPriceModel extends BaseModel {
});
}
givePhoneAuth
(
int
leadPhoneRequestId
)
{
ClueApiImpl
.
getInstance
()
.
givePhoneAuth
(
DioUtil
.
getInstance
().
getDio
(),
leadPhoneRequestId
)
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
phoneAuthLive
.
notifyView
(
event
.
data
.
success
);
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
phoneAuthLive
.
notifyView
(
false
);
}
})
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
phoneAuthLive
.
notifyView
(
false
);
NativeToast
.
showNativeToast
(
err
.
message
);
});
}
@override
void
dispose
()
{
popViewLive
.
dispost
();
...
...
lib/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart
View file @
d4498ff3
...
...
@@ -2,7 +2,7 @@
* @Author: zx
* @Date: 2020-07-03 13:53:16
* @Last Modified by: zx
* @Last Modified time: 2020-07-04 1
1:35:29
* @Last Modified time: 2020-07-04 1
2:48:35
*/
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseCenterPicker.dart'
;
...
...
@@ -149,7 +149,9 @@ class _PopView implements ICenterPicker {
),
child:
GestureDetector
(
onTap:
()
{
// TODO 一键授权
// 一键授权
_model
.
givePhoneAuth
(
111
);
dismissCallback
();
},
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
14
),
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
d4498ff3
...
...
@@ -13,6 +13,7 @@ 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'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
@ServiceCenter
()
abstract
class
ClueApi
{
...
...
@@ -53,4 +54,8 @@ abstract class ClueApi {
@Query
(
"hospital_id"
)
String
hospitalId
,
@Query
(
"doctor_id"
)
String
doctorId
,
);
@Get
(
"api/janus/plans/agree_phone_authorize"
)
DiscussLowPriceAuthBean
givePhoneAuth
(
@Query
(
"lead_phone_request_id"
)
int
leadPhoneRequestId
);
}
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
d4498ff3
...
...
@@ -22,6 +22,7 @@ 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'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
const
bool
inProduction
=
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
...
...
@@ -172,6 +173,22 @@ class ClueApiImpl {
});
}
Stream
<
DiscussLowPriceAuthBean
>
givePhoneAuth
(
Dio
_dio
,
int
leadPhoneRequestId
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/agree_phone_authorize'
,
data:
{
'lead_phone_request_id'
:
leadPhoneRequestId
,
})).
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Stream
.
fromFuture
(
compute
(
parseDiscussLowPriceAuthBean
,
value
.
toString
()));
}
else
{
throw
Exception
(
"--未知网络错误--"
);
}
});
}
///==================base method==================
Future
<
Response
>
get
(
Dio
_dio
,
url
,
{
data
,
options
,
cancelToken
})
async
{
...
...
@@ -340,3 +357,7 @@ PlanBarBean parsePlanBarBean(String value) {
DiscussLowPriceModelBean
parseDiscussLowPriceModelBean
(
String
value
)
{
return
DiscussLowPriceModelBean
.
fromJson
(
json
.
decode
(
value
));
}
DiscussLowPriceAuthBean
parseDiscussLowPriceAuthBean
(
String
value
)
{
return
DiscussLowPriceAuthBean
.
fromJson
(
json
.
decode
(
value
));
}
lib/main.mark.dart
View file @
d4498ff3
...
...
@@ -4,13 +4,13 @@
// RouterCenterGenerator
// **************************************************************************
//MainRouterImpl is resign : true
//ClueRouterImpl is resign : true
//MainRouterImpl is resign : true
import
"package:gm_flutter/MainRouter/MainRouterImpl.dart"
;
import
"package:gm_flutter/MainRouter/MainRouter.dart"
;
import
"package:gm_flutter/ClueModel/ClueRouterImpl.dart"
;
import
"package:gm_flutter/ClueModel/ClueRouter.dart"
;
import
"package:gm_flutter/MainRouter/MainRouterImpl.dart"
;
import
"package:gm_flutter/MainRouter/MainRouter.dart"
;
import
"package:flutter_common/Annotations/RouterBaser.dart"
;
...
...
@@ -38,25 +38,25 @@ class RouterCenterImpl {
}
void
init
()
{
map
.
putIfAbsent
(
"MainRouter"
,
()
=>
MainRouterImpl
());
map
.
putIfAbsent
(
"ClueRouter"
,
()
=>
ClueRouterImpl
());
map
.
putIfAbsent
(
"MainRouter"
,
()
=>
MainRouterImpl
());
}
RouterBaser
getModel
(
String
modelName
)
{
return
map
[
modelName
];
}
MainRouter
findMain
Router
()
{
if
(
map
[
"
Main
Router"
]
==
null
)
{
ClueRouter
findClue
Router
()
{
if
(
map
[
"
Clue
Router"
]
==
null
)
{
return
null
;
}
return
map
[
"
MainRouter"
]
as
Main
Router
;
return
map
[
"
ClueRouter"
]
as
Clue
Router
;
}
ClueRouter
findClue
Router
()
{
if
(
map
[
"
Clue
Router"
]
==
null
)
{
MainRouter
findMain
Router
()
{
if
(
map
[
"
Main
Router"
]
==
null
)
{
return
null
;
}
return
map
[
"
ClueRouter"
]
as
Clue
Router
;
return
map
[
"
MainRouter"
]
as
Main
Router
;
}
}
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