fixed some issues

hmxc
张萌 4 years ago
parent df2bc557be
commit 6d9f8f40fb

@ -6,6 +6,7 @@ class GoodsOutModel {
int approach;
int status;
String movingCompanyTel;
List<ImgUrl> imgUrl;
GoodsOutModel(
{this.id,
@ -14,7 +15,8 @@ class GoodsOutModel {
this.expectedTime,
this.approach,
this.status,
this.movingCompanyTel});
this.movingCompanyTel,
this.imgUrl});
GoodsOutModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -24,6 +26,12 @@ class GoodsOutModel {
approach = json['approach'];
status = json['status'];
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() {
@ -35,6 +43,37 @@ class GoodsOutModel {
data['approach'] = this.approach;
data['status'] = this.status;
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;
}
}

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

@ -2,6 +2,7 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/goods_out_model.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/material.dart';
@ -36,7 +37,7 @@ class GoodsInfoCard extends StatelessWidget {
);
}
Color _getColor(int state) {
Color _getColor(int state) {
switch (state) {
case 1:
case 2:
@ -51,6 +52,7 @@ Color _getColor(int state) {
return kDangerColor;
}
}
@override
Widget build(BuildContext context) {
return Container(
@ -135,14 +137,15 @@ Color _getColor(int state) {
children: [
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 25.w),
margin: EdgeInsets.only(bottom: 8.w),
child: Text(
'图片信息',
style: TextStyle(
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(
id:model.id,
id: model.id,
tel: model.movingCompanyTel,
)
],

Loading…
Cancel
Save