动态详情页交互功能增加游客登录判断
This commit is contained in:
@@ -423,12 +423,8 @@ fun PostScreen(
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.FOLLOW_USER)) {
|
||||
debouncedNavigation {
|
||||
debouncedNavigation {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
scope.launch {
|
||||
if (viewModel.moment?.followStatus == true) {
|
||||
@@ -450,17 +446,14 @@ fun PostScreen(
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.REPORT_CONTENT)) {
|
||||
debouncedNavigation {
|
||||
debouncedNavigation {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showReportDialog = true
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@@ -943,7 +936,13 @@ fun Header(
|
||||
.height(24.dp)
|
||||
.padding(end = 8.dp)
|
||||
.noRippleClickable {
|
||||
if(GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.REPORT_CONTENT)){
|
||||
debouncedNavigation{
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
}else {
|
||||
expanded = true
|
||||
}
|
||||
},
|
||||
painter = painterResource(id = R.drawable.rider_pro_more_horizon),
|
||||
contentDescription = "",
|
||||
@@ -1436,10 +1435,18 @@ fun CommentItem(
|
||||
AnimatedLikeIcon(
|
||||
liked = commentEntity.liked,
|
||||
onClick = {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.LIKE_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onLike(commentEntity)
|
||||
}
|
||||
},
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = commentEntity.likes.toString(),
|
||||
@@ -1468,18 +1475,22 @@ fun CommentItem(
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = AppColors.nonActiveText,
|
||||
modifier = Modifier.noRippleClickable {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.COMMENT_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onReply(
|
||||
commentEntity,
|
||||
commentEntity.replyUserId,
|
||||
commentEntity.replyUserNickname,
|
||||
commentEntity.replyUserAvatar
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
@@ -1538,6 +1549,8 @@ fun PostBottomBar(
|
||||
momentEntity: MomentEntity?
|
||||
) {
|
||||
val AppColors = LocalAppTheme.current
|
||||
val navController = LocalNavController.current
|
||||
val debouncedNavigation = rememberDebouncedNavigation()
|
||||
|
||||
Column(
|
||||
modifier = Modifier.background(
|
||||
@@ -1567,8 +1580,15 @@ fun PostBottomBar(
|
||||
.height(31.dp)
|
||||
.padding(8.dp)
|
||||
.noRippleClickable {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.COMMENT_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onCreateCommentClick()
|
||||
}
|
||||
}
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
@@ -1589,7 +1609,16 @@ fun PostBottomBar(
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
AnimatedLikeIcon(
|
||||
liked = momentEntity?.liked == true,
|
||||
onClick = onLikeClick,
|
||||
onClick = {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.LIKE_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onLikeClick()
|
||||
}
|
||||
},
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
@@ -1597,7 +1626,16 @@ fun PostBottomBar(
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
AnimatedFavouriteIcon(
|
||||
isFavourite = momentEntity?.isFavorite == true,
|
||||
onClick = onFavoriteClick,
|
||||
onClick = {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.LIKE_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onFavoriteClick()
|
||||
}
|
||||
},
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
@@ -1611,6 +1649,7 @@ fun PostBottomBar(
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
fun PostMenuModal(
|
||||
onDeleteClick: () -> Unit = {},
|
||||
@@ -1618,6 +1657,8 @@ fun PostMenuModal(
|
||||
userId: Int? = 0
|
||||
) {
|
||||
val AppColors = LocalAppTheme.current
|
||||
val navController = LocalNavController.current
|
||||
val debouncedNavigation = rememberDebouncedNavigation()
|
||||
|
||||
Row(
|
||||
modifier = Modifier
|
||||
@@ -1679,8 +1720,15 @@ fun PostMenuModal(
|
||||
modifier = Modifier
|
||||
.clip(CircleShape)
|
||||
.noRippleClickable {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.REPORT_CONTENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onReportClick()
|
||||
}
|
||||
}
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.rider_pro_moment_report),
|
||||
@@ -1705,6 +1753,7 @@ fun PostMenuModal(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
fun MenuActionItem(
|
||||
icon: Int? = null,
|
||||
@@ -1761,6 +1810,8 @@ fun CommentMenuModal(
|
||||
) {
|
||||
val clipboard = LocalClipboardManager.current
|
||||
val AppColors = LocalAppTheme.current
|
||||
val navController = LocalNavController.current
|
||||
val debouncedNavigation = rememberDebouncedNavigation()
|
||||
|
||||
fun copyToClipboard() {
|
||||
commentEntity?.let {
|
||||
@@ -1860,7 +1911,16 @@ fun CommentMenuModal(
|
||||
content = {
|
||||
AnimatedLikeIcon(
|
||||
liked = it.liked,
|
||||
onClick = onLikeClick,
|
||||
onClick = {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.LIKE_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onLikeClick()
|
||||
}
|
||||
},
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
}
|
||||
@@ -1874,14 +1934,23 @@ fun CommentMenuModal(
|
||||
icon = R.drawable.rider_pro_comment,
|
||||
text = stringResource(R.string.reply)
|
||||
) {
|
||||
// 检查游客模式,如果是游客则跳转登录
|
||||
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.COMMENT_MOMENT)) {
|
||||
debouncedNavigation {
|
||||
navController.navigate(NavigationRoute.Login.route)
|
||||
}
|
||||
} else {
|
||||
onReplyClick()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Composable
|
||||
fun OrderSelectionComponent(
|
||||
onSelected: (String) -> Unit = {}
|
||||
|
||||
Reference in New Issue
Block a user