diff --git a/assets/icons/category.png b/assets/icons/category.png new file mode 100644 index 00000000..151c0899 Binary files /dev/null and b/assets/icons/category.png differ diff --git a/assets/icons/second_hand.png b/assets/icons/second_hand.png new file mode 100644 index 00000000..090b58f3 Binary files /dev/null and b/assets/icons/second_hand.png differ diff --git a/lib/const/resource.dart b/lib/const/resource.dart index 3702742d..388c588c 100644 --- a/lib/const/resource.dart +++ b/lib/const/resource.dart @@ -152,6 +152,9 @@ class R { static const String ASSETS_ICONS_BORROW_SUCCESS_PNG = 'assets/icons/borrow_success.png'; + /// ![preview](file:///Users/akufe/Documents/aku_community/assets/icons/category.png) + static const String ASSETS_ICONS_CATEGORY_PNG = 'assets/icons/category.png'; + /// ![preview](file:///Users/akufe/Documents/aku_community/assets/icons/comment_notice.png) static const String ASSETS_ICONS_COMMENT_NOTICE_PNG = 'assets/icons/comment_notice.png'; @@ -231,6 +234,10 @@ class R { /// ![preview](file:///Users/akufe/Documents/aku_community/assets/icons/report.png) static const String ASSETS_ICONS_REPORT_PNG = 'assets/icons/report.png'; + /// ![preview](file:///Users/akufe/Documents/aku_community/assets/icons/second_hand.png) + static const String ASSETS_ICONS_SECOND_HAND_PNG = + 'assets/icons/second_hand.png'; + /// ![preview](file:///Users/akufe/Documents/aku_community/assets/icons/shield_content.png) static const String ASSETS_ICONS_SHIELD_CONTENT_PNG = 'assets/icons/shield_content.png'; 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/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/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/lib/ui/market/goods/goods_card.dart b/lib/ui/market/goods/goods_card.dart index fdafaaaa..bbb7c07f 100644 --- a/lib/ui/market/goods/goods_card.dart +++ b/lib/ui/market/goods/goods_card.dart @@ -17,7 +17,10 @@ class GoodsCard extends StatelessWidget { color: Colors.white, elevation: 0, padding: EdgeInsets.zero, - onPressed: () => 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 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('立即报名'), + ), ); } 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: () {}, + ), + ], + ); + } +} 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: '师傅接单', 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