Commit 6f6f2092 authored by 林生雨's avatar 林生雨

Merge branch 'zcc/flutter' into 'test'

Zcc/flutter

See merge request !14
parents 81631e35 c42a9303
......@@ -5,7 +5,6 @@
* @Last Modified time: 2020-07-03 13:47:57
*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart';
import 'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart';
......@@ -15,7 +14,11 @@ import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart';
class PlanCompareDetailPage extends StatefulWidget {
PlanCompareDetailPage(Map<String, dynamic> params) {}
List<int> _planIds;
PlanCompareDetailPage(Map<String, dynamic> params) {
this._planIds = params["planIds"];
}
@override
State<StatefulWidget> createState() => PlanCompareDetailPageState();
......@@ -29,7 +32,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
@override
void initState() {
super.initState();
_model.init([1, 2]);
_model.init(widget._planIds);
}
@override
......@@ -61,7 +64,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
if (data.data == FAIL) {
return errorItem(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, () {
_model.init([1, 2]);
_model.init(widget._planIds);
});
}
if (data.data == LOADING) {
......
......@@ -27,11 +27,17 @@ class _PlansCompareFeedItemViewState
@override
Widget buildItem(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 15, right: 15), child: getItem());
margin: EdgeInsets.only(left: 15, right: 15),
child: Column(
children: <Widget>[
getItem(),
Divider(height: 0.5, color: Color(0xFF979797))
],
));
}
getItem() {
if (widget.plan.planType == 2) {
if (widget.plan.planType == 1) {
return getFirstLevelItem();
} else {
return getSecondLevelItem();
......@@ -62,7 +68,7 @@ class _PlansCompareFeedItemViewState
Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: ClipRRect(
borderRadius: BorderRadius.circular(2.0),
borderRadius: BorderRadius.circular(4.0),
child: Image.network(
widget.plan.projectImage,
width: 50,
......@@ -82,12 +88,18 @@ class _PlansCompareFeedItemViewState
children: <Widget>[
baseText(widget.plan.name, 14, Color(0xFF282828),
bold: true),
Row(children: <Widget>[
baseText("好评率 ", 11, Color(0xFF282828)),
baseText(
widget.plan.positiveRate, 14, Color(0xFFFF5963),
bold: true)
]),
Text.rich(TextSpan(children: [
TextSpan(
text: "好评率 ",
style: TextStyle(
fontSize: 11, color: Color(0xFF282828))),
TextSpan(
text: widget.plan.positiveRate,
style: TextStyle(
fontSize: 14,
color: Color(0xFFFF5963),
fontWeight: FontWeight.w500))
])),
],
),
),
......
......@@ -98,13 +98,24 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
behavior: HitTestBehavior.opaque,
onTap: () => onClickCompare(),
child: Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 7.5, bottom: 7.5),
width: double.maxFinite,
height: 40,
decoration: BoxDecoration(
color: _compareColor, borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("对比", 14, Colors.white, bold: true),
color: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Divider(height: 0.5, color: Color(0xFF979797)),
Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 7.5, bottom: 7.5),
width: double.maxFinite,
height: 40,
decoration: BoxDecoration(
color: _compareColor,
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
child: baseText("对比", 14, Colors.white, bold: true),
)
],
),
))
]);
}
......@@ -112,9 +123,13 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
onClickCompare() {
if (_compareColor == Color(0xFFCCCCCC)) return;
setState(() {
RouterCenterImpl()
.findMainRouter()
.jumpPage(context, "pageName", {"ids": _setCompare}, false);
RouterCenterImpl().findMainRouter().jumpPage(
context,
widget._planType == 1
? "level_one_plan_compare_detail"
: "level_two_plan_compare_deatil",
{"planIds": _setCompare.toList()},
false);
});
}
......
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