From e34ef21ad0a3139d3369a6541ea945717e30cfc3 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Mon, 1 Feb 2021 10:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=EF=BC=9A=E5=80=9F=E8=BF=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=9A=E6=9F=A5=E8=AF=A2=E8=AF=A5=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E6=89=80=E6=9C=89=E7=89=A9=E5=93=81=E5=80=9F?= =?UTF-8?q?=E8=BF=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/model/manager/article_borrow_model.dart | 33 +++++++++++++++ lib/model/manager/mine_goods_model.dart | 40 +++++++++++++++++++ .../goods_manage_page/goods_manage_page.dart | 20 ---------- .../mine_goods_page/mine_goods_page.dart | 9 +++-- 4 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 lib/model/manager/article_borrow_model.dart create mode 100644 lib/model/manager/mine_goods_model.dart diff --git a/lib/model/manager/article_borrow_model.dart b/lib/model/manager/article_borrow_model.dart new file mode 100644 index 00000000..3aaf202f --- /dev/null +++ b/lib/model/manager/article_borrow_model.dart @@ -0,0 +1,33 @@ +import 'package:akuCommunity/model/common/img_model.dart'; + +class ArticleBorrowModel { + int id; + String name; + int quantity; + List imgUrls; + + ArticleBorrowModel({this.id, this.name, this.quantity, this.imgUrls}); + + ArticleBorrowModel.fromJson(Map json) { + id = json['id']; + name = json['name']; + quantity = json['quantity']; + if (json['imgUrls'] != null) { + imgUrls = new List(); + json['imgUrls'].forEach((v) { + imgUrls.add(new ImgModel.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['quantity'] = this.quantity; + if (this.imgUrls != null) { + data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/model/manager/mine_goods_model.dart b/lib/model/manager/mine_goods_model.dart new file mode 100644 index 00000000..6f77f281 --- /dev/null +++ b/lib/model/manager/mine_goods_model.dart @@ -0,0 +1,40 @@ +class MineGoodsModel { + int id; + String name; + int code; + String beginDate; + String endDate; + int borrowDate; + int borrowStatus; + + MineGoodsModel( + {this.id, + this.name, + this.code, + this.beginDate, + this.endDate, + this.borrowDate, + this.borrowStatus}); + + MineGoodsModel.fromJson(Map json) { + id = json['id']; + name = json['name']; + code = json['code']; + beginDate = json['beginDate']; + endDate = json['endDate']; + borrowDate = json['borrowDate']; + borrowStatus = json['borrowStatus']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['code'] = this.code; + data['beginDate'] = this.beginDate; + data['endDate'] = this.endDate; + data['borrowDate'] = this.borrowDate; + data['borrowStatus'] = this.borrowStatus; + return data; + } +} diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index 12f69d72..f42b194f 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -97,26 +97,6 @@ class _GoodsManagePageState extends State { alignment: Alignment.center, child: '我的借还物品'.text.black.size(28.sp).make())) ], - // body: Stack( - // children: [ - // Column( - // children: _listGoods - // .map((item) => _goodsCard( - // item['imagePath'], - // item['title'], - // item['goodsNum'], - // )) - // .toList(), - // ), - // Positioned( - // bottom: 0, - // child: BottomButton( - // title: '扫一扫出借', - // fun: () {}, - // ), - // ), - // ], - // ), body: BeeListView( path: API.manager.articleBorrow, diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index 5e84ef71..6fd9cb5b 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -194,9 +194,12 @@ class _MineGoodsPageState extends State { .toList(); }, builder: (items) { - return ListView.builder(itemBuilder: (context, index) { - return _goodsCard(items[index]); - }); + return ListView.builder( + itemBuilder: (context, index) { + return _goodsCard(items[index]); + }, + itemCount: items.length, + ); }), ); }