细节修改

This commit is contained in:
Seven Tsui 2025-09-17 11:51:54 +08:00
parent 81e386b038
commit bda045eb9e
4 changed files with 44 additions and 3 deletions

View File

@ -314,7 +314,7 @@ class _IndexPageState extends State<IndexPage> with SingleTickerProviderStateMix
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset('assets/images/empty.png', width: 100),
Image.asset('assets/images/empty.png', width: 50, height: 50),
const SizedBox(height: 8),
Text(
text,

View File

@ -6,6 +6,8 @@ import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
import 'package:loopin/IM/controller/im_user_info_controller.dart';
import 'package:loopin/IM/im_service.dart';
import 'package:loopin/api/video_api.dart';
import 'package:loopin/api/common_api.dart';
import 'package:loopin/utils/index.dart';
import 'package:loopin/components/custom_sticky_header.dart';
import 'package:loopin/components/my_confirm.dart';
import 'package:loopin/components/network_or_asset_image.dart';
@ -81,6 +83,7 @@ class MyPageState extends State<MyPage> with SingleTickerProviderStateMixin {
late Callback tabListener;
late Callback scrollListener;
late int vlogLikeCount = 0; //
RxBool isPinned = false.obs; //
@ -114,7 +117,7 @@ class MyPageState extends State<MyPage> with SingleTickerProviderStateMixin {
}
};
tabController.addListener(tabListener);
getUserLikesCount();
// loadData(0);
}
@ -128,6 +131,19 @@ class MyPageState extends State<MyPage> with SingleTickerProviderStateMixin {
super.dispose();
}
//
void getUserLikesCount() async {
try {
final resData = await Http.get(CommonApi.accountInfo);
if(resData != null && resData['code'] == 200){
vlogLikeCount = resData['data']['vlogLikeCount']??0;
}
} catch (e) {
}
}
//
void scrollInnerList([double? offset]) async {
if (isPinned.value) {
@ -802,7 +818,8 @@ class MyPageState extends State<MyPage> with SingleTickerProviderStateMixin {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(children: [Text('9999', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), SizedBox(height: 3.0), Text('获赞')]),
// '已售${Utils.graceNumber(int.tryParse(vlogLikeCount?.toString() ?? '0') ?? 0)}',
Column(children: [Text('${Utils.graceNumber(vlogLikeCount)}', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), SizedBox(height: 3.0), Text('获赞')]),
GestureDetector(
onTap: () async {
//

View File

@ -3,11 +3,13 @@ library;
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:loopin/utils/common.dart';
import '../../IM/im_core.dart';
import '../../behavior/custom_scroll_behavior.dart';
import '../../components/keepalive_wrapper.dart';
import '../../controller/video_module_controller.dart';
import './module/attention.dart';
// import './module/browse.dart';
// import './module/buying.dart';
@ -114,6 +116,11 @@ class _VideoPageState extends State<VideoPage> with SingleTickerProviderStateMix
labelPadding: const EdgeInsets.symmetric(horizontal: 10.0),
indicatorPadding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 4.0),
onTap: (index) {
// tabtab都校验登录状态
if (!Common.isLogin() && index != 2) {
Get.toNamed('/login');
return;
}
//
videoModuleController.updateVideoTabIndex(index);
pageController.jumpToPage(index);

View File

@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:loopin/utils/common.dart';
import 'package:loopin/IM/controller/chat_controller.dart';
import 'package:loopin/IM/controller/im_user_info_controller.dart';
import 'package:loopin/IM/im_core.dart';
@ -1170,6 +1171,10 @@ class _RecommendModuleState extends State<RecommendModule> {
),
),
onTap: () async {
if (!Common.isLogin()) {
Get.toNamed('/login');
return;
}
final vlogerId = videoList[index]['memberId'];
final doIFollowVloger = videoList[index]['doIFollowVloger'];
//
@ -1203,6 +1208,10 @@ class _RecommendModuleState extends State<RecommendModule> {
),
onTap: () {
logger.d('点击了点赞按钮${videoList[index]['doILikeThisVlog']}');
if (!Common.isLogin()) {
Get.toNamed('/login');
return;
}
if (videoList[index]['doILikeThisVlog'] == true) {
logger.d('点击了点赞按钮${videoList[index]['doILikeThisVlog']}');
doUnLikeVideo(videoList[index]);
@ -1227,6 +1236,10 @@ class _RecommendModuleState extends State<RecommendModule> {
],
),
onTap: () {
if (!Common.isLogin()) {
Get.toNamed('/login');
return;
}
handleComment(index);
},
),
@ -1242,6 +1255,10 @@ class _RecommendModuleState extends State<RecommendModule> {
],
),
onTap: () {
if (!Common.isLogin()) {
Get.toNamed('/login');
return;
}
handleShare(index);
},
),