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

w

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