对接接口:物品出户二维码

hmxc
张萌 4 years ago
parent 1575da2f96
commit 7920bc36fc

@ -124,6 +124,9 @@ class _Manager {
///
String get articleOutSubmit => '/user/articleOut/submit';
///
String get getQRcode => '/user/articleOut/getQRCode';
}
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:
@ -13,21 +18,22 @@ import 'package:akuCommunity/widget/dotted_line.dart';
class DetoCodePage extends StatelessWidget {
final int id;
const DetoCodePage({Key key, this.id}) : super(key: key);
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)),
),
],
@ -35,7 +41,7 @@ class DetoCodePage extends StatelessWidget {
);
}
Widget _card() {
Widget _card(String name, String effectiveTime) {
return Container(
decoration: BoxDecoration(
color: Color(0xffffffff),
@ -73,7 +79,7 @@ class DetoCodePage extends StatelessWidget {
),
SizedBox(width: 10.w),
Text(
'马成泽先生',
'$name先生',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -87,7 +93,7 @@ class DetoCodePage extends StatelessWidget {
),
SizedBox(height: 13.w),
Text(
'限时间2020年6月30日',
'效时间:$effectiveTime',
style: TextStyle(
fontSize: 26.sp,
color: Color(0xff999999),
@ -104,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,
),
],
@ -140,6 +146,7 @@ class DetoCodePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '出户二维码',
body: Container(
@ -149,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,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';
@ -91,12 +95,18 @@ class GoodsInfoCardButton extends StatelessWidget {
.keys
.map((index) => Expanded(
child: InkWell(
onTap: () {
onTap: () async {
switch (_listButton[index]['title']) {
case '查看二维码':
ArticleQRModel _model = await ManagerFunc.getQRcode(id);
if (_model.status) {
DetoCodePage(
id: id,
model: _model
).to();
} else {
BotToast.showText(text: _model.message);
}
break;
case '搬家公司':
if (tel.isEmptyOrNull) {

@ -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,22 @@ 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);
}
}

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

Loading…
Cancel
Save