From 09f8821815aeb2fbf945d430ddfc8147485b8eb7 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 12 May 2021 09:22:00 +0800 Subject: [PATCH 1/4] update podfile --- lib/provider/user_provider.dart | 7 +++++-- macos/Podfile.lock | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 6d8fb6e4..24a33a8f 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -1,3 +1,6 @@ +import 'dart:io'; + +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; @@ -32,7 +35,7 @@ class UserProvider extends ChangeNotifier { } logout() { - JPush().deleteAlias(); + if (!kIsWeb && !Platform.isMacOS) JPush().deleteAlias(); final appProvider = Provider.of(Get.context!, listen: false); appProvider.setCurrentHouse(null); _isLogin = false; @@ -48,7 +51,7 @@ class UserProvider extends ChangeNotifier { Future updateProfile() async { _userInfoModel = await SignFunc.getUserInfo(); - if (_userInfoModel != null) { + if (_userInfoModel != null && !kIsWeb && !Platform.isMacOS) { await JPush().setAlias(_userInfoModel!.id.toString()); } notifyListeners(); diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 93516674..24c4c506 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -6,10 +6,10 @@ PODS: - Firebase/Crashlytics (7.11.0): - Firebase/CoreOnly - FirebaseCrashlytics (~> 7.11.0) - - firebase_core (1.1.0): + - firebase_core (1.1.1): - Firebase/CoreOnly (~> 7.11.0) - FlutterMacOS - - firebase_crashlytics (2.0.2): + - firebase_crashlytics (2.0.3): - Firebase/CoreOnly (~> 7.11.0) - Firebase/Crashlytics (~> 7.11.0) - firebase_core @@ -108,8 +108,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: device_info_plus_macos: 1ad388a1ef433505c4038e7dd9605aadd1e2e9c7 Firebase: c121feb35e4126c0b355e3313fa9b487d47319fd - firebase_core: 9e45a9c5ba9dbcb8973b3a68e6ff43ecf2dcf206 - firebase_crashlytics: 4ab08e6b22a4f6ec909cc1f0a046eac2d1b2925c + firebase_core: 6db6207b18525075f0d6b639045f6752722836e9 + firebase_crashlytics: 82416d5f310a4c1576e71797f653520af2da26a7 FirebaseCore: 907447d8917a4d3eb0cce2829c5a0ad21d90b432 FirebaseCoreDiagnostics: 68ad972f99206cef818230f3f3179d52ccfb7f8c FirebaseCrashlytics: 272b675aa9d1e9bae1f9e1449fcc1f2cf6042806 From fedce0238148983bf0be2d685cee973620dc0569 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 12 May 2021 10:26:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/icons/category.png | Bin 0 -> 1444 bytes assets/icons/second_hand.png | Bin 0 -> 772 bytes lib/const/resource.dart | 7 +++++ lib/ui/market/goods/goods_card.dart | 5 ++- lib/ui/market/goods/goods_detail_page.dart | 2 +- lib/ui/market/market_page.dart | 29 +++++++++++++++--- .../market/second_hand/second_hand_page.dart | 27 ++++++++++++++++ 7 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 assets/icons/category.png create mode 100644 assets/icons/second_hand.png create mode 100644 lib/ui/market/second_hand/second_hand_page.dart diff --git a/assets/icons/category.png b/assets/icons/category.png new file mode 100644 index 0000000000000000000000000000000000000000..151c089902d4ab99e7a4ec4fb5645e7065d1d6c0 GIT binary patch literal 1444 zcmb_c_g4}K0LIgDa3Gg6#MSVXmV4pIQKY43A(dyAlG;Bn~VGm)@x;&r|FK zMM4D}Y3M2DtEU;Fl9;P=?-bWlIr<-Z?;G#?e*ND2vTu61fs~+10001V&HakE)Un^F za9pbJU~9hA6ryakeBi-@V*tQ0 z__Zr8x3DrR&ST?h{U~wk!f&6K;))TGzkF3iTBM{h zUeh0sq$egXieEz5?RSdvOW#J`-Ekb{F24j3+b3zGlMV4Chq%(_p2E>DIjMX3@|SsD zL$d#5EssjZLpxEdPOLR>q}aO;g$bu*_*W_=3EmV4h+GYO1Zay@66Q&};fArv zP<244P2VaB_gs`D{wNc^mortiY4H_ex=QhB(^d^)5!QAz`<*b5g!Z%}y(ec=L-S#4 z555FDp{WQ|ogi-Ap>v2=O8ndLTnJ~(kww`sG zifWL=I|t6mtm)5D)I6AQin6Gd)Qnt=)&1~!0sqFfaMAu0Wh@}zW& zZCdBM&Ip0#tH!#&T+YM_GzGP1Dp5ME$^8sRkrE<&D;Or{OF#>89| z0r{j=Gi57c+pubw>GV4hbY=^w9;7z=@IEmW9`}o5$h49j(Pda0FuFYu7SdcUX; zF5H^XKWuPKhqx-}OT``8Z5-R1ot!aMR8o!xw)E<2*n{17WZQN%*3`=Olr@b&Pu3h688)`|LGz1v69o$NqFyu7(M1?DB4f_1Bb#&HmDA^5_cO6A(F}rE8 zM@L44FiQ7kgYnqUFCs0`eXsT8Js7$$bOANBPj1~YqT#>&PVI=VArUx($$X|q)>iZ( z`bDm>HBQDp>-$4QhS~v1V*Fc%9_I{(zM@sClL&e(*Y~$DEP&+u6|PWRoq_+A-3TZR zZB?O;o{K~SA5B0kcIp(f1N}(;8ctnc{@Lapf_57c%pf)m<~cO6V1jfbzV(fdyG3*N zf)w@*3sRQFMqA`R-iUpCjdX944Ckrl!^PgUsDiqUz_&F#TT;f7U$WzI`tVVEQhxtN&7v*C9um^UV5s4YY49^3|Dm8|B!0EBme*a literal 0 HcmV?d00001 diff --git a/assets/icons/second_hand.png b/assets/icons/second_hand.png new file mode 100644 index 0000000000000000000000000000000000000000..090b58f3b8cc845a7bb556ccf6e6fa9a30333961 GIT binary patch literal 772 zcmeAS@N?(olHy`uVBq!ia0vp^6+m3X!3HE}{1@EF4W-}%1FUDs=Cx-<9PE#IW)8;>6h@4KP*=-&D*xAT|Y zv|^jn`=D#r|J#v&4!`7Bzh?K{I@y!m|IVwG3+|q*5U3?s;bM;sFp2a#NitmJcW__DLx*PWS*YBk(};nF`0Ow2-ky&i0P zRP_47jX5DP&o$)3xD==f# zsm`n2cTUgN3z6e1HQZ}_Z0GyzHy>+Ug?C%O)cni(d{_R?@3ouldG^X|J865?_Ovb6 qJas Get.to(() => GoodsDetailPage(id: item.id)), + onPressed: () => Get.to( + () => GoodsDetailPage(id: item.id), + preventDuplicates: false, + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/ui/market/goods/goods_detail_page.dart b/lib/ui/market/goods/goods_detail_page.dart index 526ef1f5..039ffcdb 100644 --- a/lib/ui/market/goods/goods_detail_page.dart +++ b/lib/ui/market/goods/goods_detail_page.dart @@ -180,7 +180,7 @@ class _GoodsDetailPageState extends State { decoration: BoxDecoration( color: Color(0x80000000), borderRadius: BorderRadius.circular(40.w)), - child: '${_currentIndex + 1}/3' + child: '${_currentIndex + 1}/${imgList.length}' .text .size(24.sp) .color(Colors.white) diff --git a/lib/ui/market/market_page.dart b/lib/ui/market/market_page.dart index a078163b..d942cb72 100644 --- a/lib/ui/market/market_page.dart +++ b/lib/ui/market/market_page.dart @@ -1,5 +1,6 @@ // import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/market/second_hand/second_hand_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -67,6 +68,26 @@ class _MarketPageState extends State ), title: '商城', actions: [ + MaterialButton( + minWidth: 108.w, + padding: EdgeInsets.zero, + onPressed: () async { + Get.to(() => SecondHandPage()); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Image.asset( + R.ASSETS_ICONS_SECOND_HAND_PNG, + width: 48.w, + height: 48.w, + ), + 4.hb, + '二手'.text.size(20.sp).black.make(), + ], + ), + ), MaterialButton( minWidth: 108.w, padding: EdgeInsets.zero, @@ -81,10 +102,10 @@ class _MarketPageState extends State mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ - Icon( - Icons.grid_view, - color: Color(0xFF333333), - size: 48.w, + Image.asset( + R.ASSETS_ICONS_CATEGORY_PNG, + width: 48.w, + height: 48.w, ), 4.hb, '分类'.text.size(20.sp).black.make(), diff --git a/lib/ui/market/second_hand/second_hand_page.dart b/lib/ui/market/second_hand/second_hand_page.dart new file mode 100644 index 00000000..802bd08f --- /dev/null +++ b/lib/ui/market/second_hand/second_hand_page.dart @@ -0,0 +1,27 @@ +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SecondHandPage extends StatefulWidget { + SecondHandPage({Key? key}) : super(key: key); + + @override + _SecondHandPageState createState() => _SecondHandPageState(); +} + +class _SecondHandPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '二手市场', + actions: [ + IconButton( + icon: Icon( + CupertinoIcons.add_circled, + ), + onPressed: () {}, + ), + ], + ); + } +} From 6d14b8631c258db8cf5b305c6d5f00b856687cca Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 12 May 2021 10:32:39 +0800 Subject: [PATCH 3/4] fix null safety error --- lib/pages/things_page/fixed_submit_page.dart | 2 +- lib/pages/things_page/widget/fixed_detail_page.dart | 5 +++-- lib/utils/bee_map.dart | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pages/things_page/fixed_submit_page.dart b/lib/pages/things_page/fixed_submit_page.dart index ca6afd51..7c62ffbb 100644 --- a/lib/pages/things_page/fixed_submit_page.dart +++ b/lib/pages/things_page/fixed_submit_page.dart @@ -85,7 +85,7 @@ class _FixedSubmitPageState extends State { curve: Curves.easeInOutCubic, child: GestureDetector( onTap: () { - Get.to(() => FixedDetailPage(model.id)); + Get.to(() => FixedDetailPage(model.id ?? 0)); }, child: Container( width: 686.w, diff --git a/lib/pages/things_page/widget/fixed_detail_page.dart b/lib/pages/things_page/widget/fixed_detail_page.dart index 78e4a9ac..53ba5bda 100644 --- a/lib/pages/things_page/widget/fixed_detail_page.dart +++ b/lib/pages/things_page/widget/fixed_detail_page.dart @@ -21,7 +21,7 @@ import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/views/horizontal_image_view.dart'; class FixedDetailPage extends StatefulWidget { - final int? id; + final int id; FixedDetailPage( this.id, { Key? key, @@ -220,7 +220,8 @@ class _FixedDetailPageState extends State { ...model.appProcessRecordVo! .map((e) => Row( children: [ - BeeMap.processClass[e.operationType!]!.text + (BeeMap.processClass[e.operationType ?? 0] ?? '') + .text .color(ktextSubColor) .size(28.sp) .make(), diff --git a/lib/utils/bee_map.dart b/lib/utils/bee_map.dart index 860a5ff9..386dabe8 100644 --- a/lib/utils/bee_map.dart +++ b/lib/utils/bee_map.dart @@ -16,6 +16,7 @@ class BeeMap { }; static Map processClass = { + 0: '未知', 1: '报修时间', 2: '管家分派', 3: '师傅接单', From d8181b582b08143c57e736f7dfd1764f1dd69df7 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 12 May 2021 11:42:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=95=86=E5=93=81=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 3 + lib/pages/life_pay/life_pay_page.dart | 18 ++--- lib/ui/market/goods/goods_detail_page.dart | 87 +++++++++++++++++++++- 3 files changed, 98 insertions(+), 10 deletions(-) diff --git a/lib/constants/api.dart b/lib/constants/api.dart index dfc7e902..12ea24c2 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -279,6 +279,9 @@ class _Market { ///app商城中心:根据商品主键id查询商品详情 String get goodsDetail => '/user/shop/findDetailByGoodsId'; + + ///app商城中心:商品预约 + String get appointment => '/user/shop/goodsAppointment'; } class _Upload { diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index c5fb9b52..92176fd5 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -351,15 +351,15 @@ class _LifePayPageState extends State { ], ), 24.w.widthBox, - MaterialButton( - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(37.w)), - color: kPrimaryColor, - padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), - onPressed: () {}, - child: '去缴费'.text.black.size(32.sp).bold.make(), - ), + // MaterialButton( + // elevation: 0, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(37.w)), + // color: kPrimaryColor, + // padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), + // onPressed: () {}, + // child: '去缴费'.text.black.size(32.sp).bold.make(), + // ), ], ), ), diff --git a/lib/ui/market/goods/goods_detail_page.dart b/lib/ui/market/goods/goods_detail_page.dart index 039ffcdb..5ab0983c 100644 --- a/lib/ui/market/goods/goods_detail_page.dart +++ b/lib/ui/market/goods/goods_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -22,6 +23,7 @@ import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/net_util.dart'; import 'package:aku_community/widget/bee_back_button.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/utils/headers.dart'; ///商品详情页面 class GoodsDetailPage extends StatefulWidget { @@ -41,11 +43,17 @@ class _GoodsDetailPageState extends State { List _topGoods = []; late PageController _pageController; int _currentIndex = 0; + TextEditingController _nameController = TextEditingController(); + TextEditingController _phoneController = TextEditingController(); + @override void initState() { super.initState(); + final userProvider = Provider.of(context, listen: false); _refreshController = EasyRefreshController(); _pageController = PageController(); + _nameController.text = userProvider.userInfoModel?.name ?? ''; + _phoneController.text = userProvider.userInfoModel?.tel ?? ''; } @override @@ -57,7 +65,6 @@ class _GoodsDetailPageState extends State { @override Widget build(BuildContext context) { - UserProvider userProvider = Provider.of(context); return BeeScaffold( leading: BeeBackButton(), title: '商品详情', @@ -143,6 +150,84 @@ class _GoodsDetailPageState extends State { ), controller: _refreshController, ), + bottomNavi: BottomButton( + onPressed: () { + Get.bottomSheet(Material( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(24.w), + ), + ), + child: Container( + padding: EdgeInsets.all(32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '预约后商户将通过电话联系您', + style: TextStyle( + fontSize: 28.sp, + ), + ), + 40.hb, + TextField( + controller: _nameController, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(48), + borderSide: BorderSide.none, + ), + fillColor: Color(0xFFEEEEEE), + filled: true, + ), + ), + 32.hb, + TextField( + controller: _phoneController, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(48), + borderSide: BorderSide.none, + ), + fillColor: Color(0xFFEEEEEE), + filled: true, + ), + ), + 80.hb, + MaterialButton( + elevation: 0, + minWidth: double.infinity, + shape: StadiumBorder(), + color: kPrimaryColor, + height: 80.w, + onPressed: () async { + final cancel = BotToast.showLoading(); + BaseModel baseModel = await NetUtil().post( + API.market.appointment, + params: { + 'goodsId': widget.id, + 'userName': _nameController.text, + 'userTel': _phoneController.text, + 'num': 1, + }, + showMessage: true, + ); + cancel(); + if (baseModel.status == true) { + Get.back(); + Get.back(); + } + }, + child: Text('确认报名'), + ), + ], + ), + ), + )); + }, + child: Text('立即报名'), + ), ); }