Commit 86560442 authored by 林生雨's avatar 林生雨

commit

parent 790d0f59
...@@ -15,6 +15,15 @@ class PlanItem extends StatelessWidget { ...@@ -15,6 +15,15 @@ class PlanItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
StringBuffer stringBuffer = StringBuffer();
int i = 0;
plans.baseAttrs.forEach((element) {
stringBuffer.write(element);
if (i != plans.baseAttrs.length - 1) {
stringBuffer.write("|");
}
i++;
});
return Container( return Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Container( child: Container(
...@@ -95,7 +104,7 @@ class PlanItem extends StatelessWidget { ...@@ -95,7 +104,7 @@ class PlanItem extends StatelessWidget {
Positioned( Positioned(
left: 92, left: 92,
top: 36, top: 36,
child: baseText("TODO", 11, Color(0xff999999)), child: baseText("${stringBuffer.toString()}", 11, Color(0xff999999)),
) )
], ],
), ),
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
class PlanBean { class PlanBean {
int error; int error;
String message; String message;
Null extra; Map extra;
Null errorCode; Map errorCode;
Null errorExtra; Map errorExtra;
Data data; Data data;
UserType userType; UserType userType;
......
...@@ -6,27 +6,30 @@ class PlanFeedBean { ...@@ -6,27 +6,30 @@ class PlanFeedBean {
int error; int error;
String message; String message;
Map extra; Map extra;
Map errorCode;
Map errorExtra; Map errorExtra;
UserType userType;
Data data; Data data;
UserType userType;
PlanFeedBean( PlanFeedBean(
{this.error, {this.error,
this.message, this.message,
this.extra, this.extra,
this.errorCode,
this.errorExtra, this.errorExtra,
this.userType, this.data,
this.data}); this.userType});
PlanFeedBean.fromJson(Map<String, dynamic> json) { PlanFeedBean.fromJson(Map<String, dynamic> json) {
error = json['error']; error = json['error'];
message = json['message']; message = json['message'];
extra = json['extra']; extra = json['extra'];
errorCode = json['error_code'];
errorExtra = json['error_extra']; errorExtra = json['error_extra'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
userType = json['user_type'] != null userType = json['user_type'] != null
? new UserType.fromJson(json['user_type']) ? new UserType.fromJson(json['user_type'])
: null; : null;
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
...@@ -34,23 +37,14 @@ class PlanFeedBean { ...@@ -34,23 +37,14 @@ class PlanFeedBean {
data['error'] = this.error; data['error'] = this.error;
data['message'] = this.message; data['message'] = this.message;
data['extra'] = this.extra; data['extra'] = this.extra;
data['error_code'] = this.errorCode;
data['error_extra'] = this.errorExtra; data['error_extra'] = this.errorExtra;
if (this.userType != null) {
data['user_type'] = this.userType.toJson();
}
if (this.data != null) { if (this.data != null) {
data['data'] = this.data.toJson(); data['data'] = this.data.toJson();
} }
return data; if (this.userType != null) {
} data['user_type'] = this.userType.toJson();
} }
class UserType {
UserType();
UserType.fromJson(Map<String, dynamic> json) {}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
return data; return data;
} }
} }
...@@ -79,17 +73,19 @@ class Data { ...@@ -79,17 +73,19 @@ class Data {
} }
class Plans { class Plans {
int id;
String cardType; String cardType;
String name; String name;
String positiveRate; String positiveRate;
String salesCount; String salesCount;
List<BaseAttrs> baseAttrs; List<String> baseAttrs;
String minPrice; String minPrice;
String maxPrice; String maxPrice;
String projectImage; String projectImage;
Plans( Plans(
{this.cardType, {this.id,
this.cardType,
this.name, this.name,
this.positiveRate, this.positiveRate,
this.salesCount, this.salesCount,
...@@ -99,16 +95,12 @@ class Plans { ...@@ -99,16 +95,12 @@ class Plans {
this.projectImage}); this.projectImage});
Plans.fromJson(Map<String, dynamic> json) { Plans.fromJson(Map<String, dynamic> json) {
id = json['id'];
cardType = json['card_type']; cardType = json['card_type'];
name = json['name']; name = json['name'];
positiveRate = json['positive_rate']; positiveRate = json['positive_rate'];
salesCount = json['sales_count']; salesCount = json['sales_count'];
if (json['base_attrs'] != null) { baseAttrs = json['base_attrs'].cast<String>();
baseAttrs = new List<BaseAttrs>();
json['base_attrs'].forEach((v) {
baseAttrs.add(new BaseAttrs.fromJson(v));
});
}
minPrice = json['min_price']; minPrice = json['min_price'];
maxPrice = json['max_price']; maxPrice = json['max_price'];
projectImage = json['project_image']; projectImage = json['project_image'];
...@@ -116,13 +108,12 @@ class Plans { ...@@ -116,13 +108,12 @@ class Plans {
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['id'] = this.id;
data['card_type'] = this.cardType; data['card_type'] = this.cardType;
data['name'] = this.name; data['name'] = this.name;
data['positive_rate'] = this.positiveRate; data['positive_rate'] = this.positiveRate;
data['sales_count'] = this.salesCount; data['sales_count'] = this.salesCount;
if (this.baseAttrs != null) { data['base_attrs'] = this.baseAttrs;
data['base_attrs'] = this.baseAttrs.map((v) => v.toJson()).toList();
}
data['min_price'] = this.minPrice; data['min_price'] = this.minPrice;
data['max_price'] = this.maxPrice; data['max_price'] = this.maxPrice;
data['project_image'] = this.projectImage; data['project_image'] = this.projectImage;
...@@ -130,24 +121,13 @@ class Plans { ...@@ -130,24 +121,13 @@ class Plans {
} }
} }
class BaseAttrs { class UserType {
int attrId; UserType();
String attrName;
String attrValue;
BaseAttrs({this.attrId, this.attrName, this.attrValue});
BaseAttrs.fromJson(Map<String, dynamic> json) { UserType.fromJson(Map<String, dynamic> json) {}
attrId = json['attr_id'];
attrName = json['attr_name'];
attrValue = json['attr_value'];
}
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['attr_id'] = this.attrId;
data['attr_name'] = this.attrName;
data['attr_value'] = this.attrValue;
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