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{ | @@ -38,6 +38,7 @@ export class SpConstants{ | ||
| 38 | static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称 | 38 | static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称 |
| 39 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 | 39 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 |
| 40 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 | 40 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 |
| 41 | + static LOCATION_FIRST_POSITION = 'location_first_position'// 定位后顶导首次使用地理信息 | ||
| 41 | 42 | ||
| 42 | //启动页数据存储key | 43 | //启动页数据存储key |
| 43 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' | 44 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' |
| 1 | -import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean'; | 1 | +import { Action, ContentDTO, Params, PhotoListBean, commentInfo, CompDTO } from 'wdBean'; |
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; | 3 | import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; |
| 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; | 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; |
| @@ -72,6 +72,76 @@ export class ProcessUtils { | @@ -72,6 +72,76 @@ export class ProcessUtils { | ||
| 72 | ProcessUtils.processPage(content); | 72 | ProcessUtils.processPage(content); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | + //更多 | ||
| 76 | + static compJumpPage(bean:CompDTO){ | ||
| 77 | + let contentBean = ProcessUtils.compBeanToContentBean(bean) | ||
| 78 | + if(contentBean == null){ | ||
| 79 | + return | ||
| 80 | + } | ||
| 81 | + if(ProcessUtils.checkMoreJumpPage(bean)){ | ||
| 82 | + ProcessUtils.processPage(contentBean) | ||
| 83 | + }else{ | ||
| 84 | + ProcessUtils.moreTojumpLivePage(contentBean); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + static moreTojumpLivePage(contentBean:ContentDTO){ | ||
| 89 | + if(!StringUtils.isEmpty(contentBean.dataSourceType)){ | ||
| 90 | + if(contentBean.dataSourceType == 'LIVE_HORIZONTAL_CARD') { | ||
| 91 | + //直播中 | ||
| 92 | + WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage) | ||
| 93 | + }else if(contentBean.dataSourceType == 'LIVE_RESERVATION'){ | ||
| 94 | + //预约列表 | ||
| 95 | + WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) | ||
| 96 | + }else if(contentBean.dataSourceType == 'LIVE_MONTHLY_RANKING'){ | ||
| 97 | + contentBean.objectType = '6' | ||
| 98 | + ProcessUtils.processPage(contentBean) | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + static checkMoreJumpPage(content:CompDTO){ | ||
| 104 | + let loacalJump = true | ||
| 105 | + if(content.dataSourceType == 'LIVE_HORIZONTAL_CARD'){ | ||
| 106 | + loacalJump = false | ||
| 107 | + }else if(content.dataSourceType == 'LIVE_RESERVATION'){ | ||
| 108 | + loacalJump = false | ||
| 109 | + }else if(content.dataSourceType == 'LIVE_MONTHLY_RANKING'){ | ||
| 110 | + loacalJump = false | ||
| 111 | + } | ||
| 112 | + return loacalJump | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + static compBeanToContentBean(compDTO:CompDTO){ | ||
| 116 | + if(compDTO == null){ | ||
| 117 | + return | ||
| 118 | + } | ||
| 119 | + let content = new ContentDTO() | ||
| 120 | + content.objectType = compDTO.objectType||'0' | ||
| 121 | + content.objectLevel = compDTO.objectLevel | ||
| 122 | + content.objectId = compDTO.objectId | ||
| 123 | + content.pageId = compDTO.pageId||'' | ||
| 124 | + content.newsTitle = compDTO.objectTitle | ||
| 125 | + content.newsSummary = compDTO.objectSummary | ||
| 126 | + // compContentBean.setTopicInfoBean(getTopicInfoBean()); | ||
| 127 | + // compContentBean.setChannelInfoBean(getChannelInfoBean()); | ||
| 128 | + content.bottomNavId = compDTO.bottomNavId | ||
| 129 | + content.sourceInterfaceVal = compDTO.sourceInterfaceVal | ||
| 130 | + content.dataSourceType = compDTO.dataSourceType | ||
| 131 | + content.compId = compDTO.id+'' | ||
| 132 | + content.linkUrl = compDTO.linkUrl | ||
| 133 | + content.appStyle = compDTO.appStyle | ||
| 134 | + content.recommend = compDTO.recommend | ||
| 135 | + content.expIds = compDTO.expIds | ||
| 136 | + content.relId = compDTO.relId | ||
| 137 | + content.relType = compDTO.relType | ||
| 138 | + content.itemId = compDTO.itemId | ||
| 139 | + content.itemType = compDTO.itemType | ||
| 140 | + content.sceneId = compDTO.sceneId | ||
| 141 | + content.traceId = compDTO.traceId | ||
| 142 | + content.traceInfo = compDTO.traceInfo | ||
| 143 | + return content | ||
| 144 | + } | ||
| 75 | /** | 145 | /** |
| 76 | * 页面跳转 | 146 | * 页面跳转 |
| 77 | */ | 147 | */ |
| @@ -114,6 +184,8 @@ export class ProcessUtils { | @@ -114,6 +184,8 @@ export class ProcessUtils { | ||
| 114 | ProcessUtils.gotoAudio(content) | 184 | ProcessUtils.gotoAudio(content) |
| 115 | break; | 185 | break; |
| 116 | case ContentConstants.TYPE_TELETEXT: | 186 | case ContentConstants.TYPE_TELETEXT: |
| 187 | + ProcessUtils.gotoWeb(content); | ||
| 188 | + break; | ||
| 117 | case ContentConstants.TYPE_Activity: | 189 | case ContentConstants.TYPE_Activity: |
| 118 | // 图文详情,跳转h5 | 190 | // 图文详情,跳转h5 |
| 119 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 | 191 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 |
| @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO { | @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO { | ||
| 25 | // meddleDataList: any[]; | 25 | // meddleDataList: any[]; |
| 26 | name: string = ''; | 26 | name: string = ''; |
| 27 | objectId: string = ''; // 跳转页面id? | 27 | objectId: string = ''; // 跳转页面id? |
| 28 | + /** | ||
| 29 | + * 频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间轴专题) | ||
| 30 | + */ | ||
| 31 | + objectLevel:string = '' | ||
| 28 | objectTitle: string = ''; // comp标题 | 32 | objectTitle: string = ''; // comp标题 |
| 33 | + objectSummary: string = ''; // 跳转频道、专题摘要【BFF聚合】 | ||
| 29 | // objectType?: string; // 跳转类型,枚举: | 34 | // objectType?: string; // 跳转类型,枚举: |
| 30 | operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 | 35 | operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 |
| 31 | // pageId?: any; | 36 | // pageId?: any; |
| @@ -51,6 +56,22 @@ export class CompDTO implements BaseDTO { | @@ -51,6 +56,22 @@ export class CompDTO implements BaseDTO { | ||
| 51 | 56 | ||
| 52 | // keyGenerator相关字符串,用于刷新list布局 | 57 | // keyGenerator相关字符串,用于刷新list布局 |
| 53 | timestamp: String = '1' | 58 | timestamp: String = '1' |
| 59 | + | ||
| 60 | + bottomNavId:string = '' | ||
| 61 | + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口 | ||
| 62 | + sourceInterfaceVal: number = 0 | ||
| 63 | + | ||
| 64 | + appStyle: string = ''; | ||
| 65 | + /** | ||
| 66 | + * 是否推荐数据;默认0:否,1:是 | ||
| 67 | + */ | ||
| 68 | + recommend:number = 0 | ||
| 69 | + relId: string = ''; | ||
| 70 | + relType: string = ''; | ||
| 71 | + itemType: string = ''; | ||
| 72 | + sceneId: string = ''; | ||
| 73 | + traceId: string = ''; | ||
| 74 | + traceInfo: string = ''; | ||
| 54 | /** | 75 | /** |
| 55 | * 创建新的compbean对象 | 76 | * 创建新的compbean对象 |
| 56 | * @param old | 77 | * @param old |
| @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO { | @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO { | ||
| 27 | liveType?: string; // 直播新闻-直播状态 | 27 | liveType?: string; // 直播新闻-直播状态 |
| 28 | expIds: string = ''; | 28 | expIds: string = ''; |
| 29 | itemId: string = ''; | 29 | itemId: string = ''; |
| 30 | + itemType: string = ''; | ||
| 30 | shareFlag?: string = '1'; | 31 | shareFlag?: string = '1'; |
| 31 | appStyle: string = ''; | 32 | appStyle: string = ''; |
| 32 | cityCode: string = ''; | 33 | cityCode: string = ''; |
| @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO { | @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO { | ||
| 123 | timestamp: String = '1' | 124 | timestamp: String = '1' |
| 124 | // 自定义参数,用于跳转对应页面时 传递targetLayout参数用 | 125 | // 自定义参数,用于跳转对应页面时 传递targetLayout参数用 |
| 125 | customParamTargetLayout?: string | 126 | customParamTargetLayout?: string |
| 127 | + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口 | ||
| 128 | + sourceInterfaceVal: number = 0 | ||
| 129 | + /** | ||
| 130 | + * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) | ||
| 131 | + */ | ||
| 132 | + dataSourceType: string = ''; | ||
| 133 | + //组件ID | ||
| 134 | + compId: string = ''; | ||
| 135 | + /** | ||
| 136 | + * 是否推荐数据;默认0:否,1:是 | ||
| 137 | + */ | ||
| 138 | + recommend:number = 0 | ||
| 139 | + traceId: string = ''; | ||
| 140 | + traceInfo: string = ''; | ||
| 126 | 141 | ||
| 127 | static clone(old: ContentDTO): ContentDTO { | 142 | static clone(old: ContentDTO): ContentDTO { |
| 128 | let content = new ContentDTO(); | 143 | let content = new ContentDTO(); |
| 1 | +import { InteractDataDTO } from '../content/InteractDataDTO'; | ||
| 1 | import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; | 2 | import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; |
| 2 | -export interface slideShows { | ||
| 3 | - fullColumnImgUrls: FullColumnImgUrlDTO[]; | ||
| 4 | - linkUrl?: string; | ||
| 5 | - newsId: string; | ||
| 6 | - newsTitle?: string; | ||
| 7 | - newsTitleColor?: string; | ||
| 8 | - objectLevel?: string; | ||
| 9 | - objectType: string; | ||
| 10 | - pageId?: string; | ||
| 11 | - photoNum?: string; | ||
| 12 | - publishTime: number; | ||
| 13 | - relId: string; | ||
| 14 | - source?: string; | ||
| 15 | - timeBlurred?: string; | ||
| 16 | - videoDuration?: string; | ||
| 17 | - videoLandscape?: string; | ||
| 18 | - videoUrl?: string; | ||
| 19 | - voiceDuration?: string; | 3 | + |
| 4 | +@Observed | ||
| 5 | +export class slideShows { | ||
| 6 | + fullColumnImgUrls?: FullColumnImgUrlDTO[]; | ||
| 7 | + linkUrl: string=''; | ||
| 8 | + newsId: string = ''; | ||
| 9 | + newsTitle: string=''; | ||
| 10 | + newsTitleColor: string=''; | ||
| 11 | + objectLevel: string=''; | ||
| 12 | + objectType: string =''; | ||
| 13 | + pageId: string=''; | ||
| 14 | + photoNum: string=''; | ||
| 15 | + publishTime: number=0; | ||
| 16 | + relId: string=''; | ||
| 17 | + source: string=''; | ||
| 18 | + timeBlurred: string=''; | ||
| 19 | + videoDuration: string=''; | ||
| 20 | + videoLandscape: string=''; | ||
| 21 | + videoUrl: string=''; | ||
| 22 | + voiceDuration: string=''; | ||
| 23 | + | ||
| 24 | + interactDataDto? :InteractDataDTO | ||
| 20 | } | 25 | } |
| @@ -72,7 +72,7 @@ export struct CompParser { | @@ -72,7 +72,7 @@ export struct CompParser { | ||
| 72 | 72 | ||
| 73 | build() { | 73 | build() { |
| 74 | Column() { | 74 | Column() { |
| 75 | - //Text(JSON.stringify(this.compDTO.compStyle)) | 75 | + // Text(JSON.stringify(this.compDTO.compStyle)) |
| 76 | this.componentBuilder(); | 76 | this.componentBuilder(); |
| 77 | } | 77 | } |
| 78 | } | 78 | } |
| @@ -90,16 +90,18 @@ export struct CompParser { | @@ -90,16 +90,18 @@ export struct CompParser { | ||
| 90 | } | 90 | } |
| 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 92 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 92 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 93 | - | 93 | + // Text('LiveHorizontalCardComponent') |
| 94 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 94 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 96 | if (this.compDTO.operDataList.length > 1) { | 96 | if (this.compDTO.operDataList.length > 1) { |
| 97 | + // Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent') | ||
| 97 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ | 98 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ |
| 98 | compDTO: this.compDTO, | 99 | compDTO: this.compDTO, |
| 99 | pageId: this.pageId, | 100 | pageId: this.pageId, |
| 100 | pageName: this.pageName | 101 | pageName: this.pageName |
| 101 | }) | 102 | }) |
| 102 | } else { | 103 | } else { |
| 104 | + // Text('HorizontalStrokeCardThreeTwoRadioForOneComponent') | ||
| 103 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ | 105 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ |
| 104 | compDTO: this.compDTO, | 106 | compDTO: this.compDTO, |
| 105 | pageId: this.pageId, | 107 | pageId: this.pageId, |
| 1 | -import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 1 | +import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo } from 'wdBean'; |
| 2 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 3 | import { CommonConstants } from 'wdConstant' | 3 | import { CommonConstants } from 'wdConstant' |
| 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent { | @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent { | ||
| 41 | @State isNetConnected: boolean = true | 41 | @State isNetConnected: boolean = true |
| 42 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | @State showComment: boolean = false | 43 | @State showComment: boolean = false |
| 44 | + @State topicInfo: TopicInfo = {} as TopicInfo | ||
| 45 | + | ||
| 44 | private trySendData2H5() { | 46 | private trySendData2H5() { |
| 45 | if (!this.webPrepared || !this.dataPrepared) { | 47 | if (!this.webPrepared || !this.dataPrepared) { |
| 46 | return | 48 | return |
| @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent { | @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent { | ||
| 140 | if(pageInfoMsg && pageInfoMsg.data){ | 142 | if(pageInfoMsg && pageInfoMsg.data){ |
| 141 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) | 143 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) |
| 142 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) | 144 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) |
| 143 | - if(pageInfoMsg.data.topicInfo?.shareOpen === 1){ | 145 | + console.log('contentDetailData pageInfoMsg.data', JSON.stringify(pageInfoMsg.data)) |
| 146 | + this.topicInfo = pageInfoMsg.data.topicInfo | ||
| 147 | + this.contentDetailData.newsId = Number(this.topicInfo.topicId) | ||
| 148 | + this.contentDetailData.newsType = this.topicInfo.topicType | ||
| 149 | + if(this.topicInfo?.shareOpen === 1){ | ||
| 150 | + this.contentDetailData.shareInfo.shareOpen = this.topicInfo?.shareOpen | ||
| 151 | + console.log('contentDetailData this.topicInfo', JSON.stringify(this.topicInfo)) | ||
| 144 | if (!this.operationButtonList.includes('share')) { | 152 | if (!this.operationButtonList.includes('share')) { |
| 145 | this.operationButtonList.push('share'); | 153 | this.operationButtonList.push('share'); |
| 146 | } | 154 | } |
| 147 | - }else{ | 155 | + } else { |
| 148 | this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') | 156 | this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') |
| 149 | } | 157 | } |
| 150 | } | 158 | } |
| 151 | 159 | ||
| 152 | - console.log('contentDetailData',this.contentDetailData) | 160 | + console.log('contentDetailData', JSON.stringify(this.contentDetailData)) |
| 153 | } | 161 | } |
| 154 | } | 162 | } |
| 155 | } | 163 | } |
| @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent { | @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent { | ||
| 199 | contentDetailData: this.contentDetailData, | 207 | contentDetailData: this.contentDetailData, |
| 200 | publishCommentModel: this.publishCommentModel, | 208 | publishCommentModel: this.publishCommentModel, |
| 201 | operationButtonList: this.operationButtonList, | 209 | operationButtonList: this.operationButtonList, |
| 210 | + topicInfo: this.topicInfo, | ||
| 202 | styleType: 1, | 211 | styleType: 1, |
| 203 | onCommentIconClick:()=>{ | 212 | onCommentIconClick:()=>{ |
| 204 | this.showCommentList = true | 213 | this.showCommentList = true |
| @@ -6,8 +6,12 @@ import router from '@ohos.router' | @@ -6,8 +6,12 @@ import router from '@ohos.router' | ||
| 6 | @Reusable | 6 | @Reusable |
| 7 | @Component | 7 | @Component |
| 8 | export struct CardSourceInfo { | 8 | export struct CardSourceInfo { |
| 9 | - @State contentDTO: ContentDTO = new ContentDTO(); | 9 | + @State @Watch('checkData') contentDTO: ContentDTO = new ContentDTO(); |
| 10 | @ObjectLink compDTO: CompDTO | 10 | @ObjectLink compDTO: CompDTO |
| 11 | + // 特殊稿件内部item展示的来源信息 | ||
| 12 | + isCompInnerSource: boolean = false | ||
| 13 | + // 是否有展示的信息,如来源,标签、时间、评论 | ||
| 14 | + @State viewShowData: boolean = true | ||
| 11 | 15 | ||
| 12 | aboutToAppear(): void { | 16 | aboutToAppear(): void { |
| 13 | } | 17 | } |
| @@ -21,6 +25,7 @@ export struct CardSourceInfo { | @@ -21,6 +25,7 @@ export struct CardSourceInfo { | ||
| 21 | 25 | ||
| 22 | aboutToDisappear(): void { | 26 | aboutToDisappear(): void { |
| 23 | } | 27 | } |
| 28 | + | ||
| 24 | handleTimeStr() { | 29 | handleTimeStr() { |
| 25 | return DateTimeUtils.getCommentTime( | 30 | return DateTimeUtils.getCommentTime( |
| 26 | this.contentDTO.publishTime.includes(' ') | 31 | this.contentDTO.publishTime.includes(' ') |
| @@ -54,7 +59,6 @@ export struct CardSourceInfo { | @@ -54,7 +59,6 @@ export struct CardSourceInfo { | ||
| 54 | return true | 59 | return true |
| 55 | } | 60 | } |
| 56 | 61 | ||
| 57 | - | ||
| 58 | /** | 62 | /** |
| 59 | * 全域数字显示规则 | 63 | * 全域数字显示规则 |
| 60 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | 64 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 |
| @@ -64,17 +68,17 @@ export struct CardSourceInfo { | @@ -64,17 +68,17 @@ export struct CardSourceInfo { | ||
| 64 | * 5、0 和空 不显示 | 68 | * 5、0 和空 不显示 |
| 65 | */ | 69 | */ |
| 66 | handlerNum(number: string) { | 70 | handlerNum(number: string) { |
| 67 | - const num = number??'0'; | 71 | + const num = number ?? '0'; |
| 68 | if (Number.parseInt(num) <= 9999) { | 72 | if (Number.parseInt(num) <= 9999) { |
| 69 | return Number.parseInt(num).toString() | 73 | return Number.parseInt(num).toString() |
| 70 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | 74 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { |
| 71 | const num1: string = num.slice(0, -4); // 万 | 75 | const num1: string = num.slice(0, -4); // 万 |
| 72 | const num2: string = num.slice(-4, -3); // 千 | 76 | const num2: string = num.slice(-4, -3); // 千 |
| 73 | - return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | 77 | + return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万' |
| 74 | } else if (Number.parseInt(num) > 99999999) { | 78 | } else if (Number.parseInt(num) > 99999999) { |
| 75 | const num1: string = num.slice(0, -8); // 亿 | 79 | const num1: string = num.slice(0, -8); // 亿 |
| 76 | const num2: string = num.slice(-8, -7); | 80 | const num2: string = num.slice(-8, -7); |
| 77 | - return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | 81 | + return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿' |
| 78 | } | 82 | } |
| 79 | return num | 83 | return num |
| 80 | } | 84 | } |
| @@ -87,33 +91,29 @@ export struct CardSourceInfo { | @@ -87,33 +91,29 @@ export struct CardSourceInfo { | ||
| 87 | } | 91 | } |
| 88 | 92 | ||
| 89 | build() { | 93 | build() { |
| 90 | - Flex({ alignItems: ItemAlign.Center }) { | ||
| 91 | - if (this.contentDTO.corner) { | ||
| 92 | - Text(this.contentDTO.corner) | 94 | + Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { |
| 95 | + // 标签 | ||
| 96 | + if (this.contentDTO.cornerMark || this.contentDTO.corner) { | ||
| 97 | + Text(this.contentDTO.cornerMark || this.contentDTO.corner) | ||
| 93 | .fontSize($r("app.float.font_size_11")) | 98 | .fontSize($r("app.float.font_size_11")) |
| 94 | .fontColor($r("app.color.color_ED2800")) | 99 | .fontColor($r("app.color.color_ED2800")) |
| 95 | - .margin({ right: 2 }) | ||
| 96 | - } | ||
| 97 | - if(this.contentDTO.cornerMark){ | ||
| 98 | - Text(this.contentDTO.cornerMark) | ||
| 99 | - .fontSize($r("app.float.font_size_11")) | ||
| 100 | - .fontColor($r("app.color.color_ED2800")) | ||
| 101 | - .margin({ right: 2 }) | 100 | + .margin({ right: 6 }) |
| 101 | + .flexShrink(0) | ||
| 102 | } | 102 | } |
| 103 | - if (this.contentDTO.rmhPlatform === 1) { | ||
| 104 | - Text(this.contentDTO.rmhInfo?.rmhName) | ||
| 105 | - .fontSize($r("app.float.font_size_11")) | ||
| 106 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 107 | - .maxLines(1) | ||
| 108 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 109 | - } else if (this.contentDTO.source) { | ||
| 110 | - Text(`${this.contentDTO.source}`) | 103 | + |
| 104 | + // 来源信息 | ||
| 105 | + if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { | ||
| 106 | + Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source) | ||
| 111 | .fontSize($r("app.float.font_size_11")) | 107 | .fontSize($r("app.float.font_size_11")) |
| 112 | .fontColor($r("app.color.color_B0B0B0")) | 108 | .fontColor($r("app.color.color_B0B0B0")) |
| 113 | .maxLines(1) | 109 | .maxLines(1) |
| 114 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 110 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 115 | } | 111 | } |
| 116 | - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum | 112 | + |
| 113 | + // 点 | ||
| 114 | + if (this.showTime() || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | ||
| 115 | + this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 116 | + (this.getContentDtoBean()?.interactData?.commentNum | ||
| 117 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | 117 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' |
| 118 | || (this.contentDTO.isSearch || this.contentDTO.isCollection || | 118 | || (this.contentDTO.isSearch || this.contentDTO.isCollection || |
| 119 | !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | 119 | !this.contentDTO.isSearch && DateTimeUtils.getCommentTime |
| @@ -123,52 +123,44 @@ export struct CardSourceInfo { | @@ -123,52 +123,44 @@ export struct CardSourceInfo { | ||
| 123 | .indexOf | 123 | .indexOf |
| 124 | ('-') === -1) | 124 | ('-') === -1) |
| 125 | )) { | 125 | )) { |
| 126 | + | ||
| 126 | Image($r("app.media.point")) | 127 | Image($r("app.media.point")) |
| 127 | .width(11) | 128 | .width(11) |
| 128 | .height(11) | 129 | .height(11) |
| 130 | + | ||
| 129 | } | 131 | } |
| 130 | - // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 | ||
| 131 | - // if (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 132 | - // (!this.contentDTO.isSearch && | ||
| 133 | - // DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) { | ||
| 134 | - // | ||
| 135 | - // Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 136 | - // .fontSize($r("app.float.font_size_11")) | ||
| 137 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 138 | - // .flexShrink(0); | ||
| 139 | - // } | ||
| 140 | - // if (this.contentDTO.source && this.showTime()) { | ||
| 141 | - // Text(this.handleTimeStr()) | ||
| 142 | - // .fontSize($r("app.float.font_size_11")) | ||
| 143 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 144 | - // .flexShrink(0) | ||
| 145 | - // .margin({right: 4}) | ||
| 146 | - // } | 132 | + |
| 133 | + // 发布日期 | ||
| 147 | if (this.showTime()) { | 134 | if (this.showTime()) { |
| 148 | Text(this.handleTimeStr()) | 135 | Text(this.handleTimeStr()) |
| 149 | .fontSize($r("app.float.font_size_11")) | 136 | .fontSize($r("app.float.font_size_11")) |
| 150 | .fontColor($r("app.color.color_B0B0B0")) | 137 | .fontColor($r("app.color.color_B0B0B0")) |
| 151 | .flexShrink(0) | 138 | .flexShrink(0) |
| 152 | - .margin({right: 4}) | 139 | + .margin({ right: 4 }) |
| 153 | } | 140 | } |
| 154 | - if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) { | 141 | + |
| 142 | + // 评论数 | ||
| 143 | + if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 144 | + this.showCommentNum()) { | ||
| 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 145 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 156 | .fontSize($r("app.float.font_size_11")) | 146 | .fontSize($r("app.float.font_size_11")) |
| 157 | .fontColor($r("app.color.color_B0B0B0")) | 147 | .fontColor($r("app.color.color_B0B0B0")) |
| 158 | .flexShrink(0) | 148 | .flexShrink(0) |
| 149 | + } else { | ||
| 150 | + | ||
| 151 | + if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | ||
| 152 | + Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) | ||
| 153 | + .fontSize($r("app.float.font_size_11")) | ||
| 154 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 155 | + .flexShrink(0) | ||
| 156 | + } | ||
| 157 | + | ||
| 159 | } | 158 | } |
| 160 | 159 | ||
| 161 | - // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | ||
| 162 | - // Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | ||
| 163 | - // .fontSize($r("app.float.font_size_11")) | ||
| 164 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 165 | - // .flexShrink(0) | ||
| 166 | - // .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | ||
| 167 | - // Visibility.Visible) | ||
| 168 | - // } | ||
| 169 | } | 160 | } |
| 170 | .width(CommonConstants.FULL_WIDTH) | 161 | .width(CommonConstants.FULL_WIDTH) |
| 171 | - .margin({ top: 8 }) | 162 | + .height(16) |
| 163 | + .margin({ top: this.viewShowData ? 8 : 0 }) | ||
| 172 | } | 164 | } |
| 173 | 165 | ||
| 174 | /** | 166 | /** |
| @@ -184,4 +176,45 @@ export struct CardSourceInfo { | @@ -184,4 +176,45 @@ export struct CardSourceInfo { | ||
| 184 | } | 176 | } |
| 185 | return this.compDTO.operDataList[0] | 177 | return this.compDTO.operDataList[0] |
| 186 | } | 178 | } |
| 179 | + | ||
| 180 | + /** | ||
| 181 | + * 检测是否有展示的数据 | ||
| 182 | + */ | ||
| 183 | + checkData() { | ||
| 184 | + | ||
| 185 | + let have = false | ||
| 186 | + | ||
| 187 | + if (this.contentDTO.corner) { | ||
| 188 | + have = true | ||
| 189 | + } | ||
| 190 | + if (this.contentDTO.cornerMark) { | ||
| 191 | + have = true | ||
| 192 | + } | ||
| 193 | + if (this.contentDTO.rmhPlatform === 1) { | ||
| 194 | + have = true | ||
| 195 | + } else if (this.contentDTO.source) { | ||
| 196 | + have = true | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + // 发布日期 | ||
| 200 | + if (this.showTime()) { | ||
| 201 | + have = true | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + // 评论数 | ||
| 205 | + if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 206 | + this.showCommentNum()) { | ||
| 207 | + have = true | ||
| 208 | + } else { | ||
| 209 | + if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | ||
| 210 | + have = true | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + if (have) { | ||
| 215 | + | ||
| 216 | + } else { | ||
| 217 | + this.viewShowData = false | ||
| 218 | + } | ||
| 219 | + } | ||
| 187 | } | 220 | } |
| @@ -116,7 +116,8 @@ export struct RmhTitle { | @@ -116,7 +116,8 @@ export struct RmhTitle { | ||
| 116 | Stack() { | 116 | Stack() { |
| 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) | 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 118 | .width(36) | 118 | .width(36) |
| 119 | - .height(36).borderRadius(50) | 119 | + .height(36) |
| 120 | + .borderRadius(50) | ||
| 120 | Image(this.rmhInfo?.authIcon) | 121 | Image(this.rmhInfo?.authIcon) |
| 121 | .width(14) | 122 | .width(14) |
| 122 | .height(14) | 123 | .height(14) |
| @@ -128,10 +129,13 @@ export struct RmhTitle { | @@ -128,10 +129,13 @@ export struct RmhTitle { | ||
| 128 | 129 | ||
| 129 | Column() { | 130 | Column() { |
| 130 | Text(this.rmhInfo?.rmhName) | 131 | Text(this.rmhInfo?.rmhName) |
| 131 | - .fontSize($r('app.float.font_size_13')) | 132 | + .fontSize(15) |
| 132 | .fontColor($r('app.color.color_222222')) | 133 | .fontColor($r('app.color.color_222222')) |
| 133 | .fontWeight(600) | 134 | .fontWeight(600) |
| 134 | .alignSelf(ItemAlign.Start) | 135 | .alignSelf(ItemAlign.Start) |
| 136 | + .height(21) | ||
| 137 | + .lineHeight(21) | ||
| 138 | + .margin({bottom: 1}) | ||
| 135 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { | 139 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { |
| 136 | Row() { | 140 | Row() { |
| 137 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { | 141 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { |
| @@ -139,11 +143,13 @@ export struct RmhTitle { | @@ -139,11 +143,13 @@ export struct RmhTitle { | ||
| 139 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) | 143 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) |
| 140 | .fontSize($r("app.float.font_size_12")) | 144 | .fontSize($r("app.float.font_size_12")) |
| 141 | .fontColor($r("app.color.color_B0B0B0")) | 145 | .fontColor($r("app.color.color_B0B0B0")) |
| 146 | + .height(14) | ||
| 147 | + .lineHeight(14) | ||
| 142 | } | 148 | } |
| 143 | if (this.publishTime && this.rmhInfo?.rmhDesc) { | 149 | if (this.publishTime && this.rmhInfo?.rmhDesc) { |
| 144 | Image($r('app.media.point')) | 150 | Image($r('app.media.point')) |
| 145 | - .width(16) | ||
| 146 | - .height(16) | 151 | + .width(14) |
| 152 | + .height(14) | ||
| 147 | } | 153 | } |
| 148 | } | 154 | } |
| 149 | if(this.rmhInfo?.rmhDesc != undefined){ | 155 | if(this.rmhInfo?.rmhDesc != undefined){ |
| @@ -154,12 +160,16 @@ export struct RmhTitle { | @@ -154,12 +160,16 @@ export struct RmhTitle { | ||
| 154 | .alignSelf(ItemAlign.Start) | 160 | .alignSelf(ItemAlign.Start) |
| 155 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 161 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 156 | .textAlign(TextAlign.Start) | 162 | .textAlign(TextAlign.Start) |
| 163 | + .height(14) | ||
| 164 | + .lineHeight(14) | ||
| 157 | } | 165 | } |
| 158 | 166 | ||
| 159 | } | 167 | } |
| 160 | .width('75%') | 168 | .width('75%') |
| 169 | + .height(14) | ||
| 161 | } | 170 | } |
| 162 | } | 171 | } |
| 172 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 163 | 173 | ||
| 164 | Blank() | 174 | Blank() |
| 165 | if (this.rmhInfo?.cnIsAttention) { | 175 | if (this.rmhInfo?.cnIsAttention) { |
| 1 | -import { ContentDTO, slideShows, VideoInfoDTO, CompDTO } from 'wdBean'; | 1 | +import { ContentDTO, slideShows, VideoInfoDTO, CompDTO, InteractDataDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| @@ -8,6 +8,8 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,8 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | import router from '@ohos.router' | 10 | import router from '@ohos.router' |
| 11 | +import { BasePageHelp } from '../page/template/BasePageHelp'; | ||
| 12 | +import { Logger } from 'wdKit/Index'; | ||
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 13 | * 大专题卡--CompStyle: 10 | 15 | * 大专题卡--CompStyle: 10 |
| @@ -25,11 +27,39 @@ export struct Card10Component { | @@ -25,11 +27,39 @@ export struct Card10Component { | ||
| 25 | @State titleMarked: boolean = false; | 27 | @State titleMarked: boolean = false; |
| 26 | @State textArr: textItem[] = [] | 28 | @State textArr: textItem[] = [] |
| 27 | @State hideDetail: boolean = false; | 29 | @State hideDetail: boolean = false; |
| 30 | + basePageHelp: BasePageHelp = new BasePageHelp | ||
| 31 | + // 稿件参与批查,需要对列表信息单独重绘 | ||
| 32 | + @State isBatchData: boolean = false | ||
| 28 | 33 | ||
| 29 | async aboutToAppear(): Promise<void> { | 34 | async aboutToAppear(): Promise<void> { |
| 30 | this.titleInit(); | 35 | this.titleInit(); |
| 31 | this.loadImg = await onlyWifiLoadImg(); | 36 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | this.initHideDetail(); | 37 | this.initHideDetail(); |
| 38 | + | ||
| 39 | + if (!this.hideDetail) { | ||
| 40 | + this.isBatchData = false | ||
| 41 | + // 批查评论数据 | ||
| 42 | + let interactArray = this.basePageHelp.getCompInteractParams(this.contentDTO.slideShows) | ||
| 43 | + if (interactArray.contentList != null && interactArray.contentList.length > 0) { | ||
| 44 | + this.basePageHelp.requestCompInteractData(interactArray) | ||
| 45 | + .then((result) => { | ||
| 46 | + if (result != null && result.length > 0) { | ||
| 47 | + this.isBatchData = true | ||
| 48 | + this.contentDTO.slideShows.forEach((slideShowBean) => { | ||
| 49 | + let newsId = slideShowBean.newsId | ||
| 50 | + for (let interactBean of result) { | ||
| 51 | + console.debug(TAG, JSON.stringify(interactBean)) | ||
| 52 | + if (newsId == interactBean.contentId) { | ||
| 53 | + slideShowBean.interactDataDto = interactBean | ||
| 54 | + break | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + }) | ||
| 58 | + } | ||
| 59 | + }) | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + | ||
| 33 | } | 63 | } |
| 34 | 64 | ||
| 35 | initHideDetail() { | 65 | initHideDetail() { |
| @@ -40,7 +70,7 @@ export struct Card10Component { | @@ -40,7 +70,7 @@ export struct Card10Component { | ||
| 40 | } | 70 | } |
| 41 | 71 | ||
| 42 | titleInit() { | 72 | titleInit() { |
| 43 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 73 | + const titleInitRes: titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); |
| 44 | this.titleMarked = titleInitRes.titleMarked; | 74 | this.titleMarked = titleInitRes.titleMarked; |
| 45 | this.textArr = titleInitRes.textArr; | 75 | this.textArr = titleInitRes.textArr; |
| 46 | } | 76 | } |
| @@ -94,17 +124,14 @@ export struct Card10Component { | @@ -94,17 +124,14 @@ export struct Card10Component { | ||
| 94 | 124 | ||
| 95 | // 专题列表--后端返回三个, | 125 | // 专题列表--后端返回三个, |
| 96 | if (!this.hideDetail) { | 126 | if (!this.hideDetail) { |
| 97 | - Column() { | ||
| 98 | - ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 99 | - this.timelineItem(item, index) | ||
| 100 | - if (index < this.contentDTO.slideShows.length - 1) { | ||
| 101 | - // 在不是最后一个元素的情况下添加分隔符 | ||
| 102 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 103 | - } | ||
| 104 | - }) | ||
| 105 | - } | 127 | + |
| 128 | + if (this.isBatchData) { | ||
| 129 | + this.drawCompList() | ||
| 130 | + } else { | ||
| 131 | + this.drawCompList() | ||
| 106 | } | 132 | } |
| 107 | 133 | ||
| 134 | + } | ||
| 108 | 135 | ||
| 109 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 | 136 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 |
| 110 | if (this.contentDTO.hasMore == 1 && !this.hideDetail) { | 137 | if (this.contentDTO.hasMore == 1 && !this.hideDetail) { |
| @@ -141,8 +168,26 @@ export struct Card10Component { | @@ -141,8 +168,26 @@ export struct Card10Component { | ||
| 141 | } | 168 | } |
| 142 | 169 | ||
| 143 | @Builder | 170 | @Builder |
| 171 | + drawCompList() { | ||
| 172 | + | ||
| 173 | + Column() { | ||
| 174 | + ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 175 | + this.timelineItem(item, index) | ||
| 176 | + if (index < this.contentDTO.slideShows.length - 1) { | ||
| 177 | + // 在不是最后一个元素的情况下添加分隔符 | ||
| 178 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 179 | + } | ||
| 180 | + }) | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + @Builder | ||
| 144 | timelineItem(item: slideShows, index: number) { | 186 | timelineItem(item: slideShows, index: number) { |
| 145 | Row() { | 187 | Row() { |
| 188 | + // 有图片资源的 | ||
| 189 | + if (item.fullColumnImgUrls && item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 190 | + | ||
| 146 | Column() { | 191 | Column() { |
| 147 | Stack() { | 192 | Stack() { |
| 148 | if (item.objectType == '5') { | 193 | if (item.objectType == '5') { |
| @@ -161,6 +206,7 @@ export struct Card10Component { | @@ -161,6 +206,7 @@ export struct Card10Component { | ||
| 161 | //bottom 评论等信息 | 206 | //bottom 评论等信息 |
| 162 | CardSourceInfo( | 207 | CardSourceInfo( |
| 163 | { | 208 | { |
| 209 | + isCompInnerSource: true, | ||
| 164 | compDTO: this.compDTO, | 210 | compDTO: this.compDTO, |
| 165 | contentDTO: this.createContent(item) | 211 | contentDTO: this.createContent(item) |
| 166 | } | 212 | } |
| @@ -170,8 +216,6 @@ export struct Card10Component { | @@ -170,8 +216,6 @@ export struct Card10Component { | ||
| 170 | .height(78) | 216 | .height(78) |
| 171 | .alignItems(HorizontalAlign.Start) | 217 | .alignItems(HorizontalAlign.Start) |
| 172 | 218 | ||
| 173 | - // 右侧图片 | ||
| 174 | - if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 175 | Stack() { | 219 | Stack() { |
| 176 | Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') | 220 | Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') |
| 177 | .backgroundColor(0xf5f5f5) | 221 | .backgroundColor(0xf5f5f5) |
| @@ -186,6 +230,33 @@ export struct Card10Component { | @@ -186,6 +230,33 @@ export struct Card10Component { | ||
| 186 | } | 230 | } |
| 187 | .alignContent(Alignment.BottomEnd) | 231 | .alignContent(Alignment.BottomEnd) |
| 188 | .height(78) | 232 | .height(78) |
| 233 | + }else{ | ||
| 234 | + Column() { | ||
| 235 | + Stack() { | ||
| 236 | + if (item.objectType == '5') { | ||
| 237 | + Notes({ objectType: 5 }) | ||
| 238 | + } | ||
| 239 | + Text(item.newsTitle) | ||
| 240 | + .fontSize($r('app.float.font_size_17')) | ||
| 241 | + .fontWeight(400) | ||
| 242 | + .fontColor($r('app.color.color_222222')) | ||
| 243 | + .maxLines(2) | ||
| 244 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 245 | + .textIndent(item.objectType == '5' ? 38 : 0) | ||
| 246 | + }.alignContent(Alignment.TopStart) | ||
| 247 | + | ||
| 248 | + //bottom 评论等信息 | ||
| 249 | + CardSourceInfo( | ||
| 250 | + { | ||
| 251 | + isCompInnerSource: true, | ||
| 252 | + compDTO: this.compDTO, | ||
| 253 | + contentDTO: this.createContent(item) | ||
| 254 | + } | ||
| 255 | + ) | ||
| 256 | + } | ||
| 257 | + .layoutWeight(1) | ||
| 258 | + .alignItems(HorizontalAlign.Start) | ||
| 259 | + | ||
| 189 | } | 260 | } |
| 190 | } | 261 | } |
| 191 | .padding({ top: 10, bottom: 10 }) | 262 | .padding({ top: 10, bottom: 10 }) |
| @@ -201,8 +272,9 @@ export struct Card10Component { | @@ -201,8 +272,9 @@ export struct Card10Component { | ||
| 201 | 272 | ||
| 202 | private createContent(item: slideShows): ContentDTO { | 273 | private createContent(item: slideShows): ContentDTO { |
| 203 | let contentDTO = new ContentDTO() | 274 | let contentDTO = new ContentDTO() |
| 204 | - contentDTO.publishTime = item.publishTime.toString() || ''; | 275 | + contentDTO.publishTime = item.publishTime?.toString() || ''; |
| 205 | contentDTO.source = item.source || ''; | 276 | contentDTO.source = item.source || ''; |
| 277 | + contentDTO.interactData = item.interactDataDto | ||
| 206 | return contentDTO; | 278 | return contentDTO; |
| 207 | } | 279 | } |
| 208 | 280 |
| @@ -55,7 +55,7 @@ export struct Card14Component { | @@ -55,7 +55,7 @@ export struct Card14Component { | ||
| 55 | ) | 55 | ) |
| 56 | } | 56 | } |
| 57 | // 左标题,右图 | 57 | // 左标题,右图 |
| 58 | - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) { | 58 | + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { |
| 59 | 59 | ||
| 60 | Text() { | 60 | Text() { |
| 61 | if (this.titleMarked) { | 61 | if (this.titleMarked) { |
| @@ -395,7 +395,7 @@ export struct PaperSingleColumn999CardView { | @@ -395,7 +395,7 @@ export struct PaperSingleColumn999CardView { | ||
| 395 | private item: ContentDTO = new ContentDTO(); | 395 | private item: ContentDTO = new ContentDTO(); |
| 396 | private index: number = -1; | 396 | private index: number = -1; |
| 397 | @State isRead: boolean = false;//已读状态 | 397 | @State isRead: boolean = false;//已读状态 |
| 398 | - @State interactData: InteractDataDTO = {} as InteractDataDTO; | 398 | + @State interactData: InteractDataDTO = new InteractDataDTO |
| 399 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] | 399 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] |
| 400 | 400 | ||
| 401 | getPublishTime(): string { | 401 | getPublishTime(): string { |
| @@ -298,7 +298,7 @@ struct ChannelSubscriptionLayout { | @@ -298,7 +298,7 @@ struct ChannelSubscriptionLayout { | ||
| 298 | Text(INDEX_SETTING_SUBTITLE) | 298 | Text(INDEX_SETTING_SUBTITLE) |
| 299 | .fontSize(12) | 299 | .fontSize(12) |
| 300 | .fontWeight(400) | 300 | .fontWeight(400) |
| 301 | - .fontColor('#222222') | 301 | + .fontColor('#80222222') |
| 302 | } | 302 | } |
| 303 | .width('100%') | 303 | .width('100%') |
| 304 | .margin({ top: 22, bottom: 16 }) | 304 | .margin({ top: 22, bottom: 16 }) |
| 1 | -import { CompDTO, | 1 | +import { |
| 2 | + CompDTO, | ||
| 2 | ContentBean, | 3 | ContentBean, |
| 3 | ContentDTO, | 4 | ContentDTO, |
| 4 | InteractDataDTO, | 5 | InteractDataDTO, |
| 5 | - InteractParam, LiveRoomDataBean, ReserveBean, ReserveItemBean } from 'wdBean/Index' | 6 | + InteractParam, |
| 7 | + LiveRoomDataBean, | ||
| 8 | + ReserveBean, | ||
| 9 | + ReserveItemBean, | ||
| 10 | + slideShows | ||
| 11 | +} from 'wdBean/Index' | ||
| 6 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO' | 12 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO' |
| 7 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index' | 13 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index' |
| 8 | import { HttpUtils, ResponseDTO } from 'wdNetwork/Index' | 14 | import { HttpUtils, ResponseDTO } from 'wdNetwork/Index' |
| @@ -22,7 +28,7 @@ export class BasePageHelp { | @@ -22,7 +28,7 @@ export class BasePageHelp { | ||
| 22 | if (HttpUtils.getUserId()) { | 28 | if (HttpUtils.getUserId()) { |
| 23 | 29 | ||
| 24 | let time = DateTimeUtils.getTimeStamp().toString() | 30 | let time = DateTimeUtils.getTimeStamp().toString() |
| 25 | - Logger.debug(TAG, 'getAppointmentInfo-->'+time) | 31 | + Logger.debug(TAG, 'getAppointmentInfo-->' + time) |
| 26 | const reserveBean = this.transformToLiveDetailsBeans(compList) | 32 | const reserveBean = this.transformToLiveDetailsBeans(compList) |
| 27 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { | 33 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { |
| 28 | Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`) | 34 | Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`) |
| @@ -116,7 +122,7 @@ export class BasePageHelp { | @@ -116,7 +122,7 @@ export class BasePageHelp { | ||
| 116 | return idList.join(',') | 122 | return idList.join(',') |
| 117 | } | 123 | } |
| 118 | 124 | ||
| 119 | -/** | 125 | + /** |
| 120 | * 批查稿件的互动数据,如 评论人数等 | 126 | * 批查稿件的互动数据,如 评论人数等 |
| 121 | * @param compList | 127 | * @param compList |
| 122 | * @returns | 128 | * @returns |
| @@ -165,13 +171,17 @@ export class BasePageHelp { | @@ -165,13 +171,17 @@ export class BasePageHelp { | ||
| 165 | allInteractDataList.push(...value); | 171 | allInteractDataList.push(...value); |
| 166 | } | 172 | } |
| 167 | }) | 173 | }) |
| 168 | - // 批查全部完成,统一设置到comp里 | ||
| 169 | - // this.resetInteract(allInteractDataList, compList); | ||
| 170 | success(allInteractDataList); | 174 | success(allInteractDataList); |
| 171 | }) | 175 | }) |
| 172 | }) | 176 | }) |
| 173 | } | 177 | } |
| 174 | 178 | ||
| 179 | + | ||
| 180 | + /** | ||
| 181 | + * 收集信息流页面,可参与批查稿件的业务信息 | ||
| 182 | + * @param compList | ||
| 183 | + * @returns | ||
| 184 | + */ | ||
| 175 | private getInteractParams(compList: CompDTO[]): InteractParam { | 185 | private getInteractParams(compList: CompDTO[]): InteractParam { |
| 176 | if (compList == null || compList.length == 0) { | 186 | if (compList == null || compList.length == 0) { |
| 177 | return {} as InteractParam; | 187 | return {} as InteractParam; |
| @@ -204,6 +214,34 @@ export class BasePageHelp { | @@ -204,6 +214,34 @@ export class BasePageHelp { | ||
| 204 | return param; | 214 | return param; |
| 205 | } | 215 | } |
| 206 | 216 | ||
| 217 | + /** | ||
| 218 | + * 获取组件中需要参与批查业务信息 | ||
| 219 | + * @param slideShowArray | ||
| 220 | + * @returns | ||
| 221 | + */ | ||
| 222 | + public getCompInteractParams(slideShowArray: slideShows[]): InteractParam { | ||
| 223 | + | ||
| 224 | + if (slideShowArray == null || slideShowArray.length == 0) { | ||
| 225 | + return {} as InteractParam; | ||
| 226 | + } | ||
| 227 | + let param: InteractParam = {} as InteractParam; | ||
| 228 | + param.contentList = new Array<ContentBean>(); | ||
| 229 | + slideShowArray.forEach((value) => { | ||
| 230 | + let bean = {} as ContentBean; | ||
| 231 | + bean.contentId = value.newsId; | ||
| 232 | + bean.contentType = value.objectType; | ||
| 233 | + param.contentList.push(bean); | ||
| 234 | + }) | ||
| 235 | + | ||
| 236 | + return param | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + | ||
| 240 | + /** | ||
| 241 | + * 查询互动相关数据,如收藏数、评论数等 | ||
| 242 | + * @param param | ||
| 243 | + * @returns | ||
| 244 | + */ | ||
| 207 | private createInteractDataPromise(param: InteractParam) { | 245 | private createInteractDataPromise(param: InteractParam) { |
| 208 | return new Promise<InteractDataDTO[]>((success, error) => { | 246 | return new Promise<InteractDataDTO[]>((success, error) => { |
| 209 | PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => { | 247 | PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => { |
| @@ -221,6 +259,18 @@ export class BasePageHelp { | @@ -221,6 +259,18 @@ export class BasePageHelp { | ||
| 221 | }); | 259 | }); |
| 222 | } | 260 | } |
| 223 | 261 | ||
| 262 | + async requestCompInteractData(param: InteractParam): Promise<InteractDataDTO[]> { | ||
| 263 | + return new Promise<InteractDataDTO[]>((success, error) => { | ||
| 264 | + this.createInteractDataPromise(param).then((result) => { | ||
| 265 | + if (!CollectionUtils.isArray(result)) { | ||
| 266 | + success(new Array<InteractDataDTO>()); | ||
| 267 | + return; | ||
| 268 | + } | ||
| 269 | + success(result); | ||
| 270 | + }) | ||
| 271 | + }) | ||
| 272 | + } | ||
| 273 | + | ||
| 224 | /** | 274 | /** |
| 225 | * 刷新互动数据到compList | 275 | * 刷新互动数据到compList |
| 226 | * @param interact 批查互动数据结果 | 276 | * @param interact 批查互动数据结果 |
| @@ -252,6 +302,4 @@ export class BasePageHelp { | @@ -252,6 +302,4 @@ export class BasePageHelp { | ||
| 252 | } | 302 | } |
| 253 | }) | 303 | }) |
| 254 | } | 304 | } |
| 255 | - | ||
| 256 | - | ||
| 257 | } | 305 | } |
| @@ -106,7 +106,10 @@ export struct CustomPullToRefresh { | @@ -106,7 +106,10 @@ export struct CustomPullToRefresh { | ||
| 106 | lottie.destroy(this.refreshingAnimName); | 106 | lottie.destroy(this.refreshingAnimName); |
| 107 | this.refreshAnimation?.removeEventListener('DOMLoaded') | 107 | this.refreshAnimation?.removeEventListener('DOMLoaded') |
| 108 | this.refreshAnimation?.removeEventListener('destroy') | 108 | this.refreshAnimation?.removeEventListener('destroy') |
| 109 | + this.refreshingAnimation?.removeEventListener('DOMLoaded') | ||
| 110 | + this.refreshingAnimation?.removeEventListener('destroy') | ||
| 109 | this.refreshAnimation = null | 111 | this.refreshAnimation = null |
| 112 | + this.refreshingAnimation = null | ||
| 110 | } | 113 | } |
| 111 | 114 | ||
| 112 | @Builder | 115 | @Builder |
| @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS' | @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS' | ||
| 29 | import { MoreComponent } from '../cardview/MoreComponent' | 29 | import { MoreComponent } from '../cardview/MoreComponent' |
| 30 | import { Card9Component } from '../cardview/Card9Component' | 30 | import { Card9Component } from '../cardview/Card9Component' |
| 31 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | 31 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' |
| 32 | -import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | 32 | +import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent' |
| 33 | + | ||
| 33 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 34 | 35 | ||
| 35 | @Component | 36 | @Component |
| @@ -148,7 +149,7 @@ export struct SearchResultContentComponent { | @@ -148,7 +149,7 @@ export struct SearchResultContentComponent { | ||
| 148 | this.data_rmh.push(data) | 149 | this.data_rmh.push(data) |
| 149 | }) | 150 | }) |
| 150 | 151 | ||
| 151 | - if(this.data_rmh.length > 0){ | 152 | + if (this.data_rmh.length > 0) { |
| 152 | this.count = 1 | 153 | this.count = 1 |
| 153 | } | 154 | } |
| 154 | //只有一条创作者,获取 创作者信息 | 155 | //只有一条创作者,获取 创作者信息 |
| @@ -262,7 +263,7 @@ export struct SearchResultContentComponent { | @@ -262,7 +263,7 @@ export struct SearchResultContentComponent { | ||
| 262 | this.isLoading = false | 263 | this.isLoading = false |
| 263 | this.count = this.count === -1 ? 0 : this.count | 264 | this.count = this.count === -1 ? 0 : this.count |
| 264 | }) | 265 | }) |
| 265 | - }else { | 266 | + } else { |
| 266 | this.hasMore = false | 267 | this.hasMore = false |
| 267 | } | 268 | } |
| 268 | } | 269 | } |
| @@ -270,12 +271,12 @@ export struct SearchResultContentComponent { | @@ -270,12 +271,12 @@ export struct SearchResultContentComponent { | ||
| 270 | build() { | 271 | build() { |
| 271 | Column() { | 272 | Column() { |
| 272 | if (this.count == 0) { | 273 | if (this.count == 0) { |
| 273 | - // ListHasNoMoreDataUI({ style: 2 }) | 274 | + |
| 274 | EmptyComponent({ | 275 | EmptyComponent({ |
| 275 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, | 276 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, |
| 276 | emptyButton: false, | 277 | emptyButton: false, |
| 278 | + }).height('70%') | ||
| 277 | 279 | ||
| 278 | - }) | ||
| 279 | } else { | 280 | } else { |
| 280 | List({ scroller: this.scroller2 }) { | 281 | List({ scroller: this.scroller2 }) { |
| 281 | if (this.data_rmh != null && this.data_rmh.length > 0) { | 282 | if (this.data_rmh != null && this.data_rmh.length > 0) { |
| @@ -309,7 +310,7 @@ export struct SearchResultContentComponent { | @@ -309,7 +310,7 @@ export struct SearchResultContentComponent { | ||
| 309 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 310 | } | 311 | } |
| 311 | } else { | 312 | } else { |
| 312 | - if (this.data?.get(index + 1)?.sameContentListSize > 0) { | 313 | + if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) { |
| 313 | Divider() | 314 | Divider() |
| 314 | .width('100%') | 315 | .width('100%') |
| 315 | .color($r('app.color.color_F5F5F5')) | 316 | .color($r('app.color.color_F5F5F5')) |
| @@ -326,12 +327,13 @@ export struct SearchResultContentComponent { | @@ -326,12 +327,13 @@ export struct SearchResultContentComponent { | ||
| 326 | }, (item: ContentDTO, index: number) => index.toString()) | 327 | }, (item: ContentDTO, index: number) => index.toString()) |
| 327 | 328 | ||
| 328 | //没有更多数据 显示提示 | 329 | //没有更多数据 显示提示 |
| 329 | - if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) { | 330 | + if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) { |
| 330 | ListItem() { | 331 | ListItem() { |
| 331 | ListHasNoMoreDataUI() | 332 | ListHasNoMoreDataUI() |
| 332 | } | 333 | } |
| 333 | } | 334 | } |
| 334 | - }.cachedCount(5) | 335 | + } |
| 336 | + .cachedCount(5) | ||
| 335 | .edgeEffect(EdgeEffect.None) | 337 | .edgeEffect(EdgeEffect.None) |
| 336 | .scrollBar(BarState.Off) | 338 | .scrollBar(BarState.Off) |
| 337 | .height('100%') | 339 | .height('100%') |
| @@ -344,6 +346,7 @@ export struct SearchResultContentComponent { | @@ -344,6 +346,7 @@ export struct SearchResultContentComponent { | ||
| 344 | } | 346 | } |
| 345 | } | 347 | } |
| 346 | .backgroundColor($r('app.color.white')) | 348 | .backgroundColor($r('app.color.white')) |
| 349 | + .height('100%') | ||
| 347 | .width('100%') | 350 | .width('100%') |
| 348 | } | 351 | } |
| 349 | 352 |
| @@ -62,6 +62,7 @@ export struct EmptyComponent { | @@ -62,6 +62,7 @@ export struct EmptyComponent { | ||
| 62 | @State emptyButton: boolean = false | 62 | @State emptyButton: boolean = false |
| 63 | @State isBlack: boolean = false // 背景是否为黑色 默认白色 | 63 | @State isBlack: boolean = false // 背景是否为黑色 默认白色 |
| 64 | @State timeNum: number = 10 | 64 | @State timeNum: number = 10 |
| 65 | + | ||
| 65 | /** | 66 | /** |
| 66 | * The empty image width percentage setting. | 67 | * The empty image width percentage setting. |
| 67 | */ | 68 | */ |
| @@ -51,38 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -51,38 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 51 | 51 | ||
| 52 | toMore() { | 52 | toMore() { |
| 53 | if (this.moreWidth > this.initMoreWidth * 2) { | 53 | if (this.moreWidth > this.initMoreWidth * 2) { |
| 54 | - this.liveToMore(); | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - liveToMore() { | ||
| 59 | - if (!!this.compDTO.dataSourceType) { | ||
| 60 | - // if (this.compDTO.dataSourceType === 'OBJECT_POS') { | ||
| 61 | - // ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 62 | - // return; | ||
| 63 | - // } | ||
| 64 | - if (this.compDTO.linkUrl) { | ||
| 65 | - let taskAction: Action = { | ||
| 66 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 67 | - params: { | ||
| 68 | - url: this.compDTO.linkUrl | ||
| 69 | - } as Params, | ||
| 70 | - }; | ||
| 71 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 72 | - } else { | ||
| 73 | - this.jumpToLiveMorePage() | ||
| 74 | - } | ||
| 75 | - } else { | ||
| 76 | - if (this.compDTO?.objectType === '11') { | ||
| 77 | - } else { | ||
| 78 | - const contentDTO: ContentDTO = { | ||
| 79 | - objectId: this.compDTO.objectId, | ||
| 80 | - objectType: this.compDTO.objectType, | ||
| 81 | - linkUrl: this.compDTO.linkUrl, | ||
| 82 | - pageId: this.compDTO.pageId | ||
| 83 | - } as ContentDTO | ||
| 84 | - ProcessUtils.processPage(contentDTO) | ||
| 85 | - } | 54 | + ProcessUtils.compJumpPage(this.compDTO) |
| 86 | } | 55 | } |
| 87 | } | 56 | } |
| 88 | 57 | ||
| @@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 115 | } | 84 | } |
| 116 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) | 85 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) |
| 117 | .onClick(() => { | 86 | .onClick(() => { |
| 118 | - this.liveToMore(); | 87 | + ProcessUtils.compJumpPage(this.compDTO) |
| 119 | }) | 88 | }) |
| 120 | 89 | ||
| 121 | }.justifyContent(FlexAlign.SpaceBetween) | 90 | }.justifyContent(FlexAlign.SpaceBetween) |
| @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent { | @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent { | ||
| 72 | // } | 72 | // } |
| 73 | if (this.compDTO.linkUrl) { | 73 | if (this.compDTO.linkUrl) { |
| 74 | let taskAction: Action = { | 74 | let taskAction: Action = { |
| 75 | - type: 'JUMP_H5_BY_WEB_VIEW', | 75 | + type: 'JUMP_INNER_NEW_PAGE', |
| 76 | params: { | 76 | params: { |
| 77 | - url: this.compDTO.linkUrl | 77 | + url: this.compDTO.linkUrl, |
| 78 | + pageID: 'SPACIAL_TOPIC_PAGE', | ||
| 79 | + contentID: this.compDTO.objectId, | ||
| 80 | + extra: { | ||
| 81 | + relId: this.compDTO.relId, | ||
| 82 | + relType: this.compDTO.relType, | ||
| 83 | + pageId: this.compDTO.pageId | ||
| 84 | + } | ||
| 78 | } as Params, | 85 | } as Params, |
| 79 | }; | 86 | }; |
| 87 | + this.compDTO.operDataList = [] | ||
| 88 | + console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO)) | ||
| 89 | + console.log('LiveHorizontalCardComponent', this.compDTO.relId) | ||
| 90 | + console.log('LiveHorizontalCardComponent', this.compDTO.relType) | ||
| 91 | + console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction)) | ||
| 80 | WDRouterRule.jumpWithAction(taskAction) | 92 | WDRouterRule.jumpWithAction(taskAction) |
| 81 | } else { | 93 | } else { |
| 94 | + // console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage') | ||
| 82 | this.jumpToLiveMorePage() | 95 | this.jumpToLiveMorePage() |
| 83 | } | 96 | } |
| 84 | } else { | 97 | } else { |
| @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent { | @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent { | ||
| 90 | linkUrl: this.compDTO.linkUrl, | 103 | linkUrl: this.compDTO.linkUrl, |
| 91 | pageId: this.compDTO.pageId | 104 | pageId: this.compDTO.pageId |
| 92 | } as ContentDTO | 105 | } as ContentDTO |
| 106 | + // console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage') | ||
| 93 | ProcessUtils.processPage(contentDTO) | 107 | ProcessUtils.processPage(contentDTO) |
| 94 | } | 108 | } |
| 95 | } | 109 | } |
| @@ -59,7 +59,7 @@ export struct LiveOperRowListView { | @@ -59,7 +59,7 @@ export struct LiveOperRowListView { | ||
| 59 | @State needLike: boolean = true | 59 | @State needLike: boolean = true |
| 60 | @State styleType: number = -1 | 60 | @State styleType: number = -1 |
| 61 | @State bgColor: ResourceColor = Color.White | 61 | @State bgColor: ResourceColor = Color.White |
| 62 | - @State interactData: InteractDataDTO = {} as InteractDataDTO | 62 | + @State interactData: InteractDataDTO = new InteractDataDTO |
| 63 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 63 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 64 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 64 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 65 | @State dialogController: CustomDialogController | null = null; | 65 | @State dialogController: CustomDialogController | null = null; |
| @@ -6,7 +6,8 @@ import { | @@ -6,7 +6,8 @@ import { | ||
| 6 | ContentDetailDTO, | 6 | ContentDetailDTO, |
| 7 | contentListParams, | 7 | contentListParams, |
| 8 | InteractDataDTO, | 8 | InteractDataDTO, |
| 9 | - postExecuteCollectRecordParams | 9 | + postExecuteCollectRecordParams, |
| 10 | + TopicInfo | ||
| 10 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 11 | import router from '@ohos.router'; | 12 | import router from '@ohos.router'; |
| 12 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | 13 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; |
| @@ -94,6 +95,7 @@ export struct OperRowListView { | @@ -94,6 +95,7 @@ export struct OperRowListView { | ||
| 94 | @Consume pageId: string | 95 | @Consume pageId: string |
| 95 | @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 96 | @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 96 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | 97 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 |
| 98 | + @Prop topicInfo?: TopicInfo = {} as TopicInfo | ||
| 97 | 99 | ||
| 98 | async aboutToAppear() { | 100 | async aboutToAppear() { |
| 99 | console.info(TAG, 'this.needLike', this.needLike) | 101 | console.info(TAG, 'this.needLike', this.needLike) |
| @@ -416,8 +418,34 @@ export struct OperRowListView { | @@ -416,8 +418,34 @@ export struct OperRowListView { | ||
| 416 | } | 418 | } |
| 417 | 419 | ||
| 418 | share() { | 420 | share() { |
| 421 | + if (this.topicInfo && Object.keys(this.topicInfo).length > 0) { | ||
| 422 | + console.info(TAG, 'contentDetailData this.topicInfo', JSON.stringify(this.topicInfo)) | ||
| 423 | + let contentDetailData: ContentDetailDTO = { | ||
| 424 | + newsId: this.topicInfo?.topicId && Number.parseInt(this.topicInfo.topicId), | ||
| 425 | + shareInfo:{ | ||
| 426 | + appCustomContentId: this.topicInfo?.topicId, | ||
| 427 | + appCustomContentType: this.topicInfo?.topicType + '', | ||
| 428 | + shareTitle: this.topicInfo?.shareTitle, | ||
| 429 | + shareSummary: this.topicInfo?.shareSummary, | ||
| 430 | + appCustomImageUrl: this.topicInfo?.shareCoverUrl, | ||
| 431 | + sharePosterCoverUrl: this.topicInfo?.sharePosterCoverUrl, | ||
| 432 | + shareUrl: this.topicInfo?.shareUrl, | ||
| 433 | + appCustomTargetRelId: this.topicInfo?.relId, | ||
| 434 | + appCustomTargetRelType: this.topicInfo?.relType, | ||
| 435 | + appCustomShowReport: false, | ||
| 436 | + appCustomShowLike: -1, | ||
| 437 | + shareOpen: 1, | ||
| 438 | + sharePosterOpen: this.topicInfo?.posterFlag, | ||
| 439 | + appCustomShowPoster: this.topicInfo?.posterFlag && this.topicInfo?.posterFlag > 0 ? 1 : -1, | ||
| 440 | + } | ||
| 441 | + } as ContentDetailDTO | ||
| 442 | + WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo , this.topicInfo) | ||
| 443 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper) | ||
| 444 | + } else { | ||
| 445 | + console.info(TAG, 'this.contentDetailData') | ||
| 419 | WDShare.shareContent(this.contentDetailData) | 446 | WDShare.shareContent(this.contentDetailData) |
| 420 | } | 447 | } |
| 448 | + } | ||
| 421 | 449 | ||
| 422 | // 已登录->查询用户对作品收藏状态 | 450 | // 已登录->查询用户对作品收藏状态 |
| 423 | private async getInteractDataStatus() { | 451 | private async getInteractDataStatus() { |
| 1 | import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 1 | import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 2 | -import { DateTimeUtils, Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit'; | 2 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit'; |
| 3 | 3 | ||
| 4 | import { | 4 | import { |
| 5 | batchLikeAndCollectResult, | 5 | batchLikeAndCollectResult, |
| @@ -7,8 +7,11 @@ import { | @@ -7,8 +7,11 @@ import { | ||
| 7 | ContentDetailDTO, | 7 | ContentDetailDTO, |
| 8 | ContentDTO, | 8 | ContentDTO, |
| 9 | contentListParams, | 9 | contentListParams, |
| 10 | + FeedbackTypeBean, | ||
| 11 | + GoldenPositionExtraBean, | ||
| 10 | InteractDataDTO, | 12 | InteractDataDTO, |
| 11 | LiveReviewDTO, | 13 | LiveReviewDTO, |
| 14 | + LiveRoomDataBean, | ||
| 12 | MorningEveningPaperDTO, | 15 | MorningEveningPaperDTO, |
| 13 | NavigationBodyDTO, | 16 | NavigationBodyDTO, |
| 14 | NavigationDetailDTO, | 17 | NavigationDetailDTO, |
| @@ -22,13 +25,10 @@ import { | @@ -22,13 +25,10 @@ import { | ||
| 22 | postExecuteCollectRecordParams, | 25 | postExecuteCollectRecordParams, |
| 23 | postExecuteLikeParams, | 26 | postExecuteLikeParams, |
| 24 | postInteractAccentionOperateParams, | 27 | postInteractAccentionOperateParams, |
| 25 | - postRecommendListParams, | ||
| 26 | - GoldenPositionExtraBean, | ||
| 27 | - FeedbackTypeBean, | ||
| 28 | - LiveRoomDataBean | 28 | + postRecommendListParams |
| 29 | } from 'wdBean'; | 29 | } from 'wdBean'; |
| 30 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | 30 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; |
| 31 | -import { ArrayList } from '@kit.ArkTS'; | 31 | +import { SpConstants } from 'wdConstant/Index'; |
| 32 | 32 | ||
| 33 | const TAG = 'HttpRequest'; | 33 | const TAG = 'HttpRequest'; |
| 34 | 34 | ||
| @@ -243,6 +243,14 @@ export class PageRepository { | @@ -243,6 +243,14 @@ export class PageRepository { | ||
| 243 | url = url + "&districtCode=" + HttpUtils.getDistrictCode() | 243 | url = url + "&districtCode=" + HttpUtils.getDistrictCode() |
| 244 | + "&provinceCode=" + provinceCode | 244 | + "&provinceCode=" + provinceCode |
| 245 | + "&cityCode=" + HttpUtils.getCityCode() | 245 | + "&cityCode=" + HttpUtils.getCityCode() |
| 246 | + | ||
| 247 | + let per=SPHelper.default.getSync(SpConstants.LOCATION_FIRST_POSITION,true) | ||
| 248 | + if(per){ | ||
| 249 | + //检测首次获取地理信息 | ||
| 250 | + url = url+'&firstLocation=1' | ||
| 251 | + SPHelper.default.save(SpConstants.LOCATION_FIRST_POSITION,false) | ||
| 252 | + } | ||
| 253 | + | ||
| 246 | } | 254 | } |
| 247 | if (myChannelIds) { | 255 | if (myChannelIds) { |
| 248 | url = url + `&channelIds=${myChannelIds}` | 256 | url = url + `&channelIds=${myChannelIds}` |
| @@ -221,9 +221,15 @@ export struct PlayUIComponent { | @@ -221,9 +221,15 @@ export struct PlayUIComponent { | ||
| 221 | .padding({ | 221 | .padding({ |
| 222 | top: 1, | 222 | top: 1, |
| 223 | right: 4, | 223 | right: 4, |
| 224 | - bottom: 1 | 224 | + bottom: 1, |
| 225 | }) | 225 | }) |
| 226 | - // .margin({left: this.contentDetailData?.rmhInfo ? 0 : 34}) | 226 | + .margin( |
| 227 | + { | ||
| 228 | + left: this.contentDetailData?.rmhInfo | ||
| 229 | + ? 0 | ||
| 230 | + : this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 34 : 0 | ||
| 231 | + } | ||
| 232 | + ) | ||
| 227 | } | 233 | } |
| 228 | //回看 | 234 | //回看 |
| 229 | else if (this.contentDetailData.liveInfo?.liveState == 'end') { | 235 | else if (this.contentDetailData.liveInfo?.liveState == 'end') { |
| @@ -85,6 +85,7 @@ export struct PlayerTitleComponent { | @@ -85,6 +85,7 @@ export struct PlayerTitleComponent { | ||
| 85 | Row() { | 85 | Row() { |
| 86 | this.getLiveStatusView() | 86 | this.getLiveStatusView() |
| 87 | } | 87 | } |
| 88 | + .margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34}) | ||
| 88 | 89 | ||
| 89 | } | 90 | } |
| 90 | .width('100%') | 91 | .width('100%') |
| @@ -144,7 +145,6 @@ export struct PlayerTitleComponent { | @@ -144,7 +145,6 @@ export struct PlayerTitleComponent { | ||
| 144 | .fontWeight(400) | 145 | .fontWeight(400) |
| 145 | .fontColor(Color.White) | 146 | .fontColor(Color.White) |
| 146 | } | 147 | } |
| 147 | - | ||
| 148 | } | 148 | } |
| 149 | .backgroundColor('#4D000000') | 149 | .backgroundColor('#4D000000') |
| 150 | .borderRadius(2) | 150 | .borderRadius(2) |
| @@ -154,7 +154,6 @@ export struct PlayerTitleComponent { | @@ -154,7 +154,6 @@ export struct PlayerTitleComponent { | ||
| 154 | top: 0, | 154 | top: 0, |
| 155 | bottom: 0 | 155 | bottom: 0 |
| 156 | } : 4) | 156 | } : 4) |
| 157 | - .margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34}) | ||
| 158 | } | 157 | } |
| 159 | } | 158 | } |
| 160 | } | 159 | } |
| @@ -45,10 +45,10 @@ export class WDShare { | @@ -45,10 +45,10 @@ export class WDShare { | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | //专题分享数据转换 | 47 | //专题分享数据转换 |
| 48 | - static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){ | ||
| 49 | - shareBean.appCustomTopicType = topicInfoBean.topicType+'' | 48 | + static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean?: TopicInfo){ |
| 49 | + shareBean.appCustomTopicType = topicInfoBean?.topicType+'' | ||
| 50 | //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | 50 | //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 |
| 51 | - if(25 == topicInfoBean.topicType){ | 51 | + if(25 == topicInfoBean?.topicType){ |
| 52 | shareBean.appCustomShowPosterType = 6 | 52 | shareBean.appCustomShowPosterType = 6 |
| 53 | shareBean.appCustomTopicPattern = topicInfoBean.topicPattern | 53 | shareBean.appCustomTopicPattern = topicInfoBean.topicPattern |
| 54 | shareBean.appCustomPublishTime = topicInfoBean.topicDate | 54 | shareBean.appCustomPublishTime = topicInfoBean.topicDate |
| @@ -76,11 +76,11 @@ export class WDShare { | @@ -76,11 +76,11 @@ export class WDShare { | ||
| 76 | //文章/直播/话题专题(H5普通文章专题,包含时间链) | 76 | //文章/直播/话题专题(H5普通文章专题,包含时间链) |
| 77 | shareBean.appCustomShowPosterType = 8 | 77 | shareBean.appCustomShowPosterType = 8 |
| 78 | //海报的头图 | 78 | //海报的头图 |
| 79 | - shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl | 79 | + shareBean.sharePosterCoverUrl = topicInfoBean?.backgroundImgUrl || '' |
| 80 | shareBean.appCustomIsFrontDaily = false | 80 | shareBean.appCustomIsFrontDaily = false |
| 81 | - shareBean.appCustomPosterTitle = topicInfoBean.title | ||
| 82 | - shareBean.appCustomPosterSummary = topicInfoBean.summary | ||
| 83 | - if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | 81 | + shareBean.appCustomPosterTitle = topicInfoBean?.title || '' |
| 82 | + shareBean.appCustomPosterSummary = topicInfoBean?.summary || '' | ||
| 83 | + if(topicInfoBean?.shareContentList != null && topicInfoBean?.shareContentList && topicInfoBean.shareContentList.length > 0){ | ||
| 84 | shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[] | 84 | shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[] |
| 85 | shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length | 85 | shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length |
| 86 | for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | 86 | for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { |
| @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences'; | @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences'; | ||
| 7 | import { TrackConstants } from 'wdTracking/Index'; | 7 | import { TrackConstants } from 'wdTracking/Index'; |
| 8 | 8 | ||
| 9 | const TAG = 'SpacialTopicPage'; | 9 | const TAG = 'SpacialTopicPage'; |
| 10 | - | 10 | +//H5专题 |
| 11 | @Entry | 11 | @Entry |
| 12 | @Component | 12 | @Component |
| 13 | struct SpacialTopicPage { | 13 | struct SpacialTopicPage { |
-
Please register or login to post a comment