wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool: (41 commits)
  desc:消息 圆点
  fix: 16931 功能缺陷-进入文化频道-点击视频没有跳转到视频播放页,实际跳转到文章详情页
  fix:17465 功能缺陷-【uat】 进入直播预告页,预约按钮,变成了关注按钮
  fix: 17212 人民号作品列表在作品数量较少时上滑无反应
  fix: 17458 功能缺陷-进入直播间,点击已预约按钮,没有变为预约
  视频频道点击底部或顶部tab刷新页面
  feat(广告稿件):删除广告稿件
  fix: 点赞
  feat(广告稿件):删除广告稿件
  fix: 调整
  评论-收藏
  遗漏图片
  修改点赞按钮样式与增加直播点赞数量累加逻辑,直播中lottie动画
  fix:bug[17204] 搜索结果>人民号,只有1个号主信息,不应展示更多
  fix:增加跳转登录页
  fix: 信息流卡片互动 debug
  fix(动态详情):屏蔽重复点击事件
  fix: commentInfo.ets添加newstype
  fix: 17034 功能缺陷--评论卡,点击爱心后,用android 查看精品评论页,爱心没有加1
  fix:17316 已投票账号访问投票专题,页面展示错误
  ...
Showing 65 changed files with 1959 additions and 1186 deletions

Too many changes to show.

To preserve performance only 65 of 65+ files are displayed.

@@ -60,4 +60,6 @@ export { MpaasUtils } from './src/main/ets/mpaas/MpaasUtils' @@ -60,4 +60,6 @@ export { MpaasUtils } from './src/main/ets/mpaas/MpaasUtils'
60 60
61 export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/MpaasUpgradeCheck' 61 export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/MpaasUpgradeCheck'
62 62
63 -export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'  
  63 +export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
  64 +
  65 +export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
  1 +import systemDateTime from '@ohos.systemDateTime';
  2 +
  3 +/**
  4 + * 屏蔽快速点击事件,规定时间内只触发一次
  5 + */
  6 +export class FastClickUtil {
  7 +
  8 + static MIN_DELAY_TIME = 500
  9 +
  10 + static minDelayBeforeTime = 0
  11 +
  12 + static async isMinDelayTime(): Promise<boolean> {
  13 + let systime = await systemDateTime.getCurrentTime();
  14 + return new Promise<boolean>((success, error) => {
  15 + let rtnvalue = systime - FastClickUtil.minDelayBeforeTime <= FastClickUtil.MIN_DELAY_TIME;
  16 + this.minDelayBeforeTime = systime;
  17 + success(rtnvalue);
  18 + })
  19 + }
  20 +}
  21 +
