diff --git a/assets/newIcon/alipay.png b/assets/newIcon/alipay.png new file mode 100644 index 00000000..2f0a9458 Binary files /dev/null and b/assets/newIcon/alipay.png differ diff --git a/assets/newIcon/wallet_balance.png b/assets/newIcon/wallet_balance.png new file mode 100644 index 00000000..934c4b6f Binary files /dev/null and b/assets/newIcon/wallet_balance.png differ diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 2df3f62e..7c123913 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -272,7 +272,6 @@ class _Manager { ///借还管理:根据用户主键id查询需要归还物品信息(归还界面) String get articleReturnList => '/user/articleBorrow/findBorrowByUserId'; - ///生活缴费:查询当前用户的房屋是否缴费 String get findEstatelsPament => '/user/dailyPayment/findEstateIsPayment'; diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index 03cf5a29..bbdd5708 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/widget/others/user_tool.dart'; part 'market_api.dart'; + part 'profile_api.dart'; class SAASAPI { @@ -35,6 +36,7 @@ class SAASAPI { static _WorkOrder workOrder = _WorkOrder(); static _Pay pay = _Pay(); static _LifePay lifePay = _LifePay(); + static _Balance balance = _Balance(); ///二级分类 static _ProfileApi profile = _ProfileApi(); @@ -281,6 +283,20 @@ class _WorkOrder { } class _Pay { + ///app积分充值 + String get createPointsOrder => '/app/user/alipay/createPointsOrder'; + + ///app积分充值 向支付宝发起订单查询请求 + String get pointsOrderCheckAlipay => + '/app/user/alipay/pointsOrderCheckAlipay'; + + ///app余额充值 创建订单 + String get createBalanceOrder => '/app/user/alipay/createBalanceOrder'; + + ///app余额充值 向支付宝发起订单查询请求 + String get balanceOrderCheckAlipay => + '/app/user/alipay/balanceOrderCheckAlipay'; + ///创建商品订单 String get createGoodsOrder => '/app/user/alipay/createGoodsOrder'; @@ -313,3 +329,14 @@ class _LifePay { ///查询预交余额 String get findEstateBalance => '/app/user/livingExpenses/findEstateBalance'; } + +class _Balance { + ///设置余额支付密码 + String get setBalancePayPsd => '/app/user/balance/settingBalancePayPwd'; + + ///购买积分 + String get buyPointsByBalance => '/app/user/balance/buyPoints'; + + ///app用户交易记录 + String get tradeRecordList => '/app/user/tradeRecord/tradeRecordList'; +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 6db5805b..70ed76dd 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -1297,13 +1297,12 @@ class $AssetsImagesGen { AssetGenImage get wxpay => const AssetGenImage('assets/images/wxpay.png'); } -class $AssetsJsonGen { - const $AssetsJsonGen(); -} - class $AssetsNewIconGen { const $AssetsNewIconGen(); + /// File path: assets/newIcon/alipay.png + AssetGenImage get alipay => const AssetGenImage('assets/newIcon/alipay.png'); + /// File path: assets/newIcon/all_classes.png AssetGenImage get allClasses => const AssetGenImage('assets/newIcon/all_classes.png'); @@ -1457,6 +1456,10 @@ class $AssetsNewIconGen { /// File path: assets/newIcon/srzf.png AssetGenImage get srzf => const AssetGenImage('assets/newIcon/srzf.png'); + /// File path: assets/newIcon/wallet_balance.png + AssetGenImage get walletBalance => + const AssetGenImage('assets/newIcon/wallet_balance.png'); + /// File path: assets/newIcon/xcyhm.png AssetGenImage get xcyhm => const AssetGenImage('assets/newIcon/xcyhm.png'); @@ -1563,7 +1566,6 @@ class Assets { static const $AssetsHomeGen home = $AssetsHomeGen(); static const $AssetsIconsGen icons = $AssetsIconsGen(); static const $AssetsImagesGen images = $AssetsImagesGen(); - static const $AssetsJsonGen json = $AssetsJsonGen(); static const $AssetsNewIconGen newIcon = $AssetsNewIconGen(); static const $AssetsStaticGen static = $AssetsStaticGen(); static const $AssetsTabGen tab = $AssetsTabGen(); diff --git a/lib/main.dart b/lib/main.dart index ed62b44c..b4e4d7a9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/provider/clock_timer_provider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -42,6 +43,7 @@ class _MyAppState extends State { ChangeNotifierProvider(create: (context) => AppProvider()), ChangeNotifierProvider(create: (context) => SignUpProvider()), ChangeNotifierProvider(create: (context) => DataProvider()), + ChangeNotifierProvider(create: (context) => ClockTimerProvider()), ], child: GestureDetector( onTap: () { @@ -59,7 +61,7 @@ class _MyAppState extends State { designSize: Size(750, 1334), // minTextAdapt: true, // splitScreenMode: true, - builder: () => GetMaterialApp( + builder: (context) => GetMaterialApp( onGenerateTitle: (context) => S.of(context)!.appName, debugShowCheckedModeBanner: false, theme: AppTheme.theme, diff --git a/lib/models/user/user_info_model.dart b/lib/models/user/user_info_model.dart index 3889df5a..eff46d84 100644 --- a/lib/models/user/user_info_model.dart +++ b/lib/models/user/user_info_model.dart @@ -20,6 +20,8 @@ class UserInfoModel { final bool isPointsSignSetting; final bool isSign; final int? points; + final double? balance; + final bool isBalancePayPwd; final List imgList; String get sexValue { @@ -55,6 +57,8 @@ class UserInfoModel { required this.isPointsSignSetting, required this.isSign, this.points, + this.balance, + required this.isBalancePayPwd, required this.imgList, }); } diff --git a/lib/models/user/user_info_model.g.dart b/lib/models/user/user_info_model.g.dart index 5140e033..c30c159e 100644 --- a/lib/models/user/user_info_model.g.dart +++ b/lib/models/user/user_info_model.g.dart @@ -21,6 +21,8 @@ UserInfoModel _$UserInfoModelFromJson(Map json) => isPointsSignSetting: json['isPointsSignSetting'] as bool, isSign: json['isSign'] as bool, points: json['points'] as int?, + balance: (json['balance'] as num?)?.toDouble(), + isBalancePayPwd: json['isBalancePayPwd'] as bool, imgList: (json['imgList'] as List) .map((e) => ImgModel.fromJson(e as Map)) .toList(), diff --git a/lib/models/wallet/trade_record_list_model.dart b/lib/models/wallet/trade_record_list_model.dart new file mode 100644 index 00000000..4a763857 --- /dev/null +++ b/lib/models/wallet/trade_record_list_model.dart @@ -0,0 +1,37 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; + +part 'trade_record_list_model.g.dart'; + +@JsonSerializable() +class TradeRecordListModel extends Equatable { + final int id; + final int type; + final String content; + final double payAmount; + final String createName; + final String createDate; + + factory TradeRecordListModel.fromJson(Map json) => + _$TradeRecordListModelFromJson(json); + + + const TradeRecordListModel({ + required this.id, + required this.type, + required this.content, + required this.payAmount, + required this.createName, + required this.createDate, + }); + + @override + List get props => [ + id, + type, + content, + payAmount, + createName, + createDate, + ]; +} diff --git a/lib/models/wallet/trade_record_list_model.g.dart b/lib/models/wallet/trade_record_list_model.g.dart new file mode 100644 index 00000000..9c740f3b --- /dev/null +++ b/lib/models/wallet/trade_record_list_model.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'trade_record_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TradeRecordListModel _$TradeRecordListModelFromJson( + Map json) => + TradeRecordListModel( + id: json['id'] as int, + type: json['type'] as int, + content: json['content'] as String, + payAmount: (json['payAmount'] as num).toDouble(), + createName: json['createName'] as String, + createDate: json['createDate'] as String, + ); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 323a4a53..f38bfaef 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -385,7 +385,6 @@ class _HomePageState extends State suffixTitle: '查看全部', onTap: () => Get.to(() => ActivityListPage()), ), - 24.hb, _activityItemModels == [] ? SizedBox() : Container( diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index c75d5d2a..9f2decc7 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -1,6 +1,8 @@ import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/personal/user_profile_page.dart'; +import 'package:aku_new_community/pages/personal/wallet/wallet_recharge_page.dart'; +import 'package:aku_new_community/pages/personal/wallet/wallet_trade_record_page.dart'; import 'package:aku_new_community/pages/setting_page/settings_page.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; import 'package:aku_new_community/provider/user_provider.dart'; @@ -10,6 +12,7 @@ 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/bee_avatar_widget.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; @@ -290,172 +293,300 @@ class _PersonalIndexState extends State ], ), ), - Padding( - padding: EdgeInsets.only(top: 600.w), - child: Column( - children: [ - Container( - width: 686.w, - height: 282.w, - decoration: BoxDecoration( - color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.1), - offset: Offset(1, 1), - ), - ], - ), - margin: EdgeInsets.only(left: 32.w, right: 32.w), - padding: EdgeInsets.only( - top: 24.w, left: 32.w, right: 32.w), - child: Column( - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - _homeTitle('我的订单', () { - Get.to(() => OrderPage(initIndex: 0)); - }, '查看全部'), - 50.hb, - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _orderButton( - name: '待付款', - path: Assets.newIcon.icDaifuk.path, - index: 1, - ), - _orderButton( - name: '待发货', - path: Assets.newIcon.imgDaifah.path, - index: 2, - ), - _orderButton( - name: '待收货', - path: Assets.newIcon.icDaishouh.path, - index: 3, - ), - _orderButton( - name: '已完成', - path: Assets.newIcon.imgDaipingj.path, - index: 4, - ), - ], - ), - ], - ), - ), - // Container( - // width: double.infinity, - // height: 100.w, - // clipBehavior: Clip.antiAlias, - // decoration: BoxDecoration( - // // color: Colors.white, - // borderRadius: BorderRadius.circular(16.w)), - // margin: EdgeInsets.symmetric(horizontal: 32.w), - // child: Material( - // color: Colors.white, - // child: InkWell( - // onTap: () { - // Get.to(() => ClockInPage()); - // }, - // borderRadius: BorderRadius.circular(16.w), - // child: Padding( - // padding: EdgeInsets.symmetric( - // horizontal: 32.w, vertical: 24.w), - // child: Row( - // children: [ - // '我的积分'.text.size(30.sp).black.bold.make(), - // Spacer(), - // // Assets.icons.intergral - // // .image(width: 32.w, height: 32.w), - // // 16.w.widthBox, - // // '123'.text.size(28.sp).black.make(), - // // 16.w.widthBox, - // Icon( - // CupertinoIcons.right_chevron, - // size: 24.w, - // ), - // ], - // ), - // ), - // ), - // ), - // ), - Container( - decoration: BoxDecoration( - color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.1), - offset: Offset(1, 1), - ), - ], - ), - margin: EdgeInsets.all(32.w), - padding: EdgeInsets.all(32.w), - child: Column( - children: [ - Row( - children: [ - 22.wb, - '其他功能' - .text - .size(32.sp) - .color(Color(0xFF2B2B2B)) - .bold - .make(), - Spacer(), - ], - ), - 24.hb, - _function('我的积分', Assets.newIcon.icJifen.path, - () => Get.to(() => ClockInPage()), ''), - _function( - '我的房屋', - Assets.newIcon.icWdfw.path, - () { - Get.to(() => MyHousePage()); - }, - // () => HouseOwnersPage( - // identify: 4, - // ), - '${UserTool.userProvider.defaultHouseString}', - ), - _function('我的家庭', Assets.newIcon.icWdjt.path, () { - Get.to(() => MyFamilyPage()); - }, ''), - // _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG, - // () => CarParkingPage(), ''), - // 36.hb, - // _function('我的车', R.ASSETS_ICONS_ICON_MY_CAR_PNG, - // () => CarManagePage(), ''), - // 36.hb, - _function('我的访客', Assets.newIcon.icWdfk.path, () { - BotToast.showText( - text: '本小区尚未配置门禁设备', - align: Alignment(0, 0.5)); - }, ''), - _function( - '收货地址', - Assets.newIcon.icShdz.path, - () => Get.to(() => AddressListPage( - canBack: false, - )), - ''), - ], - ), - ), - ], - ), - ), + _columBody(), ], )), )); } + Padding _columBody() { + var wallet = Container( + margin: EdgeInsets.symmetric(horizontal: 32.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Colors.white, + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + child: Row( + children: [ + '我的钱包'.text.size(32.sp).color(Colors.black).make(), + Spacer(), + GestureDetector( + onTap: () { + Get.to(() => WalletTradeRecordPage()); + }, + child: Row( + children: [ + '交易记录' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + 8.wb, + Icon( + CupertinoIcons.chevron_right, + color: Colors.black.withOpacity(0.45), + size: 32.w, + ), + ], + ), + ), + ], + ), + ), + BeeDivider.horizontal(), + Padding( + padding: EdgeInsets.symmetric(vertical: 24.w), + child: Row( + children: [ + Expanded( + child: Column( + children: [ + '${UserTool.userProvider.userInfoModel!.points ?? 0}' + .text + .size(40.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 12.hb, + '积分' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ), + Expanded( + child: Column( + children: [ + '${UserTool.userProvider.userInfoModel!.balance ?? 0}' + .text + .size(40.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 12.hb, + '余额' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ], + ), + ) + ], + ), + ), + BeeDivider.horizontal(), + Row( + children: [ + Expanded( + child: GestureDetector( + onTap: () async { + await Get.to(WalletRechargePage( + initIndex: 0, + )); + _refreshController.callRefresh(); + }, + child: Material( + color: Colors.transparent, + child: Center( + child: '充值' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ), + ))), + Container( + height: 84.w, + width: 2.w, + color: Colors.black.withOpacity(0.06), + ), + Expanded( + child: GestureDetector( + onTap: () async { + await Get.to(WalletRechargePage( + initIndex: 1, + )); + _refreshController.callRefresh(); + }, + child: Material( + color: Colors.transparent, + child: Center( + child: '购买积分' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + ), + ))) + ], + ) + ], + ), + ); + var order = Container( + width: 686.w, + height: 282.w, + decoration: BoxDecoration( + color: Color(0xffffffff), + borderRadius: BorderRadius.all(Radius.circular(8)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + offset: Offset(1, 1), + ), + ], + ), + margin: EdgeInsets.only(left: 32.w, right: 32.w), + padding: EdgeInsets.only(top: 24.w, left: 32.w, right: 32.w), + child: Column( + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + _homeTitle('我的订单', () { + Get.to(() => OrderPage(initIndex: 0)); + }, '查看全部'), + 50.hb, + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + _orderButton( + name: '待付款', + path: Assets.newIcon.icDaifuk.path, + index: 1, + ), + _orderButton( + name: '待发货', + path: Assets.newIcon.imgDaifah.path, + index: 2, + ), + _orderButton( + name: '待收货', + path: Assets.newIcon.icDaishouh.path, + index: 3, + ), + _orderButton( + name: '已完成', + path: Assets.newIcon.imgDaipingj.path, + index: 4, + ), + ], + ), + ], + ), + ); + var extra = Container( + decoration: BoxDecoration( + color: Color(0xffffffff), + borderRadius: BorderRadius.all(Radius.circular(8)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + offset: Offset(1, 1), + ), + ], + ), + margin: EdgeInsets.all(32.w), + padding: EdgeInsets.all(32.w), + child: Column( + children: [ + Row( + children: [ + 22.wb, + '其他功能'.text.size(32.sp).color(Color(0xFF2B2B2B)).bold.make(), + Spacer(), + ], + ), + 24.hb, + _function('我的积分', Assets.newIcon.icJifen.path, + () => Get.to(() => ClockInPage()), ''), + _function( + '我的房屋', + Assets.newIcon.icWdfw.path, + () { + Get.to(() => MyHousePage()); + }, + // () => HouseOwnersPage( + // identify: 4, + // ), + '${UserTool.userProvider.defaultHouseString}', + ), + _function('我的家庭', Assets.newIcon.icWdjt.path, () { + Get.to(() => MyFamilyPage()); + }, ''), + // _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG, + // () => CarParkingPage(), ''), + // 36.hb, + // _function('我的车', R.ASSETS_ICONS_ICON_MY_CAR_PNG, + // () => CarManagePage(), ''), + // 36.hb, + _function('我的访客', Assets.newIcon.icWdfk.path, () { + BotToast.showText(text: '本小区尚未配置门禁设备', align: Alignment(0, 0.5)); + }, ''), + _function( + '收货地址', + Assets.newIcon.icShdz.path, + () => Get.to(() => AddressListPage( + canBack: false, + )), + ''), + ], + ), + ); + return Padding( + padding: EdgeInsets.only(top: 560.w), + child: Column( + children: [ + wallet, + 48.hb, + order, + // Container( + // width: double.infinity, + // height: 100.w, + // clipBehavior: Clip.antiAlias, + // decoration: BoxDecoration( + // // color: Colors.white, + // borderRadius: BorderRadius.circular(16.w)), + // margin: EdgeInsets.symmetric(horizontal: 32.w), + // child: Material( + // color: Colors.white, + // child: InkWell( + // onTap: () { + // Get.to(() => ClockInPage()); + // }, + // borderRadius: BorderRadius.circular(16.w), + // child: Padding( + // padding: EdgeInsets.symmetric( + // horizontal: 32.w, vertical: 24.w), + // child: Row( + // children: [ + // '我的积分'.text.size(30.sp).black.bold.make(), + // Spacer(), + // // Assets.icons.intergral + // // .image(width: 32.w, height: 32.w), + // // 16.w.widthBox, + // // '123'.text.size(28.sp).black.make(), + // // 16.w.widthBox, + // Icon( + // CupertinoIcons.right_chevron, + // size: 24.w, + // ), + // ], + // ), + // ), + // ), + // ), + // ), + extra, + ], + ), + ); + } + _homeTitle(String title, VoidCallback onTap, String suffixTitle) { return Row( children: [ diff --git a/lib/pages/personal/wallet/balance_record_view.dart b/lib/pages/personal/wallet/balance_record_view.dart new file mode 100644 index 00000000..019f7d05 --- /dev/null +++ b/lib/pages/personal/wallet/balance_record_view.dart @@ -0,0 +1,210 @@ +import 'package:aku_new_community/constants/saas_api.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/models/wallet/trade_record_list_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class BalanceRecordView extends StatefulWidget { + const BalanceRecordView({Key? key}) : super(key: key); + + @override + _BalanceRecordViewState createState() => _BalanceRecordViewState(); +} + +class _BalanceRecordViewState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + + List _models = []; + int _pageNum = 1; + int _size = 10; + DateTime _pickTime = DateTime.now(); + int _pickType = 0; + + Map _types = { + 1: '支付', + 2: '退还', + 3: '充值', + 4: '收入', + 5: '提现', + 6: '抵扣', + }; + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + child: Row( + children: [ + GestureDetector( + onTap: () async { + var date = await BeeDatePicker.monthPicker( + DateTime.now().subtract(Duration(days: 365))); + if (date != null) { + _pickTime = date; + } + setState(() {}); + }, + child: Row( + children: [ + '${_pickTime.year}年${_pickTime.month}月' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Icon( + CupertinoIcons.chevron_down, + size: 32.w, + color: Colors.black.withOpacity(0.45), + ) + ], + ), + ), + Spacer(), + MaterialButton( + color: Colors.black.withOpacity(0.06), + onPressed: () async { + await showModalBottomSheet( + context: context, + builder: (context) { + return BeePickerBox( + onPressed: () { + Get.back(); + setState(() {}); + }, + child: CupertinoPicker.builder( + itemExtent: 60.w, + childCount: _types.values.length, + onSelectedItemChanged: (index) { + _pickType = _types.keys.toList()[index]; + }, + itemBuilder: (context, index) { + var str = _types.values.toList()[index]; + return Center( + child: str.text.size(32.sp).isIntrinsic.make(), + ); + }, + ), + ); + }, + ); + }, + shape: StadiumBorder(), + elevation: 0, + child: Row( + children: [ + '${_pickType == 0 ? '全部类型' : _types[_pickType]}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Icon( + CupertinoIcons.chevron_down, + size: 24.w, + color: Colors.black.withOpacity(0.25), + ) + ], + ), + ), + ], + ), + ), + Flexible( + child: Container( + color: Colors.white, + child: EasyRefresh( + header: MaterialHeader(), + footer: MaterialFooter(), + firstRefresh: true, + controller: _refreshController, + onRefresh: () async { + _pageNum = 1; + var baseList = await NetUtil() + .getList(SAASAPI.balance.tradeRecordList, params: { + 'pageNum': _pageNum, + 'size': _size, + 'modelType': 0, + 'type': _pickType, + 'createDate': _pickTime, + }); + + _models = baseList.rows + .map((e) => TradeRecordListModel.fromJson(e)) + .toList(); + }, + onLoad: () async { + _pageNum++; + var baseList = await NetUtil() + .getList(SAASAPI.balance.tradeRecordList, params: { + 'pageNum': _pageNum, + 'size': _size, + 'modelType': 0, + 'type': _pickType, + 'createDate': _pickTime, + }); + if (baseList.total > _models.length) { + _models.addAll(baseList.rows + .map((e) => TradeRecordListModel.fromJson(e)) + .toList()); + } else { + _refreshController.finishLoad(noMore: true); + } + }, + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: _models.map((e) => _buildCard(e)).toList(), + ), + ), + ), + ), + ], + ); + } + + bool incom(type) => [2, 3, 4].contains(type); + + Widget _buildCard(TradeRecordListModel model) { + return Column( + children: [ + Row( + children: [ + '${_types[model.type]}-${model.content}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Spacer(), + '${incom(model.type) ? '+' : '-'}¥${model.payAmount}' + .text + .size(28.sp) + .color(incom(model.type) + ? Colors.red + : Colors.black.withOpacity(0.85)) + .make(), + ], + ), + 8.hb, + '${DateUtil.formatDateStr(model.createDate, format: 'MM/dd HH:mm')}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ); + } +} diff --git a/lib/pages/personal/wallet/input_pay_password_dialog.dart b/lib/pages/personal/wallet/input_pay_password_dialog.dart new file mode 100644 index 00000000..faeef790 --- /dev/null +++ b/lib/pages/personal/wallet/input_pay_password_dialog.dart @@ -0,0 +1,91 @@ +import 'package:aku_new_community/constants/saas_api.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:sms_autofill/sms_autofill.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class InputPayPasswordDialog extends StatefulWidget { + final int balance; + + const InputPayPasswordDialog({ + Key? key, + required this.balance, + }) : super(key: key); + + @override + _InputPayPasswordDialogState createState() => _InputPayPasswordDialogState(); +} + +class _InputPayPasswordDialogState extends State { + String? _currentCode; + + @override + Widget build(BuildContext context) { + return Center( + child: Padding( + padding: EdgeInsets.only(bottom: 300.w), + child: Material( + borderRadius: BorderRadius.circular(24.w), + child: Container( + width: 630.w, + height: 480.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(24.w)), + child: Column( + children: [ + 96.hb, + '请输入您的支付密码' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .bold + .make(), + 40.hb, + '支付密码仅用于对钱包余额支付时确认' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + PinFieldAutoFill( + autoFocus: true, + currentCode: _currentCode, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + codeLength: 6, + onCodeChanged: (code) async { + if ((code?.length ?? 0) >= 6) { + Get.back(); + var base = await NetUtil() + .post(SAASAPI.balance.buyPointsByBalance, params: { + 'balance': widget.balance, + 'balancePayPwd': code + }); + Get.back(); + if (!base.success) { + BotToast.showText(text: base.msg); + } + } + _currentCode = code; + }, + decoration: UnderlineDecoration( + colorBuilder: FixedColorListBuilder([ + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + ])), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/personal/wallet/pay_way_dialog.dart b/lib/pages/personal/wallet/pay_way_dialog.dart new file mode 100644 index 00000000..9ce8487e --- /dev/null +++ b/lib/pages/personal/wallet/pay_way_dialog.dart @@ -0,0 +1,240 @@ +import 'dart:ui'; + +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/pages/life_pay/pay_util.dart'; +import 'package:aku_new_community/pages/personal/wallet/input_pay_password_dialog.dart'; +import 'package:aku_new_community/pages/personal/wallet/set_pay_password_dialog.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; +import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class PayWayDialog extends StatefulWidget { + final bool isBalance; + final int amount; + final bool insufficientBalance; + + const PayWayDialog( + {Key? key, + required this.isBalance, + required this.amount, + required this.insufficientBalance}) + : super(key: key); + + @override + _PayWayDialogState createState() => _PayWayDialogState(); +} + +class _PayWayDialogState extends State { + List _payType = []; + + @override + void initState() { + if (widget.isBalance) { + _payType.add(1); + } else { + if (widget.insufficientBalance) { + _payType.add(1); + } else { + _payType.add(0); + } + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + var wallet = GestureDetector( + onTap: () { + if (widget.insufficientBalance) { + return; + } + _payType.clear(); + _payType.add(0); + setState(() {}); + }, + child: ClipRect( + child: Stack( + children: [ + Material( + color: Colors.transparent, + child: Row( + children: [ + Assets.newIcon.walletBalance.image(width: 48.w, height: 48.w), + 8.wb, + '钱包余额' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 16.wb, + Visibility( + visible: widget.insufficientBalance, + child: + '钱包余额不足'.text.size(24.sp).color(Colors.red).make()), + Spacer(), + BeeCheckRadio( + groupValue: _payType, + value: 0, + size: 36.w, + indent: Icon( + CupertinoIcons.checkmark_alt, + color: Colors.black, + size: 28.w, + ), + ), + ], + ), + ), + BackdropFilter( + filter: ImageFilter.blur( + sigmaX: widget.insufficientBalance ? 1 : 0, + sigmaY: widget.insufficientBalance ? 1 : 0), + child: Container(), + ), + ], + ), + ), + ); + var alipay = GestureDetector( + onTap: () { + _payType.clear(); + _payType.add(1); + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + Assets.newIcon.alipay.image(width: 48.w, height: 48.w), + 8.wb, + '支付宝'.text.size(28.sp).color(Colors.black.withOpacity(0.85)).make(), + Spacer(), + BeeCheckRadio( + groupValue: _payType, + value: 1, + size: 36.w, + indent: Icon( + CupertinoIcons.checkmark_alt, + color: Colors.black, + size: 28.w, + ), + ), + ], + ), + ), + ); + return Material( + color: Colors.transparent, + child: Container( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + width: double.infinity, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + '支付' + .text + .size(32.sp) + .bold + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make(), + 48.hb, + Column( + children: [ + '¥' + .richText + .color(Colors.black.withOpacity(0.85)) + .size(26.sp) + .withTextSpanChildren([ + widget.amount + .toString() + .textSpan + .size(40.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ]).make(), + Offstage( + offstage: widget.isBalance, + child: '总共购买${widget.amount * 10}积分' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + 60.hb, + Offstage( + offstage: widget.isBalance, + child: Column( + children: [ + wallet, + 40.hb, + ], + ), + ), + alipay, + 80.hb, + BeeLongButton( + width: double.infinity, + onPressed: () async { + if (_payType.contains(0)) { + if (!UserTool + .userProvider.userInfoModel!.isBalancePayPwd) { + Get.dialog(SetPayPasswordDialog()); + } else { + Get.back(); + Get.dialog( + InputPayPasswordDialog(balance: widget.amount)); + } + return; + } + if (_payType.contains(1)) { + var cancel = BotToast.showLoading(); + await _alipayFuc(); + cancel(); + Get.back(); + return; + } + }, + text: '确认支付${widget.amount}元'), + ], + ), + ], + ), + ), + ); + } + + Future _alipayFuc() async { + if (widget.isBalance) { + var base = await NetUtil().post(SAASAPI.pay.createBalanceOrder, params: { + 'balance': widget.amount, + }); + if (base.success) { + var re = await PayUtil() + .callAliPay(base.data, SAASAPI.pay.balanceOrderCheckAlipay); + } else { + BotToast.showText(text: base.msg); + } + } else { + var base = await NetUtil().post(SAASAPI.pay.createPointsOrder, params: { + 'payAmount': widget.amount, + }); + if (base.success) { + var re = await PayUtil() + .callAliPay(base.data, SAASAPI.pay.pointsOrderCheckAlipay); + } else { + BotToast.showText(text: base.msg); + } + } + } +} diff --git a/lib/pages/personal/wallet/point_record_view.dart b/lib/pages/personal/wallet/point_record_view.dart new file mode 100644 index 00000000..a5a38329 --- /dev/null +++ b/lib/pages/personal/wallet/point_record_view.dart @@ -0,0 +1,210 @@ +import 'package:aku_new_community/constants/saas_api.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/models/wallet/trade_record_list_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class PointRecordView extends StatefulWidget { + const PointRecordView({Key? key}) : super(key: key); + + @override + _PointRecordViewState createState() => _PointRecordViewState(); +} + +class _PointRecordViewState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + + List _models = []; + int _pageNum = 1; + int _size = 10; + DateTime _pickTime = DateTime.now(); + int _pickType = 0; + + Map _types = { + 1: '支付', + 2: '退还', + 3: '充值', + 4: '收入', + 5: '提现', + 6: '抵扣', + }; + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + child: Row( + children: [ + GestureDetector( + onTap: () async { + var date = await BeeDatePicker.monthPicker( + DateTime.now().subtract(Duration(days: 365))); + if (date != null) { + _pickTime = date; + } + setState(() {}); + }, + child: Row( + children: [ + '${_pickTime.year}年${_pickTime.month}月' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Icon( + CupertinoIcons.chevron_down, + size: 32.w, + color: Colors.black.withOpacity(0.45), + ) + ], + ), + ), + Spacer(), + MaterialButton( + color: Colors.black.withOpacity(0.06), + onPressed: () async { + await showModalBottomSheet( + context: context, + builder: (context) { + return BeePickerBox( + onPressed: () { + Get.back(); + setState(() {}); + }, + child: CupertinoPicker.builder( + itemExtent: 60.w, + childCount: _types.values.length, + onSelectedItemChanged: (index) { + _pickType = _types.keys.toList()[index]; + }, + itemBuilder: (context, index) { + var str = _types.values.toList()[index]; + return Center( + child: str.text.size(32.sp).isIntrinsic.make(), + ); + }, + ), + ); + }, + ); + }, + shape: StadiumBorder(), + elevation: 0, + child: Row( + children: [ + '${_pickType == 0 ? '全部类型' : _types[_pickType]}' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + Icon( + CupertinoIcons.chevron_down, + size: 24.w, + color: Colors.black.withOpacity(0.25), + ) + ], + ), + ), + ], + ), + ), + Flexible( + child: Container( + color: Colors.white, + child: EasyRefresh( + header: MaterialHeader(), + footer: MaterialFooter(), + firstRefresh: true, + controller: _refreshController, + onRefresh: () async { + _pageNum = 1; + var baseList = await NetUtil() + .getList(SAASAPI.balance.tradeRecordList, params: { + 'pageNum': _pageNum, + 'size': _size, + 'modelType': 1, + 'type': _pickType, + 'createDate': _pickTime, + }); + + _models = baseList.rows + .map((e) => TradeRecordListModel.fromJson(e)) + .toList(); + }, + onLoad: () async { + _pageNum++; + var baseList = await NetUtil() + .getList(SAASAPI.balance.tradeRecordList, params: { + 'pageNum': _pageNum, + 'size': _size, + 'modelType': 0, + 'type': _pickType, + 'createDate': _pickTime, + }); + if (baseList.total > _models.length) { + _models.addAll(baseList.rows + .map((e) => TradeRecordListModel.fromJson(e)) + .toList()); + } else { + _refreshController.finishLoad(noMore: true); + } + }, + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + children: _models.map((e) => _buildCard(e)).toList(), + ), + ), + ), + ), + ], + ); + } + + bool incom(type) => [2, 3, 4].contains(type); + + Widget _buildCard(TradeRecordListModel model) { + return Column( + children: [ + Row( + children: [ + '${_types[model.type]}-${model.content}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Spacer(), + '${incom(model.type) ? '+' : '-'}¥${model.payAmount}' + .text + .size(28.sp) + .color(incom(model.type) + ? Colors.red + : Colors.black.withOpacity(0.85)) + .make(), + ], + ), + 8.hb, + '${DateUtil.formatDateStr(model.createDate, format: 'MM/dd HH:mm')}' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ); + } +} diff --git a/lib/pages/personal/wallet/set_pay_password_dialog.dart b/lib/pages/personal/wallet/set_pay_password_dialog.dart new file mode 100644 index 00000000..dcc458b3 --- /dev/null +++ b/lib/pages/personal/wallet/set_pay_password_dialog.dart @@ -0,0 +1,76 @@ +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/pages/personal/wallet/set_pay_password_verify_dialog.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:sms_autofill/sms_autofill.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class SetPayPasswordDialog extends StatefulWidget { + const SetPayPasswordDialog({Key? key, }) : super(key: key); + + @override + _SetPayPasswordDialogState createState() => _SetPayPasswordDialogState(); +} + +class _SetPayPasswordDialogState extends State { + String? _currentCode; + + @override + Widget build(BuildContext context) { + return Center( + child: Padding( + padding:EdgeInsets.only(bottom: 300.w), + child: Material( + borderRadius: BorderRadius.circular(24.w), + child: Container( + width: 630.w, + height: 480.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(24.w)), + child: Column( + children: [ + 96.hb, + '请先设置支付密码' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .bold + .make(), + 40.hb, + '支付密码仅用于对钱包余额支付时确认' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + PinFieldAutoFill( + autoFocus: true, + currentCode: _currentCode, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + codeLength: 6, + onCodeChanged: (code) async { + if ((code?.length ?? 0) >= 6) { + Get.back(); + Get.dialog(SetPayVerifyPasswordDialog(firstCode:code!,)); + } + _currentCode = code; + }, + decoration: UnderlineDecoration( + colorBuilder: FixedColorListBuilder([ + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + ])), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/personal/wallet/set_pay_password_verify_dialog.dart b/lib/pages/personal/wallet/set_pay_password_verify_dialog.dart new file mode 100644 index 00000000..262b9bb4 --- /dev/null +++ b/lib/pages/personal/wallet/set_pay_password_verify_dialog.dart @@ -0,0 +1,118 @@ +import 'package:aku_new_community/constants/saas_api.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/pages/personal/wallet/input_pay_password_dialog.dart'; +import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:sms_autofill/sms_autofill.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class SetPayVerifyPasswordDialog extends StatefulWidget { + final String firstCode; + + const SetPayVerifyPasswordDialog({Key? key, required this.firstCode}) + : super(key: key); + + @override + _SetPayVerifyPasswordDialogState createState() => + _SetPayVerifyPasswordDialogState(); +} + +class _SetPayVerifyPasswordDialogState + extends State { + String _currentCode = ''; + + bool get checkVerify => widget.firstCode == _currentCode; + + @override + Widget build(BuildContext context) { + return Center( + child: Padding( + padding: EdgeInsets.only(bottom: 300.w), + child: Material( + borderRadius: BorderRadius.circular(24.w), + child: Container( + width: 630.w, + height: 480.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + decoration: + BoxDecoration(borderRadius: BorderRadius.circular(24.w)), + child: Column( + children: [ + 96.hb, + '请再次输入支付密码' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .bold + .make(), + 40.hb, + '支付密码仅用于对钱包余额支付时确认' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + PinFieldAutoFill( + autoFocus: true, + currentCode: _currentCode, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + codeLength: 6, + onCodeChanged: (code) async { + _currentCode = code ?? ''; + if ((code?.length ?? 0) >= 6) { + print(checkVerify); + if (!checkVerify) { + return; + } + var base = await NetUtil() + .post(SAASAPI.balance.setBalancePayPsd, params: { + 'pwd': widget.firstCode, + 'rePwd': _currentCode, + }); + if (base.success) { + Get.back(); + UserTool.userProvider.updateUserInfo(); + } else { + BotToast.showText(text: base.msg); + Get.back(); + } + } + setState(() {}); + }, + decoration: UnderlineDecoration( + colorBuilder: FixedColorListBuilder([ + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + Colors.black.withOpacity(0.3), + ])), + ), + 24.hb, + Offstage( + offstage: (_currentCode.isEmptyOrNull) || (checkVerify), + child: Row( + children: [ + '密码输入不一致' + .text + .size(24.sp) + .isIntrinsic + .color(Colors.red) + .make(), + ], + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/personal/wallet/wallet_recharge_page.dart b/lib/pages/personal/wallet/wallet_recharge_page.dart new file mode 100644 index 00000000..a0ceadec --- /dev/null +++ b/lib/pages/personal/wallet/wallet_recharge_page.dart @@ -0,0 +1,496 @@ +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/pages/personal/wallet/pay_way_dialog.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:bot_toast/bot_toast.dart'; +import 'package:collection/src/iterable_extensions.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/src/size_extension.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/src/extensions/num_ext.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class WalletRechargePage extends StatefulWidget { + final initIndex; + + const WalletRechargePage({Key? key, this.initIndex = 0}) : super(key: key); + + @override + _WalletRechargePageState createState() => _WalletRechargePageState(); +} + +class _WalletRechargePageState extends State + with SingleTickerProviderStateMixin { + int _currentIndex = 0; + int _currentSelect = 0; + late TabController _tabController; + List _tabs = ['余额充值', '积分充值']; + + List _balanceValue = [10, 20, 30, 50, 00, 200, 300, 500]; + List _pointValue = [10, 200, 300, 500, 1000, 2000, 5000, 10000]; + + int _rechargeValue = 0; + + @override + void initState() { + _tabController = + TabController(length: 2, vsync: this, initialIndex: widget.initIndex); + _currentIndex = widget.initIndex; + _rechargeValue = widget.initIndex == 0 ? _balanceValue[0] : _pointValue[0]; + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '钱包充值', + actions: [ + TextButton( + onPressed: () {}, + child: '账单' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ), + ], + body: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + child: Row( + children: [ + '余额:${UserTool.userProvider.userInfoModel!.balance ?? 0}' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 64.wb, + '积分:' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + '${UserTool.userProvider.userInfoModel!.points ?? 0}' + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + decoration: BoxDecoration(color: Colors.white), + child: Column( + children: [ + Row( + children: _tabs + .mapIndexed((index, element) => GestureDetector( + onTap: () { + _currentIndex = index; + _tabController.animateTo(_currentIndex); + setState(() {}); + }, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + element.text + .size(28.sp) + .fontWeight(_currentIndex == index + ? FontWeight.bold + : FontWeight.normal) + .color(Colors.black.withOpacity( + _currentIndex == index ? 0.85 : 0.65)) + .make(), + 8.hb, + AnimatedOpacity( + duration: Duration(microseconds: 500), + opacity: _currentIndex == index ? 1 : 0, + child: Container( + width: 40.w, + height: 8.w, + decoration: BoxDecoration( + color: Colors.black, + borderRadius: + BorderRadius.circular(4.w), + ), + ), + ) + ], + ), + )) + .toList() + .sepWidget(separate: 48.wb), + ), + 48.hb, + Expanded( + child: TabBarView(controller: _tabController, children: [ + _balanceView(), + _pointView(), + ]), + ), + ], + ), + ), + ), + ], + ), + bottomNavi: Padding( + padding: EdgeInsets.only( + left: 32.w, + right: 32.w, + bottom: 32.w + MediaQuery.of(context).padding.bottom), + child: BeeLongButton( + onPressed: () async { + if (_currentSelect == 9) { + _rechargeValue = 0; + Get.bottomSheet(_customValueDialog(_currentIndex == 0)); + } else { + Get.bottomSheet(PayWayDialog( + isBalance: _currentIndex == 0, + amount: _rechargeValue, + insufficientBalance: _rechargeValue > + (UserTool.userProvider.userInfoModel!.balance ?? 0))); + } + }, + text: '下一步'), + ), + ); + } + + Widget _balanceView() { + return GridView.count( + crossAxisCount: 3, + mainAxisSpacing: 20.w, + crossAxisSpacing: 20.w, + children: [ + ..._balanceValue + .mapIndexed((index, e) => _card(index, e, true)) + .toList(), + _customValueCard(9, true) + ], + ); + } + + Widget _pointView() { + return GridView.count( + mainAxisSpacing: 20.w, + crossAxisSpacing: 20.w, + crossAxisCount: 3, + children: [ + ..._pointValue + .mapIndexed((index, element) => _card(index, element, false)) + .toList(), + _customValueCard(9, false) + ], + ); + } + + Widget _card(int index, int value, bool isBalance) { + return GestureDetector( + onTap: () { + _currentSelect = index; + _rechargeValue = isBalance ? _balanceValue[index] : (_pointValue[index]~/10); + setState(() {}); + }, + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(16.w), + child: Stack( + clipBehavior: Clip.antiAliasWithSaveLayer, + fit: StackFit.passthrough, + children: [ + Container( + width: 214.w, + height: 202.w, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.w), + color: + _currentSelect != index ? Color(0xFFF9F9F9) : Colors.black, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Offstage( + offstage: isBalance, + child: Assets.icons.intergral + .image(width: 48.w, height: 48.w)), + 8.hb, + '$value ' + .richText + .withTextSpanChildren([ + '${isBalance ? '元' : '积分'} ' + .textSpan + .size(26.sp) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .make(), + ]) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .size(40.w) + .make(), + 16.hb, + Offstage( + offstage: isBalance, + child: '${value ~/ 10}元' + .text + .size(26.sp) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .make(), + ), + ], + ), + ), + AnimatedPositioned( + bottom: 0, + right: 0, + child: Offstage( + offstage: _currentSelect != index, + child: ClipPath( + clipper: _TriangleClipPath(), + child: Container( + width: 40.w, + height: 48.w, + color: Color(0xFFFBE541), + child: Transform.translate( + offset: Offset(10.w, 12.w), + child: Icon( + CupertinoIcons.checkmark_alt, + size: 24.w, + ), + ), + ), + ), + ), + duration: Duration(microseconds: 500)) + ], + ), + ), + ); + } + + Widget _customValueCard(int index, bool isBalance) { + return GestureDetector( + onTap: () { + _currentSelect = index; + setState(() {}); + }, + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(16.w), + child: Stack( + clipBehavior: Clip.antiAliasWithSaveLayer, + fit: StackFit.passthrough, + children: [ + Container( + width: 214.w, + height: 202.w, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.w), + color: + _currentSelect != index ? Color(0xFFF9F9F9) : Colors.black, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Offstage( + offstage: isBalance, + child: Assets.icons.intergral + .image(width: 48.w, height: 48.w)), + 8.hb, + '' + .richText + .withTextSpanChildren([ + '${isBalance ? '其他金额' : '其他积分'} ' + .textSpan + .size(26.sp) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .make(), + ]) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .size(40.w) + .make(), + 16.hb, + Offstage( + offstage: isBalance, + child: '自定义' + .text + .size(26.sp) + .color(_currentSelect == index + ? Color(0xFFFBE541) + : Colors.black.withOpacity(0.85)) + .make(), + ), + ], + ), + ), + AnimatedPositioned( + bottom: 0, + right: 0, + child: Offstage( + offstage: _currentSelect != index, + child: ClipPath( + clipper: _TriangleClipPath(), + child: Container( + width: 40.w, + height: 48.w, + color: Color(0xFFFBE541), + child: Transform.translate( + offset: Offset(10.w, 12.w), + child: Icon( + CupertinoIcons.checkmark_alt, + size: 24.w, + ), + ), + ), + ), + ), + duration: Duration(microseconds: 500)) + ], + ), + ), + ); + } + + Widget _customValueDialog(bool isBalance) { + return StatefulBuilder( + builder: (context, reSet) { + return Material( + color: Colors.transparent, + child: Container( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + width: double.infinity, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + '${isBalance ? '充值金额' : '充值积分'}' + .text + .size(32.sp) + .bold + .isIntrinsic + .color(Colors.black.withOpacity(0.85)) + .make(), + 48.hb, + Container( + height: 88.w, + decoration: BoxDecoration( + color: Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(16.w)), + clipBehavior: Clip.antiAliasWithSaveLayer, + child: Row( + children: [ + 24.wb, + '¥' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + 12.wb, + Expanded( + child: TextField( + autofocus: true, + onChanged: (text) { + if (text.trim().isNotEmpty) { + _rechargeValue = int.parse(text); + reSet(() {}); + } + }, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration(border: InputBorder.none), + )), + Offstage( + offstage: isBalance, + child: Row( + children: [ + Assets.icons.intergral + .image(width: 32.w, height: 32.w), + 16.wb, + (_rechargeValue * 10) + .text + .size(32.sp) + .color(Colors.black.withOpacity(0.855)) + .make(), + 12.wb, + ], + ), + ), + GestureDetector( + onTap: () { + if (_rechargeValue == 0) { + BotToast.showText(text: '金额不能为0'); + return; + } + Get.back(); + Get.bottomSheet(PayWayDialog( + insufficientBalance: (UserTool.userProvider + .userInfoModel!.balance ?? + 0) < + _rechargeValue, + isBalance: isBalance, + amount: _rechargeValue)); + }, + child: Material( + child: Container( + width: 132.w, + color: Color(0xFFFBE541), + child: Center( + child: '去支付' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + ), + ), + ), + ), + ], + ), + ) + ], + ), + ), + ); + }, + ); + } +} + +class _TriangleClipPath extends CustomClipper { + @override + Path getClip(Size size) { + Path path = Path(); + path.moveTo(0, size.height); + path.lineTo(size.width, size.height); + path.lineTo(size.width, 0 + 5.w); + path.lineTo(0, size.height); + path.close(); + return path; + } + + @override + bool shouldReclip(covariant CustomClipper oldClipper) { + return false; + } +} diff --git a/lib/pages/personal/wallet/wallet_trade_record_page.dart b/lib/pages/personal/wallet/wallet_trade_record_page.dart new file mode 100644 index 00000000..7018c1c0 --- /dev/null +++ b/lib/pages/personal/wallet/wallet_trade_record_page.dart @@ -0,0 +1,44 @@ +import 'package:aku_new_community/pages/personal/wallet/point_record_view.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'balance_record_view.dart'; + +class WalletTradeRecordPage extends StatefulWidget { + const WalletTradeRecordPage({Key? key}) : super(key: key); + + @override + _WalletTradeRecordPageState createState() => _WalletTradeRecordPageState(); +} + +class _WalletTradeRecordPageState extends State + with SingleTickerProviderStateMixin { + List _tabs = ['余额账单', '积分账单']; + late TabController _tabController; + + @override + void initState() { + _tabController = TabController(length: _tabs.length, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: BeeTabBar( + controller: _tabController, + tabs: _tabs, + scrollable: true, + ), + body: TabBarView( + controller: _tabController, + children: [ + BalanceRecordView(), + PointRecordView(), + ], + ), + ); + } +} diff --git a/lib/pages/sign/login/code_message_page.dart b/lib/pages/sign/login/code_message_page.dart index 80539cae..6e321201 100644 --- a/lib/pages/sign/login/code_message_page.dart +++ b/lib/pages/sign/login/code_message_page.dart @@ -1,10 +1,12 @@ import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/provider/clock_timer_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:provider/provider.dart'; import 'package:sms_autofill/sms_autofill.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -38,6 +40,7 @@ class _CodeMessagePageState extends State { @override Widget build(BuildContext context) { + ClockTimerProvider clockTimer = Provider.of(context); return BeeScaffold( title: '', body: SafeArea( @@ -115,14 +118,14 @@ class _CodeMessagePageState extends State { .communityModel!.id); if (base.success) { _errorMessage = null; - UserTool.appProvider.startTimer(); + clockTimer.startTimer(); } else { BotToast.showText(text: base.msg); } }, - child: (UserTool.appProvider.second >= 60 + child: (clockTimer.second >= 60 ? '重新发送验证码' - : '${UserTool.appProvider.second}秒后可重新发送') + : '${clockTimer.second}秒后可重新发送') .text .size(28.sp) .color(Color(0xFF5096F1)) diff --git a/lib/pages/sign/login/forgot_psd_page.dart b/lib/pages/sign/login/forgot_psd_page.dart index 020726d8..22042ee5 100644 --- a/lib/pages/sign/login/forgot_psd_page.dart +++ b/lib/pages/sign/login/forgot_psd_page.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/pages/sign/login/forgot_set_psd_page.dart'; import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; +import 'package:aku_new_community/provider/clock_timer_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -8,6 +9,7 @@ import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; import '../sign_func.dart'; @@ -30,6 +32,7 @@ class _ForgotPsdPageState extends State { @override Widget build(BuildContext context) { + ClockTimerProvider clockTimer = Provider.of(context); return BeeScaffold( title: '', bodyColor: Colors.white, @@ -83,7 +86,7 @@ class _ForgotPsdPageState extends State { Get.to(() => ForgotSetPsdPage( tel: _telController.text, )); - UserTool.appProvider.startTimer(); + clockTimer.startTimer(); } else { BotToast.showText(text: base.msg); } diff --git a/lib/pages/sign/login/forgot_set_psd_page.dart b/lib/pages/sign/login/forgot_set_psd_page.dart index bc31c9cf..94677ed5 100644 --- a/lib/pages/sign/login/forgot_set_psd_page.dart +++ b/lib/pages/sign/login/forgot_set_psd_page.dart @@ -3,6 +3,7 @@ import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; +import 'package:aku_new_community/provider/clock_timer_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; class ForgotSetPsdPage extends StatefulWidget { @@ -52,6 +54,7 @@ class _ForgotSetPsdPageState extends State { @override Widget build(BuildContext context) { + ClockTimerProvider clockTimer = Provider.of(context); return BeeScaffold( title: '', bodyColor: Colors.white, @@ -129,7 +132,7 @@ class _ForgotSetPsdPageState extends State { Get.to(() => ForgotSetPsdPage( tel: widget.tel, )); - UserTool.appProvider.startTimer(); + clockTimer.startTimer(); } else { BotToast.showText(text: base.msg); } @@ -137,7 +140,7 @@ class _ForgotSetPsdPageState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - '|${UserTool.appProvider.second < 60 ? '${UserTool.appProvider.second}秒后重新获取' : '获取验证码'}' + '|${clockTimer.second < 60 ? '${clockTimer.second}秒后重新获取' : '获取验证码'}' .text .size(28.sp) .color(Color(0xFF5096F1)) diff --git a/lib/pages/sign/login/other_login_page.dart b/lib/pages/sign/login/other_login_page.dart index 0071da3a..2739d0b8 100644 --- a/lib/pages/sign/login/other_login_page.dart +++ b/lib/pages/sign/login/other_login_page.dart @@ -6,6 +6,7 @@ import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/provider/clock_timer_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -153,7 +154,7 @@ class _OtherLoginPageState extends State { } Widget _verificationView() { - AppProvider appProvider = Provider.of(context); + ClockTimerProvider clockTimer = Provider.of(context); return ListView( padding: EdgeInsets.symmetric(horizontal: 32.w), children: [ @@ -170,7 +171,7 @@ class _OtherLoginPageState extends State { ), 100.w.heightBox, LoginButtonWidget( - onTap: UserTool.appProvider.second < 60 + onTap: clockTimer.second < 60 ? () {} : () async { var check = checkInput(); @@ -183,13 +184,13 @@ class _OtherLoginPageState extends State { .communityModel!.id); if (base.success) { Get.to(() => CodeMessagePage(tel: _tel.text)); - appProvider.startTimer(); + clockTimer.startTimer(); } else { BotToast.showText(text: base.msg); } }, - text: appProvider.timerStart - ? '${appProvider.second}秒后重新获取' + text: clockTimer.timerStart + ? '${clockTimer.second}秒后重新获取' : '获取验证码'), 24.w.heightBox, Row( diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index 6be5cc64..68f34fec 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -355,30 +355,7 @@ class AppProvider extends ChangeNotifier { notifyListeners(); } - ///登录页验证码计时器 - int second = 60; - bool timerStart = false; - Timer? timer; - - void startTimer() { - timerStart = true; - timer = Timer.periodic(Duration(seconds: 1), (timer) { - if (second > 0) { - second--; - notifyListeners(); - } else { - stopTimer(); - } - }); - } - void stopTimer() { - second = 60; - timerStart = false; - timer?.cancel(); - timer = null; - notifyListeners(); - } notifyListeners(); } diff --git a/lib/provider/clock_timer_provider.dart b/lib/provider/clock_timer_provider.dart new file mode 100644 index 00000000..aa33dd8b --- /dev/null +++ b/lib/provider/clock_timer_provider.dart @@ -0,0 +1,30 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; + +class ClockTimerProvider extends ChangeNotifier{ + ///登录页验证码计时器 + int second = 60; + bool timerStart = false; + Timer? timer; + + void startTimer() { + timerStart = true; + timer = Timer.periodic(Duration(seconds: 1), (timer) { + if (second > 0) { + second--; + notifyListeners(); + } else { + stopTimer(); + } + }); + } + + void stopTimer() { + second = 60; + timerStart = false; + timer?.cancel(); + timer = null; + notifyListeners(); + } +} \ No newline at end of file diff --git a/lib/widget/buttons/bee_check_radio.dart b/lib/widget/buttons/bee_check_radio.dart index 410399ba..c5f4b285 100644 --- a/lib/widget/buttons/bee_check_radio.dart +++ b/lib/widget/buttons/bee_check_radio.dart @@ -9,9 +9,15 @@ class BeeCheckRadio extends StatefulWidget { final List? groupValue; final Widget? indent; final Color? backColor; + final double? size; BeeCheckRadio( - {Key? key, this.value, this.groupValue, this.indent, this.backColor}) + {Key? key, + this.value, + this.groupValue, + this.indent, + this.backColor, + this.size}) : super(key: key); @override @@ -30,8 +36,8 @@ class _BeeCheckRadioState extends State { @override Widget build(BuildContext context) { return AnimatedContainer( - height: 40.w, - width: 40.w, + height: widget.size ?? 40.w, + width: widget.size ?? 40.w, decoration: BoxDecoration( color: widget.backColor ?? kPrimaryColor.withOpacity(_selected ? 1 : 0), border: Border.all( @@ -40,7 +46,7 @@ class _BeeCheckRadioState extends State { : (_selected ? kPrimaryColor : Color(0xFF979797)), width: 3.w, ), - borderRadius: BorderRadius.circular(20.w), + borderRadius: BorderRadius.circular((widget.size??40.w)/2), ), duration: Duration(milliseconds: 300), curve: Curves.easeInOutCubic, diff --git a/lib/widget/buttons/bee_long_button.dart b/lib/widget/buttons/bee_long_button.dart index 094c761a..e7cb7c98 100644 --- a/lib/widget/buttons/bee_long_button.dart +++ b/lib/widget/buttons/bee_long_button.dart @@ -8,13 +8,14 @@ class BeeLongButton extends StatelessWidget { final String text; final Color backColor; final BorderSide border; + final double? width; - const BeeLongButton({Key? key, required this.onPressed, required this.text}) + const BeeLongButton({Key? key, required this.onPressed, required this.text, this.width}) : backColor = kPrimaryColor, border = BorderSide.none, super(key: key); - BeeLongButton.white({Key? key, required this.onPressed, required this.text}) + BeeLongButton.white({Key? key, required this.onPressed, required this.text, this.width}) : backColor = Colors.white, border = BorderSide(color: Colors.black.withOpacity(0.45)), super(key: key); @@ -24,6 +25,7 @@ class BeeLongButton extends StatelessWidget { return MaterialButton( elevation: 0, height: 93.w, + minWidth: width, disabledColor: Colors.black.withOpacity(0.06), disabledTextColor: Colors.black.withOpacity(0.25), textColor: Colors.black.withOpacity(0.85), diff --git a/lib/widget/picker/bee_date_picker.dart b/lib/widget/picker/bee_date_picker.dart index 15b0be1b..93ab0871 100644 --- a/lib/widget/picker/bee_date_picker.dart +++ b/lib/widget/picker/bee_date_picker.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/widget/picker/bee_month_pick_body.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -7,8 +8,7 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; class BeeDatePicker { - static Future pick( - DateTime initDate, { + static Future pick(DateTime initDate, { CupertinoDatePickerMode mode = CupertinoDatePickerMode.date, DateTime? min, DateTime? max, @@ -29,6 +29,12 @@ class BeeDatePicker { mode: CupertinoDatePickerMode.dateAndTime, )); } + + static Future monthPicker(DateTime initDate) async { + return await Get.bottomSheet( + BeeMonthPickBody(initTime: initDate) + ); + } } class _BeeDatePicker extends StatefulWidget { diff --git a/lib/widget/picker/bee_month_pick_body.dart b/lib/widget/picker/bee_month_pick_body.dart new file mode 100644 index 00000000..9dd5e5a9 --- /dev/null +++ b/lib/widget/picker/bee_month_pick_body.dart @@ -0,0 +1,111 @@ +import 'package:aku_new_community/saas_model/login/china_region_model.dart'; +import 'package:aku_new_community/saas_model/login/picked_city_model.dart'; +import 'package:aku_new_community/utils/hive_store.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import 'bee_picker_box.dart'; + +class BeeMonthPickBody extends StatefulWidget { + final DateTime initTime; + + BeeMonthPickBody({Key? key, required this.initTime}) : super(key: key); + + @override + _BeeMonthPickBodyState createState() => _BeeMonthPickBodyState(); +} + +class _BeeMonthPickBodyState extends State { + final FixedExtentScrollController _yearController = + FixedExtentScrollController(); + final FixedExtentScrollController _monthController = + FixedExtentScrollController(); + DateTime get _pickedTime => DateTime(_pickYear,_pickMonth) ; + + List get _years => List.generate( + DateTime.now().year - widget.initTime.year+1, + (index) => widget.initTime.year + index); + late int _pickYear; + late int _pickMonth; + + List get _months => List.generate( + _pickYear == DateTime.now().year ? DateTime.now().month : 12, + (index) => index + 1); + + @override + void initState() { + _pickYear = widget.initTime.year; + _pickMonth = 1; + super.initState(); + } + + @override + void dispose() { + _yearController.dispose(); + _monthController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeePickerBox( + onPressed: () { + Navigator.pop(context, _pickedTime); + }, + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + itemExtent: 80.w, + magnification: 1.0, + looping: false, + scrollController: _yearController, + onSelectedItemChanged: (index) { + _pickYear = _years[index]; + _pickMonth = 1; + setState(() {}); + }, + children: _years + .map((e) => Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.w), + child: + Text(e.toString()+'年', textAlign: TextAlign.center), + ), + )) + .toList()), + ), + Expanded( + child: CupertinoPicker( + itemExtent: 80.w, + magnification: 1.0, + // offAxisFraction: 0.6, + looping: true, + scrollController: _monthController, + onSelectedItemChanged: (index) { + _pickMonth = _months[index]; + setState(() {}); + }, + children: _months.isEmpty + ? [Container()] + : _months + .map((e) => Center( + child: Padding( + padding: EdgeInsets.only( + left: 20.w, + right: 20.w, + top: 10.w, + bottom: 10.w), + child: Text(e.toString()+'月', + textAlign: TextAlign.center), + ), + )) + .toList(), + ), + ), + ], + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 1a6974c6..d4e08ca8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,252 +5,252 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "38.0.0" advance_pdf_viewer: dependency: "direct main" description: name: advance_pdf_viewer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" amap_flutter_base: dependency: "direct main" description: name: amap_flutter_base - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.4.1" animated_text_kit: dependency: "direct main" description: name: animated_text_kit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.1" archive: dependency: transitive description: name: archive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.3.0" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.8.2" audio_session: dependency: transitive description: name: audio_session - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6+1" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.1" build: dependency: transitive description: name: build - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" build_config: dependency: transitive description: name: build_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.8" + version: "2.1.10" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "8.1.4" + version: "8.2.0" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" card_swiper: dependency: "direct main" description: name: card_swiper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.15.0" color: dependency: transitive description: name: color - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" common_utils: @@ -266,154 +266,154 @@ packages: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" dartx: dependency: transitive description: name: dartx - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" decimal: dependency: transitive description: name: decimal - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" device_info_plus: dependency: transitive description: name: device_info_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.3" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.0+1" device_info_plus_web: dependency: transitive description: name: device_info_plus_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.6" dotted_border: dependency: "direct main" description: name: dotted_border - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0+2" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.1" extended_list_library: dependency: transitive description: name: extended_list_library - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" flutter: @@ -425,42 +425,42 @@ packages: dependency: transitive description: name: flutter_blurhash - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.6.4" + version: "0.6.6" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.3.0" flutter_easyrefresh: dependency: "direct main" description: name: flutter_easyrefresh - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.1" flutter_gen_core: dependency: transitive description: name: flutter_gen_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.6" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.6" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" flutter_icons: @@ -481,51 +481,51 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.0" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.0" flutter_sound: dependency: "direct main" description: name: flutter_sound - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "9.1.9" + version: "9.2.2" flutter_sound_platform_interface: dependency: transitive description: name: flutter_sound_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "9.1.9" + version: "9.2.2" flutter_sound_web: dependency: transitive description: name: flutter_sound_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "9.1.9" + version: "9.2.2" flutter_test: dependency: "direct dev" description: flutter @@ -540,504 +540,504 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.8.2+1" + version: "3.8.4" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.2" get: dependency: "direct main" description: name: get - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.6.1" glob: dependency: transitive description: name: glob - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" grinder: dependency: "direct dev" description: name: grinder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.1" highlight: dependency: transitive description: name: highlight - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.0" hive: dependency: "direct main" description: name: hive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" hive_flutter: dependency: "direct main" description: name: hive_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" hive_generator: dependency: "direct dev" description: name: hive_generator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" http: dependency: transitive description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" image: dependency: transitive description: name: image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.3" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.5+4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.4.4" import_sorter: dependency: "direct dev" description: name: import_sorter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.6.0" infinite_listview: dependency: transitive description: name: infinite_listview - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" jpush_flutter: dependency: "direct main" description: name: jpush_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.4" + version: "2.2.5" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "6.1.5" + version: "6.1.6" just_audio: dependency: "direct main" description: name: just_audio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.20" just_audio_platform_interface: dependency: transitive description: name: just_audio_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" just_audio_web: dependency: transitive description: name: just_audio_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.7" like_button: dependency: "direct main" description: name: like_button - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" logger: dependency: transitive description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" logging: dependency: transitive description: name: logging - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.11" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" nested: dependency: transitive description: name: nested - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" numberpicker: dependency: transitive description: name: numberpicker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" octo_image: dependency: transitive description: name: octo_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" open_file: dependency: "direct main" description: name: open_file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info_plus: dependency: transitive description: name: package_info_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.4.2" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.5" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.5" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.5" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.9" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.12" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.8" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.2.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.7.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.4.0" pin_input_text_field: dependency: transitive description: name: pin_input_text_field - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.2" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.2" pool: dependency: transitive description: name: pool - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.0" power_logger: dependency: "direct main" description: name: power_logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.2" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.2" pub_semver: dependency: "direct dev" description: name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" qr: dependency: transitive description: name: qr - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" qr_code_scanner: dependency: "direct main" description: name: qr_code_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" random_character: @@ -1053,63 +1053,63 @@ packages: dependency: transitive description: name: rational - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" recase: dependency: transitive description: name: recase - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.27.3" scroll_to_index: dependency: "direct main" description: name: scroll_to_index - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" share: dependency: "direct main" description: name: share - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" shelf: dependency: transitive description: name: shelf - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" shimmer: dependency: "direct main" description: name: shimmer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" signature: dependency: "direct main" description: name: signature - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.1" sky_engine: @@ -1121,259 +1121,259 @@ packages: dependency: "direct main" description: name: sms_autofill - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.2" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0+2" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.3" time: dependency: transitive description: name: time - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" timing: dependency: transitive description: name: timing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" tint: dependency: transitive description: name: tint - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.4.0+2" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.20" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.15" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.6" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.4.0" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" waterfall_flow: dependency: "direct main" description: name: waterfall_flow - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.2" web_socket_channel: dependency: "direct main" description: name: web_socket_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.5.1" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.3.1" yaml: dependency: "direct dev" description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: diff --git a/tool/config.dart b/tool/config.dart index 80e38aff..36daa606 100644 --- a/tool/config.dart +++ b/tool/config.dart @@ -1,19 +1,19 @@ class Config { ///用户根目录 - static const String homeDir = 'G:\\apk'; + static const String homeDir = '/users/zhangmeng'; ///包名 static const String packageName = 'aku_new_community'; ///打包目录 static String get buildPath => - '\\build\\app\\outputs\\flutter-apk\\app-release.apk'; + './build/app/outputs/flutter-apk/app-release.apk'; ///测试包文件夹 static String get apkDevDir => - '$homeDir\\aku_new_community\\dev'; + '$homeDir/team/bee/aku_new_community_manager/dev'; ///正式包文件夹 static String get apkDir => - '$homeDir\\aku_new_community\\release'; + '$homeDir/team/bee/aku_new_community_manager/release'; }