Merge branch 'master' of 192.168.2.201:laiiihz/akuCommunity

* 'master' of 192.168.2.201:laiiihz/akuCommunity:
  add 批量删除
  对接接口:物品出户二维码
  对接接口:查询物品出户信息
hmxc
小赖 4 years ago
commit 3fe6b31e18

@ -124,6 +124,12 @@ class _Manager {
///
String get articleOutSubmit => '/user/articleOut/submit';
///
String get getQRcode => '/user/articleOut/getQRCode';
///app
String get articleOutDelete => '/user/articleOut/falseDelete';
}
class _Community {

@ -0,0 +1,51 @@
class ArticleQRModel {
AppArticleOutQRCodeVo appArticleOutQRCodeVo;
String message;
bool status;
ArticleQRModel({this.appArticleOutQRCodeVo, this.message, this.status});
ArticleQRModel.fromJson(Map<String, dynamic> json) {
appArticleOutQRCodeVo = json['appArticleOutQRCodeVo'] != null
? new AppArticleOutQRCodeVo.fromJson(json['appArticleOutQRCodeVo'])
: null;
message = json['message'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.appArticleOutQRCodeVo != null) {
data['appArticleOutQRCodeVo'] = this.appArticleOutQRCodeVo.toJson();
}
data['message'] = this.message;
data['status'] = this.status;
return data;
}
}
class AppArticleOutQRCodeVo {
int id;
int residentId;
String residentName;
String effectiveTime;
AppArticleOutQRCodeVo(
{this.id, this.residentId, this.residentName, this.effectiveTime});
AppArticleOutQRCodeVo.fromJson(Map<String, dynamic> json) {
id = json['id'];
residentId = json['residentId'];
residentName = json['residentName'];
effectiveTime = json['effectiveTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['residentId'] = this.residentId;
data['residentName'] = this.residentName;
data['effectiveTime'] = this.effectiveTime;
return data;
}
}

@ -1,9 +1,14 @@
// Flutter imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/article_QR_code_model.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
import 'package:provider/provider.dart';
import 'package:qr_flutter/qr_flutter.dart';
// Project imports:
@ -12,21 +17,23 @@ import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/dotted_line.dart';
class DetoCodePage extends StatelessWidget {
const DetoCodePage({Key key}) : super(key: key);
final int id;
final ArticleQRModel model;
const DetoCodePage({Key key, this.id, this.model}) : super(key: key);
Widget _header() {
Widget _header(String estateName) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'宁波华茂悦峰',
kEstateName,
style: TextStyle(fontSize: 40.sp, color: Color(0xffffffff)),
),
SizedBox(height: 10.w),
Text(
'1幢-1单元-702室',
estateName,
style: TextStyle(fontSize: 26.sp, color: Color(0xffffffff)),
),
],
@ -34,7 +41,7 @@ class DetoCodePage extends StatelessWidget {
);
}
Widget _card() {
Widget _card(String name, String effectiveTime) {
return Container(
decoration: BoxDecoration(
color: Color(0xffffffff),
@ -72,7 +79,7 @@ class DetoCodePage extends StatelessWidget {
),
SizedBox(width: 10.w),
Text(
'马成泽先生',
'$name先生',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -86,7 +93,7 @@ class DetoCodePage extends StatelessWidget {
),
SizedBox(height: 13.w),
Text(
'限时间2020年6月30日',
'效时间:$effectiveTime',
style: TextStyle(
fontSize: 26.sp,
color: Color(0xff999999),
@ -103,18 +110,18 @@ class DetoCodePage extends StatelessWidget {
alignment: Alignment.center,
child: Column(
children: [
Text(
'020-598-230',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 36.sp,
color: Color(0xff333333),
),
),
SizedBox(height: 11.w),
// Text(
// '020-598-230',
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 36.sp,
// color: Color(0xff333333),
// ),
// ),
// SizedBox(height: 11.w),
QrImage(
padding: EdgeInsets.zero,
data: '智慧社区开门码',
data: model.appArticleOutQRCodeVo.id.toString(),
size: 260.w,
),
],
@ -139,6 +146,7 @@ class DetoCodePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '出户二维码',
body: Container(
@ -148,9 +156,11 @@ class DetoCodePage extends StatelessWidget {
Column(
children: [
SizedBox(height: 192.w - kToolbarHeight),
_header(),
_header(BeeParse.getEstateName(
userProvider.userDetailModel.estateNames[0])),
SizedBox(height: 32.w),
_card(),
_card(model.appArticleOutQRCodeVo.residentName,
model.appArticleOutQRCodeVo.effectiveTime),
],
),
],

@ -1,4 +1,7 @@
// Flutter imports:
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:akuCommunity/widget/buttons/radio_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -25,10 +28,51 @@ class GoodsDetoPage extends StatefulWidget {
class _GoodsDetoPageState extends State<GoodsDetoPage> {
EasyRefreshController _refreshController = EasyRefreshController();
List<int> _select = [];
bool _isEdit = false;
bool _canSkew(int state) {
switch (state) {
case 1:
case 2:
case 3:
return false;
case 4:
case 5:
case 6:
case 7:
return true;
default:
return true;
}
}
Widget _buildPositioned(GoodsOutModel model) {
return AnimatedPositioned(
bottom: 0,
top: 0,
left: (_canSkew(4) && _isEdit) ? 80.w : 0.w,
duration: Duration(milliseconds: 300),
width: 750.w,
child: GoodsInfoCard(
model: model,
),
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '物品出户',
actions: [
IconButton(
icon: _isEdit
? '完成'.text.black.size(28.sp).make()
: '编辑'.text.black.size(28.sp).make(),
onPressed: () {
_isEdit = !_isEdit;
setState(() {});
})
],
body: Padding(
padding: EdgeInsets.only(bottom: 98.w),
child: BeeListView(
@ -42,21 +86,49 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
builder: (items) {
return ListView.builder(
itemBuilder: (context, index) {
return GoodsInfoCard();
return Stack(children: [
GestureDetector(
onTap: () {
if (_select.contains(items[index].id)) {
_select.remove(items[index].id);
} else
_select.add(items[index].id);
setState(() {});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 50.w, horizontal: 32.w),
alignment: Alignment.topLeft,
constraints: BoxConstraints(
minHeight: 631.w + 96.w, minWidth: 686.w),
child: BeeRadio(
value: items[index].id, groupValues: _select),
),
),
_buildPositioned(items[index]),
]);
},
itemCount: items.length,
);
},
),
),
bottomNavi: MaterialButton(
color: kPrimaryColor,
padding: EdgeInsets.only(top:26.w ,bottom: MediaQuery.of(context).padding.bottom+26.w),
child: '新增'.text.black.size(32.sp).bold.make(),
onPressed: () {
bottomNavi: BottomButton(
onPressed: _isEdit
? _select.isEmpty
? null
: () async {
await ManagerFunc.articleOutDelete(_select);
_select.clear();
_refreshController.callRefresh();
}
: () {
DetoCreatePage().to();
},),
},
child: _isEdit
? '删除'.text.size(32.sp).bold.make()
: '新增'.text.size(32.sp).bold.make(),
),
);
}
}

@ -1,4 +1,7 @@
// Flutter imports:
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -8,11 +11,46 @@ import 'goods_info_card_button.dart';
import 'image_horizontal_list.dart';
class GoodsInfoCard extends StatelessWidget {
final List<String> listImage;
final String status;
final List<Map<String, dynamic>> detoInfoList;
GoodsInfoCard({Key key,this.listImage,this.status,this.detoInfoList}) : super(key: key);
final GoodsOutModel model;
GoodsInfoCard({
Key key,
this.model,
}) : super(key: key);
Widget _builTile(String title, String text) {
return Container(
// padding: EdgeInsets.only(top: 8.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)),
),
Text(
text,
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
),
],
),
);
}
Color _getColor(int state) {
switch (state) {
case 1:
case 2:
case 3:
return kDarkPrimaryColor;
case 4:
case 5:
case 6:
case 7:
return ktextSubColor;
default:
return kDangerColor;
}
}
@override
Widget build(BuildContext context) {
return Container(
@ -41,18 +79,15 @@ class GoodsInfoCard extends StatelessWidget {
blurRadius: 10.0),
],
),
padding: EdgeInsets.only(
top: 25.w,
left: 24.w,
right: 24.w),
padding: EdgeInsets.only(top: 25.w, left: 24.w, right: 24.w),
child: Column(
children: [
Container(
padding: EdgeInsets.only(bottom: 24.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xffeeeeee), width: 0.5)),
bottom:
BorderSide(color: Color(0xffeeeeee), width: 0.5)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -64,13 +99,11 @@ class GoodsInfoCard extends StatelessWidget {
fontSize: 32.sp,
color: Color(0xff333333)),
),
Text(
status,
Text(BeeMap().fixState[model.status],
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 28.sp,
color: Color(0xff333333))
),
color: _getColor(model.status))),
],
),
),
@ -81,35 +114,16 @@ class GoodsInfoCard extends StatelessWidget {
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xffeeeeee), width: 0.5)),
),
child: Column(
children: detoInfoList
.map(
(item) => Container(
padding: EdgeInsets.only(top: 8.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
item['title'],
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff999999)),
),
Text(
item['content'],
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff333333)),
),
],
),
),
)
.toList(),
bottom:
BorderSide(color: Color(0xffeeeeee), width: 0.5)),
),
child: Column(children: [
_builTile('物品重量', BeeMap().goodsOutweight[model.weight]),
_builTile('出户时间', model.expectedTime),
_builTile('物品名称', model.name),
_builTile(
'搬运方式', BeeMap().goodsOutApproach[model.approach]),
]),
),
Container(
margin: EdgeInsets.only(
@ -120,22 +134,25 @@ class GoodsInfoCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 25.w),
child: Text(
'图片信息',
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff333333)),
fontSize: 28.sp, color: Color(0xff333333)),
),
),
ImageHorizontalList(imageUrl: listImage),
ImageHorizontalList(imageUrl: []),
],
),
),
],
),
),
GoodsInfoCardButton()
GoodsInfoCardButton(
id:model.id,
tel: model.movingCompanyTel,
)
],
),
);

