Browse Source

no message

master
ZHR007 2 months ago
parent
commit
6afb53307b
2 changed files with 154 additions and 23 deletions
  1. 16
      lib/controller/mine/mine_controller.dart
  2. 161
      lib/pages/mine/mine_page.dart

16
lib/controller/mine/mine_controller.dart

@ -4,9 +4,11 @@ import 'package:dating_touchme_app/model/mine/user_count_data.dart';
import 'package:dating_touchme_app/network/user_api.dart'; import 'package:dating_touchme_app/network/user_api.dart';
import 'package:dating_touchme_app/pages/mine/auth_center_page.dart'; import 'package:dating_touchme_app/pages/mine/auth_center_page.dart';
import 'package:dating_touchme_app/pages/mine/my_wallet_page.dart'; import 'package:dating_touchme_app/pages/mine/my_wallet_page.dart';
import 'package:dating_touchme_app/pages/mine/real_name_page.dart';
import 'package:dating_touchme_app/pages/mine/rose_page.dart'; import 'package:dating_touchme_app/pages/mine/rose_page.dart';
import 'package:dating_touchme_app/pages/mine/user_help_center_page.dart'; import 'package:dating_touchme_app/pages/mine/user_help_center_page.dart';
import 'package:dating_touchme_app/pages/setting/match_spread_page.dart'; import 'package:dating_touchme_app/pages/setting/match_spread_page.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../pages/setting/setting_page.dart'; import '../../pages/setting/setting_page.dart';
@ -20,7 +22,7 @@ class MineController extends GetxController {
{"icon": Assets.imagesWallet, "title": "我的钱包", "subTitle": "提现无门槛", "path": () => MyWalletPage()}, {"icon": Assets.imagesWallet, "title": "我的钱包", "subTitle": "提现无门槛", "path": () => MyWalletPage()},
// {"icon": Assets.imagesShop, "title": "商城中心", "subTitle": "不定期更新商品", "path": () => null}, // {"icon": Assets.imagesShop, "title": "商城中心", "subTitle": "不定期更新商品", "path": () => null},
{"icon": Assets.imagesCert, "title": "认证中心", "subTitle": GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null ? "未认证" : "已认证", "path": () => AuthCenterPage()}, {"icon": Assets.imagesCert, "title": "认证中心", "subTitle": GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null ? "未认证" : "已认证", "path": () => AuthCenterPage()},
{"icon": Assets.imagesMatchmaker, "title": "红娘等级", "subTitle": "实习红娘", "path": () => MatchSpreadPage()},
{"icon": Assets.imagesMatchmaker, "title": "红娘等级", "subTitle": "实习红娘", "path": 'MatchSpreadPage'},
].obs; ].obs;
final settingList = <Map>[ final settingList = <Map>[
@ -36,6 +38,8 @@ class MineController extends GetxController {
late UserApi _userApi; late UserApi _userApi;
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
@ -44,4 +48,14 @@ class MineController extends GetxController {
_userApi = Get.find<UserApi>(); _userApi = Get.find<UserApi>();
} }
void registerMatch() async {
if (GlobalData().userData!.identityCard != null &&
GlobalData().userData!.identityCard!.isNotEmpty) {
await Get.to(() => MatchSpreadPage());
} else {
SmartDialog.showToast('请先进行实名认证');
await Get.to(() => RealNamePage(type: 1));
}
}
} }

161
lib/pages/mine/mine_page.dart

@ -4,14 +4,20 @@ import 'package:dating_touchme_app/controller/mine/mine_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/model/mine/user_count_data.dart'; import 'package:dating_touchme_app/model/mine/user_count_data.dart';
import 'package:dating_touchme_app/network/user_api.dart'; import 'package:dating_touchme_app/network/user_api.dart';
import 'package:dating_touchme_app/pages/mine/auth_center_page.dart';
import 'package:dating_touchme_app/pages/mine/edit_info_page.dart'; import 'package:dating_touchme_app/pages/mine/edit_info_page.dart';
import 'package:dating_touchme_app/pages/mine/my_friend_page.dart'; import 'package:dating_touchme_app/pages/mine/my_friend_page.dart';
import 'package:dating_touchme_app/pages/mine/my_wallet_page.dart';
import 'package:dating_touchme_app/pages/mine/rose_page.dart';
import 'package:dating_touchme_app/pages/mine/user_help_center_page.dart';
import 'package:dating_touchme_app/pages/mine/vip_page.dart'; import 'package:dating_touchme_app/pages/mine/vip_page.dart';
import 'package:dating_touchme_app/pages/setting/setting_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:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.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';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import '../discover/visitor_list_page.dart'; import '../discover/visitor_list_page.dart';
@ -80,9 +86,13 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
var cellStyle = TDCellStyle.cellStyle(context);
cellStyle.cardPadding = EdgeInsets.symmetric(horizontal: 0);
cellStyle.padding = EdgeInsets.only(left: 16, top: 12, bottom: 12, right: 12);
return GetX<MineController>( return GetX<MineController>(
init: MineController(), init: MineController(),
builder: (controller) { builder: (controller) {
@ -223,7 +233,7 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
), ),
SizedBox(height: 16.w,), SizedBox(height: 16.w,),
Container( Container(
height: 57.w,
// height: 57.w,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 11.w, top: 11.w,
right: 42.w, right: 42.w,
@ -266,27 +276,132 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
], ],
), ),
SizedBox(height: 12.w,), SizedBox(height: 12.w,),
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
child: Column(
children: [
...controller.blockList.map((e){
return BlockItem(item: e, showWaring: e["title"] == "认证中心" && (GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null), path: e["path"],);
}),
],
),
// ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(9.w)),
// child: Column(
// children: [
// ...controller.blockList.map((e){
// return BlockItem(item: e, showWaring: e["title"] == "认证中心" && (GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null), path: e["path"],);
// }),
// ],
// ),
// ),
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
style: cellStyle,
cells: [
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesRose, height: 22.w, width: 22.w),
titleWidget: Text(
"我的玫瑰",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
Get.to(() => RosePage());
}
),
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesWallet, height: 22.w, width: 22.w),
titleWidget: Text(
"我的钱包",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
Get.to(() => MyWalletPage());
}
),
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesCert, height: 22.w, width: 22.w),
titleWidget: Text(
"认证中心",
style: TextStyle(
fontSize: 14.w
),
),
noteWidget: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if(GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null) TDBadge(TDBadgeType.redPoint),
SizedBox(width: 5.w, height: 9.w),
Text(
GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null ? "未认证" : "已认证",
style: TextStyle(fontSize: 12.w, color: const Color.fromRGBO(166, 166, 166, 1)),
)
],
),
onClick: (cell) {
Get.to(() => AuthCenterPage());
}
),
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesMatchmaker, height: 22.w, width: 22.w),
titleWidget: Text(
"红娘等级",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
controller.registerMatch();
}
),
],
), ),
SizedBox(height: 12.w,), SizedBox(height: 12.w,),
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
child: Column(
children: [
...controller.settingList.map((e){
return SettingItem(item: e, path: e["path"],);
})
],
),
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
style: cellStyle,
cells: [
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesSetting, height: 22.w, width: 22.w),
titleWidget: Text(
"设置",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
Get.to(() => SettingPage());
}
),
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesCustomer, height: 22.w, width: 22.w),
titleWidget: Text(
"联系客服",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
SmartDialog.showToast('功能暂未开放');
}
),
TDCell(arrow: true,
leftIconWidget: Image.asset(Assets.imagesMail, height: 22.w, width: 22.w),
titleWidget: Text(
"意见反馈",
style: TextStyle(
fontSize: 14.w
),
), onClick: (cell) {
Get.to(() => UserHelpCenterPage());
}
),
],
), ),
// ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(9.w)),
// child: Column(
// children: [
// ...controller.settingList.map((e){
// return SettingItem(item: e, path: e["path"],);
// })
// ],
// ),
// ),
], ],
), ),
); );
@ -329,7 +444,7 @@ class _InfoItemState extends State<InfoItem> {
Text( Text(
"${widget.item["num"]}", "${widget.item["num"]}",
style: TextStyle( style: TextStyle(
fontSize: 15.w,
fontSize: 18.w,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700 fontWeight: FontWeight.w700
), ),
@ -394,7 +509,9 @@ class _BlockItemState extends State<BlockItem> {
return InkWell( return InkWell(
onTap: (){ onTap: (){
// context.pushNamed(widget.path); // context.pushNamed(widget.path);
if(widget.path() != null){
if(widget.path() == 'MatchSpreadPage'){
} else if(widget.path() != null){
Get.to(widget.path)?.then((e){ Get.to(widget.path)?.then((e){
setState(() { setState(() {
@ -402,7 +519,7 @@ class _BlockItemState extends State<BlockItem> {
}); });
} else { } else {
SmartDialog.showToast('功能暂未开放');
SmartDialog.showToast('功能暂未开放');
} }
// RouteGuardService.to.toWithAuth(widget.path, null); // RouteGuardService.to.toWithAuth(widget.path, null);
}, },

Loading…
Cancel
Save