Browse Source
- 新增充值对话框组件,统一处理余额不足提示 - 在会议、翻译、代理模块添加余额检查逻辑 - 添加多语言翻译支持 - 移除代理模块中重复的弹窗代码,改用统一组件newdev_shunjiawei
7 changed files with 100 additions and 57 deletions
@ -0,0 +1,67 @@ |
|||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:get/get.dart'; |
||||
|
import '../../../routes/app_routes.dart'; |
||||
|
|
||||
|
void showRechargeDialog(String type) { |
||||
|
Get.dialog( |
||||
|
Dialog( |
||||
|
shape: RoundedRectangleBorder( |
||||
|
borderRadius: BorderRadius.circular(12), |
||||
|
), |
||||
|
child: Stack( |
||||
|
children: [ |
||||
|
Padding( |
||||
|
padding: const EdgeInsets.fromLTRB(16, 20, 16, 16), |
||||
|
child: Column( |
||||
|
mainAxisSize: MainAxisSize.min, |
||||
|
children: [ |
||||
|
Text( |
||||
|
'tip'.tr, |
||||
|
style: const TextStyle( |
||||
|
fontSize: 18, |
||||
|
fontWeight: FontWeight.bold, |
||||
|
), |
||||
|
), |
||||
|
const SizedBox(height: 12), |
||||
|
Text( |
||||
|
'insufficientBalanceDesc'.tr, //'余额不足,请前往对应充值界面进行充值', |
||||
|
textAlign: TextAlign.center, |
||||
|
), |
||||
|
const SizedBox(height: 20), |
||||
|
SizedBox( |
||||
|
width: double.infinity, |
||||
|
child: ElevatedButton( |
||||
|
style: ElevatedButton.styleFrom( |
||||
|
backgroundColor: Colors.orangeAccent, |
||||
|
foregroundColor: Colors.white, |
||||
|
), |
||||
|
onPressed: () { |
||||
|
Get.back(); |
||||
|
if (type == 'agent') { |
||||
|
Get.toNamed(Routes.goodsvip); |
||||
|
} else if (type == 'translation') { |
||||
|
Get.toNamed(Routes.goodstrade); |
||||
|
} else if (type == 'meeting') { |
||||
|
Get.toNamed(Routes.goodsmeet); |
||||
|
} |
||||
|
}, |
||||
|
child: Text('recharge'.tr), |
||||
|
), |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
Positioned( |
||||
|
right: 8, |
||||
|
top: 8, |
||||
|
child: IconButton( |
||||
|
icon: const Icon(Icons.close), |
||||
|
onPressed: () => Get.back(), |
||||
|
), |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
barrierDismissible: true, |
||||
|
); |
||||
|
} |
||||
Loading…
Reference in new issue