Commit 966fb05c authored by 朱翠翠's avatar 朱翠翠

Merge branch 'test' of http://git.wanmeizhensuo.com/linshengyu/gm_flutter into zcc/flutter

parents 1d94117c ef179381
...@@ -38,7 +38,6 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -38,7 +38,6 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
@override @override
void initState() { void initState() {
// DioUtil.getInstance().setProxy("172.30.9.128");
super.initState(); super.initState();
_model.init(widget._planIds); _model.init(widget._planIds);
} }
...@@ -472,7 +471,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -472,7 +471,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
flex: 1, flex: 1,
child: baseText(left.empty() ? "暂无" : left, 12, child: baseText(left.empty() ? "暂无" : left, 12,
isName ? Color(0xff666666) : Color(0xff3FB5AF), isName ? Color(0xff666666) : Color(0xff3FB5AF),
bold: isName ? false : true, maxLines: 100, isWarp: true, textAlign: TextAlign.end), bold: isName ? false : true,
maxLines: 100,
isWarp: true,
textAlign: TextAlign.end),
), ),
Container( Container(
width: 40, width: 40,
...@@ -481,7 +483,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -481,7 +483,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
flex: 1, flex: 1,
child: baseText(right.empty() ? "暂无" : right, 12, child: baseText(right.empty() ? "暂无" : right, 12,
isName ? Color(0xff666666) : Color(0xffF25874), isName ? Color(0xff666666) : Color(0xffF25874),
bold: isName ? false : true, bold: isName ? false : true,
maxLines: 100, maxLines: 100,
isWarp: true, isWarp: true,
textAlign: TextAlign.start)) textAlign: TextAlign.start))
......
...@@ -64,7 +64,6 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -64,7 +64,6 @@ class LevelOneState extends BaseState<LevelOnePage>
@override @override
void initState() { void initState() {
// DioUtil.getInstance().setProxy("172.30.8.245");
super.initState(); super.initState();
_model.plan_id = widget.planId; _model.plan_id = widget.planId;
_model.init(() { _model.init(() {
...@@ -255,9 +254,7 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -255,9 +254,7 @@ class LevelOneState extends BaseState<LevelOnePage>
List<Widget> getTabs() { List<Widget> getTabs() {
List<Widget> list = []; List<Widget> list = [];
for (int i = 0; i < _model.tabsList.length; i++) { for (int i = 0; i < _model.tabsList.length; i++) {
list.add(baseTabBarItem(_model.tabsList[i].name, list.add(baseTabBarItem(_model.tabsList[i].name));
leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabsList.length - 1 ? 21.5 : 14));
} }
return list; return list;
} }
...@@ -441,32 +438,29 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -441,32 +438,29 @@ class LevelOneState extends BaseState<LevelOnePage>
)); ));
if (_model.planoverItem != null) { if (_model.planoverItem != null) {
_model.planoverItem.explanationAttrs.forEach((element) { _model.planoverItem.explanationAttrs.forEach((element) {
List<Widget> textList = [];
if (element.attrName.length < 4) {
for (int i = 0; i < element.attrName.length; i++) {
textList.add(baseText(
element.attrName.substring(i, i + 1), 13, Color(0xff999999)));
if (i < element.attrName.length - 1) {
textList.add(Expanded(
child: Container(),
));
}
}
}
list.add(Container( list.add(Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Container(
width: 55, width: 52,
// constraints: BoxConstraints( child: element.attrName.length < 4
// maxWidth: 55, ? Row(
// minWidth: 50 children: textList,
// ), )
child: Text( : baseText(element.attrName, 13, Color(0xff999999))),
element.attrName.length == 2
? "${element.attrName.substring(0, 1)} ${element.attrName.substring(1, 2)}"
: element.attrName,
textScaleFactor: 1.0,
softWrap: true,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 13,
color: Color(0xff999999),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
)),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12), margin: EdgeInsets.only(left: 12),
...@@ -482,8 +476,6 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -482,8 +476,6 @@ class LevelOneState extends BaseState<LevelOnePage>
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400),
), ),
// baseText(element.attrValue, 13, Color(0xff666666)
// ),
), ),
) )
], ],
...@@ -522,7 +514,7 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -522,7 +514,7 @@ class LevelOneState extends BaseState<LevelOnePage>
.jumpPage(context, "level_one_plan_compare", map, false); .jumpPage(context, "level_one_plan_compare", map, false);
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 21), margin: EdgeInsets.only(left: 21, right: 20),
width: 30, width: 30,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -541,56 +533,62 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -541,56 +533,62 @@ class LevelOneState extends BaseState<LevelOnePage>
), ),
), ),
Expanded( Expanded(
child: Container(), child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (CacheManager.getInstance()
.get(MEMORY_CACHE)
.get(USER_ID) ==
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
BaseBottomPicker()
..setPicker(MechanismBox(widget.planId, widget.PAGE_NAME))
..show(context);
},
child: Container(
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("咨询", 14, Colors.white, bold: true),
))),
Container(
width: 15,
), ),
GestureDetector( Expanded(
behavior: HitTestBehavior.opaque, child: GestureDetector(
onTap: () { behavior: HitTestBehavior.opaque,
if (CacheManager.getInstance().get(MEMORY_CACHE).get(USER_ID) == onTap: () {
null && if (CacheManager.getInstance()
RouterCenterImpl().findMainRouter().isWithNative()) { .get(MEMORY_CACHE)
RouterCenterImpl() .get(USER_ID) ==
.findMainRouter() null &&
.jumpPage(context, "show_login", null, true); RouterCenterImpl().findMainRouter().isWithNative()) {
return; RouterCenterImpl()
} .findMainRouter()
BaseBottomPicker() .jumpPage(context, "show_login", null, true);
..setPicker(MechanismBox(widget.planId, widget.PAGE_NAME)) return;
..show(context); }
}, DiscussLowPricePopView.showPopView(
child: Container( context, widget.PAGE_NAME, "${widget.planId}", "", "");
width: ScreenUtil().setWidth(137), },
height: 40, child: Container(
decoration: BoxDecoration( height: 40,
color: Color(0xff51CDC7), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)), color: Color(0xffF96079),
alignment: Alignment.center, borderRadius: BorderRadius.circular(20)),
child: baseText("咨询", 14, Colors.white, bold: true), alignment: Alignment.center,
)), child: baseText("获取底价", 14, Colors.white, bold: true),
GestureDetector( ))),
behavior: HitTestBehavior.opaque, Container(
onTap: () { width: 15,
if (CacheManager.getInstance().get(MEMORY_CACHE).get(USER_ID) == )
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
DiscussLowPricePopView.showPopView(
context, widget.PAGE_NAME, "${widget.planId}", "", "");
},
child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
width: ScreenUtil().setWidth(137),
height: 40,
decoration: BoxDecoration(
color: Color(0xffF96079),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("获取底价", 14, Colors.white, bold: true),
)),
], ],
), ),
); );
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* @date 2020/6/29 * @date 2020/6/29
**/ **/
import 'dart:async'; import 'dart:async';
import 'dart:math';
import 'dart:ui'; import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
...@@ -25,7 +24,6 @@ import 'package:gm_flutter/commonModel/base/BaseState.dart'; ...@@ -25,7 +24,6 @@ import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart'; import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/cache/CacheManager.dart'; import 'package:gm_flutter/commonModel/cache/CacheManager.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'; import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/net/DioUtil.dart';
import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart'; import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import 'package:gm_flutter/main.mark.dart'; import 'package:gm_flutter/main.mark.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
...@@ -58,7 +56,6 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -58,7 +56,6 @@ class LevelTwoState extends BaseState<LevelTwoPage>
@override @override
void initState() { void initState() {
// DioUtil.getInstance().setProxy('172.30.9.253');
super.initState(); super.initState();
_model.plan_id = widget.planId; _model.plan_id = widget.planId;
_model.init(() { _model.init(() {
...@@ -255,9 +252,7 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -255,9 +252,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
List<Widget> getTabs() { List<Widget> getTabs() {
List<Widget> list = []; List<Widget> list = [];
for (int i = 0; i < _model.tabsList.length; i++) { for (int i = 0; i < _model.tabsList.length; i++) {
list.add(baseTabBarItem(_model.tabsList[i].name, list.add(baseTabBarItem(_model.tabsList[i].name));
leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabsList.length - 1 ? 21.5 : 14));
} }
return list; return list;
} }
...@@ -384,7 +379,7 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -384,7 +379,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
List<Widget> list = []; List<Widget> list = [];
list.add(Row( list.add(Row(
children: <Widget>[ children: <Widget>[
baseText("项目说明", 15, Color(0xff282828),bold: true), baseText("项目说明", 15, Color(0xff282828), bold: true),
Expanded( Expanded(
child: Container(), child: Container(),
), ),
...@@ -409,27 +404,29 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -409,27 +404,29 @@ class LevelTwoState extends BaseState<LevelTwoPage>
)); ));
if (_model.planoverItem != null) { if (_model.planoverItem != null) {
_model.planoverItem.explanationAttrs.forEach((element) { _model.planoverItem.explanationAttrs.forEach((element) {
List<Widget> textList = [];
if (element.attrName.length < 4) {
for (int i = 0; i < element.attrName.length; i++) {
textList.add(baseText(
element.attrName.substring(i, i + 1), 13, Color(0xff999999)));
if (i < element.attrName.length - 1) {
textList.add(Expanded(
child: Container(),
));
}
}
}
list.add(Container( list.add(Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Container(
width: 55, width: 52,
child: Text( child: element.attrName.length < 4
element.attrName.length == 2 ? Row(
? "${element.attrName.substring(0, 1)} ${element.attrName.substring(1, 2)}" children: textList,
: element.attrName, )
textScaleFactor: 1.0, : baseText(element.attrName, 13, Color(0xff999999))),
softWrap: true,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 13,
color: Color(0xff999999),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
)),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12), margin: EdgeInsets.only(left: 12),
...@@ -486,7 +483,7 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -486,7 +483,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
.jumpPage(context, "level_two_plan_compare", map, false); .jumpPage(context, "level_two_plan_compare", map, false);
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 21), margin: EdgeInsets.only(left: 21, right: 20),
width: 30, width: 30,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -504,58 +501,64 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -504,58 +501,64 @@ class LevelTwoState extends BaseState<LevelTwoPage>
), ),
), ),
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (CacheManager.getInstance().get(MEMORY_CACHE).get(USER_ID) ==
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
BaseBottomPicker()
..setPicker(MechanismBox(widget.planId, widget.PAGE_NAME))
..show(context);
},
child: Container(
width: ScreenUtil().setWidth(137),
margin: EdgeInsets.only(left: 20),
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("咨询", 14, Colors.white, bold: true),
)),
Expanded( Expanded(
child: Container(), child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (CacheManager.getInstance()
.get(MEMORY_CACHE)
.get(USER_ID) ==
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
BaseBottomPicker()
..setPicker(MechanismBox(widget.planId, widget.PAGE_NAME))
..show(context);
},
child: Container(
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("咨询", 14, Colors.white, bold: true),
)),
),
Container(
width: 15,
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (CacheManager.getInstance()
.get(MEMORY_CACHE)
.get(USER_ID) ==
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
DiscussLowPricePopView.showPopView(
context, widget.PAGE_NAME, "${widget.planId}", "", "");
},
child: Container(
height: 40,
decoration: BoxDecoration(
color: Color(0xffF96079),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("获取底价", 14, Colors.white, bold: true),
))),
Container(
width: 15,
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (CacheManager.getInstance().get(MEMORY_CACHE).get(USER_ID) ==
null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "show_login", null, true);
return;
}
DiscussLowPricePopView.showPopView(
context, widget.PAGE_NAME, "${widget.planId}", "", "");
},
child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
width: ScreenUtil().setWidth(137),
height: 40,
decoration: BoxDecoration(
color: Color(0xffF96079),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("获取底价", 14, Colors.white, bold: true),
)),
], ],
), ),
); );
......
...@@ -63,7 +63,7 @@ class MechanismBox implements IBottomPicker { ...@@ -63,7 +63,7 @@ class MechanismBox implements IBottomPicker {
color: Colors.white, color: Colors.white,
), ),
width: mq.size.width, width: mq.size.width,
height: mq.size.height - 140, height: mq.size.height - mq.size.height / 5,
child: StreamBuilder( child: StreamBuilder(
stream: _model.stateLive.stream, stream: _model.stateLive.stream,
initialData: _model.stateLive.data ?? LOADING, initialData: _model.stateLive.data ?? LOADING,
...@@ -93,6 +93,7 @@ class MechanismBox implements IBottomPicker { ...@@ -93,6 +93,7 @@ class MechanismBox implements IBottomPicker {
} }
setupHome(mq, keyHeight, BuildContext context) { setupHome(mq, keyHeight, BuildContext context) {
var heigth = mq.size.height - (mq.size.height / 5) - 146 - keyHeight;
return Column( return Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
...@@ -104,24 +105,22 @@ class MechanismBox implements IBottomPicker { ...@@ -104,24 +105,22 @@ class MechanismBox implements IBottomPicker {
if (data.data == LOADING) { if (data.data == LOADING) {
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: mq.size.height - 140 - 96 - 50 - keyHeight, height: heigth,
child: loadingItem(), child: loadingItem(),
); );
} }
if (data.data == FAIL) { if (data.data == FAIL) {
return errorItem(MediaQuery.of(context).size.width, return errorItem(MediaQuery.of(context).size.width, heigth, () {
mq.size.height - 140 - 96 - 50 - keyHeight, () {
_model.refreshView(true); _model.refreshView(true);
}); });
} }
if (data.data == EMPTY) { if (data.data == EMPTY) {
return emptyItem(MediaQuery.of(context).size.width, return emptyItem(MediaQuery.of(context).size.width, heigth)
mq.size.height - 140 - 96 - 50 - keyHeight)
.gestureDetector(() { .gestureDetector(() {
focusNode.unfocus(); focusNode.unfocus();
}); });
} }
return mechanismList(mq, keyHeight); return mechanismList(mq, heigth);
}, },
), ),
bottomMessage(context) bottomMessage(context)
...@@ -165,9 +164,9 @@ class MechanismBox implements IBottomPicker { ...@@ -165,9 +164,9 @@ class MechanismBox implements IBottomPicker {
} }
// 机构列表 // 机构列表
Widget mechanismList(mq, keyHeight) { Widget mechanismList(mq, heigth) {
return Container( return Container(
height: mq.size.height - 286 - keyHeight, height: heigth,
width: mq.size.width, width: mq.size.width,
padding: EdgeInsets.only(left: 15, right: 15), padding: EdgeInsets.only(left: 15, right: 15),
child: baseRefreshView(refreshController, () {}, null, null, child: baseRefreshView(refreshController, () {}, null, null,
...@@ -383,7 +382,6 @@ class MechanismBox implements IBottomPicker { ...@@ -383,7 +382,6 @@ class MechanismBox implements IBottomPicker {
focusNode: focusNode, focusNode: focusNode,
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
onSubmitted: (txt) { onSubmitted: (txt) {
print(_model.hospital_ids.toList());
if (txt.isNotEmpty) { if (txt.isNotEmpty) {
_model.sendMessage( _model.sendMessage(
_model.doctor_ids.join(','), _model.doctor_ids.join(','),
......
...@@ -102,7 +102,6 @@ class MechanismModel extends BaseModel { ...@@ -102,7 +102,6 @@ class MechanismModel extends BaseModel {
.sendMessage(DioUtil.getInstance().getDio(), doctor_ids, hospital_ids, .sendMessage(DioUtil.getInstance().getDio(), doctor_ids, hospital_ids,
question, plan_id) question, plan_id)
.listen((event) { .listen((event) {
print(event.toJson());
if (event.error == 0) { if (event.error == 0) {
func(0); func(0);
messageLive.notifyView(event.data.success); messageLive.notifyView(event.data.success);
......
...@@ -101,7 +101,8 @@ class PlanModel extends BaseModel { ...@@ -101,7 +101,8 @@ class PlanModel extends BaseModel {
PlanModelInstance.getInstance().max_price = max_price; PlanModelInstance.getInstance().max_price = max_price;
low = 0; low = 0;
projectSelectIndex = 0; projectSelectIndex = 0;
PlanModelInstance.getInstance().projectSelectIndex = projectSelectIndex; PlanModelInstance.getInstance().projectSelectIndex =
projectSelectIndex;
high = 20100; high = 20100;
sortPos = 0; sortPos = 0;
picLive.notifyView(event.data.ranks); picLive.notifyView(event.data.ranks);
...@@ -114,8 +115,10 @@ class PlanModel extends BaseModel { ...@@ -114,8 +115,10 @@ class PlanModel extends BaseModel {
PlanModelInstance.getInstance().high = high; PlanModelInstance.getInstance().high = high;
PlanModelInstance.getInstance().sortPos = sortPos; PlanModelInstance.getInstance().sortPos = sortPos;
if (call != null) { if (call != null) {
SimpleEventBus.instance().notifyListener("FilterViewState", "reset"); SimpleEventBus.instance()
SimpleEventBus.instance().notifyListener("ProjectViewState", "reset"); .notifyListener("FilterViewState", "reset");
SimpleEventBus.instance()
.notifyListener("ProjectViewState", "reset");
call(); call();
} }
refreshFeed(true, needCache: needCache); refreshFeed(true, needCache: needCache);
...@@ -182,6 +185,19 @@ class PlanModel extends BaseModel { ...@@ -182,6 +185,19 @@ class PlanModel extends BaseModel {
feedsLive.notifyView(Pair(ENDLOADING, [])); feedsLive.notifyView(Pair(ENDLOADING, []));
} }
} else { } else {
//去重复
event.data.plans.forEach((element) {
bool haveIt = false;
for (int i = 0; i < feedDatas.length; i++) {
if (feedDatas[i].id == element.id) {
haveIt = true;
break;
}
}
if (!haveIt) {
feedDatas.add(element);
}
});
feedDatas.addAll(event.data.plans); feedDatas.addAll(event.data.plans);
feedsLive.notifyView(Pair(ENDLOADING, feedDatas)); feedsLive.notifyView(Pair(ENDLOADING, feedDatas));
} }
...@@ -216,7 +232,6 @@ class PlanModel extends BaseModel { ...@@ -216,7 +232,6 @@ class PlanModel extends BaseModel {
backLive.dispost(); backLive.dispost();
feedsLive.dispost(); feedsLive.dispost();
showTab.dispost(); showTab.dispost();
print("LSY PLAN DISPOSE");
} }
void backProgress(double pro, int index) { void backProgress(double pro, int index) {
......
...@@ -63,8 +63,6 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -63,8 +63,6 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
print("LSY PLAN INIT ");
// DioUtil.getInstance().setProxy("172.30.9.128");
_model.init(needCache: true); _model.init(needCache: true);
super.initState(); super.initState();
planBarView = planBarView =
......
...@@ -40,7 +40,6 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin { ...@@ -40,7 +40,6 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin {
_model.getData(true); _model.getData(true);
}; };
SimpleEventBus.instance().resignEvent("TopList", refresh); SimpleEventBus.instance().resignEvent("TopList", refresh);
print("${this} INIT");
} }
@override @override
...@@ -48,7 +47,6 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin { ...@@ -48,7 +47,6 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin {
refreshController.dispose(); refreshController.dispose();
_model.dispose(); _model.dispose();
SimpleEventBus.instance().unResignEvent("TopList", refresh); SimpleEventBus.instance().unResignEvent("TopList", refresh);
print("${this} QUIT");
super.dispose(); super.dispose();
} }
......
...@@ -44,8 +44,19 @@ class TopListModel extends BaseModel { ...@@ -44,8 +44,19 @@ class TopListModel extends BaseModel {
datasLive.notifyView([]); datasLive.notifyView([]);
} }
} else { } else {
event.data.plans.forEach((element) {
bool haveIt = false;
for (int i = 0; i < datas.length; i++) {
if (datas[i].id == element.id) {
haveIt = true;
break;
}
}
if (!haveIt) {
datas.add(element);
}
});
stateLive.notifyView(ENDLOADING); stateLive.notifyView(ENDLOADING);
datas.addAll(event.data.plans);
datasLive.notifyView(datas); datasLive.notifyView(datas);
} }
} else { } else {
......
...@@ -31,7 +31,6 @@ class TopPage extends StatefulWidget { ...@@ -31,7 +31,6 @@ class TopPage extends StatefulWidget {
String title; String title;
TopPage(Map<String, dynamic> map) { TopPage(Map<String, dynamic> map) {
print("LSY ${map.toString()}");
this.rank_type = map["rank_type"]; this.rank_type = map["rank_type"];
this.id = map["id"]; this.id = map["id"];
this.title = map["title"]; this.title = map["title"];
...@@ -49,7 +48,6 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -49,7 +48,6 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
// DioUtil.getInstance().setProxy("172.30.8.245");
_model.rank_type = widget.rank_type; _model.rank_type = widget.rank_type;
init(); init();
super.initState(); super.initState();
...@@ -84,7 +82,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -84,7 +82,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
Widget buildItem(BuildContext context) { Widget buildItem(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
top: false, top: false,
child: baseStateView( child: baseStateView(
MediaQuery.of(context).size.width, MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, MediaQuery.of(context).size.height,
...@@ -200,7 +198,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -200,7 +198,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
for (int i = 0; i < _model.tabs.length; i++) { for (int i = 0; i < _model.tabs.length; i++) {
list.add(baseTabBarItem(_model.tabs[i].name, list.add(baseTabBarItem(_model.tabs[i].name,
leftPadding: i == 0 ? 21.5 : 14, leftPadding: i == 0 ? 21.5 : 14,
rightPadding: i == _model.tabs.length - 1 ? 21.5 : 14)); rightPadding: i == _model.tabs.length - 1 ? 21.5 : 14,
isScroll: true));
} }
return list; return list;
} }
......
...@@ -457,23 +457,32 @@ Widget baseTabBar( ...@@ -457,23 +457,32 @@ Widget baseTabBar(
} }
Widget baseTabBarItem(String text, Widget baseTabBarItem(String text,
{double leftPadding, double rightPadding, double wantWidth}) { {double leftPadding,
double rightPadding,
double wantWidth,
bool isScroll = false}) {
leftPadding = leftPadding ?? 14.0; leftPadding = leftPadding ?? 14.0;
rightPadding = rightPadding ?? 14.0; rightPadding = rightPadding ?? 14.0;
return Row( return isScroll
mainAxisSize: MainAxisSize.min, ? Row(
children: <Widget>[ mainAxisSize: MainAxisSize.min,
Container( children: <Widget>[
width: leftPadding, Container(
), width: leftPadding,
Tab( ),
text: text, Tab(
), text: text,
Container( ),
width: rightPadding, Container(
) width: rightPadding,
], )
); ],
)
: Center(
child: Tab(
text: text,
),
);
// Container( // Container(
// height: 40.0, // height: 40.0,
// width: wantWidth ?? width, // width: wantWidth ?? width,
......
...@@ -13,7 +13,7 @@ import 'DioUtil.dart'; ...@@ -13,7 +13,7 @@ import 'DioUtil.dart';
/** /**
* 生产环境 * 生产环境
*/ */
const String APP_HOST_RELEASE = "http://backend.paas-merchant.env"; const String APP_HOST_RELEASE = "https://backend.igengmei.com";
/** /**
* 测试环境 * 测试环境
*/ */
...@@ -26,7 +26,7 @@ const String APP_HOST_DEBUG = "http://backend.paas-merchant.env"; ...@@ -26,7 +26,7 @@ const String APP_HOST_DEBUG = "http://backend.paas-merchant.env";
/** /**
* 开发环境 * 开发环境
*/ */
const String APP_HOST_DEV = "https://x6cgr5y5-gengmei.mock.coding.io"; const String APP_HOST_DEV = "https://backend.igengmei.com";
class Api { class Api {
static String BUILD_CONFIG; static String BUILD_CONFIG;
......
...@@ -18,6 +18,6 @@ flutter build aar --release --target-platform android-arm ...@@ -18,6 +18,6 @@ flutter build aar --release --target-platform android-arm
#rm -rf /Users/apple/lsy/gengmei_android/gm-flutter/libs/flutterApp.aar #rm -rf /Users/apple/lsy/gengmei_android/gm-flutter/libs/flutterApp.aar
#cp -r ${projectDir}/build/host/outputs/repo/com/example/gm_flutter/flutter_release/1.0/flutter_release-1.0.aar /Users/zcc/Downloads/gm-flutter/libs/flutterApp.aar #cp -r ${projectDir}/build/host/outputs/repo/com/example/gm_flutter/flutter_release/1.0/flutter_release-1.0.aar /Users/zcc/Downloads/gm-flutter/libs/flutterApp.aar
cp -r ${projectDir}/build/host/outputs/repo/com/example/gm_flutter/flutter_release/1.0/flutter_release-1.0.aar /Users/apple/lsy/gengmei_android/libs/flutterApp.aar cp -r ${projectDir}/build/host/outputs/repo/com/example/gm_flutter/flutter_release/1.0/flutter_release-1.0.aar /Users/apple/lsy/gengmei_android/gm-flutter/libs/flutterApp.aar
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