@ -1,4 +1,8 @@
// Flutter imports:
import 'package:akuCommunity/model/manager/article_QR_code_model.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -13,7 +17,9 @@ import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page
import 'package:akuCommunity/utils/headers.dart';
class GoodsInfoCardButton extends StatelessWidget {
GoodsInfoCardButton({Key key}) : super(key: key);
final String tel;
final int id;
GoodsInfoCardButton({Key key, this.tel, this.id}) : super(key: key);
final List<Map<String, dynamic>> _listButton = [
{'title': '查看二维码', 'icon': MaterialCommunityIcons.qrcode},
@ -75,6 +81,7 @@ class GoodsInfoCardButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.6),
borderRadius: BorderRadius.only(
@ -89,13 +96,24 @@ class GoodsInfoCardButton extends StatelessWidget {
.keys
.map((index) => Expanded(
child: InkWell(
onTap: () {
onTap: () async {
switch (_listButton[index]['title']) {
case '查看二维码':
DetoCodePage().to;
ArticleQRModel _model = await ManagerFunc.getQRcode(id);
if (_model.status) {
DetoCodePage(
id: id,
model: _model
).to();
} else {
BotToast.showText(text: _model.message);
}
break;
case '搬家公司':
_showDialog(context, '0574-88467897');
if (tel.isEmptyOrNull) {
return null;
} else
_showDialog(context, tel);
break;
default:
}
@ -122,8 +140,7 @@ class GoodsInfoCardButton extends StatelessWidget {
color: Color(0xff333333),
),
Container(
margin:
EdgeInsets.only(left: 14.w),
margin: EdgeInsets.only(left: 14.w),
child: Text(
_listButton[index]['title'],
style: TextStyle(

@ -1,4 +1,5 @@
// Package imports:
import 'package:akuCommunity/model/manager/article_QR_code_model.dart';
import 'package:akuCommunity/model/manager/moving_company_model.dart';
import 'package:dio/dio.dart';
import 'package:flustars/flustars.dart';
@ -119,11 +120,31 @@ class ManagerFunc {
'weight': weight,
'approach': approach,
'movingCompanyTel': tel,
'expectedTime': DateUtil.formatDateStr(time,format: "yyyy-MM-dd HH:mm:ss"),
'expectedTime':
DateUtil.formatDateStr(time, format: "yyyy-MM-dd HH:mm:ss"),
'imgUrls': urls,
},
showMessage: true,
);
return baseModel;
}
static Future<ArticleQRModel> getQRcode(int id) async {
Response response = await NetUtil().dio.get(
API.manager.getQRcode,
queryParameters: {
'articleOutId': id,
},
);
return ArticleQRModel.fromJson(response.data);
}
static Future<BaseModel> articleOutDelete(List<int> ids) async {
BaseModel baseModel = await NetUtil().post(
API.manager.articleOutDelete,
params: {'ids': ids},
showMessage: true,
);
return baseModel;
}
}

@ -84,7 +84,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
Widget _buildCard(FixedSubmitModel model) {
return AnimatedPositioned(
top: 0,
left: (_canSkew(4) && _isEdit) ? 55.w : 0,
left: (_canSkew(model.status) && _isEdit) ? 55.w : 0,
bottom: 0,
duration: Duration(milliseconds: 300),
curve: Curves.easeInOutCubic,

@ -26,7 +26,8 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
});
widget.onChanged(_isSelected);
},
child: Container(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
alignment: Alignment.center,
width: 40.w,
height: 40.w,
@ -36,7 +37,8 @@ class _FixedCheckBoxState extends State<FixedCheckBox> {
width: 3.w, color: _isSelected ? kPrimaryColor : kDarkSubColor),
color: Colors.transparent,
),
child: Container(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
width: 24.w,
height: 24.w,
decoration: BoxDecoration(

@ -130,7 +130,6 @@ class _VisitorPassportPageState extends State<VisitorPassportPage> {
.make(),
],
),
//TODO
).centered(),
],
).box.color(Color(0xFF333333)).make(),

@ -26,4 +26,14 @@ class BeeMap {
8: '作废',
9: '取消'
};
Map<int, String> goodsOutweight = {
1: '< 50kg',
2: '50kg-100kg',
3: '> 100kg',
};
Map<int,String> goodsOutApproach={
1:'自己搬运',
2:'搬家公司',
};
}

@ -24,14 +24,10 @@ class BottomButton extends StatelessWidget {
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: DefaultTextStyle(
disabledColor: Colors.white.withOpacity(0.5),
disabledTextColor: ktextSubColor.withOpacity(0.8),
textColor: ktextPrimary,
child: child,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 32.sp,
),
),
onPressed: onPressed,
color: kPrimaryColor,
height: 98.w,

Loading…
Cancel
Save