Showing
16 changed files
with
188 additions
and
90 deletions
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | "app": { | 2 | "app": { |
| 3 | "bundleName": "com.peopledailychina.hosactivity", | 3 | "bundleName": "com.peopledailychina.hosactivity", |
| 4 | "vendor": "$string:app_vendor", | 4 | "vendor": "$string:app_vendor", |
| 5 | - "versionCode": 7397, | ||
| 6 | - "versionName": "7.3.9.7", | 5 | + "versionCode": 7398, |
| 6 | + "versionName": "7.3.9.8", | ||
| 7 | "icon": "$media:app_icon", | 7 | "icon": "$media:app_icon", |
| 8 | "label": "$string:app_name" | 8 | "label": "$string:app_name" |
| 9 | } | 9 | } |
| @@ -58,6 +58,10 @@ export class HttpUtils { | @@ -58,6 +58,10 @@ export class HttpUtils { | ||
| 58 | return SPHelper.default.getSync(SpConstants.USER_ID, "") as string | 58 | return SPHelper.default.getSync(SpConstants.USER_ID, "") as string |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | + public static getCreatorId(): string { | ||
| 62 | + return SPHelper.default.getSync(SpConstants.USER_CREATOR_ID, "") as string | ||
| 63 | + } | ||
| 64 | + | ||
| 61 | public static getUserType(): string { | 65 | public static getUserType(): string { |
| 62 | return SPHelper.default.getSync(SpConstants.USER_Type, "") as string | 66 | return SPHelper.default.getSync(SpConstants.USER_Type, "") as string |
| 63 | } | 67 | } |
| @@ -1042,30 +1042,32 @@ struct createImg { | @@ -1042,30 +1042,32 @@ struct createImg { | ||
| 1042 | 1042 | ||
| 1043 | @Builder | 1043 | @Builder |
| 1044 | longPicTip(weight: number, height: number) { | 1044 | longPicTip(weight: number, height: number) { |
| 1045 | - Flex({ direction: FlexDirection.Row }) { | ||
| 1046 | - Image($r('app.media.icon_long_pic')) | ||
| 1047 | - .width(12) | ||
| 1048 | - .height(12) | ||
| 1049 | - .margin({ right: 4 }) | ||
| 1050 | - Text('长图') | ||
| 1051 | - .fontSize(10) | ||
| 1052 | - .fontWeight(400) | ||
| 1053 | - .textShadow({ | ||
| 1054 | - radius: 1, | ||
| 1055 | - color: `rgba(0,0,0,0.5)`, | ||
| 1056 | - offsetY:1, | ||
| 1057 | - offsetX:1 | ||
| 1058 | - }) | ||
| 1059 | - .fontColor(0xffffff) | ||
| 1060 | - .fontFamily('PingFang SC') | ||
| 1061 | - .visibility( | ||
| 1062 | - weight / height > 2 || height / weight > 2 | ||
| 1063 | - ? Visibility.Visible : Visibility.None | ||
| 1064 | - ) | 1045 | + if (weight / height > 2 || height / weight > 2){ |
| 1046 | + Flex({ direction: FlexDirection.Row }) { | ||
| 1047 | + Image($r('app.media.icon_long_pic')) | ||
| 1048 | + .width(12) | ||
| 1049 | + .height(12) | ||
| 1050 | + .margin({ right: 4 }) | ||
| 1051 | + Text('长图') | ||
| 1052 | + .fontSize(10) | ||
| 1053 | + .fontWeight(400) | ||
| 1054 | + .textShadow({ | ||
| 1055 | + radius: 1, | ||
| 1056 | + color: `rgba(0,0,0,0.5)`, | ||
| 1057 | + offsetY:1, | ||
| 1058 | + offsetX:1 | ||
| 1059 | + }) | ||
| 1060 | + .fontColor(0xffffff) | ||
| 1061 | + .fontFamily('PingFang SC') | ||
| 1062 | + .visibility( | ||
| 1063 | + weight / height > 2 || height / weight > 2 | ||
| 1064 | + ? Visibility.Visible : Visibility.None | ||
| 1065 | + ) | ||
| 1066 | + } | ||
| 1067 | + .width(48) | ||
| 1068 | + .align(Alignment.BottomEnd) | ||
| 1069 | + .padding({ bottom: 8 }) | ||
| 1065 | } | 1070 | } |
| 1066 | - .width(48) | ||
| 1067 | - .align(Alignment.BottomEnd) | ||
| 1068 | - .padding({ bottom: 8 }) | ||
| 1069 | } | 1071 | } |
| 1070 | 1072 | ||
| 1071 | build() { | 1073 | build() { |
| @@ -339,7 +339,7 @@ export struct MorningEveningPaperComponent { | @@ -339,7 +339,7 @@ export struct MorningEveningPaperComponent { | ||
| 339 | compListItem: this.compListItem, | 339 | compListItem: this.compListItem, |
| 340 | }) | 340 | }) |
| 341 | .margin({ | 341 | .margin({ |
| 342 | - top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 0 : 44+this.topSafeHeight | 342 | + top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight |
| 343 | }) | 343 | }) |
| 344 | } | 344 | } |
| 345 | } | 345 | } |
| @@ -429,7 +429,7 @@ export struct MorningEveningPaperComponent { | @@ -429,7 +429,7 @@ export struct MorningEveningPaperComponent { | ||
| 429 | }) | 429 | }) |
| 430 | } | 430 | } |
| 431 | .margin({ left: 12, right: 12 }) | 431 | .margin({ left: 12, right: 12 }) |
| 432 | - .height(56) | 432 | + .height(36) |
| 433 | .alignItems(VerticalAlign.Center) | 433 | .alignItems(VerticalAlign.Center) |
| 434 | .justifyContent(FlexAlign.SpaceBetween) | 434 | .justifyContent(FlexAlign.SpaceBetween) |
| 435 | } | 435 | } |
| @@ -230,10 +230,10 @@ export struct MultiPictureDetailItemComponent { | @@ -230,10 +230,10 @@ export struct MultiPictureDetailItemComponent { | ||
| 230 | GestureGroup( | 230 | GestureGroup( |
| 231 | GestureMode.Exclusive, | 231 | GestureMode.Exclusive, |
| 232 | // 单击返回上一层 | 232 | // 单击返回上一层 |
| 233 | - TapGesture({ count: 1 }) | ||
| 234 | - .onAction(() => { | ||
| 235 | - router.back() | ||
| 236 | - }), | 233 | + // TapGesture({ count: 1 }) |
| 234 | + // .onAction(() => { | ||
| 235 | + // router.back() | ||
| 236 | + // }), | ||
| 237 | // TODO:知识点:双击切换图片大小 | 237 | // TODO:知识点:双击切换图片大小 |
| 238 | TapGesture({ count: 2 }) | 238 | TapGesture({ count: 2 }) |
| 239 | .onAction(() => { | 239 | .onAction(() => { |
| @@ -187,30 +187,32 @@ struct createImg { | @@ -187,30 +187,32 @@ struct createImg { | ||
| 187 | 187 | ||
| 188 | @Builder | 188 | @Builder |
| 189 | longPicTip(weight: number, height: number) { | 189 | longPicTip(weight: number, height: number) { |
| 190 | - // Flex({ direction: FlexDirection.Row }) { | ||
| 191 | - // Image($r('app.media.icon_long_pic')) | ||
| 192 | - // .width(12) | ||
| 193 | - // .height(12) | ||
| 194 | - // .margin({ right: 4 }) | ||
| 195 | - // Text('长图') | ||
| 196 | - // .fontSize(10) | ||
| 197 | - // .fontWeight(400) | ||
| 198 | - // .textShadow({ | ||
| 199 | - // radius: 1, | ||
| 200 | - // color: `rgba(0,0,0,0.5)`, | ||
| 201 | - // offsetY:1, | ||
| 202 | - // offsetX:1 | ||
| 203 | - // }) | ||
| 204 | - // .fontColor(0xffffff) | ||
| 205 | - // .fontFamily('PingFang SC') | ||
| 206 | - // .visibility( | ||
| 207 | - // weight / height > 2 || height / weight > 2 | ||
| 208 | - // ? Visibility.Visible : Visibility.None | ||
| 209 | - // ) | ||
| 210 | - // } | ||
| 211 | - // .width(48) | ||
| 212 | - // .align(Alignment.BottomEnd) | ||
| 213 | - // .padding({ bottom: 8 }) | 190 | + if (weight / height > 2 || height / weight > 2){ |
| 191 | + Flex({ direction: FlexDirection.Row }) { | ||
| 192 | + Image($r('app.media.icon_long_pic')) | ||
| 193 | + .width(12) | ||
| 194 | + .height(12) | ||
| 195 | + .margin({ right: 4 }) | ||
| 196 | + Text('长图') | ||
| 197 | + .fontSize(10) | ||
| 198 | + .fontWeight(400) | ||
| 199 | + .textShadow({ | ||
| 200 | + radius: 1, | ||
| 201 | + color: `rgba(0,0,0,0.5)`, | ||
| 202 | + offsetY:1, | ||
| 203 | + offsetX:1 | ||
| 204 | + }) | ||
| 205 | + .fontColor(0xffffff) | ||
| 206 | + .fontFamily('PingFang SC') | ||
| 207 | + .visibility( | ||
| 208 | + weight / height > 2 || height / weight > 2 | ||
| 209 | + ? Visibility.Visible : Visibility.None | ||
| 210 | + ) | ||
| 211 | + } | ||
| 212 | + .width(48) | ||
| 213 | + .align(Alignment.BottomEnd) | ||
| 214 | + .padding({ bottom: 8 }) | ||
| 215 | + } | ||
| 214 | } | 216 | } |
| 215 | 217 | ||
| 216 | build() { | 218 | build() { |
| @@ -151,6 +151,7 @@ export class commentStatusListModel extends PageModel { | @@ -151,6 +151,7 @@ export class commentStatusListModel extends PageModel { | ||
| 151 | @Observed | 151 | @Observed |
| 152 | export class commentStatusModel { | 152 | export class commentStatusModel { |
| 153 | commentId: string = ''; | 153 | commentId: string = ''; |
| 154 | + uuid: string = '' | ||
| 154 | status: boolean = false; | 155 | status: boolean = false; |
| 155 | level: string = ''; | 156 | level: string = ''; |
| 156 | levelHead: string = ''; | 157 | levelHead: string = ''; |
| @@ -874,13 +874,13 @@ struct commentFooterView { | @@ -874,13 +874,13 @@ struct commentFooterView { | ||
| 874 | } | 874 | } |
| 875 | } | 875 | } |
| 876 | 876 | ||
| 877 | - if (this.item.id) { // 审核通过的才显示点赞 | 877 | + // if (this.item.id) { // 审核通过的才显示点赞 |
| 878 | Row({ space: 6 }) { | 878 | Row({ space: 6 }) { |
| 879 | - Text(this.item.likeNum) | ||
| 880 | - .fontColor(this.item.api_status?$r('app.color.color_ED2800') : $r('app.color.color_666666')) | 879 | + Text(this.item.likeNum + "") |
| 880 | + .fontColor(this.item.api_status == true ?$r('app.color.color_ED2800') : $r('app.color.color_666666')) | ||
| 881 | .fontSize(14) | 881 | .fontSize(14) |
| 882 | 882 | ||
| 883 | - Image(this.item.api_status ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal')) | 883 | + Image(this.item.api_status == true ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal')) |
| 884 | .size({ | 884 | .size({ |
| 885 | width: 16, | 885 | width: 16, |
| 886 | height: 16 | 886 | height: 16 |
| @@ -890,7 +890,7 @@ struct commentFooterView { | @@ -890,7 +890,7 @@ struct commentFooterView { | ||
| 890 | .onClick(() => { | 890 | .onClick(() => { |
| 891 | this.clickLike() | 891 | this.clickLike() |
| 892 | }) | 892 | }) |
| 893 | - } | 893 | + // } |
| 894 | } | 894 | } |
| 895 | // .alignItems(VerticalAlign.Bottom) | 895 | // .alignItems(VerticalAlign.Bottom) |
| 896 | .justifyContent(FlexAlign.SpaceBetween) | 896 | .justifyContent(FlexAlign.SpaceBetween) |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| 1 | import { ViewType } from 'wdConstant/Index' | 1 | import { ViewType } from 'wdConstant/Index' |
| 2 | -import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index' | 2 | +import { DateTimeUtils, LazyDataSource, Logger, NumberFormatterUtils, ToastUtils, WindowModel } from 'wdKit/Index' |
| 3 | import { commentItemModel } from '../model/CommentModel' | 3 | import { commentItemModel } from '../model/CommentModel' |
| 4 | import commentViewModel from '../viewmodel/CommentViewModel' | 4 | import commentViewModel from '../viewmodel/CommentViewModel' |
| 5 | import { router, window } from '@kit.ArkUI' | 5 | import { router, window } from '@kit.ArkUI' |
| @@ -387,6 +387,12 @@ struct QualityCommentItem { | @@ -387,6 +387,12 @@ struct QualityCommentItem { | ||
| 387 | Row({ space: 16 }) { | 387 | Row({ space: 16 }) { |
| 388 | Row() { | 388 | Row() { |
| 389 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | 389 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) |
| 390 | + if (this.item.replyNum && this.item.replyNum.length > 0 && this.item.replyNum != '0') { | ||
| 391 | + Text(NumberFormatterUtils.formatNumberWithWan(this.item.replyNum)) | ||
| 392 | + .fontSize(14) | ||
| 393 | + .fontColor('#999999') | ||
| 394 | + .margin({ left: 3 }) | ||
| 395 | + } | ||
| 390 | }.height('100%') | 396 | }.height('100%') |
| 391 | .onClick(() => { | 397 | .onClick(() => { |
| 392 | this.replyComment() | 398 | this.replyComment() |
| @@ -54,7 +54,7 @@ class CommentViewModel { | @@ -54,7 +54,7 @@ class CommentViewModel { | ||
| 54 | return | 54 | return |
| 55 | } | 55 | } |
| 56 | let listData = data.data as commentListModel | 56 | let listData = data.data as commentListModel |
| 57 | - this.fetchCommentStatusAndConfigAuthIcon(listData, false).then((commentListModel) => { | 57 | + this.fetchCommentStatusAndConfigAuthIcon(listData, false, contentId).then((commentListModel) => { |
| 58 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') | 58 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') |
| 59 | 59 | ||
| 60 | if (pageNum !== "1") { | 60 | if (pageNum !== "1") { |
| @@ -63,7 +63,7 @@ class CommentViewModel { | @@ -63,7 +63,7 @@ class CommentViewModel { | ||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | // 热门评论批查 | 65 | // 热门评论批查 |
| 66 | - this.fetchCommentStatusAndConfigAuthIcon(listData, true).then((commentListModel) => { | 66 | + this.fetchCommentStatusAndConfigAuthIcon(listData, true, contentId).then((commentListModel) => { |
| 67 | console.log(TAG, 'hot comment fetchCommentStatusAndConfigAuthIcon完成') | 67 | console.log(TAG, 'hot comment fetchCommentStatusAndConfigAuthIcon完成') |
| 68 | 68 | ||
| 69 | listData.hotList.forEach((item) => { | 69 | listData.hotList.forEach((item) => { |
| @@ -101,7 +101,7 @@ class CommentViewModel { | @@ -101,7 +101,7 @@ class CommentViewModel { | ||
| 101 | 101 | ||
| 102 | // success(listData) | 102 | // success(listData) |
| 103 | 103 | ||
| 104 | - this.fetchCommentStatusAndConfigAuthIcon(listData).then((commentListModel) => { | 104 | + this.fetchCommentStatusAndConfigAuthIcon(listData, false, contentId).then((commentListModel) => { |
| 105 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') | 105 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') |
| 106 | success(commentListModel) | 106 | success(commentListModel) |
| 107 | }) | 107 | }) |
| @@ -160,7 +160,8 @@ class CommentViewModel { | @@ -160,7 +160,8 @@ class CommentViewModel { | ||
| 160 | // userHeaderUrl string | 160 | // userHeaderUrl string |
| 161 | // 【迭代二新增】当前用户的头像url | 161 | // 【迭代二新增】当前用户的头像url |
| 162 | 162 | ||
| 163 | - bean['commentId'] = model.id; | 163 | + bean['commentId'] = (model.id + "").length > 0 ? (model.id + "") : "0"; |
| 164 | + bean['uuid'] = model.uuid; | ||
| 164 | bean['targetId'] = model.targetId; | 165 | bean['targetId'] = model.targetId; |
| 165 | bean['targetType'] = model.targetType; | 166 | bean['targetType'] = model.targetType; |
| 166 | bean['status'] = model.api_status ? '1' : '0'; | 167 | bean['status'] = model.api_status ? '1' : '0'; |
| @@ -207,14 +208,14 @@ class CommentViewModel { | @@ -207,14 +208,14 @@ class CommentViewModel { | ||
| 207 | bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string | 208 | bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string |
| 208 | } | 209 | } |
| 209 | 210 | ||
| 210 | - HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { | 211 | + HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then(async (data: ResponseDTO<commentItemModel>) => { |
| 211 | if (data.code != 0) { | 212 | if (data.code != 0) { |
| 212 | ToastUtils.showToast(data.message, 1000); | 213 | ToastUtils.showToast(data.message, 1000); |
| 213 | fail() | 214 | fail() |
| 214 | return | 215 | return |
| 215 | } | 216 | } |
| 216 | ToastUtils.showToast(data.message, 1000); | 217 | ToastUtils.showToast(data.message, 1000); |
| 217 | - let model = data.data as commentItemModel | 218 | + let comment = data.data as commentItemModel |
| 218 | 219 | ||
| 219 | let firstCommentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') as string | 220 | let firstCommentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') as string |
| 220 | 221 | ||
| @@ -222,7 +223,15 @@ class CommentViewModel { | @@ -222,7 +223,15 @@ class CommentViewModel { | ||
| 222 | //保存首次评论时间 | 223 | //保存首次评论时间 |
| 223 | SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | 224 | SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 224 | } | 225 | } |
| 225 | - success(model) | 226 | + |
| 227 | + comment.targetId = model.targetId | ||
| 228 | + comment.targetRelId = model.targetRelId | ||
| 229 | + comment.targetRelType = model.targetRelType | ||
| 230 | + comment.targetType = model.targetType | ||
| 231 | + comment.targetRelObjectId = model.targetRelObjectId | ||
| 232 | + await this.fetchCurrentUserAuthIcons(comment) | ||
| 233 | + let newModel = commentViewModel.deepCopyCommentItemModel(comment) | ||
| 234 | + success(newModel) | ||
| 226 | }, (error: Error) => { | 235 | }, (error: Error) => { |
| 227 | ToastUtils.showToast('评论失败', 1000); | 236 | ToastUtils.showToast('评论失败', 1000); |
| 228 | fail() | 237 | fail() |
| @@ -231,10 +240,32 @@ class CommentViewModel { | @@ -231,10 +240,32 @@ class CommentViewModel { | ||
| 231 | }) | 240 | }) |
| 232 | } | 241 | } |
| 233 | 242 | ||
| 243 | + async fetchCurrentUserAuthIcons(model: commentItemModel) { | ||
| 244 | + if (false == HttpUtils.isLogin()) { | ||
| 245 | + return | ||
| 246 | + } | ||
| 247 | + if (HttpUtils.getUserType() == "1") { // 普通用户 | ||
| 248 | + let fromUserIDs = [HttpUtils.getUserId()]; | ||
| 249 | + const response = await HttpRequest.post<ResponseDTO<commentStatusModel[]>>(HttpUrlUtils.getBatchUserUrl(), fromUserIDs) | ||
| 250 | + if (response && response.data && response.data.length > 0) { | ||
| 251 | + model.api_levelHead = response.data[0].levelHead | ||
| 252 | + } | ||
| 253 | + } else { // 创作者 | ||
| 254 | + let bean: Record<string, string[]> = {"creatorIdList": [HttpUtils.getCreatorId()]}; | ||
| 255 | + const response = await HttpRequest.post<ResponseDTO<commentStatusModel[]>>(HttpUrlUtils.getDetailListUrl(), bean) | ||
| 256 | + if (response && response.data && response.data.length > 0) { | ||
| 257 | + model.api_authIcon = response.data[0].authIcon | ||
| 258 | + } | ||
| 259 | + } | ||
| 260 | + } | ||
| 261 | + | ||
| 234 | /*多接口批查*/ | 262 | /*多接口批查*/ |
| 235 | - fetchCommentStatusAndConfigAuthIcon(model: commentListModel, hot: boolean = false): Promise<commentListModel> { | 263 | + // hot 表示是否批查热门评论 |
| 264 | + // targetId 是指针对某一篇稿件的评论场景 | ||
| 265 | + fetchCommentStatusAndConfigAuthIcon(model: commentListModel, hot: boolean = false, targetId?: string): Promise<commentListModel> { | ||
| 236 | 266 | ||
| 237 | let commentIDs: string[] = []; | 267 | let commentIDs: string[] = []; |
| 268 | + let uuidIDs: string[] = []; | ||
| 238 | 269 | ||
| 239 | let fromUserIDs: string[] = []; | 270 | let fromUserIDs: string[] = []; |
| 240 | 271 | ||
| @@ -242,8 +273,10 @@ class CommentViewModel { | @@ -242,8 +273,10 @@ class CommentViewModel { | ||
| 242 | 273 | ||
| 243 | //主评论 | 274 | //主评论 |
| 244 | for (const element of (hot ? model.hotList : model.list)) { | 275 | for (const element of (hot ? model.hotList : model.list)) { |
| 245 | - if ((element.id + '').length > 0) { | 276 | + if ((element.id + '').length > 0 && (element.id + "") != "0") { |
| 246 | commentIDs.push(element.id + '') | 277 | commentIDs.push(element.id + '') |
| 278 | + } else { | ||
| 279 | + uuidIDs.push(element.uuid) | ||
| 247 | } | 280 | } |
| 248 | if ((element.fromUserId + '').length > 0) { | 281 | if ((element.fromUserId + '').length > 0) { |
| 249 | fromUserIDs.push(element.fromUserId) | 282 | fromUserIDs.push(element.fromUserId) |
| @@ -256,8 +289,10 @@ class CommentViewModel { | @@ -256,8 +289,10 @@ class CommentViewModel { | ||
| 256 | //子评论 | 289 | //子评论 |
| 257 | if (element.childComments) { | 290 | if (element.childComments) { |
| 258 | for (const obj2 of element.childComments) { | 291 | for (const obj2 of element.childComments) { |
| 259 | - if ((obj2.id + '').length > 0) { | 292 | + if ((obj2.id + '').length > 0 && (obj2.id + "") != "0") { |
| 260 | commentIDs.push(obj2.id + '') | 293 | commentIDs.push(obj2.id + '') |
| 294 | + } else { | ||
| 295 | + uuidIDs.push(obj2.uuid) | ||
| 261 | } | 296 | } |
| 262 | if ((obj2.fromUserId + '').length > 0) { | 297 | if ((obj2.fromUserId + '').length > 0) { |
| 263 | fromUserIDs.push(obj2.fromUserId) | 298 | fromUserIDs.push(obj2.fromUserId) |
| @@ -278,8 +313,10 @@ class CommentViewModel { | @@ -278,8 +313,10 @@ class CommentViewModel { | ||
| 278 | let promise1 = new Promise<void>((success) => { | 313 | let promise1 = new Promise<void>((success) => { |
| 279 | // HttpRequest HttpBizUtil | 314 | // HttpRequest HttpBizUtil |
| 280 | let url = HttpUrlUtils.getBatchCommentStatusUrl(); | 315 | let url = HttpUrlUtils.getBatchCommentStatusUrl(); |
| 281 | - let bean: Record<string, string[]> = {}; | 316 | + let bean: Record<string, string | string[]> = {}; |
| 282 | bean['commentIdList'] = commentIDs; | 317 | bean['commentIdList'] = commentIDs; |
| 318 | + bean['targetId'] = targetId ?? "" | ||
| 319 | + bean['uuidList'] = uuidIDs | ||
| 283 | HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => { | 320 | HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => { |
| 284 | if (!data || !data.data) { | 321 | if (!data || !data.data) { |
| 285 | success() | 322 | success() |
| @@ -297,13 +334,25 @@ class CommentViewModel { | @@ -297,13 +334,25 @@ class CommentViewModel { | ||
| 297 | //点赞 | 334 | //点赞 |
| 298 | for (const element of listData) { | 335 | for (const element of listData) { |
| 299 | for (const commentModel of (hot ? model.hotList : model.list)) { | 336 | for (const commentModel of (hot ? model.hotList : model.list)) { |
| 300 | - if (element.commentId == commentModel.id) { | ||
| 301 | - commentModel.api_status = element.status | 337 | + if ((commentModel.id + '').length > 0 && (commentModel.id + "") != "0") { |
| 338 | + if (element.commentId == commentModel.id) { | ||
| 339 | + commentModel.api_status = element.status | ||
| 340 | + } | ||
| 341 | + } else { | ||
| 342 | + if (element.uuid == commentModel.uuid) { | ||
| 343 | + commentModel.api_status = element.status | ||
| 344 | + } | ||
| 302 | } | 345 | } |
| 303 | if (commentModel.childComments) { | 346 | if (commentModel.childComments) { |
| 304 | for (const childCommentModel of commentModel.childComments) { | 347 | for (const childCommentModel of commentModel.childComments) { |
| 305 | - if (element.commentId == childCommentModel.id) { | ||
| 306 | - childCommentModel.api_status = element.status | 348 | + if ((childCommentModel.id + '').length > 0 && (childCommentModel.id + "") != "0") { |
| 349 | + if (element.commentId == childCommentModel.id) { | ||
| 350 | + childCommentModel.api_status = element.status | ||
| 351 | + } | ||
| 352 | + } else { | ||
| 353 | + if (element.uuid == childCommentModel.uuid) { | ||
| 354 | + childCommentModel.api_status = element.status | ||
| 355 | + } | ||
| 307 | } | 356 | } |
| 308 | } | 357 | } |
| 309 | } | 358 | } |
| @@ -421,7 +470,7 @@ class CommentViewModel { | @@ -421,7 +470,7 @@ class CommentViewModel { | ||
| 421 | 470 | ||
| 422 | newModel.api_customType = model.api_customType | 471 | newModel.api_customType = model.api_customType |
| 423 | newModel.authorLike = model.authorLike | 472 | newModel.authorLike = model.authorLike |
| 424 | - newModel.avatarFrame = model.avatarFrame | 473 | + newModel.avatarFrame = model.avatarFrame ?? "" |
| 425 | newModel.checkStatus = model.checkStatus | 474 | newModel.checkStatus = model.checkStatus |
| 426 | newModel.childCommentNum = model.childCommentNum | 475 | newModel.childCommentNum = model.childCommentNum |
| 427 | newModel.childComments = model.childComments | 476 | newModel.childComments = model.childComments |
| @@ -455,7 +504,7 @@ class CommentViewModel { | @@ -455,7 +504,7 @@ class CommentViewModel { | ||
| 455 | newModel.mySelf = model.mySelf | 504 | newModel.mySelf = model.mySelf |
| 456 | newModel.parentId = model.parentId | 505 | newModel.parentId = model.parentId |
| 457 | newModel.region = model.region | 506 | newModel.region = model.region |
| 458 | - newModel.replyNum = model.replyNum | 507 | + newModel.replyNum = model.replyNum + "" |
| 459 | newModel.rootCommentId = model.rootCommentId | 508 | newModel.rootCommentId = model.rootCommentId |
| 460 | newModel.sensitiveExist = model.sensitiveExist | 509 | newModel.sensitiveExist = model.sensitiveExist |
| 461 | newModel.sensitiveShow = model.sensitiveShow | 510 | newModel.sensitiveShow = model.sensitiveShow |
| @@ -46,6 +46,7 @@ export struct ZhSingleRow03 { | @@ -46,6 +46,7 @@ export struct ZhSingleRow03 { | ||
| 46 | @State moreWidth:number = 22 | 46 | @State moreWidth:number = 22 |
| 47 | @State moreTips: string = '' | 47 | @State moreTips: string = '' |
| 48 | scroller: Scroller = new Scroller() | 48 | scroller: Scroller = new Scroller() |
| 49 | + @Consume @Watch('pageShowForUpdateData') pageShow :number | ||
| 49 | 50 | ||
| 50 | resetMoreTips() { | 51 | resetMoreTips() { |
| 51 | console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | 52 | console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) |
| @@ -89,7 +90,7 @@ export struct ZhSingleRow03 { | @@ -89,7 +90,7 @@ export struct ZhSingleRow03 { | ||
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | async aboutToAppear(): Promise<void> { | 92 | async aboutToAppear(): Promise<void> { |
| 92 | - if (HttpUtils.getUserId()) { | 93 | + if (HttpUtils.isLogin()) { |
| 93 | this.getReserveState(); | 94 | this.getReserveState(); |
| 94 | } | 95 | } |
| 95 | this.loadImg = await onlyWifiLoadImg(); | 96 | this.loadImg = await onlyWifiLoadImg(); |
| @@ -118,11 +119,23 @@ export struct ZhSingleRow03 { | @@ -118,11 +119,23 @@ export struct ZhSingleRow03 { | ||
| 118 | } | 119 | } |
| 119 | } | 120 | } |
| 120 | }) | 121 | }) |
| 122 | + | ||
| 123 | + // 可能有被动强制退出清空 | ||
| 124 | + EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | ||
| 125 | + this.getReserveState() | ||
| 126 | + }) | ||
| 121 | } | 127 | } |
| 122 | 128 | ||
| 129 | + pageShowForUpdateData() { | ||
| 130 | + this.getReserveState() | ||
| 131 | + } | ||
| 123 | 132 | ||
| 124 | // 请求所有预约状态 | 133 | // 请求所有预约状态 |
| 125 | async getReserveState() { | 134 | async getReserveState() { |
| 135 | + if (false == HttpUtils.isLogin()) { | ||
| 136 | + this.reservedIds = [] | ||
| 137 | + return | ||
| 138 | + } | ||
| 126 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { | 139 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { |
| 127 | const reqItem: reserveReqItem = { | 140 | const reqItem: reserveReqItem = { |
| 128 | liveId: item.objectId.toString(), | 141 | liveId: item.objectId.toString(), |
| @@ -443,8 +443,8 @@ export struct PaperSingleColumn999CardView { | @@ -443,8 +443,8 @@ export struct PaperSingleColumn999CardView { | ||
| 443 | Stack({ alignContent: Alignment.BottomEnd }) { | 443 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 444 | Image(this.item?.coverUrl) | 444 | Image(this.item?.coverUrl) |
| 445 | .borderRadius(5) | 445 | .borderRadius(5) |
| 446 | - .objectFit(ImageFit.Cover) | ||
| 447 | - .aspectRatio(319 / 200) ///图片设计比例 | 446 | + .objectFit(ImageFit.Fill) |
| 447 | + .aspectRatio(319 / 179) ///图片设计比例 | ||
| 448 | .padding({ top: 10 }) | 448 | .padding({ top: 10 }) |
| 449 | //视频 | 449 | //视频 |
| 450 | if (this.item?.videoInfo) { | 450 | if (this.item?.videoInfo) { |
| @@ -490,7 +490,7 @@ export struct PaperSingleColumn999CardView { | @@ -490,7 +490,7 @@ export struct PaperSingleColumn999CardView { | ||
| 490 | // autoplay: true, | 490 | // autoplay: true, |
| 491 | // loop: true, | 491 | // loop: true, |
| 492 | // }) | 492 | // }) |
| 493 | - | 493 | + |
| 494 | Text(this.buildLiveStateString()) | 494 | Text(this.buildLiveStateString()) |
| 495 | .fontColor(Color.White) | 495 | .fontColor(Color.White) |
| 496 | .fontSize($r('app.float.vp_12')) | 496 | .fontSize($r('app.float.vp_12')) |
| @@ -178,10 +178,10 @@ export struct TopNavigationComponentNew { | @@ -178,10 +178,10 @@ export struct TopNavigationComponentNew { | ||
| 178 | // left: 6, | 178 | // left: 6, |
| 179 | // right: 6 | 179 | // right: 6 |
| 180 | // }) | 180 | // }) |
| 181 | - .borderRadius({ | ||
| 182 | - topLeft: 6, | ||
| 183 | - topRight: 6 | ||
| 184 | - }) | 181 | + // .borderRadius({ |
| 182 | + // topLeft: 6, | ||
| 183 | + // topRight: 6 | ||
| 184 | + // }) | ||
| 185 | .backgroundColor(CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent) | 185 | .backgroundColor(CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent) |
| 186 | } | 186 | } |
| 187 | 187 |
| @@ -113,6 +113,16 @@ export struct MultiPictureListPage { | @@ -113,6 +113,16 @@ export struct MultiPictureListPage { | ||
| 113 | this.swiperIndex = targetIndex | 113 | this.swiperIndex = targetIndex |
| 114 | this.currentUrl = this.photoList[targetIndex]?.picPath | 114 | this.currentUrl = this.photoList[targetIndex]?.picPath |
| 115 | }) | 115 | }) |
| 116 | + .gesture( | ||
| 117 | + GestureGroup( | ||
| 118 | + GestureMode.Exclusive, | ||
| 119 | + // 单击返回上一层 | ||
| 120 | + TapGesture({ count: 1 }) | ||
| 121 | + .onAction(() => { | ||
| 122 | + router.back() | ||
| 123 | + }) | ||
| 124 | + ) | ||
| 125 | + ) | ||
| 116 | 126 | ||
| 117 | Flex({ | 127 | Flex({ |
| 118 | direction: FlexDirection.Row, | 128 | direction: FlexDirection.Row, |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | }, | 14 | }, |
| 15 | { | 15 | { |
| 16 | "name": "play_track_color", | 16 | "name": "play_track_color", |
| 17 | - "value": "#1AFFFFFF" | 17 | + "value": "#33FFFFFF" |
| 18 | }, | 18 | }, |
| 19 | { | 19 | { |
| 20 | "name": "play_selected_color", | 20 | "name": "play_selected_color", |
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | }, | 26 | }, |
| 27 | { | 27 | { |
| 28 | "name": "pause_track_color", | 28 | "name": "pause_track_color", |
| 29 | - "value": "#1AFFFFFF" | 29 | + "value": "#33FFFFFF" |
| 30 | }, | 30 | }, |
| 31 | { | 31 | { |
| 32 | "name": "pause_selected_color", | 32 | "name": "pause_selected_color", |
| @@ -49,6 +49,10 @@ struct Index { | @@ -49,6 +49,10 @@ struct Index { | ||
| 49 | 49 | ||
| 50 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_TITLe, (val:string | undefined) => { | 50 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_TITLe, (val:string | undefined) => { |
| 51 | this.audioTitle = val | 51 | this.audioTitle = val |
| 52 | + // 播放稿件修改时进度条清零 | ||
| 53 | + this.progressVal = 0 | ||
| 54 | + this.currentTime = '00:00' | ||
| 55 | + this.totalTime = '00:00' | ||
| 52 | }) | 56 | }) |
| 53 | 57 | ||
| 54 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | 58 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { |
| @@ -98,13 +102,20 @@ struct Index { | @@ -98,13 +102,20 @@ struct Index { | ||
| 98 | 102 | ||
| 99 | build() { | 103 | build() { |
| 100 | Stack({ alignContent: Alignment.End }) { | 104 | Stack({ alignContent: Alignment.End }) { |
| 101 | - Progress({ value: 0, total: 100, type: ProgressType.Linear }) | 105 | + Progress( |
| 106 | + { | ||
| 107 | + value: this.progressVal, | ||
| 108 | + total: 100, | ||
| 109 | + type: ProgressType.Linear, | ||
| 110 | + }) | ||
| 111 | + .style({ | ||
| 112 | + enableSmoothEffect: false | ||
| 113 | + }) | ||
| 102 | .color("#ED2800") | 114 | .color("#ED2800") |
| 103 | .backgroundColor($r('app.color.white')) | 115 | .backgroundColor($r('app.color.white')) |
| 104 | .width("100%") | 116 | .width("100%") |
| 105 | .height(3) | 117 | .height(3) |
| 106 | .margin({ top: 57 }) | 118 | .margin({ top: 57 }) |
| 107 | - .value(this.progressVal) | ||
| 108 | .visibility(this.isExpand ? Visibility.Visible : Visibility.Hidden) | 119 | .visibility(this.isExpand ? Visibility.Visible : Visibility.Hidden) |
| 109 | Stack({ alignContent: Alignment.End }) { | 120 | Stack({ alignContent: Alignment.End }) { |
| 110 | Column() { //标题 时间 进度条 | 121 | Column() { //标题 时间 进度条 |
-
Please register or login to post a comment