初始化

This commit is contained in:
谢宇宁
2026-09-15 15:44:13 +07:00
commit a23ba685e9
1065 changed files with 101122 additions and 0 deletions
@@ -0,0 +1,294 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:hgdj/assets_tool/images.dart';
import 'package:hgdj/hj_model/mine/follow_user_list_model.dart';
import 'package:hgdj/hj_model/video_model.dart';
import 'package:hgdj/hj_utils/api_service/mine_service.dart';
import 'package:hgdj/hj_utils/screen.dart';
import 'package:hgdj/routers/jump_router.dart';
import 'package:hgdj/tools_base/widget/net_image_widget.dart';
import '../../../community/community_tag_page/community_tag_page.dart';
import 'package:hgdj/extension/extensions.dart';
/// 关注列表 - 女优项
class FollowActressItem extends StatefulWidget {
final FollowUserModel model;
const FollowActressItem(this.model, {super.key});
@override
State<FollowActressItem> createState() => _FollowActressItemState();
}
class _FollowActressItemState extends State<FollowActressItem> {
@override
Widget build(BuildContext context) {
return InkWell(
enableFeedback: false,
onTap: () {
// type:1 原跳女优主页 ActressMainPage(已下线),pushToPersonCenter 内 type==1 已 return null
// → 当前点击不跳转,待产品确认替代页(objcId 与用户中心 uid 非同一体系,不能直接跳 UserCenterPage
pushToPersonCenter(widget.model.objcId, type: 1);
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 18.w),
padding: EdgeInsets.symmetric(horizontal: 13.w, vertical: 16.h),
decoration: BoxDecoration(
color: Color(0xff242424),
borderRadius: BorderRadius.all(Radius.circular(6)),
),
child: Row(
children: [
NetworkImageLoader(
imageUrl: widget.model.portrait ?? "",
width: 43,
height: 43,
borderRadius: 6,
),
SizedBox(width: 12),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
widget.model.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
Text(
"粉丝: ${widget.model.fans?.countStr}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10,
color: Color(0xff666666),
fontWeight: FontWeight.w400,
),
),
],
),
),
GestureDetector(
onTap: () async {
final isFollow = widget.model.hasFollow ?? false;
final res = await MineService.postCollect(
widget.model.objcId, 'actresss', !isFollow);
if (res) {
widget.model.hasFollow = !isFollow;
setState(() {});
}
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 5.h),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: .3),
borderRadius: BorderRadius.circular(40)),
child: Row(
children: [
if (widget.model.hasFollow == true) ...[
Image.asset('collect_red.png'.commonImgPath, width: 16.w),
7.w.sizeBoxW,
],
Text(
widget.model.hasFollow == true ? '已关注' : '关注',
style: TextStyle(color: Colors.white, fontSize: 14),
)
],
),
),
),
],
),
),
);
}
}
/// 关注列表 - 博主项
class FollowBloggerItem extends StatefulWidget {
final FollowUserModel model;
const FollowBloggerItem(this.model, {super.key});
@override
State<FollowBloggerItem> createState() => _FollowBloggerItemState();
}
class _FollowBloggerItemState extends State<FollowBloggerItem> {
@override
Widget build(BuildContext context) {
return InkWell(
enableFeedback: false,
onTap: () {
pushToPersonCenter(widget.model.uid ?? 0);
},
child: Container(
padding: EdgeInsets.only(bottom: 18, left: 16, right: 16),
child: Row(
children: [
NetworkImageLoader(
imageUrl: widget.model.portrait ?? "",
width: 60,
height: 60,
borderRadius: 30,
),
SizedBox(width: 12),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
widget.model.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 16,
color: Color(0xE5FFFFFF),
fontWeight: FontWeight.w500,
),
),
6.sizeBoxH,
Row(
children: [
Flexible(
child: Text(
'${widget.model.totalWorks ?? 0} 作品',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12,
color: Color(0x8CFFFFFF),
fontWeight: FontWeight.w400),
),
),
SizedBox(width: 12),
Flexible(
child: Text(
'${widget.model.fans?.countStr} 粉丝',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12,
color: Color(0x8CFFFFFF),
fontWeight: FontWeight.w400),
),
),
],
)
],
),
),
SizedBox(width: 12),
Image.asset(
'arrow_right_grey.webp'.commonImgPath,
color: Color(0xffDCDCDC),
width: 24,
)
],
),
),
);
}
}
/// 关注列表 - 话题项
class FollowTopicItem extends StatefulWidget {
final TagsBean model;
const FollowTopicItem(this.model, {super.key});
@override
State<FollowTopicItem> createState() => _FollowTopicItemState();
}
class _FollowTopicItemState extends State<FollowTopicItem> {
@override
Widget build(BuildContext context) {
return InkWell(
enableFeedback: false,
onTap: () {
Get.to(() => CommunityTagDetailPage(model: widget.model));
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Stack(
alignment: Alignment.center,
children: [
NetworkImageLoader(
imageUrl: widget.model.coverImg ?? "",
width: double.infinity,
height: double.infinity,
borderRadius: 8,
),
Container(
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: .6),
borderRadius: BorderRadius.circular(8)),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"#${widget.model.name}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
Text(
'${widget.model.videoCount.countStr}个帖子',
style: TextStyle(color: Color(0xffcccccc), fontSize: 10),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
],
),
),
SizedBox(height: 12),
GestureDetector(
onTap: () async {
final isCollected = widget.model.hasCollected ?? false;
final res = await MineService.postCollect(
widget.model.id, "tag", !isCollected);
if (res) {
widget.model.hasCollected = !isCollected;
setState(() {});
}
},
child: Container(
width: 108,
height: 27,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFF68804),
borderRadius: BorderRadius.circular(6)),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
widget.model.hasCollected == true ? '已关注' : '关注',
style: TextStyle(color: Colors.white, fontSize: 14),
)
],
),
),
),
],
),
);
}
}