Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (21 commits) ref |> 增加刚发的评论可以点赞 ref |> 更新App版本号+1 ref |> 临时注掉掉图集点击图片手势逻辑 fix: 人民号频道换肤,内容区不应展示圆角,见截图 fix |> 【功能】稿件详情发送评论,评论列表用户头像缺少等级外框 fix: 视频暂停播放,未播放的进度条颜色很暗 fix: 音频稿件A音频播放时切换到另一稿件播放音频,播放悬浮窗会先展示一下稿件A的音频播放进度。 fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级 fix: 视频详情页,说两句输入框,要和进度条右对齐 ref |> 更新profile 增加设备 ref |> 调整早晚报和桌面组件数据和加载逻辑 fix |> 点击已关注号主的动态图文内容下方评论按钮,进入动态详情页,应锚定评论区 ref |> 增加评论长按手势识别 fix: 20235 【uat】 大图卡回看观看人数andriod 显示26万,鸿蒙显示25.9万人参加 fix: 个人评论列表,点击已评论视频,进入视频详情页,未弹出评论弹窗。 fix: 20529 【生产环境】人民号,分割线比较粗 fix: 20529 【生产环境】人民号,分割线比较粗 fix: 20510 号主页,切换到动态tab,发稿日期没有显示年份,日期错误。 fix: 人民号>动态图文详情页,点击图片查看大图,点击图片应返回动态详情页 fix: 219887 设置仅wifi加载图片控制,4G网络下,频道信息流页面缺省图缺少边框,见截图 ...
Showing
42 changed files
with
309 additions
and
163 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 | } |
| @@ -189,12 +189,12 @@ export class ProcessUtils { | @@ -189,12 +189,12 @@ export class ProcessUtils { | ||
| 189 | if (typeof type == "number") { | 189 | if (typeof type == "number") { |
| 190 | type = `${type}` | 190 | type = `${type}` |
| 191 | } | 191 | } |
| 192 | - // Logger.debug(TAG, `objectType, ${JSON.stringify(content)}`); | 192 | + // console.log(TAG, `DetailVideoListPage objectType, ${JSON.stringify(content)}`); |
| 193 | switch (type) { | 193 | switch (type) { |
| 194 | case ContentConstants.TYPE_NONE: | 194 | case ContentConstants.TYPE_NONE: |
| 195 | // Logger.debug(TAG, "processPage, do nothing"); | 195 | // Logger.debug(TAG, "processPage, do nothing"); |
| 196 | break; | 196 | break; |
| 197 | - case ContentConstants.TYPE_VOD: | 197 | + case ContentConstants.TYPE_VOD: // 视频详情 |
| 198 | // Logger.debug(TAG, "processPage, nonsupport!!!"); | 198 | // Logger.debug(TAG, "processPage, nonsupport!!!"); |
| 199 | ProcessUtils.gotoVod(content) | 199 | ProcessUtils.gotoVod(content) |
| 200 | break; | 200 | break; |
| @@ -282,7 +282,7 @@ export class ProcessUtils { | @@ -282,7 +282,7 @@ export class ProcessUtils { | ||
| 282 | } as Params, | 282 | } as Params, |
| 283 | }; | 283 | }; |
| 284 | WDRouterRule.jumpWithAction(taskAction) | 284 | WDRouterRule.jumpWithAction(taskAction) |
| 285 | - Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`); | 285 | + // Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | /** | 288 | /** |
| @@ -399,22 +399,6 @@ export class ProcessUtils { | @@ -399,22 +399,6 @@ export class ProcessUtils { | ||
| 399 | return | 399 | return |
| 400 | } | 400 | } |
| 401 | ProcessUtils.processPage(contentBean) | 401 | ProcessUtils.processPage(contentBean) |
| 402 | - // let taskAction: Action = { | ||
| 403 | - // type: 'JUMP_INNER_NEW_PAGE', | ||
| 404 | - // params: { | ||
| 405 | - // contentID: content?.newsId, | ||
| 406 | - // url:content?.linkUrl, | ||
| 407 | - // pageID: 'IMAGE_TEXT_DETAIL', | ||
| 408 | - // extra: { | ||
| 409 | - // relType: content?.relType, | ||
| 410 | - // relId: content?.relId, | ||
| 411 | - // sourcePage: '5', | ||
| 412 | - // commentId: content?.commentId | ||
| 413 | - // } as ExtraDTO | ||
| 414 | - // } as Params, | ||
| 415 | - // }; | ||
| 416 | - // WDRouterRule.jumpWithAction(taskAction) | ||
| 417 | - // Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`); | ||
| 418 | } | 402 | } |
| 419 | 403 | ||
| 420 | public static gotoH5NewsWeb(content: ContentDTO) { | 404 | public static gotoH5NewsWeb(content: ContentDTO) { |
| @@ -433,7 +417,6 @@ export class ProcessUtils { | @@ -433,7 +417,6 @@ export class ProcessUtils { | ||
| 433 | title: content?.newsTitle | 417 | title: content?.newsTitle |
| 434 | } as ExtraDTO, | 418 | } as ExtraDTO, |
| 435 | targetLayout: content.customParamTargetLayout, | 419 | targetLayout: content.customParamTargetLayout, |
| 436 | - clickComment: content.clickComment | ||
| 437 | } as Params, | 420 | } as Params, |
| 438 | }; | 421 | }; |
| 439 | WDRouterRule.jumpWithAction(taskAction) | 422 | WDRouterRule.jumpWithAction(taskAction) |
| @@ -456,7 +439,6 @@ export class ProcessUtils { | @@ -456,7 +439,6 @@ export class ProcessUtils { | ||
| 456 | commentId: content?.commentInfo?.commentId | 439 | commentId: content?.commentInfo?.commentId |
| 457 | } as ExtraDTO, | 440 | } as ExtraDTO, |
| 458 | targetLayout: content.customParamTargetLayout, | 441 | targetLayout: content.customParamTargetLayout, |
| 459 | - clickComment: content.clickComment | ||
| 460 | } as Params, | 442 | } as Params, |
| 461 | }; | 443 | }; |
| 462 | WDRouterRule.jumpWithAction(taskAction) | 444 | WDRouterRule.jumpWithAction(taskAction) |
| @@ -473,7 +455,8 @@ export class ProcessUtils { | @@ -473,7 +455,8 @@ export class ProcessUtils { | ||
| 473 | relType: content?.relType, | 455 | relType: content?.relType, |
| 474 | relId: content?.relId, | 456 | relId: content?.relId, |
| 475 | sourcePage: '5', | 457 | sourcePage: '5', |
| 476 | - commentId: content?.commentInfo?.commentId | 458 | + commentId: content?.commentInfo?.commentId, |
| 459 | + showComment: content.showComment | ||
| 477 | } as ExtraDTO, | 460 | } as ExtraDTO, |
| 478 | targetLayout: content.customParamTargetLayout | 461 | targetLayout: content.customParamTargetLayout |
| 479 | } as Params, | 462 | } as Params, |
| @@ -144,7 +144,9 @@ export class ContentDTO implements BaseDTO { | @@ -144,7 +144,9 @@ export class ContentDTO implements BaseDTO { | ||
| 144 | isMourning?: boolean = false; | 144 | isMourning?: boolean = false; |
| 145 | 145 | ||
| 146 | author: string = ""; ///撰稿人 | 146 | author: string = ""; ///撰稿人 |
| 147 | - clickComment:boolean = false; | 147 | + |
| 148 | + // 号主页评论列表点击跳转到视频详情判断评论弹框是否展开 | ||
| 149 | + showComment?:boolean = false; | ||
| 148 | 150 | ||
| 149 | static clone(old: ContentDTO): ContentDTO { | 151 | static clone(old: ContentDTO): ContentDTO { |
| 150 | let content = new ContentDTO(); | 152 | let content = new ContentDTO(); |
| @@ -24,6 +24,5 @@ export interface Params { | @@ -24,6 +24,5 @@ export interface Params { | ||
| 24 | videoCoverUrl?: string; | 24 | videoCoverUrl?: string; |
| 25 | pageId?: string; | 25 | pageId?: string; |
| 26 | backVisibility?: boolean; //展示顶部返回栏 | 26 | backVisibility?: boolean; //展示顶部返回栏 |
| 27 | - clickComment?:boolean;//点击评论按钮进入稿件详情页定位到评论区 | ||
| 28 | targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区 | 27 | targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区 |
| 29 | } | 28 | } |
| @@ -125,7 +125,7 @@ export struct CarderInteraction { | @@ -125,7 +125,7 @@ export struct CarderInteraction { | ||
| 125 | } | 125 | } |
| 126 | .justifyContent(FlexAlign.Center) | 126 | .justifyContent(FlexAlign.Center) |
| 127 | .onClick(() => { | 127 | .onClick(() => { |
| 128 | - this.contentDTO.clickComment = true | 128 | + this.contentDTO.customParamTargetLayout = "comment" |
| 129 | ProcessUtils.processPage(this.contentDTO); | 129 | ProcessUtils.processPage(this.contentDTO); |
| 130 | }) | 130 | }) |
| 131 | } | 131 | } |
| @@ -152,7 +152,7 @@ export struct CompParser { | @@ -152,7 +152,7 @@ export struct CompParser { | ||
| 152 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 152 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 153 | //ZhGridLayout02({ compDTO: this.compDTO }) | 153 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| 154 | CompNormalTitle({ compDTO: this.compDTO }) | 154 | CompNormalTitle({ compDTO: this.compDTO }) |
| 155 | - this.getBehindDivider() | 155 | + // this.getBehindDivider() |
| 156 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 | 156 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 |
| 157 | 157 | ||
| 158 | ZhGridLayout02NewsContent({ | 158 | ZhGridLayout02NewsContent({ |
| @@ -161,7 +161,7 @@ export struct CompParser { | @@ -161,7 +161,7 @@ export struct CompParser { | ||
| 161 | pageId: this.pageId, | 161 | pageId: this.pageId, |
| 162 | pageName: this.pageName | 162 | pageName: this.pageName |
| 163 | }) | 163 | }) |
| 164 | - this.getBehindDivider() | 164 | + // this.getBehindDivider() |
| 165 | 165 | ||
| 166 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 166 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| 167 | ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 167 | ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| @@ -93,12 +93,7 @@ export struct ImageAndTextPageComponent { | @@ -93,12 +93,7 @@ export struct ImageAndTextPageComponent { | ||
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | webPageIsPageEnd() { | 95 | webPageIsPageEnd() { |
| 96 | - if (this.action.params?.clickComment) { | ||
| 97 | - setTimeout(()=>{ | ||
| 98 | - this.pageScrollToCommonent() | ||
| 99 | - }, | ||
| 100 | - 800) | ||
| 101 | - } | 96 | + this.checkToScrollCommentArea() |
| 102 | } | 97 | } |
| 103 | 98 | ||
| 104 | build() { | 99 | build() { |
| @@ -255,7 +250,7 @@ export struct ImageAndTextPageComponent { | @@ -255,7 +250,7 @@ export struct ImageAndTextPageComponent { | ||
| 255 | showMainText:this.showMainText, | 250 | showMainText:this.showMainText, |
| 256 | styleType: 1, | 251 | styleType: 1, |
| 257 | onCommentIconClick: () => { | 252 | onCommentIconClick: () => { |
| 258 | - this.pageScrollToCommonent() | 253 | + this.toggleScrollToCommonentOrTop() |
| 259 | } | 254 | } |
| 260 | }) | 255 | }) |
| 261 | } | 256 | } |
| @@ -502,28 +497,6 @@ export struct ImageAndTextPageComponent { | @@ -502,28 +497,6 @@ export struct ImageAndTextPageComponent { | ||
| 502 | } | 497 | } |
| 503 | } | 498 | } |
| 504 | 499 | ||
| 505 | - private pageScrollToCommonent() { | ||
| 506 | - const info = componentUtils.getRectangleById('comment'); | ||
| 507 | - //评论区当前位置 | ||
| 508 | - let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70 | ||
| 509 | - // 当前页面滚动位置 | ||
| 510 | - let currentScrollOffSetY = this.scroller.currentOffset().yOffset | ||
| 511 | - let offSetY = 0 | ||
| 512 | - if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 513 | - offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400 | ||
| 514 | - } | ||
| 515 | - // 定位到评论区域 | ||
| 516 | - if (!this.showMainText) { | ||
| 517 | - this.scroller.scrollTo({ | ||
| 518 | - xOffset: 0, | ||
| 519 | - yOffset: offSetY, | ||
| 520 | - animation: { duration: 1000, curve: Curve.Ease } | ||
| 521 | - }) | ||
| 522 | - } else { | ||
| 523 | - this.scroller.scrollEdge(Edge.Top) | ||
| 524 | - } | ||
| 525 | - } | ||
| 526 | - | ||
| 527 | aboutToAppear() { | 500 | aboutToAppear() { |
| 528 | // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); | 501 | // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); |
| 529 | this.getDetail() | 502 | this.getDetail() |
| @@ -582,19 +555,37 @@ export struct ImageAndTextPageComponent { | @@ -582,19 +555,37 @@ export struct ImageAndTextPageComponent { | ||
| 582 | this.showMainText = true | 555 | this.showMainText = true |
| 583 | } | 556 | } |
| 584 | 557 | ||
| 585 | - if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") { | 558 | + if (!this.showMainText && this.action.params?.targetLayout == "comment") { |
| 586 | if (this.lastTimeoutId) { | 559 | if (this.lastTimeoutId) { |
| 587 | clearTimeout(this.lastTimeoutId) | 560 | clearTimeout(this.lastTimeoutId) |
| 588 | } | 561 | } |
| 589 | this.lastTimeoutId = setTimeout(() => { | 562 | this.lastTimeoutId = setTimeout(() => { |
| 590 | - //头部距离48 | ||
| 591 | - this.scroller.scrollTo({ | ||
| 592 | - yOffset: offSetY, | ||
| 593 | - xOffset: 0, | ||
| 594 | - animation: { duration: 1000, curve: Curve.Ease } | ||
| 595 | - }) | 563 | + this.toggleScrollToCommonentOrTop(true) |
| 596 | this.action.params!.targetLayout = undefined | 564 | this.action.params!.targetLayout = undefined |
| 597 | }, 600) | 565 | }, 600) |
| 598 | } | 566 | } |
| 599 | } | 567 | } |
| 568 | + | ||
| 569 | + private toggleScrollToCommonentOrTop(forceToComment?: boolean) { | ||
| 570 | + | ||
| 571 | + // 定位到评论区域 | ||
| 572 | + if ((forceToComment == undefined || forceToComment == false) && this.showMainText) { | ||
| 573 | + this.scroller.scrollEdge(Edge.Top) | ||
| 574 | + return | ||
| 575 | + } | ||
| 576 | + | ||
| 577 | + //评论区当前位置 | ||
| 578 | + let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70 | ||
| 579 | + // 当前页面滚动位置 | ||
| 580 | + let currentScrollOffSetY = this.scroller.currentOffset().yOffset | ||
| 581 | + let offSetY = 0 | ||
| 582 | + if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 583 | + offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400 | ||
| 584 | + } | ||
| 585 | + this.scroller.scrollTo({ | ||
| 586 | + xOffset: 0, | ||
| 587 | + yOffset: offSetY, | ||
| 588 | + animation: { duration: 1000, curve: Curve.Ease } | ||
| 589 | + }) | ||
| 590 | + } | ||
| 600 | } | 591 | } |
| @@ -27,8 +27,7 @@ import { common } from '@kit.AbilityKit'; | @@ -27,8 +27,7 @@ import { common } from '@kit.AbilityKit'; | ||
| 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; | 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; |
| 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' |
| 29 | import { ColorUtils } from '../../utils/ColorUtils'; | 29 | import { ColorUtils } from '../../utils/ColorUtils'; |
| 30 | -import { SpConstants } from 'wdConstant'; | ||
| 31 | - | 30 | +import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; |
| 32 | 31 | ||
| 33 | const TAG = 'MorningEveningPaperComponent'; | 32 | const TAG = 'MorningEveningPaperComponent'; |
| 34 | 33 | ||
| @@ -129,6 +128,19 @@ export struct MorningEveningPaperComponent { | @@ -129,6 +128,19 @@ export struct MorningEveningPaperComponent { | ||
| 129 | async aboutToAppear() { | 128 | async aboutToAppear() { |
| 130 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string | 129 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string |
| 131 | 130 | ||
| 131 | + if (this.dailyPaperTopicPageId.length > 0) { | ||
| 132 | + this.fetchData() | ||
| 133 | + } else { | ||
| 134 | + const dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic() | ||
| 135 | + if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | ||
| 136 | + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + ""); | ||
| 137 | + this.dailyPaperTopicPageId = dailyPaperTopicBean.id + ""; | ||
| 138 | + this.fetchData() | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + async fetchData() { | ||
| 132 | // console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) | 144 | // console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) |
| 133 | const currentTime = new Date().getTime() | 145 | const currentTime = new Date().getTime() |
| 134 | // console.log(TAG, "currentTime = " + currentTime) | 146 | // console.log(TAG, "currentTime = " + currentTime) |
| @@ -229,6 +229,11 @@ export struct MultiPictureDetailItemComponent { | @@ -229,6 +229,11 @@ export struct MultiPictureDetailItemComponent { | ||
| 229 | .gesture( | 229 | .gesture( |
| 230 | GestureGroup( | 230 | GestureGroup( |
| 231 | GestureMode.Exclusive, | 231 | GestureMode.Exclusive, |
| 232 | + // 单击返回上一层 | ||
| 233 | + // TapGesture({ count: 1 }) | ||
| 234 | + // .onAction(() => { | ||
| 235 | + // router.back() | ||
| 236 | + // }), | ||
| 232 | // TODO:知识点:双击切换图片大小 | 237 | // TODO:知识点:双击切换图片大小 |
| 233 | TapGesture({ count: 2 }) | 238 | TapGesture({ count: 2 }) |
| 234 | .onAction(() => { | 239 | .onAction(() => { |
| @@ -57,12 +57,24 @@ export struct CardMediaInfo { | @@ -57,12 +57,24 @@ export struct CardMediaInfo { | ||
| 57 | if (Number.parseInt(num) <= 9999) { | 57 | if (Number.parseInt(num) <= 9999) { |
| 58 | return Number.parseInt(num).toString() | 58 | return Number.parseInt(num).toString() |
| 59 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | 59 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { |
| 60 | - const num1: string = num.slice(0, -4); // 万 | ||
| 61 | - const num2: string = num.slice(-4, -3); // 千 | 60 | + let num1: string = num.slice(0, -4); // 万 |
| 61 | + let num2: string = num.slice(-4, -3); // 千 | ||
| 62 | + const num3: string = num.slice(-3, -2); // 百 | ||
| 63 | + if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}` | ||
| 64 | + if (Number(num2) === 10) { | ||
| 65 | + num2 = '0'; | ||
| 66 | + num1 = `${Number(num1) + 1}` | ||
| 67 | + } | ||
| 62 | return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | 68 | return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' |
| 63 | } else if (Number.parseInt(num) > 99999999) { | 69 | } else if (Number.parseInt(num) > 99999999) { |
| 64 | - const num1: string = num.slice(0, -8); // 亿 | ||
| 65 | - const num2: string = num.slice(-8, -7); | 70 | + let num1: string = num.slice(0, -8); // 亿 |
| 71 | + let num2: string = num.slice(-8, -7); | ||
| 72 | + const num3: string = num.slice(-3, -2); // 百 | ||
| 73 | + if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}` | ||
| 74 | + if (Number(num2) === 10) { | ||
| 75 | + num2 = '0'; | ||
| 76 | + num1 = `${Number(num1) + 1}` | ||
| 77 | + } | ||
| 66 | return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | 78 | return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' |
| 67 | } | 79 | } |
| 68 | return num | 80 | return num |
| @@ -78,6 +90,7 @@ export struct CardMediaInfo { | @@ -78,6 +90,7 @@ export struct CardMediaInfo { | ||
| 78 | let liveIdList: string = this.contentDTO.objectId | 90 | let liveIdList: string = this.contentDTO.objectId |
| 79 | let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList) | 91 | let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList) |
| 80 | this.joinPeopleNum = data[0].pv; | 92 | this.joinPeopleNum = data[0].pv; |
| 93 | + console.log('getJoinPeopleNum ', this.joinPeopleNum) | ||
| 81 | } | 94 | } |
| 82 | 95 | ||
| 83 | build() { | 96 | build() { |
| @@ -115,24 +115,29 @@ export struct CardSourceInfo { | @@ -115,24 +115,29 @@ export struct CardSourceInfo { | ||
| 115 | * 5、0 和空 不显示 | 115 | * 5、0 和空 不显示 |
| 116 | */ | 116 | */ |
| 117 | handlerNum(number: string) { | 117 | handlerNum(number: string) { |
| 118 | - const num = number ?? '0'; | 118 | + const num = number??'0'; |
| 119 | if (Number.parseInt(num) <= 9999) { | 119 | if (Number.parseInt(num) <= 9999) { |
| 120 | return Number.parseInt(num).toString() | 120 | return Number.parseInt(num).toString() |
| 121 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | 121 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { |
| 122 | - const num1: string = num.slice(0, -4); // 万 | ||
| 123 | - const num2: string = num.slice(-4, -3); // 千 | ||
| 124 | - return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万' | 122 | + let num1: string = num.slice(0, -4); // 万 |
| 123 | + let num2: string = num.slice(-4, -3); // 千 | ||
| 124 | + const num3: string = num.slice(-3, -2); // 百 | ||
| 125 | + if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}` | ||
| 126 | + if (Number(num2) === 10) { | ||
| 127 | + num2 = '0'; | ||
| 128 | + num1 = `${Number(num1) + 1}` | ||
| 129 | + } | ||
| 130 | + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | ||
| 125 | } else if (Number.parseInt(num) > 99999999) { | 131 | } else if (Number.parseInt(num) > 99999999) { |
| 126 | let num1: string = num.slice(0, -8); // 亿 | 132 | let num1: string = num.slice(0, -8); // 亿 |
| 127 | let num2: string = num.slice(-8, -7); | 133 | let num2: string = num.slice(-8, -7); |
| 128 | - const num3: string = `0.${num.slice(-7, -6)}` | ||
| 129 | - if (Math.round(Number(num3)) > Number(num3)) { | ||
| 130 | - if (`${Number(num2) + 1}`.length === 2) { | ||
| 131 | - num1 = `${Number(num1) + 1}` | ||
| 132 | - num2 = '0' | ||
| 133 | - } | 134 | + const num3: string = num.slice(-3, -2); // 百 |
| 135 | + if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}` | ||
| 136 | + if (Number(num2) === 10) { | ||
| 137 | + num2 = '0'; | ||
| 138 | + num1 = `${Number(num1) + 1}` | ||
| 134 | } | 139 | } |
| 135 | - return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿' | 140 | + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' |
| 136 | } | 141 | } |
| 137 | return num | 142 | return num |
| 138 | } | 143 | } |
| @@ -177,10 +182,10 @@ export struct CardSourceInfo { | @@ -177,10 +182,10 @@ export struct CardSourceInfo { | ||
| 177 | } | 182 | } |
| 178 | 183 | ||
| 179 | getContentSize(textContent: string, fontSize: number ) { | 184 | getContentSize(textContent: string, fontSize: number ) { |
| 180 | - return px2vp(Number(measure.measureTextSize({ | 185 | + return Number(measure.measureTextSize({ |
| 181 | textContent, | 186 | textContent, |
| 182 | fontSize | 187 | fontSize |
| 183 | - }).width)) | 188 | + }).width) |
| 184 | } | 189 | } |
| 185 | 190 | ||
| 186 | calcContentSpace() { | 191 | calcContentSpace() { |
| @@ -188,27 +193,25 @@ export struct CardSourceInfo { | @@ -188,27 +193,25 @@ export struct CardSourceInfo { | ||
| 188 | 193 | ||
| 189 | const screenWidth = px2vp(display.getDefaultDisplaySync().width) | 194 | const screenWidth = px2vp(display.getDefaultDisplaySync().width) |
| 190 | let leftSpace = screenWidth; | 195 | let leftSpace = screenWidth; |
| 191 | - | ||
| 192 | const souceSize = this.getContentSize(this.displayText, 12); | 196 | const souceSize = this.getContentSize(this.displayText, 12); |
| 193 | - const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); | ||
| 194 | const dotSize = 11; | 197 | const dotSize = 11; |
| 195 | - const timeSize = this.getContentSize(this.handleTimeStr(), 12); | ||
| 196 | - | ||
| 197 | - const commentNum = this.getContentDtoBean()?.interactData?.commentNum | ||
| 198 | - let commentSize = 0; | ||
| 199 | - if (commentNum) { | ||
| 200 | - commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); | ||
| 201 | - } | ||
| 202 | 198 | ||
| 203 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { | 199 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 200 | + const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); | ||
| 204 | leftSpace = leftSpace - cornerSize | 201 | leftSpace = leftSpace - cornerSize |
| 205 | } | 202 | } |
| 206 | 203 | ||
| 207 | if (this.showTime()) { | 204 | if (this.showTime()) { |
| 205 | + const timeSize = this.getContentSize(this.handleTimeStr(), 12); | ||
| 208 | leftSpace = leftSpace - dotSize - timeSize | 206 | leftSpace = leftSpace - dotSize - timeSize |
| 209 | } | 207 | } |
| 210 | 208 | ||
| 211 | if (!this.isEllipsisActive) { | 209 | if (!this.isEllipsisActive) { |
| 210 | + let commentSize = 0; | ||
| 211 | + const commentNum = this.getContentDtoBean()?.interactData?.commentNum | ||
| 212 | + if (commentNum) { | ||
| 213 | + commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); | ||
| 214 | + } | ||
| 212 | leftSpace = leftSpace - dotSize - commentSize | 215 | leftSpace = leftSpace - dotSize - commentSize |
| 213 | } | 216 | } |
| 214 | 217 |
| @@ -78,8 +78,8 @@ export struct Card12Component { | @@ -78,8 +78,8 @@ export struct Card12Component { | ||
| 78 | CarderInteraction({contentDTO: this.contentDTO}) | 78 | CarderInteraction({contentDTO: this.contentDTO}) |
| 79 | } | 79 | } |
| 80 | .padding({ | 80 | .padding({ |
| 81 | - left: 16, | ||
| 82 | - right: 16, | 81 | + left: 10, |
| 82 | + right: 10, | ||
| 83 | top: $r('app.float.card_comp_pagePadding_tb'), | 83 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 84 | bottom: $r('app.float.card_comp_pagePadding_tb') | 84 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 85 | }) | 85 | }) |
| @@ -100,8 +100,8 @@ export struct Card14Component { | @@ -100,8 +100,8 @@ export struct Card14Component { | ||
| 100 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 100 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 101 | } | 101 | } |
| 102 | .padding({ | 102 | .padding({ |
| 103 | - left: 16, | ||
| 104 | - right: 16, | 103 | + left: 10, |
| 104 | + right: 10, | ||
| 105 | top: $r('app.float.card_comp_pagePadding_tb'), | 105 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 106 | bottom: $r('app.float.card_comp_pagePadding_tb') | 106 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 107 | }) | 107 | }) |
| @@ -98,8 +98,8 @@ export struct Card15Component { | @@ -98,8 +98,8 @@ export struct Card15Component { | ||
| 98 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 98 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 99 | } | 99 | } |
| 100 | .padding({ | 100 | .padding({ |
| 101 | - left: 16, | ||
| 102 | - right: 16, | 101 | + left: 10, |
| 102 | + right: 10, | ||
| 103 | top: $r('app.float.card_comp_pagePadding_tb'), | 103 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 104 | bottom: $r('app.float.card_comp_pagePadding_tb') | 104 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 105 | }) | 105 | }) |
| @@ -131,8 +131,8 @@ export struct Card16Component { | @@ -131,8 +131,8 @@ export struct Card16Component { | ||
| 131 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 131 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 132 | } | 132 | } |
| 133 | .padding({ | 133 | .padding({ |
| 134 | - left: 16, | ||
| 135 | - right: 16, | 134 | + left: 10, |
| 135 | + right: 10, | ||
| 136 | top: 8, | 136 | top: 8, |
| 137 | bottom: $r('app.float.card_comp_pagePadding_tb') | 137 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 138 | }) | 138 | }) |
| @@ -86,8 +86,8 @@ export struct Card19Component { | @@ -86,8 +86,8 @@ export struct Card19Component { | ||
| 86 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 86 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 87 | } | 87 | } |
| 88 | .padding({ | 88 | .padding({ |
| 89 | - left: 16, | ||
| 90 | - right: 16, | 89 | + left: 10, |
| 90 | + right: 10, | ||
| 91 | top: $r('app.float.card_comp_pagePadding_tb'), | 91 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 92 | bottom: $r('app.float.card_comp_pagePadding_tb') | 92 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 93 | }) | 93 | }) |
| @@ -109,8 +109,8 @@ export struct Card20Component { | @@ -109,8 +109,8 @@ export struct Card20Component { | ||
| 109 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 109 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 110 | } | 110 | } |
| 111 | .padding({ | 111 | .padding({ |
| 112 | - left: 16, | ||
| 113 | - right: 16, | 112 | + left: 10, |
| 113 | + right: 10, | ||
| 114 | top: $r('app.float.card_comp_pagePadding_tb'), | 114 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 115 | bottom: $r('app.float.card_comp_pagePadding_tb') | 115 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 116 | }) | 116 | }) |
| @@ -105,8 +105,8 @@ export struct Card21Component { | @@ -105,8 +105,8 @@ export struct Card21Component { | ||
| 105 | ProcessUtils.processPage(this.contentDTO) | 105 | ProcessUtils.processPage(this.contentDTO) |
| 106 | }) | 106 | }) |
| 107 | .padding({ | 107 | .padding({ |
| 108 | - left: 16, | ||
| 109 | - right: 16, | 108 | + left: 10, |
| 109 | + right: 10, | ||
| 110 | top: $r('app.float.card_comp_pagePadding_tb'), | 110 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 111 | bottom: $r('app.float.card_comp_pagePadding_tb') | 111 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 112 | }) | 112 | }) |
| @@ -124,7 +124,7 @@ export struct Card6Component { | @@ -124,7 +124,7 @@ export struct Card6Component { | ||
| 124 | .borderRadius(5) | 124 | .borderRadius(5) |
| 125 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | 125 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) |
| 126 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 126 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 127 | - .border({width: 0.5, color: 0xf5f5f5}) | 127 | + .border({width: 0.5, color: '#0D000000'}) |
| 128 | .borderStyle(BorderStyle.Solid) | 128 | .borderStyle(BorderStyle.Solid) |
| 129 | CardMediaInfo({ contentDTO: this.contentDTO }) | 129 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 130 | } | 130 | } |
| @@ -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 = ''; |
| @@ -494,10 +494,26 @@ struct ChildCommentItem { | @@ -494,10 +494,26 @@ struct ChildCommentItem { | ||
| 494 | .onClick(() => { | 494 | .onClick(() => { |
| 495 | this.replyComment() | 495 | this.replyComment() |
| 496 | }) | 496 | }) |
| 497 | + .gesture( | ||
| 498 | + LongPressGesture() | ||
| 499 | + .onAction((event: GestureEvent|undefined)=>{ | ||
| 500 | + if (event) { | ||
| 501 | + //TODO: 显示功能菜单 | ||
| 502 | + } | ||
| 503 | + }) | ||
| 504 | + ) | ||
| 497 | if (this.item.commentPics.length > 0) { | 505 | if (this.item.commentPics.length > 0) { |
| 498 | Image(this.item.commentPics) | 506 | Image(this.item.commentPics) |
| 499 | .width(88).height(88) | 507 | .width(88).height(88) |
| 500 | .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) | 508 | .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) |
| 509 | + .gesture( | ||
| 510 | + LongPressGesture() | ||
| 511 | + .onAction((event: GestureEvent|undefined)=>{ | ||
| 512 | + if (event) { | ||
| 513 | + //TODO: 显示功能菜单 | ||
| 514 | + } | ||
| 515 | + }) | ||
| 516 | + ) | ||
| 501 | } | 517 | } |
| 502 | 518 | ||
| 503 | commentFooterView({ | 519 | commentFooterView({ |
| @@ -718,11 +734,27 @@ struct commentHeaderView { | @@ -718,11 +734,27 @@ struct commentHeaderView { | ||
| 718 | .onClick(() => { | 734 | .onClick(() => { |
| 719 | this.replyComment() | 735 | this.replyComment() |
| 720 | }) | 736 | }) |
| 737 | + .gesture( | ||
| 738 | + LongPressGesture() | ||
| 739 | + .onAction((event: GestureEvent|undefined)=>{ | ||
| 740 | + if (event) { | ||
| 741 | + //TODO: 显示功能菜单 | ||
| 742 | + } | ||
| 743 | + }) | ||
| 744 | + ) | ||
| 721 | 745 | ||
| 722 | if (this.item.commentPics.length > 0) { | 746 | if (this.item.commentPics.length > 0) { |
| 723 | Image(this.item.commentPics) | 747 | Image(this.item.commentPics) |
| 724 | .width(88).height(88) | 748 | .width(88).height(88) |
| 725 | .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) | 749 | .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) |
| 750 | + .gesture( | ||
| 751 | + LongPressGesture() | ||
| 752 | + .onAction((event: GestureEvent|undefined)=>{ | ||
| 753 | + if (event) { | ||
| 754 | + //TODO: 显示功能菜单 | ||
| 755 | + } | ||
| 756 | + }) | ||
| 757 | + ) | ||
| 726 | } | 758 | } |
| 727 | 759 | ||
| 728 | commentFooterView({ | 760 | commentFooterView({ |
| @@ -842,13 +874,13 @@ struct commentFooterView { | @@ -842,13 +874,13 @@ struct commentFooterView { | ||
| 842 | } | 874 | } |
| 843 | } | 875 | } |
| 844 | 876 | ||
| 845 | - if (this.item.id) { // 审核通过的才显示点赞 | 877 | + // if (this.item.id) { // 审核通过的才显示点赞 |
| 846 | Row({ space: 6 }) { | 878 | Row({ space: 6 }) { |
| 847 | - Text(this.item.likeNum) | ||
| 848 | - .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')) | ||
| 849 | .fontSize(14) | 881 | .fontSize(14) |
| 850 | 882 | ||
| 851 | - 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')) |
| 852 | .size({ | 884 | .size({ |
| 853 | width: 16, | 885 | width: 16, |
| 854 | height: 16 | 886 | height: 16 |
| @@ -858,7 +890,7 @@ struct commentFooterView { | @@ -858,7 +890,7 @@ struct commentFooterView { | ||
| 858 | .onClick(() => { | 890 | .onClick(() => { |
| 859 | this.clickLike() | 891 | this.clickLike() |
| 860 | }) | 892 | }) |
| 861 | - } | 893 | + // } |
| 862 | } | 894 | } |
| 863 | // .alignItems(VerticalAlign.Bottom) | 895 | // .alignItems(VerticalAlign.Bottom) |
| 864 | .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 |
| @@ -299,6 +299,7 @@ function getParams(item: CommentListItem) : ContentDTO{ | @@ -299,6 +299,7 @@ function getParams(item: CommentListItem) : ContentDTO{ | ||
| 299 | contentDTO.relId = item.targetRelId; | 299 | contentDTO.relId = item.targetRelId; |
| 300 | contentDTO.objectType = item.targetType + ""; | 300 | contentDTO.objectType = item.targetType + ""; |
| 301 | contentDTO.newsTitle = item.targetTitle | 301 | contentDTO.newsTitle = item.targetTitle |
| 302 | + contentDTO.showComment = true | ||
| 302 | 303 | ||
| 303 | return contentDTO | 304 | return contentDTO |
| 304 | } | 305 | } |
| @@ -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 | ||
| @@ -711,7 +711,7 @@ export struct TopNavigationComponentNew { | @@ -711,7 +711,7 @@ export struct TopNavigationComponentNew { | ||
| 711 | if (NetworkUtil.isNetConnected()) { | 711 | if (NetworkUtil.isNetConnected()) { |
| 712 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { | 712 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { |
| 713 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | 713 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { |
| 714 | - SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | 714 | + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + ""); |
| 715 | ProcessUtils.gotoMorningEveningPaper() | 715 | ProcessUtils.gotoMorningEveningPaper() |
| 716 | } else { | 716 | } else { |
| 717 | ToastUtils.showToast('暂无早晚报信息', 1000) | 717 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| @@ -260,7 +260,7 @@ export struct PeopleShipMainComponent { | @@ -260,7 +260,7 @@ export struct PeopleShipMainComponent { | ||
| 260 | ListItem() { | 260 | ListItem() { |
| 261 | Column(){ | 261 | Column(){ |
| 262 | CardParser({ compDTO: new CompDTO, contentDTO: item }) | 262 | CardParser({ compDTO: new CompDTO, contentDTO: item }) |
| 263 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 263 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 264 | }.width('100%') | 264 | }.width('100%') |
| 265 | 265 | ||
| 266 | }.width("100%") | 266 | }.width("100%") |
| @@ -101,7 +101,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -101,7 +101,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 101 | Column() { | 101 | Column() { |
| 102 | CardParser({compDTO:new CompDTO, contentDTO: item , isPeopleShipHome:true}) | 102 | CardParser({compDTO:new CompDTO, contentDTO: item , isPeopleShipHome:true}) |
| 103 | .margin({left: 6, right: 6}) | 103 | .margin({left: 6, right: 6}) |
| 104 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 104 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 105 | } | 105 | } |
| 106 | }.width("100%") | 106 | }.width("100%") |
| 107 | .backgroundColor(Color.Transparent) | 107 | .backgroundColor(Color.Transparent) |
| @@ -300,14 +300,14 @@ export struct PeopleShipHomeArticleListComponent { | @@ -300,14 +300,14 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 300 | } | 300 | } |
| 301 | // contentDTO.shareInfo = [self.contentShare.firstObject convertToShareInfo]; | 301 | // contentDTO.shareInfo = [self.contentShare.firstObject convertToShareInfo]; |
| 302 | // contentDTO.shareInfo.shareUrl = self.shareUrl; | 302 | // contentDTO.shareInfo.shareUrl = self.shareUrl; |
| 303 | - if (element.updateTime.length > 0) { | ||
| 304 | - contentDTO.publishTime = this.convertPublishTimeWith(element.updateTime); | ||
| 305 | - }else if (element.publishTime.length > 0) { | 303 | + if (element.publishTime.length > 0) { |
| 306 | contentDTO.publishTime = this.convertPublishTimeWith(element.publishTime); | 304 | contentDTO.publishTime = this.convertPublishTimeWith(element.publishTime); |
| 307 | } else if (element.firstPublishTime.length > 0) { | 305 | } else if (element.firstPublishTime.length > 0) { |
| 308 | contentDTO.publishTime = this.convertPublishTimeWith(element.firstPublishTime); | 306 | contentDTO.publishTime = this.convertPublishTimeWith(element.firstPublishTime); |
| 309 | } else if (element.createTime.length > 0) { | 307 | } else if (element.createTime.length > 0) { |
| 310 | contentDTO.publishTime = this.convertPublishTimeWith(element.createTime); | 308 | contentDTO.publishTime = this.convertPublishTimeWith(element.createTime); |
| 309 | + } else if (element.updateTime.length > 0) { | ||
| 310 | + contentDTO.publishTime = this.convertPublishTimeWith(element.updateTime); | ||
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | //图集数量 | 313 | //图集数量 |
| @@ -107,7 +107,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -107,7 +107,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 107 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | 107 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) |
| 108 | .objectFit(ImageFit.Contain) | 108 | .objectFit(ImageFit.Contain) |
| 109 | .borderRadius(4) | 109 | .borderRadius(4) |
| 110 | - .border({width: 0.5, color: 0xf5f5f5}) | 110 | + .border({width: 0.5, color: '#0D000000'}) |
| 111 | CardMediaInfo({ | 111 | CardMediaInfo({ |
| 112 | livePeopleNum:false, | 112 | livePeopleNum:false, |
| 113 | contentDTO: item | 113 | contentDTO: item |
| @@ -168,7 +168,7 @@ export struct LiveHorizontalCardComponent { | @@ -168,7 +168,7 @@ export struct LiveHorizontalCardComponent { | ||
| 168 | }) | 168 | }) |
| 169 | } | 169 | } |
| 170 | .borderRadius(4) | 170 | .borderRadius(4) |
| 171 | - .border({width: 1, color: 0xf5f5f5}) | 171 | + .border({width: 1, color: '#0D000000'}) |
| 172 | 172 | ||
| 173 | Text(item.newsTitle) | 173 | Text(item.newsTitle) |
| 174 | .fontSize(15) | 174 | .fontSize(15) |
| @@ -100,11 +100,11 @@ export struct OperRowListView { | @@ -100,11 +100,11 @@ export struct OperRowListView { | ||
| 100 | private shareOpen = 0; | 100 | private shareOpen = 0; |
| 101 | 101 | ||
| 102 | async aboutToAppear() { | 102 | async aboutToAppear() { |
| 103 | - console.info(TAG, 'this.needLike', this.needLike) | 103 | + // console.info(TAG, 'this.needLike', this.needLike) |
| 104 | this.handleStyle() | 104 | this.handleStyle() |
| 105 | this.onDetailUpdated() | 105 | this.onDetailUpdated() |
| 106 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | 106 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { |
| 107 | - console.log(TAG, 'this.currentStatus', val) | 107 | + // console.log(TAG, 'this.currentStatus', val) |
| 108 | this.currentStatus = val | 108 | this.currentStatus = val |
| 109 | }) | 109 | }) |
| 110 | //注册通知,来自别的组件的评论成功通知 | 110 | //注册通知,来自别的组件的评论成功通知 |
| @@ -134,7 +134,7 @@ export struct OperRowListView { | @@ -134,7 +134,7 @@ export struct OperRowListView { | ||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | async onDetailUpdated() { | 136 | async onDetailUpdated() { |
| 137 | - console.info(TAG, 'this.styleType', this.styleType) | 137 | + // console.info(TAG, 'this.styleType', this.styleType) |
| 138 | this.handleStyle() | 138 | this.handleStyle() |
| 139 | if (!this.contentDetailData) { | 139 | if (!this.contentDetailData) { |
| 140 | return | 140 | return |
| @@ -168,10 +168,10 @@ export struct OperRowListView { | @@ -168,10 +168,10 @@ export struct OperRowListView { | ||
| 168 | 168 | ||
| 169 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' | 169 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' |
| 170 | 170 | ||
| 171 | - console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | ||
| 172 | - console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen)) | ||
| 173 | - console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | ||
| 174 | - console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) | 171 | + // console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) |
| 172 | + // console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen)) | ||
| 173 | + // console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | ||
| 174 | + // console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) | ||
| 175 | 175 | ||
| 176 | // 评论需要数据 | 176 | // 评论需要数据 |
| 177 | /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' | 177 | /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' |
| @@ -185,8 +185,8 @@ export struct OperRowListView { | @@ -185,8 +185,8 @@ export struct OperRowListView { | ||
| 185 | if (this.operationButtonList?.includes('listen')) { | 185 | if (this.operationButtonList?.includes('listen')) { |
| 186 | this.audioUrl = this.contentDetailData.audioList[0]?.audioUrl || '' | 186 | this.audioUrl = this.contentDetailData.audioList[0]?.audioUrl || '' |
| 187 | this.audioTitle = this.contentDetailData.newsTitle || '' | 187 | this.audioTitle = this.contentDetailData.newsTitle || '' |
| 188 | - console.log(TAG, 'this.audioUrl+++', this.audioUrl) | ||
| 189 | - console.log(TAG, 'this.audioTitle+++', this.audioTitle) | 188 | + // console.log(TAG, 'this.audioUrl+++', this.audioUrl) |
| 189 | + // console.log(TAG, 'this.audioTitle+++', this.audioTitle) | ||
| 190 | } | 190 | } |
| 191 | // 2:竖屏直播页 3:图集 4:横屏直播页 | 191 | // 2:竖屏直播页 3:图集 4:横屏直播页 |
| 192 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { | 192 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { |
| @@ -289,7 +289,7 @@ export struct OperRowListView { | @@ -289,7 +289,7 @@ export struct OperRowListView { | ||
| 289 | } | 289 | } |
| 290 | .layoutWeight(1) | 290 | .layoutWeight(1) |
| 291 | .margin({ | 291 | .margin({ |
| 292 | - right: this.pageComponentType === 1 ? 20 : 0, | 292 | + right: 10, |
| 293 | left: 0 | 293 | left: 0 |
| 294 | }) | 294 | }) |
| 295 | 295 |
| @@ -5,7 +5,7 @@ import { PageRepository } from '../repository/PageRepository'; | @@ -5,7 +5,7 @@ import { PageRepository } from '../repository/PageRepository'; | ||
| 5 | 5 | ||
| 6 | const TAG = "SearcherAboutDataModel" | 6 | const TAG = "SearcherAboutDataModel" |
| 7 | 7 | ||
| 8 | -class DailyPaperTopicModel { | 8 | + class DailyPaperTopicModel { |
| 9 | private static instance: DailyPaperTopicModel; | 9 | private static instance: DailyPaperTopicModel; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| @@ -26,9 +26,21 @@ export struct MultiPictureListPage { | @@ -26,9 +26,21 @@ export struct MultiPictureListPage { | ||
| 26 | @Provide duration: number = 0 | 26 | @Provide duration: number = 0 |
| 27 | @State noAnimation: boolean = true | 27 | @State noAnimation: boolean = true |
| 28 | 28 | ||
| 29 | + // pageTransition() { | ||
| 30 | + // // PageTransitionEnter({ duration: this.noAnimation ? 0 : 300 }) | ||
| 31 | + // PageTransitionExit({ duration: !this.noAnimation ? 0 : 300 }) | ||
| 32 | + // } | ||
| 33 | + | ||
| 29 | pageTransition() { | 34 | pageTransition() { |
| 30 | - // PageTransitionEnter({ duration: this.noAnimation ? 0 : 300 }) | ||
| 31 | - PageTransitionExit({ duration: !this.noAnimation ? 0 : 300 }) | 35 | + // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。 |
| 36 | + PageTransitionEnter({ type: RouteType.Push, duration: 300 }) | ||
| 37 | + .slide(SlideEffect.Right) | ||
| 38 | + PageTransitionEnter({ type: RouteType.Pop, duration: 300 }) | ||
| 39 | + .slide(SlideEffect.Left) | ||
| 40 | + PageTransitionExit({ type: RouteType.Push, duration: 300 }) | ||
| 41 | + .slide(SlideEffect.Left) | ||
| 42 | + PageTransitionExit({ type: RouteType.Pop, duration: 300 }) | ||
| 43 | + .slide(SlideEffect.Right) | ||
| 32 | } | 44 | } |
| 33 | 45 | ||
| 34 | aboutToAppear(): void { | 46 | aboutToAppear(): void { |
| @@ -285,6 +285,7 @@ export struct DetailPlayShortVideoPage { | @@ -285,6 +285,7 @@ export struct DetailPlayShortVideoPage { | ||
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | showCommentListChanged() { | 287 | showCommentListChanged() { |
| 288 | + // console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList) | ||
| 288 | if (this.showCommentList) { | 289 | if (this.showCommentList) { |
| 289 | this.playerWidth = px2vp(this.windowWidth) | 290 | this.playerWidth = px2vp(this.windowWidth) |
| 290 | // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) | 291 | // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) |
| @@ -99,7 +99,7 @@ export struct DetailVideoListPage { | @@ -99,7 +99,7 @@ export struct DetailVideoListPage { | ||
| 99 | aboutToAppear() { | 99 | aboutToAppear() { |
| 100 | // 在视频详情页 | 100 | // 在视频详情页 |
| 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; | 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; |
| 102 | - console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) | 102 | + // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) |
| 103 | if (this.peopleShipHomeCreatorId) { | 103 | if (this.peopleShipHomeCreatorId) { |
| 104 | // 从人民号号主传过来的 | 104 | // 从人民号号主传过来的 |
| 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); | 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); |
| @@ -110,6 +110,8 @@ export struct DetailVideoListPage { | @@ -110,6 +110,8 @@ export struct DetailVideoListPage { | ||
| 110 | 110 | ||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | + | ||
| 114 | + | ||
| 113 | async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) { | 115 | async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) { |
| 114 | // 注册监听网络连接 | 116 | // 注册监听网络连接 |
| 115 | this.netStatus = undefined | 117 | this.netStatus = undefined |
| @@ -165,6 +167,19 @@ export struct DetailVideoListPage { | @@ -165,6 +167,19 @@ export struct DetailVideoListPage { | ||
| 165 | this.AudioSuspension.minimize() | 167 | this.AudioSuspension.minimize() |
| 166 | } | 168 | } |
| 167 | }); | 169 | }); |
| 170 | + | ||
| 171 | + const action: Action = router.getParams() as Action; | ||
| 172 | + if (action) { | ||
| 173 | + if (action.params && action.params.extra) { | ||
| 174 | + if(action.params.extra.showComment) { | ||
| 175 | + // 目的子组件watch生效 | ||
| 176 | + setTimeout(() => { | ||
| 177 | + this.showCommentList = true | ||
| 178 | + }, 300) | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + // console.log(TAG, 'onPageShow', JSON.stringify(action.params)) | ||
| 168 | } | 183 | } |
| 169 | 184 | ||
| 170 | onPageHide(): void { | 185 | onPageHide(): void { |
| @@ -17,11 +17,14 @@ export struct CommentDialogView { | @@ -17,11 +17,14 @@ export struct CommentDialogView { | ||
| 17 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false | 17 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false |
| 18 | 18 | ||
| 19 | showCommentListChange(val: boolean) { | 19 | showCommentListChange(val: boolean) { |
| 20 | + // console.log('DetailVideoListPage this.showCommentList', this.showCommentList) | ||
| 20 | if (this.showCommentList && this.index === this.currentIndex) { | 21 | if (this.showCommentList && this.index === this.currentIndex) { |
| 21 | this.innerShowComment = true | 22 | this.innerShowComment = true |
| 22 | } else { | 23 | } else { |
| 23 | this.innerShowComment = false | 24 | this.innerShowComment = false |
| 24 | } | 25 | } |
| 26 | + // console.log('DetailVideoListPage this.index', this.index) | ||
| 27 | + // console.log('DetailVideoListPage this.currentIndex', this.currentIndex) | ||
| 25 | } | 28 | } |
| 26 | 29 | ||
| 27 | innerShowCommentChange() { | 30 | innerShowCommentChange() { |
| @@ -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", |
| @@ -43,7 +43,9 @@ export class NewspaperDataFetcher { | @@ -43,7 +43,9 @@ export class NewspaperDataFetcher { | ||
| 43 | 43 | ||
| 44 | let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[] | 44 | let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[] |
| 45 | if (contents && contents.length) { | 45 | if (contents && contents.length) { |
| 46 | - data.paperContents = contents.map((contentDTO) => { | 46 | + data.paperContents = contents.filter((value, index) => { |
| 47 | + return index < 4 | ||
| 48 | + }).map((contentDTO) => { | ||
| 47 | let content : FormNewspaperPaperContent = { | 49 | let content : FormNewspaperPaperContent = { |
| 48 | title: contentDTO.newsTitle, | 50 | title: contentDTO.newsTitle, |
| 49 | coverUrl: contentDTO.coverUrl, | 51 | coverUrl: contentDTO.coverUrl, |
| @@ -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() { //标题 时间 进度条 |
| @@ -97,7 +97,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -97,7 +97,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 97 | } | 97 | } |
| 98 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { | 98 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { |
| 99 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | 99 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { |
| 100 | - SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | 100 | + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + ""); |
| 101 | ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面 | 101 | ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面 |
| 102 | } else { | 102 | } else { |
| 103 | ToastUtils.showToast('暂无早晚报信息', 1000) | 103 | ToastUtils.showToast('暂无早晚报信息', 1000) |
No preview for this file type
-
Please register or login to post a comment