You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
278 lines
9.5 KiB
278 lines
9.5 KiB
import 'package:dating_touchme_app/components/page_appbar.dart';
|
|
import 'package:dating_touchme_app/controller/mine/rose_history_controller.dart';
|
|
import 'package:dating_touchme_app/generated/assets.dart';
|
|
import 'package:dating_touchme_app/model/mine/rose_history_data.dart';
|
|
import 'package:easy_refresh/easy_refresh.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
class RoseHistoryPage extends StatelessWidget {
|
|
const RoseHistoryPage({super.key});
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetX<RoseHistoryController>(
|
|
init: RoseHistoryController(),
|
|
builder: (controller){
|
|
return Scaffold(
|
|
appBar: PageAppbar(title: "交易记录"),
|
|
body: EasyRefresh(
|
|
controller: controller.listRefreshController,
|
|
// 下拉刷新
|
|
onRefresh: () async {
|
|
print('推荐列表下拉刷新被触发');
|
|
Future.delayed(Duration(seconds: 3), () {
|
|
print("3 秒后执行");
|
|
controller.listRefreshController.finishRefresh(IndicatorResult.success);
|
|
});
|
|
},
|
|
// 上拉加载更多
|
|
onLoad: () async {
|
|
print('推荐列表上拉加载被触发, hasMore: ');
|
|
Future.delayed(Duration(seconds: 3), () {
|
|
print("3 秒后执行");
|
|
controller.listRefreshController.finishLoad(IndicatorResult.success);
|
|
});
|
|
},
|
|
child: SingleChildScrollView(
|
|
child: Container(
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 6.w,
|
|
horizontal: 15.w
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
...controller.friendNavList.asMap().entries.map((entry){
|
|
return Container(
|
|
margin: EdgeInsets.only(right: 25.w),
|
|
child: InkWell(
|
|
onTap: (){
|
|
controller.changeNavTab(entry.key);
|
|
|
|
},
|
|
child: Container(
|
|
padding: entry.key == controller.friendNavActive.value ? EdgeInsets.symmetric(vertical: 2.w, horizontal: 26.w) : EdgeInsets.zero,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(21.w)),
|
|
color: entry.key == controller.friendNavActive.value ? const Color.fromRGBO(117, 98, 249, 1) : Colors.transparent
|
|
),
|
|
child: Text(
|
|
entry.value,
|
|
style: TextStyle(
|
|
fontSize: 12.w,
|
|
color: entry.key == controller.friendNavActive.value ? Colors.white : const Color.fromRGBO(51, 51, 51, .7),
|
|
fontWeight: entry.key == controller.friendNavActive.value ? FontWeight.w700 : FontWeight.w500
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}),
|
|
|
|
],
|
|
),
|
|
SizedBox(height: 4.w,),
|
|
if(controller.friendNavActive.value != 2) ...[
|
|
...controller.roseHistoryList.map((e){
|
|
return SendItem(item: e);
|
|
})
|
|
],
|
|
if(controller.friendNavActive.value == 2) ...[
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
ChatCouponItem(),
|
|
],
|
|
SizedBox(height: 6.w,),
|
|
Text(
|
|
"没有更多了",
|
|
style: TextStyle(
|
|
fontSize: 11.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class SendItem extends StatefulWidget {
|
|
final Records item;
|
|
const SendItem({super.key, required this.item});
|
|
|
|
@override
|
|
State<SendItem> createState() => _SendItemState();
|
|
}
|
|
|
|
class _SendItemState extends State<SendItem> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
height: 70.w,
|
|
decoration: BoxDecoration(
|
|
border: Border(
|
|
bottom: BorderSide(
|
|
width: 1,
|
|
color: const Color.fromRGBO(219, 219, 219, 1)
|
|
)
|
|
)
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: 40.w,
|
|
height: 40.w,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(40.w)),
|
|
color: const Color.fromRGBO(237, 237, 237, 1)
|
|
),
|
|
child: Center(
|
|
child: Image.asset(
|
|
Assets.imagesRoseGift,
|
|
width: 27.w,
|
|
height: 27.w,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(width: 22.w,),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
widget.item.tradeType == 201 ? "聊天花费" :
|
|
widget.item.tradeType == 202 ? "赠送礼物" :
|
|
widget.item.tradeType == 101 ? "充值" : "",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
color: const Color.fromRGBO(51, 51, 51, 1),
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
),
|
|
Text(
|
|
"${widget.item.createTime}",
|
|
style: TextStyle(
|
|
fontSize: 11.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1),
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
Text(
|
|
"${widget.item.tradeType == 101 ? "+" : "-"}${widget.item.tradeBalance}支",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
color: const Color.fromRGBO(227, 84, 84, 1)
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ChatCouponItem extends StatefulWidget {
|
|
const ChatCouponItem({super.key});
|
|
|
|
@override
|
|
State<ChatCouponItem> createState() => _ChatCouponItemState();
|
|
}
|
|
|
|
class _ChatCouponItemState extends State<ChatCouponItem> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
height: 70.w,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.all(Radius.circular(40.w)),
|
|
child: Image.asset(
|
|
Assets.imagesUserAvatar,
|
|
width: 40.w,
|
|
height: 40.w ,
|
|
),
|
|
),
|
|
SizedBox(width: 12.w ,),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
"视频详情直播间送礼物",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
),
|
|
Text(
|
|
"2025-11-03 17:55:55",
|
|
style: TextStyle(
|
|
fontSize: 11.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1)
|
|
),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
"主动发消息",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1)
|
|
),
|
|
),
|
|
Text(
|
|
"-1张",
|
|
style: TextStyle(
|
|
fontSize: 13.w,
|
|
color: const Color.fromRGBO(227, 84, 84, 1)
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|