diff --git a/build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill b/build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill index 7426125..e016848 100644 Binary files a/build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill and b/build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill differ diff --git a/build/ios/Debug-iphonesimulator/App.framework/App b/build/ios/Debug-iphonesimulator/App.framework/App index 4485936..46c3fc2 100755 Binary files a/build/ios/Debug-iphonesimulator/App.framework/App and b/build/ios/Debug-iphonesimulator/App.framework/App differ diff --git a/build/ios/Debug-iphonesimulator/App.framework/_CodeSignature/CodeResources b/build/ios/Debug-iphonesimulator/App.framework/_CodeSignature/CodeResources index 4ab9a1d..3acc53d 100644 --- a/build/ios/Debug-iphonesimulator/App.framework/_CodeSignature/CodeResources +++ b/build/ios/Debug-iphonesimulator/App.framework/_CodeSignature/CodeResources @@ -52,10 +52,6 @@ sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/order/icon_order_sucess.png - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/search.png bbW0EKFzhnRZv1DDPt08Hk6bU+U= @@ -130,7 +126,7 @@ flutter_assets/kernel_blob.bin - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf @@ -253,17 +249,6 @@ c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - flutter_assets/assets/images/order/icon_order_sucess.png - - hash - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - - hash2 - - c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - - flutter_assets/assets/images/search.png hash @@ -466,11 +451,11 @@ hash - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= hash2 - PbCxbgSr03xuoHF6okSWNtHnrEmO4/hIUmZX5MRLpY4= + PGRzojBRXfrk6mC1gpiNrn3dzXD1xHzSjJCJdLvsovE= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf diff --git a/build/ios/Debug-iphonesimulator/App.framework/flutter_assets/kernel_blob.bin b/build/ios/Debug-iphonesimulator/App.framework/flutter_assets/kernel_blob.bin index f912004..a2b0c97 100644 Binary files a/build/ios/Debug-iphonesimulator/App.framework/flutter_assets/kernel_blob.bin and b/build/ios/Debug-iphonesimulator/App.framework/flutter_assets/kernel_blob.bin differ diff --git a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App index 4485936..46c3fc2 100755 Binary files a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App and b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App differ diff --git a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources index 4ab9a1d..3acc53d 100644 --- a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources +++ b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources @@ -52,10 +52,6 @@ sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/order/icon_order_sucess.png - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/search.png bbW0EKFzhnRZv1DDPt08Hk6bU+U= @@ -130,7 +126,7 @@ flutter_assets/kernel_blob.bin - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf @@ -253,17 +249,6 @@ c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - flutter_assets/assets/images/order/icon_order_sucess.png - - hash - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - - hash2 - - c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - - flutter_assets/assets/images/search.png hash @@ -466,11 +451,11 @@ hash - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= hash2 - PbCxbgSr03xuoHF6okSWNtHnrEmO4/hIUmZX5MRLpY4= + PGRzojBRXfrk6mC1gpiNrn3dzXD1xHzSjJCJdLvsovE= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf diff --git a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin index f912004..a2b0c97 100644 Binary files a/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin and b/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin differ diff --git a/build/ios/Debug-iphonesimulator/Runner.app/Runner b/build/ios/Debug-iphonesimulator/Runner.app/Runner index 1496240..b013bc0 100755 Binary files a/build/ios/Debug-iphonesimulator/Runner.app/Runner and b/build/ios/Debug-iphonesimulator/Runner.app/Runner differ diff --git a/build/ios/Debug-iphonesimulator/Runner.app/_CodeSignature/CodeResources b/build/ios/Debug-iphonesimulator/Runner.app/_CodeSignature/CodeResources index a6437dd..0110837 100644 --- a/build/ios/Debug-iphonesimulator/Runner.app/_CodeSignature/CodeResources +++ b/build/ios/Debug-iphonesimulator/Runner.app/_CodeSignature/CodeResources @@ -110,7 +110,7 @@ Frameworks/App.framework/App - L1a0o1wVkn+B8eseIyb3hZzaAWQ= + HJ/Ks2PD1inSI+aXhJfo5X65KMA= Frameworks/App.framework/Info.plist @@ -118,7 +118,7 @@ Frameworks/App.framework/_CodeSignature/CodeResources - n+4Ljp9rUsHHUhNVO2tJ1jIrKTk= + UB9EI/exDiYJHknckmELqPV2nFs= Frameworks/App.framework/flutter_assets/AssetManifest.json @@ -234,7 +234,7 @@ Frameworks/App.framework/flutter_assets/kernel_blob.bin - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf @@ -641,11 +641,11 @@ hash - L1a0o1wVkn+B8eseIyb3hZzaAWQ= + HJ/Ks2PD1inSI+aXhJfo5X65KMA= hash2 - L9NcViiqF/e0QWa+Uj0UHBDXboScJPPvd/yMhvdQZaE= + LYiu5jj2mHbSM9JFDBEXE53jhCzTtwaSLxXzOuBs2xw= Frameworks/App.framework/Info.plist @@ -663,11 +663,11 @@ hash - n+4Ljp9rUsHHUhNVO2tJ1jIrKTk= + UB9EI/exDiYJHknckmELqPV2nFs= hash2 - /CF/OmNCLyOqJ+m6HhomsMQvHqf8qaVgrkk8jzLR+g4= + etA7sVuZbOLZy7KCZFY/L1jaD+J4hCfRb3tWfmy67dM= Frameworks/App.framework/flutter_assets/AssetManifest.json @@ -982,11 +982,11 @@ hash - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= hash2 - PbCxbgSr03xuoHF6okSWNtHnrEmO4/hIUmZX5MRLpY4= + PGRzojBRXfrk6mC1gpiNrn3dzXD1xHzSjJCJdLvsovE= Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf diff --git a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/App b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/App index 4485936..46c3fc2 100755 Binary files a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/App and b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/App differ diff --git a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources index 4ab9a1d..3acc53d 100644 --- a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources +++ b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources @@ -52,10 +52,6 @@ sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/order/icon_order_sucess.png - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - flutter_assets/assets/images/search.png bbW0EKFzhnRZv1DDPt08Hk6bU+U= @@ -130,7 +126,7 @@ flutter_assets/kernel_blob.bin - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf @@ -253,17 +249,6 @@ c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - flutter_assets/assets/images/order/icon_order_sucess.png - - hash - - sxjr9ZcIGCoXZ3yC/aLqSpGzJ2Q= - - hash2 - - c4wySsehvqIo8Zk5X7c4aUL48MJdmgEXr2tcciPMLlE= - - flutter_assets/assets/images/search.png hash @@ -466,11 +451,11 @@ hash - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= hash2 - PbCxbgSr03xuoHF6okSWNtHnrEmO4/hIUmZX5MRLpY4= + PGRzojBRXfrk6mC1gpiNrn3dzXD1xHzSjJCJdLvsovE= flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf diff --git a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin index f912004..a2b0c97 100644 Binary files a/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin and b/build/ios/iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin differ diff --git a/build/ios/iphonesimulator/Runner.app/Runner b/build/ios/iphonesimulator/Runner.app/Runner index 1496240..b013bc0 100755 Binary files a/build/ios/iphonesimulator/Runner.app/Runner and b/build/ios/iphonesimulator/Runner.app/Runner differ diff --git a/build/ios/iphonesimulator/Runner.app/_CodeSignature/CodeResources b/build/ios/iphonesimulator/Runner.app/_CodeSignature/CodeResources index a6437dd..0110837 100644 --- a/build/ios/iphonesimulator/Runner.app/_CodeSignature/CodeResources +++ b/build/ios/iphonesimulator/Runner.app/_CodeSignature/CodeResources @@ -110,7 +110,7 @@ Frameworks/App.framework/App - L1a0o1wVkn+B8eseIyb3hZzaAWQ= + HJ/Ks2PD1inSI+aXhJfo5X65KMA= Frameworks/App.framework/Info.plist @@ -118,7 +118,7 @@ Frameworks/App.framework/_CodeSignature/CodeResources - n+4Ljp9rUsHHUhNVO2tJ1jIrKTk= + UB9EI/exDiYJHknckmELqPV2nFs= Frameworks/App.framework/flutter_assets/AssetManifest.json @@ -234,7 +234,7 @@ Frameworks/App.framework/flutter_assets/kernel_blob.bin - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf @@ -641,11 +641,11 @@ hash - L1a0o1wVkn+B8eseIyb3hZzaAWQ= + HJ/Ks2PD1inSI+aXhJfo5X65KMA= hash2 - L9NcViiqF/e0QWa+Uj0UHBDXboScJPPvd/yMhvdQZaE= + LYiu5jj2mHbSM9JFDBEXE53jhCzTtwaSLxXzOuBs2xw= Frameworks/App.framework/Info.plist @@ -663,11 +663,11 @@ hash - n+4Ljp9rUsHHUhNVO2tJ1jIrKTk= + UB9EI/exDiYJHknckmELqPV2nFs= hash2 - /CF/OmNCLyOqJ+m6HhomsMQvHqf8qaVgrkk8jzLR+g4= + etA7sVuZbOLZy7KCZFY/L1jaD+J4hCfRb3tWfmy67dM= Frameworks/App.framework/flutter_assets/AssetManifest.json @@ -982,11 +982,11 @@ hash - l8d5keZY1KLx7iKI8dlPM/8F6R0= + uYQMtJhveX/PAG6rB3AMSXhBrv8= hash2 - PbCxbgSr03xuoHF6okSWNtHnrEmO4/hIUmZX5MRLpY4= + PGRzojBRXfrk6mC1gpiNrn3dzXD1xHzSjJCJdLvsovE= Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf diff --git a/lib/pages/components/dot_number.dart b/lib/pages/components/dot_number.dart new file mode 100644 index 0000000..7fd1143 --- /dev/null +++ b/lib/pages/components/dot_number.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; + +class DotNumber extends StatelessWidget { + final double number; + final Color color; + final int dotLength; + final double size; + final String prefix; + final double correct; + + const DotNumber( + this.number, { + this.dotLength = 4, // 小数点后面的位数 + this.color = const Color.fromRGBO(255, 255, 255, .7), // 文本颜色 + this.size = 32.0, // 字符尺寸 + this.prefix = '', // 前缀字符 + this.correct = 0, // 小数点底部边距修正 + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + prefix + number.truncate().toString(), + style: TextStyle( + color: color, + fontSize: size, + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: correct > 0 ? correct : (size / 10), + ), + child: Text( + (number % 1).toStringAsFixed(dotLength).substring(1), + style: TextStyle( + color: color.withAlpha(0xB3), + fontSize: size * 0.618, + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/store/buy/buy.dart b/lib/pages/store/buy/buy.dart index d063155..dd108ba 100644 --- a/lib/pages/store/buy/buy.dart +++ b/lib/pages/store/buy/buy.dart @@ -1,7 +1,7 @@ /* * @Author: Aimee~ * @Date: 2022-05-26 13:16:03 - * @LastEditTime: 2022-06-06 15:53:45 + * @LastEditTime: 2022-06-06 17:32:27 * @LastEditors: Aimee * @FilePath: /gl_dao/lib/pages/store/buy/buy.dart * @Description: 订单确认页面 @@ -11,7 +11,7 @@ import 'package:get/get.dart'; import '../../../main_color.dart'; import '../../address/adds_list/adds_list_page.dart'; -import '../../components/yy_alert_dialog_with_divider.dart'; +// import '../../components/yy_alert_dialog_with_divider.dart'; import '../checkout/checkout_page.dart'; class BuyPages extends StatefulWidget { diff --git a/lib/pages/store/cart/cart_page.dart b/lib/pages/store/cart/cart_page.dart new file mode 100644 index 0000000..8b04bdc --- /dev/null +++ b/lib/pages/store/cart/cart_page.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:gl_dao/main_color.dart'; +import 'widget/shop_item.dart'; + +class CartPage extends StatefulWidget { + const CartPage({Key? key}) : super(key: key); + + @override + State createState() => _CartPageState(); +} + +class _CartPageState extends State { + List cartList = [ + { + 'cartId': '1', + 'title': '七度空间京东旗舰店', + 'url': 'assets/images/detail.png', + 'goodsList': [ + {'goodsId': 001, 'qty': 1}, + {'goodsId': 002, 'qty': 2}, + {'goodsId': 003, 'qty': 3}, + ] + }, + { + 'cartId': '2', + 'title': '苏菲京东旗舰店', + 'url': 'assets/images/banner.png', + 'goodsList': [ + {'goodsId': 201, 'qty': 11}, + {'goodsId': 202, 'qty': 12}, + {'goodsId': 203, 'qty': 13}, + {'goodsId': 204, 'qty': 14}, + ] + }, + { + 'cartId': '2', + 'title': '透蜜京东旗舰店', + 'url': 'assets/images/banner.png', + 'goodsList': [ + {'goodsId': 301, 'qty': 121}, + {'goodsId': 302, 'qty': 122}, + {'goodsId': 303, 'qty': 123}, + {'goodsId': 304, 'qty': 124}, + ] + }, + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text( + '购物车', + style: TextStyle( + color: Colors.white, + ), + ), + backgroundColor: tMainRedColor, + shadowColor: Colors.transparent, + actions: [ + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.more_horiz, + color: Colors.white, + ), + ), + ], + ), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView( + children: cartList.map((item) { + return ShopItem(item); + }).toList(), + ), + ), + bottomNavigationBar: _cartAction(), + ); + } + + Widget _cartAction() { + return Container( + padding: const EdgeInsets.only( + top: 4, + left: 4, + right: 8, + bottom: 4, + ), + decoration: const BoxDecoration( + color: tMainBg, + border: Border( + top: BorderSide(color: Colors.black12), + ), + ), + child: Row( + children: [ + Radio( + toggleable: true, + value: false, + groupValue: 'G', + onChanged: (e) {}, + ), + const Expanded( + child: Text('价格'), + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(tMainRedColor), + ), + onPressed: () { + // Get.toNamed(MallRoutes.transactionSure); + }, + child: const Text('去结算'), + ), + ], + ), + ); + } +} diff --git a/lib/pages/store/cart/widget/goods_item.dart b/lib/pages/store/cart/widget/goods_item.dart new file mode 100644 index 0000000..3cff99a --- /dev/null +++ b/lib/pages/store/cart/widget/goods_item.dart @@ -0,0 +1,131 @@ +/* + * @Author: Aimee~ + * @Date: 2022-06-06 17:33:14 + * @LastEditTime: 2022-06-07 15:36:43 + * @LastEditors: Aimee + * @FilePath: /gl_dao/lib/pages/store/cart/widget/goods_item.dart + * @Description: 购物车内的商品列表信息 + */ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:gl_dao/main_color.dart'; + +import '../../../components/dot_number.dart'; + +// import '../../../routes/mall_routes.dart'; + +class GoodsItem extends StatelessWidget { + final Map it; + const GoodsItem(this.it, {Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: GestureDetector( + onTap: () { + // ignore: avoid_print + print('商品信息'); + // Get.toNamed(MallRoutes.goods, arguments: { + // 'goodsId': 1, + // }); + }, + onLongPress: () { + Get.snackbar('提示', '长按了商品'); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + toggleable: true, + value: false, + groupValue: 'G', + onChanged: (e) {}, + ), + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: Image.asset( + 'assets/images/detail.png', + width: 120, + height: 120 * 0.618, + fit: BoxFit.cover, + ), + ), + const SizedBox( + width: 8, + ), + Expanded( + child: SizedBox( + height: 120 * 0.618, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '商品名称商品名称商品名称商品名称商品名称', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + overflow: TextOverflow.ellipsis, + ), + maxLines: 1, + ), + const Text( + '型号描述', + style: TextStyle( + fontSize: 14, + overflow: TextOverflow.ellipsis, + color: Colors.black87, + ), + maxLines: 1, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: const [ + // DotNumber( + // 123.22, + // dotLength: 2, + // // prefix: '¥', + // size: 16, + // color: tMainRedColor, + // ), + Text( + '123.22', + style: TextStyle( + fontSize: 17, + color: tMainRedColor, + ), + ), + SizedBox(width: 2), + Text( + 'DT积分', + style: TextStyle( + fontSize: 10, + color: tMainRedColor, + ), + ), + ], + ), + Text( + '数量 x ${it["qty"]}', + style: const TextStyle( + color: Colors.grey, + fontSize: 13, + ), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/store/cart/widget/shop_item.dart b/lib/pages/store/cart/widget/shop_item.dart new file mode 100644 index 0000000..1dbaf0d --- /dev/null +++ b/lib/pages/store/cart/widget/shop_item.dart @@ -0,0 +1,107 @@ +/* + * @Author: Aimee~ + * @Date: 2022-06-06 17:33:14 + * @LastEditTime: 2022-06-07 15:26:53 + * @LastEditors: Aimee + * @FilePath: /gl_dao/lib/pages/store/cart/widget/shop_item.dart + * @Description: 店铺信息 + */ +import 'package:flutter/material.dart'; + +import '../../../components/dot_number.dart'; +import 'goods_item.dart'; + +class ShopItem extends StatelessWidget { + final Map item; + const ShopItem(this.item, {Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Container( + width: double.infinity, + padding: const EdgeInsets.only( + right: 8, + bottom: 8, + top: 8, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(4), + boxShadow: const [ + BoxShadow( + blurStyle: BlurStyle.outer, + color: Colors.black12, + blurRadius: 4, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Radio( + toggleable: true, + value: false, + groupValue: 'G', + onChanged: (e) { + // ignore: avoid_print + print(e); + }, + ), + ClipRRect( + borderRadius: BorderRadius.circular(16), + child: Image.asset( + item["url"], + width: 32, + height: 32, + fit: BoxFit.cover, + ), + ), + const SizedBox(width: 8), + Text( + item["title"], + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + const Divider(height: 0.4), + Column( + children: item['goodsList'].map((it) { + return GoodsItem(it); + }).toList(), + ), + const Divider(height: 0.4), + Padding( + padding: const EdgeInsets.only(top: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: const [ + Text( + '合计:', + style: TextStyle( + fontSize: 16, + ), + ), + DotNumber( + 123.125, + dotLength: 2, + size: 18, + prefix: '¥', + color: Colors.red, + correct: 3.3, + ) + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/store/checkout/checkout_page.dart b/lib/pages/store/checkout/checkout_page.dart index 73b72b4..95bf9e2 100644 --- a/lib/pages/store/checkout/checkout_page.dart +++ b/lib/pages/store/checkout/checkout_page.dart @@ -3,7 +3,7 @@ /* * @Author: Aimee~ * @Date: 2022-06-06 09:14:27 - * @LastEditTime: 2022-06-06 15:45:05 + * @LastEditTime: 2022-06-06 16:07:17 * @LastEditors: Aimee * @FilePath: /gl_dao/lib/pages/store/checkout/checkout_page.dart * @Description: 收银台 diff --git a/lib/pages/store/index/index_page.dart b/lib/pages/store/index/index_page.dart index 99da936..dccecfb 100644 --- a/lib/pages/store/index/index_page.dart +++ b/lib/pages/store/index/index_page.dart @@ -2,7 +2,7 @@ * @Author: Aimee * @Date: 2022-05-26 13:16:03 * @LastEditors: Aimee - * @LastEditTime: 2022-05-31 14:49:55 + * @LastEditTime: 2022-06-06 16:08:41 * @FilePath: /gl_dao/lib/pages/store/index/index_page.dart * @Description: 商城首页 */ @@ -13,6 +13,7 @@ import 'package:gl_dao/main_color.dart'; import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart'; import '../details/details_page.dart'; +import '../order/order_list_page.dart'; import './components/offline_bussiness.dart'; import './components/offline_title.dart'; @@ -161,6 +162,15 @@ class _StorePagesState extends State with TickerProviderStateMixin { ), ), + GestureDetector( + child: ElevatedButton( + child: const Text('我的订单页面'), + onPressed: () { + Get.to(const OrderListPage()); + }, + ), + ), + // *******分类组件******* Padding( padding: const EdgeInsets.only(bottom: 6.0), diff --git a/lib/pages/store/index_copy_1.dart b/lib/pages/store/index_copy_1.dart deleted file mode 100644 index 33d2384..0000000 --- a/lib/pages/store/index_copy_1.dart +++ /dev/null @@ -1,157 +0,0 @@ -import 'package:flutter/material.dart'; - -class StorePages1 extends StatefulWidget { - const StorePages1({Key? key}) : super(key: key); - - @override - _StorePages1State createState() => _StorePages1State(); -} - -class _StorePages1State extends State - with TickerProviderStateMixin { - late TabController _tabController; - - @override - void initState() { - _tabController = TabController( - length: 3, - vsync: this, - ); - - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - body: SafeArea( - child: NestedScrollView( - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverToBoxAdapter( - child: Column( - children: [ - Image.network( - "https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350", - fit: BoxFit.cover, - ) - ], - ), - ), - SliverPersistentHeader( - delegate: _SliverAppBarDelegate( - TabBar( - controller: _tabController, - tabs: const [ - Tab(text: "Tab 1"), - Tab(text: "Tab 2"), - Tab(text: "Tab 3"), - ], - ), - ), - pinned: true, - ), - ]; - }, - body: TabBarView( - controller: _tabController, - children: [ - ListView( - children: const [ - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - Text('asdfasjkdfahsdjkl'), - ], - ), - const Center( - child: Text('Tab 2'), - ), - const Center( - child: Text('Tab 3'), - ), - ], - ), - ), - ), - ); - } -} - -class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { - _SliverAppBarDelegate(this._tabBar); - - final TabBar _tabBar; - - @override - double get minExtent => _tabBar.preferredSize.height; - @override - double get maxExtent => _tabBar.preferredSize.height; - - @override - Widget build( - BuildContext context, double shrinkOffset, bool overlapsContent) { - return Container( - color: Colors.red, - child: _tabBar, - ); - } - - @override - bool shouldRebuild(_SliverAppBarDelegate oldDelegate) { - return false; - } -} diff --git a/lib/pages/store/order/order_list_page.dart b/lib/pages/store/order/order_list_page.dart new file mode 100644 index 0000000..5a5982a --- /dev/null +++ b/lib/pages/store/order/order_list_page.dart @@ -0,0 +1,57 @@ +/* + * @Author: Aimee~ + * @Date: 2022-06-06 16:06:00 + * @LastEditTime: 2022-06-06 16:28:58 + * @LastEditors: Aimee + * @FilePath: /gl_dao/lib/pages/store/order/order_list_page.dart + * @Description: 我的订单页面 + */ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../main_color.dart'; +import '../cart/cart_page.dart'; + +class OrderListPage extends StatefulWidget { + const OrderListPage({Key? key}) : super(key: key); + + @override + State createState() => _OrderListPageState(); +} + +class _OrderListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: appBar(), + body: const Text('data....'), + ); + } + + // 自定义顶部导航 + PreferredSizeWidget appBar() { + return AppBar( + elevation: 0, + backgroundColor: tMainRedColor, + title: const Text( + '我的订单', + style: TextStyle( + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + actions: [ + IconButton( + icon: const Icon(Icons.shopping_cart), + tooltip: 'Open shopping cart', + onPressed: () { + // handle the press + Get.to(const CartPage()); + }, + ), + ], + ); + } +}