Commit e8dca8aa authored by 朱翠翠's avatar 朱翠翠

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

 Conflicts:
	lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
parents a90cb17a e4a4ead0
......@@ -51,6 +51,7 @@ class DiscussLowPriceModel extends BaseModel {
.givePhoneAuth(DioUtil.getInstance().getDio(), leadPhoneRequestId)
.listen((event) {
if (event.error == 0) {
NativeToast.showNativeToast("提交成功,请留意机构来电~");
} else {
NativeToast.showNativeToast(event.message);
}
......
......@@ -119,12 +119,10 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Groups group = data.data.second[newIndex];
Widget widget;
if (group.groupType == 'hot') {
widget = Container(
child: planPopularityView(group),
widget = planPopularityView(group);
// height: 100,
// alignment: Alignment.center,
// child: baseText("第一个", 15, Colors.black),
);
} else if (group.groupType == 'normal_attrs') {
widget = Container(
child: planNormalEffectiveAttrsView(group),
......
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_common/commonModel/toast/NativeToast.dart';
import 'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import 'CallBackCompareItem.dart';
......@@ -49,30 +51,28 @@ class _PlansCompareFeedItemViewState
width: double.maxFinite,
height: 90,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(top: 20, bottom: 20),
padding: EdgeInsets.only(top: 15, bottom: 15),
child: Row(
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => onClickCheckBox(_icon),
child: Container(
alignment: Alignment.center,
child: Image.asset(
_icon,
width: 17,
height: 17,
fit: BoxFit.fill,
))),
Container(
alignment: Alignment.center,
child: Image.asset(
_icon,
width: 17,
height: 17,
),
),
Container(
margin: EdgeInsets.only(left: 15, right: 15),
width: 50,
height: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0),
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(widget.plan.projectImage),
)),
child: ClipRRect(
borderRadius: BorderRadius.circular(4.0),
child: CachedNetworkImage(
imageUrl: widget.plan.projectImage,
width: 50,
height: 50,
fit: BoxFit.cover,
),
),
),
Expanded(
child: Column(
......@@ -91,10 +91,17 @@ class _PlansCompareFeedItemViewState
style: TextStyle(
fontSize: 11, color: Color(0xFF282828))),
TextSpan(
text: widget.plan.positiveRate,
text:
"${(widget.plan.positiveRate.contains(".") ? widget.plan.positiveRate.split(".")[0] : widget.plan.positiveRate).replaceAll("%", "")}",
style: TextStyle(
fontSize: 14,
color: Color(0xFFFF5963),
fontWeight: FontWeight.w500)),
TextSpan(
text: "%",
style: TextStyle(
fontSize: 11,
color: Color(0xFFFF5963),
fontWeight: FontWeight.w500))
])),
],
......@@ -114,7 +121,9 @@ class _PlansCompareFeedItemViewState
)
],
),
);
).gestureDetector(() {
onClickCheckBox(_icon);
});
}
getSecondLevelItem() {
......
......@@ -168,9 +168,13 @@ class LevelOneListState extends State<LevelOneList>
double height = MediaQuery.of(context).size.height -
40 -
widget.topHeight -
totalHeight;
totalHeight
// - 55
// - 40
;
return SliverToBoxAdapter(
child: Container(
color: Color(0xffF7F6FA),
height: height < 0 ? 0 : height,
),
);
......@@ -179,7 +183,7 @@ class LevelOneListState extends State<LevelOneList>
],
), onLoading: () {
_model.loadMore();
}, pullDown: false, pullUp: true);
}, pullDown: false, pullUp: true,loadMoreColor: Color(0xffF7F6FA));
}
@override
......
......@@ -12,6 +12,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart';
import 'package:gm_flutter/ClueModel/page/common/StickyTabBarDelegate.dart';
import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneList.dart';
......@@ -132,6 +133,11 @@ class LevelOneState extends BaseState<LevelOnePage>
Expanded(
child: newHomeWarp(),
),
Container(
height: 0.5,
width: double.maxFinite,
color: Color(0xffE5E5E5),
),
bottomWidget(),
],
))), () {
......@@ -175,8 +181,8 @@ class LevelOneState extends BaseState<LevelOnePage>
},
child: newHome(),
)),
baseSliverTitle(
"${widget.title}", MediaQuery.of(context).size.width, _model.textLive),
baseSliverTitle("${widget.title}", MediaQuery.of(context).size.width,
_model.textLive),
baseSliverBack(() {
if (RouterCenterImpl().findMainRouter().isWithNative()) {
FlutterBoost.singleton.closeCurrent();
......@@ -245,6 +251,7 @@ class LevelOneState extends BaseState<LevelOnePage>
}
Widget head() {
print("SCRRNWIDTH ${MediaQuery.of(context).size.width}");
return Container(
key: keyTop,
width: double.maxFinite,
......@@ -280,8 +287,11 @@ class LevelOneState extends BaseState<LevelOnePage>
Positioned(
bottom: 8,
left: 15,
child: baseText(
_model.planoverItem.planDescription, 12, Color(0xff999999)),
child: Container(
width: MediaQuery.of(context).size.width - 30 - 100,
child: baseText("${_model.planoverItem.planDescription}", 12,
Color(0xff999999)),
),
),
Positioned(
right: 0,
......@@ -307,11 +317,11 @@ class LevelOneState extends BaseState<LevelOnePage>
Container(
margin: EdgeInsets.only(left: 4),
child: baseText(
"${_model.planoverItem.positiveRate.contains(".") ? _model.planoverItem.positiveRate.split(".")[0] : _model.planoverItem.positiveRate}",
"${(_model.planoverItem.positiveRate.contains(".") ? _model.planoverItem.positiveRate.split(".")[0] : _model.planoverItem.positiveRate).replaceAll("%", "")}",
20,
Color(0xffFF5963)),
),
// baseText("%", 11, Color(0xffFF5963)),
baseText("%", 11, Color(0xffFF5963)),
],
),
),
......@@ -345,7 +355,7 @@ class LevelOneState extends BaseState<LevelOnePage>
Container(
margin: EdgeInsets.only(left: 2, right: 2),
child: Text(
element.attrName,
element.attrValue,
textScaleFactor: 1.0,
maxLines: 1,
overflow: TextOverflow.ellipsis,
......@@ -360,7 +370,7 @@ class LevelOneState extends BaseState<LevelOnePage>
Container(
margin: EdgeInsets.only(left: 2, right: 2),
child: Text(
element.attrValue,
element.attrName,
textScaleFactor: 1.0,
maxLines: 1,
overflow: TextOverflow.ellipsis,
......@@ -431,15 +441,20 @@ class LevelOneState extends BaseState<LevelOnePage>
child: Row(
children: <Widget>[
Container(
constraints: BoxConstraints(
maxWidth: 52,
),
width: 52,
// constraints: BoxConstraints(
// maxWidth: 52,
// minWidth:
// ),
child: Text(
element.attrName,
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,
......@@ -481,14 +496,11 @@ class LevelOneState extends BaseState<LevelOnePage>
}
Widget bottomWidget() {
return Align(
alignment: Alignment.bottomCenter,
child: Container(
return Container(
width: double.maxFinite,
height: 55,
color: Colors.white,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GestureDetector(
......@@ -501,7 +513,7 @@ class LevelOneState extends BaseState<LevelOnePage>
false);
},
child: Container(
margin: EdgeInsets.only(left: 18),
margin: EdgeInsets.only(left: 21),
width: 30,
child: Column(
mainAxisSize: MainAxisSize.min,
......@@ -519,6 +531,9 @@ class LevelOneState extends BaseState<LevelOnePage>
),
),
),
Expanded(
child: Container(),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
......@@ -537,8 +552,7 @@ class LevelOneState extends BaseState<LevelOnePage>
..show(context);
},
child: Container(
margin: EdgeInsets.only(left: 15),
width: 135,
width: ScreenUtil().setWidth(137),
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
......@@ -571,8 +585,8 @@ class LevelOneState extends BaseState<LevelOnePage>
context, widget.PAGE_NAME, "${widget.planId}", "", "");
},
child: Container(
margin: EdgeInsets.only(left: 15),
width: 135,
margin: EdgeInsets.only(left: 15,right: 15),
width: ScreenUtil().setWidth(137),
height: 40,
decoration: BoxDecoration(
color: Color(0xffF96079),
......@@ -580,12 +594,10 @@ class LevelOneState extends BaseState<LevelOnePage>
alignment: Alignment.center,
child: baseText("获取底价", 14, Colors.white, bold: true),
)),
Expanded(
child: Container(),
)
],
),
));
);
}
// Widget home() {
......
......@@ -13,6 +13,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart';
import 'package:gm_flutter/ClueModel/page/common/StickyTabBarDelegate.dart';
import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneList.dart';
......@@ -126,6 +127,11 @@ class LevelTwoState extends BaseState<LevelTwoPage>
Expanded(
child: newHomeWarp(),
),
Container(
height: 0.5,
width: double.maxFinite,
color: Color(0xffE5E5E5),
),
bottomWidget(),
],
)),
......@@ -457,110 +463,103 @@ class LevelTwoState extends BaseState<LevelTwoPage>
// 底部按钮
Widget bottomWidget() {
return Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.maxFinite,
height: 55,
color: Colors.white,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
RouterCenterImpl().findMainRouter().jumpPage(
context,
"level_two_plan_compare",
{"planType": 2, "planId": widget.planId},
false);
},
child: Container(
margin: EdgeInsets.only(left: 18),
width: 30,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: 22,
height: 22,
child: Image.asset("assets/vs_black.png"),
),
Container(
margin: EdgeInsets.only(top: 3),
child: baseText("去比较", 10, Color(0xff282828)),
)
],
return Container(
width: double.maxFinite,
height: 55,
color: Colors.white,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
RouterCenterImpl().findMainRouter().jumpPage(
context,
"level_two_plan_compare",
{"planType": 2, "planId": widget.planId},
false);
},
child: Container(
margin: EdgeInsets.only(left: 21),
width: 30,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: 22,
height: 22,
child: Image.asset("assets/vs_black.png"),
),
),
Container(
margin: EdgeInsets.only(top: 3),
child: baseText("去比较", 10, Color(0xff282828)),
)
],
),
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))
..show(context);
},
child: Container(
margin: EdgeInsets.only(left: 15),
width: 135,
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("咨询", 14, Colors.white, bold: true),
)),
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;
}
Map<String, dynamic> map = {
"page_name": "level_two_plan_deatil",
"referrer_link": [],
"popup_name": "interested_plan"
};
RouterCenterImpl()
.findMainRouter()
.buriedEvent("popup_view", map);
DiscussLowPricePopView.showPopView(
context, widget.PAGE_NAME, "${widget.planId}", "", "");
},
child: Container(
margin: EdgeInsets.only(left: 15),
width: 135,
height: 40,
decoration: BoxDecoration(
color: Color(0xffF96079),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("获取底价", 14, Colors.white, bold: true),
)),
Expanded(
child: Container(),
)
],
),
),
));
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))
..show(context);
},
child: Container(
width: ScreenUtil().setWidth(137),
height: 40,
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("咨询", 14, Colors.white, bold: true),
)),
Expanded(
child: Container(),
),
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;
}
Map<String, dynamic> map = {
"page_name": "level_two_plan_deatil",
"referrer_link": [],
"popup_name": "interested_plan"
};
RouterCenterImpl()
.findMainRouter()
.buriedEvent("popup_view", map);
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),
)),
],
),
);
}
}
......@@ -32,6 +32,7 @@ class PlanItem extends StatelessWidget {
if (rate != null && rate.contains(".")) {
rate = rate.split(".")[0];
}
rate = rate.replaceAll("%", "");
return Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Container(
......@@ -88,7 +89,8 @@ class PlanItem extends StatelessWidget {
Container(
width: 4,
),
baseText("${rate}%", 14, Color(0xffFF5963))
baseText("${rate}", 14, Color(0xffFF5963)),
baseText("%", 11, Color(0xffFF5963)),
],
),
),
......
......@@ -408,7 +408,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
_model.loadMore();
},
pullDown: false,
pullUp: true));
pullUp: true,
loadMoreColor: Color(0xffF7F6FA)));
},
);
}
......
......@@ -112,7 +112,7 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin {
],
), onLoading: () {
_model.loadMore();
}, pullDown: false, pullUp: true);
}, pullDown: false, pullUp: true,loadMoreColor: Color(0xffF7F6FA));
}
@override
......
......@@ -62,7 +62,7 @@ class TestState extends BaseState<TestPage> {
context,
RouterCenterImpl()
.findClueRouter()
.getPlansCompareFeed({"planId": 1, "planType": 1}));
.getPlansCompareFeed({"planId": 1, "planType": 2}));
}));
list.add(listItem("榜单", () {
JumpUtil.jumpToPageRight(context,
......
......@@ -296,7 +296,8 @@ Widget baseRefreshView(RefreshController refreshController,
bool pullDown = true,
VoidCallback onLoading,
ScrollController scrollController,
Widget customScrollView}) {
Widget customScrollView,
Color loadMoreColor}) {
return SmartRefresher(
enablePullDown: pullDown,
enablePullUp: pullUp,
......@@ -326,6 +327,7 @@ Widget baseRefreshView(RefreshController refreshController,
repeat: true, reverse: false);
}
return Container(
color: loadMoreColor ?? Colors.white,
height: 55.0,
child: Center(child: body),
);
......
......@@ -159,10 +159,11 @@ class NestedScrollViewRefreshIndicatorState
Animation<Color> _valueColor;
Future<void> _pendingRefreshFuture;
bool _isIndicatorAtTop=false;
double _dragOffset=0.0;
_RefreshIndicatorMode _mode=_RefreshIndicatorMode.drag;
bool _isIndicatorAtTop;
double _dragOffset;
_RefreshIndicatorMode _mode;
static final Animatable<double> _threeQuarterTween =
Tween<double>(begin: 0.0, end: 0.75);
......@@ -177,6 +178,9 @@ class NestedScrollViewRefreshIndicatorState
func = (str) {
if (str == "refresh") {
if (mounted) {
_isIndicatorAtTop = false;
_dragOffset = 0.0;
_mode = _RefreshIndicatorMode.drag;
_show();
}
}
......@@ -451,8 +455,7 @@ class NestedScrollViewRefreshIndicatorState
final bool showIndeterminateIndicator =
_mode == _RefreshIndicatorMode.refresh ||
_mode == _RefreshIndicatorMode.done;
return
Column(
return Column(
children: <Widget>[
Container(
color: Color(0xffF7F6FA),
......
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