diff --git a/assets/images/my_wallet_bg.png b/assets/images/my_wallet_bg.png new file mode 100644 index 0000000..9e585d9 Binary files /dev/null and b/assets/images/my_wallet_bg.png differ diff --git a/assets/images/question_icon.png b/assets/images/question_icon.png new file mode 100644 index 0000000..22b0209 Binary files /dev/null and b/assets/images/question_icon.png differ diff --git a/lib/controller/mine/my_wallet_controller.dart b/lib/controller/mine/my_wallet_controller.dart index 90c156e..962fa25 100644 --- a/lib/controller/mine/my_wallet_controller.dart +++ b/lib/controller/mine/my_wallet_controller.dart @@ -18,6 +18,8 @@ class MyWalletController extends GetxController { final size = 10.obs; + final visibility = false.obs; + late UserApi _userApi; late final EasyRefreshController listRefreshController; @@ -78,12 +80,8 @@ class MyWalletController extends GetxController { final response = await _userApi.getWalletAccountRecord( pageNum: page.value, pageSize: size.value, - recordTimeFrom: timeActive.value == 1 ? - formatStartTimestamp(DateTime.now().millisecondsSinceEpoch - 86400000 * 30) : - timeActive.value == 2 ? formatStartTimestamp(DateTime.now().millisecondsSinceEpoch - 86400000 * 90) : - timeActive.value == 3 ? formatStartTimestamp(DateTime.now().millisecondsSinceEpoch - 86400000 * 180) : - "", - recordTimeTo: formatEndTimestamp(DateTime.now().millisecondsSinceEpoch), + recordTimeFrom: "", + recordTimeTo: "", ); if (response.data.isSuccess && response.data.data != null) { walletHistoryList.addAll(response.data.data?.records ?? []); diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index a476b12..0e6b11c 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -140,6 +140,7 @@ class Assets { static const String imagesMinePre = 'assets/images/mine_pre.png'; static const String imagesMore = 'assets/images/more.png'; static const String imagesMoreIcon = 'assets/images/more_icon.png'; + static const String imagesMyWalletBg = 'assets/images/my_wallet_bg.png'; static const String imagesOnlineIcon = 'assets/images/online_icon.png'; static const String imagesPhoneChecked = 'assets/images/phone_checked.png'; static const String imagesPhoneHelp = 'assets/images/phone_help.png'; @@ -150,6 +151,7 @@ class Assets { static const String imagesPlatVoiceMessageSelf = 'assets/images/plat_voice_message_self.png'; static const String imagesPlayIcon = 'assets/images/play_icon.png'; static const String imagesPlayer = 'assets/images/player.png'; + static const String imagesQuestionIcon = 'assets/images/question_icon.png'; static const String imagesRealChecked = 'assets/images/real_checked.png'; static const String imagesRealName = 'assets/images/real_name.png'; static const String imagesRealUncheck = 'assets/images/real_uncheck.png'; diff --git a/lib/network/rtc_api.g.dart b/lib/network/rtc_api.g.dart index 5aa117a..febd393 100644 --- a/lib/network/rtc_api.g.dart +++ b/lib/network/rtc_api.g.dart @@ -433,6 +433,40 @@ class _RtcApi implements RtcApi { return httpResponse; } + @override + Future>> costImGift( + Map data, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(data); + final _options = _setStreamType>>( + Options(method: 'POST', headers: _headers, extra: _extra) + .compose( + _dio.options, + 'dating-agency-chat-audio/user/cost/im-gift', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => json as dynamic, + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/pages/mine/my_wallet_page.dart b/lib/pages/mine/my_wallet_page.dart index 7e009ea..037578d 100644 --- a/lib/pages/mine/my_wallet_page.dart +++ b/lib/pages/mine/my_wallet_page.dart @@ -1,6 +1,7 @@ import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/controller/mine/my_wallet_controller.dart'; import 'package:dating_touchme_app/extension/ex_widget.dart'; +import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/pages/mine/withdraw_page.dart'; import 'package:easy_refresh/easy_refresh.dart'; import 'package:flutter/material.dart'; @@ -64,224 +65,202 @@ class MyWalletPage extends StatelessWidget { ), child: Column( children: [ - Container( - height: 44.w, - margin: EdgeInsets.only( - top: 9.w, - bottom: 16.w - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 72.w, - height: 44.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 1 ? 1 : 0) - ) - ) - ), - child: Center( - child: Text( - "最近一个月", - style: TextStyle( - fontSize: 14.w, - color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 1 ? 1 : .5), - fontWeight: controller.timeActive.value == 1 ? FontWeight.w700 : FontWeight.w400 - ), - ), - ), - ).onTap(() async { - controller.timeActive.value = 1; - controller.page.value = 1; - controller.walletHistoryList.clear(); - await controller.getHistoryList(); - controller.listRefreshController.finishRefresh(IndicatorResult.success); - controller.listRefreshController.finishLoad(IndicatorResult.none); - }), - Container( - width: 72.w, - height: 44.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 2 ? 1 : 0) - ) - ) - ), - child: Center( - child: Text( - "3个月", - style: TextStyle( - fontSize: 14.w, - color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 2 ? 1 : .5), - fontWeight: controller.timeActive.value == 2 ? FontWeight.w700 : FontWeight.w400 - ), - ), - ), - ).onTap(() async { - controller.timeActive.value = 2; - controller.page.value = 1; - controller.walletHistoryList.clear(); - await controller.getHistoryList(); - controller.listRefreshController.finishRefresh(IndicatorResult.success); - controller.listRefreshController.finishLoad(IndicatorResult.none); - }), - Container( - width: 72.w, - height: 44.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 3 ? 1 : 0) - ) - ) - ), - child: Center( - child: Text( - "6个月", - style: TextStyle( - fontSize: 14.w, - color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 13 ? 1 : .5), - fontWeight: controller.timeActive.value == 3 ? FontWeight.w700 : FontWeight.w400 - ), - ), - ), - ).onTap(() async { - controller.timeActive.value = 3; - controller.page.value = 1; - controller.walletHistoryList.clear(); - await controller.getHistoryList(); - controller.listRefreshController.finishRefresh(IndicatorResult.success); - controller.listRefreshController.finishLoad(IndicatorResult.none); - }), - Container( - width: 72.w, - height: 44.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 4 ? 1 : 0) - ) - ) - ), - child: Center( - child: Text( - "全部", - style: TextStyle( - fontSize: 14.w, - color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 4 ? 1 : .5), - fontWeight: controller.timeActive.value == 4 ? FontWeight.w700 : FontWeight.w400 - ), + if(controller.walletData.value.id != null) Stack( + children: [ + Image.asset( + Assets.imagesMyWalletBg, + width: 346.w, + height: 168.w, + ), + Container( + width: 346.w, + height: 168.w, + margin: EdgeInsets.only( + bottom: 19.w + ), + padding: EdgeInsets.only( + top: 17.w, + right: 13.w, + left: 13.w + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(8.w)), + ), + child: Column( + children: [ + Row( + children: [ + Text( + "钱包余额(元)", + style: TextStyle( + fontSize: 14.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + SizedBox(width: 9.w,), + Icon( + controller.visibility.value ? Icons.visibility : Icons.visibility_off, + size: 16.w, + color: Colors.white, + ).onTap((){ + controller.visibility.value = !controller.visibility.value; + }) + ], ), - ), - ).onTap(() async { - controller.timeActive.value = 4; - controller.page.value = 1; - controller.walletHistoryList.clear(); - await controller.getHistoryList(); - controller.listRefreshController.finishRefresh(IndicatorResult.success); - controller.listRefreshController.finishLoad(IndicatorResult.none); - }), - ], - ), - ), - Container( - width: 355.w, - height: 129.w, - margin: EdgeInsets.only( - bottom: 24.w - ), - padding: EdgeInsets.symmetric( - vertical: 12.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.w)), - color: const Color.fromRGBO(247, 247, 247, 1) - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 255.w, - padding: EdgeInsets.symmetric( - horizontal: 16.w - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${controller.walletData.value.totalBalance ?? ""}", - style: TextStyle( - fontSize: 20.w, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + controller.visibility.value ? "${controller.walletData.value.totalBalance}" : controller.walletData.value.totalBalance.toString().replaceAll(RegExp(r'\d'), '*'), + style: TextStyle( + fontSize: 30.w, + color: Colors.white, + fontWeight: FontWeight.w700 + ), + ), + Container( + width: 108.w, + height: 32.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(32.w)), + color: Colors.white + ), + child: Center( + child: Text( + "提现", + style: TextStyle( + fontSize: 15.w, + color: const Color.fromRGBO(64, 136, 225, 1), fontWeight: FontWeight.w500 + ), ), ), - SizedBox(height: 6.w,), - Text( - "总余额(元)", - style: TextStyle( + ).onTap(() { + Get.to(() => WithdrawPage(availableWithdrawBalance: controller.walletData.value.availableWithdrawBalance ?? 0))?.then((e){ + controller.getWalletData(); + controller.getHistoryList(); + }); + }) + ], + ), + SizedBox(height: 15.w,), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "可提现(元)", + style: TextStyle( + fontSize: 9.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + Text( + "${controller.walletData.value.availableWithdrawBalance}", + style: TextStyle( fontSize: 13.w, - color: const Color.fromRGBO(102, 102, 102, 1) + color: Colors.white, + fontWeight: FontWeight.w700 + ), + ) + ], + ), + Container( + width: 1, + height: 32.w, + color: const Color.fromRGBO(255, 255, 255, .2), + margin: EdgeInsets.symmetric( + horizontal: 20.w + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "计算中(元)", + style: TextStyle( + fontSize: 9.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), ), - ) - ], + Text( + "${controller.walletData.value.settlementBalance}", + style: TextStyle( + fontSize: 13.w, + color: Colors.white, + fontWeight: FontWeight.w700 + ), + ) + ], + ), + Container( + width: 1, + height: 32.w, + color: const Color.fromRGBO(255, 255, 255, .2), + margin: EdgeInsets.symmetric( + horizontal: 20.w + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "提现中(元)", + style: TextStyle( + fontSize: 9.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + Text( + "${controller.walletData.value.frozenBalance}", + style: TextStyle( + fontSize: 13.w, + color: Colors.white, + fontWeight: FontWeight.w700 + ), + ) + ], + ), + ], + ), + Container( + height: 1, + margin: EdgeInsets.only( + top: 16.w, + bottom: 5.w ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, + color: const Color.fromRGBO(255, 255, 255, .2), + ), + Opacity( + opacity: .6, + child: Row( children: [ - Text( - "${controller.walletData.value.settlementBalance ?? ""}", - style: TextStyle( - fontSize: 20.w, - fontWeight: FontWeight.w500, - color: const Color.fromRGBO(117, 98, 249, 1) - ), + Image.asset( + Assets.imagesQuestionIcon, + width: 13.w, + ), + SizedBox( + width: 5.w, ), - SizedBox(height: 6.w,), Text( - "结算中金额(元)", + "提现说明:收益到账后满 3 天方可申请提现,提现金额最低 50 元", style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(102, 102, 102, 1) + fontSize: 9.w, + color: Colors.white ), ) ], ), - ], - ), + ) + ], ), - Container( - width: 255.w, - height: 42.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(42.w)), - color: const Color.fromRGBO(117, 98, 249, 1) - ), - child: Center( - child: Text( - "提现", - style: TextStyle( - fontSize: 14.w, - fontWeight: FontWeight.w500, - color: Colors.white - ), - ), - ), - ).onTap(() { - Get.to(() => WithdrawPage(availableWithdrawBalance: controller.walletData.value.availableWithdrawBalance ?? 0)); - }) - ], - ), + ), + ], ), Padding( padding: EdgeInsetsGeometry.symmetric( diff --git a/lib/pages/mine/vip_page.dart b/lib/pages/mine/vip_page.dart index 1025e5b..16af040 100644 --- a/lib/pages/mine/vip_page.dart +++ b/lib/pages/mine/vip_page.dart @@ -1,4 +1,6 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:dating_touchme_app/components/page_appbar.dart'; +import 'package:dating_touchme_app/controller/global.dart'; import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/pages/mine/pay_fail_page.dart'; @@ -30,6 +32,7 @@ class _VipPageState extends State { int payActive = 0; + final userData = GlobalData().userData.obs; @override @@ -89,17 +92,32 @@ class _VipPageState extends State { children: [ Row( children: [ - Image.asset( - Assets.imagesUserAvatar, - width: 60.w, - height: 60.w, + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(60.w)), + child: (userData.value?.profilePhoto?.isNotEmpty ?? false) ? CachedNetworkImage( + imageUrl: "${userData.value?.profilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_120", + width: 60.w, + height: 60.w, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover, + ), + ), + ), + ) : Image.asset( + Assets.imagesUserAvatar, + width: 60.w, + height: 60.w, + ) ), SizedBox(width: 15.w,), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "用户昵称", + userData.value?.nickName ?? "", style: TextStyle( fontSize: 18.w, fontWeight: FontWeight.w700 @@ -154,220 +172,149 @@ class _VipPageState extends State { child: Container( width: 375.w, height: 821.h - 270.w, - padding: EdgeInsetsGeometry.symmetric( - vertical: 22.w, - horizontal: 13.w - ), decoration: BoxDecoration( - borderRadius: BorderRadius.vertical( - top: Radius.circular(18.w) - ), - color: Colors.white + borderRadius: BorderRadius.vertical( + top: Radius.circular(18.w) + ), + color: Colors.white ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + child: SingleChildScrollView( + child: Container( + padding: EdgeInsetsGeometry.symmetric( + vertical: 22.w, + horizontal: 13.w + ), + child: Column( children: [ - VipItem(active: vipActive, index: 0,).onTap((){ - vipActive = 0; - setState(() { + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + VipItem(active: vipActive, index: 0,).onTap((){ + vipActive = 0; + setState(() { - }); - }), - VipItem(active: vipActive, index: 1,).onTap((){ - vipActive = 1; - setState(() { + }); + }), + VipItem(active: vipActive, index: 1,).onTap((){ + vipActive = 1; + setState(() { - }); - }), - VipItem(active: vipActive, index: 2,).onTap((){ - vipActive = 2; - setState(() { + }); + }), + VipItem(active: vipActive, index: 2,).onTap((){ + vipActive = 2; + setState(() { - }); - }), - ], - ), - SizedBox(height: 12.w,), - Row( - children: [ + }); + }), + ], + ), + SizedBox(height: 12.w,), + Row( + children: [ - Checkbox( - value: checked, - onChanged: (value) { - checked = value ?? false; - setState(() { + Checkbox( + value: checked, + onChanged: (value) { + checked = value ?? false; + setState(() { - }); - }, - activeColor: const Color.fromRGBO(117, 98, 249, 1), - side: const BorderSide(color: Colors.grey), - shape: const CircleBorder(), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + }); + }, + activeColor: const Color.fromRGBO(117, 98, 249, 1), + side: const BorderSide(color: Colors.grey), + shape: const CircleBorder(), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + Text( + "我已阅读并同意《会员购买协议》", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(189, 189, 189, 1) + ), + ) + ], ), - Text( - "我已阅读并同意《会员购买协议》", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(189, 189, 189, 1) - ), - ) - ], - ), - SizedBox(height: 25.w,), - Row( - children: [ - Text( - "会员专属特权", - style: TextStyle( - fontSize: 17.w, - fontWeight: FontWeight.w500, - color: const Color.fromRGBO(54, 0, 115, 1) - ), - ) - ], - ), - SizedBox(height: 18.w,), - Container( - padding: EdgeInsets.symmetric( - horizontal: 18.w - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - ...vipPrivilege.map((e){ - return VipPrivilege(img: e["img"], label: e["label"]); - }) - ], - ), - ), - SizedBox(height: 15.w,), - Container( - height: 60.w, - padding: EdgeInsets.symmetric( - vertical: 19.w, - horizontal: 18.w - ), - margin: EdgeInsets.only( - bottom: 10.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesVipChat, - width: 34.w, + SizedBox(height: 25.w,), + Row( + children: [ + Text( + "会员专属特权", + style: TextStyle( + fontSize: 17.w, + fontWeight: FontWeight.w500, + color: const Color.fromRGBO(54, 0, 115, 1) + ), + ) + ], + ), + SizedBox(height: 18.w,), + Container( + padding: EdgeInsets.symmetric( + horizontal: 18.w ), - SizedBox(width: 16.w,), - Text( - "【聊天券】立即得70张,后续每天领7张,共280张", - style: TextStyle( - fontSize: 11.w, - fontWeight: FontWeight.w500 - ), - ) - ], - ), - ), - Container( - height: 60.w, - padding: EdgeInsets.symmetric( - vertical: 19.w, - horizontal: 18.w - ), - margin: EdgeInsets.only( - bottom: 10.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesVipMessage, - width: 34.w, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ...vipPrivilege.map((e){ + return VipPrivilege(img: e["img"], label: e["label"]); + }) + ], ), - SizedBox(width: 16.w,), - Text( - "【消息回执】消息已读!看到了~", - style: TextStyle( - fontSize: 11.w, - fontWeight: FontWeight.w500 - ), - ) - ], - ), - ), - Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + ), + SizedBox(height: 15.w,), Container( - width: 86.w, - height: 30.w, + height: 60.w, padding: EdgeInsets.symmetric( - horizontal: 9.w + vertical: 19.w, + horizontal: 18.w + ), + margin: EdgeInsets.only( + bottom: 10.w ), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(30.w)), - border: Border.all( - width: 1, - color: Color.fromRGBO(117, 98, 249, payActive == 0 ? 1 : 0)), - color: payActive == 0 ? - const Color.fromRGBO(117, 98, 249, .07) : - const Color.fromRGBO(247, 247, 247, 1) + borderRadius: BorderRadius.all(Radius.circular(9.w)), + color: const Color.fromRGBO(117, 98, 249, .1) ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( - Assets.imagesWechatPay, - width: 17.w, + Assets.imagesVipChat, + width: 34.w, ), + SizedBox(width: 16.w,), Text( - "微信支付", + "【聊天券】立即得70张,后续每天领7张,共280张", style: TextStyle( - fontSize: 11.w, - fontWeight: FontWeight.w500 + fontSize: 11.w, + fontWeight: FontWeight.w500 ), ) ], ), - ).onTap((){ - payActive = 0; - setState(() { - - }); - }), + ), Container( - width: 80.w, - height: 30.w, + height: 60.w, padding: EdgeInsets.symmetric( - horizontal: 12.w + vertical: 19.w, + horizontal: 18.w + ), + margin: EdgeInsets.only( + bottom: 10.w ), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(30.w)), - border: Border.all( - width: 1, - color: Color.fromRGBO(117, 98, 249, payActive == 1 ? 1 : 0)), - color: payActive == 1 ? - const Color.fromRGBO(117, 98, 249, .07) : - const Color.fromRGBO(247, 247, 247, 1) + borderRadius: BorderRadius.all(Radius.circular(9.w)), + color: const Color.fromRGBO(117, 98, 249, .1) ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( - Assets.imagesAliPay, - width: 17.w, + Assets.imagesVipMessage, + width: 34.w, ), + SizedBox(width: 16.w,), Text( - "支付宝", + "【消息回执】消息已读!看到了~", style: TextStyle( fontSize: 11.w, fontWeight: FontWeight.w500 @@ -375,44 +322,118 @@ class _VipPageState extends State { ) ], ), - ).onTap((){ - payActive = 1; - setState(() { + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 86.w, + height: 30.w, + padding: EdgeInsets.symmetric( + horizontal: 9.w + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(30.w)), + border: Border.all( + width: 1, + color: Color.fromRGBO(117, 98, 249, payActive == 0 ? 1 : 0)), + color: payActive == 0 ? + const Color.fromRGBO(117, 98, 249, .07) : + const Color.fromRGBO(247, 247, 247, 1) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + Assets.imagesWechatPay, + width: 17.w, + ), + Text( + "微信支付", + style: TextStyle( + fontSize: 11.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + ).onTap((){ + payActive = 0; + setState(() { - }); - }), - Container( - width: 161.w, - height: 45.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(45.w)), - gradient: LinearGradient( - begin: Alignment.centerLeft, // 90deg: 从左到右 - end: Alignment.centerRight, - colors: [ - Color.fromRGBO(131, 89, 255, 1), // 起点颜色 - Color.fromRGBO(77, 127, 231, 1), // 中间颜色 - Color.fromRGBO(61, 138, 224, 1), // 终点颜色 - ], - stops: [0.0, 0.7753, 1.0], // 对应 0%、77.53%、100% - ), - ), - child: Center( - child: Text( - "立即开通", - style: TextStyle( - fontSize: 18.w, - color: Colors.white, - fontWeight: FontWeight.w500 + }); + }), + Container( + width: 80.w, + height: 30.w, + padding: EdgeInsets.symmetric( + horizontal: 12.w ), - ), - ), - ).onTap((){ - Get.to(() => PayFailPage()); - }) + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(30.w)), + border: Border.all( + width: 1, + color: Color.fromRGBO(117, 98, 249, payActive == 1 ? 1 : 0)), + color: payActive == 1 ? + const Color.fromRGBO(117, 98, 249, .07) : + const Color.fromRGBO(247, 247, 247, 1) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + Assets.imagesAliPay, + width: 17.w, + ), + Text( + "支付宝", + style: TextStyle( + fontSize: 11.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + ).onTap((){ + payActive = 1; + setState(() { + + }); + }), + Container( + width: 161.w, + height: 45.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(45.w)), + gradient: LinearGradient( + begin: Alignment.centerLeft, // 90deg: 从左到右 + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(131, 89, 255, 1), // 起点颜色 + Color.fromRGBO(77, 127, 231, 1), // 中间颜色 + Color.fromRGBO(61, 138, 224, 1), // 终点颜色 + ], + stops: [0.0, 0.7753, 1.0], // 对应 0%、77.53%、100% + ), + ), + child: Center( + child: Text( + "立即开通", + style: TextStyle( + fontSize: 18.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ).onTap((){ + Get.to(() => PayFailPage()); + }) + ], + ) ], - ) - ], + ), + ), ), ), ), @@ -442,7 +463,6 @@ class _VipItemState extends State { height: 120.h, padding: EdgeInsets.only( top: 16.w, - bottom: 21.w ), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(18.w)), diff --git a/lib/pages/mine/withdraw_page.dart b/lib/pages/mine/withdraw_page.dart index a8eeabe..1c65dc7 100644 --- a/lib/pages/mine/withdraw_page.dart +++ b/lib/pages/mine/withdraw_page.dart @@ -231,25 +231,54 @@ class WithdrawPage extends StatelessWidget { ], ), SizedBox(height: 16.w,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "可提现金额:${availableWithdrawBalance}元", - style: TextStyle( - fontSize: 12.w, - color: const Color.fromRGBO(153, 153, 153, 1) - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Text( + "可提现金额:${availableWithdrawBalance}元", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(153, 153, 153, 1) + ), + ), + Text( + "全部提现", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(25, 114, 248, 1) + ), + ).onTap((){ + controller.withdrawMoney.value = availableWithdrawBalance.toString(); + controller.withdrawMoneyController.value.value = TextEditingValue( + text: controller.withdrawMoney.value, + selection: TextSelection.fromPosition(TextPosition(offset: controller.withdrawMoney.value.length)), + ); + }) + ], + ), + Text( + "提现记录", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(25, 114, 248, 1) + ), + ).onTap((){ + Get.to(() => WithdrawHistoryPage()); + }) + ], ), Text( - "提现记录", + "收益到账后满 3 天方可申请提现,提现金额最低 50 元", style: TextStyle( fontSize: 12.w, - color: const Color.fromRGBO(25, 114, 248, 1) + color: const Color.fromRGBO(153, 153, 153, 1) ), - ).onTap((){ - Get.to(() => WithdrawHistoryPage()); - }) + ) ], ), SizedBox(height: 40.w,), @@ -279,6 +308,10 @@ class WithdrawPage extends StatelessWidget { SmartDialog.showToast('请输入提现金额'); return; } + if(double.parse(controller.withdrawMoney.value) < 50){ + SmartDialog.showToast('最低提现金额为50元'); + return; + } await controller.getServiceFee(); Navigator.of(context).push( TDSlidePopupRoute( @@ -472,11 +505,6 @@ class WithdrawPage extends StatelessWidget { children: [ Row ( children: [ - Image.asset( - Assets.imagesBankIcon, - width: 16.w, - ), - SizedBox(width: 10.w,), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [