Browse Source

优化聊天券明细展示界面,排版好有界面

ios
王子贤 3 months ago
parent
commit
43ee09535a
7 changed files with 250 additions and 7 deletions
  1. BIN
      assets/images/chat_coupon_icon.png
  2. BIN
      assets/images/empty_icon.png
  3. 17
      lib/controller/mine/my_friend_controller.dart
  4. 2
      lib/generated/assets.dart
  5. 3
      lib/pages/mine/mine_page.dart
  6. 224
      lib/pages/mine/my_friend_page.dart
  7. 11
      lib/pages/mine/rose_history_page.dart

BIN
assets/images/chat_coupon_icon.png

Before After
Width: 310  |  Height: 170  |  Size: 28 KiB

BIN
assets/images/empty_icon.png

Before After
Width: 364  |  Height: 364  |  Size: 84 KiB

17
lib/controller/mine/my_friend_controller.dart

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class MyFriendController extends GetxController with GetSingleTickerProviderStateMixin {
late TabController tabController;
final sum = 0.obs;
@override
void onInit() {
super.onInit();
tabController = TabController(length: 4, vsync: this);
}
}

2
lib/generated/assets.dart

@ -88,6 +88,7 @@ class Assets {
static const String imagesCertPhone = 'assets/images/cert_phone.png';
static const String imagesCertRealname = 'assets/images/cert_realname.png';
static const String imagesChatBtn = 'assets/images/chat_btn.png';
static const String imagesChatCouponIcon = 'assets/images/chat_coupon_icon.png';
static const String imagesChatUserBg = 'assets/images/chat_user_bg.png';
static const String imagesChatUserBgBottom = 'assets/images/chat_user_bg_bottom.png';
static const String imagesCheck = 'assets/images/check.png';
@ -100,6 +101,7 @@ class Assets {
static const String imagesEditAvatarsIcon = 'assets/images/edit_avatars_icon.png';
static const String imagesEmoji = 'assets/images/emoji.png';
static const String imagesEmojiTab = 'assets/images/emoji_tab.png';
static const String imagesEmptyIcon = 'assets/images/empty_icon.png';
static const String imagesFemale = 'assets/images/female.png';
static const String imagesFemaleEmpty = 'assets/images/female_empty.png';
static const String imagesFireIcon = 'assets/images/fire_icon.png';

3
lib/pages/mine/mine_page.dart

@ -3,6 +3,7 @@ import 'package:dating_touchme_app/controller/global.dart';
import 'package:dating_touchme_app/controller/mine/mine_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.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/vip_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -285,6 +286,8 @@ class _InfoItemState extends State<InfoItem> {
).onTap((){
if(widget.item['type'] == 4){
Get.to(()=> VisitorListPage());
} else {
Get.to(()=> MyFriendPage());
}
});
}

224
lib/pages/mine/my_friend_page.dart

@ -0,0 +1,224 @@
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/mine/my_friend_controller.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class MyFriendPage extends StatelessWidget {
const MyFriendPage({super.key});
@override
Widget build(BuildContext context) {
return GetX<MyFriendController>(
init: MyFriendController(),
builder: (controller){
return Scaffold(
appBar: PageAppbar(title: "我的关注${controller.sum.value}"),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(22.w),
child: Column(
children: [
TDTabBar(
tabs: [
TDTab(
child: Padding(
padding: EdgeInsets.only(right: 16, left: 16),
child: Text('全部'),
),
),
TDTab(
child: Padding(
padding: EdgeInsets.only(right: 16, left: 16),
child: Text('同城'),
),
),
TDTab(
child: Padding(
padding: EdgeInsets.only(right: 12, left: 12),
child: Text('相亲视频'),
),
),
TDTab(
child: Padding(
padding: EdgeInsets.only(right: 12, left: 12),
child: Text('相亲语音'),
),
),
],
backgroundColor: Colors.transparent,
labelPadding: const EdgeInsets.only(right: 4, top: 10, bottom: 10, left: 4),
selectedBgColor: const Color.fromRGBO(108, 105, 244, 1),
unSelectedBgColor: Colors.transparent,
labelColor: Colors.white,
dividerHeight: 0,
tabAlignment: TabAlignment.start,
outlineType: TDTabBarOutlineType.capsule,
controller: controller.tabController,
showIndicator: false,
isScrollable: true,
onTap: (index) {
print('相亲页面 Tab: $index');
},
),
if(false) ...[
Container(
padding: EdgeInsets.only(top: 60.w,bottom: 13.w),
child: Center(
child: Image.asset(
Assets.imagesEmptyIcon,
width: 91.w,
height: 91.w,
),
),
),
Text(
"你还没有关注任何人噢",
style: TextStyle(
fontSize: 12.w,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Container(
width: 151.w,
height: 32.w,
margin: EdgeInsets.only(top: 11.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(32.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: [0.0, 0.7753, 1.0],
colors: [
Color.fromRGBO(131, 89, 255, 1),
Color.fromRGBO(77, 127, 231, 1),
Color.fromRGBO(61, 138, 224, 1),
],
),
),
child: Center(
child: Text(
"去聊聊",
style: TextStyle(
fontSize: 12.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
],
...[
UserItem(),
UserItem(),
UserItem(),
UserItem(),
UserItem(),
UserItem(),
UserItem(),
]
],
),
),
),
);
},
);
}
}
class UserItem extends StatefulWidget {
const UserItem({super.key});
@override
State<UserItem> createState() => _UserItemState();
}
class _UserItemState extends State<UserItem> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(
vertical: 15.w
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
child: Image.asset(
Assets.imagesUserAvatar,
width: 45.w,
height: 45.w,
),
),
SizedBox(width: 9.w,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"叫我大王",
style: TextStyle(
fontSize: 14.w,
fontWeight: FontWeight.w500
),
),
Container(
margin: EdgeInsets.only(left: 7.w),
width: 12.w,
height: 12.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12.w)),
color: const Color.fromRGBO(255, 237, 255, 1)
),
child: Center(
child: Image.asset(
Assets.imagesFemale,
width: 7.w,
),
),
)
],
),
Text(
"30岁·广州",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, 1),
fontWeight: FontWeight.w500
),
)
],
)
],
),
Container(
width: 60.w,
height: 22.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(22.w)),
color: const Color.fromRGBO(224, 224, 224, .5)
),
child: Center(
child: Text(
"已关注",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, 1),
fontWeight: FontWeight.w500
),
),
),
)
],
),
);
}
}

11
lib/pages/mine/rose_history_page.dart

@ -237,13 +237,10 @@ class _ChatCouponItemState extends State<ChatCouponItem> {
children: [
Row(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(40.w)),
child: Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w ,
),
Image.asset(
Assets.imagesChatCouponIcon,
width: 40.w,
height: 40.w ,
),
SizedBox(width: 12.w ,),
Column(

Loading…
Cancel
Save