From 4e6999acfbb26a9ecca819e068937629cf5ebffb Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 23 Mar 2022 20:21:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/market/good_detail_model.dart | 13 +- lib/models/market/good_detail_model.g.dart | 10 +- .../work_order/work_order_list_model.dart | 6 + .../work_order/work_order_list_model.g.dart | 3 + .../work_order/work_order_type_model.dart | 22 + .../work_order/work_order_type_model.g.dart | 13 + lib/pages/personal/personal_page.dart | 178 +------- lib/pages/personal/user_profile_page.dart | 50 +-- .../task/publish_task_page.dart | 133 +++--- .../task/task_remark_page.dart | 9 +- .../dialogs/work_order_bill_dialog.dart | 6 +- .../work_order/history_report_page.dart | 69 ++-- .../work_order/publish_work_order_page.dart | 185 ++++++--- .../work_order/work_order_card.dart | 15 +- .../work_order/work_order_detail_page.dart | 141 ++++--- .../work_order/work_order_func.dart | 23 ++ .../work_order/work_order_map.dart | 3 - .../work_order/work_order_page.dart | 13 +- .../work_order/work_order_remark_page.dart | 196 +++++++++ lib/ui/market/search/good_detail_page.dart | 21 +- lib/utils/hive_store.dart | 7 + lib/widget/picker/bee_image_picker.dart | 4 +- lib/widget/picker/bee_pick_image_widget.dart | 121 +++--- pubspec.lock | 384 +++++++++--------- 24 files changed, 950 insertions(+), 675 deletions(-) create mode 100644 lib/models/work_order/work_order_type_model.dart create mode 100644 lib/models/work_order/work_order_type_model.g.dart create mode 100644 lib/ui/function_and_service/work_order/work_order_remark_page.dart diff --git a/lib/models/market/good_detail_model.dart b/lib/models/market/good_detail_model.dart index 87efa3d9..fbedd3b2 100644 --- a/lib/models/market/good_detail_model.dart +++ b/lib/models/market/good_detail_model.dart @@ -1,6 +1,5 @@ -import 'package:json_annotation/json_annotation.dart'; - import 'package:aku_new_community/ui/market/shop_car/shop_car_func.dart'; +import 'package:json_annotation/json_annotation.dart'; part 'good_detail_model.g.dart'; @@ -9,14 +8,14 @@ class GoodDetailModel { final int id; final List? jcookImageVoList; final num sellPrice; - final num discountPrice; - final String? skuName; + final num? discountPrice; + final String skuName; final int status; final int shopStatus; final int? sellNum; - final int? kind; - final String defaultLocation; - final String defaultAddressDetail; + final int kind; + final String? defaultLocation; + final String? defaultAddressDetail; final int stockStatus; final List jcookSpecificationVoList; final int isCollection; diff --git a/lib/models/market/good_detail_model.g.dart b/lib/models/market/good_detail_model.g.dart index 95416279..116f8172 100644 --- a/lib/models/market/good_detail_model.g.dart +++ b/lib/models/market/good_detail_model.g.dart @@ -13,14 +13,14 @@ GoodDetailModel _$GoodDetailModelFromJson(Map json) => ?.map((e) => JcookImageVoList.fromJson(e as Map)) .toList(), sellPrice: json['sellPrice'] as num, - discountPrice: json['discountPrice'] as num, - skuName: json['skuName'] as String?, + discountPrice: json['discountPrice'] as num?, + skuName: json['skuName'] as String, status: json['status'] as int, shopStatus: json['shopStatus'] as int, sellNum: json['sellNum'] as int?, - kind: json['kind'] as int?, - defaultLocation: json['defaultLocation'] as String, - defaultAddressDetail: json['defaultAddressDetail'] as String, + kind: json['kind'] as int, + defaultLocation: json['defaultLocation'] as String?, + defaultAddressDetail: json['defaultAddressDetail'] as String?, stockStatus: json['stockStatus'] as int, jcookSpecificationVoList: (json['jcookSpecificationVoList'] as List) diff --git a/lib/models/work_order/work_order_list_model.dart b/lib/models/work_order/work_order_list_model.dart index 11fe8496..57b30eab 100644 --- a/lib/models/work_order/work_order_list_model.dart +++ b/lib/models/work_order/work_order_list_model.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -15,10 +16,13 @@ class WorkOrderListModel extends Equatable { final String content; final String updateDate; final String createDate; + final List? imgList; factory WorkOrderListModel.fromJson(Map json) => _$WorkOrderListModelFromJson(json); + DateTime? get updateDateDT => DateUtil.getDateTime(updateDate); + DateTime? get createDateDT => DateUtil.getDateTime(createDate); @override @@ -32,6 +36,7 @@ class WorkOrderListModel extends Equatable { content, updateDate, createDate, + imgList ]; const WorkOrderListModel({ @@ -44,5 +49,6 @@ class WorkOrderListModel extends Equatable { required this.content, required this.updateDate, required this.createDate, + this.imgList, }); } diff --git a/lib/models/work_order/work_order_list_model.g.dart b/lib/models/work_order/work_order_list_model.g.dart index 13336c14..3d1a8490 100644 --- a/lib/models/work_order/work_order_list_model.g.dart +++ b/lib/models/work_order/work_order_list_model.g.dart @@ -17,4 +17,7 @@ WorkOrderListModel _$WorkOrderListModelFromJson(Map json) => content: json['content'] as String, updateDate: json['updateDate'] as String, createDate: json['createDate'] as String, + imgList: (json['imgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), ); diff --git a/lib/models/work_order/work_order_type_model.dart b/lib/models/work_order/work_order_type_model.dart new file mode 100644 index 00000000..440e6f87 --- /dev/null +++ b/lib/models/work_order/work_order_type_model.dart @@ -0,0 +1,22 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'work_order_type_model.g.dart'; + +@JsonSerializable() +class WorkOrderTypeModel extends Equatable { + final int id; + final String name; + factory WorkOrderTypeModel.fromJson(Map json) => + _$WorkOrderTypeModelFromJson(json); + + const WorkOrderTypeModel({ + required this.id, + required this.name, + }); + @override + List get props => [ + id, + name, + ]; +} diff --git a/lib/models/work_order/work_order_type_model.g.dart b/lib/models/work_order/work_order_type_model.g.dart new file mode 100644 index 00000000..62d1417b --- /dev/null +++ b/lib/models/work_order/work_order_type_model.g.dart @@ -0,0 +1,13 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'work_order_type_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +WorkOrderTypeModel _$WorkOrderTypeModelFromJson(Map json) => + WorkOrderTypeModel( + id: json['id'] as int, + name: json['name'] as String, + ); diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 5f493fe2..9da66493 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -4,7 +4,6 @@ import 'package:aku_new_community/pages/personal/clock_in/clock_in_page.dart'; import 'package:aku_new_community/pages/personal/user_profile_page.dart'; import 'package:aku_new_community/pages/setting_page/settings_page.dart'; import 'package:aku_new_community/pages/sign/login/login_page.dart'; -import 'package:aku_new_community/painters/user_bottom_bar_painter.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/ui/market/order/order_page.dart'; import 'package:aku_new_community/ui/profile/car/car_manage_page.dart'; @@ -13,6 +12,7 @@ import 'package:aku_new_community/ui/profile/new_house/my_family_page.dart'; import 'package:aku_new_community/ui/profile/new_house/my_house_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; @@ -36,150 +36,6 @@ class PersonalIndex extends StatefulWidget { class _PersonalIndexState extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { - SliverAppBar _sliverAppBar(double height) { - final userProvider = Provider.of(context); - return SliverAppBar( - pinned: false, - toolbarHeight: 0, - elevation: 0, - floating: false, - expandedHeight: 450.w - height, - backgroundColor: Colors.white, - flexibleSpace: FlexibleSpaceBar( - background: Stack( - children: [ - Positioned( - top: 0, - left: 0, - right: 0, - bottom: 0, - child: Container( - // decoration: BoxDecoration( - // image: DecorationImage( - // image: AssetImage(R.ASSETS_ICONS_ICON_MY_SETTING_PNG), - // fit: BoxFit.cover, - // ), - // ), - child: Column( - children: [ - Spacer(), - MaterialButton( - padding: EdgeInsets.all(5.w), - onPressed: () { - if (!userProvider.isLogin) - Get.to(() => LoginPage()); - else - Get.to(() => UserProfilePage()); - }, - child: Container( - margin: EdgeInsets.only(left: 32.w), - child: Row( - children: [ - Hero( - tag: 'AVATAR1', - child: ClipOval( - // child: FadeInImage.assetNetwork( - // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: SARSAPI.image(userProvider - // .userInfoModel!.imgUrls.isNotEmpty - // ? userProvider - // .userInfoModel!.imgUrls.first.url - // : ''), - // height: 106.w, - // width: 106.w, - // fit: BoxFit.cover, - // imageErrorBuilder: - // (context, error, stackTrace) { - // return Image.asset( - // R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // height: 106.w, - // width: 106.w, - // ); - // }, - // ), - ), - ), - Container( - margin: EdgeInsets.only(left: 16.w), - child: userProvider.isLogin - ? Text( - userProvider.userInfoModel?.nickName ?? - '', - style: TextStyle( - fontSize: 32.sp, - color: Color(0xffad8940), - ), - ) - : Text( - '登录/注册', - style: TextStyle( - fontSize: 32.sp, - color: Color(0xffad8940), - ), - )), - ], - ), - ), - ), - Stack( - children: [ - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - height: 41.w, - width: double.infinity, - child: CustomPaint( - painter: UserBottomBarPainter(), - ), - ), - ), - Container( - margin: EdgeInsets.only( - top: 38.w, - left: 36.w, - right: 36.w, - bottom: 18.w, - ), - child: Image.asset( - R.ASSETS_IMAGES_MEMBER_BG_PNG, - width: 678.w, - height: 129.w, - ), - ), - ], - ), - ], - ), - ), - ) - ], - ), - ), - ); - } - - // Container _containerBar(String title) { - // return Container( - // color: title == '我的物业' ? Colors.white : BaseStyle.colorf9f9f9, - // padding: EdgeInsets.all(title == '我的物业' ? 0 : 32.w), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Text( - // title, - // style: TextStyle( - // fontWeight: FontWeight.w600, - // fontSize: BaseStyle.fontSize34, - // color: ktextPrimary, - // ), - // ), - // ], - // ), - // ); - // } - Widget _orderButton({ required String name, required String path, @@ -275,30 +131,14 @@ class _PersonalIndexState extends State Hero( tag: 'AVATAR', child: ClipOval( - // child: FadeInImage.assetNetwork( - // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: SARSAPI.image((userProvider - // .userInfoModel?.imgUrls ?? - // []) - // .isNotEmpty - // ? (userProvider.userInfoModel?.imgUrls ?? - // []) - // .first - // .url - // : ''), - // height: 106.w, - // width: 106.w, - // fit: BoxFit.cover, - // imageErrorBuilder: - // (context, error, stackTrace) { - // return Image.asset( - // R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // height: 106.w, - // width: 106.w, - // ); - // }, - // ), - ), + child: BeeImageNetwork( + width: 106.w, + height: 106.w, + imgs: UserTool.userProvider.userInfoModel + ?.imgList ?? + [], + ), + ), ), Container( margin: EdgeInsets.only(left: 16.w), diff --git a/lib/pages/personal/user_profile_page.dart b/lib/pages/personal/user_profile_page.dart index 8f276af0..d79839a7 100644 --- a/lib/pages/personal/user_profile_page.dart +++ b/lib/pages/personal/user_profile_page.dart @@ -8,9 +8,10 @@ import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; -import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; @@ -90,31 +91,12 @@ class _UserProfilePageState extends State { Hero( tag: 'AVATAR', child: ClipOval( - // child: - // CachedNetworkImage( - // imageUrl: SARSAPI.image( - // userProvider.userInfoModel!.imgUrls.isNotEmpty - // ? userProvider.userInfoModel?.imgUrls.first.url - // : ''), - // height: 56.w, - // width: 56.w, - // placeholder: (context, url) => - // Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP), - // errorWidget: (context, url, error) => - // Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP), - // fit: BoxFit.fill, - // ), - // FadeInImage.assetNetwork( - // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: SARSAPI.image( - // (userProvider.userInfoModel?.imgUrls ?? []).isNotEmpty - // ? userProvider.userInfoModel?.imgUrls.first.url - // : ''), - // height: 56.w, - // width: 56.w, - // fit: BoxFit.cover, - // ), - ), + child: BeeImageNetwork( + width: 56.w, + height: 56.w, + imgs: UserTool.userProvider.userInfoModel?.imgList ?? [], + ), + ), ), onPressed: _pickAvatar, ), @@ -162,14 +144,14 @@ class _UserProfilePageState extends State { } }, ), - _buildTile( - '出生日期', - 'userProvider.userInfoModel!.birthdayValue'.text.make(), - onPressed: () async { - DateTime? date = await BeeDatePicker.pick(DateTime.now()); - if (date != null) userProvider.setBirthday(date); - }, - ), + // _buildTile( + // '出生日期', + // 'userProvider.userInfoModel!.birthdayValue'.text.make(), + // onPressed: () async { + // DateTime? date = await BeeDatePicker.pick(DateTime.now()); + // if (date != null) userProvider.setBirthday(date); + // }, + // ), ].sepWidget( separate: Divider( indent: 104.w, diff --git a/lib/ui/function_and_service/task/publish_task_page.dart b/lib/ui/function_and_service/task/publish_task_page.dart index 939bd5c5..f8ffadb9 100644 --- a/lib/ui/function_and_service/task/publish_task_page.dart +++ b/lib/ui/function_and_service/task/publish_task_page.dart @@ -49,8 +49,10 @@ class _PublishTaskPageState extends State { //报酬类型 int _rewardType = 0; + //预约开始时间 DateTime? _appointDate; + //预约结束时间 DateTime? _appointEndDate; TextEditingController _rewardController = TextEditingController(); @@ -59,9 +61,11 @@ class _PublishTaskPageState extends State { String? _content; List _photos = []; String? _voiceUri; + //送达地址 String? _accessAddress; String? _accessAddressDetail; + //接取地址 String? _serviceAddress; String? _serviceAddressDetail; @@ -110,56 +114,56 @@ class _PublishTaskPageState extends State { bottomNavi: Padding( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), child: BeeLongButton( - onPressed: !canTap - ? null - : () async { - var cancel = BotToast.showLoading(); - var _voiceUrl; - if (_voiceUri != null) { - try { - var base = await NetUtil().upload( - SAASAPI.uploadFile.uploadImg, - File.fromUri(Uri(path: _voiceUri))); - if (base.success) { - _voiceUrl = base.data; - } else { - BotToast.showText(text: base.msg); - } - } catch (e) { - print(e.toString()); - } - } - var imgs; - if (_photos.isNotEmpty) { - try { - imgs = await NetUtil() - .uploadFiles(_photos, SAASAPI.uploadFile.uploadImg); - } catch (e) { - print(e.toString()); - } - } - var re = await TaskFunc.publish( - type: _type, - sex: _sex, - servicePersonnel: _service, - readyStartTime: _appointDate.toString(), - readyEndTime: _appointEndDate.toString(), - contact: _nameController.text, - tel: _telController.text, - accessAddress: _accessAddress!, - accessAddressDetail: _accessAddressDetail!, - serviceAddress: _serviceAddress, - serviceAddressDetail: _serviceAddressDetail, - remarks: _content, - voiceUrl: _voiceUrl, - imgUrls: imgs, - rewardType: _rewardType, - reward: _rewardController.text); - if (re) { - Get.back(); - } - cancel(); - }, + onPressed: () async { + if (!canTap) { + return; + } + var cancel = BotToast.showLoading(); + var _voiceUrl; + if (_voiceUri != null) { + try { + var base = await NetUtil().upload(SAASAPI.uploadFile.uploadImg, + File.fromUri(Uri(path: _voiceUri))); + if (base.success) { + _voiceUrl = base.data; + } else { + BotToast.showText(text: base.msg); + } + } catch (e) { + print(e.toString()); + } + } + var imgs; + if (_photos.isNotEmpty) { + try { + imgs = await NetUtil() + .uploadFiles(_photos, SAASAPI.uploadFile.uploadImg); + } catch (e) { + print(e.toString()); + } + } + var re = await TaskFunc.publish( + type: _type, + sex: _sex, + servicePersonnel: _service, + readyStartTime: _appointDate.toString(), + readyEndTime: _appointEndDate.toString(), + contact: _nameController.text, + tel: _telController.text, + accessAddress: _accessAddress!, + accessAddressDetail: _accessAddressDetail!, + serviceAddress: _serviceAddress, + serviceAddressDetail: _serviceAddressDetail, + remarks: _content, + voiceUrl: _voiceUrl, + imgUrls: imgs, + rewardType: _rewardType, + reward: _rewardController.text); + if (re) { + Get.back(); + } + cancel(); + }, text: '确认发布', ), ), @@ -176,7 +180,6 @@ class _PublishTaskPageState extends State { return BeePickerBox( onPressed: () { Get.back(); - print(_type); setState(() {}); }, child: CupertinoPicker.builder( @@ -758,7 +761,10 @@ class _PublishTaskPageState extends State { children: [ GestureDetector( onTap: () async { - _content = await Get.to(() => TaskRemarkPage()); + _content = await Get.to(() => TaskRemarkPage( + text: _content, + )) ?? + ''; setState(() {}); }, child: Material( @@ -999,36 +1005,59 @@ class _PublishTaskPageState extends State { bool get canTap { if (_type == 0) { + BotToast.showText(text: '请选择类型'); return false; } if (_service == 0) { + BotToast.showText(text: '请选择服务人员'); return false; } if (_rewardType == 0) { + BotToast.showText(text: '请选择赏金类型'); return false; } if (_sex == 0) { + BotToast.showText(text: '请选择性别'); return false; } if (_appointDate == null) { + BotToast.showText(text: '请选择预约开始时间'); return false; } if (_appointEndDate == null) { + BotToast.showText(text: '请选择预约结束时间'); return false; } if (_accessAddress == null) { + BotToast.showText(text: '请填写收取地址'); return false; } if (_accessAddressDetail == null) { + BotToast.showText(text: '请填写收取详细地址'); + return false; + } + if (_type == 1 && _serviceAddress == null) { + BotToast.showText(text: '请填写服务地址'); + return false; + } + if (_type == 1 && _accessAddressDetail == null) { + BotToast.showText(text: '请填写服务详细地址'); return false; } if (_rewardController.text.isEmpty) { + BotToast.showText(text: '请填写赏金'); + return false; + } + if (int.parse(_rewardController.text) == 0) { + BotToast.showText(text: '赏金不能为0'); return false; } if (_nameController.text.isEmpty) { + BotToast.showText(text: '请填写联系人姓名'); return false; } if (_telController.text.isEmpty) { + BotToast.showText(text: '请填写联系人电话'); return false; } return true; diff --git a/lib/ui/function_and_service/task/task_remark_page.dart b/lib/ui/function_and_service/task/task_remark_page.dart index 197f7996..044f8ca7 100644 --- a/lib/ui/function_and_service/task/task_remark_page.dart +++ b/lib/ui/function_and_service/task/task_remark_page.dart @@ -8,7 +8,8 @@ import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class TaskRemarkPage extends StatefulWidget { - const TaskRemarkPage({Key? key}) : super(key: key); + final String? text; + const TaskRemarkPage({Key? key, this.text}) : super(key: key); @override _TaskRemarkPageState createState() => _TaskRemarkPageState(); @@ -22,6 +23,9 @@ class _TaskRemarkPageState extends State { @override void initState() { _shortcutLabel = HiveStore.shortcutBox!.values.cast().toList(); + if (widget.text != null) { + _contentController.text = widget.text!; + } super.initState(); } @@ -43,6 +47,7 @@ class _TaskRemarkPageState extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(16.w)), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, @@ -121,7 +126,7 @@ class _TaskRemarkPageState extends State { child: BeeLongButton( onPressed: () async { var inBox = _shortcutLabel.contains(_contentController.text); - if (!inBox&&_contentController.text.isNotEmpty) { + if (!inBox && _contentController.text.isNotEmpty) { await HiveStore.shortcutBox!.add(_contentController.text); } Get.back(result: _contentController.text); diff --git a/lib/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart b/lib/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart index 9518e801..655375c7 100644 --- a/lib/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart +++ b/lib/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/work_order/work_order_bill_model.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; @@ -52,7 +53,10 @@ class WorkOrderBillDialog extends StatelessWidget { .make(), ], )) - .toList(), + .toList() + .sepWidget( + separate: 16.hb, + ), BeeDivider.horizontal(), Row( children: [ diff --git a/lib/ui/function_and_service/work_order/history_report_page.dart b/lib/ui/function_and_service/work_order/history_report_page.dart index b68719b4..a73ac7a2 100644 --- a/lib/ui/function_and_service/work_order/history_report_page.dart +++ b/lib/ui/function_and_service/work_order/history_report_page.dart @@ -1,7 +1,9 @@ -import 'dart:math'; - +import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/work_order/work_order_report_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/dotted_line.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; @@ -38,27 +40,16 @@ class _HistoryReportPageState extends State { firstRefresh: true, header: MaterialHeader(), onRefresh: () async { - // var base = - // await NetUtil().get(SAASAPI.workOrder.findRRById, params: { - // 'workOrderId': widget.id, - // }); - // if (base.success) { - // _models = (base.data as List) - // .map((e) => WorkOrderReportModel.fromJson(e)) - // .toList(); - // setState(() {}); - // } - _models.add(WorkOrderReportModel( - id: Random().nextInt(100), - type: Random().nextInt(100), - content: '${List.filled(Random().nextInt(50), 'aabb')}', - userType: Random().nextInt(2), - createId: Random().nextInt(100), - createName: 'xxx', - createDate: DateTime.now().toString(), - totalCost: '300', - imgList: [], - reportRecordVoList: [])); + var base = + await NetUtil().get(SAASAPI.workOrder.findRRById, params: { + 'workOrderId': widget.id, + }); + if (base.success) { + _models = (base.data as List) + .map((e) => WorkOrderReportModel.fromJson(e)) + .toList(); + setState(() {}); + } setState(() {}); }, child: _models.isEmpty @@ -104,6 +95,14 @@ class LineCard extends StatefulWidget { class _LineCardState extends State { double _height = 0; + double get total { + double sum = 0; + for (var item in widget.model.reportRecordVoList) { + sum = sum + item.price; + } + return sum; + } + @override void didChangeDependencies() { WidgetsBinding.instance?.addPostFrameCallback((timeStamp) { @@ -232,6 +231,7 @@ class _LineCardState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ + 24.hb, ...widget.model.reportRecordVoList .map((e) => Row( children: [ @@ -250,7 +250,28 @@ class _LineCardState extends State { .make(), ], )) - .toList(), + .toList() + .sepWidget( + separate: 16.hb, + ), + 24.hb, + BeeDivider.horizontal(), + 24.hb, + Row( + children: [ + '工单总费用' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + Spacer(), + '¥${total}' + .text + .size(28.sp) + .color(Color(0xFFF5222D)) + .make(), + ], + ) ], ), ) diff --git a/lib/ui/function_and_service/work_order/publish_work_order_page.dart b/lib/ui/function_and_service/work_order/publish_work_order_page.dart index d3907676..cdfd5548 100644 --- a/lib/ui/function_and_service/work_order/publish_work_order_page.dart +++ b/lib/ui/function_and_service/work_order/publish_work_order_page.dart @@ -1,14 +1,20 @@ import 'dart:io'; +import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; -import 'package:aku_new_community/ui/function_and_service/task/task_remark_page.dart'; -import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart'; +import 'package:aku_new_community/models/work_order/work_order_type_model.dart'; +import 'package:aku_new_community/ui/function_and_service/work_order/work_order_func.dart'; +import 'package:aku_new_community/ui/function_and_service/work_order/work_order_remark_page.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_pick_image_widget.dart'; import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -24,7 +30,7 @@ class PublishWorkOrderPage extends StatefulWidget { } class _PublishWorkOrderPageState extends State { - int _type = 0; + int _typeIndex = -1; DateTime? _appointDate; @@ -33,6 +39,7 @@ class _PublishWorkOrderPageState extends State { TextEditingController _addressController = TextEditingController(); String _remark = ''; List _photos = []; + List _types = []; @override void initState() { @@ -61,14 +68,18 @@ class _PublishWorkOrderPageState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - CircleAvatar( - maxRadius: 50.w, + ClipOval( + child: BeeImageNetwork( + width: 100.w, + height: 100.w, + imgs: UserTool.userProvider.userInfoModel?.imgList ?? [], + ), ), 16.wb, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - '李一宣' + '${UserTool.userProvider.userInfoModel!.nickName}' .text .size(28.sp) .color(Colors.black.withOpacity(0.85)) @@ -86,7 +97,8 @@ class _PublishWorkOrderPageState extends State { onTap: () {}, child: Icon( CupertinoIcons.chevron_right, - size: 40.w, + color: Colors.black.withOpacity(0.25), + size: 32.w, )), ], ), @@ -96,43 +108,102 @@ class _PublishWorkOrderPageState extends State { ], ), ), - bottomNavi: BeeLongButton(onPressed: () {}, text: '确认发布'), + bottomNavi: Padding( + padding: EdgeInsets.only( + left: 32.w, + right: 32.w, + bottom: MediaQuery.of(context).padding.bottom + 32.w), + child: BeeLongButton( + onPressed: () async { + if (!canTap) { + return; + } + var cancel = BotToast.showLoading(); + var imgUrls = []; + try { + imgUrls = await NetUtil() + .uploadFiles(_photos, SAASAPI.uploadFile.uploadImg); + } catch (e) { + print(e.toString()); + } + try { + var re = await WorkOrderFuc.publish( + estateId: 1, + workOrderTypeId: _types[_typeIndex].id, + reserveDate: _appointDate.toString(), + reserveAddress: _appointEndDate.toString(), + content: _remark, + imgUrls: imgUrls); + if (re) { + Get.back(); + } + } catch (e) { + print(e.toString()); + } + cancel(); + }, + text: '确认发布'), + ), ); } + bool get canTap { + if (_appointDate == null) { + BotToast.showText(text: '请选择预约开始时间'); + return false; + } + if (_appointEndDate == null) { + BotToast.showText(text: '请选择预约结束时间'); + return false; + } + if (_typeIndex == -1) { + BotToast.showText(text: '请选择类型'); + return false; + } + if (_addressController.text.isEmpty) { + BotToast.showText(text: '请输入地址'); + return false; + } + + if (_remark.isEmpty) { + BotToast.showText(text: '请输入具体需求'); + return false; + } + return true; + } + Container _baseInfo(BuildContext context) { var type = GestureDetector( onTap: () async { - _type = 1; - showModalBottomSheet( - context: context, - builder: (context) { - return BeePickerBox( - onPressed: () { - Get.back(); - print(_type); - setState(() {}); - }, - child: CupertinoPicker.builder( - itemExtent: 60.w, - childCount: WorkOrderMap.orderType.values.length, - onSelectedItemChanged: (index) { - var typeStr = - WorkOrderMap.orderType.values.toList()[index]; - WorkOrderMap.orderType.forEach((key, value) { - if (value == typeStr) { - _type = key; - } - }); - }, - itemBuilder: (context, index) { - var str = WorkOrderMap.orderType.values.toList()[index]; - return Center( - child: str.text.size(32.sp).isIntrinsic.make(), - ); - })); - }, - ); + _typeIndex = 0; + var base = await NetUtil().get(SAASAPI.workOrder.typeList); + if (base.success) { + _types = (base.data as List) + .map((e) => WorkOrderTypeModel.fromJson(e)) + .toList(); + await showModalBottomSheet( + context: context, + builder: (context) { + return BeePickerBox( + onPressed: () { + Get.back(); + setState(() {}); + }, + child: CupertinoPicker.builder( + itemExtent: 60.w, + childCount: _types.length, + onSelectedItemChanged: (index) { + _typeIndex = index; + }, + itemBuilder: (context, index) { + var str = _types[index].name; + return Center( + child: str.text.size(32.sp).isIntrinsic.make(), + ); + })); + }, + ); + } }, child: Material( color: Colors.transparent, @@ -146,14 +217,15 @@ class _PublishWorkOrderPageState extends State { .color(Colors.black.withOpacity(0.45)) .make(), ), - '${_type == 0 ? '请选择分类' : WorkOrderMap.orderType[_type]}' + '${_typeIndex == -1 ? '请选择分类' : _types[_typeIndex].name}' .text .size(28.sp) - .color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85)) + .color(Colors.black.withOpacity(_typeIndex == -1 ? 0.25 : 0.85)) .make(), Spacer(), Icon( CupertinoIcons.chevron_right, + color: Colors.black.withOpacity(0.25), size: 24.w, ), ], @@ -179,10 +251,12 @@ class _PublishWorkOrderPageState extends State { child: Material( color: Colors.transparent, child: - '${DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}' + '${_appointDate == null ? '请选择开始时间' : DateUtil.formatDate(_appointDate, format: DateFormats.zh_mo_d_h_m)}' .text .size(24.sp) - .color(Colors.black.withOpacity(0.85)) + .align(TextAlign.start) + .color(Colors.black + .withOpacity(_appointDate == null ? 0.25 : 0.85)) .make(), ), ), @@ -197,16 +271,20 @@ class _PublishWorkOrderPageState extends State { child: Material( color: Colors.transparent, child: - '${DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}' + '${_appointDate == null ? '请选择结束时间' : DateUtil.formatDate(_appointEndDate, format: DateFormats.zh_mo_d_h_m)}' .text .size(24.sp) - .color(Colors.black.withOpacity(_type == 0 ? 0.25 : 0.85)) + .align(TextAlign.end) + .color(Colors.black + .withOpacity(_appointEndDate == null ? 0.25 : 0.85)) .make(), ), ), ), + 24.wb, Icon( CupertinoIcons.chevron_right, + color: Colors.black.withOpacity(0.25), size: 24.w, ), ], @@ -242,7 +320,10 @@ class _PublishWorkOrderPageState extends State { ); var remark = GestureDetector( onTap: () async { - _remark = await Get.to(() => TaskRemarkPage()); + _remark = await Get.to(() => WorkOrderRemarkPage( + text: _remark, + )) ?? + ''; setState(() {}); }, child: Material( @@ -251,14 +332,14 @@ class _PublishWorkOrderPageState extends State { children: [ SizedBox( width: 170.w, - child: '任务备注' + child: '具体需求' .text .size(28.sp) .color(Colors.black.withOpacity(0.45)) .make(), ), Expanded( - child: '${_remark.isEmpty ? '请输入任务备注' : _remark}' + child: '${_remark.isEmpty ? '请输入具体需求' : _remark}' .text .size(28.sp) .color( @@ -268,6 +349,7 @@ class _PublishWorkOrderPageState extends State { 20.wb, Icon( CupertinoIcons.chevron_right, + color: Colors.black.withOpacity(0.25), size: 24.w, ), ], @@ -282,6 +364,7 @@ class _PublishWorkOrderPageState extends State { borderRadius: BorderRadius.circular(16.w), ), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ 32.hb, type, @@ -316,9 +399,11 @@ class _PublishWorkOrderPageState extends State { ], ), 24.hb, - BeePickImageWidget(onChanged: (value) { - _photos = value; - }), + BeePickImageWidget( + maxCount: 6, + onChanged: (value) { + _photos = value; + }), ], ), ); diff --git a/lib/ui/function_and_service/work_order/work_order_card.dart b/lib/ui/function_and_service/work_order/work_order_card.dart index a823803b..63d662fe 100644 --- a/lib/ui/function_and_service/work_order/work_order_card.dart +++ b/lib/ui/function_and_service/work_order/work_order_card.dart @@ -56,7 +56,7 @@ class WorkOrderCard extends StatelessWidget { GestureDetector( onTap: () { Get.to(() => WorkOrderDetailPage( - model: model, + id: model.id, )); }, child: ClipPath( @@ -124,7 +124,10 @@ class WorkOrderCard extends StatelessWidget { .make(), 24.hb, BeeHorImageView( - maxCount: 4, imgs: [], imgWidth: 146.w, imgHeight: 146.w), + maxCount: 4, + imgs: model.imgList ?? [], + imgWidth: 146.w, + imgHeight: 146.w), 24.hb, Row( children: [ @@ -135,14 +138,6 @@ class WorkOrderCard extends StatelessWidget { .color(Colors.black.withOpacity(0.45)) .make(), Spacer(), - 24.wb, - GestureDetector( - onTap: () {}, - child: Icon( - CupertinoIcons.ellipsis_vertical, - size: 40.w, - ), - ) ], ), ], diff --git a/lib/ui/function_and_service/work_order/work_order_detail_page.dart b/lib/ui/function_and_service/work_order/work_order_detail_page.dart index 6c275ae7..12901424 100644 --- a/lib/ui/function_and_service/work_order/work_order_detail_page.dart +++ b/lib/ui/function_and_service/work_order/work_order_detail_page.dart @@ -2,11 +2,12 @@ import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/work_order/work_order_detail_model.dart'; -import 'package:aku_new_community/models/work_order/work_order_list_model.dart'; +import 'package:aku_new_community/models/work_order/work_order_progress_model.dart'; import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_evaluation_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/urge_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_finish_dialog.dart'; +import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_progress_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/team_list_page.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_func.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart'; @@ -29,9 +30,12 @@ import 'package:velocity_x/src/extensions/num_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart'; class WorkOrderDetailPage extends StatefulWidget { - final WorkOrderListModel model; + final int id; - const WorkOrderDetailPage({Key? key, required this.model}) : super(key: key); + const WorkOrderDetailPage({ + Key? key, + required this.id, + }) : super(key: key); @override _WorkOrderDetailPageState createState() => _WorkOrderDetailPageState(); @@ -51,61 +55,87 @@ class _WorkOrderDetailPageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '', + extendBody: true, body: Stack( children: [ - Container( - width: double.infinity, - height: 380.w, - decoration: BoxDecoration( - gradient: _getLiner, - ), - child: Column( - children: [ - 150.w.heightBox, - Row( - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + _model == null + ? Container() + : Container( + width: double.infinity, + height: 380.w, + decoration: BoxDecoration( + gradient: _getLiner, + ), + child: Column( + children: [ + 150.w.heightBox, + Row( children: [ - GestureDetector( - onTap: () async {}, - child: Material( - color: Colors.transparent, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - '${WorkOrderMap.orderStatus[_model?.status] ?? ''}' - .text - .size(40.sp) - .color(Colors.black) - .bold - .make(), - ], - ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () async { + var base = await NetUtil().get( + SAASAPI.workOrder.findScheduleById, + params: {'workOrderId': widget.id}); + if (base.success) { + var models = (base.data as List) + .map((e) => + WorkOrderProgressModel.fromJson( + e)) + .toList(); + await Get.bottomSheet( + WorkOrderProgressDialog( + models: models)); + } else { + BotToast.showText(text: base.msg); + } + }, + child: Material( + color: Colors.transparent, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + '${WorkOrderMap.orderStatus[_model?.status] ?? ''}' + .text + .size(40.sp) + .color(Colors.black) + .bold + .make(), + 16.wb, + Icon( + CupertinoIcons.chevron_right, + size: 32.w, + color: Colors.black.withOpacity(0.65), + ) + ], + ), + ), + ), + '${WorkOrderMap.subStatusString[_model?.status] ?? ''}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], ), ), - '${WorkOrderMap.subStatusString[_model?.status] ?? ''}' - .text - .size(24.sp) - .color(Colors.black.withOpacity(0.45)) - .make(), + Spacer(), ], ), - ), - Spacer(), - ], + ], + ), ), - ], - ), - ), SafeArea( child: EasyRefresh( firstRefresh: true, header: MaterialHeader(), onRefresh: () async { - var base = await NetUtil().get(SAASAPI.workOrder.findById); + var base = await NetUtil().get(SAASAPI.workOrder.findById, + params: {'workOrderId': widget.id}); if (base.success) { _model = WorkOrderDetailModel.fromJson(base.data); setState(() {}); @@ -118,7 +148,8 @@ class _WorkOrderDetailPageState extends State { EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w), children: [ Offstage( - offstage: _model!.servicePersonnelImgList == null, + offstage: _model!.servicePersonnelImgList == null || + _model!.servicePersonnelImgList!.isEmpty, child: Column( children: [ _servicePeople(), @@ -135,7 +166,12 @@ class _WorkOrderDetailPageState extends State { )), ], ), - bottomNavi: _getBottomButton(), + bottomNavi: Padding( + padding: EdgeInsets.only( + left: 32.w, + right: 32.w, + bottom: MediaQuery.of(context).padding.bottom + 32.w), + child: _getBottomButton()), ); } @@ -183,7 +219,7 @@ class _WorkOrderDetailPageState extends State { return BeeLongButton( onPressed: () async { await Get.bottomSheet(UrgeDialog(onConfirm: () async { - var re = await WorkOrderFuc.promotionRate(_model!.id); + var re = await WorkOrderFuc.promotionRate(widget.id); if (re) { _refreshController.callRefresh(); } @@ -195,7 +231,7 @@ class _WorkOrderDetailPageState extends State { return BeeLongButton( onPressed: () async { await Get.bottomSheet(WorkOrderFinishDialog(onConfirm: () async { - var re = await WorkOrderFuc.confirmComplete(_model!.id); + var re = await WorkOrderFuc.confirmComplete(widget.id); if (re) { Get.back(); _refreshController.callRefresh(); @@ -206,7 +242,7 @@ class _WorkOrderDetailPageState extends State { case 6: return BeeLongButton( onPressed: () async { - var bills = await WorkOrderFuc.getBill(workOrderId: _model!.id); + var bills = await WorkOrderFuc.getBill(workOrderId: widget.id); await Get.bottomSheet(WorkOrderBillDialog(models: bills)); }, text: '确认支付'); @@ -216,9 +252,7 @@ class _WorkOrderDetailPageState extends State { await Get.bottomSheet(TaskEvaluationDialog( evaluate: (star, content) async { return await WorkOrderFuc.evaluate( - workOrderId: widget.model.id, - star: star, - evaluation: content); + workOrderId: widget.id, star: star, evaluation: content); }, )); }, @@ -277,6 +311,7 @@ class _WorkOrderDetailPageState extends State { borderRadius: BorderRadius.circular(12.w), ), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ '服务人员名单' .text diff --git a/lib/ui/function_and_service/work_order/work_order_func.dart b/lib/ui/function_and_service/work_order/work_order_func.dart index cd27c174..5dc053b0 100644 --- a/lib/ui/function_and_service/work_order/work_order_func.dart +++ b/lib/ui/function_and_service/work_order/work_order_func.dart @@ -63,4 +63,27 @@ class WorkOrderFuc { } return models; } + + ///发布工单 + static Future publish({ + required int estateId, + required int workOrderTypeId, + required String reserveDate, + required String reserveAddress, + required String content, + required List imgUrls, + }) async { + var base = await NetUtil().post(SAASAPI.workOrder.insert, + params: { + 'estateId': estateId, + 'workOrderTypeId': workOrderTypeId, + 'reserveDate': reserveDate, + 'reserveAddress': reserveAddress, + 'content': content, + 'imgUrls': imgUrls, + }, + showMessage: true); + + return base.success; + } } diff --git a/lib/ui/function_and_service/work_order/work_order_map.dart b/lib/ui/function_and_service/work_order/work_order_map.dart index fdbc4cb8..1b664689 100644 --- a/lib/ui/function_and_service/work_order/work_order_map.dart +++ b/lib/ui/function_and_service/work_order/work_order_map.dart @@ -1,7 +1,4 @@ class WorkOrderMap { - static Map orderType = { - 1: '报事报修', - }; static Map orderStatus = { 1: '待分配', 2: '工单池', diff --git a/lib/ui/function_and_service/work_order/work_order_page.dart b/lib/ui/function_and_service/work_order/work_order_page.dart index 7787ea5a..a5d3a79c 100644 --- a/lib/ui/function_and_service/work_order/work_order_page.dart +++ b/lib/ui/function_and_service/work_order/work_order_page.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/models/work_order/work_order_list_model.dart'; -import 'package:aku_new_community/ui/function_and_service/work_order/history_report_page.dart'; +import 'package:aku_new_community/ui/function_and_service/work_order/publish_work_order_page.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; @@ -48,10 +48,7 @@ class _WorkOrderPageState extends State actions: [ IconButton( onPressed: () { - // Get.to(() => PublishWorkOrderPage()); - Get.to(() => HistoryReportPage( - id: 1, - )); + Get.to(() => PublishWorkOrderPage()); }, icon: Icon( CupertinoIcons.plus_circle, @@ -71,12 +68,14 @@ class _WorkOrderPageState extends State Widget _getOrderView(int index) { return EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), onRefresh: () async { _page = 1; var base = await NetUtil().getList(SAASAPI.workOrder.list, params: { 'pageNum': _page, 'size': _size, - 'status': index, + 'status': index == 0 ? null : index, }); _models = base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList(); @@ -87,7 +86,7 @@ class _WorkOrderPageState extends State var base = await NetUtil().getList(SAASAPI.workOrder.list, params: { 'pageNum': _page, 'size': _size, - 'status': index + 1, + 'status': index == 0 ? null : index, }); if (_models.length < base.total) { _models.addAll( diff --git a/lib/ui/function_and_service/work_order/work_order_remark_page.dart b/lib/ui/function_and_service/work_order/work_order_remark_page.dart new file mode 100644 index 00000000..fdb659f9 --- /dev/null +++ b/lib/ui/function_and_service/work_order/work_order_remark_page.dart @@ -0,0 +1,196 @@ +import 'package:aku_new_community/utils/hive_store.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class WorkOrderRemarkPage extends StatefulWidget { + final String? text; + + const WorkOrderRemarkPage({Key? key, this.text}) : super(key: key); + + @override + _WorkOrderRemarkPageState createState() => _WorkOrderRemarkPageState(); +} + +class _WorkOrderRemarkPageState extends State { + TextEditingController _contentController = TextEditingController(); + List _shortcutLabel = []; + bool _edit = false; + + @override + void initState() { + _shortcutLabel = + HiveStore.workOrderShortBox!.values.cast().toList(); + if (widget.text != null) { + _contentController.text = widget.text!; + } + super.initState(); + } + + @override + void dispose() { + _contentController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '添加需求', + body: ListView( + padding: EdgeInsets.all(32.w), + children: [ + Container( + padding: EdgeInsets.all(32.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + '具体需求' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + 32.w.heightBox, + Container( + width: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 24.w), + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.06), + borderRadius: BorderRadius.circular(16.w)), + child: TextField( + controller: _contentController, + autofocus: false, + onChanged: (text) => setState(() {}), + minLines: 5, + maxLength: 200, + maxLines: 20, + decoration: InputDecoration( + border: InputBorder.none, + ), + ), + ), + 32.w.heightBox, + Row( + children: [ + '快捷标签' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Spacer(), + GestureDetector( + onTap: () { + _edit = !_edit; + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + '${_edit ? '保存' : '编辑'}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + ), + ), + ], + ), + 32.w.heightBox, + Wrap( + spacing: 12.w, + runSpacing: 12.w, + children: _shortcutLabel + .mapIndexed((currentValue, index) => + label(currentValue, _edit, index)) + .toList(), + ), + ], + ), + ), + ], + ), + bottomNavi: Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + child: BeeLongButton( + onPressed: () async { + var inBox = _shortcutLabel.contains(_contentController.text); + if (!inBox && _contentController.text.isNotEmpty) { + await HiveStore.workOrderShortBox!.add(_contentController.text); + } + Get.back(result: _contentController.text); + }, + text: '完成', + ), + ), + ); + } + + Widget label(String text, bool edit, int index) { + var textHandled = ''; + if (text.length > 10) { + textHandled = text.replaceRange(10, null, '…'); + } else { + textHandled = text; + } + return Stack( + clipBehavior: Clip.none, + children: [ + GestureDetector( + onTap: () { + _contentController.text = text; + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: FittedBox( + child: Container( + height: 60.w, + padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 8.w), + alignment: Alignment.center, + decoration: BoxDecoration( + border: Border.all(color: Colors.black.withOpacity(0.25)), + borderRadius: BorderRadius.circular(8.w)), + child: textHandled.text + .size(22.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + ), + ), + ), + if (edit) + Positioned( + top: -10.w, + right: -10.w, + child: GestureDetector( + onTap: () { + _shortcutLabel.removeAt(index); + HiveStore.workOrderShortBox!.deleteAt(index); + setState(() {}); + }, + child: Material( + child: Icon( + CupertinoIcons.xmark_circle_fill, + size: 40.w, + color: Colors.black.withOpacity(0.45), + ), + ), + )) + ], + ); + } +} diff --git a/lib/ui/market/search/good_detail_page.dart b/lib/ui/market/search/good_detail_page.dart index 257659ce..4b3e1a65 100644 --- a/lib/ui/market/search/good_detail_page.dart +++ b/lib/ui/market/search/good_detail_page.dart @@ -1,13 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; @@ -21,6 +13,13 @@ import 'package:aku_new_community/ui/market/shop_car/shop_car_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'good_detail_bottomSheet.dart'; class GoodDetailPage extends StatefulWidget { @@ -340,15 +339,15 @@ class _GoodDetailPageState extends State { 16.wb, '原价:'.text.color(Color(0xFFBBBBBB)).size(24.sp).make(), Text( - (_goodDetail!.discountPrice).toStringAsFixed(2), + (_goodDetail!.discountPrice)?.toStringAsFixed(2) ?? '0.0', style: TextStyle(fontSize: 24.sp, color: Color(0xFFBBBBBB)), ), 50.wb, '折扣:'.text.color(Color(0xFFBBBBBB)).size(24.sp).make(), Text( - (_goodDetail!.discountPrice) > (_goodDetail!.sellPrice) + ((_goodDetail!.discountPrice) ?? 0.0) > (_goodDetail!.sellPrice) ? _getDiscount(_goodDetail!.sellPrice.toDouble(), - _goodDetail!.discountPrice.toDouble()) + _goodDetail!.discountPrice?.toDouble() ?? 0.0) : '暂无折扣', style: TextStyle(fontSize: 24.sp, color: Color(0xFFBBBBBB)), ), diff --git a/lib/utils/hive_store.dart b/lib/utils/hive_store.dart index 5b2dca4c..0af2ee4a 100644 --- a/lib/utils/hive_store.dart +++ b/lib/utils/hive_store.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/models/login/china_region_model.dart'; import 'package:aku_new_community/models/login/history_login_model.dart'; +import 'package:aku_new_community/models/login/picked_city_model.dart'; import 'package:aku_new_community/models/user/user_config_model.dart'; import 'package:flutter/foundation.dart'; import 'package:hive/hive.dart'; @@ -20,6 +21,10 @@ class HiveStore { static Box? get shortcutBox => _shortcutBox; + static Box? _workOrderShortBox; + + static Box? get workOrderShortBox => _workOrderShortBox; + static Future init() async { if (!kIsWeb) { var dir = await getApplicationDocumentsDirectory(); @@ -30,10 +35,12 @@ class HiveStore { Hive.registerAdapter(ChinaRegionModelAdapter()); //HiveTypeId:3 Hive.registerAdapter(HistoryLoginModelAdapter()); //HiveTypeId:4 Hive.registerAdapter(UserConfigModelAdapter()); //HiveTypeId:5 + Hive.registerAdapter(PickedCityModelAdapter()); //HiveTypeId:6 _appBox = await Hive.openBox('app'); _userBox = await Hive.openBox('userBox'); _dataBox = await Hive.openBox('dataBox'); _shortcutBox = await Hive.openBox('shortcut'); + _workOrderShortBox = await Hive.openBox('workOrderShort'); } } } diff --git a/lib/widget/picker/bee_image_picker.dart b/lib/widget/picker/bee_image_picker.dart index b8406437..b85b6145 100644 --- a/lib/widget/picker/bee_image_picker.dart +++ b/lib/widget/picker/bee_image_picker.dart @@ -1,13 +1,11 @@ import 'dart:io'; +import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; - import 'package:get/get.dart'; import 'package:image_picker/image_picker.dart'; import 'package:velocity_x/velocity_x.dart'; -import 'package:aku_new_community/utils/headers.dart'; - class BeeImagePicker { static Future pick( {required String title, diff --git a/lib/widget/picker/bee_pick_image_widget.dart b/lib/widget/picker/bee_pick_image_widget.dart index 12a83be4..708adda1 100644 --- a/lib/widget/picker/bee_pick_image_widget.dart +++ b/lib/widget/picker/bee_pick_image_widget.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; +import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; // Package imports: import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/cupertino.dart'; @@ -14,9 +15,13 @@ class BeePickImageWidget extends StatefulWidget { final double? size; final Function(List files) onChanged; final String description; - + final int? maxCount; BeePickImageWidget( - {Key? key, this.size, required this.onChanged, this.description = '上传照片'}) + {Key? key, + this.size, + required this.onChanged, + this.description = '上传照片', + this.maxCount}) : super(key: key); @override @@ -35,48 +40,52 @@ class _BeePickImageWidgetState extends State { runSpacing: 10.w, children: [ ..._files.map((e) => showImage(e)).toList(), - GestureDetector( - onTap: () async { - await BeeImagePicker.pick(title: '选择图片').then( - (value) { - if (value != null) { - _files.add( - File(value.path), - ); - } - }, - ); - widget.onChanged(_files); - setState(() {}); - }, - child: DottedBorder( - color: Colors.black.withOpacity(0.25), - borderType: BorderType.RRect, - strokeWidth: 2.w, - dashPattern: [6, 3], - radius: Radius.circular(8.w), - child: Container( - width: widget.size ?? 160.w, - height: widget.size ?? 160.w, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - Assets.icons.camera.path, - width: 60.w, - height: 60.w, - color: Color(0xFF999999), - ), - 4.w.heightBox, - widget.description.text - .color(Colors.black.withOpacity(0.45)) - .size(22.sp) - .make(), - ], + Offstage( + offstage: + widget.maxCount != null && _files.length >= widget.maxCount!, + child: GestureDetector( + onTap: () async { + await BeeImagePicker.pick(title: '选择图片').then( + (value) { + if (value != null) { + _files.add( + File(value.path), + ); + } + }, + ); + widget.onChanged(_files); + setState(() {}); + }, + child: DottedBorder( + color: Colors.black.withOpacity(0.25), + borderType: BorderType.RRect, + strokeWidth: 2.w, + dashPattern: [6, 3], + radius: Radius.circular(8.w), + child: Container( + width: widget.size ?? 160.w, + height: widget.size ?? 160.w, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + Assets.icons.camera.path, + width: 60.w, + height: 60.w, + color: Color(0xFF999999), + ), + 4.w.heightBox, + widget.description.text + .color(Colors.black.withOpacity(0.45)) + .size(22.sp) + .make(), + ], + ), ), - ), - ).material(color: Colors.transparent), + ).material(color: Colors.transparent), + ), ) ], ); @@ -84,17 +93,25 @@ class _BeePickImageWidgetState extends State { Widget showImage(File file) { return Stack(children: [ - Container( - width: widget.size ?? 160.w, - height: widget.size ?? 160.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Colors.black.withOpacity(0.03)), - child: Image.file(file), + GestureDetector( + onTap: () async { + await BeeImagePreview.toFile(file: file); + }, + child: Container( + width: widget.size ?? 160.w, + height: widget.size ?? 160.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Colors.black.withOpacity(0.03)), + child: Image.file( + file, + fit: BoxFit.cover, + ), + ), ), Positioned( - top: 8.w, - right: 8.w, + top: 0.w, + right: 0.w, child: Container( width: 40.w, height: 40.w, diff --git a/pubspec.lock b/pubspec.lock index 9a64b892..199dc8a7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,252 +5,252 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "36.0.0" advance_pdf_viewer: dependency: "direct main" description: name: advance_pdf_viewer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" amap_flutter_base: dependency: "direct main" description: name: amap_flutter_base - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.1" animated_text_kit: dependency: "direct main" description: name: animated_text_kit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.1" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.2" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.2" audio_session: dependency: transitive description: name: audio_session - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6+1" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.8" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "8.1.4" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" card_swiper: dependency: "direct main" description: name: card_swiper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.15.0" color: dependency: transitive description: name: color - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" common_utils: @@ -266,154 +266,154 @@ packages: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" dartx: dependency: transitive description: name: dartx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" decimal: dependency: transitive description: name: decimal - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" device_info_plus: dependency: transitive description: name: device_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0+1" device_info_plus_web: dependency: transitive description: name: device_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.4" dotted_border: dependency: "direct main" description: name: dotted_border - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0+2" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" extended_list_library: dependency: transitive description: name: extended_list_library - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" flutter: @@ -425,42 +425,42 @@ packages: dependency: transitive description: name: flutter_blurhash - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.4" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.0" flutter_easyrefresh: dependency: "direct main" description: name: flutter_easyrefresh - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_gen_core: dependency: transitive description: name: flutter_gen_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.6" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.6" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" flutter_icons: @@ -481,56 +481,56 @@ packages: dependency: "direct dev" description: name: flutter_native_splash - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.3.1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" flutter_sound: dependency: "direct main" description: name: flutter_sound - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "9.1.7" flutter_sound_platform_interface: dependency: transitive description: name: flutter_sound_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "9.1.7" flutter_sound_web: dependency: transitive description: name: flutter_sound_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "9.1.7" flutter_test: @@ -547,504 +547,504 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.8.1" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" get: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.1" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" grinder: dependency: "direct dev" description: name: grinder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.0" highlight: dependency: transitive description: name: highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" hive: dependency: "direct main" description: name: hive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" hive_flutter: dependency: "direct main" description: name: hive_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" hive_generator: dependency: "direct dev" description: name: hive_generator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.3" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.5+4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.4" import_sorter: dependency: "direct dev" description: name: import_sorter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.0" infinite_listview: dependency: transitive description: name: infinite_listview - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" jpush_flutter: dependency: "direct main" description: name: jpush_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.4.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.5" just_audio: dependency: "direct main" description: name: just_audio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.20" just_audio_platform_interface: dependency: transitive description: name: just_audio_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" just_audio_web: dependency: transitive description: name: just_audio_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.7" logger: dependency: transitive description: name: logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.11" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" numberpicker: dependency: transitive description: name: numberpicker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" octo_image: dependency: transitive description: name: octo_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" open_file: dependency: "direct main" description: name: open_file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" package_info_plus: dependency: transitive description: name: package_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" palette_generator: dependency: "direct main" description: name: palette_generator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.3" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.9" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.12" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.8" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "7.2.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.7.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.4.0" pin_input_text_field: dependency: transitive description: name: pin_input_text_field - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.2" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" power_logger: dependency: "direct main" description: name: power_logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.2" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.2" pub_semver: dependency: "direct dev" description: name: pub_semver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" qr_code_scanner: dependency: "direct main" description: name: qr_code_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" random_character: @@ -1060,63 +1060,63 @@ packages: dependency: transitive description: name: rational - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" recase: dependency: transitive description: name: recase - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.27.3" scroll_to_index: dependency: "direct main" description: name: scroll_to_index - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" share: dependency: "direct main" description: name: share - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" shimmer: dependency: "direct main" description: name: shimmer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" signature: dependency: "direct main" description: name: signature - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.1" sky_engine: @@ -1128,266 +1128,266 @@ packages: dependency: "direct main" description: name: sms_autofill - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.3" time: dependency: transitive description: name: time - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" tint: dependency: transitive description: name: tint - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.0+1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.20" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.15" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.6" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.0" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" waterfall_flow: dependency: "direct main" description: name: waterfall_flow - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" web_socket_channel: dependency: "direct main" description: name: web_socket_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.4.4" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.3.1" yaml: dependency: "direct dev" description: name: yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" sdks: From ad32f713fc88d2c1f82e42c076ebdb4ea2ad7a3e Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 24 Mar 2022 09:42:14 +0800 Subject: [PATCH 2/3] fileUrls -> imgUrls --- lib/provider/user_provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 944514d2..40ecbddd 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -163,7 +163,7 @@ class UserProvider extends ChangeNotifier { BaseModel model = await NetUtil().post( SAASAPI.user.updateAvatar, params: { - 'fileUrls': [path] + 'imgUrls': [path] }, showMessage: true, ); From 3a38b1e2916d7ec2ee956661f3fdd513cb728dc8 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 24 Mar 2022 10:06:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E4=BA=BA=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/home/home_activity_model.dart | 23 ++++++++++-- lib/models/home/home_activity_model.g.dart | 3 ++ .../work_order/work_order_detail_model.dart | 35 ++++++++++--------- .../work_order/work_order_detail_model.g.dart | 3 ++ lib/ui/community/activity/activity_card.dart | 5 +-- lib/ui/community/activity/activity_func.dart | 2 +- .../work_order/work_order_detail_page.dart | 2 +- lib/ui/market/search/good_detail_page.dart | 8 ++--- .../search/submit_order_page_normal.dart | 2 +- lib/widget/others/stack_avatar.dart | 2 +- 10 files changed, 57 insertions(+), 28 deletions(-) diff --git a/lib/models/home/home_activity_model.dart b/lib/models/home/home_activity_model.dart index 7febb34b..93bbe807 100644 --- a/lib/models/home/home_activity_model.dart +++ b/lib/models/home/home_activity_model.dart @@ -1,13 +1,14 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'home_activity_model.g.dart'; @JsonSerializable() -class HomeActivityModel { +class HomeActivityModel extends Equatable { final int id; final String title; final int status; @@ -17,12 +18,15 @@ class HomeActivityModel { final String activityEndTime; final List? imgList; final int? registrationNum; + final List? avatarImgList; + factory HomeActivityModel.fromJson(Map json) => _$HomeActivityModelFromJson(json); DateTime? get begin => DateUtil.getDateTime(registrationStartTime); DateTime? get end => DateUtil.getDateTime(registrationEndTime); + String get statusString { switch (this.status) { case 1: @@ -53,6 +57,20 @@ class HomeActivityModel { } } + @override + List get props => [ + id, + title, + status, + registrationStartTime, + registrationEndTime, + activityStartTime, + activityEndTime, + imgList, + registrationNum, + avatarImgList, + ]; + const HomeActivityModel({ required this.id, required this.title, @@ -62,6 +80,7 @@ class HomeActivityModel { required this.activityStartTime, required this.activityEndTime, this.imgList, - this.registrationNum, + required this.registrationNum, + this.avatarImgList, }); } diff --git a/lib/models/home/home_activity_model.g.dart b/lib/models/home/home_activity_model.g.dart index cf1783e8..623fba25 100644 --- a/lib/models/home/home_activity_model.g.dart +++ b/lib/models/home/home_activity_model.g.dart @@ -19,4 +19,7 @@ HomeActivityModel _$HomeActivityModelFromJson(Map json) => ?.map((e) => ImgModel.fromJson(e as Map)) .toList(), registrationNum: json['registrationNum'] as int?, + avatarImgList: (json['avatarImgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), ); diff --git a/lib/models/work_order/work_order_detail_model.dart b/lib/models/work_order/work_order_detail_model.dart index 92eca55f..37b98ec9 100644 --- a/lib/models/work_order/work_order_detail_model.dart +++ b/lib/models/work_order/work_order_detail_model.dart @@ -14,6 +14,7 @@ class WorkOrderDetailModel extends Equatable { final String reserveDate; final String content; final String createDate; + final List? imgList; final List? servicePersonnelImgList; final int newReportNum; final int? evaluateLevel; @@ -23,22 +24,6 @@ class WorkOrderDetailModel extends Equatable { factory WorkOrderDetailModel.fromJson(Map json) => _$WorkOrderDetailModelFromJson(json); - const WorkOrderDetailModel({ - required this.id, - required this.code, - required this.status, - required this.workOrderTypeName, - required this.reserveAddress, - required this.reserveDate, - required this.content, - required this.createDate, - this.servicePersonnelImgList, - required this.newReportNum, - this.evaluateLevel, - this.evaluateContent, - this.evaluateDate, - }); - @override List get props => [ id, @@ -54,5 +39,23 @@ class WorkOrderDetailModel extends Equatable { evaluateLevel, evaluateContent, evaluateDate, + imgList ]; + + const WorkOrderDetailModel({ + required this.id, + required this.code, + required this.status, + required this.workOrderTypeName, + required this.reserveAddress, + required this.reserveDate, + required this.content, + required this.createDate, + this.imgList, + this.servicePersonnelImgList, + required this.newReportNum, + this.evaluateLevel, + this.evaluateContent, + this.evaluateDate, + }); } diff --git a/lib/models/work_order/work_order_detail_model.g.dart b/lib/models/work_order/work_order_detail_model.g.dart index 6ba23bb3..e8dcb16d 100644 --- a/lib/models/work_order/work_order_detail_model.g.dart +++ b/lib/models/work_order/work_order_detail_model.g.dart @@ -17,6 +17,9 @@ WorkOrderDetailModel _$WorkOrderDetailModelFromJson( reserveDate: json['reserveDate'] as String, content: json['content'] as String, createDate: json['createDate'] as String, + imgList: (json['imgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), servicePersonnelImgList: (json['servicePersonnelImgList'] as List?) ?.map((e) => ImgModel.fromJson(e as Map)) diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index 7f52e94f..5330b2f3 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -18,7 +18,7 @@ class ActivityCard extends StatelessWidget { this.home = false, }) : super(key: key); - bool get outdate => model!.end!.compareTo(DateTime.now()) == -1; + bool get outdate => ActivityFunc.dateCheck(model!.end) == ''; Widget build(BuildContext context) { return ConstrainedBox( @@ -109,7 +109,8 @@ class ActivityCard extends StatelessWidget { [ Flexible( child: AvatarsParticipate( - avatars: (model?.imgList?.map((e) => e.url).toList() ?? []), + avatars: + (model?.avatarImgList?.map((e) => e.url).toList() ?? []), pNum: model?.registrationNum ?? 0, hasIcon: false, ), diff --git a/lib/ui/community/activity/activity_func.dart b/lib/ui/community/activity/activity_func.dart index 00a3ee54..9521c6ea 100644 --- a/lib/ui/community/activity/activity_func.dart +++ b/lib/ui/community/activity/activity_func.dart @@ -5,7 +5,7 @@ class ActivityFunc { } var nowDate = DateTime.now(); if (date.isBefore(nowDate)) { - return '已结束'; + return ''; } else { var days = date.difference(nowDate).inDays; if (days > 0) { diff --git a/lib/ui/function_and_service/work_order/work_order_detail_page.dart b/lib/ui/function_and_service/work_order/work_order_detail_page.dart index 12901424..a9d363b4 100644 --- a/lib/ui/function_and_service/work_order/work_order_detail_page.dart +++ b/lib/ui/function_and_service/work_order/work_order_detail_page.dart @@ -429,7 +429,7 @@ class _WorkOrderDetailPageState extends State { .make(), 24.hb, BeeGridImageView( - urls: [], + urls: (_model!.imgList ?? []).map((e) => e.url).toList(), ), 24.hb, ], diff --git a/lib/ui/market/search/good_detail_page.dart b/lib/ui/market/search/good_detail_page.dart index 4b3e1a65..02846d74 100644 --- a/lib/ui/market/search/good_detail_page.dart +++ b/lib/ui/market/search/good_detail_page.dart @@ -257,7 +257,7 @@ class _GoodDetailPageState extends State { height: 100.w, width: double.infinity, child: Text( - (_goodDetail!.skuName ?? ''), + (_goodDetail!.skuName), style: TextStyle( fontSize: 36.sp, fontWeight: FontWeight.bold, @@ -266,7 +266,7 @@ class _GoodDetailPageState extends State { overflow: TextOverflow.ellipsis, ), ), - _getIcon(_goodDetail!.kind ?? 0), + _getIcon(_goodDetail!.kind), 24.hb, Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -325,13 +325,13 @@ class _GoodDetailPageState extends State { height: 80.w, width: double.infinity, child: Text( - (_goodDetail!.skuName ?? ''), + (_goodDetail!.skuName), style: TextStyle(fontSize: 28.sp, color: ktextPrimary), maxLines: 2, overflow: TextOverflow.ellipsis, ), ), - _getIcon(_goodDetail!.kind ?? 0), + _getIcon(_goodDetail!.kind), Spacer(), Row( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/ui/market/search/submit_order_page_normal.dart b/lib/ui/market/search/submit_order_page_normal.dart index 77b3611d..77814120 100644 --- a/lib/ui/market/search/submit_order_page_normal.dart +++ b/lib/ui/market/search/submit_order_page_normal.dart @@ -439,7 +439,7 @@ class _SubmitOrderNormalPageState extends State { var top = RichText( text: TextSpan(children: [ WidgetSpan( - child: _getKindWd(model.kind ?? 0), + child: _getKindWd(model.kind), ), TextSpan( text: model.skuName, diff --git a/lib/widget/others/stack_avatar.dart b/lib/widget/others/stack_avatar.dart index 3e186509..8f921a4b 100644 --- a/lib/widget/others/stack_avatar.dart +++ b/lib/widget/others/stack_avatar.dart @@ -26,7 +26,7 @@ class StackAvatar extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(22.w + 2.w), - border: Border.all(color: Color(0xFF999999)), + // border: Border.all(color: Color(0xFF999999)), ), clipBehavior: Clip.antiAlias, child: BeeImageNetwork(