Commit 31b86426 authored by 林生雨's avatar 林生雨

fix bug

parent 28d22877
...@@ -14,6 +14,7 @@ import 'package:gm_flutter/commonModel/rx/RxDispose.dart'; ...@@ -14,6 +14,7 @@ import 'package:gm_flutter/commonModel/rx/RxDispose.dart';
import 'package:gm_flutter/commonModel/bean/Pair.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/DiscussLowPriceModelBean.dart';
import 'package:gm_flutter/commonModel/util/NativeToast.dart'; import 'package:gm_flutter/commonModel/util/NativeToast.dart';
import 'package:gm_flutter/commonModel/util/PrintUtil.dart';
class DiscussLowPriceModel extends BaseModel { class DiscussLowPriceModel extends BaseModel {
LiveData<Pair<int, DiscussLowPriceModelBean>> popViewLive = LiveData(); LiveData<Pair<int, DiscussLowPriceModelBean>> popViewLive = LiveData();
...@@ -26,8 +27,10 @@ class DiscussLowPriceModel extends BaseModel { ...@@ -26,8 +27,10 @@ class DiscussLowPriceModel extends BaseModel {
DioUtil.getInstance().getDio(), planId, hospitalId, doctorId) DioUtil.getInstance().getDio(), planId, hospitalId, doctorId)
.listen((event) { .listen((event) {
if (event.error == 0) { if (event.error == 0) {
if (event.data == null) { if (event.data == null || event.data.title == null) {
popViewLive.notifyView(Pair(ENDLOADING, null)); PrintUtil.printBug("");
fail();
// popViewLive.notifyView(Pair(ENDLOADING, null));
} else { } else {
popViewLive.notifyView(Pair(ENDLOADING, event.data)); popViewLive.notifyView(Pair(ENDLOADING, event.data));
} }
......
...@@ -12,6 +12,7 @@ import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.d ...@@ -12,6 +12,7 @@ import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.d
import 'package:gm_flutter/commonModel/bean/Pair.dart'; import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart'; import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import 'package:gm_flutter/commonModel/base/BaseUtil.dart'; import 'package:gm_flutter/commonModel/base/BaseUtil.dart';
import 'package:gm_flutter/commonModel/view/ImagesAnimation.dart';
import 'package:gm_flutter/main.mark.dart'; import 'package:gm_flutter/main.mark.dart';
class DiscussLowPricePopView { class DiscussLowPricePopView {
...@@ -43,7 +44,14 @@ class _PopView implements ICenterPicker { ...@@ -43,7 +44,14 @@ class _PopView implements ICenterPicker {
initialData: _model.popViewLive.data ?? Pair(LOADING, null), initialData: _model.popViewLive.data ?? Pair(LOADING, null),
builder: (c, data) { builder: (c, data) {
if (data.data.first == LOADING) { if (data.data.first == LOADING) {
return loadingItem(); return Center(
child: ImagesAnimation(
h: 100,
durationSeconds: 1500,
entry:
ImagesAnimationEntry(1, 16, "assets/ptr_header_loading")),
);
// loadingItem();
} }
if (data.data.second == null || data.data.first == FAIL) { if (data.data.second == null || data.data.first == FAIL) {
return errorItem(contentWidth, 308.5, () {}); return errorItem(contentWidth, 308.5, () {});
......
...@@ -283,7 +283,7 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -283,7 +283,7 @@ class LevelOneState extends BaseState<LevelOnePage>
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 54, height: 54,
margin: EdgeInsets.only(top: 10, bottom: 12), margin: EdgeInsets.only(top: 4, bottom: 12),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Positioned( Positioned(
...@@ -456,7 +456,7 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -456,7 +456,7 @@ class LevelOneState extends BaseState<LevelOnePage>
children: <Widget>[ children: <Widget>[
Container( Container(
width: 55, width: 55,
child: element.attrName.length < 4 child: element.attrName.length < 5
? Row( ? Row(
children: textList, children: textList,
) )
......
...@@ -416,7 +416,7 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -416,7 +416,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
children: <Widget>[ children: <Widget>[
Container( Container(
width: 55, width: 55,
child: element.attrName.length < 4 child: element.attrName.length < 5
? Row( ? Row(
children: textList, children: textList,
) )
......
...@@ -329,8 +329,12 @@ Widget baseRefreshView(RefreshController refreshController, ...@@ -329,8 +329,12 @@ Widget baseRefreshView(RefreshController refreshController,
// body = Container(); // body = Container();
// } // }
if (mode == LoadStatus.loading) { if (mode == LoadStatus.loading) {
body = Lottie.asset("assets/smart_refresh_header.json", body = ImagesAnimation(
repeat: true, reverse: false); h: 55,
durationSeconds: 1500,
entry: ImagesAnimationEntry(1, 16, "assets/ptr_header_loading"));
// body = Lottie.asset("assets/smart_refresh_header.json",
// repeat: true, reverse: false);
} }
return Container( return Container(
color: loadMoreColor ?? Colors.white, color: loadMoreColor ?? Colors.white,
......
...@@ -474,18 +474,20 @@ class NestedScrollViewRefreshIndicatorState ...@@ -474,18 +474,20 @@ class NestedScrollViewRefreshIndicatorState
child: AnimatedBuilder( child: AnimatedBuilder(
animation: _positionController, animation: _positionController,
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
return Container( return SizedBox(
height: 80, height: 80,
alignment: Alignment.center, // child: ClipRRect(
// child:Center( // borderRadius:
// child: Lottie.asset("assets/smart_refresh_header.json", // BorderRadius.only(bottomRight: Radius.circular(40)),
// repeat: true, reverse: false, fit: BoxFit.fitHeight), // child: Lottie.asset("assets/smart_refresh_header.json",
// repeat: true, reverse: false, fit: BoxFit.cover),
// ), // ),
child: ImagesAnimation( child: ImagesAnimation(
h: 80, h: 80,
durationSeconds: 1500, durationSeconds: 1500,
entry: ImagesAnimationEntry( entry: ImagesAnimationEntry(
1, 16, "assets/ptr_header_loading"))); 1, 16, "assets/ptr_header_loading"))
);
}, },
), ),
), ),
......
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