wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 19185 搜索结果-第一条有查看更多时,顶部多出分割线,和安卓不一致
  fix:1)未解决少了点  16732
  fix: 19196 UI还原问题-【生产】已登录进入人民号》关注页 昵称、时间和头像未对齐
  fix(19154): 话题专题--话题专题中引用专题和文章,专题入口处点击引用内容,应跳转到点击内容详情页,实际跳转到话题专题详情页。
  fix: 19150 角标--配置超长来源时,稿件角标不应折行展示
  fix(公共跳转): 更多跳转优化
  feat:1)新闻tab页面顶导接口加入首次授权参数firstLocation,只在第一次使用地理信息时使用,后面不用了
  fix:1)进入首页设置,“将指定频道设置为首页”颜色和android不一致,看图
  fix:1)搜索 输入wuhuhuan,缺省图和android不一致,位置未居中,看图
  样式卡跳专题分享增加逻辑
  refresh更新
  fix: 19085 一多适配--折叠屏,人民号>关注:号主动态,单图卡样式标题折行不正确
  feat:1)稿件来源信息处没有信息展示,top=0
  fix: 17107 UI还原问题-进入视频全屏,回看间距和字体问题
  fix:1)【uat】进入新闻-热点,大专专题卡评论数和android不一致,看图
  fix: 17107 UI还原问题-进入视频全屏,回看间距和字体问题
  fix: 17107 UI还原问题-进入视频全屏,回看间距和字体问题
