wangliang_wd

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 303 additions and 157 deletions
... ... @@ -2,8 +2,8 @@
"app": {
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 7397,
"versionName": "7.3.9.7",
"versionCode": 7398,
"versionName": "7.3.9.8",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
... ...
... ... @@ -58,6 +58,10 @@ export class HttpUtils {
return SPHelper.default.getSync(SpConstants.USER_ID, "") as string
}
public static getCreatorId(): string {
return SPHelper.default.getSync(SpConstants.USER_CREATOR_ID, "") as string
}
public static getUserType(): string {
return SPHelper.default.getSync(SpConstants.USER_Type, "") as string
}
... ...
... ... @@ -189,12 +189,12 @@ export class ProcessUtils {
if (typeof type == "number") {
type = `${type}`
}
// Logger.debug(TAG, `objectType, ${JSON.stringify(content)}`);
// console.log(TAG, `DetailVideoListPage objectType, ${JSON.stringify(content)}`);
switch (type) {
case ContentConstants.TYPE_NONE:
// Logger.debug(TAG, "processPage, do nothing");
break;
case ContentConstants.TYPE_VOD:
case ContentConstants.TYPE_VOD: // 视频详情
// Logger.debug(TAG, "processPage, nonsupport!!!");
ProcessUtils.gotoVod(content)
break;
... ... @@ -282,7 +282,7 @@ export class ProcessUtils {
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`);
// Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`);
}
/**
... ... @@ -399,22 +399,6 @@ export class ProcessUtils {
return
}
ProcessUtils.processPage(contentBean)
// let taskAction: Action = {
// type: 'JUMP_INNER_NEW_PAGE',
// params: {
// contentID: content?.newsId,
// url:content?.linkUrl,
// pageID: 'IMAGE_TEXT_DETAIL',
// extra: {
// relType: content?.relType,
// relId: content?.relId,
// sourcePage: '5',
// commentId: content?.commentId
// } as ExtraDTO
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
}
public static gotoH5NewsWeb(content: ContentDTO) {
... ... @@ -433,7 +417,6 @@ export class ProcessUtils {
title: content?.newsTitle
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ... @@ -456,7 +439,6 @@ export class ProcessUtils {
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ... @@ -473,7 +455,8 @@ export class ProcessUtils {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
commentId: content?.commentInfo?.commentId,
showComment: content.showComment
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
... ...
... ... @@ -20,4 +20,5 @@ export interface ExtraDTO extends ItemDTO {
commentId?: string;
extra?:string
title: string
showComment?:boolean
}
\ No newline at end of file
... ...
... ... @@ -144,7 +144,9 @@ export class ContentDTO implements BaseDTO {
isMourning?: boolean = false;
author: string = ""; ///撰稿人
clickComment:boolean = false;
// 号主页评论列表点击跳转到视频详情判断评论弹框是否展开
showComment?:boolean = false;
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
... ...
... ... @@ -24,6 +24,5 @@ export interface Params {
videoCoverUrl?: string;
pageId?: string;
backVisibility?: boolean; //展示顶部返回栏
clickComment?:boolean;//点击评论按钮进入稿件详情页定位到评论区
targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区
}
... ...
... ... @@ -125,7 +125,7 @@ export struct CarderInteraction {
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.contentDTO.clickComment = true
this.contentDTO.customParamTargetLayout = "comment"
ProcessUtils.processPage(this.contentDTO);
})
}
... ...
... ... @@ -152,7 +152,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
this.getBehindDivider()
// this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({
... ... @@ -161,7 +161,7 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
// this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
... ...
... ... @@ -93,12 +93,7 @@ export struct ImageAndTextPageComponent {
}
webPageIsPageEnd() {
if (this.action.params?.clickComment) {
setTimeout(()=>{
this.pageScrollToCommonent()
},
800)
}
this.checkToScrollCommentArea()
}
build() {
... ... @@ -255,7 +250,7 @@ export struct ImageAndTextPageComponent {
showMainText:this.showMainText,
styleType: 1,
onCommentIconClick: () => {
this.pageScrollToCommonent()
this.toggleScrollToCommonentOrTop()
}
})
}
... ... @@ -502,28 +497,6 @@ export struct ImageAndTextPageComponent {
}
}
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
// 定位到评论区域
if (!this.showMainText) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
}
aboutToAppear() {
// Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
... ... @@ -582,19 +555,37 @@ export struct ImageAndTextPageComponent {
this.showMainText = true
}
if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") {
if (!this.showMainText && this.action.params?.targetLayout == "comment") {
if (this.lastTimeoutId) {
clearTimeout(this.lastTimeoutId)
}
this.lastTimeoutId = setTimeout(() => {
//头部距离48
this.toggleScrollToCommonentOrTop(true)
this.action.params!.targetLayout = undefined
}, 600)
}
}
private toggleScrollToCommonentOrTop(forceToComment?: boolean) {
// 定位到评论区域
if ((forceToComment == undefined || forceToComment == false) && this.showMainText) {
this.scroller.scrollEdge(Edge.Top)
return
}
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
this.scroller.scrollTo({
yOffset: offSetY,
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
this.action.params!.targetLayout = undefined
}, 600)
}
}
}
... ...
... ... @@ -27,8 +27,7 @@ import { common } from '@kit.AbilityKit';
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { ColorUtils } from '../../utils/ColorUtils';
import { SpConstants } from 'wdConstant';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
const TAG = 'MorningEveningPaperComponent';
... ... @@ -129,6 +128,19 @@ export struct MorningEveningPaperComponent {
async aboutToAppear() {
this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string
if (this.dailyPaperTopicPageId.length > 0) {
this.fetchData()
} else {
const dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + "");
this.dailyPaperTopicPageId = dailyPaperTopicBean.id + "";
this.fetchData()
}
}
}
async fetchData() {
// console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId)
const currentTime = new Date().getTime()
// console.log(TAG, "currentTime = " + currentTime)
... ...
... ... @@ -229,6 +229,11 @@ export struct MultiPictureDetailItemComponent {
.gesture(
GestureGroup(
GestureMode.Exclusive,
// 单击返回上一层
// TapGesture({ count: 1 })
// .onAction(() => {
// router.back()
// }),
// TODO:知识点:双击切换图片大小
TapGesture({ count: 2 })
.onAction(() => {
... ...
... ... @@ -57,12 +57,24 @@ export struct CardMediaInfo {
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
let num1: string = num.slice(0, -4); // 万
let num2: string = num.slice(-4, -3); // 千
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
}
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
let num1: string = num.slice(0, -8); // 亿
let num2: string = num.slice(-8, -7);
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
}
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
... ... @@ -78,6 +90,7 @@ export struct CardMediaInfo {
let liveIdList: string = this.contentDTO.objectId
let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList)
this.joinPeopleNum = data[0].pv;
console.log('getJoinPeopleNum ', this.joinPeopleNum)
}
build() {
... ...
... ... @@ -115,24 +115,29 @@ export struct CardSourceInfo {
* 5、0 和空 不显示
*/
handlerNum(number: string) {
const num = number ?? '0';
const num = number??'0';
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万'
let num1: string = num.slice(0, -4); // 万
let num2: string = num.slice(-4, -3); // 千
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
}
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
let num1: string = num.slice(0, -8); // 亿
let num2: string = num.slice(-8, -7);
const num3: string = `0.${num.slice(-7, -6)}`
if (Math.round(Number(num3)) > Number(num3)) {
if (`${Number(num2) + 1}`.length === 2) {
const num3: string = num.slice(-3, -2); // 百
if (Math.round(Number(`0.${num3}`)) === 1) num2 = `${Number(num2) + 1}`
if (Number(num2) === 10) {
num2 = '0';
num1 = `${Number(num1) + 1}`
num2 = '0'
}
}
return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿'
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
}
... ... @@ -177,10 +182,10 @@ export struct CardSourceInfo {
}
getContentSize(textContent: string, fontSize: number ) {
return px2vp(Number(measure.measureTextSize({
return Number(measure.measureTextSize({
textContent,
fontSize
}).width))
}).width)
}
calcContentSpace() {
... ... @@ -188,27 +193,25 @@ export struct CardSourceInfo {
const screenWidth = px2vp(display.getDefaultDisplaySync().width)
let leftSpace = screenWidth;
const souceSize = this.getContentSize(this.displayText, 12);
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
const dotSize = 11;
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
const commentNum = this.getContentDtoBean()?.interactData?.commentNum
let commentSize = 0;
if (commentNum) {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
leftSpace = leftSpace - cornerSize
}
if (this.showTime()) {
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
leftSpace = leftSpace - dotSize - timeSize
}
if (!this.isEllipsisActive) {
let commentSize = 0;
const commentNum = this.getContentDtoBean()?.interactData?.commentNum
if (commentNum) {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
leftSpace = leftSpace - dotSize - commentSize
}
... ...
... ... @@ -78,8 +78,8 @@ export struct Card12Component {
CarderInteraction({contentDTO: this.contentDTO})
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -100,8 +100,8 @@ export struct Card14Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -98,8 +98,8 @@ export struct Card15Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -131,8 +131,8 @@ export struct Card16Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: 8,
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -86,8 +86,8 @@ export struct Card19Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -109,8 +109,8 @@ export struct Card20Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -105,8 +105,8 @@ export struct Card21Component {
ProcessUtils.processPage(this.contentDTO)
})
.padding({
left: 16,
right: 16,
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -124,7 +124,7 @@ export struct Card6Component {
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
.border({width: 0.5, color: 0xf5f5f5})
.border({width: 0.5, color: '#0D000000'})
.borderStyle(BorderStyle.Solid)
CardMediaInfo({ contentDTO: this.contentDTO })
}
... ...
... ... @@ -151,6 +151,7 @@ export class commentStatusListModel extends PageModel {
@Observed
export class commentStatusModel {
commentId: string = '';
uuid: string = ''
status: boolean = false;
level: string = '';
levelHead: string = '';
... ...
... ... @@ -494,10 +494,26 @@ struct ChildCommentItem {
.onClick(() => {
this.replyComment()
})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
}
commentFooterView({
... ... @@ -718,11 +734,27 @@ struct commentHeaderView {
.onClick(() => {
this.replyComment()
})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
}
commentFooterView({
... ... @@ -842,13 +874,13 @@ struct commentFooterView {
}
}
if (this.item.id) { // 审核通过的才显示点赞
// if (this.item.id) { // 审核通过的才显示点赞
Row({ space: 6 }) {
Text(this.item.likeNum)
.fontColor(this.item.api_status?$r('app.color.color_ED2800') : $r('app.color.color_666666'))
Text(this.item.likeNum + "")
.fontColor(this.item.api_status == true ?$r('app.color.color_ED2800') : $r('app.color.color_666666'))
.fontSize(14)
Image(this.item.api_status ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal'))
Image(this.item.api_status == true ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal'))
.size({
width: 16,
height: 16
... ... @@ -858,7 +890,7 @@ struct commentFooterView {
.onClick(() => {
this.clickLike()
})
}
// }
}
// .alignItems(VerticalAlign.Bottom)
.justifyContent(FlexAlign.SpaceBetween)
... ...
import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource, Logger, NumberFormatterUtils, ToastUtils, WindowModel } from 'wdKit/Index'
import { commentItemModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { router, window } from '@kit.ArkUI'
... ... @@ -387,6 +387,12 @@ struct QualityCommentItem {
Row({ space: 16 }) {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
if (this.item.replyNum && this.item.replyNum.length > 0 && this.item.replyNum != '0') {
Text(NumberFormatterUtils.formatNumberWithWan(this.item.replyNum))
.fontSize(14)
.fontColor('#999999')
.margin({ left: 3 })
}
}.height('100%')
.onClick(() => {
this.replyComment()
... ...
... ... @@ -54,7 +54,7 @@ class CommentViewModel {
return
}
let listData = data.data as commentListModel
this.fetchCommentStatusAndConfigAuthIcon(listData, false).then((commentListModel) => {
this.fetchCommentStatusAndConfigAuthIcon(listData, false, contentId).then((commentListModel) => {
console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成')
if (pageNum !== "1") {
... ... @@ -63,7 +63,7 @@ class CommentViewModel {
}
// 热门评论批查
this.fetchCommentStatusAndConfigAuthIcon(listData, true).then((commentListModel) => {
this.fetchCommentStatusAndConfigAuthIcon(listData, true, contentId).then((commentListModel) => {
console.log(TAG, 'hot comment fetchCommentStatusAndConfigAuthIcon完成')
listData.hotList.forEach((item) => {
... ... @@ -101,7 +101,7 @@ class CommentViewModel {
// success(listData)
this.fetchCommentStatusAndConfigAuthIcon(listData).then((commentListModel) => {
this.fetchCommentStatusAndConfigAuthIcon(listData, false, contentId).then((commentListModel) => {
console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成')
success(commentListModel)
})
... ... @@ -160,7 +160,8 @@ class CommentViewModel {
// userHeaderUrl string
// 【迭代二新增】当前用户的头像url
bean['commentId'] = model.id;
bean['commentId'] = (model.id + "").length > 0 ? (model.id + "") : "0";
bean['uuid'] = model.uuid;
bean['targetId'] = model.targetId;
bean['targetType'] = model.targetType;
bean['status'] = model.api_status ? '1' : '0';
... ... @@ -207,14 +208,14 @@ class CommentViewModel {
bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
}
HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
HttpBizUtil.post<ResponseDTO<commentItemModel>>(url, bean).then(async (data: ResponseDTO<commentItemModel>) => {
if (data.code != 0) {
ToastUtils.showToast(data.message, 1000);
fail()
return
}
ToastUtils.showToast(data.message, 1000);
let model = data.data as commentItemModel
let comment = data.data as commentItemModel
let firstCommentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') as string
... ... @@ -222,7 +223,15 @@ class CommentViewModel {
//保存首次评论时间
SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
}
success(model)
comment.targetId = model.targetId
comment.targetRelId = model.targetRelId
comment.targetRelType = model.targetRelType
comment.targetType = model.targetType
comment.targetRelObjectId = model.targetRelObjectId
await this.fetchCurrentUserAuthIcons(comment)
let newModel = commentViewModel.deepCopyCommentItemModel(comment)
success(newModel)
}, (error: Error) => {
ToastUtils.showToast('评论失败', 1000);
fail()
... ... @@ -231,10 +240,32 @@ class CommentViewModel {
})
}
async fetchCurrentUserAuthIcons(model: commentItemModel) {
if (false == HttpUtils.isLogin()) {
return
}
if (HttpUtils.getUserType() == "1") { // 普通用户
let fromUserIDs = [HttpUtils.getUserId()];
const response = await HttpRequest.post<ResponseDTO<commentStatusModel[]>>(HttpUrlUtils.getBatchUserUrl(), fromUserIDs)
if (response && response.data && response.data.length > 0) {
model.api_levelHead = response.data[0].levelHead
}
} else { // 创作者
let bean: Record<string, string[]> = {"creatorIdList": [HttpUtils.getCreatorId()]};
const response = await HttpRequest.post<ResponseDTO<commentStatusModel[]>>(HttpUrlUtils.getDetailListUrl(), bean)
if (response && response.data && response.data.length > 0) {
model.api_authIcon = response.data[0].authIcon
}
}
}
/*多接口批查*/
fetchCommentStatusAndConfigAuthIcon(model: commentListModel, hot: boolean = false): Promise<commentListModel> {
// hot 表示是否批查热门评论
// targetId 是指针对某一篇稿件的评论场景
fetchCommentStatusAndConfigAuthIcon(model: commentListModel, hot: boolean = false, targetId?: string): Promise<commentListModel> {
let commentIDs: string[] = [];
let uuidIDs: string[] = [];
let fromUserIDs: string[] = [];
... ... @@ -242,8 +273,10 @@ class CommentViewModel {
//主评论
for (const element of (hot ? model.hotList : model.list)) {
if ((element.id + '').length > 0) {
if ((element.id + '').length > 0 && (element.id + "") != "0") {
commentIDs.push(element.id + '')
} else {
uuidIDs.push(element.uuid)
}
if ((element.fromUserId + '').length > 0) {
fromUserIDs.push(element.fromUserId)
... ... @@ -256,8 +289,10 @@ class CommentViewModel {
//子评论
if (element.childComments) {
for (const obj2 of element.childComments) {
if ((obj2.id + '').length > 0) {
if ((obj2.id + '').length > 0 && (obj2.id + "") != "0") {
commentIDs.push(obj2.id + '')
} else {
uuidIDs.push(obj2.uuid)
}
if ((obj2.fromUserId + '').length > 0) {
fromUserIDs.push(obj2.fromUserId)
... ... @@ -278,8 +313,10 @@ class CommentViewModel {
let promise1 = new Promise<void>((success) => {
// HttpRequest HttpBizUtil
let url = HttpUrlUtils.getBatchCommentStatusUrl();
let bean: Record<string, string[]> = {};
let bean: Record<string, string | string[]> = {};
bean['commentIdList'] = commentIDs;
bean['targetId'] = targetId ?? ""
bean['uuidList'] = uuidIDs
HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => {
if (!data || !data.data) {
success()
... ... @@ -297,14 +334,26 @@ class CommentViewModel {
//点赞
for (const element of listData) {
for (const commentModel of (hot ? model.hotList : model.list)) {
if ((commentModel.id + '').length > 0 && (commentModel.id + "") != "0") {
if (element.commentId == commentModel.id) {
commentModel.api_status = element.status
}
} else {
if (element.uuid == commentModel.uuid) {
commentModel.api_status = element.status
}
}
if (commentModel.childComments) {
for (const childCommentModel of commentModel.childComments) {
if ((childCommentModel.id + '').length > 0 && (childCommentModel.id + "") != "0") {
if (element.commentId == childCommentModel.id) {
childCommentModel.api_status = element.status
}
} else {
if (element.uuid == childCommentModel.uuid) {
childCommentModel.api_status = element.status
}
}
}
}
}
... ... @@ -421,7 +470,7 @@ class CommentViewModel {
newModel.api_customType = model.api_customType
newModel.authorLike = model.authorLike
newModel.avatarFrame = model.avatarFrame
newModel.avatarFrame = model.avatarFrame ?? ""
newModel.checkStatus = model.checkStatus
newModel.childCommentNum = model.childCommentNum
newModel.childComments = model.childComments
... ... @@ -455,7 +504,7 @@ class CommentViewModel {
newModel.mySelf = model.mySelf
newModel.parentId = model.parentId
newModel.region = model.region
newModel.replyNum = model.replyNum
newModel.replyNum = model.replyNum + ""
newModel.rootCommentId = model.rootCommentId
newModel.sensitiveExist = model.sensitiveExist
newModel.sensitiveShow = model.sensitiveShow
... ...
... ... @@ -299,6 +299,7 @@ function getParams(item: CommentListItem) : ContentDTO{
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
contentDTO.showComment = true
return contentDTO
}
... ...
... ... @@ -178,10 +178,10 @@ export struct TopNavigationComponentNew {
// left: 6,
// right: 6
// })
.borderRadius({
topLeft: 6,
topRight: 6
})
// .borderRadius({
// topLeft: 6,
// topRight: 6
// })
.backgroundColor(CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent)
}
... ... @@ -711,7 +711,7 @@ export struct TopNavigationComponentNew {
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + "");
ProcessUtils.gotoMorningEveningPaper()
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
... ...
... ... @@ -260,7 +260,7 @@ export struct PeopleShipMainComponent {
ListItem() {
Column(){
CardParser({ compDTO: new CompDTO, contentDTO: item })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}.width('100%')
}.width("100%")
... ...
... ... @@ -101,7 +101,7 @@ export struct PeopleShipHomeArticleListComponent {
Column() {
CardParser({compDTO:new CompDTO, contentDTO: item , isPeopleShipHome:true})
.margin({left: 6, right: 6})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}.width("100%")
.backgroundColor(Color.Transparent)
... ... @@ -300,14 +300,14 @@ export struct PeopleShipHomeArticleListComponent {
}
// contentDTO.shareInfo = [self.contentShare.firstObject convertToShareInfo];
// contentDTO.shareInfo.shareUrl = self.shareUrl;
if (element.updateTime.length > 0) {
contentDTO.publishTime = this.convertPublishTimeWith(element.updateTime);
}else if (element.publishTime.length > 0) {
if (element.publishTime.length > 0) {
contentDTO.publishTime = this.convertPublishTimeWith(element.publishTime);
} else if (element.firstPublishTime.length > 0) {
contentDTO.publishTime = this.convertPublishTimeWith(element.firstPublishTime);
} else if (element.createTime.length > 0) {
contentDTO.publishTime = this.convertPublishTimeWith(element.createTime);
} else if (element.updateTime.length > 0) {
contentDTO.publishTime = this.convertPublishTimeWith(element.updateTime);
}
//图集数量
... ...
... ... @@ -107,7 +107,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.objectFit(ImageFit.Contain)
.borderRadius(4)
.border({width: 0.5, color: 0xf5f5f5})
.border({width: 0.5, color: '#0D000000'})
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
... ...
... ... @@ -168,7 +168,7 @@ export struct LiveHorizontalCardComponent {
})
}
.borderRadius(4)
.border({width: 1, color: 0xf5f5f5})
.border({width: 1, color: '#0D000000'})
Text(item.newsTitle)
.fontSize(15)
... ...
... ... @@ -100,11 +100,11 @@ export struct OperRowListView {
private shareOpen = 0;
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
// console.info(TAG, 'this.needLike', this.needLike)
this.handleStyle()
this.onDetailUpdated()
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
console.log(TAG, 'this.currentStatus', val)
// console.log(TAG, 'this.currentStatus', val)
this.currentStatus = val
})
//注册通知,来自别的组件的评论成功通知
... ... @@ -134,7 +134,7 @@ export struct OperRowListView {
}
async onDetailUpdated() {
console.info(TAG, 'this.styleType', this.styleType)
// console.info(TAG, 'this.styleType', this.styleType)
this.handleStyle()
if (!this.contentDetailData) {
return
... ... @@ -168,10 +168,10 @@ export struct OperRowListView {
this.likeBean['contentType'] = this.contentDetailData.newsType + ''
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
// console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
// console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
// console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// 评论需要数据
/* this.publishCommentModel.targetId = this.contentDetailData.newsId + ''
... ... @@ -185,8 +185,8 @@ export struct OperRowListView {
if (this.operationButtonList?.includes('listen')) {
this.audioUrl = this.contentDetailData.audioList[0]?.audioUrl || ''
this.audioTitle = this.contentDetailData.newsTitle || ''
console.log(TAG, 'this.audioUrl+++', this.audioUrl)
console.log(TAG, 'this.audioTitle+++', this.audioTitle)
// console.log(TAG, 'this.audioUrl+++', this.audioUrl)
// console.log(TAG, 'this.audioTitle+++', this.audioTitle)
}
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
... ... @@ -289,7 +289,7 @@ export struct OperRowListView {
}
.layoutWeight(1)
.margin({
right: this.pageComponentType === 1 ? 20 : 0,
right: 10,
left: 0
})
... ...
... ... @@ -5,7 +5,7 @@ import { PageRepository } from '../repository/PageRepository';
const TAG = "SearcherAboutDataModel"
class DailyPaperTopicModel {
class DailyPaperTopicModel {
private static instance: DailyPaperTopicModel;
/**
... ...
... ... @@ -26,9 +26,21 @@ export struct MultiPictureListPage {
@Provide duration: number = 0
@State noAnimation: boolean = true
// pageTransition() {
// // PageTransitionEnter({ duration: this.noAnimation ? 0 : 300 })
// PageTransitionExit({ duration: !this.noAnimation ? 0 : 300 })
// }
pageTransition() {
// PageTransitionEnter({ duration: this.noAnimation ? 0 : 300 })
PageTransitionExit({ duration: !this.noAnimation ? 0 : 300 })
// 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Right)
PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
.slide(SlideEffect.Left)
PageTransitionExit({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Left)
PageTransitionExit({ type: RouteType.Pop, duration: 300 })
.slide(SlideEffect.Right)
}
aboutToAppear(): void {
... ...
... ... @@ -285,6 +285,7 @@ export struct DetailPlayShortVideoPage {
}
showCommentListChanged() {
// console.log('DetailVideoListPage showCommentListChanged this.showCommentList', this.showCommentList)
if (this.showCommentList) {
this.playerWidth = px2vp(this.windowWidth)
// this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
... ...
... ... @@ -99,7 +99,7 @@ export struct DetailVideoListPage {
aboutToAppear() {
// 在视频详情页
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
// console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
... ... @@ -110,6 +110,8 @@ export struct DetailVideoListPage {
}
async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) {
// 注册监听网络连接
this.netStatus = undefined
... ... @@ -165,6 +167,19 @@ export struct DetailVideoListPage {
this.AudioSuspension.minimize()
}
});
const action: Action = router.getParams() as Action;
if (action) {
if (action.params && action.params.extra) {
if(action.params.extra.showComment) {
// 目的子组件watch生效
setTimeout(() => {
this.showCommentList = true
}, 300)
}
}
}
// console.log(TAG, 'onPageShow', JSON.stringify(action.params))
}
onPageHide(): void {
... ...
... ... @@ -17,11 +17,14 @@ export struct CommentDialogView {
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
showCommentListChange(val: boolean) {
// console.log('DetailVideoListPage this.showCommentList', this.showCommentList)
if (this.showCommentList && this.index === this.currentIndex) {
this.innerShowComment = true
} else {
this.innerShowComment = false
}
// console.log('DetailVideoListPage this.index', this.index)
// console.log('DetailVideoListPage this.currentIndex', this.currentIndex)
}
innerShowCommentChange() {
... ...
... ... @@ -14,7 +14,7 @@
},
{
"name": "play_track_color",
"value": "#1AFFFFFF"
"value": "#33FFFFFF"
},
{
"name": "play_selected_color",
... ... @@ -26,7 +26,7 @@
},
{
"name": "pause_track_color",
"value": "#1AFFFFFF"
"value": "#33FFFFFF"
},
{
"name": "pause_selected_color",
... ...
... ... @@ -43,7 +43,9 @@ export class NewspaperDataFetcher {
let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[]
if (contents && contents.length) {
data.paperContents = contents.map((contentDTO) => {
data.paperContents = contents.filter((value, index) => {
return index < 4
}).map((contentDTO) => {
let content : FormNewspaperPaperContent = {
title: contentDTO.newsTitle,
coverUrl: contentDTO.coverUrl,
... ...
... ... @@ -49,6 +49,10 @@ struct Index {
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_TITLe, (val:string | undefined) => {
this.audioTitle = val
// 播放稿件修改时进度条清零
this.progressVal = 0
this.currentTime = '00:00'
this.totalTime = '00:00'
})
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
... ... @@ -98,13 +102,20 @@ struct Index {
build() {
Stack({ alignContent: Alignment.End }) {
Progress({ value: 0, total: 100, type: ProgressType.Linear })
Progress(
{
value: this.progressVal,
total: 100,
type: ProgressType.Linear,
})
.style({
enableSmoothEffect: false
})
.color("#ED2800")
.backgroundColor($r('app.color.white'))
.width("100%")
.height(3)
.margin({ top: 57 })
.value(this.progressVal)
.visibility(this.isExpand ? Visibility.Visible : Visibility.Hidden)
Stack({ alignContent: Alignment.End }) {
Column() { //标题 时间 进度条
... ...
... ... @@ -97,7 +97,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + "");
ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
... ...