Commit 006e8411 authored by 林生雨's avatar 林生雨

commit

parent d97ed16c
......@@ -5,6 +5,7 @@
* @Last Modified time: 2020-07-04 14:41:41
*/
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
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';
......@@ -18,7 +19,8 @@ class DiscussLowPriceModel extends BaseModel {
LiveData<Pair<int, DiscussLowPriceModelBean>> popViewLive = LiveData();
RxDispose rxDispose = RxDispose();
fetchPopviewData(String planId, String hospitalId, String doctorId) {
fetchPopviewData(
String planId, String hospitalId, String doctorId, VoidCallback fail) {
ClueApiImpl.getInstance()
.getPopviewData(
DioUtil.getInstance().getDio(), planId, hospitalId, doctorId)
......@@ -31,13 +33,15 @@ class DiscussLowPriceModel extends BaseModel {
}
} else {
NativeToast.showNativeToast(event.message);
popViewLive.notifyView(Pair(FAIL, null));
// popViewLive.notifyView(Pair(FAIL, null));
fail();
}
})
.addToDispose(rxDispose)
.onError((err) {
popViewLive.notifyView(Pair(FAIL, null));
// popViewLive.notifyView(Pair(FAIL, null));
NativeToast.showNativeToast(err.message);
fail();
});
}
......
......@@ -42,6 +42,16 @@ class _PopView implements ICenterPicker {
if (data.data.first == LOADING) {
return loadingItem();
}
// if(data.data.first==EMPTY||data.data.first==FAIL){
// return Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(7),
// color: Colors.white,
// ),
// width: contentWidth,
// height: 308.5,
// );
// }
if (data.data.second == null || data.data.first == FAIL) {
return errorItem(contentWidth, 308.5, () {});
}
......@@ -183,6 +193,8 @@ class _PopView implements ICenterPicker {
@override
void initState(VoidCallback dismissCall, BuildContext context) {
this.dismissCallback = dismissCall;
_model.fetchPopviewData(this.planId, this.hospitalId, this.doctorId);
_model.fetchPopviewData(this.planId, this.hospitalId, this.doctorId,(){
dismissCallback();
});
}
}
......@@ -56,8 +56,11 @@ class LevelOneListState extends State<LevelOneList>
@override
Widget build(BuildContext context) {
super.build(context);
return baseStateView(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, _model.stateLive, pages(), () {
return baseStateView(
MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height ,
_model.stateLive,
pages(), () {
_model.refreshView(true);
}, paddingTop: widget.topHeight);
}
......
......@@ -47,6 +47,8 @@ class LevelOneState extends BaseState<LevelOnePage>
int index = 0;
double stateBarHeight = 0;
@override
void initState() {
DioUtil.getInstance().setProxy("172.30.8.245");
......@@ -84,6 +86,8 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
Widget buildItem(BuildContext context) {
stateBarHeight = MediaQueryData.fromWindow(window).padding.top;
oneList.clear();
oneList.add(good());
oneList.add(rect());
......@@ -165,12 +169,11 @@ class LevelOneState extends BaseState<LevelOnePage>
Widget newHome() {
List<Widget> list = [];
var d = MediaQueryData.fromWindow(window).padding.top;
for (int i = 0; i < _model.tabsList.length; i++) {
list.add(extend.NestedScrollViewInnerScrollPositionKeyWidget(
Key("Tab${i}"),
LevelOneList(
widget.planId, _model.tabsList[i].tabType, kToolbarHeight + d)));
LevelOneList(widget.planId, _model.tabsList[i].tabType,
kToolbarHeight + stateBarHeight)));
}
final double statusBarHeight = MediaQuery.of(context).padding.top;
final double pinnedHeaderHeight = statusBarHeight + kToolbarHeight;
......@@ -184,8 +187,7 @@ class LevelOneState extends BaseState<LevelOnePage>
SliverOverlapAbsorber(
handle: extend.NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: baseSliverAppBar(
_model.imageUrl)),
sliver: baseSliverAppBar(_model.imageUrl)),
SliverList(
delegate: SliverChildBuilderDelegate((BuildContext c, int i) {
if (i == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment