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/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 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: () {}, + ), + ], + ); + } +}