@@ -309,6 +309,25 @@ export class HttpUrlUtils { @@ -309,6 +309,25 @@ export class HttpUrlUtils {
309 * 查询是否设置过密码checkSetPassword 309 * 查询是否设置过密码checkSetPassword
310 */ 310 */
311 static readonly CHECK_SET_PASSWORD_PATH: string = "/api/rmrb-user-center/user/zh/c/ifSetPassword"; 311 static readonly CHECK_SET_PASSWORD_PATH: string = "/api/rmrb-user-center/user/zh/c/ifSetPassword";
  312 + /**
  313 + * 获取oss 配置
  314 + */
  315 + static readonly OSS_PARAMS_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/oss/configs";
  316 +
  317 + /**
  318 + * 获取上传OSS token
  319 + */
  320 + static readonly STS_TOKEN_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/oss/stsToken";
  321 +
  322 + /**
  323 + * 获取意见反馈类型
  324 + */
  325 + static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list";
  326 +
  327 + /**
  328 + * 查询点赞、回复我的、系统消息的未读数量以及回复/评论人
  329 + */
  330 + static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime=";
312 331
313 static getHost(): string { 332 static getHost(): string {
314 return HostManager.getHost(); 333 return HostManager.getHost();
@@ -717,4 +736,10 @@ export class HttpUrlUtils { @@ -717,4 +736,10 @@ export class HttpUrlUtils {
717 return url; 736 return url;
718 } 737 }
719 738
  739 + //获取消息未读接口
  740 + static getMessageUnReadDataUrl() {
  741 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH
  742 + return url
  743 + }
  744 +
720 } 745 }
@@ -92,6 +92,8 @@ export function registerRouter() { @@ -92,6 +92,8 @@ export function registerRouter() {
92 return WDRouterPage.liveMorePage 92 return WDRouterPage.liveMorePage
93 } else if (action.params?.pageID == "ORDER_MORE_PAGE") { 93 } else if (action.params?.pageID == "ORDER_MORE_PAGE") {
94 return WDRouterPage.reserveMorePage 94 return WDRouterPage.reserveMorePage
  95 + } else if (action.params?.pageID == "FeedBackActivity") {
  96 + return WDRouterPage.feedBackActivity
95 } 97 }
96 return undefined 98 return undefined
97 }) 99 })
@@ -133,4 +133,7 @@ export class WDRouterPage { @@ -133,4 +133,7 @@ export class WDRouterPage {
133 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage"); 133 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
134 //展示头像 134 //展示头像
135 static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage"); 135 static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
  136 +
  137 + //意见反馈
  138 + static feedBackActivity = new WDRouterPage("wdComponent", "ets/components/FeedBackActivity");
136 } 139 }
@@ -108,7 +108,11 @@ export class ProcessUtils { @@ -108,7 +108,11 @@ export class ProcessUtils {
108 break; 108 break;
109 case ContentConstants.TYPE_TELETEXT: 109 case ContentConstants.TYPE_TELETEXT:
110 // 图文详情,跳转h5 110 // 图文详情,跳转h5
111 - ProcessUtils.gotoWeb(content); 111 + if(content?.linkUrl){ //有 linkUrl 走专题页展示逻辑
  112 + ProcessUtils.gotoSpecialTopic(content)
  113 + }else{
  114 + ProcessUtils.gotoWeb(content);
  115 + }
112 break; 116 break;
113 case ContentConstants.TYPE_LINK: 117 case ContentConstants.TYPE_LINK:
114 ProcessUtils.gotoDefaultWeb(content); 118 ProcessUtils.gotoDefaultWeb(content);
@@ -441,4 +445,26 @@ export class ProcessUtils { @@ -441,4 +445,26 @@ export class ProcessUtils {
441 let params = { 'creatorId': creatorId } as Record<string, string>; 445 let params = { 'creatorId': creatorId } as Record<string, string>;
442 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) 446 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
443 } 447 }
  448 +
  449 + /**
  450 + * 意见反馈
  451 + */
  452 + public static gotoFeedBackActivity() {
  453 + let taskAction: Action = {
  454 + type: 'JUMP_INNER_NEW_PAGE',
  455 + params: {
  456 + pageID: 'FeedBackActivity'
  457 + } as Params,
  458 + };
  459 +
  460 + WDRouterRule.jumpWithAction(taskAction)
  461 + }
  462 +
  463 + /**
  464 + * 跳转到登录页
  465 + */
  466 + public static gotoLoginPage() {
  467 +
  468 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  469 + }
444 } 470 }
@@ -39,14 +39,14 @@ class AppLoginAuthInfo { @@ -39,14 +39,14 @@ class AppLoginAuthInfo {
39 } 39 }
40 40
41 interface IDataJson { 41 interface IDataJson {
42 - jumpType:number  
43 - jumpUrl:string  
44 - newsId:string  
45 - newsObjectLevel:string  
46 - newsObjectType:number  
47 - newsRelId:string  
48 - newsTitle:string  
49 - pageId:string 42 + jumpType: number
  43 + jumpUrl: string
  44 + newsId: string
  45 + newsObjectLevel: string
  46 + newsObjectType: number
  47 + newsRelId: string
  48 + newsTitle: string
  49 + pageId: string
50 } 50 }
51 51
52 /** 52 /**
@@ -159,59 +159,64 @@ function handleJsCallAppInnerLinkMethod(data: Message) { @@ -159,59 +159,64 @@ function handleJsCallAppInnerLinkMethod(data: Message) {
159 content.objectType = ''; 159 content.objectType = '';
160 content.linkUrl = encodeURI(urlParams.get('url') || ''); 160 content.linkUrl = encodeURI(urlParams.get('url') || '');
161 switch (urlParams.get('type')) { 161 switch (urlParams.get('type')) {
162 - case 'video':  
163 - content.objectType = ContentConstants.TYPE_VOD  
164 - ProcessUtils.processPage(content)  
165 - break;  
166 - case 'live':  
167 - content.objectType = ContentConstants.TYPE_LIVE  
168 - ProcessUtils.processPage(content)  
169 - break;  
170 - case 'article':  
171 - content.objectType = ContentConstants.TYPE_TELETEXT  
172 - ProcessUtils.processPage(content)  
173 - break;  
174 - case 'picture':  
175 - content.objectType = ContentConstants.TYPE_NINE  
176 - ProcessUtils.processPage(content)  
177 - break;  
178 - case 'audio':  
179 - content.objectType = ContentConstants.TYPE_AUDIO 162 + case 'video':
  163 + content.objectType = ContentConstants.TYPE_VOD
  164 + ProcessUtils.processPage(content)
  165 + break;
  166 + case 'live':
  167 + content.objectType = ContentConstants.TYPE_LIVE
  168 + ProcessUtils.processPage(content)
  169 + break;
  170 + case 'article':
  171 + content.objectType = ContentConstants.TYPE_TELETEXT
  172 + ProcessUtils.processPage(content)
  173 + break;
  174 + case 'picture':
  175 + content.objectType = ContentConstants.TYPE_NINE
  176 + ProcessUtils.processPage(content)
  177 + break;
  178 + case 'audio':
  179 + content.objectType = ContentConstants.TYPE_AUDIO
  180 + ProcessUtils.processPage(content)
  181 + break;
  182 + case 'h5':
  183 + if (urlParams.get('skipType') === '1') {
  184 + content.objectType = ContentConstants.TYPE_LINK
180 ProcessUtils.processPage(content) 185 ProcessUtils.processPage(content)
181 - break;  
182 - case 'h5':  
183 - if (urlParams.get('skipType') === '1') {  
184 - content.objectType = ContentConstants.TYPE_LINK  
185 - ProcessUtils.processPage(content)  
186 - }  
187 - if (urlParams.get('skipType') === '4') {  
188 - content.objectType = ContentConstants.TYPE_LINK  
189 - ProcessUtils.jumpExternalWebPage(content.linkUrl)  
190 - }  
191 - break;  
192 - case 'topic':  
193 - if (urlParams.get('subType') === 'h5') {  
194 - content.objectType = ContentConstants.TYPE_SPECIAL_TOPIC  
195 - ProcessUtils.processPage(content)  
196 - }  
197 - if (urlParams.get('subType') === 'moring_evening_news') {  
198 - ProcessUtils.gotoMorningEveningPaper()  
199 - }  
200 - if (urlParams.get('subType') === 'electronic_newspapers') {  
201 - ProcessUtils.gotoENewsPaper()  
202 - }  
203 - break;  
204 - case 'dynamic':  
205 - content.objectType = ContentConstants.TYPE_FOURTEEN 186 + }
  187 + if (urlParams.get('skipType') === '4') {
  188 + content.objectType = ContentConstants.TYPE_LINK
  189 + ProcessUtils.jumpExternalWebPage(content.linkUrl)
  190 + }
  191 + break;
  192 + case 'topic':
  193 + if (urlParams.get('subType') === 'h5') {
  194 + content.objectType = ContentConstants.TYPE_SPECIAL_TOPIC
206 ProcessUtils.processPage(content) 195 ProcessUtils.processPage(content)
207 - break;  
208 - case 'owner_page':  
209 - let creatorId = urlParams.get('creatorId') || ''  
210 - ProcessUtils.gotoPeopleShipHomePage(creatorId)  
211 - break;  
212 - default:  
213 - break;  
214 - } 196 + }
  197 + if (urlParams.get('subType') === 'moring_evening_news') {
  198 + ProcessUtils.gotoMorningEveningPaper()
  199 + }
  200 + if (urlParams.get('subType') === 'electronic_newspapers') {
  201 + ProcessUtils.gotoENewsPaper()
  202 + }
  203 + break;
  204 + case 'dynamic':
  205 + content.objectType = ContentConstants.TYPE_FOURTEEN
  206 + ProcessUtils.processPage(content)
  207 + break;
  208 + case 'owner_page':
  209 + let creatorId = urlParams.get('creatorId') || ''
  210 + ProcessUtils.gotoPeopleShipHomePage(creatorId)
  211 + break;
  212 + case 'app':
  213 + if (urlParams.get('subType') === 'login') {
  214 + ProcessUtils.gotoLoginPage()
  215 + }
  216 + break;
  217 + default:
  218 + break;
  219 + }
215 220
216 } 221 }
217 222
1 import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; 1 import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
2 -import { H5ReceiveDataJsonBean, postBatchAttentionStatusResult } from 'wdBean';  
3 -import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork'; 2 +import { WDHttp, HttpUrlUtils } from 'wdNetwork';
4 3
5 const TAG = 'JsCallAppService' 4 const TAG = 'JsCallAppService'
6 5
7 6
8 export function handleJsCallAppService(data: Message, callback: (res: string) => void) { 7 export function handleJsCallAppService(data: Message, callback: (res: string) => void) {
9 - let url: string = HttpUrlUtils.getHost() + data?.data?.url 8 + if (data?.data?.method === 'get') {
  9 + let queryString: string = ''
  10 + let parameters = data?.data?.parameters
  11 + if (parameters) {
  12 + queryString = Object.keys(parameters)
  13 + .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(parameters?.[key])}`)
  14 + .join('&');
  15 + }
10 16
11 - let responseMap: ResponseDTO<postBatchAttentionStatusResult> = {} as ResponseDTO<postBatchAttentionStatusResult>  
12 -  
13 - let h5ReceiveDataJson: H5ReceiveDataJsonBean<ResponseDTO<postBatchAttentionStatusResult>> = {  
14 - netError: '0',  
15 - responseMap  
16 - } as H5ReceiveDataJsonBean<ResponseDTO<postBatchAttentionStatusResult>> 17 + let url: string = HttpUrlUtils.getHost() + data?.data?.url
  18 + if (queryString) {
  19 + url = url + `?${queryString}`
  20 + }
  21 + console.log('yzl', queryString, url)
  22 + WDHttp.get(url).then((res) => {
  23 + callback(JSON.stringify({
  24 + netError: '0',
  25 + responseMap: res
  26 + }))
  27 + })
  28 + }
  29 + if (data?.data?.method === 'post') {
  30 + let url: string = HttpUrlUtils.getHost() + data?.data?.url
17 31
18 - // if (data?.data?.method === 'get') {  
19 - // WDHttp.get<ResponseDTO<postBatchAttentionStatusResult>>(url, headers).then((res: ResponseDTO<postBatchAttentionStatusResult>) => {  
20 - // callback(JSON.stringify(res))  
21 - // })  
22 - // }  
23 - if (data?.data?.method === 'post' && data?.data?.url === '/api/rmrb-interact/interact/zh/c/batchAttention/status') {  
24 - WDHttp.post<ResponseDTO<postBatchAttentionStatusResult>>(url, data?.data?.parameters).then((res: ResponseDTO<postBatchAttentionStatusResult>) => {  
25 - h5ReceiveDataJson.responseMap = res  
26 - callback(JSON.stringify(h5ReceiveDataJson)) 32 + WDHttp.post(url, data?.data?.parameters).then((res) => {
  33 + callback(JSON.stringify({
  34 + netError: '0',
  35 + responseMap: res
  36 + }))
27 }) 37 })
28 } 38 }
29 } 39 }
@@ -172,3 +172,6 @@ export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes'; @@ -172,3 +172,6 @@ export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
172 172
173 export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; 173 export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean';
174 174
  175 +
  176 +
  177 +export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean';
@@ -84,7 +84,7 @@ export class ContentDTO implements BaseDTO { @@ -84,7 +84,7 @@ export class ContentDTO implements BaseDTO {
84 openType: string = ''; 84 openType: string = '';
85 extra: string = '' 85 extra: string = ''
86 86
87 - static clone(old:ContentDTO): ContentDTO { 87 + static clone(old: ContentDTO): ContentDTO {
88 let content = new ContentDTO(); 88 let content = new ContentDTO();
89 content.appStyle = old.appStyle; 89 content.appStyle = old.appStyle;
90 content.cityCode = old.cityCode; 90 content.cityCode = old.cityCode;
1 export interface commentInfo { 1 export interface commentInfo {
2 commentTitle: string, 2 commentTitle: string,
3 newsTitle: string, 3 newsTitle: string,
4 - userName: string,  
5 - userHeaderUrl: string, 4 + userId?: string,
  5 + userName?: string,
  6 + userHeaderUrl?: string,
6 publishTime: number, 7 publishTime: number,
7 commentId: string, 8 commentId: string,
8 newsId: string, 9 newsId: string,
9 relId: string; 10 relId: string;
10 relType: string; 11 relType: string;
11 - userId: string; 12 + newsType?: string,
  13 + objectType?: string,
12 } 14 }
  1 +export interface FeedbackTypeBean {
  2 + classifyName: string;
  3 + id: number;
  4 + isselect: boolean;
  5 +}
@@ -57,6 +57,8 @@ export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailCompo @@ -57,6 +57,8 @@ export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailCompo
57 57
58 export { DynamicDetailComponent } from "./src/main/ets/components/DynamicDetailComponent" 58 export { DynamicDetailComponent } from "./src/main/ets/components/DynamicDetailComponent"
59 59
  60 +export { FeedBackActivity } from "./src/main/ets/components/FeedBackActivity"
  61 +
60 export { AudioSuspensionModel } from "./src/main/ets/viewmodel/AudioSuspensionModel" 62 export { AudioSuspensionModel } from "./src/main/ets/viewmodel/AudioSuspensionModel"
61 63
62 export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent" 64 export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
@@ -65,7 +67,7 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir @@ -65,7 +67,7 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir
65 67
66 export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI" 68 export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI"
67 69
68 -export { LottieView } from './src/main/ets/lottie/LottieView' 70 +export { LottieView } from './src/main/ets/components/lottie/LottieView'
69 71
70 export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent' 72 export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent'
71 73
1 -import { CommonConstants, CompStyle } from 'wdConstant';  
2 -import { ContentDTO } from 'wdBean'; 1 +import { CompStyle } from 'wdConstant';
  2 +import { CompDTO, ContentDTO } from 'wdBean';
3 import { Card2Component } from './cardview/Card2Component'; 3 import { Card2Component } from './cardview/Card2Component';
4 import { Card3Component } from './cardview/Card3Component'; 4 import { Card3Component } from './cardview/Card3Component';
5 import { Card4Component } from './cardview/Card4Component'; 5 import { Card4Component } from './cardview/Card4Component';
@@ -24,13 +24,14 @@ import { Card21Component } from './cardview/Card21Component'; @@ -24,13 +24,14 @@ import { Card21Component } from './cardview/Card21Component';
24 @Component 24 @Component
25 export struct CardParser { 25 export struct CardParser {
26 @State contentDTO: ContentDTO = new ContentDTO(); 26 @State contentDTO: ContentDTO = new ContentDTO();
  27 + @State compDTO: CompDTO = {} as CompDTO
27 28
28 build() { 29 build() {
29 - this.contentBuilder(this.contentDTO); 30 + this.contentBuilder(this.contentDTO, this.compDTO);
30 } 31 }
31 32
32 @Builder 33 @Builder
33 - contentBuilder(contentDTO: ContentDTO) { 34 + contentBuilder(contentDTO: ContentDTO, compDTO: CompDTO) {
34 if (contentDTO.appStyle === CompStyle.Card_02) { 35 if (contentDTO.appStyle === CompStyle.Card_02) {
35 Card2Component({ contentDTO }) 36 Card2Component({ contentDTO })
36 } else if (contentDTO.appStyle === CompStyle.Card_03) { 37 } else if (contentDTO.appStyle === CompStyle.Card_03) {
@@ -38,7 +39,7 @@ export struct CardParser { @@ -38,7 +39,7 @@ export struct CardParser {
38 } else if (contentDTO.appStyle === CompStyle.Card_04) { 39 } else if (contentDTO.appStyle === CompStyle.Card_04) {
39 Card4Component({ contentDTO }) 40 Card4Component({ contentDTO })
40 } else if (contentDTO.appStyle === CompStyle.Card_05) { 41 } else if (contentDTO.appStyle === CompStyle.Card_05) {
41 - Card5Component({ contentDTO }) 42 + Card5Component({ contentDTO, titleShowPolicy: compDTO.titleShowPolicy })
42 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle 43 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
43 .Card_13) { 44 .Card_13) {
44 Card6Component({ contentDTO }) 45 Card6Component({ contentDTO })
@@ -64,8 +65,7 @@ export struct CardParser { @@ -64,8 +65,7 @@ export struct CardParser {
64 Card20Component({ contentDTO }) 65 Card20Component({ contentDTO })
65 } else if (contentDTO.appStyle === CompStyle.Card_21) { 66 } else if (contentDTO.appStyle === CompStyle.Card_21) {
66 Card21Component({ contentDTO }) 67 Card21Component({ contentDTO })
67 - }  
68 - else { 68 + } else {
69 // todo:组件未实现 / Component Not Implemented 69 // todo:组件未实现 / Component Not Implemented
70 // Text(contentDTO.appStyle) 70 // Text(contentDTO.appStyle)
71 // .width(CommonConstants.FULL_PARENT) 71 // .width(CommonConstants.FULL_PARENT)
1 -import { SPHelper,Logger,ToastUtils } from 'wdKit';  
2 -import { ContentDetailDTO, Action, ContentDTO,batchLikeAndCollectResult } from 'wdBean'; 1 +import { SPHelper, Logger, ToastUtils } from 'wdKit';
  2 +import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import router from '@ohos.router'; 4 import router from '@ohos.router';
5 import { batchLikeAndCollectParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 5 import { batchLikeAndCollectParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
6 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 6 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
7 import { SpConstants } from 'wdConstant/Index'; 7 import { SpConstants } from 'wdConstant/Index';
8 import { WDShare } from 'wdShare/Index'; 8 import { WDShare } from 'wdShare/Index';
9 -import {LikeComponent} from './view/LikeComponent' 9 +import { LikeComponent } from './view/LikeComponent'
  10 +
10 const TAG = 'CarderInteraction' 11 const TAG = 'CarderInteraction'
  12 +
11 /** 13 /**
12 * 卡片 分享、评论、点赞公用组件 14 * 卡片 分享、评论、点赞公用组件
13 */ 15 */
@@ -15,9 +17,10 @@ const TAG = 'CarderInteraction' @@ -15,9 +17,10 @@ const TAG = 'CarderInteraction'
15 export struct CarderInteraction { 17 export struct CarderInteraction {
16 @Prop contentDTO: ContentDTO 18 @Prop contentDTO: ContentDTO
17 @State contentId: string = '' 19 @State contentId: string = ''
18 - @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO  
19 - @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态 20 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  21 + @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult // 点赞、收藏状态
20 @State likeBean: Record<string, string> = {} 22 @State likeBean: Record<string, string> = {}
  23 +
21 async aboutToAppear() { 24 async aboutToAppear() {
22 await this.getContentDetailData() 25 await this.getContentDetailData()
23 // 点赞需要数据 26 // 点赞需要数据
@@ -28,51 +31,55 @@ export struct CarderInteraction { @@ -28,51 +31,55 @@ export struct CarderInteraction {
28 this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' 31 this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
29 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' 32 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
30 } 33 }
31 - build() {  
32 - Row(){  
33 - Row(){  
34 - Image($r('app.media.CarderInteraction_share'))  
35 - .width(18)  
36 - .height(18)  
37 - Text('分享')  
38 - .margin({left:4})  
39 - .fontSize(14)  
40 - .fontColor('#666666')  
41 - }  
42 - .justifyContent(FlexAlign.Center)  
43 - .onClick(()=>{  
44 - WDShare.shareContent(this.contentDetailData)  
45 - })  
46 - Row(){  
47 - Image($r('app.media.CarderInteraction_comment'))  
48 - .width(18)  
49 - .height(18)  
50 - Text('评论')  
51 - .margin({left:4})  
52 - .fontSize(14)  
53 - .fontColor('#666666')  
54 - }  
55 - .justifyContent(FlexAlign.Center)  
56 - .onClick(()=>{  
57 - ProcessUtils.processPage(this.contentDTO)  
58 - })  
59 - this.builderLike() 34 +
  35 + build() {
  36 + Row() {
  37 + Row() {
  38 + Image($r('app.media.CarderInteraction_share'))
  39 + .width(18)
  40 + .height(18)
  41 + Text('分享')
  42 + .margin({ left: 4 })
  43 + .fontSize(14)
  44 + .fontColor('#666666')
60 } 45 }
61 - .width('100%')  
62 - .margin({top:11})  
63 - .padding({  
64 - left:21,  
65 - right:21  
66 - })  
67 - .justifyContent(FlexAlign.SpaceBetween)  
68 - .alignItems(VerticalAlign.Center)  
69 - } 46 + .justifyContent(FlexAlign.Center)
  47 + .onClick(() => {
  48 + WDShare.shareContent(this.contentDetailData)
  49 + })
  50 +
  51 + Row() {
  52 + Image($r('app.media.CarderInteraction_comment'))
  53 + .width(18)
  54 + .height(18)
  55 + Text('评论')
  56 + .margin({ left: 4 })
  57 + .fontSize(14)
  58 + .fontColor('#666666')
  59 + }
  60 + .justifyContent(FlexAlign.Center)
  61 + .onClick(() => {
  62 + ProcessUtils.processPage(this.contentDTO)
  63 + })
  64 +
  65 + this.builderLike()
  66 + }
  67 + .width('100%')
  68 + .margin({ top: 11 })
  69 + .padding({
  70 + left: 21,
  71 + right: 21
  72 + })
  73 + .justifyContent(FlexAlign.SpaceBetween)
  74 + .alignItems(VerticalAlign.Center)
  75 + }
  76 +
70 /** 77 /**
71 * 点赞组件 78 * 点赞组件
72 */ 79 */
73 @Builder 80 @Builder
74 builderLike() { 81 builderLike() {
75 - Row(){ 82 + Row() {
76 if (this.likeBean?.contentId) { 83 if (this.likeBean?.contentId) {
77 LikeComponent({ 84 LikeComponent({
78 data: this.likeBean, 85 data: this.likeBean,
@@ -88,13 +95,13 @@ export struct CarderInteraction { @@ -88,13 +95,13 @@ export struct CarderInteraction {
88 * */ 95 * */
89 private async getContentDetailData() { 96 private async getContentDetailData() {
90 try { 97 try {
91 - let data = await MultiPictureDetailViewModel.getDetailData(this.contentDTO.relId, this.contentDTO.objectId, this.contentDTO.relType) 98 + let data = await MultiPictureDetailViewModel.getDetailData(this.contentDTO.relId, this.contentDTO.objectId,
  99 + this.contentDTO.relType)
92 this.contentDetailData = data[0]; 100 this.contentDetailData = data[0];
93 - console.log('动态详情',JSON.stringify(this.contentDetailData)) 101 + console.log('动态详情', JSON.stringify(this.contentDetailData))
94 } catch (exception) { 102 } catch (exception) {
95 - console.log('请求失败',JSON.stringify(exception)) 103 + console.log('请求失败', JSON.stringify(exception))
96 } 104 }
97 } 105 }
98 -  
99 } 106 }
100 107
@@ -32,12 +32,12 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent' @@ -32,12 +32,12 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'
32 @Component 32 @Component
33 export struct CompParser { 33 export struct CompParser {
34 @State compDTO: CompDTO = {} as CompDTO 34 @State compDTO: CompDTO = {} as CompDTO
35 - @State private pageModel: PageModel = new PageModel();  
36 @State compIndex: number = 0; 35 @State compIndex: number = 0;
  36 + @State private pageModel: PageModel = new PageModel();
37 37
38 build() { 38 build() {
39 Column() { 39 Column() {
40 - if (this.compDTO.name !="月度排行卡") { 40 + if (this.compDTO.name != "月度排行卡") {
41 41
42 this.componentBuilder(this.compDTO, this.compIndex); 42 this.componentBuilder(this.compDTO, this.compIndex);
43 } 43 }
@@ -53,7 +53,8 @@ export struct CompParser { @@ -53,7 +53,8 @@ export struct CompParser {
53 } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 53 } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
54 ZhCarouselLayout01({ compDTO: compDTO }) 54 ZhCarouselLayout01({ compDTO: compDTO })
55 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 55 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
56 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) {// && compDTO.name ==="横划卡" 56 + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
  57 + compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
57 58
58 LiveHorizontalCardComponent({ compDTO: compDTO }) 59 LiveHorizontalCardComponent({ compDTO: compDTO })
59 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 60 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
@@ -87,7 +88,7 @@ export struct CompParser { @@ -87,7 +88,7 @@ export struct CompParser {
87 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 88 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
88 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { 89 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
89 //头图卡 和comStyle 2相同, 90 //头图卡 和comStyle 2相同,
90 - Card5Component({ contentDTO: compDTO.operDataList[0] }) 91 + Card5Component({ contentDTO: compDTO.operDataList[0], titleShowPolicy: compDTO.titleShowPolicy })
91 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 92 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
92 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_03) { 93 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
93 // 大图卡 94 // 大图卡
@@ -107,10 +108,9 @@ export struct CompParser { @@ -107,10 +108,9 @@ export struct CompParser {
107 //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) 108 //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
108 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 109 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
109 } else if (!Number.isNaN(Number(compDTO.compStyle))) { 110 } else if (!Number.isNaN(Number(compDTO.compStyle))) {
110 - CardParser({ contentDTO: compDTO.operDataList[0] }); 111 + CardParser({ contentDTO: compDTO.operDataList[0], compDTO });
111 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 112 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
112 - }  
113 - else { 113 + } else {
114 Text(compDTO.compStyle) 114 Text(compDTO.compStyle)
115 .width(CommonConstants.FULL_PARENT) 115 .width(CommonConstants.FULL_PARENT)
116 .padding(10) 116 .padding(10)
1 -import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils,  
2 - NetworkUtil } from 'wdKit'; 1 +import {
  2 + AccountManagerUtils,
  3 + Logger,
  4 + DateTimeUtils,
  5 + SPHelper,
  6 + NumberFormatterUtils,
  7 + DisplayUtils,
  8 + NetworkUtil,
  9 + FastClickUtil
  10 +} from 'wdKit';
3 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 11 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
4 -import { ContentDetailDTO,postBatchAttentionStatusParams, 12 +import {
  13 + ContentDetailDTO,
  14 + postBatchAttentionStatusParams,
5 PhotoListBean, 15 PhotoListBean,
6 ContentDTO, 16 ContentDTO,
7 batchLikeAndCollectResult, 17 batchLikeAndCollectResult,
8 RmhInfoDTO, 18 RmhInfoDTO,
9 - InteractDataDTO, } from 'wdBean'; 19 + InteractDataDTO,
  20 +} from 'wdBean';
10 import media from '@ohos.multimedia.media'; 21 import media from '@ohos.multimedia.media';
11 import { OperRowListView } from './view/OperRowListView'; 22 import { OperRowListView } from './view/OperRowListView';
12 import { WDPlayerController } from 'wdPlayer/Index'; 23 import { WDPlayerController } from 'wdPlayer/Index';
@@ -33,6 +44,7 @@ import { detailedSkeleton } from './skeleton/detailSkeleton'; @@ -33,6 +44,7 @@ import { detailedSkeleton } from './skeleton/detailSkeleton';
33 44
34 const TAG = 'DynamicDetailComponent' 45 const TAG = 'DynamicDetailComponent'
35 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 46 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
  47 +
36 // @Preview 48 // @Preview
37 @Component 49 @Component
38 export struct DynamicDetailComponent { 50 export struct DynamicDetailComponent {
@@ -40,418 +52,479 @@ export struct DynamicDetailComponent { @@ -40,418 +52,479 @@ export struct DynamicDetailComponent {
40 private relId: string = '' 52 private relId: string = ''
41 private contentId: string = '' 53 private contentId: string = ''
42 private relType: string = '' 54 private relType: string = ''
43 -  
44 //出参 55 //出参
45 - @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 56 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
46 //UI 57 //UI
47 scroller: Scroller = new Scroller(); 58 scroller: Scroller = new Scroller();
48 -  
49 //点赞 收藏 评论 数量 59 //点赞 收藏 评论 数量
50 - @State interactDataDTO: InteractDataDTO = {likeNum:0} as InteractDataDTO 60 + @State interactDataDTO: InteractDataDTO = { likeNum: 0 } as InteractDataDTO
51 /** 61 /**
52 * 关注状态:默认未关注 点击去关注 62 * 关注状态:默认未关注 点击去关注
53 */ 63 */
54 - @State followStatus: String = '';  
55 -  
56 - @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态 64 + @State followStatus: String = '';
  65 + @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult // 点赞、收藏状态
57 //跳转 66 //跳转
58 - private mJumpInfo: ContentDTO = new ContentDTO();  
59 - 67 + private mJumpInfo: ContentDTO = new ContentDTO();
60 @State publishTime: string = '' 68 @State publishTime: string = ''
61 @State isNetConnected: boolean = true 69 @State isNetConnected: boolean = true
62 @State isPageEnd: boolean = false 70 @State isPageEnd: boolean = false
63 -  
64 @State publishCommentModel: publishCommentModel = new publishCommentModel() 71 @State publishCommentModel: publishCommentModel = new publishCommentModel()
65 72
66 -  
67 async aboutToAppear() { 73 async aboutToAppear() {
68 await this.getContentDetailData() 74 await this.getContentDetailData()
69 } 75 }
  76 +
70 onPageHide() { 77 onPageHide() {
71 78
72 } 79 }
73 80
74 build() { 81 build() {
75 - Column(){  
76 - //logo、日期  
77 - Row() {  
78 - Image($r('app.media.ic_article_rmh'))  
79 - .width($r('app.float.margin_80'))  
80 - .height($r('app.float.margin_28'))  
81 - .margin({ left: $r('app.float.margin_16') })  
82 - Blank()  
83 - Text(this.publishTime)  
84 - .fontColor($r('app.color.color_B0B0B0'))  
85 - .fontSize($r('app.float.font_size_12'))  
86 - .lineHeight($r('app.float.margin_28'))  
87 - .margin({ right: $r('app.float.margin_16') })  
88 - }  
89 - .height($r('app.float.margin_48')) 82 + Column() {
  83 + //logo、日期
  84 + Row() {
  85 + Image($r('app.media.ic_article_rmh'))
  86 + .width($r('app.float.margin_80'))
  87 + .height($r('app.float.margin_28'))
  88 + .margin({ left: $r('app.float.margin_16') })
  89 + Blank()
  90 + Text(this.publishTime)
  91 + .fontColor($r('app.color.color_B0B0B0'))
  92 + .fontSize($r('app.float.font_size_12'))
  93 + .lineHeight($r('app.float.margin_28'))
  94 + .margin({ right: $r('app.float.margin_16') })
  95 + }
  96 + .height($r('app.float.margin_48'))
  97 + .width('100%')
  98 + .alignItems(VerticalAlign.Bottom)
  99 + .padding({ bottom: 5 })
  100 +
  101 + //分割线
  102 + Image($r('app.media.ic_news_detail_division'))
90 .width('100%') 103 .width('100%')
91 - .alignItems(VerticalAlign.Bottom)  
92 - .padding({bottom:5})  
93 - //分割线  
94 - Image($r('app.media.ic_news_detail_division'))  
95 - .width('100%')  
96 - .height($r('app.float.margin_7'))  
97 - .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )  
98 - Stack({ alignContent: Alignment.Bottom }) {  
99 - if (!this.isNetConnected) {  
100 - EmptyComponent({  
101 - emptyType: 1,  
102 - emptyButton: true,  
103 - retry: () => {  
104 - this.getContentDetailData()  
105 - }  
106 - }).padding({ bottom: 200 }) 104 + .height($r('app.float.margin_7'))
  105 + .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
  106 + Stack({ alignContent: Alignment.Bottom }) {
  107 + if (!this.isNetConnected) {
  108 + EmptyComponent({
  109 + emptyType: 1,
  110 + emptyButton: true,
  111 + retry: () => {
  112 + this.getContentDetailData()
  113 + }
  114 + }).padding({ bottom: 200 })
  115 + } else {
  116 + if (!this.isPageEnd) {
  117 + detailedSkeleton()
107 } else { 118 } else {
108 - if (!this.isPageEnd) {  
109 - detailedSkeleton()  
110 - }else{  
111 - Scroll(this.scroller) {  
112 - Column() {  
113 - //号主信息  
114 - Row() {  
115 - //头像  
116 - Stack() {  
117 - Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)  
118 - .alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater'))  
119 - .width($r('app.float.margin_32'))  
120 - .height($r('app.float.margin_32'))  
121 - .objectFit(ImageFit.Cover)  
122 - .borderRadius($r('app.float.margin_16'))  
123 - Image(this.contentDetailData.rmhInfo?.honoraryIcon)  
124 - .width($r('app.float.margin_48'))  
125 - .height($r('app.float.margin_48'))  
126 - .objectFit(ImageFit.Cover)  
127 - .borderRadius($r('app.float.margin_24'))  
128 - if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){  
129 - Stack() {  
130 - Image(this.contentDetailData.rmhInfo?.authIcon)  
131 - .width($r('app.float.vp_12'))  
132 - .height($r('app.float.vp_12'))  
133 - .objectFit(ImageFit.Cover)  
134 - }  
135 - .width($r('app.float.margin_48'))  
136 - .height($r('app.float.margin_48'))  
137 - .alignContent(Alignment.BottomEnd) 119 + Scroll(this.scroller) {
  120 + Column() {
  121 + //号主信息
  122 + Row() {
  123 + //头像
  124 + Stack() {
  125 + Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
  126 + .alt(this.contentDetailData.rmhInfo?.userType == '1' ? $r('app.media.default_head') :
  127 + $r('app.media.icon_default_head_mater'))
  128 + .width($r('app.float.margin_32'))
  129 + .height($r('app.float.margin_32'))
  130 + .objectFit(ImageFit.Cover)
  131 + .borderRadius($r('app.float.margin_16'))
  132 + Image(this.contentDetailData.rmhInfo?.honoraryIcon)
  133 + .width($r('app.float.margin_48'))
  134 + .height($r('app.float.margin_48'))
  135 + .objectFit(ImageFit.Cover)
  136 + .borderRadius($r('app.float.margin_24'))
  137 + if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
  138 + Stack() {
  139 + Image(this.contentDetailData.rmhInfo?.authIcon)
  140 + .width($r('app.float.vp_12'))
  141 + .height($r('app.float.vp_12'))
  142 + .objectFit(ImageFit.Cover)
138 } 143 }
  144 + .width($r('app.float.margin_48'))
  145 + .height($r('app.float.margin_48'))
  146 + .alignContent(Alignment.BottomEnd)
139 } 147 }
140 - .width($r('app.float.margin_48'))  
141 - .height($r('app.float.margin_48'))  
142 - .alignContent(Alignment.Center)  
143 - .onClick(() => {  
144 - ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId)  
145 - })  
146 - Column(){  
147 - //昵称  
148 - Text(this.contentDetailData.rmhInfo?.rmhName)  
149 - .fontSize($r('app.float.font_size_14'))  
150 - .fontColor($r('app.color.color_222222'))  
151 - .fontWeight(FontWeight.Medium)  
152 - .margin({ left: $r('app.float.margin_5') })  
153 - .alignSelf(ItemAlign.Start)  
154 - //简介  
155 - Text(this.contentDetailData.rmhInfo?.rmhDesc)  
156 - .fontSize($r('app.float.font_size_14'))  
157 - .fontColor($r('app.color.color_B0B0B0'))  
158 - .fontWeight(FontWeight.Medium)  
159 - .maxLines(1)  
160 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
161 - .margin({ left: $r('app.float.margin_5') })  
162 - .alignSelf(ItemAlign.Start) 148 + }
  149 + .width($r('app.float.margin_48'))
  150 + .height($r('app.float.margin_48'))
  151 + .alignContent(Alignment.Center)
  152 + .onClick(async () => {
  153 + let retvalue = await FastClickUtil.isMinDelayTime()
  154 + if(retvalue){
  155 + return
163 } 156 }
164 - .width('63%')  
165 - .margin({right: $r('app.float.margin_6')})  
166 - if(!StringUtils.isEmpty(this.followStatus)){  
167 - if (this.followStatus == '0') {  
168 - Row() {  
169 - Blank().layoutWeight(1)  
170 - Image($r('app.media.icon_add_attention'))  
171 - .width($r('app.float.vp_12'))  
172 - .height($r('app.float.vp_12'))  
173 - .margin({right:2})  
174 - Text('关注')  
175 - .textAlign(TextAlign.Center)  
176 - .fontSize($r('app.float.font_size_12'))  
177 - .fontColor($r('app.color.color_fff'))  
178 - Blank().layoutWeight(1) 157 + ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ? "" :
  158 + this.contentDetailData.rmhInfo.rmhId)
  159 + })
  160 +
  161 + Column() {
  162 + //昵称
  163 + Text(this.contentDetailData.rmhInfo?.rmhName)
  164 + .fontSize($r('app.float.font_size_14'))
  165 + .fontColor($r('app.color.color_222222'))
  166 + .fontWeight(FontWeight.Medium)
  167 + .margin({ left: $r('app.float.margin_5') })
  168 + .alignSelf(ItemAlign.Start)
  169 + //简介
  170 + Text(this.contentDetailData.rmhInfo?.rmhDesc)
  171 + .fontSize($r('app.float.font_size_14'))
  172 + .fontColor($r('app.color.color_B0B0B0'))
  173 + .fontWeight(FontWeight.Medium)
  174 + .maxLines(1)
  175 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  176 + .margin({ left: $r('app.float.margin_5') })
  177 + .alignSelf(ItemAlign.Start)
  178 + }
  179 + .width('63%')
  180 + .margin({ right: $r('app.float.margin_6') })
  181 +
  182 + if (!StringUtils.isEmpty(this.followStatus)) {
  183 + if (this.followStatus == '0') {
  184 + Row() {
  185 + Blank().layoutWeight(1)
  186 + Image($r('app.media.icon_add_attention'))
  187 + .width($r('app.float.vp_12'))
  188 + .height($r('app.float.vp_12'))
  189 + .margin({ right: 2 })
  190 + Text('关注')
  191 + .textAlign(TextAlign.Center)
  192 + .fontSize($r('app.float.font_size_12'))
  193 + .fontColor($r('app.color.color_fff'))
  194 + Blank().layoutWeight(1)
  195 + }
  196 + .width($r('app.float.margin_54'))
  197 + .height($r('app.float.margin_24'))
  198 + .borderRadius($r('app.float.vp_3'))
  199 + .backgroundColor($r('app.color.color_ED2800'))
  200 + .onClick(async () => {
  201 + let retvalue = await FastClickUtil.isMinDelayTime()
  202 + if(retvalue){
  203 + return
179 } 204 }
  205 + this.handleAccention()
  206 + })
  207 + } else {
  208 + Text('已关注')
180 .width($r('app.float.margin_54')) 209 .width($r('app.float.margin_54'))
181 .height($r('app.float.margin_24')) 210 .height($r('app.float.margin_24'))
  211 + .borderWidth(1)
  212 + .textAlign(TextAlign.Center)
  213 + .fontSize($r('app.float.font_size_12'))
182 .borderRadius($r('app.float.vp_3')) 214 .borderRadius($r('app.float.vp_3'))
183 - .backgroundColor($r('app.color.color_ED2800'))  
184 - .onClick(() => { 215 + .borderColor($r('app.color.color_CCCCCC_1A'))
  216 + .backgroundColor($r('app.color.color_CCCCCC_1A'))
  217 + .fontColor($r('app.color.color_CCCCCC'))
  218 + .onClick(async () => {
  219 + let retvalue = await FastClickUtil.isMinDelayTime()
  220 + if(retvalue){
  221 + return
  222 + }
185 this.handleAccention() 223 this.handleAccention()
186 }) 224 })
187 - } else {  
188 - Text('已关注')  
189 - .width($r('app.float.margin_54'))  
190 - .height($r('app.float.margin_24'))  
191 - .borderWidth(1)  
192 - .textAlign(TextAlign.Center)  
193 - .fontSize($r('app.float.font_size_12'))  
194 - .borderRadius($r('app.float.vp_3'))  
195 - .borderColor($r('app.color.color_CCCCCC_1A'))  
196 - .backgroundColor($r('app.color.color_CCCCCC_1A'))  
197 - .fontColor($r('app.color.color_CCCCCC'))  
198 - .onClick(() => {  
199 - this.handleAccention()  
200 - })  
201 - }  
202 } 225 }
203 } 226 }
204 - .width('100%')  
205 - .margin({ left: $r('app.float.margin_16')})  
206 - //内容  
207 - Text(StringUtils.isEmpty(this.contentDetailData.newsContent)  
208 - ?StringUtils.isEmpty(this.contentDetailData.newsSummary)  
209 - ?this.contentDetailData.newsTitle  
210 - :this.contentDetailData.newsSummary  
211 - :this.contentDetailData.newsContent)  
212 - .fontColor($r('app.color.color_222222'))  
213 - .fontSize($r('app.float.font_size_18'))  
214 - .lineHeight($r('app.float.margin_25'))  
215 - .margin({ top: $r('app.float.margin_6')  
216 - ,left: $r('app.float.margin_16')  
217 - ,right: $r('app.float.margin_16') })  
218 - .alignSelf(ItemAlign.Start)  
219 - if(this.contentDetailData.newsType+"" == ContentConstants.TYPE_FOURTEEN){  
220 - //附件内容:图片/视频  
221 - if(this.contentDetailData.photoList!= null && this.contentDetailData.photoList.length>0){  
222 - // 图片-从无图到9图展示  
223 - GridRow({  
224 - gutter: { x: 2, y: 2 }  
225 - }) {  
226 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {  
227 - if (this.contentDetailData.photoList.length === 1) {  
228 - if (this.getPicType(item) !== 3) {  
229 - GridCol({  
230 - span: this.getPicType(item) === 1 ? 12 : 8  
231 - }){  
232 - Stack({  
233 - alignContent: Alignment.BottomEnd  
234 - }) {  
235 - if (this.getPicType(item) === 1) {  
236 - Image(item.picPath)  
237 - .width('100%')  
238 - .height(172)  
239 - .autoResize(true)  
240 - .borderRadius(this.caclImageRadius(index))  
241 - } else if (this.getPicType(item) === 2) {  
242 - Image(item.picPath)  
243 - .width('100%')  
244 - .height(305)  
245 - .autoResize(true)  
246 - .borderRadius(this.caclImageRadius(index))  
247 - }  
248 - Flex({ direction: FlexDirection.Row }) {  
249 - Image($r('app.media.icon_long_pic'))  
250 - .width(14)  
251 - .height(14)  
252 - .margin({right: 4})  
253 - Text('长图')  
254 - .fontSize(12)  
255 - .fontWeight(400)  
256 - .fontColor(0xffffff)  
257 - .fontFamily('PingFang SC')  
258 - }  
259 - .width(48)  
260 - .padding({bottom: 9}) 227 + }
  228 + .width('100%')
  229 + .margin({ left: $r('app.float.margin_16') })
261 230
262 - }  
263 - }  
264 - .onClick((event: ClickEvent) => {  
265 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
266 - })  
267 - } else {  
268 - GridCol({  
269 - span: { xs: 8 }  
270 - }) {  
271 - Image(item.picPath)  
272 - .width('100%')  
273 - .borderRadius(this.caclImageRadius(index))  
274 - .autoResize(true)  
275 - .opacity(!item.width && !item.height ? 0 : 1)  
276 - .onComplete(callback => {  
277 - item.width = callback?.width || 0;  
278 - item.height = callback?.height || 0;  
279 - })  
280 - }  
281 - .onClick((event: ClickEvent) => {  
282 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
283 - })  
284 - }  
285 - } else if (this.contentDetailData.photoList.length === 4) { 231 + //内容
  232 + Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
  233 + ? StringUtils.isEmpty(this.contentDetailData.newsSummary)
  234 + ? this.contentDetailData.newsTitle
  235 + : this.contentDetailData.newsSummary
  236 + : this.contentDetailData.newsContent)
  237 + .fontColor($r('app.color.color_222222'))
  238 + .fontSize($r('app.float.font_size_18'))
  239 + .lineHeight($r('app.float.margin_25'))
  240 + .margin({
  241 + top: $r('app.float.margin_6')
  242 + , left: $r('app.float.margin_16')
  243 + , right: $r('app.float.margin_16')
  244 + })
  245 + .alignSelf(ItemAlign.Start)
  246 + if (this.contentDetailData.newsType + "" == ContentConstants.TYPE_FOURTEEN) {
  247 + //附件内容:图片/视频
  248 + if (this.contentDetailData.photoList != null && this.contentDetailData.photoList.length > 0) {
  249 + // 图片-从无图到9图展示
  250 + GridRow({
  251 + gutter: { x: 2, y: 2 }
  252 + }) {
  253 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {
  254 + if (this.contentDetailData.photoList.length === 1) {
  255 + if (this.getPicType(item) !== 3) {
286 GridCol({ 256 GridCol({
287 - span: { xs: 4 } 257 + span: this.getPicType(item) === 1 ? 12 : 8
288 }) { 258 }) {
289 - Image(item.picPath)  
290 - .aspectRatio(1)  
291 - .borderRadius(this.caclImageRadius(index)) 259 + Stack({
  260 + alignContent: Alignment.BottomEnd
  261 + }) {
  262 + if (this.getPicType(item) === 1) {
  263 + Image(item.picPath)
  264 + .width('100%')
  265 + .height(172)
  266 + .autoResize(true)
  267 + .borderRadius(this.caclImageRadius(index))
  268 + } else if (this.getPicType(item) === 2) {
  269 + Image(item.picPath)
  270 + .width('100%')
  271 + .height(305)
  272 + .autoResize(true)
  273 + .borderRadius(this.caclImageRadius(index))
  274 + }
  275 + Flex({ direction: FlexDirection.Row }) {
  276 + Image($r('app.media.icon_long_pic'))
  277 + .width(14)
  278 + .height(14)
  279 + .margin({ right: 4 })
  280 + Text('长图')
  281 + .fontSize(12)
  282 + .fontWeight(400)
  283 + .fontColor(0xffffff)
  284 + .fontFamily('PingFang SC')
  285 + }
  286 + .width(48)
  287 + .padding({ bottom: 9 })
  288 +
  289 + }
292 } 290 }
293 - .onClick((event: ClickEvent) => {  
294 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index) 291 + .onClick(async (event: ClickEvent) => {
  292 + let retvalue = await FastClickUtil.isMinDelayTime()
  293 + if(retvalue){
  294 + return
  295 + }
  296 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
295 }) 297 })
296 } else { 298 } else {
297 GridCol({ 299 GridCol({
298 - span: { sm: 4, lg: 3 } 300 + span: { xs: 8 }
299 }) { 301 }) {
300 Image(item.picPath) 302 Image(item.picPath)
301 - .aspectRatio(1) 303 + .width('100%')
302 .borderRadius(this.caclImageRadius(index)) 304 .borderRadius(this.caclImageRadius(index))
  305 + .autoResize(true)
  306 + .opacity(!item.width && !item.height ? 0 : 1)
  307 + .onComplete(callback => {
  308 + item.width = callback?.width || 0;
  309 + item.height = callback?.height || 0;
  310 + })
303 } 311 }
304 - .onClick((event: ClickEvent) => {  
305 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index) 312 + .onClick(async (event: ClickEvent) => {
  313 + let retvalue = await FastClickUtil.isMinDelayTime()
  314 + if(retvalue){
  315 + return
  316 + }
  317 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
306 }) 318 })
307 } 319 }
308 - })  
309 - }  
310 - .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})  
311 - }  
312 - }else{  
313 - if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){  
314 - GridRow() {  
315 - if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {  
316 - // 横屏 320 + } else if (this.contentDetailData.photoList.length === 4) {
317 GridCol({ 321 GridCol({
318 - span: { xs: 12 } 322 + span: { xs: 4 }
319 }) { 323 }) {
320 - Stack() {  
321 - Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?  
322 - this.contentDetailData.fullColumnImgUrls[0].url:  
323 - this.contentDetailData.videoInfo[0].firstFrameImageUri)  
324 - .width(DisplayUtils.getDeviceWidth()- 32)  
325 - .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16)  
326 - .borderRadius($r('app.float.image_border_radius'))  
327 - CardMediaInfo({ contentDTO: this.mJumpInfo })  
328 - }  
329 - .align(Alignment.BottomEnd) 324 + Image(item.picPath)
  325 + .aspectRatio(1)
  326 + .borderRadius(this.caclImageRadius(index))
330 } 327 }
  328 + .onClick(async (event: ClickEvent) => {
  329 + let retvalue = await FastClickUtil.isMinDelayTime()
  330 + if(retvalue){
  331 + return
  332 + }
  333 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  334 + })
331 } else { 335 } else {
332 - // 竖图显示,宽度占50%,高度自适应  
333 GridCol({ 336 GridCol({
334 - span: { xs: 6 } 337 + span: { sm: 4, lg: 3 }
335 }) { 338 }) {
336 - Stack() {  
337 - Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?  
338 - this.contentDetailData.fullColumnImgUrls[0].url:  
339 - this.contentDetailData.videoInfo[0].firstFrameImageUri)  
340 - .width(DisplayUtils.getDeviceWidth()/2)  
341 - .height(DisplayUtils.getDeviceWidth()/2* 4 / 3)  
342 - .borderRadius($r('app.float.image_border_radius'))  
343 - CardMediaInfo({ contentDTO: this.mJumpInfo })  
344 - }  
345 - .align(Alignment.BottomEnd) 339 + Image(item.picPath)
  340 + .aspectRatio(1)
  341 + .borderRadius(this.caclImageRadius(index))
346 } 342 }
  343 + .onClick(async (event: ClickEvent) => {
  344 + let retvalue = await FastClickUtil.isMinDelayTime()
  345 + if(retvalue){
  346 + return
  347 + }
  348 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  349 + })
347 } 350 }
348 - }  
349 - .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')})  
350 - .onClick((event: ClickEvent) => {  
351 - ProcessUtils.processPage(this.mJumpInfo)  
352 }) 351 })
353 } 352 }
  353 + .margin({
  354 + left: $r('app.float.margin_16'),
  355 + right: $r('app.float.margin_16'),
  356 + top: $r('app.float.margin_8')
  357 + })
354 } 358 }
355 - //特别声明  
356 - Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")  
357 - .fontColor($r('app.color.color_CCCCCC'))  
358 - .fontSize($r('app.float.font_size_12'))  
359 - .lineHeight($r('app.float.margin_16'))  
360 - .margin({ top: $r('app.float.margin_16')  
361 - ,left: $r('app.float.vp_12')  
362 - ,right: $r('app.float.vp_12') })  
363 - //微信/朋友圈/微博  
364 - // Row(){  
365 - // Image($r('app.media.xxhdpi_pic_wechat'))  
366 - // .width($r('app.float.margin_116'))  
367 - // .height($r('app.float.margin_36'))  
368 - // .objectFit(ImageFit.Cover)  
369 - // Image($r('app.media.xxhdpi_pic_pyq'))  
370 - // .width($r('app.float.margin_116'))  
371 - // .height($r('app.float.margin_36'))  
372 - // .margin({ left: $r('app.float.margin_4_negative')})  
373 - // .objectFit(ImageFit.Cover)  
374 - // Image($r('app.media.xxhdpi_pic_wb'))  
375 - // .width($r('app.float.margin_116'))  
376 - // .height($r('app.float.margin_36'))  
377 - // .margin({ left: $r('app.float.margin_4_negative')})  
378 - // .objectFit(ImageFit.Cover)  
379 - // }  
380 - // .margin({ top: $r('app.float.margin_24')})  
381 - //点赞  
382 - Row(){  
383 - Blank().layoutWeight(1)  
384 - Image(this.newsStatusOfUser?.likeStatus == '1'?  
385 - $r('app.media.icon_like_selected_redheart')  
386 - :$r('app.media.icon_like_unselect_grey_redheart'))  
387 - .width($r('app.float.margin_36'))  
388 - .height($r('app.float.margin_36'))  
389 - .objectFit(ImageFit.Cover)  
390 - .margin({ left: $r('app.float.margin_6_negative'),right: $r('app.float.margin_6_negative')})  
391 - if(this.interactDataDTO?.likeNum != 0){  
392 - Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))  
393 - .fontColor($r('app.color.color_999999'))  
394 - .fontSize($r('app.float.font_size_16'))  
395 - .lineHeight($r('app.float.margin_20'))  
396 - .margin({ left: $r('app.float.margin_2')}) 359 + } else {
  360 + if (this.contentDetailData.videoInfo != null && this.contentDetailData.videoInfo.length > 0) {
  361 + GridRow() {
  362 + if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {
  363 + // 横屏
  364 + GridCol({
  365 + span: { xs: 12 }
  366 + }) {
  367 + Stack() {
  368 + Image(this.contentDetailData.fullColumnImgUrls != null &&
  369 + this.contentDetailData.fullColumnImgUrls.length > 0 &&
  370 + !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
  371 + this.contentDetailData.fullColumnImgUrls[0].url :
  372 + this.contentDetailData.videoInfo[0].firstFrameImageUri)
  373 + .width(DisplayUtils.getDeviceWidth() - 32)
  374 + .height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16)
  375 + .borderRadius($r('app.float.image_border_radius'))
  376 + CardMediaInfo({ contentDTO: this.mJumpInfo })
  377 + }
  378 + .align(Alignment.BottomEnd)
  379 + }
  380 + } else {
  381 + // 竖图显示,宽度占50%,高度自适应
  382 + GridCol({
  383 + span: { xs: 6 }
  384 + }) {
  385 + Stack() {
  386 + Image(this.contentDetailData.fullColumnImgUrls != null &&
  387 + this.contentDetailData.fullColumnImgUrls.length > 0 &&
  388 + !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
  389 + this.contentDetailData.fullColumnImgUrls[0].url :
  390 + this.contentDetailData.videoInfo[0].firstFrameImageUri)
  391 + .width(DisplayUtils.getDeviceWidth() / 2)
  392 + .height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3)
  393 + .borderRadius($r('app.float.image_border_radius'))
  394 + CardMediaInfo({ contentDTO: this.mJumpInfo })
  395 + }
  396 + .align(Alignment.BottomEnd)
  397 + }
  398 + }
397 } 399 }
398 - Blank().layoutWeight(1) 400 + .padding({
  401 + left: this.contentDetailData.videoInfo[0].videoLandScape === 1 ? 0 : 25,
  402 + top: $r('app.float.margin_8')
  403 + })
  404 + .onClick(async (event: ClickEvent) => {
  405 + let retvalue = await FastClickUtil.isMinDelayTime()
  406 + if(retvalue){
  407 + return
  408 + }
  409 + ProcessUtils.processPage(this.mJumpInfo)
  410 + })
399 } 411 }
400 - .width($r('app.float.margin_154'))  
401 - .height($r('app.float.margin_40'))  
402 - .margin({top:$r('app.float.margin_16')})  
403 - .borderWidth($r('app.float.margin_1'))  
404 - .borderColor($r('app.color.color_EDEDED'))  
405 - .borderRadius($r('app.float.margin_20'))  
406 - .onClick((event: ClickEvent) => {  
407 - //点赞操作  
408 - this.toggleLikeStatus() 412 + }
  413 + //特别声明
  414 + Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")
  415 + .fontColor($r('app.color.color_CCCCCC'))
  416 + .fontSize($r('app.float.font_size_12'))
  417 + .lineHeight($r('app.float.margin_16'))
  418 + .margin({
  419 + top: $r('app.float.margin_16')
  420 + , left: $r('app.float.vp_12')
  421 + , right: $r('app.float.vp_12')
409 }) 422 })
410 - // 评论  
411 - if (this.contentDetailData?.openComment) {  
412 - Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')})  
413 - CommentComponent({  
414 - publishCommentModel: {  
415 - targetId: String(this.contentDetailData?.newsId || ''),  
416 - targetRelId: this.contentDetailData?.reLInfo?.relId,  
417 - targetTitle: this.contentDetailData?.newsTitle,  
418 - targetRelType: this.contentDetailData?.reLInfo?.relType,  
419 - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),  
420 - keyArticle: String(this.contentDetailData?.keyArticle),  
421 - targetType: String(this.contentDetailData?.newsType),  
422 - } as publishCommentModel  
423 - }) 423 + //微信/朋友圈/微博
  424 + // Row(){
  425 + // Image($r('app.media.xxhdpi_pic_wechat'))
  426 + // .width($r('app.float.margin_116'))
  427 + // .height($r('app.float.margin_36'))
  428 + // .objectFit(ImageFit.Cover)
  429 + // Image($r('app.media.xxhdpi_pic_pyq'))
  430 + // .width($r('app.float.margin_116'))
  431 + // .height($r('app.float.margin_36'))
  432 + // .margin({ left: $r('app.float.margin_4_negative')})
  433 + // .objectFit(ImageFit.Cover)
  434 + // Image($r('app.media.xxhdpi_pic_wb'))
  435 + // .width($r('app.float.margin_116'))
  436 + // .height($r('app.float.margin_36'))
  437 + // .margin({ left: $r('app.float.margin_4_negative')})
  438 + // .objectFit(ImageFit.Cover)
  439 + // }
  440 + // .margin({ top: $r('app.float.margin_24')})
  441 + //点赞
  442 + Row() {
  443 + Blank().layoutWeight(1)
  444 + Image(this.newsStatusOfUser?.likeStatus == '1' ?
  445 + $r('app.media.icon_like_selected_redheart')
  446 + : $r('app.media.icon_like_unselect_grey_redheart'))
  447 + .width($r('app.float.margin_36'))
  448 + .height($r('app.float.margin_36'))
  449 + .objectFit(ImageFit.Cover)
  450 + .margin({ left: $r('app.float.margin_6_negative'), right: $r('app.float.margin_6_negative') })
  451 + if (this.interactDataDTO?.likeNum != 0) {
  452 + Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
  453 + .fontColor($r('app.color.color_999999'))
  454 + .fontSize($r('app.float.font_size_16'))
  455 + .lineHeight($r('app.float.margin_20'))
  456 + .margin({ left: $r('app.float.margin_2') })
424 } 457 }
425 Blank().layoutWeight(1) 458 Blank().layoutWeight(1)
426 } 459 }
  460 + .width($r('app.float.margin_154'))
  461 + .height($r('app.float.margin_40'))
  462 + .margin({ top: $r('app.float.margin_16') })
  463 + .borderWidth($r('app.float.margin_1'))
  464 + .borderColor($r('app.color.color_EDEDED'))
  465 + .borderRadius($r('app.float.margin_20'))
  466 + .onClick(async (event: ClickEvent) => {
  467 + let retvalue = await FastClickUtil.isMinDelayTime()
  468 + if(retvalue){
  469 + return
  470 + }
  471 + //点赞操作
  472 + this.toggleLikeStatus()
  473 + })
  474 +
  475 + // 评论
  476 + if (this.contentDetailData?.openComment) {
  477 + Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') })
  478 + CommentComponent({
  479 + publishCommentModel: {
  480 + targetId: String(this.contentDetailData?.newsId || ''),
  481 + targetRelId: this.contentDetailData?.reLInfo?.relId,
  482 + targetTitle: this.contentDetailData?.newsTitle,
  483 + targetRelType: this.contentDetailData?.reLInfo?.relType,
  484 + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
  485 + keyArticle: String(this.contentDetailData?.keyArticle),
  486 + targetType: String(this.contentDetailData?.newsType),
  487 + } as publishCommentModel
  488 + })
  489 + }
  490 + Blank().layoutWeight(1)
427 } 491 }
428 - .width(CommonConstants.FULL_WIDTH)  
429 - .height(CommonConstants.FULL_HEIGHT)  
430 - .padding({ bottom: 76 })  
431 - .scrollBar(BarState.Off)  
432 - .alignSelf(ItemAlign.Start)  
433 } 492 }
  493 + .width(CommonConstants.FULL_WIDTH)
  494 + .height(CommonConstants.FULL_HEIGHT)
  495 + .padding({ bottom: 76 })
  496 + .scrollBar(BarState.Off)
  497 + .alignSelf(ItemAlign.Start)
434 } 498 }
435 - //底部交互区  
436 - OperRowListView({  
437 - contentDetailData: this.contentDetailData,  
438 - publishCommentModel: this.publishCommentModel,  
439 - operationButtonList: ['comment', 'collect', 'share'],  
440 - styleType: 1,  
441 - })  
442 -  
443 } 499 }
  500 + //底部交互区
  501 + OperRowListView({
  502 + contentDetailData: this.contentDetailData,
  503 + publishCommentModel: this.publishCommentModel,
  504 + operationButtonList: ['comment', 'collect', 'share'],
  505 + styleType: 1,
  506 + })
  507 +
444 } 508 }
445 - .alignSelf(ItemAlign.Start)  
446 - .backgroundColor('#FFFFFFFF')  
447 - .width('100%')  
448 - .height('100%') 509 + }
  510 + .alignSelf(ItemAlign.Start)
  511 + .backgroundColor('#FFFFFFFF')
  512 + .width('100%')
  513 + .height('100%')
449 } 514 }
  515 +
450 /** 516 /**
451 * 请求(动态)详情页数据 517 * 请求(动态)详情页数据
452 * */ 518 * */
453 private async getContentDetailData() { 519 private async getContentDetailData() {
454 this.isNetConnected = NetworkUtil.isNetConnected() 520 this.isNetConnected = NetworkUtil.isNetConnected()
  521 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  522 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
  523 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  524 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
  525 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
  526 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
  527 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
455 try { 528 try {
456 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 529 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
457 this.isPageEnd = true; 530 this.isPageEnd = true;
@@ -460,9 +533,9 @@ export struct DynamicDetailComponent { @@ -460,9 +533,9 @@ export struct DynamicDetailComponent {
460 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); 533 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
461 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) 534 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
462 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) 535 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
463 - console.log('动态详情',JSON.stringify(this.contentDetailData)) 536 + console.log('动态详情', JSON.stringify(this.contentDetailData))
464 } catch (exception) { 537 } catch (exception) {
465 - console.log('请求失败',JSON.stringify(exception)) 538 + console.log('请求失败', JSON.stringify(exception))
466 this.isPageEnd = true; 539 this.isPageEnd = true;
467 } 540 }
468 this.getBatchAttentionStatus() 541 this.getBatchAttentionStatus()
@@ -471,10 +544,11 @@ export struct DynamicDetailComponent { @@ -471,10 +544,11 @@ export struct DynamicDetailComponent {
471 this.interactDataV2() 544 this.interactDataV2()
472 } 545 }
473 546
474 -  
475 private async interactDataV2() { 547 private async interactDataV2() {
476 this.interactDataDTO = await MultiPictureDetailViewModel.interactDataV2( 548 this.interactDataDTO = await MultiPictureDetailViewModel.interactDataV2(
477 - this.contentDetailData?.newsId+'',this.contentDetailData?.newsType+'',this.contentDetailData.reLInfo == null ?'':this.contentDetailData.reLInfo?.relId,this.contentDetailData.rmhPlatform) 549 + this.contentDetailData?.newsId + '', this.contentDetailData?.newsType + '',
  550 + this.contentDetailData.reLInfo == null ? '' : this.contentDetailData.reLInfo?.relId,
  551 + this.contentDetailData.rmhPlatform)
478 } 552 }
479 553
480 // 已登录->查询用户对作品点赞、收藏状态 554 // 已登录->查询用户对作品点赞、收藏状态
@@ -514,30 +588,31 @@ export struct DynamicDetailComponent { @@ -514,30 +588,31 @@ export struct DynamicDetailComponent {
514 return 588 return
515 } 589 }
516 try { 590 try {
517 - const params: postBatchAttentionStatusParams = {  
518 - creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]  
519 - }  
520 - let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)  
521 - this.followStatus = data[0]?.status;  
522 - Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)  
523 - } catch (exception) {  
524 - this.followStatus = '0'; 591 + const params: postBatchAttentionStatusParams = {
  592 + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
525 } 593 }
  594 + let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
  595 + this.followStatus = data[0]?.status;
  596 + Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
  597 + } catch (exception) {
  598 + this.followStatus = '0';
  599 + }
526 } 600 }
527 601
528 //创建跳转信息 602 //创建跳转信息
529 - makeJumpInfo(){ 603 + makeJumpInfo() {
530 this.mJumpInfo.pageId = 'dynamicDetailPage' 604 this.mJumpInfo.pageId = 'dynamicDetailPage'
531 - this.mJumpInfo.objectId = this.contentDetailData.newsId+""  
532 - this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType+""  
533 - this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId+""  
534 - this.mJumpInfo.objectType = (this.contentDetailData.newsType+"") == ContentConstants.TYPE_FOURTEEN?this.contentDetailData.newsType+"":ContentConstants.TYPE_VOD  
535 - if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){ 605 + this.mJumpInfo.objectId = this.contentDetailData.newsId + ""
  606 + this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + ""
  607 + this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + ""
  608 + this.mJumpInfo.objectType =
  609 + (this.contentDetailData.newsType + "") == ContentConstants.TYPE_FOURTEEN ? this.contentDetailData.newsType + "" :
  610 + ContentConstants.TYPE_VOD
  611 + if (this.contentDetailData.videoInfo != null && this.contentDetailData.videoInfo.length > 0) {
536 this.mJumpInfo.videoInfo = this.contentDetailData.videoInfo[0] 612 this.mJumpInfo.videoInfo = this.contentDetailData.videoInfo[0]
537 } 613 }
538 } 614 }
539 615
540 -  
541 caclImageRadius(index: number) { 616 caclImageRadius(index: number) {
542 let radius: radiusType = { 617 let radius: radiusType = {
543 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0, 618 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
@@ -561,11 +636,11 @@ export struct DynamicDetailComponent { @@ -561,11 +636,11 @@ export struct DynamicDetailComponent {
561 return radius 636 return radius
562 } 637 }
563 638
564 - getPicType(item: PhotoListBean){ 639 + getPicType(item: PhotoListBean) {
565 if (item.width && item.width) { 640 if (item.width && item.width) {
566 - if (item.width / item.height > 343/172) { 641 + if (item.width / item.height > 343 / 172) {
567 return 1; //横长图 642 return 1; //横长图
568 - } else if (item.height / item.width > 305/228) { 643 + } else if (item.height / item.width > 305 / 228) {
569 return 2; //竖长图 644 return 2; //竖长图
570 } else { 645 } else {
571 return 3 646 return 3
@@ -590,7 +665,7 @@ export struct DynamicDetailComponent { @@ -590,7 +665,7 @@ export struct DynamicDetailComponent {
590 attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) 665 attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
591 attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id 666 attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
592 attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id 667 attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
593 - status: this.followStatus == '0'? 1:0, 668 + status: this.followStatus == '0' ? 1 : 0,
594 } 669 }
595 ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { 670 ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
596 console.log('关注号主==', JSON.stringify(res.data)) 671 console.log('关注号主==', JSON.stringify(res.data))
@@ -9,7 +9,7 @@ import font from '@ohos.font'; @@ -9,7 +9,7 @@ import font from '@ohos.font';
9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; 9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
10 import { RMCalendarBean } from './calendar/RMCalendarBean'; 10 import { RMCalendarBean } from './calendar/RMCalendarBean';
11 import { newsSkeleton } from './skeleton/newsSkeleton'; 11 import { newsSkeleton } from './skeleton/newsSkeleton';
12 -import { Logger, ToastUtils } from 'wdKit/Index'; 12 +import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
13 13
14 @Component 14 @Component
15 export struct ENewspaperPageComponent { 15 export struct ENewspaperPageComponent {
@@ -82,6 +82,12 @@ export struct ENewspaperPageComponent { @@ -82,6 +82,12 @@ export struct ENewspaperPageComponent {
82 this.screenWidth = this.displayTool.width 82 this.screenWidth = this.displayTool.width
83 this.picWidth = this.screenWidth - vp2px(52) 83 this.picWidth = this.screenWidth - vp2px(52)
84 this.picHeight = this.picWidth * 566 / 378 84 this.picHeight = this.picWidth * 566 / 378
  85 + // 默认日期
  86 + const date = new Date()
  87 + const month = date.getMonth() + 1
  88 + const day = date.getDate()
  89 + this.calendarDate =
  90 + `${date.getFullYear()}-${month > 9 ? month : '0' + month}-${day > 9 ? day : '0' + day}`
85 //注册字体 91 //注册字体
86 font.registerFont({ 92 font.registerFont({
87 familyName: 'BebasNeueBold', 93 familyName: 'BebasNeueBold',
@@ -135,12 +141,12 @@ export struct ENewspaperPageComponent { @@ -135,12 +141,12 @@ export struct ENewspaperPageComponent {
135 }) 141 })
136 .id('e_newspaper_date') 142 .id('e_newspaper_date')
137 .onClick(() => { 143 .onClick(() => {
138 - this.calendarDialogShow = !this.calendarDialogShow  
139 - if (this.calendarDialogShow) {  
140 - this.calendarDialogController.open()  
141 - } else {  
142 - this.calendarDialogController.close()  
143 - } 144 + this.calendarDialogShow = !this.calendarDialogShow
  145 + if (this.calendarDialogShow) {
  146 + this.calendarDialogController.open()
  147 + } else {
  148 + this.calendarDialogController.close()
  149 + }
144 }) 150 })
145 151
146 Image($r('app.media.icon_share')) 152 Image($r('app.media.icon_share'))
@@ -260,11 +266,15 @@ export struct ENewspaperPageComponent { @@ -260,11 +266,15 @@ export struct ENewspaperPageComponent {
260 }) 266 })
261 .id('e_newspaper_page_num') 267 .id('e_newspaper_page_num')
262 .onClick((event: ClickEvent) => { 268 .onClick((event: ClickEvent) => {
263 - this.pageDialogShow = !this.pageDialogShow  
264 - if (this.pageDialogShow) {  
265 - this.pageDialogController.open()  
266 - } else {  
267 - this.pageDialogController.close() 269 + if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
  270 + this.pageDialogShow = !this.pageDialogShow
  271 + if (this.pageDialogShow) {
  272 + this.pageDialogController.open()
  273 + } else {
  274 + this.pageDialogController.close()
  275 + }
  276 + }else {
  277 + ToastUtils.showToast('暂无数据', 1000)
268 } 278 }
269 }) 279 })
270 280
@@ -291,7 +301,11 @@ export struct ENewspaperPageComponent { @@ -291,7 +301,11 @@ export struct ENewspaperPageComponent {
291 }) 301 })
292 .id('e_newspaper_read') 302 .id('e_newspaper_read')
293 .onClick((event: ClickEvent) => { 303 .onClick((event: ClickEvent) => {
294 - this.isOpenListDialog = true 304 + if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
  305 + this.isOpenListDialog = true
  306 + }else {
  307 + ToastUtils.showToast('暂无数据', 1000)
  308 + }
295 }) 309 })
296 } 310 }
297 .width('100%') 311 .width('100%')
@@ -322,8 +336,12 @@ export struct ENewspaperPageComponent { @@ -322,8 +336,12 @@ export struct ENewspaperPageComponent {
322 336
323 private async getNewspaperList() { 337 private async getNewspaperList() {
324 try { 338 try {
325 - let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)  
326 - this.newspaperListBean = listBean; 339 + if (NetworkUtil.isNetConnected()) {
  340 + let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
  341 + this.newspaperListBean = listBean;
  342 + } else {
  343 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  344 + }
327 } catch (exception) { 345 } catch (exception) {
328 346
329 } 347 }
  1 +import { FeedbackTypeBean } from 'wdBean/Index';
  2 +import { NetworkUtil } from 'wdKit/Index';
  3 +import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
  4 +import { CustomTitleUI } from './reusable/CustomTitleUI'
  5 +import { ArrayList } from '@kit.ArkTS';
  6 +
  7 +const TAG = 'FeedBackActivity'
  8 +// 意见反馈页面
  9 +@Entry
  10 +@Component
  11 +export struct FeedBackActivity {
  12 + //UI
  13 + scroller: Scroller = new Scroller();
  14 +
  15 + @State isNetConnected: boolean = true
  16 +
  17 + @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[]
  18 +
  19 + async aboutToAppear() {
  20 + await this.getContentDetailData()
  21 + }
  22 +
  23 + build() {
  24 + Column() {
  25 + //标题栏目
  26 + CustomTitleUI({ titleName: "意见反馈" })
  27 + Stack({ alignContent: Alignment.Bottom }) {
  28 + Scroll(this.scroller) {
  29 + Column() {
  30 + Text('请选择问题类型')
  31 + .fontColor($r('app.color.color_222222'))
  32 + .fontSize($r('app.float.font_size_16'))
  33 + .fontWeight(FontWeight.Bold)
  34 + .margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') })
  35 + GridRow({
  36 + gutter: { x: 2, y: 2 }
  37 + }) {
  38 + ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
  39 + GridCol({
  40 + span: 12
  41 + }) {
  42 + Row(){
  43 + Toggle({ type: ToggleType.Checkbox, isOn: false })
  44 + Text(item.classifyName)
  45 + .fontColor($r('app.color.color_222222'))
  46 + .fontSize($r('app.float.font_size_14'))
  47 + .fontWeight(FontWeight.Bold)
  48 + .margin({ left: $r('app.float.vp_4') })
  49 + }
  50 + .width(115)
  51 + .height(22)
  52 + .backgroundColor($r('app.color.color_fff'))
  53 + }
  54 + })
  55 + }
  56 +
  57 + Blank()
  58 + .height(0.5)
  59 + .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
  60 + .backgroundColor($r('app.color.color_EDEDED'))
  61 + Text('描述您的问题')
  62 + .fontColor($r('app.color.color_222222'))
  63 + .fontSize($r('app.float.font_size_16'))
  64 + .fontWeight(FontWeight.Bold)
  65 + .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') })
  66 + Stack() {
  67 + TextInput({ placeholder: '您的宝贵意见是我们前行的动力' })
  68 + GridRow({
  69 + gutter: { x: 2, y: 2 }
  70 + }) {
  71 + ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
  72 + GridCol({
  73 + span: 12
  74 + }) {
  75 + }
  76 + })
  77 + }
  78 +
  79 + Text('0/500')
  80 + }
  81 + .height(200)
  82 + .width('100%')
  83 + .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
  84 + .backgroundColor($r('app.color.color_F5F5F5'))
  85 + .borderRadius(4)
  86 +
  87 + Text('期待您留下联系方式,我们将提供更好的服务')
  88 + .fontColor($r('app.color.color_222222'))
  89 + .fontSize($r('app.float.font_size_14'))
  90 + .fontWeight(FontWeight.Bold)
  91 + .margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') })
  92 + Row() {
  93 + Text('电话或者邮箱')
  94 + .fontColor($r('app.color.color_222222'))
  95 + .fontSize($r('app.float.font_size_14'))
  96 + .fontWeight(FontWeight.Bold)
  97 + .margin({ left: $r('app.float.vp_12') })
  98 + TextInput({ placeholder: '请输入电话或者邮箱' })
  99 + }
  100 + .height(44)
  101 + .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_12'), top: $r('app.float.margin_16') })
  102 + .backgroundColor($r('app.color.color_F5F5F5'))
  103 + .borderRadius(4)
  104 + }
  105 + }
  106 +
  107 + Text($r('app.string.submit'))
  108 + .height(44)
  109 + .fontColor($r('app.color.color_9E9E9E_40'))
  110 + .fontSize($r('app.float.font_size_18'))
  111 + .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_16'), top: $r('app.float.vp_15') })
  112 + .backgroundColor($r('app.color.color_ED2800_99'))
  113 + .borderRadius(4)
  114 + }
  115 + }
  116 + }
  117 + /**
  118 + * 请求接口数据
  119 + * */
  120 + private async getContentDetailData() {
  121 + this.isNetConnected = NetworkUtil.isNetConnected()
  122 + try {
  123 + this.feedbackTypeBeans = await MultiPictureDetailViewModel.getFeedbackTypeList()
  124 +
  125 + } catch (exception) {
  126 + console.log('请求失败',JSON.stringify(exception))
  127 + }
  128 + }
  129 +}
@@ -40,7 +40,7 @@ const TAG: string = 'ImageAndTextPageComponent' @@ -40,7 +40,7 @@ const TAG: string = 'ImageAndTextPageComponent'
40 export struct ImageAndTextPageComponent { 40 export struct ImageAndTextPageComponent {
41 scroller: Scroller = new Scroller(); 41 scroller: Scroller = new Scroller();
42 action: Action = {} as Action 42 action: Action = {} as Action
43 - @State contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO [] 43 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
44 @State recommendList: ContentDTO[] = [] 44 @State recommendList: ContentDTO[] = []
45 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 45 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
46 @State interactData: InteractDataDTO = {} as InteractDataDTO 46 @State interactData: InteractDataDTO = {} as InteractDataDTO
@@ -52,11 +52,12 @@ export struct ImageAndTextPageComponent { @@ -52,11 +52,12 @@ export struct ImageAndTextPageComponent {
52 @State isNetConnected: boolean = true 52 @State isNetConnected: boolean = true
53 @State info: Area | null = null 53 @State info: Area | null = null
54 @State likeNum: number = 0 54 @State likeNum: number = 0
  55 +
55 build() { 56 build() {
56 Column() { 57 Column() {
57 // 发布时间 58 // 发布时间
58 Row() { 59 Row() {
59 - Image(this.contentDetailData[0]?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) 60 + Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
60 .width(80) 61 .width(80)
61 .height(28) 62 .height(28)
62 Text(this.publishTime) 63 Text(this.publishTime)
@@ -83,26 +84,26 @@ export struct ImageAndTextPageComponent { @@ -83,26 +84,26 @@ export struct ImageAndTextPageComponent {
83 Scroll(this.scroller) { 84 Scroll(this.scroller) {
84 Column() { 85 Column() {
85 ImageAndTextWebComponent({ 86 ImageAndTextWebComponent({
86 - contentDetailData: this.contentDetailData, 87 + contentDetailData: [this.contentDetailData],
87 action: this.action, 88 action: this.action,
88 isPageEnd: $isPageEnd 89 isPageEnd: $isPageEnd
89 }) 90 })
90 - .padding({bottom:10}) 91 + .padding({ bottom: 10 })
91 Column() { 92 Column() {
92 // 点赞 93 // 点赞
93 - if (this.contentDetailData[0]?.openLikes && this.contentDetailData[0]?.likesStyle !== 4) { 94 + if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
94 Row() { 95 Row() {
95 Row() { 96 Row() {
96 if (this.newsStatusOfUser?.likeStatus === '1') { 97 if (this.newsStatusOfUser?.likeStatus === '1') {
97 - Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') :  
98 - (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : 98 + Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') :
  99 + (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') :
99 $r('app.media.icon_candle_active'))) 100 $r('app.media.icon_candle_active')))
100 .width(24) 101 .width(24)
101 .height(24) 102 .height(24)
102 .margin({ right: 5 }) 103 .margin({ right: 5 })
103 } else { 104 } else {
104 - Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') :  
105 - (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : 105 + Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.icon_like') :
  106 + (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer') :
106 $r('app.media.icon_candle'))) 107 $r('app.media.icon_candle')))
107 .width(24) 108 .width(24)
108 .height(24) 109 .height(24)
@@ -129,7 +130,7 @@ export struct ImageAndTextPageComponent { @@ -129,7 +130,7 @@ export struct ImageAndTextPageComponent {
129 }) 130 })
130 131
131 }.width(CommonConstants.FULL_WIDTH) 132 }.width(CommonConstants.FULL_WIDTH)
132 - .padding({top:14,bottom:24}) 133 + .padding({ top: 14, bottom: 24 })
133 .justifyContent(FlexAlign.Center) 134 .justifyContent(FlexAlign.Center)
134 } 135 }
135 if (this.recommendList.length > 0) { 136 if (this.recommendList.length > 0) {
@@ -137,7 +138,7 @@ export struct ImageAndTextPageComponent { @@ -137,7 +138,7 @@ export struct ImageAndTextPageComponent {
137 RecommendList({ recommendList: this.recommendList }) 138 RecommendList({ recommendList: this.recommendList })
138 } 139 }
139 // 评论 140 // 评论
140 - if (this.contentDetailData[0]?.openComment) { 141 + if (this.contentDetailData?.openComment) {
141 Divider().strokeWidth(6).color('#f5f5f5') 142 Divider().strokeWidth(6).color('#f5f5f5')
142 CommentComponent({ 143 CommentComponent({
143 publishCommentModel: this.publishCommentModel 144 publishCommentModel: this.publishCommentModel
@@ -173,7 +174,7 @@ export struct ImageAndTextPageComponent { @@ -173,7 +174,7 @@ export struct ImageAndTextPageComponent {
173 //底部交互区 174 //底部交互区
174 if (this.operationButtonList.length) { 175 if (this.operationButtonList.length) {
175 OperRowListView({ 176 OperRowListView({
176 - contentDetailData: this.contentDetailData[0], 177 + contentDetailData: this.contentDetailData,
177 publishCommentModel: this.publishCommentModel, 178 publishCommentModel: this.publishCommentModel,
178 operationButtonList: this.operationButtonList, 179 operationButtonList: this.operationButtonList,
179 styleType: 1, 180 styleType: 1,
@@ -207,29 +208,29 @@ export struct ImageAndTextPageComponent { @@ -207,29 +208,29 @@ export struct ImageAndTextPageComponent {
207 } 208 }
208 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) 209 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
209 if (detailBeans && detailBeans.length > 0) { 210 if (detailBeans && detailBeans.length > 0) {
210 - this.contentDetailData = detailBeans; 211 + this.contentDetailData = detailBeans[0];
211 let dateTime = 212 let dateTime =
212 - DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); 213 + DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
213 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) 214 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
214 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) 215 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
215 - if (this.contentDetailData[0]?.recommendShow === 1) { 216 + if (this.contentDetailData?.recommendShow === 1) {
216 this.getRecommend() 217 this.getRecommend()
217 } 218 }
218 - if (this.contentDetailData[0]?.openLikes === 1) { 219 + if (this.contentDetailData?.openLikes === 1) {
219 this.getInteractDataStatus() 220 this.getInteractDataStatus()
220 this.queryContentInteractCount() 221 this.queryContentInteractCount()
221 } 222 }
222 - if (this.contentDetailData[0]?.openComment) {  
223 - this.publishCommentModel.targetId = String(this.contentDetailData[0]?.newsId || '')  
224 - this.publishCommentModel.targetRelId = String(this.contentDetailData[0]?.reLInfo?.relId)  
225 - this.publishCommentModel.targetTitle = this.contentDetailData[0]?.newsTitle  
226 - this.publishCommentModel.targetRelType = String(this.contentDetailData[0]?.reLInfo?.relType)  
227 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData[0]?.reLInfo?.relObjectId)  
228 - this.publishCommentModel.keyArticle = String(this.contentDetailData[0]?.keyArticle)  
229 - this.publishCommentModel.targetType = String(this.contentDetailData[0]?.newsType) 223 + if (this.contentDetailData?.openComment) {
  224 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  225 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
  226 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  227 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
  228 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
  229 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
  230 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
230 } 231 }
231 - if (this.contentDetailData[0]?.openAudio && this.contentDetailData[0]?.audioList?.length &&  
232 - this.contentDetailData[0]?.audioList[0].audioUrl) { 232 + if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
  233 + this.contentDetailData?.audioList[0].audioUrl) {
233 this.operationButtonList = ['comment', 'collect', 'listen', 'share'] 234 this.operationButtonList = ['comment', 'collect', 'listen', 'share']
234 } else { 235 } else {
235 this.operationButtonList = ['comment', 'collect', 'share'] 236 this.operationButtonList = ['comment', 'collect', 'share']
@@ -242,11 +243,11 @@ export struct ImageAndTextPageComponent { @@ -242,11 +243,11 @@ export struct ImageAndTextPageComponent {
242 let params: postRecommendListParams = { 243 let params: postRecommendListParams = {
243 imei: HttpUtils.getImei(), 244 imei: HttpUtils.getImei(),
244 userId: HttpUtils.getUserId(), 245 userId: HttpUtils.getUserId(),
245 - contentId: String(this.contentDetailData[0]?.newsId),  
246 - recType: Number(this.contentDetailData[0]?.reLInfo?.relType),  
247 - contentType: this.contentDetailData[0]?.newsType,  
248 - relId: this.contentDetailData[0]?.reLInfo?.relId,  
249 - channelId: String(this.contentDetailData[0]?.reLInfo?.channelId) 246 + contentId: String(this.contentDetailData?.newsId),
  247 + recType: Number(this.contentDetailData?.reLInfo?.relType),
  248 + contentType: this.contentDetailData?.newsType,
  249 + relId: this.contentDetailData?.reLInfo?.relId,
  250 + channelId: String(this.contentDetailData?.reLInfo?.channelId)
250 } 251 }
251 let recommendList = await DetailViewModel.postRecommendList(params) 252 let recommendList = await DetailViewModel.postRecommendList(params)
252 this.recommendList = recommendList; 253 this.recommendList = recommendList;
@@ -258,8 +259,8 @@ export struct ImageAndTextPageComponent { @@ -258,8 +259,8 @@ export struct ImageAndTextPageComponent {
258 const params: batchLikeAndCollectParams = { 259 const params: batchLikeAndCollectParams = {
259 contentList: [ 260 contentList: [
260 { 261 {
261 - contentId: this.contentDetailData[0]?.newsId + '',  
262 - contentType: this.contentDetailData[0]?.newsType + '', 262 + contentId: this.contentDetailData?.newsId + '',
  263 + contentType: this.contentDetailData?.newsType + '',
263 } 264 }
264 ] 265 ]
265 } 266 }
@@ -284,8 +285,8 @@ export struct ImageAndTextPageComponent { @@ -284,8 +285,8 @@ export struct ImageAndTextPageComponent {
284 } 285 }
285 const params: postExecuteLikeParams = { 286 const params: postExecuteLikeParams = {
286 status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', 287 status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
287 - contentId: this.contentDetailData[0]?.newsId + '',  
288 - contentType: this.contentDetailData[0]?.newsType + '', 288 + contentId: this.contentDetailData?.newsId + '',
  289 + contentType: this.contentDetailData?.newsType + '',
289 } 290 }
290 PageRepository.postExecuteLike(params).then(res => { 291 PageRepository.postExecuteLike(params).then(res => {
291 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) 292 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
@@ -304,8 +305,8 @@ export struct ImageAndTextPageComponent { @@ -304,8 +305,8 @@ export struct ImageAndTextPageComponent {
304 console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) 305 console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
305 const params: contentListParams = { 306 const params: contentListParams = {
306 contentList: [{ 307 contentList: [{
307 - contentId: this.contentDetailData[0]?.newsId + '',  
308 - contentType: this.contentDetailData[0]?.newsType, 308 + contentId: this.contentDetailData?.newsId + '',
  309 + contentType: this.contentDetailData?.newsType,
309 }] 310 }]
310 } 311 }
311 PageRepository.getContentInteract(params).then(res => { 312 PageRepository.getContentInteract(params).then(res => {
@@ -114,7 +114,7 @@ export struct SingleColumn999Component { @@ -114,7 +114,7 @@ export struct SingleColumn999Component {
114 build() { 114 build() {
115 // if (this.compDTO && this.compDTO?.operDataList?.length > 0) { 115 // if (this.compDTO && this.compDTO?.operDataList?.length > 0) {
116 if (this.compListItem && this.compListItem?.operDataList?.length > 0) { 116 if (this.compListItem && this.compListItem?.operDataList?.length > 0) {
117 - List({ space: 2, initialIndex: 0 }) { 117 + List({ initialIndex: 0 }) {
118 // ListItemGroup({ 118 // ListItemGroup({
119 // // footer: this.itemFooter("") 119 // // footer: this.itemFooter("")
120 // }) { 120 // }) {
1 -import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils} from 'wdKit'; 1 +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
3 import { 3 import {
4 ContentDetailDTO, 4 ContentDetailDTO,
@@ -35,7 +35,7 @@ export struct MultiPictureDetailPageComponent { @@ -35,7 +35,7 @@ export struct MultiPictureDetailPageComponent {
35 private picWidth: number = 0 35 private picWidth: number = 0
36 @State picHeight: number = 0 36 @State picHeight: number = 0
37 @State titleHeight: number = 0 37 @State titleHeight: number = 0
38 - @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 38 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
39 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 39 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
40 private swiperController: SwiperController = new SwiperController() 40 private swiperController: SwiperController = new SwiperController()
41 private swiperControllerItem: SwiperController = new SwiperController() 41 private swiperControllerItem: SwiperController = new SwiperController()
@@ -49,8 +49,8 @@ export struct MultiPictureDetailPageComponent { @@ -49,8 +49,8 @@ export struct MultiPictureDetailPageComponent {
49 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; 49 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
50 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number; 50 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number;
51 @State windowHeight: number = AppStorage.get<number>('windowHeight') as number; 51 @State windowHeight: number = AppStorage.get<number>('windowHeight') as number;
52 - @State currentOffset:number = 0  
53 - @State duration:number = 0 52 + @State currentOffset: number = 0
  53 + @State duration: number = 0
54 54
55 //watch监听页码回调 55 //watch监听页码回调
56 onCurrentPageNumUpdated(): void { 56 onCurrentPageNumUpdated(): void {
@@ -83,7 +83,6 @@ export struct MultiPictureDetailPageComponent { @@ -83,7 +83,6 @@ export struct MultiPictureDetailPageComponent {
83 } 83 }
84 } 84 }
85 85
86 -  
87 aboutToDisappear() { 86 aboutToDisappear() {
88 87
89 } 88 }
@@ -101,10 +100,10 @@ export struct MultiPictureDetailPageComponent { @@ -101,10 +100,10 @@ export struct MultiPictureDetailPageComponent {
101 @Builder 100 @Builder
102 init() { 101 init() {
103 if (this.contentDetailData.rmhPlatform == 1) { 102 if (this.contentDetailData.rmhPlatform == 1) {
104 - if(!this.showDownload) { 103 + if (!this.showDownload) {
105 Row() { 104 Row() {
106 Row({ space: 8 }) { 105 Row({ space: 8 }) {
107 - if (this.getImgUrl()){ 106 + if (this.getImgUrl()) {
108 Row() { 107 Row() {
109 Stack() { 108 Stack() {
110 Image(this.getImgUrl()) 109 Image(this.getImgUrl())
@@ -115,7 +114,7 @@ export struct MultiPictureDetailPageComponent { @@ -115,7 +114,7 @@ export struct MultiPictureDetailPageComponent {
115 .height(36) 114 .height(36)
116 .objectFit(ImageFit.Fill) 115 .objectFit(ImageFit.Fill)
117 .interpolation(ImageInterpolation.High) 116 .interpolation(ImageInterpolation.High)
118 - if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ 117 + if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
119 Stack() { 118 Stack() {
120 Image(this.contentDetailData.rmhInfo?.authIcon) 119 Image(this.contentDetailData.rmhInfo?.authIcon)
121 .width($r('app.float.vp_13')) 120 .width($r('app.float.vp_13'))
@@ -219,7 +218,7 @@ export struct MultiPictureDetailPageComponent { @@ -219,7 +218,7 @@ export struct MultiPictureDetailPageComponent {
219 .width('100%') 218 .width('100%')
220 .height(44) 219 .height(44)
221 .zIndex(10) 220 .zIndex(10)
222 - .margin({top:`${this.topSafeHeight + 12}px`}) 221 + .margin({ top: `${this.topSafeHeight + 12}px` })
223 .alignRules({ 222 .alignRules({
224 top: { anchor: "__container__", align: VerticalAlign.Top }, 223 top: { anchor: "__container__", align: VerticalAlign.Top },
225 middle: { anchor: "__container__", align: HorizontalAlign.Center } 224 middle: { anchor: "__container__", align: HorizontalAlign.Center }
@@ -249,15 +248,15 @@ export struct MultiPictureDetailPageComponent { @@ -249,15 +248,15 @@ export struct MultiPictureDetailPageComponent {
249 this.currentOffset = Math.abs(extraInfo.currentOffset) 248 this.currentOffset = Math.abs(extraInfo.currentOffset)
250 }) 249 })
251 .onTouch((event: TouchEvent) => { 250 .onTouch((event: TouchEvent) => {
252 - if(this.duration === 0) {  
253 - this.duration = 500  
254 - }  
255 - if(event.type === 1) {  
256 - // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {  
257 - if(this.currentOffset > 160) {  
258 - router.back()  
259 - } 251 + if (this.duration === 0) {
  252 + this.duration = 500
  253 + }
  254 + if (event.type === 1) {
  255 + // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
  256 + if (this.currentOffset > 160) {
  257 + router.back()
260 } 258 }
  259 + }
261 }) 260 })
262 }) 261 })
263 } 262 }
@@ -296,9 +295,9 @@ export struct MultiPictureDetailPageComponent { @@ -296,9 +295,9 @@ export struct MultiPictureDetailPageComponent {
296 middle: { anchor: "__container__", align: HorizontalAlign.Center } 295 middle: { anchor: "__container__", align: HorizontalAlign.Center }
297 }) 296 })
298 } 297 }
299 - Column(){  
300 - if(!this.showDownload) {  
301 - Column(){ 298 + Column() {
  299 + if (!this.showDownload) {
  300 + Column() {
302 Row() { 301 Row() {
303 Scroll(this.scroller) { 302 Scroll(this.scroller) {
304 Row() { 303 Row() {
@@ -306,7 +305,7 @@ export struct MultiPictureDetailPageComponent { @@ -306,7 +305,7 @@ export struct MultiPictureDetailPageComponent {
306 direction: FlexDirection.Column, 305 direction: FlexDirection.Column,
307 justifyContent: FlexAlign.Start 306 justifyContent: FlexAlign.Start
308 }) { 307 }) {
309 - if(this.contentDetailData?.photoList?.length) { 308 + if (this.contentDetailData?.photoList?.length) {
310 Text() { 309 Text() {
311 Span(`${this.swiperIndex + 1}`) 310 Span(`${this.swiperIndex + 1}`)
312 .fontSize(24) 311 .fontSize(24)
@@ -322,7 +321,7 @@ export struct MultiPictureDetailPageComponent { @@ -322,7 +321,7 @@ export struct MultiPictureDetailPageComponent {
322 .fontColor(Color.White) 321 .fontColor(Color.White)
323 .margin(4) 322 .margin(4)
324 } 323 }
325 - if(this.contentDetailData.newsTitle) { 324 + if (this.contentDetailData.newsTitle) {
326 Text(`${this.contentDetailData.newsTitle}`) 325 Text(`${this.contentDetailData.newsTitle}`)
327 .fontColor(Color.White) 326 .fontColor(Color.White)
328 .fontSize(16) 327 .fontSize(16)
@@ -336,7 +335,7 @@ export struct MultiPictureDetailPageComponent { @@ -336,7 +335,7 @@ export struct MultiPictureDetailPageComponent {
336 right: 0 335 right: 0
337 }) 336 })
338 } 337 }
339 - if(this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { 338 + if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
340 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) 339 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
341 .fontColor(Color.White) 340 .fontColor(Color.White)
342 .fontSize(14) 341 .fontSize(14)
@@ -361,6 +360,7 @@ export struct MultiPictureDetailPageComponent { @@ -361,6 +360,7 @@ export struct MultiPictureDetailPageComponent {
361 .height(px2vp(this.titleHeight)) 360 .height(px2vp(this.titleHeight))
362 .align(Alignment.Bottom) 361 .align(Alignment.Bottom)
363 } 362 }
  363 +
364 OperRowListView({ 364 OperRowListView({
365 contentDetailData: this.contentDetailData, 365 contentDetailData: this.contentDetailData,
366 publishCommentModel: this.publishCommentModel, 366 publishCommentModel: this.publishCommentModel,
@@ -372,14 +372,14 @@ export struct MultiPictureDetailPageComponent { @@ -372,14 +372,14 @@ export struct MultiPictureDetailPageComponent {
372 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) 372 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
373 )) 373 ))
374 } 374 }
375 - if(this.showDownload) {  
376 - Column(){ 375 + if (this.showDownload) {
  376 + Column() {
377 Row() { 377 Row() {
378 Flex({ 378 Flex({
379 direction: FlexDirection.Row, 379 direction: FlexDirection.Row,
380 justifyContent: FlexAlign.SpaceBetween 380 justifyContent: FlexAlign.SpaceBetween
381 }) { 381 }) {
382 - if(this.contentDetailData?.photoList?.length) { 382 + if (this.contentDetailData?.photoList?.length) {
383 Text() { 383 Text() {
384 Span(`${this.swiperIndex + 1}`) 384 Span(`${this.swiperIndex + 1}`)
385 .fontSize(24) 385 .fontSize(24)
@@ -396,7 +396,7 @@ export struct MultiPictureDetailPageComponent { @@ -396,7 +396,7 @@ export struct MultiPictureDetailPageComponent {
396 .margin(4) 396 .margin(4)
397 } 397 }
398 398
399 - if(this.contentDetailData.photoList?.[this.swiperIndex].picPath) { 399 + if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
400 ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) 400 ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
401 .margin({ 401 .margin({
402 top: 8, 402 top: 8,
@@ -18,7 +18,7 @@ export struct SpacialTopicPageComponent { @@ -18,7 +18,7 @@ export struct SpacialTopicPageComponent {
18 action: Action = {} as Action 18 action: Action = {} as Action
19 @State webUrl: string = ''; 19 @State webUrl: string = '';
20 @State isPageEnd: boolean = false 20 @State isPageEnd: boolean = false
21 - @State contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO [] 21 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
22 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean 22 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
23 private webPrepared = false; 23 private webPrepared = false;
24 private dataPrepared = false; 24 private dataPrepared = false;
@@ -63,15 +63,15 @@ export struct SpacialTopicPageComponent { @@ -63,15 +63,15 @@ export struct SpacialTopicPageComponent {
63 } 63 }
64 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) 64 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
65 if (detailBeans && detailBeans.length > 0) { 65 if (detailBeans && detailBeans.length > 0) {
66 - this.contentDetailData = detailBeans; 66 + this.contentDetailData = detailBeans[0];
67 // if (this.contentDetailData[0]?.openComment) { 67 // if (this.contentDetailData[0]?.openComment) {
68 - this.publishCommentModel.targetId = String(this.contentDetailData[0]?.newsId || '')  
69 - this.publishCommentModel.targetRelId = String(this.contentDetailData[0]?.reLInfo?.relId)  
70 - this.publishCommentModel.targetTitle = this.contentDetailData[0]?.newsTitle  
71 - this.publishCommentModel.targetRelType = String(this.contentDetailData[0]?.reLInfo?.relType)  
72 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData[0]?.reLInfo?.relObjectId)  
73 - this.publishCommentModel.keyArticle = String(this.contentDetailData[0]?.keyArticle)  
74 - this.publishCommentModel.targetType = String(this.contentDetailData[0]?.newsType) 68 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  69 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
  70 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  71 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
  72 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
  73 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
  74 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
75 // } 75 // }
76 this.trySendData2H5() 76 this.trySendData2H5()
77 } 77 }
@@ -92,17 +92,17 @@ export struct SpacialTopicPageComponent { @@ -92,17 +92,17 @@ export struct SpacialTopicPageComponent {
92 } 92 }
93 .width(CommonConstants.FULL_WIDTH) 93 .width(CommonConstants.FULL_WIDTH)
94 .height(CommonConstants.FULL_HEIGHT) 94 .height(CommonConstants.FULL_HEIGHT)
95 - .padding({bottom:75}) 95 + .padding({ bottom: 75 })
96 96
97 if (!this.isPageEnd) { 97 if (!this.isPageEnd) {
98 detailedSkeleton() 98 detailedSkeleton()
99 } 99 }
100 //底部交互区 100 //底部交互区
101 - OperRowListView({  
102 - contentDetailData: this.contentDetailData[0],  
103 - publishCommentModel: this.publishCommentModel,  
104 - operationButtonList: this.operationButtonList,  
105 - }) 101 + OperRowListView({
  102 + contentDetailData: this.contentDetailData,
  103 + publishCommentModel: this.publishCommentModel,
  104 + operationButtonList: this.operationButtonList,
  105 + })
106 } 106 }
107 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 107 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
108 } 108 }
1 import { RMCalendarBean } from './RMCalendarBean' 1 import { RMCalendarBean } from './RMCalendarBean'
2 import { RMCalenderCell } from './RMCalendarCell' 2 import { RMCalenderCell } from './RMCalendarCell'
  3 +import { ToastUtils, NetworkUtil } from 'wdKit/Index';
3 4
4 @Component 5 @Component
5 export struct RMCalendar { 6 export struct RMCalendar {
@@ -166,6 +167,9 @@ export struct RMCalendar { @@ -166,6 +167,9 @@ export struct RMCalendar {
166 * 下一个月 167 * 下一个月
167 */ 168 */
168 private nextMonth() { 169 private nextMonth() {
  170 + if (!NetworkUtil.isNetConnected()) {
  171 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  172 + }
169 // this.dates.slice(0, this.dates.length) 173 // this.dates.slice(0, this.dates.length)
170 this.dates = [] 174 this.dates = []
171 const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()) 175 const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth())
@@ -180,6 +184,9 @@ export struct RMCalendar { @@ -180,6 +184,9 @@ export struct RMCalendar {
180 * 上一个月 184 * 上一个月
181 */ 185 */
182 private preMonth() { 186 private preMonth() {
  187 + if (!NetworkUtil.isNetConnected()) {
  188 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  189 + }
183 // this.dates.slice(0, this.dates.length) 190 // this.dates.slice(0, this.dates.length)
184 this.dates = [] 191 this.dates = []
185 const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()) 192 const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth())
1 /** 1 /**
2 * 这里是人民号动态中的顶部信息:人民号logo,名字,描述,关注等 2 * 这里是人民号动态中的顶部信息:人民号logo,名字,描述,关注等
3 */ 3 */
  4 +import {
  5 + ContentDetailRequest,
  6 + postInteractAccentionOperateParams
  7 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
4 import { RmhInfoDTO } from 'wdBean' 8 import { RmhInfoDTO } from 'wdBean'
5 import { CommonConstants } from 'wdConstant/Index'; 9 import { CommonConstants } from 'wdConstant/Index';
6 -import { DateTimeUtils, SPHelper } from 'wdKit'; 10 +import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit';
7 import { SpConstants } from 'wdConstant/Index' 11 import { SpConstants } from 'wdConstant/Index'
8 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 12 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
9 import router from '@ohos.router' 13 import router from '@ohos.router'
  14 +import { postBatchAttentionStatusParams } from 'wdBean/Index';
  15 +import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
10 16
11 @Component 17 @Component
12 export struct RmhTitle { 18 export struct RmhTitle {
13 @Prop rmhInfo: RmhInfoDTO 19 @Prop rmhInfo: RmhInfoDTO
14 @Prop publishTime: string | undefined 20 @Prop publishTime: string | undefined
  21 + /**
  22 + * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏
  23 + */
15 @Prop hideTime: boolean 24 @Prop hideTime: boolean
  25 + /**
  26 + * 默认未关注 点击去关注
  27 + */
  28 + @State followStatus: string = '0';
16 29
17 - async appointReq() { 30 + /**
  31 + * 关注号主
  32 + */
  33 + async handleAccention() {
18 // 未登录,跳转登录 34 // 未登录,跳转登录
19 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') 35 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
20 if (!user_id) { 36 if (!user_id) {
21 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 37 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
22 return 38 return
23 } 39 }
  40 +
  41 + const params2: postInteractAccentionOperateParams = {
  42 + attentionUserType: this.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  43 + attentionUserId: this.rmhInfo?.userId || '', // 被关注用户号主id
  44 + attentionCreatorId: this.rmhInfo?.rmhId || '', // 被关注用户号主id
  45 + status: this.followStatus == '0' ? 1 : 0,
  46 + }
  47 + ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
  48 + console.log('rmhTitle-data', JSON.stringify(res.data))
  49 + if (this.followStatus == '1') {
  50 + this.followStatus = '0'
  51 + } else {
  52 + this.followStatus = '1'
  53 + // 弹窗样式与何时调用待确认
  54 + ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => {
  55 + console.log('关注号主获取积分==', JSON.stringify(res.data))
  56 + if (res.data?.showToast) {
  57 + ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000);
  58 + }
  59 + })
  60 + }
  61 + })
  62 + }
  63 + /**
  64 + * 查询当前登录用户是否关注作品号主
  65 + * */
  66 + async getBatchAttentionStatus() {
  67 + try {
  68 + const params: postBatchAttentionStatusParams = {
  69 + creatorIds: [{ creatorId: this.rmhInfo?.rmhId ?? '' }]
  70 + }
  71 + let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
  72 + this.followStatus = data[0]?.status;
  73 + Logger.info(`rmhTitle-followStatus:${JSON.stringify(this.followStatus)}`)
  74 + } catch (exception) {
  75 + Logger.info(`rmhTitle-followStatus:${JSON.stringify(exception)}`)
  76 + }
24 } 77 }
25 78
26 aboutToAppear(): void { 79 aboutToAppear(): void {
  80 + this.getBatchAttentionStatus()
  81 +
27 let page = router.getState(); 82 let page = router.getState();
28 if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { 83 if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) {
29 this.hideTime = true; 84 this.hideTime = true;
@@ -88,17 +143,20 @@ export struct RmhTitle { @@ -88,17 +143,20 @@ export struct RmhTitle {
88 Blank() 143 Blank()
89 if (this.rmhInfo.cnIsAttention) { 144 if (this.rmhInfo.cnIsAttention) {
90 Row() { 145 Row() {
91 - Image($r('app.media.rmh_follow'))  
92 - .width(16)  
93 - .height(16)  
94 - Text('关注') 146 + if (Number(this.followStatus) === 0) {
  147 + Image($r('app.media.rmh_follow'))
  148 + .width(16)
  149 + .height(16)
  150 + }
  151 +
  152 + Text(Number(this.followStatus) === 0 ? '关注' : '已关注')
95 .fontSize($r('app.float.font_size_13')) 153 .fontSize($r('app.float.font_size_13'))
96 .fontColor($r('app.color.color_ED2800')) 154 .fontColor($r('app.color.color_ED2800'))
97 } 155 }
98 .flexShrink(0) 156 .flexShrink(0)
99 .alignSelf(ItemAlign.Center) 157 .alignSelf(ItemAlign.Center)
100 .onClick(() => { 158 .onClick(() => {
101 - this.appointReq(); 159 + this.handleAccention();
102 }) 160 })
103 } 161 }
104 } 162 }
1 import { CompDTO } from 'wdBean/Index'; 1 import { CompDTO } from 'wdBean/Index';
2 -import { Logger } from 'wdKit/Index'; 2 +import { DateTimeUtils, Logger } from 'wdKit/Index';
3 import PageModel from '../../viewmodel/PageModel'; 3 import PageModel from '../../viewmodel/PageModel';
4 4
5 /** 5 /**
@@ -59,9 +59,9 @@ export struct CardAdvBottom { @@ -59,9 +59,9 @@ export struct CardAdvBottom {
59 break; 59 break;
60 } 60 }
61 } 61 }
62 - Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex);  
63 if (currentIndex >= 0) { 62 if (currentIndex >= 0) {
64 this.pageModel.compList.deleteItem(currentIndex) 63 this.pageModel.compList.deleteItem(currentIndex)
  64 + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
65 } 65 }
66 } 66 }
67 } 67 }
1 import { CompDTO } from 'wdBean/Index'; 1 import { CompDTO } from 'wdBean/Index';
2 -import { Logger } from 'wdKit/Index'; 2 +import { DateTimeUtils, Logger } from 'wdKit/Index';
3 import PageModel from '../../viewmodel/PageModel'; 3 import PageModel from '../../viewmodel/PageModel';
4 4
5 /** 5 /**
@@ -71,10 +71,9 @@ export struct CardAdvTop { @@ -71,10 +71,9 @@ export struct CardAdvTop {
71 break; 71 break;
72 } 72 }
73 } 73 }
74 -  
75 - Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex);  
76 if (currentIndex >= 0) { 74 if (currentIndex >= 0) {
77 this.pageModel.compList.deleteItem(currentIndex) 75 this.pageModel.compList.deleteItem(currentIndex)
  76 + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
78 } 77 }
79 } 78 }
80 } 79 }
@@ -48,8 +48,9 @@ export struct Card10Component { @@ -48,8 +48,9 @@ export struct Card10Component {
48 .onClick((event: ClickEvent) => { 48 .onClick((event: ClickEvent) => {
49 ProcessUtils.processPage(this.contentDTO) 49 ProcessUtils.processPage(this.contentDTO)
50 }) 50 })
51 -  
52 - Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 }) 51 + if (this.contentDTO.objectType == '5') {
  52 + Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
  53 + }
53 }.alignContent(Alignment.BottomStart) 54 }.alignContent(Alignment.BottomStart)
54 55
55 // 专题列表--后端返回三个, 56 // 专题列表--后端返回三个,
@@ -106,7 +107,7 @@ export struct Card10Component { @@ -106,7 +107,7 @@ export struct Card10Component {
106 .fontColor($r('app.color.color_222222')) 107 .fontColor($r('app.color.color_222222'))
107 .maxLines(2) 108 .maxLines(2)
108 .textOverflow({ overflow: TextOverflow.Ellipsis }) 109 .textOverflow({ overflow: TextOverflow.Ellipsis })
109 - .textIndent(item.objectType == '5' ? 40 : 0) 110 + .textIndent(item.objectType == '5' ? 38 : 0)
110 }.alignContent(Alignment.TopStart) 111 }.alignContent(Alignment.TopStart)
111 112
112 CardSourceInfo( 113 CardSourceInfo(
@@ -102,6 +102,9 @@ struct createImg { @@ -102,6 +102,9 @@ struct createImg {
102 CardMediaInfo({ contentDTO: this.contentDTO }) 102 CardMediaInfo({ contentDTO: this.contentDTO })
103 } 103 }
104 .align(Alignment.BottomEnd) 104 .align(Alignment.BottomEnd)
  105 + .onClick((event: ClickEvent) => {
  106 + ProcessUtils.gotoVod(this.contentDTO)
  107 + })
105 } 108 }
106 } 109 }
107 } 110 }
@@ -40,7 +40,7 @@ export struct Card2Component { @@ -40,7 +40,7 @@ export struct Card2Component {
40 .maxLines(2) 40 .maxLines(2)
41 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 41 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
42 .align(Alignment.Start) 42 .align(Alignment.Start)
43 - .textIndent(this.contentDTO.objectType == '5' ? 40 : 0) 43 + .textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
44 } 44 }
45 .alignContent(Alignment.TopStart) 45 .alignContent(Alignment.TopStart)
46 46
@@ -12,7 +12,7 @@ const TAG: string = 'Card5Component'; @@ -12,7 +12,7 @@ const TAG: string = 'Card5Component';
12 @Component 12 @Component
13 export struct Card5Component { 13 export struct Card5Component {
14 @State contentDTO: ContentDTO = new ContentDTO(); 14 @State contentDTO: ContentDTO = new ContentDTO();
15 - @State titleShowPolicy: number | string = 1 15 + @Prop titleShowPolicy: number | string
16 @State loadImg: boolean = false; 16 @State loadImg: boolean = false;
17 @State clicked: boolean = false; 17 @State clicked: boolean = false;
18 18
@@ -22,12 +22,13 @@ export struct Card5Component { @@ -22,12 +22,13 @@ export struct Card5Component {
22 22
23 build() { 23 build() {
24 Stack() { 24 Stack() {
  25 +
25 Image(this.loadImg ? this.contentDTO.coverUrl : '') 26 Image(this.loadImg ? this.contentDTO.coverUrl : '')
26 .backgroundColor(0xf5f5f5) 27 .backgroundColor(0xf5f5f5)
27 .width(CommonConstants.FULL_WIDTH) 28 .width(CommonConstants.FULL_WIDTH)
28 .autoResize(true) 29 .autoResize(true)
29 .borderRadius($r('app.float.image_border_radius')) 30 .borderRadius($r('app.float.image_border_radius'))
30 - // if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) { 31 + if (this.titleShowPolicy === 1) {
31 Row() 32 Row()
32 .width(CommonConstants.FULL_WIDTH) 33 .width(CommonConstants.FULL_WIDTH)
33 .height(59) 34 .height(59)
@@ -41,20 +42,21 @@ export struct Card5Component { @@ -41,20 +42,21 @@ export struct Card5Component {
41 if (this.contentDTO.objectType == '5') { 42 if (this.contentDTO.objectType == '5') {
42 Notes({ objectType: this.contentDTO.objectType }) 43 Notes({ objectType: this.contentDTO.objectType })
43 } 44 }
  45 +
44 Text(this.contentDTO.newsTitle) 46 Text(this.contentDTO.newsTitle)
45 - .width(CommonConstants.FULL_WIDTH)// .height(CommonConstants.FULL_HEIGHT) 47 + .width(CommonConstants.FULL_WIDTH)
46 .fontColor(Color.White) 48 .fontColor(Color.White)
47 .fontSize($r('app.float.normal_text_size')) 49 .fontSize($r('app.float.normal_text_size'))
48 .fontWeight(FontWeight.Bold) 50 .fontWeight(FontWeight.Bold)
49 .maxLines(2) 51 .maxLines(2)
50 .align(Alignment.TopStart) 52 .align(Alignment.TopStart)
51 - .textIndent(this.contentDTO.objectType == '5' ? 40 : 0) 53 + .textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
52 }.alignContent(Alignment.TopStart) 54 }.alignContent(Alignment.TopStart)
53 } 55 }
54 .justifyContent(FlexAlign.Start) 56 .justifyContent(FlexAlign.Start)
55 - // .height(40)  
56 .margin({ left: 12, bottom: 10, right: 12 }) 57 .margin({ left: 12, bottom: 10, right: 12 })
57 - // } 58 +
  59 + }
58 } 60 }
59 .alignContent(Alignment.Bottom) 61 .alignContent(Alignment.Bottom)
60 .width(CommonConstants.FULL_WIDTH) 62 .width(CommonConstants.FULL_WIDTH)
@@ -49,7 +49,7 @@ export struct Card6Component { @@ -49,7 +49,7 @@ export struct Card6Component {
49 .maxLines(3) 49 .maxLines(3)
50 .alignSelf(ItemAlign.Start) 50 .alignSelf(ItemAlign.Start)
51 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 51 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
52 - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 60 : 52 + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
53 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 53 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
54 this.contentDTO.objectType == '5' ? 30 : 0) 54 this.contentDTO.objectType == '5' ? 30 : 0)
55 }.alignContent(Alignment.TopStart) 55 }.alignContent(Alignment.TopStart)
@@ -43,8 +43,11 @@ export struct Card9Component { @@ -43,8 +43,11 @@ export struct Card9Component {
43 topRight: $r('app.float.image_border_radius') 43 topRight: $r('app.float.image_border_radius')
44 }) 44 })
45 45
46 - Notes({ objectType: 5 })  
47 - .margin({ left: 5, bottom: 5 }) 46 + if (this.contentDTO.objectType == '5') {
  47 + Notes({ objectType: 5 })
  48 + .margin({ left: 5, bottom: 5 })
  49 + }
  50 +
48 }.alignContent(Alignment.BottomStart) 51 }.alignContent(Alignment.BottomStart)
49 52
50 // 时间线--后端返回三个, 53 // 时间线--后端返回三个,
@@ -13,10 +13,10 @@ export struct Notes { @@ -13,10 +13,10 @@ export struct Notes {
13 build() { 13 build() {
14 if (this.returnTypeTitleFn()) { 14 if (this.returnTypeTitleFn()) {
15 Text(this.returnTypeTitleFn()) 15 Text(this.returnTypeTitleFn())
16 - .fontSize($r('app.float.font_size_12')) 16 + .fontSize($r('app.float.font_size_11'))
17 .padding({ 17 .padding({
18 - left: 5,  
19 - right: 5, 18 + left: 4,
  19 + right: 4,
20 top: 3, 20 top: 3,
21 bottom: 3 21 bottom: 3
22 }) 22 })
1 import { CompDTO, ContentDTO, } from 'wdBean'; 1 import { CompDTO, ContentDTO, } from 'wdBean';
2 -import { BreakpointConstants, CommonConstants, DurationEnum } from 'wdConstant'; 2 +import { BreakpointConstants, CommonConstants } from 'wdConstant';
3 import { BreakPointType, Logger } from 'wdKit'; 3 import { BreakPointType, Logger } from 'wdKit';
4 import { CompUtils } from '../../utils/CompUtils'; 4 import { CompUtils } from '../../utils/CompUtils';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { EmptyComponent } from '../view/EmptyComponent'; 6 import { EmptyComponent } from '../view/EmptyComponent';
7 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 7 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  9 +import { Notes } from '../cardview/notes';
9 10
10 const TAG = 'Zh_Carousel_Layout-01'; 11 const TAG = 'Zh_Carousel_Layout-01';
11 12
@@ -40,19 +41,21 @@ class MyDataSource implements IDataSource { @@ -40,19 +41,21 @@ class MyDataSource implements IDataSource {
40 41
41 @Component 42 @Component
42 export struct ZhCarouselLayout01 { 43 export struct ZhCarouselLayout01 {
43 - @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS; 44 + @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
  45 + BreakpointConstants.BREAKPOINT_XS;
44 @State compDTO: CompDTO = {} as CompDTO 46 @State compDTO: CompDTO = {} as CompDTO
45 - private data: MyDataSource = new MyDataSource([])  
46 @State firstWd: number = 0 47 @State firstWd: number = 0
47 @State SecondWd: number = 0 48 @State SecondWd: number = 0
48 @State swiperIndex: number = 0 49 @State swiperIndex: number = 0
  50 + private data: MyDataSource = new MyDataSource([])
49 51
50 watchCurrentBreakpoint() { 52 watchCurrentBreakpoint() {
51 Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); 53 Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`);
52 } 54 }
53 55
54 aboutToAppear() { 56 aboutToAppear() {
55 - Logger.info(TAG, `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); 57 + Logger.info(TAG,
  58 + `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`);
56 let list: number[] = [] 59 let list: number[] = []
57 for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) { 60 for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) {
58 list.push(i); 61 list.push(i);
@@ -155,16 +158,21 @@ export struct ZhCarouselLayout01 { @@ -155,16 +158,21 @@ export struct ZhCarouselLayout01 {
155 } 158 }
156 159
157 public buildDisplayCount(): number { 160 public buildDisplayCount(): number {
158 - return new BreakPointType({ xs: 1, sm: 1, md: 2, lg: 3 }).getValue(this.currentBreakpoint) 161 + return new BreakPointType({
  162 + xs: 1,
  163 + sm: 1,
  164 + md: 2,
  165 + lg: 3
  166 + }).getValue(this.currentBreakpoint)
159 } 167 }
160 } 168 }
161 169
162 170
163 @Component 171 @Component
164 struct CarouselLayout01CardView { 172 struct CarouselLayout01CardView {
  173 + @State loadImg: boolean = false;
165 private item: ContentDTO = new ContentDTO(); 174 private item: ContentDTO = new ContentDTO();
166 private length: number = 1; // 轮播图数量 175 private length: number = 1; // 轮播图数量
167 - @State loadImg: boolean = false;  
168 176
169 async aboutToAppear(): Promise<void> { 177 async aboutToAppear(): Promise<void> {
170 this.loadImg = await onlyWifiLoadImg(); 178 this.loadImg = await onlyWifiLoadImg();
@@ -187,29 +195,37 @@ struct CarouselLayout01CardView { @@ -187,29 +195,37 @@ struct CarouselLayout01CardView {
187 }) 195 })
188 Column() { 196 Column() {
189 // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 197 // 这里用于展示轮播图右上角信息,这里只对直播类型的展示
190 - if (this.item.objectType === '2' || this.item.objectType ==='4') { 198 + if (this.item.objectType === '2' || this.item.objectType === '4') {
191 CardMediaInfo({ contentDTO: this.item }) 199 CardMediaInfo({ contentDTO: this.item })
192 .width(CommonConstants.FULL_PARENT) 200 .width(CommonConstants.FULL_PARENT)
193 } 201 }
194 Blank() 202 Blank()
195 // 文本信息 203 // 文本信息
196 - Text(`${this.item.corner}${this.item.newsTitle}`)  
197 - .width(CommonConstants.FULL_PARENT)  
198 - .height(39)  
199 - .padding({  
200 - left: 10,  
201 - right: 10  
202 - })  
203 - .margin({  
204 - bottom: this.length > 1 ? 28 : 10  
205 - })  
206 - .fontColor(Color.White)  
207 - .fontSize($r('app.float.font_size_16'))  
208 - .fontWeight(FontWeight.Medium)  
209 - .textAlign(TextAlign.Start)  
210 - .align(Alignment.Bottom)  
211 - .maxLines(CompUtils.MAX_LINES_2)  
212 - .textOverflow({ overflow: TextOverflow.Ellipsis }) 204 + Stack() {
  205 + if (this.item.objectType == '5') {
  206 + Notes({ objectType: this.item.objectType })
  207 + }
  208 + Text(`${this.item.corner}${this.item.newsTitle}`)
  209 + .width(CommonConstants.FULL_PARENT)
  210 + .fontColor(Color.White)
  211 + .fontSize($r('app.float.font_size_16'))
  212 + .fontWeight(FontWeight.Medium)
  213 + .textAlign(TextAlign.Start)
  214 + .align(Alignment.Bottom)
  215 + .maxLines(CompUtils.MAX_LINES_2)
  216 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  217 + .textIndent(this.item.objectType == '5' ? 35 : 0)
  218 + }
  219 + // .height(39)
  220 + .padding({
  221 + left: 10,
  222 + right: 10
  223 + })
  224 + .margin({
  225 + bottom: this.length > 1 ? 28 : 10
  226 + })
  227 + .alignContent(Alignment.TopStart)
  228 +
213 } 229 }
214 .width(CommonConstants.FULL_PARENT) 230 .width(CommonConstants.FULL_PARENT)
215 .height(CommonConstants.FULL_PARENT) 231 .height(CommonConstants.FULL_PARENT)
@@ -40,6 +40,7 @@ export struct ZhSingleRow03 { @@ -40,6 +40,7 @@ export struct ZhSingleRow03 {
40 40
41 // 请求所有预约状态 41 // 请求所有预约状态
42 async getReserveState() { 42 async getReserveState() {
  43 + this.reservedIds = []
43 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { 44 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => {
44 const reqItem: reserveReqItem = { 45 const reqItem: reserveReqItem = {
45 liveId: item.objectId.toString(), 46 liveId: item.objectId.toString(),
1 -import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean'; 1 +import { commentInfo, CompDTO, ContentDTO, Params, batchLikeAndCollectResult } from 'wdBean';
2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 -import { DateTimeUtils, SPHelper } from 'wdKit/Index'; 3 +import { DateTimeUtils, SPHelper, Logger } from 'wdKit/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import { SpConstants } from 'wdConstant/Index' 5 import { SpConstants } from 'wdConstant/Index'
  6 +import {
  7 + batchLikeAndCollectParams,
  8 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  9 +import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
  10 +import commentViewModel from '../../components/comment/viewmodel/CommentViewModel';
  11 +import { commentItemModel } from '../../components/comment/model/CommentModel'
6 12
7 /** 13 /**
8 * 精选评论卡 14 * 精选评论卡
9 * Zh_Single_Row-06 15 * Zh_Single_Row-06
10 */ 16 */
11 const TAG = 'Zh_Single_Row-06' 17 const TAG = 'Zh_Single_Row-06'
12 -  
13 -// interface commentInfo {  
14 -// commentTitle: string,  
15 -// newsTitle: string,  
16 -// userName: string,  
17 -// userHeaderUrl: string,  
18 -// publishTime: number  
19 -// }  
20 -// interface operDataListItem {  
21 -// commentInfo: commentInfo  
22 -// }  
23 -// interface CommentData{  
24 -// operDataList: Array<operDataListItem>  
25 -// }  
26 -  
27 @Entry 18 @Entry
28 @Component 19 @Component
29 export struct ZhSingleRow06 { 20 export struct ZhSingleRow06 {
30 @State compDTO: CompDTO = {} as CompDTO 21 @State compDTO: CompDTO = {} as CompDTO
31 - @State likeBl: boolean = false; 22 + @State newsStatusOfUser: batchLikeAndCollectResult = {
  23 + likeStatus: '0'
  24 + } as batchLikeAndCollectResult // 点赞、收藏状态
  25 +
  26 + aboutToAppear(): void {
  27 + this.getInteractDataStatus()
  28 + }
32 29
33 - async likeAction() { 30 + /**
  31 + * 点赞、取消点赞
  32 + */
  33 + async toggleLikeStatus() {
  34 + // 未登录,跳转登录
34 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') 35 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
35 if (!user_id) { 36 if (!user_id) {
36 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 37 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
37 return 38 return
38 } 39 }
39 40
40 - if (this.likeBl) {  
41 - this.likeBl = false;  
42 - } else {  
43 - this.likeBl = true; 41 + const commentInfo = this.compDTO.operDataList[0]?.commentInfo as commentInfo;
  42 + // commentLikeChange(this.item)
  43 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
  44 + const commentLikeParam = {
  45 + targetId: commentInfo.newsId || '',
  46 + id: commentInfo.commentId,
  47 + targetType: commentInfo?.objectType || '',
  48 + api_status: this.newsStatusOfUser?.likeStatus == '1' ? false : true
  49 + } as commentItemModel;
  50 + commentViewModel.commentLike(commentLikeParam).then(() => {
  51 + }).catch(() => {
  52 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
  53 + })
  54 + }
  55 +
  56 + // 已登录->查询用户对作品点赞、收藏状态
  57 + async getInteractDataStatus() {
  58 + // 未登录,跳转登录
  59 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  60 + if (!user_id) {
  61 + return
  62 + }
  63 + try {
  64 + const params: batchLikeAndCollectParams = {
  65 + contentList: [
  66 + {
  67 + contentId: this.compDTO.operDataList[0]?.commentInfo?.newsId + '',
  68 + contentType: this.compDTO.operDataList[0]?.commentInfo?.newsType + '',
  69 + }
  70 + ]
  71 + }
  72 + let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
  73 + Logger.info(TAG, 'ZhSingleRow06-data', JSON.stringify(data))
  74 + this.newsStatusOfUser = data[0];
  75 + Logger.info(TAG, `ZhSingleRow06-newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
  76 + } catch (exception) {
  77 + console.error(TAG, JSON.stringify(exception))
44 } 78 }
45 } 79 }
46 80
@@ -95,7 +129,7 @@ export struct ZhSingleRow06 { @@ -95,7 +129,7 @@ export struct ZhSingleRow06 {
95 .fontColor(0x999999) 129 .fontColor(0x999999)
96 130
97 Row(){ 131 Row(){
98 - Image(this.likeBl ? $r('app.media.icon_like_select') : $r('app.media.icon_like')) 132 + Image(Number(this.newsStatusOfUser?.likeStatus) == 1 ? $r('app.media.icon_like_select') : $r('app.media.icon_like'))
99 .width(16) 133 .width(16)
100 .height(16) 134 .height(16)
101 .margin({right: 3}) 135 .margin({right: 3})
@@ -103,9 +137,11 @@ export struct ZhSingleRow06 { @@ -103,9 +137,11 @@ export struct ZhSingleRow06 {
103 Text('点赞') 137 Text('点赞')
104 .fontSize(15) 138 .fontSize(15)
105 .fontColor(0x999999) 139 .fontColor(0x999999)
  140 + .onClick(() => {
  141 + })
106 } 142 }
107 .onClick(() => { 143 .onClick(() => {
108 - this.likeAction() 144 + this.toggleLikeStatus()
109 }) 145 })
110 } 146 }
111 .justifyContent(FlexAlign.SpaceBetween) 147 .justifyContent(FlexAlign.SpaceBetween)
1 -import lottie, { AnimationSegment } from '@ohos/lottie'; 1 +import lottie, { AnimationItem, AnimationSegment } from '@ohos/lottie';
2 2
3 @Component 3 @Component
4 export struct LottieView { 4 export struct LottieView {
5 - @Prop name: string = ''  
6 - @Prop path: string = ''  
7 - @Prop lottieWidth?: number = 30  
8 - @Prop lottieHeight?: number = 30  
9 - @Prop autoplay?: boolean = false  
10 - @Prop loop?: boolean = false 5 + @Prop name: string
  6 + @Prop path: string
  7 + @Prop lottieWidth: number = 30
  8 + @Prop lottieHeight: number = 30
  9 + @Prop autoplay: boolean = false
  10 + @Prop loop: boolean = false
11 @Prop initialSegment?: AnimationSegment = [0, 120] // 动画起始帧 11 @Prop initialSegment?: AnimationSegment = [0, 120] // 动画起始帧
12 - @Prop onReady: (animateItem: ESObject) => void // 动画初始化完成事件 12 + @Prop onReady: (animateItem: AnimationItem | null) => void // 动画初始化完成事件
13 @Prop onComplete?: () => void // 动画完成事件 13 @Prop onComplete?: () => void // 动画完成事件
14 - private politeChickyController: CanvasRenderingContext2D = new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象  
15 - private animateItem: ESObject = null; // 初始化loadAnimation接口的返回对象 14 + private politeChickyController: CanvasRenderingContext2D =
  15 + new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象
  16 + private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象
16 17
17 // 页面隐藏销毁动画 18 // 页面隐藏销毁动画
18 onPageHide(): void { 19 onPageHide(): void {
19 - this.animateItem.destroy() 20 + this.animateItem?.destroy()
20 21
21 if (this.onComplete) { 22 if (this.onComplete) {
22 - this.animateItem.removeEventListener('complete', this.onComplete) 23 + this.animateItem?.removeEventListener('complete', this.onComplete)
23 } 24 }
24 } 25 }
25 26
@@ -44,7 +45,7 @@ export struct LottieView { @@ -44,7 +45,7 @@ export struct LottieView {
44 // initialSegment: this.initialSegment 45 // initialSegment: this.initialSegment
45 }) 46 })
46 if (this.initialSegment) { 47 if (this.initialSegment) {
47 - this.animateItem.initialSegment = this.initialSegment 48 + this.animateItem.segments = this.initialSegment
48 } 49 }
49 50
50 if (this.onComplete) { 51 if (this.onComplete) {
@@ -57,7 +58,7 @@ export struct LottieView { @@ -57,7 +58,7 @@ export struct LottieView {
57 Stack({ alignContent: Alignment.TopStart }) { 58 Stack({ alignContent: Alignment.TopStart }) {
58 Canvas(this.politeChickyController) 59 Canvas(this.politeChickyController)
59 .width(this.lottieWidth) 60 .width(this.lottieWidth)
60 - .height(this.lottieHeight) 61 + .height(this.lottieHeight)// .backgroundColor(Color.Black)
61 .onReady(() => { 62 .onReady(() => {
62 this.loadAnimation(); 63 this.loadAnimation();
63 if (this.onReady) { 64 if (this.onReady) {
@@ -65,7 +66,7 @@ export struct LottieView { @@ -65,7 +66,7 @@ export struct LottieView {
65 } 66 }
66 }) 67 })
67 .onClick(() => { 68 .onClick(() => {
68 - this.animateItem.play() 69 + this.animateItem?.play()
69 }) 70 })
70 } 71 }
71 } 72 }
1 import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' 1 import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel'
2 -import { WDRouterRule, WDRouterPage } from 'wdRouter' 2 +import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter'
3 import { Params } from 'wdBean'; 3 import { Params } from 'wdBean';
4 import { ToastUtils } from 'wdKit/Index'; 4 import { ToastUtils } from 'wdKit/Index';
5 5
@@ -77,7 +77,7 @@ export default struct MinePageMoreFunctionUI { @@ -77,7 +77,7 @@ export default struct MinePageMoreFunctionUI {
77 }else if (item.msg == "关于") { // 关于 77 }else if (item.msg == "关于") { // 关于
78 WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) 78 WDRouterRule.jumpWithPage(WDRouterPage.aboutPage)
79 }else if (item.msg == "意见反馈") { // 关于 79 }else if (item.msg == "意见反馈") { // 关于
80 - ToastUtils.shortToast("待开发") 80 + ProcessUtils.gotoFeedBackActivity()
81 } 81 }
82 }) 82 })
83 .height('117lpx') 83 .height('117lpx')
1 import { WDRouterRule, WDRouterPage } from 'wdRouter' 1 import { WDRouterRule, WDRouterPage } from 'wdRouter'
2 import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' 2 import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem'
  3 +import { PagePersonFunction } from './PagePersonFunction'
3 4
4 @Component 5 @Component
5 export default struct MinePagePersonFunctionUI { 6 export default struct MinePagePersonFunctionUI {
@@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI { @@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI {
10 Grid(){ 11 Grid(){
11 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ 12 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
12 GridItem(){ 13 GridItem(){
13 - Row(){  
14 - Column(){  
15 - Image(item.imgSrc)  
16 - .width('46lpx')  
17 - .height('46lpx')  
18 - .objectFit(ImageFit.Auto)  
19 - .interpolation(ImageInterpolation.High)  
20 - Text(`${item.msg}`)  
21 - .margin({top:'8lpx'})  
22 - .height('23lpx')  
23 - .fontColor($r('app.color.color_222222'))  
24 - .fontSize('23lpx')  
25 - }  
26 - .alignItems(HorizontalAlign.Center)  
27 - .width('100%')  
28 - Blank()  
29 - .layoutWeight(1)  
30 - if(index % 4 < 3 && index != this.personalData.length-1){  
31 - Text().backgroundColor($r('app.color.color_222222'))  
32 - .opacity(0.1)  
33 - .width('2lpx')  
34 - .height('29lpx')  
35 - }  
36 - } 14 + PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true})
37 }.onClick(()=>{ 15 }.onClick(()=>{
38 console.log(index+"") 16 console.log(index+"")
39 switch (item.msg){ 17 switch (item.msg){
@@ -42,7 +20,8 @@ export default struct MinePagePersonFunctionUI { @@ -42,7 +20,8 @@ export default struct MinePagePersonFunctionUI {
42 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 20 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
43 return 21 return
44 }else { 22 }else {
45 - WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage) 23 + let params: Record<string, string> = {'comment': "1"};
  24 + WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage,params)
46 } 25 }
47 break; 26 break;
48 } 27 }
@@ -91,11 +70,10 @@ export default struct MinePagePersonFunctionUI { @@ -91,11 +70,10 @@ export default struct MinePagePersonFunctionUI {
91 .height('117lpx') 70 .height('117lpx')
92 }) 71 })
93 } 72 }
94 - // .rowsTemplate('1fr 1fr')  
95 - .rowsTemplate('1fr') 73 + .rowsTemplate('1fr 1fr')
96 .columnsTemplate('1fr 1fr 1fr 1fr') 74 .columnsTemplate('1fr 1fr 1fr 1fr')
97 - // .height('234lpx')  
98 - .height('167lpx') 75 + .height('234lpx')
99 .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) 76 .margin({top:'31lpx',left:'23lpx',right:'23lpx' })
100 } 77 }
101 -}  
  78 +}
  79 +
  1 +import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem'
  2 +
  3 +@Component
  4 +export struct PagePersonFunction{
  5 + @ObjectLink item: MinePagePersonalFunctionsItem
  6 + @State noDivider:boolean = false
  7 +
  8 + build() {
  9 + Row(){
  10 + Column(){
  11 + Stack({ alignContent: Alignment.TopEnd }){
  12 + Image(this.item.imgSrc)
  13 + .objectFit(ImageFit.Auto)
  14 + .interpolation(ImageInterpolation.High)
  15 + if (this.item.isShowRedPoint) {
  16 + Button()
  17 + .type(ButtonType.Circle)
  18 + .width("12lpx")
  19 + .height("12lpx")
  20 + .backgroundColor($r('app.color.color_ED2800'))
  21 + }
  22 + }.width('46lpx')
  23 + .height('46lpx')
  24 +
  25 + Text(`${this.item.msg}`)
  26 + .margin({top:'8lpx'})
  27 + .height('23lpx')
  28 + .fontColor($r('app.color.color_222222'))
  29 + .fontSize('23lpx')
  30 + }
  31 + .alignItems(HorizontalAlign.Center)
  32 + .width('100%')
  33 + Blank()
  34 + .layoutWeight(1)
  35 + if(!this.noDivider){
  36 + Text().backgroundColor($r('app.color.color_222222'))
  37 + .opacity(0.1)
  38 + .width('2lpx')
  39 + .height('29lpx')
  40 + }
  41 + }
  42 + }
  43 +
  44 +}
1 import { SpConstants } from 'wdConstant/Index' 1 import { SpConstants } from 'wdConstant/Index'
2 -import { DateTimeUtils, SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' 2 +import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'
3 import { HttpUtils } from 'wdNetwork/Index' 3 import { HttpUtils } from 'wdNetwork/Index'
4 import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' 4 import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
5 import MinePageDatasModel from '../../../model/MinePageDatasModel' 5 import MinePageDatasModel from '../../../model/MinePageDatasModel'
@@ -116,9 +116,14 @@ export struct FollowChildComponent{ @@ -116,9 +116,14 @@ export struct FollowChildComponent{
116 }.height('202lpx') 116 }.height('202lpx')
117 .justifyContent(FlexAlign.Start) 117 .justifyContent(FlexAlign.Start)
118 118
119 - Text().backgroundColor($r('app.color.color_EDEDED')) 119 + // Text().backgroundColor($r('app.color.color_EDEDED'))
  120 + // .width('100%')
  121 + // .height('2lpx')
  122 + Divider()
120 .width('100%') 123 .width('100%')
121 .height('2lpx') 124 .height('2lpx')
  125 + .color($r('app.color.color_F5F5F5'))
  126 + .strokeWidth('1lpx')
122 }.width('100%') 127 }.width('100%')
123 128
124 }else { 129 }else {
@@ -230,9 +235,15 @@ export struct FollowChildComponent{ @@ -230,9 +235,15 @@ export struct FollowChildComponent{
230 }.height('146lpx') 235 }.height('146lpx')
231 .justifyContent(FlexAlign.Center) 236 .justifyContent(FlexAlign.Center)
232 237
233 - Text().backgroundColor($r('app.color.color_EDEDED')) 238 + // Text().backgroundColor($r('app.color.color_EDEDED'))
  239 + // .width('100%')
  240 + // .height('2lpx')
  241 +
  242 + Divider()
234 .width('100%') 243 .width('100%')
235 .height('2lpx') 244 .height('2lpx')
  245 + .color($r('app.color.color_F5F5F5'))
  246 + .strokeWidth('1lpx')
236 }.width('100%') 247 }.width('100%')
237 248
238 } 249 }
@@ -255,12 +266,6 @@ export struct FollowChildComponent{ @@ -255,12 +266,6 @@ export struct FollowChildComponent{
255 this.data.status = this.data.status ==="0"?"1":"0" 266 this.data.status = this.data.status ==="0"?"1":"0"
256 267
257 UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status) 268 UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status)
258 -  
259 - // if(this.data.status === "1"){  
260 - // UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+"")  
261 - // }else{  
262 - // UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+","+this.data.creatorId)  
263 - // }  
264 } 269 }
265 } 270 }
266 }) 271 })
@@ -30,10 +30,9 @@ export struct HomePageBottomCommentComponent { @@ -30,10 +30,9 @@ export struct HomePageBottomCommentComponent {
30 build() { 30 build() {
31 Column() { 31 Column() {
32 if (this.isGetRequest == true) { 32 if (this.isGetRequest == true) {
33 - Divider().width('100%') 33 + Text().backgroundColor($r('app.color.color_EDEDED'))
  34 + .width('100%')
34 .height('2lpx') 35 .height('2lpx')
35 - .strokeWidth('1lpx')  
36 - .backgroundColor($r('app.color.color_EDEDED'))  
37 } 36 }
38 if (this.count === 0) { 37 if (this.count === 0) {
39 if (this.isGetRequest == true) { 38 if (this.isGetRequest == true) {
@@ -65,10 +65,9 @@ export struct HomePageBottomFollowComponent { @@ -65,10 +65,9 @@ export struct HomePageBottomFollowComponent {
65 65
66 Column() { 66 Column() {
67 if (this.isGetRequest == true) { 67 if (this.isGetRequest == true) {
68 - Divider().width('100%') 68 + Text().backgroundColor($r('app.color.color_EDEDED'))
  69 + .width('100%')
69 .height('2lpx') 70 .height('2lpx')
70 - .strokeWidth('1lpx')  
71 - .backgroundColor($r('app.color.color_EDEDED'))  
72 } 71 }
73 72
74 if (this.count === 0) { 73 if (this.count === 0) {
@@ -30,10 +30,9 @@ export struct OtherHomePageBottomCommentComponent { @@ -30,10 +30,9 @@ export struct OtherHomePageBottomCommentComponent {
30 30
31 build() { 31 build() {
32 Column() { 32 Column() {
33 - Divider().width('100%') 33 + Text().backgroundColor($r('app.color.color_EDEDED'))
  34 + .width('100%')
34 .height('2lpx') 35 .height('2lpx')
35 - .strokeWidth('1lpx')  
36 - .backgroundColor($r('app.color.color_EDEDED'))  
37 36
38 if (this.count === 0) { 37 if (this.count === 0) {
39 if (this.isGetRequest == true) { 38 if (this.isGetRequest == true) {
@@ -30,10 +30,9 @@ export struct OtherHomePageBottomFollowComponent{ @@ -30,10 +30,9 @@ export struct OtherHomePageBottomFollowComponent{
30 30
31 build(){ 31 build(){
32 Column(){ 32 Column(){
33 - Divider().width('100%') 33 + Text().backgroundColor($r('app.color.color_EDEDED'))
  34 + .width('100%')
34 .height('2lpx') 35 .height('2lpx')
35 - .strokeWidth('1lpx')  
36 - .backgroundColor($r('app.color.color_EDEDED'))  
37 36
38 if(this.count === 0){ 37 if(this.count === 0){
39 Column(){ 38 Column(){
@@ -85,6 +85,7 @@ export struct BottomNavigationComponent { @@ -85,6 +85,7 @@ export struct BottomNavigationComponent {
85 VideoChannelPage({ 85 VideoChannelPage({
86 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), 86 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
87 _currentNavIndex: $currentNavIndex, 87 _currentNavIndex: $currentNavIndex,
  88 + autoRefresh: this.autoRefresh
88 }) 89 })
89 } else { 90 } else {
90 TopNavigationComponent({ 91 TopNavigationComponent({
@@ -487,12 +487,7 @@ export struct PaperSingleColumn999CardView { @@ -487,12 +487,7 @@ export struct PaperSingleColumn999CardView {
487 Text(this.getPublishTime()) 487 Text(this.getPublishTime())
488 .fontSize(12) 488 .fontSize(12)
489 .fontColor(Color.Gray) 489 .fontColor(Color.Gray)
490 - if (this.interactData && this.interactData.commentNum) {  
491 - Text(this.interactData.commentNum + "评")  
492 - .fontSize(12)  
493 - .fontColor(Color.Gray)  
494 - .margin({ left: 6 })  
495 - }else if (this.commentList && this.commentList.length) { 490 + if (this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) {
496 Text(this.interactData.commentNum + "评") 491 Text(this.interactData.commentNum + "评")
497 .fontSize(12) 492 .fontSize(12)
498 .fontColor(Color.Gray) 493 .fontColor(Color.Gray)
@@ -517,7 +512,7 @@ export struct PaperSingleColumn999CardView { @@ -517,7 +512,7 @@ export struct PaperSingleColumn999CardView {
517 } 512 }
518 } 513 }
519 .backgroundColor(Color.White) 514 .backgroundColor(Color.White)
520 - .margin({ bottom: 14, left: 12, right: 12 }) 515 + .margin({ bottom: 10, left: 12, right: 12 })
521 .borderRadius(4) 516 .borderRadius(4)
522 .onClick(() => { 517 .onClick(() => {
523 ProcessUtils.processPage(this.item) 518 ProcessUtils.processPage(this.item)
@@ -53,8 +53,25 @@ export struct MinePageComponent { @@ -53,8 +53,25 @@ export struct MinePageComponent {
53 this.getUserLogin() 53 this.getUserLogin()
54 this.getFunctionData() 54 this.getFunctionData()
55 this.addLoginStatusObserver() 55 this.addLoginStatusObserver()
  56 + this.getMessageData()
56 } 57 }
57 58
  59 + getMessageData(){
  60 + MinePageDatasModel.getMessageUnReadData().then((value) => {
  61 + if(value !=null) {
  62 + if(value.activeCount >0 ||value.subscribeCount > 0 || value.systemCount > 0){
  63 + this.personalData.forEach((value) => {
  64 + if(value.msg == "消息")
  65 + value.isShowRedPoint = true
  66 + })
  67 + }
  68 + }
  69 + }).catch((err: Error) => {
  70 + console.log(TAG, JSON.stringify(err))
  71 + })
  72 + }
  73 +
  74 +
58 async addLoginStatusObserver(){ 75 async addLoginStatusObserver(){
59 this.preferences = await SPHelper.default.getPreferences(); 76 this.preferences = await SPHelper.default.getPreferences();
60 this.preferences.on('change', this.observer); 77 this.preferences.on('change', this.observer);
@@ -13,6 +13,7 @@ import { @@ -13,6 +13,7 @@ import {
13 PeopleShipUserDetailData, 13 PeopleShipUserDetailData,
14 ArticleCountData 14 ArticleCountData
15 } from 'wdBean' 15 } from 'wdBean'
  16 +import { EmptyComponent } from '../view/EmptyComponent'
16 17
17 @Entry 18 @Entry
18 @Component 19 @Component
@@ -35,65 +36,87 @@ struct PeopleShipHomePage { @@ -35,65 +36,87 @@ struct PeopleShipHomePage {
35 @Provide @Watch('handleChangeAttentionStata') isLoadingAttention: boolean = false 36 @Provide @Watch('handleChangeAttentionStata') isLoadingAttention: boolean = false
36 //关注显示 37 //关注显示
37 @State attentionOpacity: boolean = false 38 @State attentionOpacity: boolean = false
38 - @Provide topHeight: number = 400 39 + @Provide topHeight: number = 286
  40 + @State isLoading: boolean = true
39 41
40 build() { 42 build() {
41 -  
42 - Stack({ alignContent: Alignment.TopStart }) {  
43 - // 头部返回  
44 - PeopleShipHomePageNavComponent({  
45 - attentionOpacity: this.attentionOpacity,  
46 - topOpacity: this.topOpacity,  
47 - detailModel: this.detailModel  
48 - })  
49 - .height($r('app.float.top_bar_height'))  
50 - .zIndex(100)  
51 - .backgroundColor(Color.Transparent)  
52 -  
53 - if (this.detailModel && this.detailModel.userName) {  
54 - Scroll(this.scroller) {  
55 - Column() {  
56 - // 顶部相关  
57 - PeopleShipHomePageTopComponent({  
58 - creatorId: this.creatorId,  
59 - detailModel: this.detailModel,  
60 - publishCount: this.publishCount,  
61 - topHeight: this.topHeight  
62 - }) 43 + Stack({ alignContent: Alignment.TopStart }) {
  44 + // 顶部图片
  45 + Image($r('app.media.home_page_bg'))
  46 + .width('100%')
  47 + .height('120vp')
  48 + .objectFit(ImageFit.Fill)
  49 + .backgroundColor(Color.White)
  50 + .visibility(this.isLoading ? Visibility.None : Visibility.Visible)
  51 +
  52 + Column(){
  53 + // 头部返回
  54 + PeopleShipHomePageNavComponent({
  55 + attentionOpacity: this.attentionOpacity,
  56 + topOpacity: this.topOpacity,
  57 + detailModel: this.detailModel
  58 + })
  59 + .height($r('app.float.top_bar_height'))
  60 + .backgroundColor(Color.Transparent)
  61 + if (this.detailModel && this.detailModel.userName) {
  62 + Scroll(this.scroller) {
  63 + Column() {
  64 + // 顶部相关
  65 + PeopleShipHomePageTopComponent({
  66 + creatorId: this.creatorId,
  67 + detailModel: this.detailModel,
  68 + publishCount: this.publishCount,
  69 + topHeight: this.topHeight
  70 + })
  71 + .width("100%")
  72 + .height(this.topHeight)
  73 + // 列表
  74 + Column(){
  75 + PeopleShipHomeListComponent({
  76 + publishCount: this.publishCount,
  77 + creatorId: this.creatorId
  78 + })
  79 + }.height('100%')
  80 +
  81 +
  82 + }
63 .width("100%") 83 .width("100%")
64 - .height(this.topHeight) 84 + .justifyContent(FlexAlign.Start)
  85 + .alignItems(HorizontalAlign.Start)
  86 + // .height('100%')
  87 + // .height(this.publishCount == 0 ? '100%' : '')
  88 + }
  89 + .scrollable(ScrollDirection.Vertical)
  90 + // .alignSelf(ItemAlign.Start)
  91 + // .align(Alignment.Start)
  92 + .edgeEffect(EdgeEffect.None)
  93 + .friction(0.7)
  94 + .backgroundColor(Color.White)
  95 + .scrollBar(BarState.Off)
  96 + .width('100%')
  97 + .height('calc(100% - 44vp)')
  98 + // .layoutWeight(1)
  99 + .onDidScroll(() => {
  100 + // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
  101 + this.topOpacity = this.scroller.currentOffset().yOffset / 100
  102 + if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
  103 + this.attentionOpacity = true
  104 + } else {
  105 + this.attentionOpacity = false
  106 + }
  107 + Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
65 108
66 - // 列表  
67 - PeopleShipHomeListComponent({  
68 - publishCount: this.publishCount,  
69 - creatorId: this.creatorId  
70 }) 109 })
71 -  
72 } 110 }
73 - .width("100%")  
74 - .justifyContent(FlexAlign.Start)  
75 - // .height(this.publishCount == 0 ? '100%' : '') 111 +
76 } 112 }
77 - .edgeEffect(EdgeEffect.None)  
78 - .friction(0.6)  
79 - .backgroundColor(Color.White)  
80 - .scrollBar(BarState.Off) 113 + .alignItems(HorizontalAlign.Start)
  114 + .justifyContent(FlexAlign.Start)
81 .width('100%') 115 .width('100%')
82 - .height('100%')  
83 - .onDidScroll(() => {  
84 - // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)  
85 - this.topOpacity = this.scroller.currentOffset().yOffset / 100  
86 - if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {  
87 - this.attentionOpacity = true  
88 - } else {  
89 - this.attentionOpacity = false  
90 - }  
91 - Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)  
92 -  
93 - }) 116 + // .height('100%')
94 } 117 }
95 -  
96 - } 118 + // .height('100%')
  119 + .width('100%')
97 120
98 } 121 }
99 122
@@ -104,9 +127,11 @@ struct PeopleShipHomePage { @@ -104,9 +127,11 @@ struct PeopleShipHomePage {
104 127
105 private async getData() { 128 private async getData() {
106 try { 129 try {
  130 + this.isLoading = true
107 // 获取页面信息 131 // 获取页面信息
108 this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') 132 this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '')
109 Logger.debug('PeopleShipHomePage', '获取页面信息' + `${JSON.stringify(this.detailModel)}`) 133 Logger.debug('PeopleShipHomePage', '获取页面信息' + `${JSON.stringify(this.detailModel)}`)
  134 + this.isLoading = false
110 135
111 // 获取关注 136 // 获取关注
112 // 登录后获取,是否关注 137 // 登录后获取,是否关注
@@ -117,7 +142,7 @@ struct PeopleShipHomePage { @@ -117,7 +142,7 @@ struct PeopleShipHomePage {
117 } 142 }
118 143
119 } catch (exception) { 144 } catch (exception) {
120 - 145 + this.isLoading = false
121 } 146 }
122 } 147 }
123 148
1 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; 1 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';
2 import { SpConstants } from 'wdConstant'; 2 import { SpConstants } from 'wdConstant';
3 -import { DisplayUtils, LazyDataSource, Logger, SPHelper, NetworkUtil, ToastUtils } from 'wdKit'; 3 +import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
4 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; 4 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
5 import { PageComponent } from './PageComponent'; 5 import { PageComponent } from './PageComponent';
6 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; 6 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
@@ -13,6 +13,8 @@ export struct VideoChannelPage { @@ -13,6 +13,8 @@ export struct VideoChannelPage {
13 readonly MAX_LINE: number = 1; 13 readonly MAX_LINE: number = 1;
14 private groupId: number = 0 14 private groupId: number = 0
15 private swiperController: SwiperController = new SwiperController() 15 private swiperController: SwiperController = new SwiperController()
  16 + // 自动刷新触发(双击tab自动刷新)
  17 + @Prop autoRefresh: number = 0
16 @Prop topNavList: TopNavDTO[] 18 @Prop topNavList: TopNavDTO[]
17 @Link _currentNavIndex?: number; 19 @Link _currentNavIndex?: number;
18 @Consume barBackgroundColor: Color 20 @Consume barBackgroundColor: Color
@@ -91,8 +93,12 @@ export struct VideoChannelPage { @@ -91,8 +93,12 @@ export struct VideoChannelPage {
91 right: $r('app.float.top_tab_item_padding_horizontal'), 93 right: $r('app.float.top_tab_item_padding_horizontal'),
92 }) 94 })
93 .onClick(() => { 95 .onClick(() => {
  96 + if (this.currentTopNavSelectedIndex === index) {
  97 + this.autoRefresh++
  98 + }
94 this.currentTopNavSelectedIndex = index 99 this.currentTopNavSelectedIndex = index
95 this.swiperController.changeIndex(index, true) 100 this.swiperController.changeIndex(index, true)
  101 +
96 }) 102 })
97 }, (item: TopNavDTO) => item.channelId + '') 103 }, (item: TopNavDTO) => item.channelId + '')
98 } 104 }
@@ -113,6 +119,7 @@ export struct VideoChannelPage { @@ -113,6 +119,7 @@ export struct VideoChannelPage {
113 groupId: this.groupId + '', 119 groupId: this.groupId + '',
114 pageId: item.pageId + '', 120 pageId: item.pageId + '',
115 channelId: item.channelId + '', 121 channelId: item.channelId + '',
  122 + autoRefresh: this.autoRefresh,
116 }) 123 })
117 } else { 124 } else {
118 // 直播 125 // 直播
@@ -121,7 +128,7 @@ export struct VideoChannelPage { @@ -121,7 +128,7 @@ export struct VideoChannelPage {
121 navIndex: index, 128 navIndex: index,
122 pageId: item.pageId + '', 129 pageId: item.pageId + '',
123 channelId: item.channelId + '', 130 channelId: item.channelId + '',
124 - autoRefresh: this.autoRefresh2Page 131 + autoRefresh: this.autoRefresh
125 }).margin({ top: 40 }) 132 }).margin({ top: 40 })
126 } 133 }
127 }, (item: TopNavDTO) => item.channelId + '') 134 }, (item: TopNavDTO) => item.channelId + '')
1 import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent' 1 import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent'
2 import { RmhRecommendDTO } from 'wdBean'; 2 import { RmhRecommendDTO } from 'wdBean';
  3 +import { faceDetector } from '@kit.CoreVisionKit';
3 4
4 @Component 5 @Component
5 export struct PeopleShipRecommendComponent { 6 export struct PeopleShipRecommendComponent {
@@ -29,7 +30,7 @@ export struct PeopleShipRecommendComponent { @@ -29,7 +30,7 @@ export struct PeopleShipRecommendComponent {
29 .fontSize($r('app.float.vp_18')) 30 .fontSize($r('app.float.vp_18'))
30 31
31 Blank() 32 Blank()
32 - Button({ type: ButtonType.Normal, stateEffect: true }) { 33 + Button({ type: ButtonType.Normal, stateEffect: false }) {
33 Row() { 34 Row() {
34 Text('换一换') 35 Text('换一换')
35 .height('30vp') 36 .height('30vp')
1 -import { Logger, DisplayUtils} from 'wdKit' 1 +import { Logger} from 'wdKit'
2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' 2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
3 import { 3 import {
4 ContentDTO, 4 ContentDTO,
@@ -16,11 +16,11 @@ import { @@ -16,11 +16,11 @@ import {
16 } from 'wdBean' 16 } from 'wdBean'
17 import { CardParser } from '../CardParser' 17 import { CardParser } from '../CardParser'
18 import { PageRepository } from '../../repository/PageRepository' 18 import { PageRepository } from '../../repository/PageRepository'
19 -import { RefreshLayoutBean } from '../page/RefreshLayoutBean'  
20 import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' 19 import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
21 import { ErrorComponent } from '../view/ErrorComponent' 20 import { ErrorComponent } from '../view/ErrorComponent'
22 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' 21 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'
23 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData' 22 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'
  23 +import LoadMoreLayout from '../page/LoadMoreLayout'
24 24
25 const TAG = 'PeopleShipHomeArticleListComponent'; 25 const TAG = 'PeopleShipHomeArticleListComponent';
26 26
@@ -47,45 +47,29 @@ export struct PeopleShipHomeArticleListComponent { @@ -47,45 +47,29 @@ export struct PeopleShipHomeArticleListComponent {
47 } else if (this.viewType == 2) { 47 } else if (this.viewType == 2) {
48 ErrorComponent() 48 ErrorComponent()
49 } else { 49 } else {
50 - CustomPullToRefresh({  
51 - alldata:this.arr,  
52 - scroller:this.scroller,  
53 - hasMore: this.hasMore,  
54 - customList:()=>{  
55 - this.ListLayout()  
56 - },  
57 - onRefresh:(resolve)=>{  
58 - this.currentPage = 1  
59 - this.getPeopleShipPageArticleList(resolve)  
60 - },  
61 - onLoadMore:(resolve)=> {  
62 - if (this.hasMore === false) {  
63 - if(resolve) {  
64 - resolve('')  
65 - }  
66 - return  
67 - }  
68 - if(!this.isLoading && this.hasMore){  
69 - //加载分页数据  
70 - this.currentPage++;  
71 - this.getPeopleShipPageArticleList(resolve)  
72 - }else {  
73 - if(resolve) {  
74 - resolve('')  
75 - }  
76 - }  
77 - },  
78 - }) 50 + this.ListLayout()
  51 + // CustomPullToRefresh({
  52 + // alldata:this.arr,
  53 + // scroller:this.scroller,
  54 + // hasMore: false,
  55 + // customList:()=>{
  56 + // this.ListLayout()
  57 + // },
  58 + // onRefresh:(resolve)=>{
  59 + // this.currentPage = 1
  60 + // this.getPeopleShipPageArticleList(resolve)
  61 + // },
  62 + // })
79 } 63 }
80 64
81 } 65 }
82 66
83 @Builder 67 @Builder
84 LoadingLayout() { 68 LoadingLayout() {
85 - CustomRefreshLoadLayout({  
86 - refreshBean: new RefreshLayoutBean(true,  
87 - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), 20)  
88 - }).height(DisplayUtils.getDeviceHeight() - this.topHeight) 69 + // CustomRefreshLoadLayout({
  70 + // refreshBean: new RefreshLayoutBean(true,
  71 + // $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), 20)
  72 + // }).height(DisplayUtils.getDeviceHeight() - this.topHeight)
89 } 73 }
90 74
91 @Builder 75 @Builder
@@ -93,7 +77,6 @@ export struct PeopleShipHomeArticleListComponent { @@ -93,7 +77,6 @@ export struct PeopleShipHomeArticleListComponent {
93 77
94 List({scroller: this.scroller}) { 78 List({scroller: this.scroller}) {
95 // 下拉刷新 79 // 下拉刷新
96 -  
97 ForEach(this.arr, (item: ContentDTO) => { 80 ForEach(this.arr, (item: ContentDTO) => {
98 ListItem() { 81 ListItem() {
99 CardParser({ contentDTO: item }) 82 CardParser({ contentDTO: item })
@@ -103,11 +86,14 @@ export struct PeopleShipHomeArticleListComponent { @@ -103,11 +86,14 @@ export struct PeopleShipHomeArticleListComponent {
103 86
104 // 加载更多 87 // 加载更多
105 ListItem() { 88 ListItem() {
106 - if (!this.hasMore && !this.isLoading) { 89 + if (this.hasMore) {
  90 + LoadMoreLayout({ isVisible: this.hasMore })
  91 + } else if (!this.hasMore && !this.isLoading) {
107 PeopleShipNoMoreData() 92 PeopleShipNoMoreData()
108 } 93 }
109 } 94 }
110 } 95 }
  96 + .backgroundColor(Color.Transparent)
111 .width("100%") 97 .width("100%")
112 .height("100%") 98 .height("100%")
113 .edgeEffect(EdgeEffect.None) 99 .edgeEffect(EdgeEffect.None)
@@ -115,13 +101,13 @@ export struct PeopleShipHomeArticleListComponent { @@ -115,13 +101,13 @@ export struct PeopleShipHomeArticleListComponent {
115 scrollForward: NestedScrollMode.PARENT_FIRST, 101 scrollForward: NestedScrollMode.PARENT_FIRST,
116 scrollBackward: NestedScrollMode.SELF_FIRST 102 scrollBackward: NestedScrollMode.SELF_FIRST
117 }) 103 })
118 -  
119 - // .onReachEnd(() => {  
120 - // if(!this.isLoading && this.hasMore){  
121 - // //加载分页数据  
122 - // this.getPeopleShipPageArticleList()  
123 - // }  
124 - // }) 104 + .onReachEnd(() => {
  105 + if(!this.isLoading && this.hasMore){
  106 + //加载分页数据
  107 + this.currentPage++;
  108 + this.getPeopleShipPageArticleList()
  109 + }
  110 + })
125 } 111 }
126 112
127 aboutToAppear() { 113 aboutToAppear() {
@@ -313,7 +299,6 @@ export struct PeopleShipHomeArticleListComponent { @@ -313,7 +299,6 @@ export struct PeopleShipHomeArticleListComponent {
313 } 299 }
314 300
315 } 301 }
316 -  
317 // this.arr = listData.list 302 // this.arr = listData.list
318 } 303 }
319 304
@@ -24,10 +24,10 @@ export struct PeopleShipHomeListComponent { @@ -24,10 +24,10 @@ export struct PeopleShipHomeListComponent {
24 // 列表 24 // 列表
25 else if (this.publishCount == 0) { 25 else if (this.publishCount == 0) {
26 // 无数据展示 26 // 无数据展示
27 - EmptyComponent({emptyType: 12}).height(DisplayUtils.getDeviceHeight() - this.topHeight) 27 + EmptyComponent({emptyType: 12}).height('100%')
28 } else { 28 } else {
29 Column() { 29 Column() {
30 - Column() { 30 + Stack({ alignContent: Alignment.Top }){
31 // 页签 31 // 页签
32 Row() { 32 Row() {
33 Scroll() { 33 Scroll() {
@@ -44,54 +44,54 @@ export struct PeopleShipHomeListComponent { @@ -44,54 +44,54 @@ export struct PeopleShipHomeListComponent {
44 .scrollBar(BarState.Off) 44 .scrollBar(BarState.Off)
45 .width('100%') 45 .width('100%')
46 } 46 }
  47 + .zIndex(10)
47 .backgroundColor(Color.White) 48 .backgroundColor(Color.White)
  49 + .height('44vp')
48 .alignItems(VerticalAlign.Bottom) 50 .alignItems(VerticalAlign.Bottom)
49 .width('100%') 51 .width('100%')
50 - }  
51 - .justifyContent(FlexAlign.Start)  
52 - .height('44vp')  
53 - .alignItems(HorizontalAlign.Start)  
54 - .width('100%')  
55 52
56 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {  
57 - ForEach(this.tabArr, (item: ArticleTypeData, index: number) => {  
58 - TabContent() {  
59 - PeopleShipHomeArticleListComponent({  
60 - typeModel: item,  
61 - creatorId: this.creatorId,  
62 - currentTopSelectedIndex: this.currentIndex,  
63 - currentIndex: index  
64 - })  
65 - }  
66 - // }.tabBar(this.tabBuilder(index, item.name ?? '')) 53 + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
  54 + ForEach(this.tabArr, (item: ArticleTypeData, index: number) => {
  55 + TabContent() {
  56 + PeopleShipHomeArticleListComponent({
  57 + typeModel: item,
  58 + creatorId: this.creatorId,
  59 + currentTopSelectedIndex: this.currentIndex,
  60 + currentIndex: index
  61 + })
  62 + }
  63 + // .tabBar(this.Tab(index, item.name ?? ''))
  64 + })
  65 +
  66 + }
  67 + .backgroundColor(Color.White)
  68 + .barWidth('100%')
  69 + .vertical(false)
  70 + .barHeight('44vp')
  71 + .height('100% ')
  72 + .animationDuration(0)
  73 + .divider({
  74 + strokeWidth: '0.5vp',
  75 + color: $r('app.color.color_F5F5F5'),
  76 + startMargin: 0,
  77 + endMargin: 0
  78 + })
  79 + .onChange((index: number) => {
  80 + this.currentIndex = index
67 }) 81 })
68 82
69 } 83 }
70 - .backgroundColor(Color.White)  
71 - .barWidth('100%')  
72 - .barHeight(0)  
73 - .vertical(false)  
74 - .height(DisplayUtils.getDeviceHeight() - 144)  
75 - .animationDuration(0)  
76 - .divider({  
77 - strokeWidth: '0.5vp',  
78 - color: $r('app.color.color_F5F5F5'),  
79 - startMargin: 0,  
80 - endMargin: 0  
81 - })  
82 - .onChange((index: number) => {  
83 - this.currentIndex = index  
84 - }) 84 +
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 @Builder 89 @Builder
90 LoadingLayout() { 90 LoadingLayout() {
91 - CustomRefreshLoadLayout({  
92 - refreshBean: new RefreshLayoutBean(true,  
93 - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), DisplayUtils.getDeviceHeight() - this.topHeight)  
94 - }).height(DisplayUtils.getDeviceHeight() - this.topHeight) 91 + // CustomRefreshLoadLayout({
  92 + // refreshBean: new RefreshLayoutBean(true,
  93 + // $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), DisplayUtils.getDeviceHeight() - this.topHeight)
  94 + // }).height('100%')
95 } 95 }
96 96
97 // 单独的页签 97 // 单独的页签
@@ -12,6 +12,7 @@ import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; @@ -12,6 +12,7 @@ import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
12 import { HttpUtils } from 'wdNetwork/Index'; 12 import { HttpUtils } from 'wdNetwork/Index';
13 import { WDRouterPage, WDRouterRule } from 'wdRouter' 13 import { WDRouterPage, WDRouterRule } from 'wdRouter'
14 import { LazyDataSource } from 'wdKit/Index'; 14 import { LazyDataSource } from 'wdKit/Index';
  15 +import LoadMoreLayout from '../page/LoadMoreLayout'
15 16
16 const TAG: string = 'ReserveMorePage'; 17 const TAG: string = 'ReserveMorePage';
17 18
@@ -31,7 +32,7 @@ struct ReserveMorePage { @@ -31,7 +32,7 @@ struct ReserveMorePage {
31 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; 32 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
32 type: number = 2; 33 type: number = 2;
33 pageSize: number = 20; 34 pageSize: number = 20;
34 - title: string = '预约列表' 35 + title: string = '直播预告'
35 //是否预约过直播 36 //是否预约过直播
36 @State isAppointmentLive: boolean = false 37 @State isAppointmentLive: boolean = false
37 @State contentDTO: ContentDTO = {} as ContentDTO; 38 @State contentDTO: ContentDTO = {} as ContentDTO;
@@ -95,7 +96,9 @@ struct ReserveMorePage { @@ -95,7 +96,9 @@ struct ReserveMorePage {
95 ) 96 )
96 // 加载更多 97 // 加载更多
97 ListItem() { 98 ListItem() {
98 - if (!this.hasMore && !this.isLoading) { 99 + if (this.hasMore) {
  100 + LoadMoreLayout({ isVisible: this.hasMore })
  101 + } else if (!this.hasMore && !this.isLoading) {
99 PeopleShipNoMoreData() 102 PeopleShipNoMoreData()
100 } 103 }
101 } 104 }
@@ -201,7 +204,7 @@ struct ReserveMorePage { @@ -201,7 +204,7 @@ struct ReserveMorePage {
201 .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) 204 .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC'))
202 .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None) 205 .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None)
203 206
204 - Text(!this.isReserved(item) ? '关注' : '已关注') 207 + Text(!this.isReserved(item) ? '预约' : '已预约')
205 .fontSize($r('app.float.vp_12')) 208 .fontSize($r('app.float.vp_12'))
206 .fontWeight(500) 209 .fontWeight(500)
207 .fontColor(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) 210 .fontColor(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC'))
@@ -323,9 +323,10 @@ export struct SearchComponent { @@ -323,9 +323,10 @@ export struct SearchComponent {
323 if(value.videoTotal!=0){ 323 if(value.videoTotal!=0){
324 this.count.push("视频") 324 this.count.push("视频")
325 } 325 }
326 - if(value.activityTotal!=0){  
327 - this.count.push("活动")  
328 - } 326 + //屏蔽活动
  327 + // if(value.activityTotal!=0){
  328 + // this.count.push("活动")
  329 + // }
329 } 330 }
330 this.isGetRequest = true 331 this.isGetRequest = true
331 this.resetSearch() 332 this.resetSearch()
1 -import { ContentDTO, 1 +import {
  2 + ContentDTO,
2 contentListParams, 3 contentListParams,
3 - FullColumnImgUrlDTO, InteractDataDTO, 4 + FullColumnImgUrlDTO,
  5 + InteractDataDTO,
4 Params, 6 Params,
5 - RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index' 7 + RmhInfoDTO,
  8 + VideoInfoDTO
  9 +} from 'wdBean/Index'
6 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' 10 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
7 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' 11 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
8 -import { LazyDataSource, Logger, StringUtils, ToastUtils } from 'wdKit/Index' 12 +import { LazyDataSource, Logger, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'
9 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 13 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  14 +import MinePageDatasModel from '../../model/MinePageDatasModel'
10 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 15 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
11 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' 16 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
  17 +import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'
  18 +import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem'
  19 +import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
12 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' 20 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
13 import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' 21 import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
14 import { CardParser } from '../CardParser' 22 import { CardParser } from '../CardParser'
  23 +import { FollowChildComponent } from '../mine/follow/FollowChildComponent'
15 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' 24 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
16 import { ActivityItemComponent } from './ActivityItemComponent' 25 import { ActivityItemComponent } from './ActivityItemComponent'
17 import { SearchCreatorComponent } from './SearchCreatorComponent' 26 import { SearchCreatorComponent } from './SearchCreatorComponent'
@@ -19,27 +28,28 @@ import { SearchCreatorComponent } from './SearchCreatorComponent' @@ -19,27 +28,28 @@ import { SearchCreatorComponent } from './SearchCreatorComponent'
19 const TAG = "SearchResultContentComponent" 28 const TAG = "SearchResultContentComponent"
20 29
21 @Component 30 @Component
22 -export struct SearchResultContentComponent{  
23 - @State keywords:string = ""  
24 - @State searchType:string = "" 31 +export struct SearchResultContentComponent {
  32 + @State keywords: string = ""
  33 + @State searchType: string = ""
25 @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); 34 @State data: LazyDataSource<ContentDTO> = new LazyDataSource();
26 @State data_rmh: SearchRmhDescription[] = [] 35 @State data_rmh: SearchRmhDescription[] = []
27 - @State count:number = -1;  
28 - @State isLoading:boolean = false  
29 - @State hasMore:boolean = true  
30 - curPageNum:number = 1;  
31 - 36 + @State count: number = -1;
  37 + @State isLoading: boolean = false
  38 + @State hasMore: boolean = true
  39 + curPageNum: number = 1;
  40 + @State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "")
  41 + scroller: Scroller = new Scroller()
32 42
33 aboutToAppear(): void { 43 aboutToAppear(): void {
34 - if(this.searchType == "全部"){ 44 + if (this.searchType == "全部") {
35 this.searchType = "all" 45 this.searchType = "all"
36 - }else if(this.searchType == "精选"){ 46 + } else if (this.searchType == "精选") {
37 this.searchType = "cms" 47 this.searchType = "cms"
38 - }else if(this.searchType == "人民号"){ 48 + } else if (this.searchType == "人民号") {
39 this.searchType = "rmh" 49 this.searchType = "rmh"
40 - }else if(this.searchType == "视频"){ 50 + } else if (this.searchType == "视频") {
41 this.searchType = "video" 51 this.searchType = "video"
42 - }else if(this.searchType == "活动"){ 52 + } else if (this.searchType == "活动") {
43 this.searchType = "activity" 53 this.searchType = "activity"
44 } 54 }
45 55
@@ -47,93 +57,135 @@ export struct SearchResultContentComponent{ @@ -47,93 +57,135 @@ export struct SearchResultContentComponent{
47 this.getNewSearchResultData() 57 this.getNewSearchResultData()
48 } 58 }
49 59
50 - getNewSearchResultData(){ 60 + getNewSearchResultData() {
51 this.isLoading = true 61 this.isLoading = true
52 - if(this.hasMore){  
53 - SearcherAboutDataModel.getSearchResultListData("20",`${this.curPageNum}`,this.searchType,this.keywords,getContext(this)).then((value)=>{  
54 - if (!this.data || value.list.length == 0){ 62 + if (this.hasMore) {
  63 + SearcherAboutDataModel.getSearchResultListData("15", `${this.curPageNum}`, this.searchType, this.keywords,
  64 + getContext(this)).then((value) => {
  65 + if (!this.data || value.list.length == 0) {
55 this.hasMore = false 66 this.hasMore = false
56 this.isLoading = false 67 this.isLoading = false
57 - this.count = this.count===-1?0:this.count  
58 - }else{  
59 - if(value.list[0].dataList!=null){ 68 + this.count = this.count === -1 ? 0 : this.count
  69 + } else {
  70 + if (value.list[0].dataList != null) {
60 let data_temp: SearchRmhDescription[] = [] 71 let data_temp: SearchRmhDescription[] = []
  72 +
61 data_temp = value.list[0].dataList 73 data_temp = value.list[0].dataList
62 74
63 //TODO 查询创作者详情接口 75 //TODO 查询创作者详情接口
64 let request = new CreatorDetailRequestItem() 76 let request = new CreatorDetailRequestItem()
65 77
66 - data_temp.forEach((data)=>{ 78 + data_temp.forEach((data) => {
67 request.creatorIdList.push(data.creatorId) 79 request.creatorIdList.push(data.creatorId)
68 }) 80 })
69 81
70 - SearcherAboutDataModel.getCreatorDetailListData(request).then((value)=>{  
71 - if(value!=null && value.length>0){  
72 - data_temp.forEach((data)=>{  
73 - value.forEach((item)=>{  
74 - if(data.creatorId == item.creatorId){ 82 + SearcherAboutDataModel.getCreatorDetailListData(request).then((value) => {
  83 + if (value != null && value.length > 0) {
  84 + data_temp.forEach((data) => {
  85 + value.forEach((item) => {
  86 + if (data.creatorId == item.creatorId) {
75 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] 87 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0]
76 - data.mainControl = item.mainControl+"" 88 + data.mainControl = item.mainControl + ""
  89 +
  90 + if(data_temp.length === 1){
  91 + this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0]
  92 + this.bean.cnUserName = item.userName
  93 + this.bean.creatorId = item.creatorId
  94 + this.bean.authIcon = item.authIcon
  95 +
  96 + if (value[0].fansNum > 10000) {
  97 + let temp = (value[0].fansNum / 10000) + ""
  98 + let index = temp.indexOf('.')
  99 + if (index != -1) {
  100 + temp = temp.substring(0, index + 2)
  101 + } else {
  102 + temp = temp
  103 + }
  104 + this.bean.cnFansNum = temp + "万"
  105 + } else {
  106 + this.bean.cnFansNum = item.fansNum + ""
  107 + }
  108 + this.bean.introduction = item.introduction
  109 + this.bean.mainControl = item.mainControl
  110 + this.bean.banControl = item.banControl
  111 + this.bean.cnUserType = item.userType
  112 + this.bean.cnUserId = item.userId
  113 + }
77 } 114 }
78 }) 115 })
79 }) 116 })
80 } 117 }
81 - data_temp.forEach((data)=>{ 118 + data_temp.forEach((data) => {
82 this.data_rmh.push(data) 119 this.data_rmh.push(data)
83 }) 120 })
84 121
85 - }).catch((err:Error)=>{  
86 - console.log(TAG,JSON.stringify(err)) 122 + //只有一条创作者,获取 创作者信息
  123 + if (this.data_rmh.length === 1) {
  124 + if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){
  125 + //查询是否被关注
  126 + let status = new FollowListStatusRequestItem()
  127 + status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId))
  128 + MinePageDatasModel.getFollowListStatusData(status, getContext(this)).then((newValue) => {
  129 + this.bean.status = newValue[0].status
  130 + }).catch((err: Error) => {
  131 + console.log(TAG, "请求失败")
  132 + })
  133 + }else{
  134 + this.bean.status = ""
  135 + }
  136 + }
  137 + }).catch((err: Error) => {
  138 + console.log(TAG, JSON.stringify(err))
87 }) 139 })
88 } 140 }
89 this.getInteractData(value) 141 this.getInteractData(value)
90 } 142 }
91 - }).catch((err:Error)=>{  
92 - console.log(TAG,JSON.stringify(err)) 143 + }).catch((err: Error) => {
  144 + console.log(TAG, JSON.stringify(err))
93 this.isLoading = false 145 this.isLoading = false
94 - this.count = this.count===-1?0:this.count 146 + this.count = this.count === -1 ? 0 : this.count
95 }) 147 })
96 } 148 }
97 } 149 }
98 150
99 - getInteractData(resultData:SearchResultContentData){  
100 - if(resultData.list[0].dataList!=null){  
101 - resultData.list.splice(0,1) 151 + getInteractData(resultData: SearchResultContentData) {
  152 + if (resultData.list[0].dataList != null) {
  153 + resultData.list.splice(0, 1)
102 } 154 }
103 155
104 - let data : contentListParams = { 156 + let data: contentListParams = {
105 contentList: [] 157 contentList: []
106 } 158 }
107 - resultData.list.forEach((item)=>{ 159 + resultData.list.forEach((item) => {
108 data.contentList.push({ 160 data.contentList.push({
109 contentId: item.data.id + '', 161 contentId: item.data.id + '',
110 contentType: Number.parseInt(item.data.type) 162 contentType: Number.parseInt(item.data.type)
111 }) 163 })
112 }) 164 })
113 165
114 - SearcherAboutDataModel.getInteractListData(data,getContext(this)).then((newValue)=>{  
115 - newValue.forEach((item)=>{  
116 - resultData.list.forEach((data)=>{ 166 + SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => {
  167 + newValue.forEach((item) => {
  168 + resultData.list.forEach((data) => {
117 if (item.contentId == data.data.id) { 169 if (item.contentId == data.data.id) {
118 - data.data.collectNum = item.collectNum+""  
119 - data.data.commentNum = item.commentNum+""  
120 - data.data.likeNum = item.likeNum+""  
121 - data.data.readNum = item.readNum+""  
122 - data.data.shareNum = item.shareNum+"" 170 + data.data.collectNum = item.collectNum + ""
  171 + data.data.commentNum = item.commentNum + ""
  172 + data.data.likeNum = item.likeNum + ""
  173 + data.data.readNum = item.readNum + ""
  174 + data.data.shareNum = item.shareNum + ""
123 } 175 }
124 }) 176 })
125 }) 177 })
126 178
127 - resultData.list.forEach((value)=>{  
128 - let photos:FullColumnImgUrlDTO[] = []  
129 - if(value.data.appStyle === 4){  
130 - value.data.appStyleImages.split("&&").forEach((value)=>{  
131 - photos.push({url:value} as FullColumnImgUrlDTO) 179 + resultData.list.forEach((value) => {
  180 + let photos: FullColumnImgUrlDTO[] = []
  181 + if (value.data.appStyle === 4) {
  182 + value.data.appStyleImages.split("&&").forEach((value) => {
  183 + photos.push({ url: value } as FullColumnImgUrlDTO)
132 }) 184 })
133 } 185 }
134 186
135 - let contentDTO = this.dataTransform(value,photos);  
136 - if(contentDTO.appStyle != "13"){ 187 + let contentDTO = this.dataTransform(value, photos);
  188 + if (contentDTO.appStyle != "13") {
137 this.data.push(contentDTO) 189 this.data.push(contentDTO)
138 } 190 }
139 191
@@ -142,131 +194,189 @@ export struct SearchResultContentComponent{ @@ -142,131 +194,189 @@ export struct SearchResultContentComponent{
142 this.count = this.data.totalCount() 194 this.count = this.data.totalCount()
143 if (this.data.totalCount() < resultData.totalCount) { 195 if (this.data.totalCount() < resultData.totalCount) {
144 this.curPageNum++ 196 this.curPageNum++
145 - }else { 197 + } else {
146 this.hasMore = false 198 this.hasMore = false
147 } 199 }
148 this.isLoading = false 200 this.isLoading = false
149 201
150 - if(this.count === 0 && resultData.list.length > 0){ 202 + if (this.count === 0 && resultData.list.length > 0) {
151 this.count = -1 203 this.count = -1
152 - if(!this.isLoading){ 204 + if (!this.isLoading) {
153 //加载分页数据 205 //加载分页数据
154 this.getNewSearchResultData() 206 this.getNewSearchResultData()
155 } 207 }
156 - }else if(this.count <= 20 && resultData.list.length > 0){  
157 - if(!this.isLoading){ 208 + } else if (this.count <= 10 && resultData.list.length > 0) {
  209 + if (!this.isLoading) {
158 //加载分页数据 210 //加载分页数据
159 this.getNewSearchResultData() 211 this.getNewSearchResultData()
160 } 212 }
161 } 213 }
162 - }).catch((err:Error)=>{  
163 - console.log(TAG,"请求失败") 214 + }).catch((err: Error) => {
  215 + console.log(TAG, "请求失败")
164 this.isLoading = false 216 this.isLoading = false
165 - this.count = this.count===-1?0:this.count 217 + this.count = this.count === -1 ? 0 : this.count
166 }) 218 })
167 } 219 }
168 220
169 build() { 221 build() {
170 Column() { 222 Column() {
171 - if(this.count == 0){  
172 - ListHasNoMoreDataUI({style:2})  
173 - }else{  
174 - Column(){  
175 - if (this.data_rmh!=null && this.data_rmh.length > 0) {  
176 - //List  
177 - List({space:'8lpx'}) {  
178 - ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {  
179 - ListItem() {  
180 - SearchCreatorComponent({item:item})  
181 - }.onClick(()=>{  
182 - //TODO 跳转  
183 - })  
184 - .width('150lpx')  
185 - .height('100%')  
186 - })  
187 - 223 + if (this.count == 0) {
  224 + ListHasNoMoreDataUI({ style: 2 })
  225 + } else {
  226 + List() {
  227 + if (this.data_rmh != null && this.data_rmh.length > 0){
  228 + if (this.data_rmh.length === 1){
  229 + ListItem(){
  230 + FollowChildComponent({ data: this.bean, type: 1 })
  231 + }.padding({left:"31lpx",right:"31lpx"})
  232 + }else{
188 ListItem(){ 233 ListItem(){
189 Column(){ 234 Column(){
190 - Text("查看更多")  
191 - .width('19lpx')  
192 - .fontSize('19lpx')  
193 - .fontWeight('400lpx')  
194 - .lineHeight('27lpx')  
195 - .fontColor($r('app.color.color_9E9E9E'))  
196 - }.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'})  
197 - .height('180lpx')  
198 - .width('77lpx')  
199 - .backgroundColor($r('app.color.color_EDEDED'))  
200 - .justifyContent(FlexAlign.Center)  
201 -  
202 - }.height('100%')  
203 - .margin({left:'23lpx'})  
204 - .onClick(()=>{  
205 - let params: Params = {  
206 - pageID: this.keywords 235 + this.SearchListUI()
207 } 236 }
208 - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)  
209 - }) 237 + }
210 } 238 }
211 - .cachedCount(6)  
212 - .edgeEffect(EdgeEffect.Spring)  
213 - .scrollBar(BarState.Off)  
214 - .listDirection(Axis.Horizontal)  
215 - .width('100%')  
216 - .height('219lpx')  
217 -  
218 - Divider()  
219 - .width('100%')  
220 - .height('12lpx')  
221 - .color($r('app.color.color_F5F5F5'))  
222 - .strokeWidth('12lpx')  
223 } 239 }
224 - //List  
225 - List({ space: '6lpx' }) {  
226 - LazyForEach(this.data, (item: ContentDTO, index: number) => {  
227 - ListItem() {  
228 - Column(){  
229 - if(this.searchType == "activity"){  
230 - ActivityItemComponent({contentDTO:item})  
231 - }else{  
232 - CardParser({contentDTO:item})  
233 - }  
234 - if(index != this.data.totalCount()-1 ){  
235 - Divider()  
236 - .width('100%')  
237 - .height('1lpx')  
238 - .color($r('app.color.color_F5F5F5'))  
239 - .strokeWidth('1lpx')  
240 - } 240 + LazyForEach(this.data, (item: ContentDTO, index: number) => {
  241 + ListItem() {
  242 + Column() {
  243 + if (this.searchType == "activity") {
  244 + ActivityItemComponent({ contentDTO: item })
  245 + } else {
  246 + CardParser({ contentDTO: item })
  247 + }
  248 + if (index != this.data.totalCount() - 1) {
  249 + Divider()
  250 + .width('100%')
  251 + .height('1lpx')
  252 + .color($r('app.color.color_F5F5F5'))
  253 + .strokeWidth('1lpx')
241 } 254 }
242 - }  
243 - }, (item: ContentDTO, index: number) => index.toString())  
244 -  
245 - //没有更多数据 显示提示  
246 - if(!this.hasMore && this.data.totalCount() > 0){  
247 - ListItem(){  
248 - ListHasNoMoreDataUI()  
249 } 255 }
250 } 256 }
251 - }.cachedCount(6)  
252 - .edgeEffect(EdgeEffect.None)  
253 - .scrollBar(BarState.Off)  
254 - .layoutWeight(1)  
255 - .onReachEnd(()=>{  
256 - console.log(TAG,"触底了");  
257 - if(!this.isLoading){  
258 - //加载分页数据  
259 - this.getNewSearchResultData() 257 + }, (item: ContentDTO, index: number) => index.toString())
  258 +
  259 + //没有更多数据 显示提示
  260 + if (!this.hasMore && this.data.totalCount() > 0) {
  261 + ListItem() {
  262 + ListHasNoMoreDataUI()
260 } 263 }
261 - })  
262 - }.layoutWeight(1) 264 + }
  265 + }.cachedCount(10)
  266 + .edgeEffect(EdgeEffect.None)
  267 + .scrollBar(BarState.Off)
  268 + .onReachEnd(() => {
  269 + console.log(TAG, "触底了");
  270 + if (!this.isLoading) {
  271 + //加载分页数据
  272 + this.getNewSearchResultData()
  273 + }
  274 + })
263 } 275 }
264 } 276 }
265 .backgroundColor($r('app.color.white')) 277 .backgroundColor($r('app.color.white'))
266 - .layoutWeight(1)  
267 .width('100%') 278 .width('100%')
268 } 279 }
269 280
  281 + @Builder
  282 + multiCreatorUI() {
  283 + Column() {
  284 + List() {
  285 + ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
  286 + ListItem() {
  287 + SearchCreatorComponent({ item: item })
  288 + }
  289 + .width('150lpx')
  290 + .height('100%')
  291 + })
  292 +
  293 + ListItem() {
  294 + Column() {
  295 + Text("查看更多")
  296 + .width('19lpx')
  297 + .fontSize('19lpx')
  298 + .fontWeight('400lpx')
  299 + .lineHeight('27lpx')
  300 + .fontColor($r('app.color.color_9E9E9E'))
  301 + }
  302 + .borderRadius({ topLeft: '4lpx', bottomLeft: '4lpx' })
  303 + .height('180lpx')
  304 + .width('77lpx')
  305 + .backgroundColor($r('app.color.color_EDEDED'))
  306 + .justifyContent(FlexAlign.Center)
  307 +
  308 + }.height('100%')
  309 + .margin({ left: '23lpx' })
  310 + .onClick(() => {
  311 + let params: Params = {
  312 + pageID: this.keywords
  313 + }
  314 + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params)
  315 + })
  316 + }
  317 + .cachedCount(6)
  318 + .edgeEffect(EdgeEffect.None)
  319 + .scrollBar(BarState.Off)
  320 + .listDirection(Axis.Horizontal)
  321 + .width('100%')
  322 + .height('219lpx')
  323 +
  324 + Divider()
  325 + .width('100%')
  326 + .height('12lpx')
  327 + .color($r('app.color.color_F5F5F5'))
  328 + .strokeWidth('12lpx')
  329 + }
  330 + }
  331 +
  332 + @Builder
  333 + SearchListUI() {
  334 + List({space:'8lpx'}) {
  335 + ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
  336 + ListItem() {
  337 + SearchCreatorComponent({item:item})
  338 + }
  339 + .width('150lpx')
  340 + .height('100%')
  341 + })
  342 +
  343 + ListItem(){
  344 + Column(){
  345 + Text("查看更多")
  346 + .width('19lpx')
  347 + .fontSize('19lpx')
  348 + .fontWeight('400lpx')
  349 + .lineHeight('27lpx')
  350 + .fontColor($r('app.color.color_9E9E9E'))
  351 + }.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'})
  352 + .height('180lpx')
  353 + .width('77lpx')
  354 + .backgroundColor($r('app.color.color_EDEDED'))
  355 + .justifyContent(FlexAlign.Center)
  356 +
  357 + }.height('100%')
  358 + .margin({left:'23lpx'})
  359 + .onClick(()=>{
  360 + let params: Params = {
  361 + pageID: this.keywords
  362 + }
  363 + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)
  364 + })
  365 + }
  366 + .cachedCount(6)
  367 + .edgeEffect(EdgeEffect.None)
  368 + .scrollBar(BarState.Off)
  369 + .listDirection(Axis.Horizontal)
  370 + .width('100%')
  371 + .height('219lpx')
  372 +
  373 + Divider()
  374 + .width('100%')
  375 + .height('12lpx')
  376 + .color($r('app.color.color_F5F5F5'))
  377 + .strokeWidth('12lpx')
  378 + }
  379 +
270 private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { 380 private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
271 let contentDTO = new ContentDTO(); 381 let contentDTO = new ContentDTO();
272 contentDTO.appStyle = value.data.appStyle + "" 382 contentDTO.appStyle = value.data.appStyle + ""
@@ -8,7 +8,7 @@ const TAG = 'AboutPageUI'; @@ -8,7 +8,7 @@ const TAG = 'AboutPageUI';
8 8
9 @Component 9 @Component
10 export struct AboutPageUI { 10 export struct AboutPageUI {
11 - @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; 11 + @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议','收集个人信息明示清单','第三方信息共享清单'];
12 @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' 12 @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.'
13 @State version: string = '版本号:v' 13 @State version: string = '版本号:v'
14 dialogController: CustomDialogController = new CustomDialogController({ 14 dialogController: CustomDialogController = new CustomDialogController({
@@ -76,9 +76,15 @@ export struct AboutPageUI { @@ -76,9 +76,15 @@ export struct AboutPageUI {
76 if (index == 0) { 76 if (index == 0) {
77 let bean = { contentID: "2", pageID: "" } as Params 77 let bean = { contentID: "2", pageID: "" } as Params
78 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 78 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
79 - } else { 79 + } else if(index == 1){
80 let bean = { contentID: "1", pageID: "" } as Params 80 let bean = { contentID: "1", pageID: "" } as Params
81 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 81 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
  82 + }else if(index == 2){
  83 + let bean = { contentID: "5", pageID: "" } as Params
  84 + WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
  85 + }else if(index == 3){
  86 + let bean = { contentID: "6", pageID: "" } as Params
  87 + WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
82 } 88 }
83 }) 89 })
84 }) 90 })
@@ -14,6 +14,7 @@ import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunc @@ -14,6 +14,7 @@ import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunc
14 import common from '@ohos.app.ability.common'; 14 import common from '@ohos.app.ability.common';
15 import dataPreferences from '@ohos.data.preferences'; 15 import dataPreferences from '@ohos.data.preferences';
16 import { TitleBackComponent } from './TitleBackComponent'; 16 import { TitleBackComponent } from './TitleBackComponent';
  17 +import { MyCustomDialog } from '../reusable/MyCustomDialog';
17 18
18 @Component 19 @Component
19 export struct MineSettingComponent { 20 export struct MineSettingComponent {
@@ -23,17 +24,22 @@ export struct MineSettingComponent { @@ -23,17 +24,22 @@ export struct MineSettingComponent {
23 @State cacheSize: number = 0 24 @State cacheSize: number = 0
24 @State accountState:boolean=false 25 @State accountState:boolean=false
25 preferences: dataPreferences.Preferences | null = null; 26 preferences: dataPreferences.Preferences | null = null;
  27 +
26 dialogController: CustomDialogController = new CustomDialogController({ 28 dialogController: CustomDialogController = new CustomDialogController({
27 - builder: CustomCacheDialog({ 29 + builder: MyCustomDialog({
28 cancel: () => { 30 cancel: () => {
29 -  
30 }, 31 },
31 confirm: () => { 32 confirm: () => {
32 this.deleteCache() 33 this.deleteCache()
33 - } 34 + },
  35 + title: "清理缓存",
  36 + tipValue:"是否确认清理此App的缓存",
  37 + tipShow:true,
  38 + leftTextColor:$r('app.color.color_648DF2')
34 }), 39 }),
35 - customStyle: true,  
36 - alignment: DialogAlignment.Center 40 + autoCancel: true,
  41 + alignment: DialogAlignment.Center,
  42 + customStyle: true
37 }) 43 })
38 aboutToAppear() { 44 aboutToAppear() {
39 // 获取设置页面数据 45 // 获取设置页面数据
@@ -16,29 +16,42 @@ export struct newsSkeleton { @@ -16,29 +16,42 @@ export struct newsSkeleton {
16 Column() { 16 Column() {
17 Image($r('app.media.peopleSeleton')).width('100%').height(47)// 后缀名不能省略 17 Image($r('app.media.peopleSeleton')).width('100%').height(47)// 后缀名不能省略
18 .interpolation(ImageInterpolation.High) 18 .interpolation(ImageInterpolation.High)
19 - textArea('100%', 9)  
20 - }.width('72.00%').alignItems(HorizontalAlign.Start).margin({ right: 5 }) 19 + textArea('100%', 8)
  20 + }
  21 + .width(124)
  22 + .alignItems(HorizontalAlign.Start)
  23 + .margin({ right: 5 })
21 24
22 Column() { 25 Column() {
23 - textArea(27, 25)  
24 - textArea(27, 4)  
25 - textArea(27, 20) 26 + Row()
  27 + .width(27)
  28 + .height(25)
  29 + .backgroundColor('#FFF5F5F5')
  30 + Row()
  31 + .width(27)
  32 + .height(4)
  33 + .backgroundColor('#FFF5F5F5')
  34 + .margin({ top: 3, bottom: 3 })
  35 + Row()
  36 + .width(27)
  37 + .height(20)
  38 + .backgroundColor('#FFF5F5F5')
  39 + // textArea(27, 25)
  40 + // textArea(27, 4)
  41 + // textArea(27, 20)
26 } 42 }
27 .border({ width: 1 }) 43 .border({ width: 1 })
28 .borderColor('#FFF5F5F5') 44 .borderColor('#FFF5F5F5')
29 .padding({ 45 .padding({
30 - right: 2,  
31 - left: 2,  
32 - top: 0,  
33 - bottom: 2 46 + right: 5,
  47 + left: 5,
  48 + top: 4,
  49 + bottom: 4
34 }) 50 })
35 - .justifyContent(FlexAlign.SpaceEvenly) 51 + .justifyContent(FlexAlign.SpaceBetween)
36 .alignItems(HorizontalAlign.Start) 52 .alignItems(HorizontalAlign.Start)
37 } 53 }
38 - .justifyContent(FlexAlign.SpaceBetween)  
39 - .width('98%')  
40 -  
41 - // .height(64) 54 + .width('100%')
42 55
43 BoxAndLine().width('100%') 56 BoxAndLine().width('100%')
44 BoxAndBox({ firstBoxNumber: '65%', boxHeight: 100 }) 57 BoxAndBox({ firstBoxNumber: '65%', boxHeight: 100 })
@@ -48,24 +61,27 @@ export struct newsSkeleton { @@ -48,24 +61,27 @@ export struct newsSkeleton {
48 61
49 BoxAndBox({ firstBoxNumber: '30%', boxHeight: 51 }) 62 BoxAndBox({ firstBoxNumber: '30%', boxHeight: 51 })
50 63
51 - }.width('45%')  
52 - .opacity(1)  
53 - .align(Alignment.Start)  
54 - .alignItems(HorizontalAlign.Start) 64 + }
  65 + .width('50%')
  66 + .margin({ right: 5 })
55 67
56 Column() { 68 Column() {
57 Column() { 69 Column() {
58 textArea('100%', 13) 70 textArea('100%', 13)
59 }.width('100%') 71 }.width('100%')
60 72
61 - BoxAndLine() 73 + Column() {
  74 + textArea('100%', 136)
  75 + textArea('100%', 13)
  76 + textArea('80%', 13)
  77 + }.width('100%').alignItems(HorizontalAlign.Start)
62 78
63 Column() { 79 Column() {
64 - textArea('95%', 126) 80 + textArea('100%', 126)
65 } 81 }
66 82
67 Column() { 83 Column() {
68 - textArea('95%', 13) 84 + textArea('100%', 13)
69 } 85 }
70 86
71 Row() { 87 Row() {
@@ -76,24 +92,28 @@ export struct newsSkeleton { @@ -76,24 +92,28 @@ export struct newsSkeleton {
76 Column() { 92 Column() {
77 textArea('100%', 30) 93 textArea('100%', 30)
78 }.layoutWeight(1) 94 }.layoutWeight(1)
79 - }.width('95%').justifyContent(FlexAlign.SpaceBetween) 95 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
80 96
81 Column() { 97 Column() {
82 - textArea('95%', 100) 98 + textArea('100%', 100)
83 } 99 }
84 - }.width('45%') 100 + }
  101 + .width('50%')
85 } 102 }
86 .justifyContent(FlexAlign.SpaceBetween) 103 .justifyContent(FlexAlign.SpaceBetween)
87 .backgroundColor(Color.White) 104 .backgroundColor(Color.White)
88 .padding({ 105 .padding({
89 - top: 5,  
90 - bottom: 5,  
91 - right: 5,  
92 - left: 5 106 + top: 15,
  107 + bottom: 15,
  108 + right: 15,
  109 + left: 15
93 }) 110 })
  111 +
  112 + Column().backgroundColor('#CBCBCB').height(5).width(339)
  113 + Column().backgroundColor('#909090').height(5).width(326)
94 } 114 }
95 .width('100%') 115 .width('100%')
96 - 116 + .padding({ right: 10, left: 10 })
97 } 117 }
98 .height('100%') 118 .height('100%')
99 119
@@ -107,7 +127,7 @@ struct BoxAndLine { @@ -107,7 +127,7 @@ struct BoxAndLine {
107 textArea('100%', 130) 127 textArea('100%', 130)
108 textArea('100%', 13) 128 textArea('100%', 13)
109 textArea('80%', 13) 129 textArea('80%', 13)
110 - }.width('98%').alignItems(HorizontalAlign.Start) 130 + }.alignItems(HorizontalAlign.Start)
111 } 131 }
112 } 132 }
113 133
@@ -140,18 +160,5 @@ function textArea(width: number | Resource | string = '100%', height: number | R @@ -140,18 +160,5 @@ function textArea(width: number | Resource | string = '100%', height: number | R
140 // .borderRadius(5) 160 // .borderRadius(5)
141 } 161 }
142 162
143 -// 全局公共样式  
144 -@Styles  
145 -function SkeletonStyle() {  
146 - .padding({ right: 14, left: 14 })  
147 - .width('100%')  
148 - .margin({ top: 5 })  
149 -}  
150 163
151 -@Extend(Column)  
152 -function RightStyle() {  
153 - .alignItems(HorizontalAlign.Start)  
154 - .justifyContent(FlexAlign.SpaceAround)  
155 - .height('100%')  
156 -}  
157 164
1 -import { Logger } from 'wdKit/Index' 1 +import { Logger, NumberFormatterUtils } from 'wdKit/Index'
2 import { LikeViewModel } from '../../viewmodel/LikeViewModel' 2 import { LikeViewModel } from '../../viewmodel/LikeViewModel'
3 import { SPHelper } from 'wdKit'; 3 import { SPHelper } from 'wdKit';
4 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 4 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
  6 +import { ContentDetailDTO } from 'wdBean/Index';
6 7
7 8
8 const TAG = 'LikeComponent'; 9 const TAG = 'LikeComponent';
9 10
  11 +interface ILikeStyleResp {
  12 + url: Resource;
  13 + name: string;
  14 +}
  15 +
10 @Component 16 @Component
11 export struct LikeComponent { 17 export struct LikeComponent {
  18 + @Consume contentDetailData: ContentDetailDTO
  19 + @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
12 @State likeStatus: boolean = false 20 @State likeStatus: boolean = false
13 viewModel: LikeViewModel = new LikeViewModel() 21 viewModel: LikeViewModel = new LikeViewModel()
14 @Prop data: Record<string, string> 22 @Prop data: Record<string, string>
15 enableBtn = true 23 enableBtn = true
16 - componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口  
17 - styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 24 + componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
  25 + styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
18 @State likeCount: number = 0 //点赞数 26 @State likeCount: number = 0 //点赞数
19 27
20 //上层传值 样例 28 //上层传值 样例
@@ -37,105 +45,202 @@ export struct LikeComponent { @@ -37,105 +45,202 @@ export struct LikeComponent {
37 } 45 }
38 46
39 build() { 47 build() {
40 - if (this.componentType == 2){ 48 +
  49 + if (this.componentType == 2) {
41 //2: 新闻页中间位置样式 50 //2: 新闻页中间位置样式
42 - Column() { 51 + this.likeCompStyle2()
  52 + } else if (this.componentType == 3) {
  53 + this.likeCompStyle3()
  54 + } else if (this.componentType == 4) {
  55 + // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量
  56 + this.likeCompStyle4()
  57 + } else {
  58 + //1: 底部栏目样式 默认样式
  59 + this.likeCompStyle1()
  60 + }
  61 + }
43 62
44 - Button(){  
45 -  
46 - Row(){  
47 - Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))  
48 - .width(20)  
49 - .height(20)  
50 - Text(this.likeCount.toString())  
51 - .height(20)  
52 - .margin({  
53 - right: 0,  
54 - left: 4  
55 - })  
56 - .fontColor(this.likeStatus ? '#ED2800' : '#222222')  
57 - .fontSize('16')  
58 - }  
59 - .justifyContent(FlexAlign.Center)  
60 - .width('100%')  
61 - .height('100%') 63 + /**
  64 + * 将点赞样式转换为icon
  65 + */
  66 + transLikeStyle(): ILikeStyleResp {
  67 + if (this.likesStyle === 1) {
  68 + return {
  69 + url: this.likeStatus ? $r(`app.media.ic_like_check`) :
  70 + this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`),
  71 + name: '赞'
  72 + }
  73 + } else if (this.likesStyle === 2) {
  74 + return {
  75 + url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
  76 + name: '祈祷'
  77 + }
  78 + } else if (this.likesStyle === 3) {
  79 + return {
  80 + url: this.likeStatus ? $r(`app.media.ic_candle_check`) :
  81 + $r(`app.media.ic_candle_uncheck`),
  82 + name: '默哀'
  83 + }
  84 + }
  85 + return {
  86 + url: this.likeStatus ? $r(`app.media.ic_like_check`) :
  87 + this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`),
  88 + name: '点赞'
  89 + }
  90 + }
62 91
  92 + @Builder
  93 + likeCompStyle2() {
  94 + //2: 新闻页中间位置样式
  95 + Column() {
  96 + Button() {
  97 + Row() {
  98 + Image(this.transLikeStyle().url)
  99 + .width(20)
  100 + .height(20)
  101 + Text(this.likeCount.toString())
  102 + .height(20)
  103 + .margin({
  104 + right: 0,
  105 + left: 4
  106 + })
  107 + .fontColor(this.likeStatus ? '#ED2800' : '#222222')
  108 + .fontSize('16')
63 } 109 }
  110 + .justifyContent(FlexAlign.Center)
64 .width('100%') 111 .width('100%')
65 .height('100%') 112 .height('100%')
66 - .backgroundColor(Color.White)  
67 - .type(ButtonType.Capsule)  
68 - .borderColor('#EDEDED')  
69 - .borderRadius(20)  
70 - .borderWidth(1)  
71 - .onClick(()=>{  
72 - this.clickButtonEvent()  
73 - })  
74 - }  
75 - .width(154)  
76 - .height(40)  
77 - }else if(this.componentType == 3){  
78 - Row(){  
79 - Image(this.likeStatus ? $r('app.media.icon_like_select') : this.styleType == 1 ? $r('app.media.CarderInteraction_like') :  
80 - $r('app.media.icon_like_default_white'))  
81 - .width(18)  
82 - .height(18)  
83 - Text(this.likeCount >0?this.likeCount.toString(): '点赞')  
84 - .margin({left:4})  
85 - .fontSize(14)  
86 - .fontColor(this.likeStatus ? '#ED2800' : '#666666') 113 +
87 } 114 }
88 - .justifyContent(FlexAlign.Center) 115 + .width('100%')
  116 + .height('100%')
  117 + .backgroundColor(Color.White)
  118 + .type(ButtonType.Capsule)
  119 + .borderColor('#EDEDED')
  120 + .borderRadius(20)
  121 + .borderWidth(1)
89 .onClick(() => { 122 .onClick(() => {
90 this.clickButtonEvent() 123 this.clickButtonEvent()
91 }) 124 })
92 - }else{  
93 - //1: 底部栏目样式 默认样式 125 + }
  126 + .width(154)
  127 + .height(40)
  128 + }
  129 +
  130 + @Builder
  131 + likeCompStyle3() {
  132 + Row() {
  133 + Image(this.transLikeStyle().url)
  134 + .width(18)
  135 + .height(18)
  136 + // Text(this.likeStatus ? '已赞' : '点赞')
  137 + Text(this.likeCount > 0 ? this.likeCount.toString() : '点赞')
  138 + .margin({ left: 4 })
  139 + .fontSize(14)
  140 + .fontColor(this.likeStatus ? '#ED2800' : '#666666')
  141 + }
  142 + .justifyContent(FlexAlign.Center)
  143 + .onClick(() => {
  144 + this.clickButtonEvent()
  145 + })
  146 + }
  147 +
  148 + @Builder
  149 + likeCompStyle1() {
  150 + //1: 底部栏目样式 默认样式
  151 + Column() {
  152 + // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
  153 + Image(this.transLikeStyle().url)
  154 + .width(24)
  155 + .height(24)
  156 + .onClick(() => {
  157 + this.clickButtonEvent()
  158 + })
  159 + }.width(24).height(24)
  160 + }
  161 +
  162 + @Builder
  163 + likeCompStyle4() {
  164 + Stack({ alignContent: Alignment.Bottom }) {
94 Column() { 165 Column() {
95 - // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))  
96 - Image(this.likeStatus ? $r('app.media.icon_like_select') : this.styleType == 1 ? $r('app.media.icon_like_default') :  
97 - $r('app.media.icon_like_default_white')) 166 + Image(this.transLikeStyle().url)
98 .width(24) 167 .width(24)
99 .height(24) 168 .height(24)
100 .onClick(() => { 169 .onClick(() => {
101 this.clickButtonEvent() 170 this.clickButtonEvent()
102 }) 171 })
103 - }.width(24).height(24) 172 + }
  173 + .justifyContent(FlexAlign.Center)
  174 + .width(36)
  175 + .height(36)
  176 + .borderRadius(18)
  177 + .backgroundColor('#FFF5F5F5')
  178 +
  179 +
  180 + Row() {
  181 + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))
  182 + .fontSize(8)
  183 + .fontColor(Color.White)
  184 + .padding({ left: 4, right: 2 })
  185 + }
  186 + .height(12)
  187 + .alignItems(VerticalAlign.Center)
  188 + .position({ x: '100%', })
  189 + .markAnchor({ x: '100%' })
  190 + .backgroundImage($r('app.media.ic_like_back'))
  191 + .backgroundImageSize(ImageSize.Auto)
  192 + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
104 } 193 }
  194 + .width(36)
  195 + .height(42)
105 196
106 } 197 }
107 198
108 - async clickButtonEvent(){ 199 + async clickButtonEvent() {
  200 + console.log(TAG, '点赞点击')
109 // 未登录,跳转登录 201 // 未登录,跳转登录
110 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') 202 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
111 if (!user_id) { 203 if (!user_id) {
  204 + console.log(TAG, '点赞点击,未登录')
112 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 205 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
113 return 206 return
114 } 207 }
115 208
116 - if (!this.enableBtn) {  
117 - return  
118 - }  
119 - if (this.likeStatus) {  
120 - //1  
121 - this.executeLike('0')  
122 - } else {  
123 - //0  
124 - this.executeLike('1')  
125 - } 209 + // if (!this.enableBtn) {
  210 + // return
  211 + // }
  212 + this.executeLike(this.likeStatus ? '0' : '1')
126 213
127 } 214 }
128 215
129 executeLike(status: string) { 216 executeLike(status: string) {
  217 + console.log(TAG, '点赞接口调用', status)
130 this.data['status'] = status 218 this.data['status'] = status
  219 + this.data['contentId'] = this.contentDetailData?.newsId + ''
  220 + this.data['contentType'] = this.contentDetailData?.newsType + ''
  221 +
131 this.viewModel.executeLike2(this.data).then(() => { 222 this.viewModel.executeLike2(this.data).then(() => {
132 - this.likeStatus = !this.likeStatus  
133 - //点赞和取消点赞成功后更新点赞数  
134 - if(this.likeStatus){  
135 - this.likeCount ++  
136 - }else {  
137 - this.likeCount -- 223 +
  224 + console.log(TAG, '点赞接口调用成功')
  225 +
  226 + // 直播点赞一直增加
  227 + if (this.contentDetailData.liveInfo) {
  228 + this.likeStatus = true
  229 + this.likeCount++
  230 + } else {
  231 + this.likeStatus = !this.likeStatus
  232 + //点赞和取消点赞成功后更新点赞数
  233 + if (this.likeStatus) {
  234 + this.likeCount++
  235 + } else {
  236 + this.likeCount--
  237 + }
  238 + }
  239 +
  240 + if (this.likeCount <= 0) {
  241 + this.likeCount = 0
138 } 242 }
  243 +
139 this.enableBtn = true 244 this.enableBtn = true
140 }).catch(() => { 245 }).catch(() => {
141 this.enableBtn = true 246 this.enableBtn = true
@@ -144,9 +249,9 @@ export struct LikeComponent { @@ -144,9 +249,9 @@ export struct LikeComponent {
144 249
145 getLikeStatus() { 250 getLikeStatus() {
146 this.viewModel.getLikeStatus(this.data).then((data) => { 251 this.viewModel.getLikeStatus(this.data).then((data) => {
147 - if (data && data['data'].length && data['data'][0]['likeStatus']) { 252 + if (data && data['data'].length && data['data'][0]['likeStatus']) {
148 this.likeStatus = data['data'][0]['likeStatus'] 253 this.likeStatus = data['data'][0]['likeStatus']
149 - }else { 254 + } else {
150 this.likeStatus = false 255 this.likeStatus = false
151 } 256 }
152 }).catch(() => { 257 }).catch(() => {
@@ -159,14 +264,11 @@ export struct LikeComponent { @@ -159,14 +264,11 @@ export struct LikeComponent {
159 this.viewModel.getLikeCount(this.data).then((data) => { 264 this.viewModel.getLikeCount(this.data).then((data) => {
160 if (data && data['data']) { 265 if (data && data['data']) {
161 this.likeCount = data['data']['likeNum'] 266 this.likeCount = data['data']['likeNum']
162 - }else { 267 + } else {
163 this.likeCount = 0 268 this.likeCount = 0
164 } 269 }
165 }).catch(() => { 270 }).catch(() => {
166 this.likeCount = 0 271 this.likeCount = 0
167 }) 272 })
168 } 273 }
169 -  
170 -  
171 -  
172 } 274 }
@@ -33,7 +33,7 @@ const TAG = 'OperRowListView'; @@ -33,7 +33,7 @@ const TAG = 'OperRowListView';
33 * 2、(非必传) operationButtonList---组件展示条件, 33 * 2、(非必传) operationButtonList---组件展示条件,
34 * ['comment', 'like', 'collect', 'share'],需要展示什么传什么 34 * ['comment', 'like', 'collect', 'share'],需要展示什么传什么
35 * comment--评论;like--点赞;collect--收藏;listen--音频;share--分享; 35 * comment--评论;like--点赞;collect--收藏;listen--音频;share--分享;
36 - * 36 + * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData
37 * 传值示例: 37 * 传值示例:
38 OperRowListView({ 38 OperRowListView({
39 contentDetailData: this.contentDetailData[0], 39 contentDetailData: this.contentDetailData[0],
@@ -48,22 +48,35 @@ export struct OperRowListView { @@ -48,22 +48,35 @@ export struct OperRowListView {
48 private onCommentFocus: () => void = () => { 48 private onCommentFocus: () => void = () => {
49 } 49 }
50 @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 50 @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
  51 + /**
  52 + * 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断
  53 + * 1:底部栏目样式
  54 + * 2:新闻页中间位置样式
  55 + * 3:动态Tab内容下的互动入口
  56 + * 4:视频详情页
  57 + * 5:横屏直播详情页
  58 + * 6:竖屏直播详情页
  59 + * 7:图集详情页
  60 + */
  61 + @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
  62 + @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
51 @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 63 @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件
  64 + @State needLike: boolean = true
52 @ObjectLink publishCommentModel: publishCommentModel 65 @ObjectLink publishCommentModel: publishCommentModel
53 @State styleType: number = 1 66 @State styleType: number = 1
  67 + @State showCommentIcon: boolean = true
  68 + @State bgColor: ResourceColor = Color.White
54 @State interactData: InteractDataDTO = {} as InteractDataDTO 69 @State interactData: InteractDataDTO = {} as InteractDataDTO
55 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 70 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
56 @State likeBean: Record<string, string> = {} 71 @State likeBean: Record<string, string> = {}
57 @State audioUrl: string = '' 72 @State audioUrl: string = ''
58 - @State bgColor: ResourceColor = Color.White  
59 - @State showCommentIcon: boolean = true  
60 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 73 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
61 - needLike: boolean = true  
62 74
63 async aboutToAppear() { 75 async aboutToAppear() {
64 console.info(TAG, '22222----', this.styleType) 76 console.info(TAG, '22222----', this.styleType)
65 console.info(TAG, '3333----', this.needLike) 77 console.info(TAG, '3333----', this.needLike)
66 this.handleStyle() 78 this.handleStyle()
  79 + this.onDetailUpdated()
67 } 80 }
68 81
69 async onDetailUpdated() { 82 async onDetailUpdated() {
@@ -146,8 +159,8 @@ export struct OperRowListView { @@ -146,8 +159,8 @@ export struct OperRowListView {
146 .backgroundColor(this.bgColor) 159 .backgroundColor(this.bgColor)
147 .padding({ 160 .padding({
148 top: 10, 161 top: 10,
149 - // bottom: `${this.bottomSafeHeight}px`  
150 - bottom: 50 162 + bottom: `${this.bottomSafeHeight}px`
  163 + // bottom: 50
151 }) 164 })
152 } 165 }
153 166
@@ -183,15 +196,18 @@ export struct OperRowListView { @@ -183,15 +196,18 @@ export struct OperRowListView {
183 */ 196 */
184 @Builder 197 @Builder
185 builderLike() { 198 builderLike() {
  199 + // 点赞根据字段判断是否显示待添加
186 Column() { 200 Column() {
187 - if (this.likeBean?.contentId) {  
188 - LikeComponent({  
189 - data: this.likeBean,  
190 - styleType: this.styleType  
191 - })  
192 - } 201 + // if (this.likeBean?.contentId) {
  202 + LikeComponent({
  203 + data: this.likeBean,
  204 + styleType: this.styleType,
  205 + componentType: this.componentType
  206 + })
  207 + // }
193 } 208 }
194 .width(42) 209 .width(42)
  210 + .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None)
195 } 211 }
196 212
197 /** 213 /**
@@ -301,10 +317,11 @@ export struct OperRowListView { @@ -301,10 +317,11 @@ export struct OperRowListView {
301 * 收藏、取消收藏 317 * 收藏、取消收藏
302 */ 318 */
303 async toggleCollectStatus() { 319 async toggleCollectStatus() {
304 - // console.log(TAG, '收藏--') 320 + console.log(TAG, '收藏点击')
305 // 未登录,跳转登录 321 // 未登录,跳转登录
306 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') 322 const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
307 if (!user_id) { 323 if (!user_id) {
  324 + console.log(TAG, '收藏点击,用户未登录')
308 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 325 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
309 return 326 return
310 } 327 }
@@ -316,7 +333,9 @@ export struct OperRowListView { @@ -316,7 +333,9 @@ export struct OperRowListView {
316 }], 333 }],
317 334
318 } 335 }
  336 + console.log(TAG, '收藏点击', JSON.stringify(params))
319 PageRepository.postExecuteCollectRecord(params).then(res => { 337 PageRepository.postExecuteCollectRecord(params).then(res => {
  338 + console.log(TAG, '收藏点击 res', JSON.stringify(res))
320 if (this.newsStatusOfUser) { 339 if (this.newsStatusOfUser) {
321 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 340 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
322 if (this.newsStatusOfUser.collectStatus === 1) { 341 if (this.newsStatusOfUser.collectStatus === 1) {
@@ -339,7 +358,9 @@ export struct OperRowListView { @@ -339,7 +358,9 @@ export struct OperRowListView {
339 contentType: this.contentDetailData?.newsType, 358 contentType: this.contentDetailData?.newsType,
340 }] 359 }]
341 } 360 }
  361 + console.log(TAG, '点赞点击', JSON.stringify(params))
342 PageRepository.getContentInteract(params).then(res => { 362 PageRepository.getContentInteract(params).then(res => {
  363 + console.log(TAG, '点赞点击 res', JSON.stringify(res))
343 if (res.data) { 364 if (res.data) {
344 this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) 365 this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum)
345 this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) 366 this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
@@ -8,7 +8,6 @@ export struct ENewspaperCalendarDialog { @@ -8,7 +8,6 @@ export struct ENewspaperCalendarDialog {
8 onDateChange?: (date: RMCalendarBean) => void 8 onDateChange?: (date: RMCalendarBean) => void
9 //当前选择的日期标记 9 //当前选择的日期标记
10 @Prop selectDate: Date = new Date() 10 @Prop selectDate: Date = new Date()
11 -  
12 build() { 11 build() {
13 RMCalendar({ 12 RMCalendar({
14 // 开始日期 13 // 开始日期
@@ -48,6 +48,7 @@ export struct ENewspaperPageDialog { @@ -48,6 +48,7 @@ export struct ENewspaperPageDialog {
48 .justifyContent(FlexAlign.Center) 48 .justifyContent(FlexAlign.Center)
49 .width(30) 49 .width(30)
50 .height(30) 50 .height(30)
  51 + .borderRadius(3)
51 .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800')) 52 .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800'))
52 .onClick((event: ClickEvent) => { 53 .onClick((event: ClickEvent) => {
53 this.currentPageNum = item.pageNum 54 this.currentPageNum = item.pageNum