Showing 27 changed files with 490 additions and 169 deletions
... ... @@ -38,6 +38,7 @@ export class SpConstants{
static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称
static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114
static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位
static LOCATION_FIRST_POSITION = 'location_first_position'// 定位后顶导首次使用地理信息
//启动页数据存储key
static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model'
... ...
import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean';
import { Action, ContentDTO, Params, PhotoListBean, commentInfo, CompDTO } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
... ... @@ -72,6 +72,76 @@ export class ProcessUtils {
ProcessUtils.processPage(content);
}
//更多
static compJumpPage(bean:CompDTO){
let contentBean = ProcessUtils.compBeanToContentBean(bean)
if(contentBean == null){
return
}
if(ProcessUtils.checkMoreJumpPage(bean)){
ProcessUtils.processPage(contentBean)
}else{
ProcessUtils.moreTojumpLivePage(contentBean);
}
}
static moreTojumpLivePage(contentBean:ContentDTO){
if(!StringUtils.isEmpty(contentBean.dataSourceType)){
if(contentBean.dataSourceType == 'LIVE_HORIZONTAL_CARD') {
//直播中
WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage)
}else if(contentBean.dataSourceType == 'LIVE_RESERVATION'){
//预约列表
WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
}else if(contentBean.dataSourceType == 'LIVE_MONTHLY_RANKING'){
contentBean.objectType = '6'
ProcessUtils.processPage(contentBean)
}
}
}
static checkMoreJumpPage(content:CompDTO){
let loacalJump = true
if(content.dataSourceType == 'LIVE_HORIZONTAL_CARD'){
loacalJump = false
}else if(content.dataSourceType == 'LIVE_RESERVATION'){
loacalJump = false
}else if(content.dataSourceType == 'LIVE_MONTHLY_RANKING'){
loacalJump = false
}
return loacalJump
}
static compBeanToContentBean(compDTO:CompDTO){
if(compDTO == null){
return
}
let content = new ContentDTO()
content.objectType = compDTO.objectType||'0'
content.objectLevel = compDTO.objectLevel
content.objectId = compDTO.objectId
content.pageId = compDTO.pageId||''
content.newsTitle = compDTO.objectTitle
content.newsSummary = compDTO.objectSummary
// compContentBean.setTopicInfoBean(getTopicInfoBean());
// compContentBean.setChannelInfoBean(getChannelInfoBean());
content.bottomNavId = compDTO.bottomNavId
content.sourceInterfaceVal = compDTO.sourceInterfaceVal
content.dataSourceType = compDTO.dataSourceType
content.compId = compDTO.id+''
content.linkUrl = compDTO.linkUrl
content.appStyle = compDTO.appStyle
content.recommend = compDTO.recommend
content.expIds = compDTO.expIds
content.relId = compDTO.relId
content.relType = compDTO.relType
content.itemId = compDTO.itemId
content.itemType = compDTO.itemType
content.sceneId = compDTO.sceneId
content.traceId = compDTO.traceId
content.traceInfo = compDTO.traceInfo
return content
}
/**
* 页面跳转
*/
... ... @@ -114,6 +184,8 @@ export class ProcessUtils {
ProcessUtils.gotoAudio(content)
break;
case ContentConstants.TYPE_TELETEXT:
ProcessUtils.gotoWeb(content);
break;
case ContentConstants.TYPE_Activity:
// 图文详情,跳转h5
if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
... ...
... ... @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO {
// meddleDataList: any[];
name: string = '';
objectId: string = ''; // 跳转页面id?
/**
* 频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间轴专题)
*/
objectLevel:string = ''
objectTitle: string = ''; // comp标题
objectSummary: string = ''; // 跳转频道、专题摘要【BFF聚合】
// objectType?: string; // 跳转类型,枚举:
operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
// pageId?: any;
... ... @@ -51,6 +56,22 @@ export class CompDTO implements BaseDTO {
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
bottomNavId:string = ''
//数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
sourceInterfaceVal: number = 0
appStyle: string = '';
/**
* 是否推荐数据;默认0:否,1:是
*/
recommend:number = 0
relId: string = '';
relType: string = '';
itemType: string = '';
sceneId: string = '';
traceId: string = '';
traceInfo: string = '';
/**
* 创建新的compbean对象
* @param old
... ...
... ... @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO {
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
itemType: string = '';
shareFlag?: string = '1';
appStyle: string = '';
cityCode: string = '';
... ... @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO {
timestamp: String = '1'
// 自定义参数,用于跳转对应页面时 传递targetLayout参数用
customParamTargetLayout?: string
//数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
sourceInterfaceVal: number = 0
/**
* 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
*/
dataSourceType: string = '';
//组件ID
compId: string = '';
/**
* 是否推荐数据;默认0:否,1:是
*/
recommend:number = 0
traceId: string = '';
traceInfo: string = '';
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
... ...
... ... @@ -9,4 +9,6 @@ export class InteractDataDTO {
likeNum: number | string = 0;
readNum: number = 0;
shareNum: number = 0;
}
\ No newline at end of file
... ...
import { InteractDataDTO } from '../content/InteractDataDTO';
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
export interface slideShows {
fullColumnImgUrls: FullColumnImgUrlDTO[];
linkUrl?: string;
newsId: string;
newsTitle?: string;
newsTitleColor?: string;
objectLevel?: string;
objectType: string;
pageId?: string;
photoNum?: string;
publishTime: number;
relId: string;
source?: string;
timeBlurred?: string;
videoDuration?: string;
videoLandscape?: string;
videoUrl?: string;
voiceDuration?: string;
@Observed
export class slideShows {
fullColumnImgUrls?: FullColumnImgUrlDTO[];
linkUrl: string='';
newsId: string = '';
newsTitle: string='';
newsTitleColor: string='';
objectLevel: string='';
objectType: string ='';
pageId: string='';
photoNum: string='';
publishTime: number=0;
relId: string='';
source: string='';
timeBlurred: string='';
videoDuration: string='';
videoLandscape: string='';
videoUrl: string='';
voiceDuration: string='';
interactDataDto? :InteractDataDTO
}
\ No newline at end of file
... ...
... ... @@ -72,7 +72,7 @@ export struct CompParser {
build() {
Column() {
//Text(JSON.stringify(this.compDTO.compStyle))
// Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
}
... ... @@ -90,16 +90,18 @@ export struct CompParser {
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
// Text('LiveHorizontalCardComponent')
LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
// Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent')
HorizontalStrokeCardThreeTwoRadioForMoreComponent({
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
})
} else {
// Text('HorizontalStrokeCardThreeTwoRadioForOneComponent')
HorizontalStrokeCardThreeTwoRadioForOneComponent({
compDTO: this.compDTO,
pageId: this.pageId,
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
... ... @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent {
@State isNetConnected: boolean = true
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State showComment: boolean = false
@State topicInfo: TopicInfo = {} as TopicInfo
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
return
... ... @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent {
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag)
if(pageInfoMsg.data.topicInfo?.shareOpen === 1){
console.log('contentDetailData pageInfoMsg.data', JSON.stringify(pageInfoMsg.data))
this.topicInfo = pageInfoMsg.data.topicInfo
this.contentDetailData.newsId = Number(this.topicInfo.topicId)
this.contentDetailData.newsType = this.topicInfo.topicType
if(this.topicInfo?.shareOpen === 1){
this.contentDetailData.shareInfo.shareOpen = this.topicInfo?.shareOpen
console.log('contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
if (!this.operationButtonList.includes('share')) {
this.operationButtonList.push('share');
}
}else{
} else {
this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share')
}
}
console.log('contentDetailData',this.contentDetailData)
console.log('contentDetailData', JSON.stringify(this.contentDetailData))
}
}
}
... ... @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
topicInfo: this.topicInfo,
styleType: 1,
onCommentIconClick:()=>{
this.showCommentList = true
... ...
... ... @@ -6,8 +6,12 @@ import router from '@ohos.router'
@Reusable
@Component
export struct CardSourceInfo {
@State contentDTO: ContentDTO = new ContentDTO();
@State @Watch('checkData') contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
// 特殊稿件内部item展示的来源信息
isCompInnerSource: boolean = false
// 是否有展示的信息,如来源,标签、时间、评论
@State viewShowData: boolean = true
aboutToAppear(): void {
}
... ... @@ -21,6 +25,7 @@ export struct CardSourceInfo {
aboutToDisappear(): void {
}
handleTimeStr() {
return DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
... ... @@ -54,7 +59,6 @@ export struct CardSourceInfo {
return true
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
... ... @@ -64,17 +68,17 @@ 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 + '万'
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);
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿'
}
return num
}
... ... @@ -87,33 +91,29 @@ export struct CardSourceInfo {
}
build() {
Flex({ alignItems: ItemAlign.Center }) {
if (this.contentDTO.corner) {
Text(this.contentDTO.corner)
Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
// 标签
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
Text(this.contentDTO.cornerMark || this.contentDTO.corner)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 2 })
}
if(this.contentDTO.cornerMark){
Text(this.contentDTO.cornerMark)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 2 })
.margin({ right: 6 })
.flexShrink(0)
}
if (this.contentDTO.rmhPlatform === 1) {
Text(this.contentDTO.rmhInfo?.rmhName)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (this.contentDTO.source) {
Text(`${this.contentDTO.source}`)
// 来源信息
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum
// 点
if (this.showTime() || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum
// || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
|| (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
... ... @@ -123,52 +123,44 @@ export struct CardSourceInfo {
.indexOf
('-') === -1)
)) {
Image($r("app.media.point"))
.width(11)
.height(11)
}
// 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
// if (this.contentDTO.isSearch || this.contentDTO.isCollection ||
// (!this.contentDTO.isSearch &&
// DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) {
//
// Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0);
// }
// if (this.contentDTO.source && this.showTime()) {
// Text(this.handleTimeStr())
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0)
// .margin({right: 4})
// }
// 发布日期
if (this.showTime()) {
Text(this.handleTimeStr())
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({right: 4})
.margin({ right: 4 })
}
if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) {
// 评论数
if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
} else {
if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
}
}
// if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
// Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0)
// .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
// Visibility.Visible)
// }
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: 8 })
.height(16)
.margin({ top: this.viewShowData ? 8 : 0 })
}
/**
... ... @@ -184,4 +176,45 @@ export struct CardSourceInfo {
}
return this.compDTO.operDataList[0]
}
/**
* 检测是否有展示的数据
*/
checkData() {
let have = false
if (this.contentDTO.corner) {
have = true
}
if (this.contentDTO.cornerMark) {
have = true
}
if (this.contentDTO.rmhPlatform === 1) {
have = true
} else if (this.contentDTO.source) {
have = true
}
// 发布日期
if (this.showTime()) {
have = true
}
// 评论数
if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
have = true
} else {
if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
have = true
}
}
if (have) {
} else {
this.viewShowData = false
}
}
}
\ No newline at end of file
... ...
... ... @@ -116,7 +116,8 @@ export struct RmhTitle {
Stack() {
Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag'))
.width(36)
.height(36).borderRadius(50)
.height(36)
.borderRadius(50)
Image(this.rmhInfo?.authIcon)
.width(14)
.height(14)
... ... @@ -128,10 +129,13 @@ export struct RmhTitle {
Column() {
Text(this.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_13'))
.fontSize(15)
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.alignSelf(ItemAlign.Start)
.height(21)
.lineHeight(21)
.margin({bottom: 1})
Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
Row() {
if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) {
... ... @@ -139,11 +143,13 @@ export struct RmhTitle {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.height(14)
.lineHeight(14)
}
if (this.publishTime && this.rmhInfo?.rmhDesc) {
Image($r('app.media.point'))
.width(16)
.height(16)
.width(14)
.height(14)
}
}
if(this.rmhInfo?.rmhDesc != undefined){
... ... @@ -154,12 +160,16 @@ export struct RmhTitle {
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
}
}
.width('75%')
.height(14)
}
}
.justifyContent(FlexAlign.SpaceBetween)
Blank()
if (this.rmhInfo?.cnIsAttention) {
... ...
import { ContentDTO, slideShows, VideoInfoDTO, CompDTO } from 'wdBean';
import { ContentDTO, slideShows, VideoInfoDTO, CompDTO, InteractDataDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
... ... @@ -8,6 +8,8 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import { BasePageHelp } from '../page/template/BasePageHelp';
import { Logger } from 'wdKit/Index';
/**
* 大专题卡--CompStyle: 10
... ... @@ -25,11 +27,39 @@ export struct Card10Component {
@State titleMarked: boolean = false;
@State textArr: textItem[] = []
@State hideDetail: boolean = false;
basePageHelp: BasePageHelp = new BasePageHelp
// 稿件参与批查,需要对列表信息单独重绘
@State isBatchData: boolean = false
async aboutToAppear(): Promise<void> {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
this.initHideDetail();
if (!this.hideDetail) {
this.isBatchData = false
// 批查评论数据
let interactArray = this.basePageHelp.getCompInteractParams(this.contentDTO.slideShows)
if (interactArray.contentList != null && interactArray.contentList.length > 0) {
this.basePageHelp.requestCompInteractData(interactArray)
.then((result) => {
if (result != null && result.length > 0) {
this.isBatchData = true
this.contentDTO.slideShows.forEach((slideShowBean) => {
let newsId = slideShowBean.newsId
for (let interactBean of result) {
console.debug(TAG, JSON.stringify(interactBean))
if (newsId == interactBean.contentId) {
slideShowBean.interactDataDto = interactBean
break
}
}
})
}
})
}
}
}
initHideDetail() {
... ... @@ -40,7 +70,7 @@ export struct Card10Component {
}
titleInit() {
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
const titleInitRes: titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
... ... @@ -94,17 +124,14 @@ export struct Card10Component {
// 专题列表--后端返回三个,
if (!this.hideDetail) {
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
if (index < this.contentDTO.slideShows.length - 1) {
// 在不是最后一个元素的情况下添加分隔符
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
})
}
if (this.isBatchData) {
this.drawCompList()
} else {
this.drawCompList()
}
}
// 底部-查看更多。根据接口返回的isMore判断是否显示查看更多
if (this.contentDTO.hasMore == 1 && !this.hideDetail) {
... ... @@ -141,8 +168,26 @@ export struct Card10Component {
}
@Builder
drawCompList() {
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
if (index < this.contentDTO.slideShows.length - 1) {
// 在不是最后一个元素的情况下添加分隔符
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
})
}
}
@Builder
timelineItem(item: slideShows, index: number) {
Row() {
// 有图片资源的
if (item.fullColumnImgUrls && item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
Column() {
Stack() {
if (item.objectType == '5') {
... ... @@ -161,6 +206,7 @@ export struct Card10Component {
//bottom 评论等信息
CardSourceInfo(
{
isCompInnerSource: true,
compDTO: this.compDTO,
contentDTO: this.createContent(item)
}
... ... @@ -170,8 +216,6 @@ export struct Card10Component {
.height(78)
.alignItems(HorizontalAlign.Start)
// 右侧图片
if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
Stack() {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
.backgroundColor(0xf5f5f5)
... ... @@ -186,6 +230,33 @@ export struct Card10Component {
}
.alignContent(Alignment.BottomEnd)
.height(78)
}else{
Column() {
Stack() {
if (item.objectType == '5') {
Notes({ objectType: 5 })
}
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(item.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
//bottom 评论等信息
CardSourceInfo(
{
isCompInnerSource: true,
compDTO: this.compDTO,
contentDTO: this.createContent(item)
}
)
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}
}
.padding({ top: 10, bottom: 10 })
... ... @@ -201,8 +272,9 @@ export struct Card10Component {
private createContent(item: slideShows): ContentDTO {
let contentDTO = new ContentDTO()
contentDTO.publishTime = item.publishTime.toString() || '';
contentDTO.publishTime = item.publishTime?.toString() || '';
contentDTO.source = item.source || '';
contentDTO.interactData = item.interactDataDto
return contentDTO;
}
... ...
... ... @@ -55,7 +55,7 @@ export struct Card14Component {
)
}
// 左标题,右图
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
Text() {
if (this.titleMarked) {
... ...
... ... @@ -395,7 +395,7 @@ export struct PaperSingleColumn999CardView {
private item: ContentDTO = new ContentDTO();
private index: number = -1;
@State isRead: boolean = false;//已读状态
@State interactData: InteractDataDTO = {} as InteractDataDTO;
@State interactData: InteractDataDTO = new InteractDataDTO
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
getPublishTime(): string {
... ...
... ... @@ -298,7 +298,7 @@ struct ChannelSubscriptionLayout {
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#222222')
.fontColor('#80222222')
}
.width('100%')
.margin({ top: 22, bottom: 16 })
... ...
import { CompDTO,
import {
CompDTO,
ContentBean,
ContentDTO,
InteractDataDTO,
InteractParam, LiveRoomDataBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'
InteractParam,
LiveRoomDataBean,
ReserveBean,
ReserveItemBean,
slideShows
} from 'wdBean/Index'
import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'
import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index'
import { HttpUtils, ResponseDTO } from 'wdNetwork/Index'
... ... @@ -22,7 +28,7 @@ export class BasePageHelp {
if (HttpUtils.getUserId()) {
let time = DateTimeUtils.getTimeStamp().toString()
Logger.debug(TAG, 'getAppointmentInfo-->'+time)
Logger.debug(TAG, 'getAppointmentInfo-->' + time)
const reserveBean = this.transformToLiveDetailsBeans(compList)
LiveModel.getAppointmentStatus(reserveBean).then((result) => {
Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`)
... ... @@ -116,7 +122,7 @@ export class BasePageHelp {
return idList.join(',')
}
/**
/**
* 批查稿件的互动数据,如 评论人数等
* @param compList
* @returns
... ... @@ -165,13 +171,17 @@ export class BasePageHelp {
allInteractDataList.push(...value);
}
})
// 批查全部完成,统一设置到comp里
// this.resetInteract(allInteractDataList, compList);
success(allInteractDataList);
})
})
}
/**
* 收集信息流页面,可参与批查稿件的业务信息
* @param compList
* @returns
*/
private getInteractParams(compList: CompDTO[]): InteractParam {
if (compList == null || compList.length == 0) {
return {} as InteractParam;
... ... @@ -204,6 +214,34 @@ export class BasePageHelp {
return param;
}
/**
* 获取组件中需要参与批查业务信息
* @param slideShowArray
* @returns
*/
public getCompInteractParams(slideShowArray: slideShows[]): InteractParam {
if (slideShowArray == null || slideShowArray.length == 0) {
return {} as InteractParam;
}
let param: InteractParam = {} as InteractParam;
param.contentList = new Array<ContentBean>();
slideShowArray.forEach((value) => {
let bean = {} as ContentBean;
bean.contentId = value.newsId;
bean.contentType = value.objectType;
param.contentList.push(bean);
})
return param
}
/**
* 查询互动相关数据,如收藏数、评论数等
* @param param
* @returns
*/
private createInteractDataPromise(param: InteractParam) {
return new Promise<InteractDataDTO[]>((success, error) => {
PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => {
... ... @@ -221,6 +259,18 @@ export class BasePageHelp {
});
}
async requestCompInteractData(param: InteractParam): Promise<InteractDataDTO[]> {
return new Promise<InteractDataDTO[]>((success, error) => {
this.createInteractDataPromise(param).then((result) => {
if (!CollectionUtils.isArray(result)) {
success(new Array<InteractDataDTO>());
return;
}
success(result);
})
})
}
/**
* 刷新互动数据到compList
* @param interact 批查互动数据结果
... ... @@ -252,6 +302,4 @@ export class BasePageHelp {
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -106,7 +106,10 @@ export struct CustomPullToRefresh {
lottie.destroy(this.refreshingAnimName);
this.refreshAnimation?.removeEventListener('DOMLoaded')
this.refreshAnimation?.removeEventListener('destroy')
this.refreshingAnimation?.removeEventListener('DOMLoaded')
this.refreshingAnimation?.removeEventListener('destroy')
this.refreshAnimation = null
this.refreshingAnimation = null
}
@Builder
... ...
... ... @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS'
import { MoreComponent } from '../cardview/MoreComponent'
import { Card9Component } from '../cardview/Card9Component'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent'
const TAG = "SearchResultContentComponent"
@Component
... ... @@ -148,7 +149,7 @@ export struct SearchResultContentComponent {
this.data_rmh.push(data)
})
if(this.data_rmh.length > 0){
if (this.data_rmh.length > 0) {
this.count = 1
}
//只有一条创作者,获取 创作者信息
... ... @@ -262,7 +263,7 @@ export struct SearchResultContentComponent {
this.isLoading = false
this.count = this.count === -1 ? 0 : this.count
})
}else {
} else {
this.hasMore = false
}
}
... ... @@ -270,12 +271,12 @@ export struct SearchResultContentComponent {
build() {
Column() {
if (this.count == 0) {
// ListHasNoMoreDataUI({ style: 2 })
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult,
emptyButton: false,
}).height('70%')
})
} else {
List({ scroller: this.scroller2 }) {
if (this.data_rmh != null && this.data_rmh.length > 0) {
... ... @@ -309,7 +310,7 @@ export struct SearchResultContentComponent {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else {
if (this.data?.get(index + 1)?.sameContentListSize > 0) {
if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
... ... @@ -326,12 +327,13 @@ export struct SearchResultContentComponent {
}, (item: ContentDTO, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) {
if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}.cachedCount(5)
}
.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.height('100%')
... ... @@ -344,6 +346,7 @@ export struct SearchResultContentComponent {
}
}
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
}
... ...
... ... @@ -62,6 +62,7 @@ export struct EmptyComponent {
@State emptyButton: boolean = false
@State isBlack: boolean = false // 背景是否为黑色 默认白色
@State timeNum: number = 10
/**
* The empty image width percentage setting.
*/
... ...
... ... @@ -51,38 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
this.liveToMore();
}
}
liveToMore() {
if (!!this.compDTO.dataSourceType) {
// if (this.compDTO.dataSourceType === 'OBJECT_POS') {
// ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
// return;
// }
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
this.jumpToLiveMorePage()
}
} else {
if (this.compDTO?.objectType === '11') {
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
ProcessUtils.compJumpPage(this.compDTO)
}
}
... ... @@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
}
.visibility(this.showMore() ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.liveToMore();
ProcessUtils.compJumpPage(this.compDTO)
})
}.justifyContent(FlexAlign.SpaceBetween)
... ...
... ... @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent {
// }
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
type: 'JUMP_INNER_NEW_PAGE',
params: {
url: this.compDTO.linkUrl
url: this.compDTO.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
contentID: this.compDTO.objectId,
extra: {
relId: this.compDTO.relId,
relType: this.compDTO.relType,
pageId: this.compDTO.pageId
}
} as Params,
};
this.compDTO.operDataList = []
console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO))
console.log('LiveHorizontalCardComponent', this.compDTO.relId)
console.log('LiveHorizontalCardComponent', this.compDTO.relType)
console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction))
WDRouterRule.jumpWithAction(taskAction)
} else {
// console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage')
this.jumpToLiveMorePage()
}
} else {
... ... @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent {
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
// console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage')
ProcessUtils.processPage(contentDTO)
}
}
... ...
... ... @@ -59,7 +59,7 @@ export struct LiveOperRowListView {
@State needLike: boolean = true
@State styleType: number = -1
@State bgColor: ResourceColor = Color.White
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State interactData: InteractDataDTO = new InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State dialogController: CustomDialogController | null = null;
... ...
... ... @@ -6,7 +6,8 @@ import {
ContentDetailDTO,
contentListParams,
InteractDataDTO,
postExecuteCollectRecordParams
postExecuteCollectRecordParams,
TopicInfo
} from 'wdBean';
import router from '@ohos.router';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
... ... @@ -94,6 +95,7 @@ export struct OperRowListView {
@Consume pageId: string
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@Prop topicInfo?: TopicInfo = {} as TopicInfo
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
... ... @@ -416,8 +418,34 @@ export struct OperRowListView {
}
share() {
if (this.topicInfo && Object.keys(this.topicInfo).length > 0) {
console.info(TAG, 'contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
let contentDetailData: ContentDetailDTO = {
newsId: this.topicInfo?.topicId && Number.parseInt(this.topicInfo.topicId),
shareInfo:{
appCustomContentId: this.topicInfo?.topicId,
appCustomContentType: this.topicInfo?.topicType + '',
shareTitle: this.topicInfo?.shareTitle,
shareSummary: this.topicInfo?.shareSummary,
appCustomImageUrl: this.topicInfo?.shareCoverUrl,
sharePosterCoverUrl: this.topicInfo?.sharePosterCoverUrl,
shareUrl: this.topicInfo?.shareUrl,
appCustomTargetRelId: this.topicInfo?.relId,
appCustomTargetRelType: this.topicInfo?.relType,
appCustomShowReport: false,
appCustomShowLike: -1,
shareOpen: 1,
sharePosterOpen: this.topicInfo?.posterFlag,
appCustomShowPoster: this.topicInfo?.posterFlag && this.topicInfo?.posterFlag > 0 ? 1 : -1,
}
} as ContentDetailDTO
WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo , this.topicInfo)
WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper)
} else {
console.info(TAG, 'this.contentDetailData')
WDShare.shareContent(this.contentDetailData)
}
}
// 已登录->查询用户对作品收藏状态
private async getInteractDataStatus() {
... ...
import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { DateTimeUtils, Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit';
import {
batchLikeAndCollectResult,
... ... @@ -7,8 +7,11 @@ import {
ContentDetailDTO,
ContentDTO,
contentListParams,
FeedbackTypeBean,
GoldenPositionExtraBean,
InteractDataDTO,
LiveReviewDTO,
LiveRoomDataBean,
MorningEveningPaperDTO,
NavigationBodyDTO,
NavigationDetailDTO,
... ... @@ -22,13 +25,10 @@ import {
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams,
GoldenPositionExtraBean,
FeedbackTypeBean,
LiveRoomDataBean
postRecommendListParams
} from 'wdBean';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
import { ArrayList } from '@kit.ArkTS';
import { SpConstants } from 'wdConstant/Index';
const TAG = 'HttpRequest';
... ... @@ -243,6 +243,14 @@ export class PageRepository {
url = url + "&districtCode=" + HttpUtils.getDistrictCode()
+ "&provinceCode=" + provinceCode
+ "&cityCode=" + HttpUtils.getCityCode()
let per=SPHelper.default.getSync(SpConstants.LOCATION_FIRST_POSITION,true)
if(per){
//检测首次获取地理信息
url = url+'&firstLocation=1'
SPHelper.default.save(SpConstants.LOCATION_FIRST_POSITION,false)
}
}
if (myChannelIds) {
url = url + `&channelIds=${myChannelIds}`
... ...
... ... @@ -221,9 +221,15 @@ export struct PlayUIComponent {
.padding({
top: 1,
right: 4,
bottom: 1
bottom: 1,
})
// .margin({left: this.contentDetailData?.rmhInfo ? 0 : 34})
.margin(
{
left: this.contentDetailData?.rmhInfo
? 0
: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 34 : 0
}
)
}
//回看
else if (this.contentDetailData.liveInfo?.liveState == 'end') {
... ...
... ... @@ -85,6 +85,7 @@ export struct PlayerTitleComponent {
Row() {
this.getLiveStatusView()
}
.margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34})
}
.width('100%')
... ... @@ -144,7 +145,6 @@ export struct PlayerTitleComponent {
.fontWeight(400)
.fontColor(Color.White)
}
}
.backgroundColor('#4D000000')
.borderRadius(2)
... ... @@ -154,7 +154,6 @@ export struct PlayerTitleComponent {
top: 0,
bottom: 0
} : 4)
.margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34})
}
}
}
... ...
... ... @@ -45,10 +45,10 @@ export class WDShare {
}
//专题分享数据转换
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){
shareBean.appCustomTopicType = topicInfoBean.topicType+''
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean?: TopicInfo){
shareBean.appCustomTopicType = topicInfoBean?.topicType+''
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
if(25 == topicInfoBean.topicType){
if(25 == topicInfoBean?.topicType){
shareBean.appCustomShowPosterType = 6
shareBean.appCustomTopicPattern = topicInfoBean.topicPattern
shareBean.appCustomPublishTime = topicInfoBean.topicDate
... ... @@ -76,11 +76,11 @@ export class WDShare {
//文章/直播/话题专题(H5普通文章专题,包含时间链)
shareBean.appCustomShowPosterType = 8
//海报的头图
shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl
shareBean.sharePosterCoverUrl = topicInfoBean?.backgroundImgUrl || ''
shareBean.appCustomIsFrontDaily = false
shareBean.appCustomPosterTitle = topicInfoBean.title
shareBean.appCustomPosterSummary = topicInfoBean.summary
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.appCustomPosterTitle = topicInfoBean?.title || ''
shareBean.appCustomPosterSummary = topicInfoBean?.summary || ''
if(topicInfoBean?.shareContentList != null && topicInfoBean?.shareContentList && topicInfoBean.shareContentList.length > 0){
shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[]
shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
... ...
... ... @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'SpacialTopicPage';
//H5专题
@Entry
@Component
struct SpacialTopicPage {
... ...