Jolie 3 months ago
parent
commit
2b800b29be
4 changed files with 59 additions and 9 deletions
  1. 2
      lib/main.dart
  2. 12
      lib/pages/mine/edit_info_page.dart
  3. 42
      lib/pages/mine/withdraw_page.dart
  4. 12
      lib/pages/setting/setting_page.dart

2
lib/main.dart

@ -89,7 +89,7 @@ void main() async {
runApp( runApp(
GetMaterialApp( GetMaterialApp(
locale: Get.locale, // 使GetX的locale
locale: Locale('zh', 'CN'), // 使GetX的locale
supportedLocales: const [Locale('zh', 'CN')], supportedLocales: const [Locale('zh', 'CN')],
/// ///

12
lib/pages/mine/edit_info_page.dart

@ -461,7 +461,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
fontSize: 13.w, fontSize: 13.w,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
),),
), hideArrow: true,),
Container( Container(
margin: EdgeInsets.only(bottom: 3.w), margin: EdgeInsets.only(bottom: 3.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -558,12 +558,15 @@ class _EditInfoPageState extends State<EditInfoPage> {
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 13.w, size: 13.w,
color: const Color.fromRGBO(191, 191, 191, 1)
color: Color.fromRGBO(191, 191, 191, (controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != "") ? 0 : 1)
) )
], ],
) )
], ],
).onTap((){ ).onTap((){
if(controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != ""){
return;
}
_showDatePicker(controller); _showDatePicker(controller);
}), }),
], ],
@ -1176,7 +1179,8 @@ class SetItem extends StatefulWidget {
final String label; final String label;
final bool showRequired; final bool showRequired;
final Widget child; final Widget child;
const SetItem({super.key, required this.label, this.showRequired = true, required this.child});
final bool hideArrow;
const SetItem({super.key, required this.label, this.showRequired = true, required this.child, this.hideArrow = false});
@override @override
State<SetItem> createState() => _SetItemState(); State<SetItem> createState() => _SetItemState();
@ -1229,7 +1233,7 @@ class _SetItemState extends State<SetItem> {
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 13.w, size: 13.w,
color: const Color.fromRGBO(191, 191, 191, 1)
color: Color.fromRGBO(191, 191, 191, widget.hideArrow ? 0 : 1)
) )
], ],
), ),

42
lib/pages/mine/withdraw_page.dart

@ -6,6 +6,7 @@ import 'package:dating_touchme_app/model/mine/bank_card_data.dart';
import 'package:dating_touchme_app/pages/mine/add_bankcard_page.dart'; import 'package:dating_touchme_app/pages/mine/add_bankcard_page.dart';
import 'package:dating_touchme_app/pages/mine/withdraw_history_page.dart'; import 'package:dating_touchme_app/pages/mine/withdraw_history_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -195,7 +196,10 @@ class WithdrawPage extends StatelessWidget {
Expanded( Expanded(
child: TextField( child: TextField(
controller: controller.withdrawMoneyController.value, controller: controller.withdrawMoneyController.value,
keyboardType: TextInputType.number,
keyboardType: const TextInputType.numberWithOptions(decimal: true),
inputFormatters: [
DecimalTextInputFormatter(decimalRange: 2),
],
style: TextStyle( style: TextStyle(
fontSize: ScreenUtil().setWidth(22), fontSize: ScreenUtil().setWidth(22),
height: 1 height: 1
@ -582,3 +586,39 @@ class WithdrawPage extends StatelessWidget {
} }
} }
class DecimalTextInputFormatter extends TextInputFormatter {
DecimalTextInputFormatter({this.decimalRange = 2});
final int decimalRange;
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue,
TextEditingValue newValue,
) {
final text = newValue.text;
//
if (text.isEmpty) return newValue;
//
if (!RegExp(r'^\d*\.?\d*$').hasMatch(text)) {
return oldValue;
}
//
if ('.'.allMatches(text).length > 1) {
return oldValue;
}
//
if (text.contains('.')) {
final parts = text.split('.');
if (parts.length > 1 && parts[1].length > decimalRange) {
return oldValue;
}
}
return newValue;
}
}

12
lib/pages/setting/setting_page.dart

@ -7,6 +7,7 @@ import 'package:dating_touchme_app/pages/setting/deactivate_page.dart';
import 'package:dating_touchme_app/pages/setting/teenager_mode_page.dart'; import 'package:dating_touchme_app/pages/setting/teenager_mode_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart';
@ -62,7 +63,9 @@ class SettingPage extends StatelessWidget {
TDCell(arrow: true, title: '黑名单', onClick: (cell) { TDCell(arrow: true, title: '黑名单', onClick: (cell) {
Get.to(() => BlacklistPage()); Get.to(() => BlacklistPage());
}), }),
TDCell(arrow: true, title: '隐私设置'),
TDCell(arrow: true, title: '隐私设置', onClick: (cell) {
SmartDialog.showToast('功能暂未开放');
},),
TDCell(arrow: true, title: '青少年模式', onClick: (cell) { TDCell(arrow: true, title: '青少年模式', onClick: (cell) {
Get.to(() => TeenagerModePage()); Get.to(() => TeenagerModePage());
},), },),
@ -76,11 +79,14 @@ class SettingPage extends StatelessWidget {
openAppSettings(); openAppSettings();
},), },),
TDCell(arrow: true, title: '消息通知', onClick: (cell) { TDCell(arrow: true, title: '消息通知', onClick: (cell) {
Get.to(() => NoticePage());
// Get.to(() => NoticePage());
openAppSettings();
}), }),
TDCell(arrow: true, title: '检查更新', onClick: (cell) { TDCell(arrow: true, title: '检查更新', onClick: (cell) {
// _showUpdateDialog(); // _showUpdateDialog();
controller.checkVersion();
// controller.checkVersion();
SmartDialog.showToast('功能暂未开放');
}, },
noteWidget: Text('当前版本:${controller.version.value}',style: TextStyle(fontSize: 13.w,color: const Color.fromRGBO(117, 98, 249, 1))), noteWidget: Text('当前版本:${controller.version.value}',style: TextStyle(fontSize: 13.w,color: const Color.fromRGBO(117, 98, 249, 1))),
) )

Loading…
Cancel
Save