Commit 7fa04e7f authored by 林生雨's avatar 林生雨

w

parent ddf25116
...@@ -26,15 +26,15 @@ class PlanCompareDetailModel extends BaseModel { ...@@ -26,15 +26,15 @@ class PlanCompareDetailModel extends BaseModel {
.listen((event) { .listen((event) {
if (event.error == 0) { if (event.error == 0) {
stateLive.notifyView(ENDLOADING); stateLive.notifyView(ENDLOADING);
if (event.data.plansInfo != null &&
event.data.plansInfo.length > 1) {
headerLive.notifyView(event.data.plansInfo);
}
if (event.data.groups == null || event.data.groups.isEmpty) { if (event.data.groups == null || event.data.groups.isEmpty) {
detailLive.notifyView(Pair(EMPTY, null)); detailLive.notifyView(Pair(EMPTY, null));
} else { } else {
detailLive.notifyView(Pair(ENDLOADING, event.data.groups)); detailLive.notifyView(Pair(ENDLOADING, event.data.groups));
} }
if (event.data.plansInfo != null &&
event.data.plansInfo.length > 1) {
headerLive.notifyView(event.data.plansInfo);
}
} else { } else {
stateLive.notifyView(FAIL); stateLive.notifyView(FAIL);
NativeToast.showNativeToast(event.message); NativeToast.showNativeToast(event.message);
......
...@@ -12,6 +12,7 @@ import 'package:flutter/material.dart'; ...@@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
import 'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart'; import 'package:gm_flutter/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart';
import 'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'; import 'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart';
import 'package:gm_flutter/ClueModel/util/NumPlanUtil.dart';
import 'package:gm_flutter/ClueModel/view/FiveStarView.dart'; import 'package:gm_flutter/ClueModel/view/FiveStarView.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart'; import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart'; import 'package:gm_flutter/commonModel/base/BaseState.dart';
...@@ -177,6 +178,8 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -177,6 +178,8 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
if (data.data == null || data.data.length != 2) { if (data.data == null || data.data.length != 2) {
return Container(); return Container();
} }
var price = NumPlanUtil.getPrice(
data.data[index].min_price, data.data[index].max_price);
return Container( return Container(
child: Stack(children: <Widget>[ child: Stack(children: <Widget>[
Positioned( Positioned(
...@@ -203,8 +206,19 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> { ...@@ -203,8 +206,19 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned( Positioned(
left: 12, left: 12,
top: 56, top: 56,
child: baseText('${data.data[index].price}', 14, Colors.red, child: Column(
bold: true), children: <Widget>[
price == "暂无报价"
? Container(
width: 0,
height: 0,
)
: baseText("¥", 12, Color(0xffFF5963)),
baseText(price, price == "暂无报价" ? 13 : 15,
price == "暂无报价" ? Color(0xff999999) : Color(0xffFF5963),
bold: price != "暂无报价")
],
),
), ),
])); ]));
}, },
......
...@@ -166,27 +166,21 @@ class _PlansCompareFeedItemViewState ...@@ -166,27 +166,21 @@ class _PlansCompareFeedItemViewState
bold: true), bold: true),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Row( price == "暂无报价"
mainAxisSize: MainAxisSize.min, ? Container(
crossAxisAlignment: CrossAxisAlignment.end, width: 0,
children: <Widget>[ height: 0,
price == "暂无报价" )
? Container( : baseText("¥", 12, Color(0xFFFF5963)),
width: 0, baseText(price, price == "暂无报价" ? 13 : 15,
height: 0, price == "暂无报价" ? Color(0xFF666666) : Color(0xFFFF5963),
) bold: price != "暂无报价"),
: baseText("¥", 12, Color(0xFFFF5963)), Expanded(
baseText( child: Container(),
price,
price == "暂无报价" ? 13 : 15,
price == "暂无报价"
? Color(0xFF666666)
: Color(0xFFFF5963),
bold: price != "暂无报价")
],
), ),
baseText("指导价:${widget.plan.guidePrice ?? "暂无报价"}", 11,
Color(0xff666666)),
], ],
), ),
], ],
......
...@@ -50,7 +50,7 @@ class PlanItem extends StatelessWidget { ...@@ -50,7 +50,7 @@ class PlanItem extends StatelessWidget {
return Container( return Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Card( child: Card(
elevation: 1.0, elevation: 3.0,
child: Container( child: Container(
height: 90, height: 90,
decoration: BoxDecoration( decoration: BoxDecoration(
......
...@@ -88,18 +88,24 @@ class PlansInfoDetail { ...@@ -88,18 +88,24 @@ class PlansInfoDetail {
int planId; int planId;
String planName; String planName;
String price; String price;
String min_price;
String max_price;
PlansInfoDetail({this.planId, this.planName, this.price}); PlansInfoDetail({this.planId, this.planName, this.price});
PlansInfoDetail.fromJson(Map<String, dynamic> json) { PlansInfoDetail.fromJson(Map<String, dynamic> json) {
planId = json['plan_id']; planId = json['plan_id'];
planName = json['plan_name']; planName = json['plan_name'];
min_price = json['min_price'];
max_price = json['max_price'];
price = json['price']; price = json['price'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['plan_id'] = this.planId; data['plan_id'] = this.planId;
data['min_price'] = this.min_price;
data['max_price'] = this.max_price;
data['plan_name'] = this.planName; data['plan_name'] = this.planName;
data['price'] = this.price; data['price'] = this.price;
return data; return data;
......
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