fixed some issues

hmxc
张萌 4 years ago
parent df2bc557be
commit 6d9f8f40fb

@ -6,6 +6,7 @@ class GoodsOutModel {
int approach; int approach;
int status; int status;
String movingCompanyTel; String movingCompanyTel;
List<ImgUrl> imgUrl;
GoodsOutModel( GoodsOutModel(
{this.id, {this.id,
@ -14,7 +15,8 @@ class GoodsOutModel {
this.expectedTime, this.expectedTime,
this.approach, this.approach,
this.status, this.status,
this.movingCompanyTel}); this.movingCompanyTel,
this.imgUrl});
GoodsOutModel.fromJson(Map<String, dynamic> json) { GoodsOutModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -24,6 +26,12 @@ class GoodsOutModel {
approach = json['approach']; approach = json['approach'];
status = json['status']; status = json['status'];
movingCompanyTel = json['movingCompanyTel']; movingCompanyTel = json['movingCompanyTel'];
if (json['imgUrl'] != null) {
imgUrl = new List<ImgUrl>();
json['imgUrl'].forEach((v) {
imgUrl.add(new ImgUrl.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,6 +43,37 @@ class GoodsOutModel {
data['approach'] = this.approach; data['approach'] = this.approach;
data['status'] = this.status; data['status'] = this.status;
data['movingCompanyTel'] = this.movingCompanyTel; data['movingCompanyTel'] = this.movingCompanyTel;
if (this.imgUrl != null) {
data['imgUrl'] = this.imgUrl.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgUrl {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrl({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrl.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data; return data;
} }
} }

@ -340,7 +340,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
setState(() {}); setState(() {});
} }
Widget _getMovingCompany(String movingCompany) { Widget _getMovingCompany() {
return Container( return Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -350,12 +350,15 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
InkWell( InkWell(
onTap: () async { onTap: () async {
_selectTel = await SelectMoveCompanyPage().to(); _selectTel = await SelectMoveCompanyPage().to();
setState(() {
});
}, },
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 30.w), padding: EdgeInsets.symmetric(vertical: 30.w),
child: Row( child: Row(
children: [ children: [
(movingCompany.isEmptyOrNull ? '请选择搬家公司' : movingCompany) (_selectTel.isEmptyOrNull ? '请选择搬家公司' : _selectTel)
.text .text
.color(ktextSubColor) .color(ktextSubColor)
.size(36.sp) .size(36.sp)
@ -412,7 +415,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
_showItmePicker(); _showItmePicker();
}), }),
_getApproach(), _getApproach(),
_selectApproach == 0 ? SizedBox() : _getMovingCompany(''), _selectApproach == 0 ? SizedBox() : _getMovingCompany(),
Container( Container(
margin: EdgeInsets.only(top: 54.w, bottom: 24.w), margin: EdgeInsets.only(top: 54.w, bottom: 24.w),
child: Text( child: Text(

@ -2,6 +2,7 @@
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/goods_out_model.dart'; import 'package:akuCommunity/model/manager/goods_out_model.dart';
import 'package:akuCommunity/utils/bee_map.dart'; import 'package:akuCommunity/utils/bee_map.dart';
import 'package:akuCommunity/widget/views/horizontal_image_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,7 +37,7 @@ class GoodsInfoCard extends StatelessWidget {
); );
} }
Color _getColor(int state) { Color _getColor(int state) {
switch (state) { switch (state) {
case 1: case 1:
case 2: case 2:
@ -51,6 +52,7 @@ Color _getColor(int state) {
return kDangerColor; return kDangerColor;
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -135,14 +137,15 @@ Color _getColor(int state) {
children: [ children: [
Container( Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 25.w), margin: EdgeInsets.only(bottom: 8.w),
child: Text( child: Text(
'图片信息', '图片信息',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, color: Color(0xff333333)), fontSize: 28.sp, color: Color(0xff333333)),
), ),
), ),
ImageHorizontalList(imageUrl: []), HorizontalImageView(
model.imgUrl.map((e) => e.url).toList()),
], ],
), ),
), ),
@ -150,7 +153,7 @@ Color _getColor(int state) {
), ),
), ),
GoodsInfoCardButton( GoodsInfoCardButton(
id:model.id, id: model.id,
tel: model.movingCompanyTel, tel: model.movingCompanyTel,
) )
], ],

Loading…
Cancel
Save