Browse Source

调整提现样式和逻辑

ios
王子贤 4 months ago
parent
commit
061b0681d2
8 changed files with 506 additions and 445 deletions
  1. BIN
      assets/images/my_wallet_bg.png
  2. BIN
      assets/images/question_icon.png
  3. 10
      lib/controller/mine/my_wallet_controller.dart
  4. 2
      lib/generated/assets.dart
  5. 34
      lib/network/rtc_api.g.dart
  6. 383
      lib/pages/mine/my_wallet_page.dart
  7. 458
      lib/pages/mine/vip_page.dart
  8. 64
      lib/pages/mine/withdraw_page.dart

BIN
assets/images/my_wallet_bg.png

Before After
Width: 1384  |  Height: 672  |  Size: 14 KiB

BIN
assets/images/question_icon.png

Before After
Width: 32  |  Height: 32  |  Size: 469 B

10
lib/controller/mine/my_wallet_controller.dart

@ -18,6 +18,8 @@ class MyWalletController extends GetxController {
final size = 10.obs; final size = 10.obs;
final visibility = false.obs;
late UserApi _userApi; late UserApi _userApi;
late final EasyRefreshController listRefreshController; late final EasyRefreshController listRefreshController;
@ -78,12 +80,8 @@ class MyWalletController extends GetxController {
final response = await _userApi.getWalletAccountRecord( final response = await _userApi.getWalletAccountRecord(
pageNum: page.value, pageNum: page.value,
pageSize: size.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) { if (response.data.isSuccess && response.data.data != null) {
walletHistoryList.addAll(response.data.data?.records ?? []); walletHistoryList.addAll(response.data.data?.records ?? []);

2
lib/generated/assets.dart

@ -140,6 +140,7 @@ class Assets {
static const String imagesMinePre = 'assets/images/mine_pre.png'; static const String imagesMinePre = 'assets/images/mine_pre.png';
static const String imagesMore = 'assets/images/more.png'; static const String imagesMore = 'assets/images/more.png';
static const String imagesMoreIcon = 'assets/images/more_icon.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 imagesOnlineIcon = 'assets/images/online_icon.png';
static const String imagesPhoneChecked = 'assets/images/phone_checked.png'; static const String imagesPhoneChecked = 'assets/images/phone_checked.png';
static const String imagesPhoneHelp = 'assets/images/phone_help.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 imagesPlatVoiceMessageSelf = 'assets/images/plat_voice_message_self.png';
static const String imagesPlayIcon = 'assets/images/play_icon.png'; static const String imagesPlayIcon = 'assets/images/play_icon.png';
static const String imagesPlayer = 'assets/images/player.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 imagesRealChecked = 'assets/images/real_checked.png';
static const String imagesRealName = 'assets/images/real_name.png'; static const String imagesRealName = 'assets/images/real_name.png';
static const String imagesRealUncheck = 'assets/images/real_uncheck.png'; static const String imagesRealUncheck = 'assets/images/real_uncheck.png';

34
lib/network/rtc_api.g.dart

@ -433,6 +433,40 @@ class _RtcApi implements RtcApi {
return httpResponse; return httpResponse;
} }
@override
Future<HttpResponse<BaseResponse<dynamic>>> costImGift(
Map<String, dynamic> data,
) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(data);
final _options = _setStreamType<HttpResponse<BaseResponse<dynamic>>>(
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<Map<String, dynamic>>(_options);
late BaseResponse<dynamic> _value;
try {
_value = BaseResponse<dynamic>.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<T>(RequestOptions requestOptions) { RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic && if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes || !(requestOptions.responseType == ResponseType.bytes ||

383
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/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/mine/my_wallet_controller.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/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/pages/mine/withdraw_page.dart'; import 'package:dating_touchme_app/pages/mine/withdraw_page.dart';
import 'package:easy_refresh/easy_refresh.dart'; import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -64,224 +65,202 @@ class MyWalletPage extends StatelessWidget {
), ),
child: Column( child: Column(
children: [ 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 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, 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: [ 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( Text(
"结算中金额(元)",
"提现说明:收益到账后满 3 天方可申请提现,提现金额最低 50 元",
style: TextStyle( 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(
padding: EdgeInsetsGeometry.symmetric( padding: EdgeInsetsGeometry.symmetric(

458
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/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/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/pages/mine/pay_fail_page.dart'; import 'package:dating_touchme_app/pages/mine/pay_fail_page.dart';
@ -30,6 +32,7 @@ class _VipPageState extends State<VipPage> {
int payActive = 0; int payActive = 0;
final userData = GlobalData().userData.obs;
@override @override
@ -89,17 +92,32 @@ class _VipPageState extends State<VipPage> {
children: [ children: [
Row( Row(
children: [ 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,), SizedBox(width: 15.w,),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"用户昵称",
userData.value?.nickName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 18.w, fontSize: 18.w,
fontWeight: FontWeight.w700 fontWeight: FontWeight.w700
@ -154,220 +172,149 @@ class _VipPageState extends State<VipPage> {
child: Container( child: Container(
width: 375.w, width: 375.w,
height: 821.h - 270.w, height: 821.h - 270.w,
padding: EdgeInsetsGeometry.symmetric(
vertical: 22.w,
horizontal: 13.w
),
decoration: BoxDecoration( 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: [ 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( Container(
width: 86.w,
height: 30.w,
height: 60.w,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 9.w
vertical: 19.w,
horizontal: 18.w
),
margin: EdgeInsets.only(
bottom: 10.w
), ),
decoration: BoxDecoration( 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( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset( Image.asset(
Assets.imagesWechatPay,
width: 17.w,
Assets.imagesVipChat,
width: 34.w,
), ),
SizedBox(width: 16.w,),
Text( Text(
"微信支付",
"【聊天券】立即得70张,后续每天领7张,共280张",
style: TextStyle( style: TextStyle(
fontSize: 11.w,
fontWeight: FontWeight.w500
fontSize: 11.w,
fontWeight: FontWeight.w500
), ),
) )
], ],
), ),
).onTap((){
payActive = 0;
setState(() {
});
}),
),
Container( Container(
width: 80.w,
height: 30.w,
height: 60.w,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 12.w
vertical: 19.w,
horizontal: 18.w
),
margin: EdgeInsets.only(
bottom: 10.w
), ),
decoration: BoxDecoration( 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( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset( Image.asset(
Assets.imagesAliPay,
width: 17.w,
Assets.imagesVipMessage,
width: 34.w,
), ),
SizedBox(width: 16.w,),
Text( Text(
"支付宝",
"【消息回执】消息已读!看到了~",
style: TextStyle( style: TextStyle(
fontSize: 11.w, fontSize: 11.w,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
@ -375,44 +322,118 @@ class _VipPageState extends State<VipPage> {
) )
], ],
), ),
).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<VipItem> {
height: 120.h, height: 120.h,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 16.w, top: 16.w,
bottom: 21.w
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18.w)), borderRadius: BorderRadius.all(Radius.circular(18.w)),

64
lib/pages/mine/withdraw_page.dart

@ -231,25 +231,54 @@ class WithdrawPage extends StatelessWidget {
], ],
), ),
SizedBox(height: 16.w,), SizedBox(height: 16.w,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Text(
"提现记录",
"收益到账后满 3 天方可申请提现,提现金额最低 50 元",
style: TextStyle( style: TextStyle(
fontSize: 12.w, 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,), SizedBox(height: 40.w,),
@ -279,6 +308,10 @@ class WithdrawPage extends StatelessWidget {
SmartDialog.showToast('请输入提现金额'); SmartDialog.showToast('请输入提现金额');
return; return;
} }
if(double.parse(controller.withdrawMoney.value) < 50){
SmartDialog.showToast('最低提现金额为50元');
return;
}
await controller.getServiceFee(); await controller.getServiceFee();
Navigator.of(context).push( Navigator.of(context).push(
TDSlidePopupRoute( TDSlidePopupRoute(
@ -472,11 +505,6 @@ class WithdrawPage extends StatelessWidget {
children: [ children: [
Row ( Row (
children: [ children: [
Image.asset(
Assets.imagesBankIcon,
width: 16.w,
),
SizedBox(width: 10.w,),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

Loading…
Cancel
Save