王士厅
Showing 92 changed files with 2071 additions and 710 deletions

Too many changes to show.

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

@@ -48,4 +48,8 @@ export class SpConstants{ @@ -48,4 +48,8 @@ export class SpConstants{
48 //游客状态下首次评论时间 48 //游客状态下首次评论时间
49 static FIRSTCOMMENTTIME = 'firstCommentTime' 49 static FIRSTCOMMENTTIME = 'firstCommentTime'
50 static TOURIST_NICK_NAME = 'touristNickName' 50 static TOURIST_NICK_NAME = 'touristNickName'
  51 +
  52 + // 个推推送
  53 + static GETUI_PUSH_CID = "cid"
  54 + static GETUI_PUSH_DEVICE_TOKEN = "deviceToken"
51 } 55 }
@@ -39,7 +39,7 @@ export const enum CompStyle { @@ -39,7 +39,7 @@ export const enum CompStyle {
39 Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡 39 Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡
40 Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡 40 Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡
41 Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡 41 Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡
42 - Zh_Grid_Layout_02 = 'Zh_Grid_Layout-02', //7 双列流小视频,一行两图卡 42 + Zh_Grid_Layout_02 = 'Zh_Grid_Layout-02', //7 双列流小视频,一行两图卡 ->标题
43 Zh_Grid_Layout_03 = 'Zh_Grid_Layout-03', //11 金刚位卡 43 Zh_Grid_Layout_03 = 'Zh_Grid_Layout-03', //11 金刚位卡
44 Card_01 = '1', // 小图卡 44 Card_01 = '1', // 小图卡
45 Card_02 = '2', // 大图卡 45 Card_02 = '2', // 大图卡
@@ -80,5 +80,7 @@ export const enum CompStyle { @@ -80,5 +80,7 @@ export const enum CompStyle {
80 /** 80 /**
81 * 本地稿件和组件样式 81 * 本地稿件和组件样式
82 */ 82 */
83 - Card_Comp_Adv = 'card_comp_adv', // 83 + Card_Comp_Adv = 'card_comp_adv', // 信息流广告稿件
  84 +
  85 + Card_Comp_Zh_Grid_Layout_02 = 'Card_Comp_Zh_Grid_Layout-02', // 一行两列卡业务内容
84 } 86 }
@@ -133,10 +133,15 @@ export class NetworkManager { @@ -133,10 +133,15 @@ export class NetworkManager {
133 * 同步获取网络类型,耗时 133 * 同步获取网络类型,耗时
134 */ 134 */
135 public getNetTypeSync(): NetworkType { 135 public getNetTypeSync(): NetworkType {
  136 + try {
136 let netHandle = connection.getDefaultNetSync(); 137 let netHandle = connection.getDefaultNetSync();
137 let netCapabilities = connection.getNetCapabilitiesSync(netHandle) 138 let netCapabilities = connection.getNetCapabilitiesSync(netHandle)
138 this.reset(netCapabilities.bearerTypes) 139 this.reset(netCapabilities.bearerTypes)
139 return this.networkType; 140 return this.networkType;
  141 + } catch (e) {
  142 + Logger.error(TAG, 'getNetTypeSync e: ' + JSON.stringify(e))
  143 + }
  144 + return NetworkType.TYPE_UNKNOWN
140 } 145 }
141 146
142 private parseData(data: connection.NetCapabilityInfo) { 147 private parseData(data: connection.NetCapabilityInfo) {
@@ -43,7 +43,7 @@ export class NetworkUtil { @@ -43,7 +43,7 @@ export class NetworkUtil {
43 */ 43 */
44 static isNetConnected(): boolean { 44 static isNetConnected(): boolean {
45 let type = NetworkManager.getInstance().getNetType() 45 let type = NetworkManager.getInstance().getNetType()
46 - if (type == NetworkType.TYPE_NONE) { 46 + if (type == NetworkType.TYPE_UNKNOWN || type == NetworkType.TYPE_NONE) {
47 return false 47 return false
48 } 48 }
49 return true 49 return true
@@ -5,6 +5,10 @@ import { HostManager } from './HttpHostManager'; @@ -5,6 +5,10 @@ import { HostManager } from './HttpHostManager';
5 */ 5 */
6 export class HttpUrlUtils { 6 export class HttpUrlUtils {
7 /** 7 /**
  8 + * 查询直播参与人数
  9 + */
  10 + static readonly GET_JOIN_PEOPLE_NUM: string = '/api/live-center-message/zh/a/live/room/number/batch/all'
  11 + /**
8 * 启动接口(底导接口) 12 * 启动接口(底导接口)
9 */ 13 */
10 static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup"; 14 static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup";
@@ -135,14 +139,6 @@ export class HttpUrlUtils { @@ -135,14 +139,6 @@ export class HttpUrlUtils {
135 */ 139 */
136 static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; 140 static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
137 /** 141 /**
138 - * 个人中心 - 消息  
139 - */  
140 - static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private";  
141 - /**  
142 - * 个人中心 - 消息 点赞数  
143 - */  
144 - static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount";  
145 - /**  
146 * 个人中心 我的评论列表 142 * 个人中心 我的评论列表
147 */ 143 */
148 static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; 144 static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList";
@@ -324,10 +320,6 @@ export class HttpUrlUtils { @@ -324,10 +320,6 @@ export class HttpUrlUtils {
324 */ 320 */
325 static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list"; 321 static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list";
326 322
327 - /**  
328 - * 查询点赞、回复我的、系统消息的未读数量以及回复/评论人  
329 - */  
330 - static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime=";  
331 323
332 /** 324 /**
333 * 直播详情-直播人数 325 * 直播详情-直播人数
@@ -515,16 +507,6 @@ export class HttpUrlUtils { @@ -515,16 +507,6 @@ export class HttpUrlUtils {
515 return url 507 return url
516 } 508 }
517 509
518 - static getMessageListDataUrl() {  
519 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH  
520 - return url  
521 - }  
522 -  
523 - static getMessageLikeCount() {  
524 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH  
525 - return url  
526 - }  
527 -  
528 static getExecuteCollcetUrl() { 510 static getExecuteCollcetUrl() {
529 let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH 511 let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
530 return url 512 return url
@@ -761,14 +743,9 @@ export class HttpUrlUtils { @@ -761,14 +743,9 @@ export class HttpUrlUtils {
761 return url; 743 return url;
762 } 744 }
763 745
764 - //获取消息未读接口  
765 - static getMessageUnReadDataUrl() {  
766 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH  
767 - return url  
768 - }  
769 -  
770 - static reportDeviceInfo() {  
771 - let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/common/user/c/device/push"; 746 +// 查询节目的参与人数
  747 + static getJoinPeopleNum() {
  748 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.GET_JOIN_PEOPLE_NUM;
772 return url; 749 return url;
773 } 750 }
774 751
@@ -796,4 +773,43 @@ export class HttpUrlUtils { @@ -796,4 +773,43 @@ export class HttpUrlUtils {
796 let url = HttpUrlUtils.getHost() + HttpUrlUtils.ENTER_MESSAGE_PATH 773 let url = HttpUrlUtils.getHost() + HttpUrlUtils.ENTER_MESSAGE_PATH
797 return url 774 return url
798 } 775 }
  776 + /**
  777 + * 个人中心 - 消息
  778 + */
  779 + static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private";
  780 + /**
  781 + * 个人中心 - 消息 点赞数
  782 + */
  783 + static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount";
  784 +
  785 + /**
  786 + * 查询点赞、回复我的、系统消息的未读数量以及回复/评论人
  787 + */
  788 + static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime=";
  789 +
  790 + static getMessageListDataUrl() {
  791 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH
  792 + return url
  793 + }
  794 +
  795 + static getMessageLikeCount() {
  796 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH
  797 + return url
  798 + }
  799 +
  800 + //获取消息未读接口
  801 + static getMessageUnReadDataUrl() {
  802 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH
  803 + return url
  804 + }
  805 +
  806 + static reportDeviceInfo() {
  807 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/common/user/c/device/push";
  808 + return url;
  809 + }
  810 +
  811 + static getUploadPushInfoUrl() {
  812 + let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device"
  813 + return url
  814 + }
799 } 815 }
@@ -13,3 +13,5 @@ export { ProcessUtils } from './src/main/ets/utils/ProcessUtils' @@ -13,3 +13,5 @@ export { ProcessUtils } from './src/main/ets/utils/ProcessUtils'
13 export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; 13 export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils';
14 14
15 export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' 15 export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor'
  16 +
  17 +export { AppInnerLink } from './src/main/ets/utils/AppInnerLink'
  1 +import { url } from '@kit.ArkTS'
  2 +import App from '@system.app'
  3 +import { Logger } from 'wdKit/Index'
  4 +
  5 +const TAG = "AppInnerLink"
  6 +
  7 +export class AppInnerLink {
  8 +
  9 + static readonly INNER_LINK_PROTCOL = "rmrbapp:"
  10 + static readonly INNER_LINK_HOSTNAME = "rmrb.app"
  11 + static readonly INNER_LINK_PATHNAME = "openwith"
  12 +
  13 + // 内链跳转
  14 + // 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
  15 + static jumpWithLink(innerLink: string) {
  16 +
  17 + let params = AppInnerLink.parseParams(innerLink)
  18 + if (!params) {
  19 + Logger.info(TAG, "跳转无效的链接地址 " + innerLink)
  20 + return
  21 + }
  22 +
  23 + switch (params.skipType) {
  24 + case 1: {
  25 + AppInnerLink.jumpParams(params)
  26 + break
  27 + }
  28 + case 2: {
  29 + AppInnerLink.jumpNoParams(params)
  30 + break
  31 + }
  32 + case 3: {
  33 + AppInnerLink.jumpAppH5(params)
  34 + break
  35 + }
  36 + case 4: {
  37 + AppInnerLink.jumpOutH5(params)
  38 + break
  39 + }
  40 + case 5: {
  41 + AppInnerLink.jumpThirdApp(params)
  42 + break
  43 + }
  44 + default: {
  45 + Logger.info(TAG, "跳转无效的链接地址 " + innerLink)
  46 + }
  47 + }
  48 + }
  49 +
  50 + private static jumpParams(params: InnerLinkParam) {
  51 +
  52 + }
  53 + private static jumpNoParams(params: InnerLinkParam) {
  54 +
  55 + }
  56 + private static jumpAppH5(params: InnerLinkParam) {
  57 +
  58 + }
  59 + private static jumpOutH5(params: InnerLinkParam) {
  60 +
  61 + }
  62 + private static jumpThirdApp(params: InnerLinkParam) {
  63 +
  64 + }
  65 +
  66 + static parseParams(link: string) : InnerLinkParam | undefined {
  67 + const that = url.URL.parseURL(link)
  68 + if (that.protocol !== AppInnerLink.INNER_LINK_PROTCOL) {
  69 + return
  70 + }
  71 + if (that.hostname !== AppInnerLink.INNER_LINK_HOSTNAME) {
  72 + return
  73 + }
  74 + if (that.pathname !== AppInnerLink.INNER_LINK_PATHNAME) {
  75 + return
  76 + }
  77 +
  78 + let obj = {} as InnerLinkParam
  79 +
  80 + const params = that.params
  81 + obj.type = params.get("type") as string
  82 + obj.subType = params.get("subType") as string
  83 + obj.contentId = params.get("contentId") as string
  84 + obj.relId = params.get("relId") as string
  85 + obj.relType = params.get("relType") as string
  86 + obj.pageId = params.get("pageId") as string
  87 + obj.url = params.get("url") as string
  88 + obj.activityId = params.get("activityId") as string
  89 + obj.activityType = params.get("activityType") as string
  90 + obj.creatorId = params.get("creatorId") as string
  91 + obj.firstChannelId = params.get("firstChannelId") as string
  92 + obj.skipType = Number(params.get("skipType"))
  93 + obj.isLogin = params.get("isLogin") as string
  94 + return obj
  95 + }
  96 +
  97 +
  98 +}
  99 +
  100 +interface InnerLinkParam {
  101 + type?: string,
  102 + subType?: string,
  103 + contentId?: string,
  104 + relId?: string,
  105 + relType?: string
  106 + pageId?: string,
  107 + url?: string,
  108 + activityId?: string,
  109 + activityType?: string,
  110 + creatorId?: string,
  111 + firstChannelId?: string,
  112 + skipType: number,
  113 + isLogin?: string,
  114 +}
@@ -238,7 +238,6 @@ export class ProcessUtils { @@ -238,7 +238,6 @@ export class ProcessUtils {
238 238
239 } 239 }
240 240
241 -  
242 Logger.debug(TAG, `gotoWeb, ${content.objectId}`) 241 Logger.debug(TAG, `gotoWeb, ${content.objectId}`)
243 } 242 }
244 243
@@ -7,10 +7,11 @@ import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; @@ -7,10 +7,11 @@ import { VoiceInfoDTO } from '../detail/VoiceInfoDTO';
7 import { RmhInfoDTO } from '../detail/RmhInfoDTO'; 7 import { RmhInfoDTO } from '../detail/RmhInfoDTO';
8 import { commentInfo } from './commentInfo'; 8 import { commentInfo } from './commentInfo';
9 import { BaseDTO } from '../component/BaseDTO'; 9 import { BaseDTO } from '../component/BaseDTO';
  10 +import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
10 11
11 @Observed 12 @Observed
12 export class ContentDTO implements BaseDTO { 13 export class ContentDTO implements BaseDTO {
13 - shareFlag?:string='1'; 14 + shareFlag?: string = '1';
14 appStyle: string = ''; 15 appStyle: string = '';
15 cityCode: string = ''; 16 cityCode: string = '';
16 coverSize: string = ''; 17 coverSize: string = '';
@@ -62,8 +63,7 @@ export class ContentDTO implements BaseDTO { @@ -62,8 +63,7 @@ export class ContentDTO implements BaseDTO {
62 videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 63 videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
63 64
64 newsSummary: string = ''; //appstyle:2 ,新闻详情 65 newsSummary: string = ''; //appstyle:2 ,新闻详情
65 - contentText?: string ='';  
66 - 66 + contentText?: string = '';
67 // 二次请求接口,返回的数据,这里组装到content里; 67 // 二次请求接口,返回的数据,这里组装到content里;
68 interactData?: InteractDataDTO; 68 interactData?: InteractDataDTO;
69 hasMore: number = -1; 69 hasMore: number = -1;
@@ -85,6 +85,10 @@ export class ContentDTO implements BaseDTO { @@ -85,6 +85,10 @@ export class ContentDTO implements BaseDTO {
85 // 链接类型: 0:无链接;1:内链(文章);2:外链 85 // 链接类型: 0:无链接;1:内链(文章);2:外链
86 openType: string = ''; 86 openType: string = '';
87 extra: string = '' 87 extra: string = ''
  88 + /*
  89 + 本地辅助字段
  90 + */
  91 + liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数
88 92
89 static clone(old: ContentDTO): ContentDTO { 93 static clone(old: ContentDTO): ContentDTO {
90 let content = new ContentDTO(); 94 let content = new ContentDTO();
@@ -42,6 +42,16 @@ export interface PageInfoDTO { @@ -42,6 +42,16 @@ export interface PageInfoDTO {
42 pageAdList:CompAdvBean[] 42 pageAdList:CompAdvBean[]
43 43
44 md5:string 44 md5:string
  45 +
  46 + /*
  47 + 信息流页面,最后一个楼层的最后一个组件的信息源
  48 + lastCompSourceType = 0 从楼层接口获取数据(compinfor)
  49 + = 1 表示 直播回看数据源
  50 + */
  51 + lastCompSourceType: number
  52 +
  53 +
  54 +
45 } 55 }
46 56
47 export interface ChannelInfoDTO { 57 export interface ChannelInfoDTO {
@@ -44,7 +44,7 @@ export struct CardParser { @@ -44,7 +44,7 @@ export struct CardParser {
44 } else if (contentDTO.appStyle === CompStyle.Card_04) { 44 } else if (contentDTO.appStyle === CompStyle.Card_04) {
45 Card4Component({ compDTO: this.compDTO, contentDTO }) 45 Card4Component({ compDTO: this.compDTO, contentDTO })
46 } else if (contentDTO.appStyle === CompStyle.Card_05) { 46 } else if (contentDTO.appStyle === CompStyle.Card_05) {
47 - Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, compDTO: this.compDTO }) 47 + Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy})
48 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle 48 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
49 .Card_13) { 49 .Card_13) {
50 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) 50 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
@@ -7,7 +7,8 @@ import { Card2Component } from './cardview/Card2Component'; @@ -7,7 +7,8 @@ import { Card2Component } from './cardview/Card2Component';
7 import { Card5Component } from './cardview/Card5Component'; 7 import { Card5Component } from './cardview/Card5Component';
8 import { AdvCardParser } from './cardViewAdv/AdvCardParser'; 8 import { AdvCardParser } from './cardViewAdv/AdvCardParser';
9 import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01'; 9 import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
10 -import { ZhGridLayout02 } from './compview/ZhGridLayout02'; 10 +import { CompNormalTitle } from './compview/CompNormalTitle';
  11 +import { ZhGridLayout02NewsContent } from './compview/ZhGridLayout02NewsContent';
11 import { ZhGridLayout03 } from './compview/ZhGridLayout03'; 12 import { ZhGridLayout03 } from './compview/ZhGridLayout03';
12 import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'; 13 import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';
13 import { ZhSingleColumn05 } from './compview/ZhSingleColumn05'; 14 import { ZhSingleColumn05 } from './compview/ZhSingleColumn05';
@@ -37,12 +38,10 @@ export struct CompParser { @@ -37,12 +38,10 @@ export struct CompParser {
37 38
38 build() { 39 build() {
39 Column() { 40 Column() {
40 - if (this.compDTO.name != "月度排行卡") {  
41 41
42 this.componentBuilder(); 42 this.componentBuilder();
43 } 43 }
44 } 44 }
45 - }  
46 45
47 @Builder 46 @Builder
48 componentBuilder() { 47 componentBuilder() {
@@ -75,9 +74,14 @@ export struct CompParser { @@ -75,9 +74,14 @@ export struct CompParser {
75 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 74 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
76 ZhSingleRow03({ compDTO: this.compDTO }) 75 ZhSingleRow03({ compDTO: this.compDTO })
77 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 76 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
78 - } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {  
79 - ZhGridLayout02({ compDTO: this.compDTO })  
80 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 77 + } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
  78 + //ZhGridLayout02({ compDTO: this.compDTO })
  79 + CompNormalTitle({ compDTO: this.compDTO })
  80 + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  81 + } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
  82 +
  83 + ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList })
  84 +
81 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { 85 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
82 ZhGridLayout03({ compDTO: this.compDTO }) 86 ZhGridLayout03({ compDTO: this.compDTO })
83 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 87 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
@@ -105,7 +109,7 @@ export struct CompParser { @@ -105,7 +109,7 @@ export struct CompParser {
105 // ZhSingleColumn05({ compDTO: compDTO }) 109 // ZhSingleColumn05({ compDTO: compDTO })
106 // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 110 // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
107 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { 111 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
108 - Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({top: -3}) 112 + Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({ top: -3 })
109 Divider().strokeWidth(6).color('#f5f5f5') 113 Divider().strokeWidth(6).color('#f5f5f5')
110 ZhSingleColumn09({ compDTO: this.compDTO }) 114 ZhSingleColumn09({ compDTO: this.compDTO })
111 Divider().strokeWidth(6).color('#f5f5f5') 115 Divider().strokeWidth(6).color('#f5f5f5')
@@ -41,6 +41,8 @@ import { publishCommentModel } from './comment/model/PublishCommentModel'; @@ -41,6 +41,8 @@ import { publishCommentModel } from './comment/model/PublishCommentModel';
41 import { CommentComponent } from './comment/view/CommentComponent'; 41 import { CommentComponent } from './comment/view/CommentComponent';
42 import { EmptyComponent } from './view/EmptyComponent'; 42 import { EmptyComponent } from './view/EmptyComponent';
43 import { detailedSkeleton } from './skeleton/detailSkeleton'; 43 import { detailedSkeleton } from './skeleton/detailSkeleton';
  44 +import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
  45 +import { common } from '@kit.AbilityKit';
44 46
45 const TAG = 'DynamicDetailComponent' 47 const TAG = 'DynamicDetailComponent'
46 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 48 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
@@ -602,6 +604,7 @@ export struct DynamicDetailComponent { @@ -602,6 +604,7 @@ export struct DynamicDetailComponent {
602 this.getInteractDataStatus() 604 this.getInteractDataStatus()
603 this.makeJumpInfo() 605 this.makeJumpInfo()
604 this.interactDataV2() 606 this.interactDataV2()
  607 + this.viewBlogInsightIntentShare()
605 } 608 }
606 609
607 private async interactDataV2() { 610 private async interactDataV2() {
@@ -761,6 +764,14 @@ export struct DynamicDetailComponent { @@ -761,6 +764,14 @@ export struct DynamicDetailComponent {
761 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 764 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
762 }) 765 })
763 } 766 }
  767 +
  768 + /**
  769 + * 意图上报
  770 + */
  771 + private viewBlogInsightIntentShare(){
  772 + let context = getContext(this) as common.UIAbilityContext;
  773 + viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactDataDTO)
  774 + }
764 } 775 }
765 776
766 interface radiusType { 777 interface radiusType {
@@ -145,6 +145,7 @@ export struct ENewspaperPageComponent { @@ -145,6 +145,7 @@ export struct ENewspaperPageComponent {
145 .onClick(() => { 145 .onClick(() => {
146 this.calendarDialogShow = !this.calendarDialogShow 146 this.calendarDialogShow = !this.calendarDialogShow
147 if (this.calendarDialogShow) { 147 if (this.calendarDialogShow) {
  148 +
148 this.calendarDialogController.open() 149 this.calendarDialogController.open()
149 } else { 150 } else {
150 this.calendarDialogController.close() 151 this.calendarDialogController.close()
@@ -210,23 +210,22 @@ export struct FeedBackActivity { @@ -210,23 +210,22 @@ export struct FeedBackActivity {
210 .padding({ bottom: 44 }) 210 .padding({ bottom: 44 })
211 Column(){ 211 Column(){
212 Text($r('app.string.submit')) 212 Text($r('app.string.submit'))
213 - .align(Alignment.Center) 213 + .textAlign(TextAlign.Center)
214 .height(44) 214 .height(44)
215 .width('90%') 215 .width('90%')
216 - .fontColor(this.canSubmit?$r('app.color.color_9E9E9E_40'):$r('app.color.color_fff')) 216 + .fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40'))
217 .fontSize($r('app.float.font_size_18')) 217 .fontSize($r('app.float.font_size_18'))
218 - .backgroundColor(this.canSubmit?$r('app.color.color_ED2800_99'):$r('app.color.color_EDEDED')) 218 + .backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99'))
219 .borderRadius(4) 219 .borderRadius(4)
220 .onClick(async (event: ClickEvent) => { 220 .onClick(async (event: ClickEvent) => {
221 - if(await FastClickUtil.isMinDelayTime()){ 221 + if (await FastClickUtil.isMinDelayTime()) {
222 return 222 return
223 } 223 }
224 this.reportCommit() 224 this.reportCommit()
225 }) 225 })
226 - Blank().height(15).width('100%')  
227 - }  
228 - .height(59) 226 + .margin({bottom:20})
229 } 227 }
  228 + }.margin({bottom:20})
230 } 229 }
231 } 230 }
232 231
@@ -31,6 +31,8 @@ import { publishCommentModel } from '../components/comment/model/PublishCommentM @@ -31,6 +31,8 @@ import { publishCommentModel } from '../components/comment/model/PublishCommentM
31 import { EmptyComponent } from '../components/view/EmptyComponent'; 31 import { EmptyComponent } from '../components/view/EmptyComponent';
32 import { CommentComponent } from '../components/comment/view/CommentComponent' 32 import { CommentComponent } from '../components/comment/view/CommentComponent'
33 import { HttpUtils } from 'wdNetwork/Index'; 33 import { HttpUtils } from 'wdNetwork/Index';
  34 +import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
  35 +import { common } from '@kit.AbilityKit';
34 36
35 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 37 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
36 38
@@ -56,7 +58,6 @@ export struct ImageAndTextPageComponent { @@ -56,7 +58,6 @@ export struct ImageAndTextPageComponent {
56 @State likeNum: number = 0 58 @State likeNum: number = 0
57 @State reachEndIncreament: number = 0 59 @State reachEndIncreament: number = 0
58 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 60 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
59 -  
60 build() { 61 build() {
61 Stack({ alignContent: Alignment.Top }) { 62 Stack({ alignContent: Alignment.Top }) {
62 Stack({ alignContent: Alignment.Bottom }) { 63 Stack({ alignContent: Alignment.Bottom }) {
@@ -189,11 +190,11 @@ export struct ImageAndTextPageComponent { @@ -189,11 +190,11 @@ export struct ImageAndTextPageComponent {
189 .alignItems(VerticalAlign.Bottom) 190 .alignItems(VerticalAlign.Bottom)
190 191
191 Row() { 192 Row() {
192 - Image($r('app.media.line')) 193 + Image($r('app.media.ic_news_detail_division'))
193 .width('100%') 194 .width('100%')
194 .height(6) 195 .height(6)
195 - .objectFit(ImageFit.Cover)  
196 .margin({ top: 10 }) 196 .margin({ top: 10 })
  197 + .objectFit(ImageFit.Fill)
197 } 198 }
198 .padding({ left: 15, right: 15 }) 199 .padding({ left: 15, right: 15 })
199 .backgroundColor(Color.White) 200 .backgroundColor(Color.White)
@@ -261,10 +262,20 @@ export struct ImageAndTextPageComponent { @@ -261,10 +262,20 @@ export struct ImageAndTextPageComponent {
261 } else { 262 } else {
262 this.operationButtonList = ['comment', 'collect', 'share'] 263 this.operationButtonList = ['comment', 'collect', 'share']
263 } 264 }
  265 +
  266 + //意图上报
  267 + this.viewBlogInsightIntentShare()
264 } 268 }
265 } 269 }
266 } 270 }
267 271
  272 + //意图上报
  273 + private viewBlogInsightIntentShare(){
  274 + let context = getContext(this) as common.UIAbilityContext;
  275 + viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactData)
  276 + }
  277 +
  278 +
268 private async getRecommend() { 279 private async getRecommend() {
269 let params: postRecommendListParams = { 280 let params: postRecommendListParams = {
270 imei: HttpUtils.getImei(), 281 imei: HttpUtils.getImei(),
@@ -341,6 +352,7 @@ export struct ImageAndTextPageComponent { @@ -341,6 +352,7 @@ export struct ImageAndTextPageComponent {
341 } 352 }
342 PageRepository.getContentInteract(params).then(res => { 353 PageRepository.getContentInteract(params).then(res => {
343 if (res.data) { 354 if (res.data) {
  355 + this.interactData = res.data[0]
344 this.likeNum = Number(res.data[0]?.likeNum) || 0 356 this.likeNum = Number(res.data[0]?.likeNum) || 0
345 } 357 }
346 }) 358 })
@@ -73,16 +73,18 @@ export struct InteractMComponent { @@ -73,16 +73,18 @@ export struct InteractMComponent {
73 .height('12') 73 .height('12')
74 }.margin({top:10,bottom:15}) 74 }.margin({top:10,bottom:15})
75 }.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) 75 }.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5)
  76 +
  77 + }
  78 + }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%')
  79 + }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top)
76 .onClick(()=>{ 80 .onClick(()=>{
  81 + if(this.messageModel.contentType === '211') return
77 let contentDTO :ContentDTO = new ContentDTO(); 82 let contentDTO :ContentDTO = new ContentDTO();
78 contentDTO.objectType = this.messageModel.InteractMsubM.contentType 83 contentDTO.objectType = this.messageModel.InteractMsubM.contentType
79 contentDTO.objectId = this.messageModel.InteractMsubM.contentId 84 contentDTO.objectId = this.messageModel.InteractMsubM.contentId
80 ProcessUtils.processPage(contentDTO) 85 ProcessUtils.processPage(contentDTO)
81 }) 86 })
82 } 87 }
83 - }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%')  
84 - }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top)  
85 - }  
86 88
87 buildContentString(): string { 89 buildContentString(): string {
88 let contentString: string = '' 90 let contentString: string = ''
@@ -22,6 +22,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -22,6 +22,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
22 import { PageRepository } from '../repository/PageRepository'; 22 import { PageRepository } from '../repository/PageRepository';
23 import { SpConstants } from 'wdConstant/Index'; 23 import { SpConstants } from 'wdConstant/Index';
24 import { router } from '@kit.ArkUI'; 24 import { router } from '@kit.ArkUI';
  25 +import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
  26 +import { common } from '@kit.AbilityKit';
25 27
26 const TAG = 'MultiPictureDetailPageComponent'; 28 const TAG = 'MultiPictureDetailPageComponent';
27 29
@@ -467,6 +469,7 @@ export struct MultiPictureDetailPageComponent { @@ -467,6 +469,7 @@ export struct MultiPictureDetailPageComponent {
467 this.getInteractBrowsOperate() 469 this.getInteractBrowsOperate()
468 this.getBatchAttentionStatus() 470 this.getBatchAttentionStatus()
469 } 471 }
  472 + this.viewBlogInsightIntentShare()
470 }) 473 })
471 .catch((err: Error) => { 474 .catch((err: Error) => {
472 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); 475 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
@@ -544,4 +547,12 @@ export struct MultiPictureDetailPageComponent { @@ -544,4 +547,12 @@ export struct MultiPictureDetailPageComponent {
544 } 547 }
545 }) 548 })
546 } 549 }
  550 +
  551 + /**
  552 + * 意图上报
  553 + */
  554 + private viewBlogInsightIntentShare(){
  555 + let context = getContext(this) as common.UIAbilityContext;
  556 + viewBlogItemInsightIntentShare(context,this.contentDetailData)
  557 + }
547 } 558 }
@@ -10,6 +10,8 @@ import DetailViewModel from '../viewmodel/DetailViewModel'; @@ -10,6 +10,8 @@ import DetailViewModel from '../viewmodel/DetailViewModel';
10 import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; 10 import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
11 import { EmptyComponent } from '../components/view/EmptyComponent'; 11 import { EmptyComponent } from '../components/view/EmptyComponent';
12 import { NetworkUtil, WindowModel } from 'wdKit'; 12 import { NetworkUtil, WindowModel } from 'wdKit';
  13 +import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
  14 +import { common } from '@kit.AbilityKit';
13 15
14 const TAG: string = 'SpacialTopicPageComponent' 16 const TAG: string = 'SpacialTopicPageComponent'
15 17
@@ -49,6 +51,12 @@ export struct SpacialTopicPageComponent { @@ -49,6 +51,12 @@ export struct SpacialTopicPageComponent {
49 }) 51 })
50 } 52 }
51 53
  54 + //意图上报
  55 + private viewBlogInsightIntentShare(){
  56 + let context = getContext(this) as common.UIAbilityContext;
  57 + viewBlogItemInsightIntentShare(context,this.contentDetailData)
  58 + }
  59 +
52 private async getDetail() { 60 private async getDetail() {
53 this.isNetConnected = NetworkUtil.isNetConnected() 61 this.isNetConnected = NetworkUtil.isNetConnected()
54 62
@@ -71,6 +79,7 @@ export struct SpacialTopicPageComponent { @@ -71,6 +79,7 @@ export struct SpacialTopicPageComponent {
71 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) 79 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
72 if (detailBeans && detailBeans.length > 0) { 80 if (detailBeans && detailBeans.length > 0) {
73 this.contentDetailData = detailBeans[0]; 81 this.contentDetailData = detailBeans[0];
  82 + this.viewBlogInsightIntentShare()
74 // if (this.contentDetailData[0]?.openComment) { 83 // if (this.contentDetailData[0]?.openComment) {
75 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 84 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
76 this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '') 85 this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
@@ -103,6 +103,10 @@ export struct RMCalendar { @@ -103,6 +103,10 @@ export struct RMCalendar {
103 nowFontColor: this.nowFontColor, 103 nowFontColor: this.nowFontColor,
104 disableClick: (item: RMCalendarBean) => { 104 disableClick: (item: RMCalendarBean) => {
105 if (this.disableCellClick) { 105 if (this.disableCellClick) {
  106 + if (!NetworkUtil.isNetConnected()) {
  107 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  108 + return
  109 + }
106 this.disableCellClick(item) 110 this.disableCellClick(item)
107 } 111 }
108 }, 112 },
1 import { RMCalendarBean } from './RMCalendarBean'; 1 import { RMCalendarBean } from './RMCalendarBean';
2 -import font from '@ohos.font'; 2 +import { ToastUtils, NetworkUtil } from 'wdKit/Index';
3 3
4 @Component 4 @Component
5 export struct RMCalenderCell { 5 export struct RMCalenderCell {
@@ -38,6 +38,12 @@ export struct RMCalenderCell { @@ -38,6 +38,12 @@ export struct RMCalenderCell {
38 } 38 }
39 39
40 getItemColor() { 40 getItemColor() {
  41 + if (!NetworkUtil.isNetConnected()) {
  42 + if (this.selectItem && this.selectItem.time == this.item.time) {
  43 + return this.selectFontColor
  44 + }
  45 + return this.disabledFontColor
  46 + }
41 if (!this.isShowSelectBg() && this.item.isNow) { 47 if (!this.isShowSelectBg() && this.item.isNow) {
42 return this.nowFontColor 48 return this.nowFontColor
43 } else if (this.item.isPre) { 49 } else if (this.item.isPre) {
@@ -136,10 +142,12 @@ export struct RMCalenderCell { @@ -136,10 +142,12 @@ export struct RMCalenderCell {
136 return 142 return
137 // } 143 // }
138 } 144 }
  145 + if (NetworkUtil.isNetConnected()) {
139 this.selectItem = this.item 146 this.selectItem = this.item
140 if (this.cellClick) { 147 if (this.cellClick) {
141 this.cellClick(this.item) 148 this.cellClick(this.item)
142 } 149 }
  150 + }
143 }) 151 })
144 } 152 }
145 153
@@ -8,7 +8,7 @@ export struct CardSourceInfo { @@ -8,7 +8,7 @@ export struct CardSourceInfo {
8 @ObjectLink compDTO: CompDTO 8 @ObjectLink compDTO: CompDTO
9 9
10 build() { 10 build() {
11 - Flex() { 11 + Flex({ alignItems: ItemAlign.Center }) {
12 if (this.contentDTO.corner) { 12 if (this.contentDTO.corner) {
13 Text(this.contentDTO.corner) 13 Text(this.contentDTO.corner)
14 .fontSize($r("app.float.font_size_11")) 14 .fontSize($r("app.float.font_size_11"))
@@ -28,31 +28,45 @@ export struct CardSourceInfo { @@ -28,31 +28,45 @@ export struct CardSourceInfo {
28 .maxLines(1) 28 .maxLines(1)
29 .textOverflow({ overflow: TextOverflow.Ellipsis }) 29 .textOverflow({ overflow: TextOverflow.Ellipsis })
30 } 30 }
31 - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '')) {  
32 - Image($r("app.media.point"))  
33 - .width(16)  
34 - .height(16)  
35 - }  
36 - // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间  
37 - if (this.contentDTO.isSearch || this.contentDTO.isCollection || 31 + if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum
  32 + // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
  33 + || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
38 !this.contentDTO.isSearch && DateTimeUtils.getCommentTime 34 !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
39 (Number 35 (Number
40 .parseFloat(this 36 .parseFloat(this
41 .contentDTO.publishTime)) 37 .contentDTO.publishTime))
42 .indexOf 38 .indexOf
43 - ('-') === -1) { 39 + ('-') === -1)
  40 + )) {
  41 + Image($r("app.media.point"))
  42 + .width(11)
  43 + .height(11)
  44 + }
  45 + // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
  46 + // if (this.contentDTO.isSearch || this.contentDTO.isCollection ||
  47 + // (!this.contentDTO.isSearch &&
  48 + // DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) {
  49 + //
  50 + // Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
  51 + // .fontSize($r("app.float.font_size_11"))
  52 + // .fontColor($r("app.color.color_B0B0B0"))
  53 + // .flexShrink(0);
  54 + // }
  55 + if (this.contentDTO.source) {
44 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) 56 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
45 .fontSize($r("app.float.font_size_11")) 57 .fontSize($r("app.float.font_size_11"))
46 .fontColor($r("app.color.color_B0B0B0")) 58 .fontColor($r("app.color.color_B0B0B0"))
47 - .flexShrink(0) 59 + .flexShrink(0);
48 } 60 }
49 - if (this.getContentDtoBean()?.interactData?.commentNum) { 61 +
  62 + if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
50 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) 63 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
51 .fontSize($r("app.float.font_size_11")) 64 .fontSize($r("app.float.font_size_11"))
52 .fontColor($r("app.color.color_B0B0B0")) 65 .fontColor($r("app.color.color_B0B0B0"))
53 .flexShrink(0) 66 .flexShrink(0)
54 .margin({ left: 6 }) 67 .margin({ left: 6 })
55 - .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : Visibility.Visible) 68 + .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
  69 + Visibility.Visible)
56 } 70 }
57 } 71 }
58 .width(CommonConstants.FULL_WIDTH) 72 .width(CommonConstants.FULL_WIDTH)
@@ -67,7 +81,7 @@ export struct CardSourceInfo { @@ -67,7 +81,7 @@ export struct CardSourceInfo {
67 if (this.compDTO == undefined) { 81 if (this.compDTO == undefined) {
68 return this.contentDTO 82 return this.contentDTO
69 } 83 }
70 - if(this.compDTO.operDataList.length == 0){ 84 + if (this.compDTO.operDataList.length == 0) {
71 return this.contentDTO 85 return this.contentDTO
72 } 86 }
73 return this.compDTO.operDataList[0] 87 return this.compDTO.operDataList[0]
@@ -38,9 +38,9 @@ export struct Card11Component { @@ -38,9 +38,9 @@ export struct Card11Component {
38 Column() { 38 Column() {
39 Stack() { 39 Stack() {
40 if (this.contentDTO.newTags) { 40 if (this.contentDTO.newTags) {
41 - Notes({ newTags: this.contentDTO.newTags }) 41 + Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
42 } else if (this.contentDTO.objectType == '5') { 42 } else if (this.contentDTO.objectType == '5') {
43 - Notes({ objectType: this.contentDTO.objectType }) 43 + Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
44 } 44 }
45 Text() { 45 Text() {
46 if (this.titleMarked) { 46 if (this.titleMarked) {
@@ -52,6 +52,7 @@ export struct Card11Component { @@ -52,6 +52,7 @@ export struct Card11Component {
52 Span(this.contentDTO.newsTitle) 52 Span(this.contentDTO.newsTitle)
53 } 53 }
54 } 54 }
  55 + .lineHeight(27)
55 .fontSize($r("app.float.font_size_18")) 56 .fontSize($r("app.float.font_size_18"))
56 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) 57 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
57 .maxLines(3) 58 .maxLines(3)
@@ -59,7 +60,7 @@ export struct Card11Component { @@ -59,7 +60,7 @@ export struct Card11Component {
59 .width(CommonConstants.FULL_WIDTH) 60 .width(CommonConstants.FULL_WIDTH)
60 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 61 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
61 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 62 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
62 - this.contentDTO.objectType == '5' ? 30 : 0) 63 + this.contentDTO.objectType == '5' ? 35 : 0)
63 64
64 }.alignContent(Alignment.TopStart) 65 }.alignContent(Alignment.TopStart)
65 66
@@ -49,7 +49,7 @@ export struct Card17Component { @@ -49,7 +49,7 @@ export struct Card17Component {
49 } 49 }
50 } 50 }
51 .textOverflow({ overflow: TextOverflow.Ellipsis }) 51 .textOverflow({ overflow: TextOverflow.Ellipsis })
52 - .fontSize($r('app.float.font_size_18')) 52 + .fontSize($r('app.float.font_size_17'))
53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
54 .lineHeight(25) 54 .lineHeight(25)
55 .maxLines(3) 55 .maxLines(3)
@@ -120,7 +120,7 @@ export struct Card17Component { @@ -120,7 +120,7 @@ export struct Card17Component {
120 }) 120 })
121 121
122 // 评论等信息 122 // 评论等信息
123 - CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO }) 123 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
124 } 124 }
125 .width(CommonConstants.FULL_WIDTH) 125 .width(CommonConstants.FULL_WIDTH)
126 .padding({ 126 .padding({
@@ -131,11 +131,3 @@ export struct Card17Component { @@ -131,11 +131,3 @@ export struct Card17Component {
131 }) 131 })
132 } 132 }
133 } 133 }
134 -  
135 -// 全局公共样式  
136 -@Styles  
137 -function ImageSize() {  
138 - .padding({ right: 18, left: 18 })  
139 - .width('100%')  
140 - .margin({ top: 10 })  
141 -}  
@@ -62,20 +62,7 @@ export struct Card19Component { @@ -62,20 +62,7 @@ export struct Card19Component {
62 } 62 }
63 // 图片-从无图到9图展示 63 // 图片-从无图到9图展示
64 createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls }) 64 createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls })
65 - .onClick(() => {  
66 - const photoList: PhotoListBean[] = this.contentDTO.fullColumnImgUrls.map(item => {  
67 - const photo: PhotoListBean = {  
68 - width: item.weight,  
69 - height: item.height,  
70 - picPath: item.fullUrl||item.url,  
71 - picDesc: '',  
72 - itemType:2,  
73 - id:0  
74 - }  
75 - return photo  
76 - })  
77 - ProcessUtils.gotoMultiPictureListPage(photoList, 0)  
78 - }) 65 +
79 CarderInteraction({ contentDTO: this.contentDTO }) 66 CarderInteraction({ contentDTO: this.contentDTO })
80 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 67 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
81 } 68 }
@@ -107,12 +94,12 @@ struct createImg { @@ -107,12 +94,12 @@ struct createImg {
107 @State loadImg: boolean = false; 94 @State loadImg: boolean = false;
108 95
109 async aboutToAppear(): Promise<void> { 96 async aboutToAppear(): Promise<void> {
110 - this.loadImg = await onlyWifiLoadImg();  
111 if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 97 if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
112 this.fullColumnImgUrls.splice(2, 0, { 98 this.fullColumnImgUrls.splice(2, 0, {
113 fullUrl: '' 99 fullUrl: ''
114 } as FullColumnImgUrlDTO) 100 } as FullColumnImgUrlDTO)
115 } 101 }
  102 + this.loadImg = await onlyWifiLoadImg();
116 console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls)) 103 console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls))
117 } 104 }
118 105
@@ -167,14 +154,14 @@ struct createImg { @@ -167,14 +154,14 @@ struct createImg {
167 alignContent: Alignment.BottomEnd 154 alignContent: Alignment.BottomEnd
168 }) { 155 }) {
169 if (this.getPicType() === 1) { 156 if (this.getPicType() === 1) {
170 - Image(this.loadImg ? item.fullUrl||item.url : '') 157 + Image(this.loadImg ? item.fullUrl || item.url : '')
171 .backgroundColor(0xf5f5f5) 158 .backgroundColor(0xf5f5f5)
172 .width('100%') 159 .width('100%')
173 .height(172) 160 .height(172)
174 .autoResize(true) 161 .autoResize(true)
175 .borderRadius(this.caclImageRadius(index)) 162 .borderRadius(this.caclImageRadius(index))
176 } else if (this.getPicType() === 2) { 163 } else if (this.getPicType() === 2) {
177 - Image(this.loadImg ? item.fullUrl||item.url : '') 164 + Image(this.loadImg ? item.fullUrl || item.url : '')
178 .width('100%') 165 .width('100%')
179 .height(305) 166 .height(305)
180 .autoResize(true) 167 .autoResize(true)
@@ -291,6 +278,20 @@ struct createImg { @@ -291,6 +278,20 @@ struct createImg {
291 .padding({ bottom: 3 }) 278 .padding({ bottom: 3 })
292 } 279 }
293 } 280 }
  281 + .onClick(() => {
  282 + const photoList: PhotoListBean[] = this.fullColumnImgUrls.map(item => {
  283 + const photo: PhotoListBean = {
  284 + width: item.weight,
  285 + height: item.height,
  286 + picPath: item.fullUrl||item.url,
  287 + picDesc: '',
  288 + itemType:2,
  289 + id:0
  290 + }
  291 + return photo
  292 + })
  293 + ProcessUtils.gotoMultiPictureListPage(photoList, index)
  294 + })
294 } 295 }
295 } 296 }
296 }) 297 })
@@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  9 +
9 // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 10 // import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
10 const TAG: string = 'Card2Component'; 11 const TAG: string = 'Card2Component';
11 12
@@ -66,12 +67,13 @@ export struct Card2Component { @@ -66,12 +67,13 @@ export struct Card2Component {
66 .fontSize($r('app.float.font_size_18')) 67 .fontSize($r('app.float.font_size_18'))
67 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 68 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
68 .maxLines(2) 69 .maxLines(2)
69 - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 70 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
70 .align(Alignment.Start) 71 .align(Alignment.Start)
71 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 72 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
72 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 73 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
73 - this.contentDTO.objectType == '5' ? 30 : 0) 74 + this.contentDTO.objectType == '5' ? 35 : 0)
74 }.alignContent(Alignment.TopStart) 75 }.alignContent(Alignment.TopStart)
  76 +
75 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) 77 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
76 // } 78 // }
77 // .alignContent(Alignment.TopStart) 79 // .alignContent(Alignment.TopStart)
@@ -36,9 +36,9 @@ export struct Card3Component { @@ -36,9 +36,9 @@ export struct Card3Component {
36 Column() { 36 Column() {
37 Stack() { 37 Stack() {
38 if (this.contentDTO.newTags) { 38 if (this.contentDTO.newTags) {
39 - Notes({ newTags: this.contentDTO.newTags }) 39 + Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
40 } else if (this.contentDTO.objectType == '5') { 40 } else if (this.contentDTO.objectType == '5') {
41 - Notes({ objectType: this.contentDTO.objectType }) 41 + Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
42 } 42 }
43 Text() { 43 Text() {
44 if (this.titleMarked) { 44 if (this.titleMarked) {
@@ -56,11 +56,11 @@ export struct Card3Component { @@ -56,11 +56,11 @@ export struct Card3Component {
56 .width(CommonConstants.FULL_WIDTH) 56 .width(CommonConstants.FULL_WIDTH)
57 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 57 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
58 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 58 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
59 - this.contentDTO.objectType == '5' ? 30 : 0) 59 + this.contentDTO.objectType == '5' ? 35 : 0)
60 }.alignContent(Alignment.TopStart) 60 }.alignContent(Alignment.TopStart)
61 61
62 // 评论等信息 62 // 评论等信息
63 - CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO }) 63 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
64 } 64 }
65 .width(CommonConstants.FULL_WIDTH) 65 .width(CommonConstants.FULL_WIDTH)
66 .padding({ 66 .padding({
@@ -3,8 +3,6 @@ import { CommonConstants } from 'wdConstant'; @@ -3,8 +3,6 @@ import { CommonConstants } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 4 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 import { Notes } from './notes'; 5 import { Notes } from './notes';
6 -import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'  
7 -import { common } from '@kit.AbilityKit';  
8 6
9 const TAG: string = 'Card5Component'; 7 const TAG: string = 'Card5Component';
10 8
@@ -15,7 +13,6 @@ const TAG: string = 'Card5Component'; @@ -15,7 +13,6 @@ const TAG: string = 'Card5Component';
15 export struct Card5Component { 13 export struct Card5Component {
16 @State contentDTO: ContentDTO = new ContentDTO(); 14 @State contentDTO: ContentDTO = new ContentDTO();
17 @Prop titleShowPolicy: number | string 15 @Prop titleShowPolicy: number | string
18 - @Prop compDTO: CompDTO = {} as CompDTO  
19 @State loadImg: boolean = false; 16 @State loadImg: boolean = false;
20 @State clicked: boolean = false; 17 @State clicked: boolean = false;
21 @State titleMarked: boolean = false; 18 @State titleMarked: boolean = false;
@@ -75,13 +72,12 @@ export struct Card5Component { @@ -75,13 +72,12 @@ export struct Card5Component {
75 .width(CommonConstants.FULL_WIDTH) 72 .width(CommonConstants.FULL_WIDTH)
76 .fontColor(Color.White) 73 .fontColor(Color.White)
77 .fontSize($r('app.float.font_size_18')) 74 .fontSize($r('app.float.font_size_18'))
78 - .fontWeight(FontWeight.Bold)  
79 .maxLines(2) 75 .maxLines(2)
80 .align(Alignment.TopStart) 76 .align(Alignment.TopStart)
81 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 77 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
82 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 78 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
83 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 79 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
84 - this.contentDTO.objectType == '5' ? 30 : 0) 80 + this.contentDTO.objectType == '5' ? 35 : 0)
85 }.alignContent(Alignment.TopStart) 81 }.alignContent(Alignment.TopStart)
86 } 82 }
87 .justifyContent(FlexAlign.Start) 83 .justifyContent(FlexAlign.Start)
@@ -100,8 +96,6 @@ export struct Card5Component { @@ -100,8 +96,6 @@ export struct Card5Component {
100 .onClick((event: ClickEvent) => { 96 .onClick((event: ClickEvent) => {
101 this.clicked = true; 97 this.clicked = true;
102 ProcessUtils.processPage(this.contentDTO) 98 ProcessUtils.processPage(this.contentDTO)
103 - let context = getContext(this) as common.UIAbilityContext;  
104 - viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED)  
105 }) 99 })
106 100
107 } 101 }
@@ -54,9 +54,9 @@ export struct Card6Component { @@ -54,9 +54,9 @@ export struct Card6Component {
54 // } 54 // }
55 Stack() { 55 Stack() {
56 if (this.contentDTO.newTags) { 56 if (this.contentDTO.newTags) {
57 - Notes({ newTags: this.contentDTO.newTags }) 57 + Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
58 } else if (this.contentDTO.objectType == '5') { 58 } else if (this.contentDTO.objectType == '5') {
59 - Notes({ objectType: this.contentDTO.objectType }) 59 + Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
60 } 60 }
61 61
62 Text() { 62 Text() {
@@ -75,10 +75,10 @@ export struct Card6Component { @@ -75,10 +75,10 @@ export struct Card6Component {
75 .fontWeight(FontWeight.Normal) 75 .fontWeight(FontWeight.Normal)
76 .maxLines(3) 76 .maxLines(3)
77 .alignSelf(ItemAlign.Start) 77 .alignSelf(ItemAlign.Start)
78 - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。  
79 - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 78 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  79 + .textIndent(this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2 ? 58 :
80 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 80 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
81 - this.contentDTO.objectType == '5' ? 30 : 0) 81 + this.contentDTO.objectType == '5' ? 35 : 0)
82 }.alignContent(Alignment.TopStart) 82 }.alignContent(Alignment.TopStart)
83 83
84 } 84 }
@@ -86,7 +86,7 @@ export struct Card6Component { @@ -86,7 +86,7 @@ export struct Card6Component {
86 86
87 87
88 //bottom 评论等信息 88 //bottom 评论等信息
89 - CardSourceInfo({ compDTO: this.compDTO,contentDTO:this.contentDTO }) 89 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
90 } 90 }
91 .alignItems(HorizontalAlign.Start) 91 .alignItems(HorizontalAlign.Start)
92 .justifyContent(FlexAlign.Start) 92 .justifyContent(FlexAlign.Start)
@@ -114,7 +114,7 @@ export struct Card6Component { @@ -114,7 +114,7 @@ export struct Card6Component {
114 bottom: $r('app.float.card_comp_pagePadding_tb') 114 bottom: $r('app.float.card_comp_pagePadding_tb')
115 }) 115 })
116 .width(CommonConstants.FULL_WIDTH) 116 .width(CommonConstants.FULL_WIDTH)
117 - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) 117 + // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217)
118 .justifyContent(FlexAlign.SpaceBetween) 118 .justifyContent(FlexAlign.SpaceBetween)
119 } 119 }
120 } 120 }
@@ -13,7 +13,7 @@ const TAG: string = 'Card9Component'; @@ -13,7 +13,7 @@ const TAG: string = 'Card9Component';
13 @Component 13 @Component
14 export struct Card9Component { 14 export struct Card9Component {
15 @State contentDTO: ContentDTO = new ContentDTO(); 15 @State contentDTO: ContentDTO = new ContentDTO();
16 - @State loadImg: boolean = true; 16 + // @State loadImg: boolean = true;
17 @State clicked: boolean = false; 17 @State clicked: boolean = false;
18 @State titleMarked: boolean = false; 18 @State titleMarked: boolean = false;
19 @State str01: string = ''; 19 @State str01: string = '';
@@ -38,11 +38,6 @@ export struct Card9Component { @@ -38,11 +38,6 @@ export struct Card9Component {
38 Column() { 38 Column() {
39 // 顶部标题,最多两行 39 // 顶部标题,最多两行
40 if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { 40 if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
41 - if (this.contentDTO.newTags) {  
42 - Notes({ newTags: this.contentDTO.newTags })  
43 - } else if (this.contentDTO.objectType == '5') {  
44 - Notes({ objectType: this.contentDTO.objectType })  
45 - }  
46 Text() { 41 Text() {
47 if (this.titleMarked) { 42 if (this.titleMarked) {
48 Span(this.str01) 43 Span(this.str01)
@@ -56,18 +51,14 @@ export struct Card9Component { @@ -56,18 +51,14 @@ export struct Card9Component {
56 .fontColor(this.clicked ? 0x848484 : 0x222222) 51 .fontColor(this.clicked ? 0x848484 : 0x222222)
57 .width(CommonConstants.FULL_WIDTH) 52 .width(CommonConstants.FULL_WIDTH)
58 .fontSize($r('app.float.font_size_18')) 53 .fontSize($r('app.float.font_size_18'))
59 - .fontWeight(600)  
60 .maxLines(2) 54 .maxLines(2)
61 .textOverflow({ overflow: TextOverflow.Ellipsis }) 55 .textOverflow({ overflow: TextOverflow.Ellipsis })
62 - .margin({ bottom: 19 })  
63 - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :  
64 - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||  
65 - this.contentDTO.objectType == '5' ? 30 : 0)  
66 - 56 + .margin({ top: 10, bottom: 10 })
  57 + .fontWeight(400)
67 } 58 }
68 // 大图 59 // 大图
69 Stack() { 60 Stack() {
70 - Image(this.loadImg ? this.contentDTO.coverUrl : '') 61 + Image(this.contentDTO.coverUrl)
71 .backgroundColor(0xf5f5f5) 62 .backgroundColor(0xf5f5f5)
72 .width('100%') 63 .width('100%')
73 .height(133) 64 .height(133)
@@ -21,8 +21,9 @@ export struct Notes { @@ -21,8 +21,9 @@ export struct Notes {
21 bottom: 3 21 bottom: 3
22 }) 22 })
23 .linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] }) 23 .linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] })
24 - .fontColor(Color.White)  
25 - .borderRadius($r('app.float.button_border_radius')) 24 + .fontColor(Color.White)// .borderRadius($r('app.float.button_border_radius'))
  25 + .borderRadius(2)
  26 + .margin({ top: 1 })
26 } 27 }
27 } 28 }
28 29
@@ -19,6 +19,9 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一 @@ -19,6 +19,9 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一
19 @Preview 19 @Preview
20 @Component 20 @Component
21 export struct CommentComponent { 21 export struct CommentComponent {
  22 + private onCloseClick = () => {
  23 + }
  24 + @Prop showCloseIcon?: boolean = false
22 @State hasMore: boolean = true; 25 @State hasMore: boolean = true;
23 @State currentPage: number = 1; 26 @State currentPage: number = 1;
24 @State isComments: boolean = true 27 @State isComments: boolean = true
@@ -29,13 +32,12 @@ export struct CommentComponent { @@ -29,13 +32,12 @@ export struct CommentComponent {
29 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset 32 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
30 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); 33 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
31 @State dialogController: CustomDialogController | null = null; 34 @State dialogController: CustomDialogController | null = null;
32 -  
33 // @State private browSingModel: commentListModel = new commentListModel() 35 // @State private browSingModel: commentListModel = new commentListModel()
34 36
35 // 是否为固定高度模式。true时,里面上拉加载更多生效,外层不能包Scroll。 37 // 是否为固定高度模式。true时,里面上拉加载更多生效,外层不能包Scroll。
36 // false时,外层实现加载更多,并通过reachEndIncreament通知开发加载更多,reachEndLoadMoreFinish 通知上层加载更多完成 38 // false时,外层实现加载更多,并通过reachEndIncreament通知开发加载更多,reachEndLoadMoreFinish 通知上层加载更多完成
37 fixedHeightMode: boolean = false 39 fixedHeightMode: boolean = false
38 - @Prop @Watch("parentOnReachEnd") reachEndIncreament : number = 0 40 + @Prop @Watch("parentOnReachEnd") reachEndIncreament: number = 0
39 reachEndLoadMoreFinish?: () => void 41 reachEndLoadMoreFinish?: () => void
40 42
41 // 在自定义组件即将析构销毁时将dialogControlle置空 43 // 在自定义组件即将析构销毁时将dialogControlle置空
@@ -102,6 +104,7 @@ export struct CommentComponent { @@ -102,6 +104,7 @@ export struct CommentComponent {
102 /*标题:全部评论*/ 104 /*标题:全部评论*/
103 @Builder 105 @Builder
104 titleHeader() { 106 titleHeader() {
  107 +
105 Row() { 108 Row() {
106 Row() { 109 Row() {
107 Image($r('app.media.redLine')) 110 Image($r('app.media.redLine'))
@@ -112,18 +115,29 @@ export struct CommentComponent { @@ -112,18 +115,29 @@ export struct CommentComponent {
112 .fontColor($r('app.color.color_222222')) 115 .fontColor($r('app.color.color_222222'))
113 .fontWeight(FontWeight.Medium) 116 .fontWeight(FontWeight.Medium)
114 .margin({ left: 5 }) 117 .margin({ left: 5 })
115 -  
116 } 118 }
117 .margin({ left: 16 }) 119 .margin({ left: 16 })
  120 +
  121 +
  122 + Image($r('app.media.close_button'))
  123 + .height(16)
  124 + .width(16)
  125 + .margin({ right: 16 })
  126 + .visibility(this.showCloseIcon ? Visibility.Visible : Visibility.Hidden)
  127 + .onClick(() => {
  128 + this.onCloseClick()
  129 + })
  130 +
  131 + }
  132 + .height(44)
  133 + .width('100%')
  134 + .justifyContent(FlexAlign.SpaceBetween)
118 .onClick(() => { 135 .onClick(() => {
119 // this.allDatas.push(new commentItemModel()) 136 // this.allDatas.push(new commentItemModel())
120 // this.allDatas.addFirstItem(new commentItemModel()) 137 // this.allDatas.addFirstItem(new commentItemModel())
121 // this.allDatas.reloadData(); 138 // this.allDatas.reloadData();
122 }) 139 })
123 140
124 - }.height(44)  
125 - .width('100%')  
126 - .justifyContent(FlexAlign.SpaceBetween);  
127 } 141 }
128 142
129 /*1级评论作为titleHeader*/ 143 /*1级评论作为titleHeader*/
@@ -200,7 +214,7 @@ export struct CommentComponent { @@ -200,7 +214,7 @@ export struct CommentComponent {
200 } 214 }
201 } 215 }
202 } 216 }
203 - .margin({bottom: 10}) 217 + .margin({ bottom: 10 })
204 .onReachEnd(() => { 218 .onReachEnd(() => {
205 if (!this.fixedHeightMode) { 219 if (!this.fixedHeightMode) {
206 return 220 return
@@ -209,7 +223,8 @@ export struct CommentComponent { @@ -209,7 +223,8 @@ export struct CommentComponent {
209 this.getData() 223 this.getData()
210 } 224 }
211 }) 225 })
212 - .enableScrollInteraction(this.fixedHeightMode ? true: false) 226 + .enableScrollInteraction(this.fixedHeightMode ? true : false)
  227 +
213 // .nestedScroll({ 228 // .nestedScroll({
214 // scrollForward: NestedScrollMode.PARENT_FIRST, 229 // scrollForward: NestedScrollMode.PARENT_FIRST,
215 // scrollBackward: NestedScrollMode.SELF_FIRST 230 // scrollBackward: NestedScrollMode.SELF_FIRST
  1 +import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';
  2 +import { CommonConstants } from 'wdConstant/Index';
  3 +import { Logger } from 'wdKit/Index';
  4 +import { ProcessUtils } from 'wdRouter';
  5 +import PageViewModel from '../../viewmodel/PageViewModel';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  7 +
  8 +
  9 +/**
  10 + * 通用标题组件
  11 + *
  12 + */
  13 +@Component
  14 +export struct CompNormalTitle {
  15 + @State compDTO: CompDTO = new CompDTO
  16 +
  17 + aboutToAppear() {
  18 + }
  19 +
  20 + build() {
  21 + Column() {
  22 + Row() {
  23 + Image($r("app.media.redLine"))
  24 + .width(3)
  25 + .height(16)
  26 + .margin({ right: 4 })
  27 + Text(this.compDTO.objectTitle)
  28 + .fontSize($r("app.float.font_size_17"))
  29 + .fontColor($r("app.color.color_222222"))
  30 + .fontWeight(600)
  31 + }
  32 + .justifyContent(FlexAlign.Start)
  33 + .margin({ top: 16, bottom: 10 })
  34 + .width(CommonConstants.FULL_WIDTH)
  35 + }
  36 + .width(CommonConstants.FULL_WIDTH)
  37 + .padding({ left: 16, right: 16 })
  38 +
  39 + }
  40 +}
  41 +
  42 +
1 -import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';  
2 -import { CommonConstants } from 'wdConstant/Index';  
3 -import { Logger } from 'wdKit/Index';  
4 -import { ProcessUtils } from 'wdRouter';  
5 -import PageViewModel from '../../viewmodel/PageViewModel';  
6 -import { onlyWifiLoadImg } from '../../utils/lazyloadImg';  
7 -  
8 -const TAG = 'Zh_Grid_Layout-02';  
9 -const FULL_PARENT: string = '100%';  
10 -let listSize: number = 2;  
11 -  
12 -/**  
13 - * 双图卡  
14 - * 枚举值Zh_Grid_Layout-02  
15 - * Zh_Grid_Layout-02  
16 - *  
17 - */  
18 -@Component  
19 -export struct ZhGridLayout02 {  
20 - @State compDTO: CompDTO = {} as CompDTO  
21 - @State operDataList: ContentDTO[] = []  
22 - @State loadImg: boolean = false;  
23 - @State liveRoomList: LiveRoomDataBean[] = []  
24 - currentPage = 1  
25 - pageSize = 12  
26 -  
27 - async aboutToAppear(): Promise<void> {  
28 - Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle)  
29 - this.currentPage = 1  
30 - PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {  
31 - this.operDataList = []  
32 - this.operDataList.push(...liveReviewDTO.list)  
33 - this.getLiveRoomDataInfo(this.operDataList)  
34 - })  
35 -  
36 - this.loadImg = await onlyWifiLoadImg();  
37 - }  
38 -  
39 - build() {  
40 - Column() {  
41 - Scroll() {  
42 - Column() {  
43 - Row() {  
44 - Image($r("app.media.redLine"))  
45 - .width(3)  
46 - .height(16)  
47 - .margin({ right: 4 })  
48 - Text(this.compDTO.objectTitle)  
49 - .fontSize($r("app.float.font_size_17"))  
50 - .fontColor($r("app.color.color_222222"))  
51 - .fontWeight(600)  
52 - }  
53 - .justifyContent(FlexAlign.Start)  
54 - .margin({ top: 16, bottom: 8 })  
55 - .width(CommonConstants.FULL_WIDTH)  
56 -  
57 - GridRow({  
58 - gutter: { x: 12, y: 13 },  
59 - columns: { sm: listSize, md: 2 },  
60 - breakpoints: { value: ['320vp', '520vp', '840vp'] }  
61 - }) {  
62 - ForEach(this.operDataList, (item: ContentDTO, index: number) => {  
63 - GridCol() {  
64 - this.buildItemCard(item);  
65 - }  
66 - })  
67 - }  
68 - }  
69 - }  
70 - .width("100%")  
71 - .height("100%")  
72 - // .layoutWeight(1)  
73 - .edgeEffect(EdgeEffect.None)  
74 - .scrollBar(BarState.Off)  
75 - .onReachStart(() => {  
76 - Logger.debug(TAG, 'onReachStart')  
77 - })  
78 - .onReachEnd(() => {  
79 - Logger.debug(TAG, 'onReachEnd')  
80 - this.addItems()  
81 - })  
82 - .nestedScroll({  
83 - scrollForward: NestedScrollMode.PARENT_FIRST,  
84 - scrollBackward: NestedScrollMode.SELF_FIRST  
85 - })  
86 - }  
87 - .width(CommonConstants.FULL_WIDTH)  
88 - // .width("100%")  
89 - .height("100%")  
90 - .padding({ left: 16, right: 16 })  
91 -  
92 - // .layoutWeight(1)  
93 -  
94 - }  
95 -  
96 - /**  
97 - * 组件项  
98 - *  
99 - * @param programmeBean item 组件项, 上面icon,下面标题  
100 - */  
101 - @Builder  
102 - buildItemCard(item: ContentDTO) {  
103 - Column() {  
104 - Stack({ alignContent: Alignment.BottomEnd }) {  
105 - Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')  
106 - .backgroundColor(0xf5f5f5)  
107 - .width('100%')  
108 - .height(95)  
109 - .borderRadius(4)  
110 - if (this.getLiveRoomNumber(item).length > 0) {  
111 - Text(this.getLiveRoomNumber(item))  
112 - .fontSize('11vp')  
113 - .fontWeight(400)  
114 - .fontColor(Color.White)  
115 - .margin({  
116 - right: '5vp',  
117 - bottom: '5vp'  
118 - })  
119 - }  
120 - }  
121 -  
122 - Text(item.newsTitle)  
123 - .margin({top:'6'})  
124 - .fontSize(13)  
125 - .maxLines(2)  
126 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
127 - }  
128 - .width('100%')  
129 - .onClick(() => {  
130 - ProcessUtils.processPage(item)  
131 - })  
132 - }  
133 -  
134 - // 获取评论数  
135 - async getLiveRoomDataInfo(list: ContentDTO[]) {  
136 - const reserveIds = this.getLiveDetailIds(list)  
137 - PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => {  
138 - if (result && result.length > 0) {  
139 - this.liveRoomList.push(...result)  
140 - }  
141 - }).catch(() => {  
142 - })  
143 - }  
144 -  
145 - // 判断是否预约  
146 - getLiveRoomNumber(item: ContentDTO): string {  
147 - const objc = this.liveRoomList.find((element: LiveRoomDataBean) => {  
148 - return element.liveId.toString() == item.objectId  
149 - })  
150 - if (objc && objc.pv && objc.pv > 0) {  
151 - return this.computeShowNum(objc.pv)  
152 - }  
153 - return ''  
154 - }  
155 -  
156 - addItems() {  
157 - Logger.debug(TAG, 'addItems')  
158 - this.currentPage++  
159 - PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {  
160 - this.operDataList.push(...liveReviewDTO.list)  
161 - this.getLiveRoomDataInfo(this.operDataList)  
162 - Logger.debug(TAG, 'addItems after: ' + this.operDataList.length)  
163 - })  
164 - }  
165 -  
166 - private getLiveDetailIds(list: ContentDTO[]): string {  
167 - let idList: string[] = []  
168 - list.forEach(item => {  
169 - idList.push(item.objectId)  
170 - });  
171 - return idList.join(',')  
172 - }  
173 -  
174 - private computeShowNum(count: number): string {  
175 - if (count >= 10000) {  
176 - let num = (count / 10000).toFixed(1)  
177 - if (Number(num.substring(num.length - 1)) == 0) {  
178 - num = num.substring(0, num.length - 2)  
179 - }  
180 - return num + '万人参加'  
181 - }  
182 - return `${count}人参加`  
183 - }  
184 -}  
185 -  
186 -  
  1 +import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';
  2 +import { CommonConstants } from 'wdConstant/Index';
  3 +import { Logger } from 'wdKit/Index';
  4 +import { ProcessUtils } from 'wdRouter';
  5 +import PageViewModel from '../../viewmodel/PageViewModel';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  7 +
  8 +let listSize: number = 2;
  9 +
  10 +/**
  11 + * 双图卡 的标题组件
  12 + *
  13 + */
  14 +@Component
  15 +export struct ZhGridLayout02NewsContent {
  16 + @ObjectLink compDTO: CompDTO
  17 + @State operDataList: ContentDTO[] = []
  18 + @State loadImg: boolean = false;
  19 +
  20 + async aboutToAppear(): Promise<void> {
  21 +
  22 + this.loadImg = await onlyWifiLoadImg();
  23 + }
  24 +
  25 + build() {
  26 +
  27 + GridRow({
  28 + gutter: { x: 9, y: 0 },
  29 + columns: { sm: listSize, md: listSize },
  30 + breakpoints: { value: ['320vp', '520vp', '840vp'] }
  31 + }) {
  32 + ForEach(this.operDataList, (item: ContentDTO, index: number) => {
  33 + GridCol() {
  34 + this.buildItemCard(item, index);
  35 + }
  36 + })
  37 + }.width("100%").padding({ left: 16, right: 16 })
  38 +
  39 + }
  40 +
  41 + @Builder
  42 + buildItemCard(item: ContentDTO, index: number) {
  43 + Column() {
  44 + Stack({ alignContent: Alignment.BottomEnd }) {
  45 + Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
  46 + .backgroundColor(0xf5f5f5)
  47 + .width('100%')
  48 + .height(95)
  49 + .borderWidth(0.5)
  50 + .borderColor($r('app.color.color_0D000000'))
  51 + .borderRadius(4)
  52 + if (this.compDTO.operDataList[index].liveRoomDataBean != undefined
  53 + && this.compDTO.operDataList[index].liveRoomDataBean?.pv != undefined) {
  54 + Text(this.computeShowNum(this.compDTO.operDataList[index].liveRoomDataBean))
  55 + .fontSize(12)
  56 + .fontWeight(400)
  57 + .fontColor(Color.White)
  58 + .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
  59 + .margin({
  60 + right: '5vp',
  61 + bottom: '5vp'
  62 + })
  63 + }
  64 + }
  65 +
  66 + Text(item.newsTitle)
  67 + .margin({ top: 8, bottom: 14 })
  68 + .fontSize(15)
  69 + .maxLines(2)
  70 + .lineHeight(21)
  71 + .width('100%')
  72 + .textAlign(TextAlign.Start)
  73 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  74 + }
  75 + .width('100%')
  76 + .onClick(() => {
  77 + ProcessUtils.processPage(item)
  78 + })
  79 + }
  80 +
  81 + private computeShowNum(bean: LiveRoomDataBean): string {
  82 + let count = bean.pv
  83 + if (count >= 10000) {
  84 + let num = (count / 10000).toFixed(1)
  85 + if (Number(num.substring(num.length - 1)) == 0) {
  86 + num = num.substring(0, num.length - 2)
  87 + }
  88 + return num + '万人参加'
  89 + }
  90 + return `${count}人参加`
  91 + }
  92 +}
  93 +
  94 +
@@ -17,10 +17,10 @@ export struct ZhSingleRow04 { @@ -17,10 +17,10 @@ export struct ZhSingleRow04 {
17 //顶部 17 //顶部
18 Row() { 18 Row() {
19 Row() { 19 Row() {
20 - Image($r("app.media.local_selection"))  
21 - .width(24)  
22 - .height(24)  
23 - .margin({ right: 4 }) 20 + // Image($r("app.media.local_selection"))
  21 + // .width(24)
  22 + // .height(24)
  23 + // .margin({ right: 4 })
24 Text(this.compDTO.objectTitle) 24 Text(this.compDTO.objectTitle)
25 .fontSize($r("app.float.font_size_17")) 25 .fontSize($r("app.float.font_size_17"))
26 .fontColor($r("app.color.color_222222")) 26 .fontColor($r("app.color.color_222222"))
@@ -36,7 +36,8 @@ export struct ZhSingleRow04 { @@ -36,7 +36,8 @@ export struct ZhSingleRow04 {
36 .width(14) 36 .width(14)
37 .height(14) 37 .height(14)
38 } 38 }
39 - .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) 39 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None :
  40 + Visibility.Visible)
40 .onClick(() => { 41 .onClick(() => {
41 if (this.compDTO?.objectType === '11') { 42 if (this.compDTO?.objectType === '11') {
42 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) 43 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
@@ -64,9 +65,11 @@ export struct ZhSingleRow04 { @@ -64,9 +65,11 @@ export struct ZhSingleRow04 {
64 operDataListItem: item 65 operDataListItem: item
65 } 66 }
66 ) 67 )
67 - .margin({right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left: 68 + .margin({
  69 + right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left:
68 index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0, 70 index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0,
69 - top: 6}) 71 + top: 6
  72 + })
70 .onClick(() => { 73 .onClick(() => {
71 ProcessUtils.processPage(item) 74 ProcessUtils.processPage(item)
72 }) 75 })
@@ -106,8 +109,7 @@ struct localCard { @@ -106,8 +109,7 @@ struct localCard {
106 .align(Alignment.TopStart) 109 .align(Alignment.TopStart)
107 .maxLines(3) 110 .maxLines(3)
108 .textOverflow({ overflow: TextOverflow.Ellipsis }) 111 .textOverflow({ overflow: TextOverflow.Ellipsis })
109 - .lineHeight(20)  
110 - .margin({bottom: 17}) 112 + .lineHeight(25)
111 .fontWeight(500) 113 .fontWeight(500)
112 Row() { 114 Row() {
113 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime))) 115 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime)))
@@ -115,7 +117,7 @@ struct localCard { @@ -115,7 +117,7 @@ struct localCard {
115 .fontColor($r("app.color.color_B0B0B0")) 117 .fontColor($r("app.color.color_B0B0B0"))
116 .margin({ right: 5 }) 118 .margin({ right: 5 })
117 // 这里需要外部查询评论接口后,写入字段 119 // 这里需要外部查询评论接口后,写入字段
118 - if(this.operDataListItem.interactData?.commentNum) { 120 + if (this.operDataListItem.interactData?.commentNum) {
119 Text(`${this.operDataListItem.interactData?.commentNum}评`) 121 Text(`${this.operDataListItem.interactData?.commentNum}评`)
120 .fontSize(12) 122 .fontSize(12)
121 } 123 }
@@ -139,7 +141,12 @@ struct localCard { @@ -139,7 +141,12 @@ struct localCard {
139 .border({ 141 .border({
140 radius: 2, 142 radius: 2,
141 }) 143 })
142 - .shadow({ radius: 6, color: '#1A000000', offsetX: 3, offsetY: 0 }) 144 + .shadow({
  145 + radius: 6,
  146 + color: '#1A000000',
  147 + offsetX: 0,
  148 + offsetY: 3
  149 + }) // 设置下方阴影
143 .margin({ 150 .margin({
144 right: 10 151 right: 10
145 }) 152 })
@@ -30,6 +30,7 @@ export struct ZhSingleRow06 { @@ -30,6 +30,7 @@ export struct ZhSingleRow06 {
30 this.loadImg = await onlyWifiLoadImg(); 30 this.loadImg = await onlyWifiLoadImg();
31 } 31 }
32 32
  33 +
33 /** 34 /**
34 * 点赞、取消点赞 35 * 点赞、取消点赞
35 */ 36 */
@@ -43,7 +44,7 @@ export struct ZhSingleRow06 { @@ -43,7 +44,7 @@ export struct ZhSingleRow06 {
43 44
44 const commentInfo = this.compDTO.operDataList[0]?.commentInfo as commentInfo; 45 const commentInfo = this.compDTO.operDataList[0]?.commentInfo as commentInfo;
45 // commentLikeChange(this.item) 46 // commentLikeChange(this.item)
46 - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1'; 47 + // this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
47 const commentLikeParam = { 48 const commentLikeParam = {
48 targetId: commentInfo.newsId || '', 49 targetId: commentInfo.newsId || '',
49 id: commentInfo.commentId, 50 id: commentInfo.commentId,
@@ -51,8 +52,9 @@ export struct ZhSingleRow06 { @@ -51,8 +52,9 @@ export struct ZhSingleRow06 {
51 api_status: this.newsStatusOfUser?.likeStatus == '1' ? false : true 52 api_status: this.newsStatusOfUser?.likeStatus == '1' ? false : true
52 } as commentItemModel; 53 } as commentItemModel;
53 commentViewModel.commentLike(commentLikeParam).then(() => { 54 commentViewModel.commentLike(commentLikeParam).then(() => {
54 - }).catch(() => {  
55 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1'; 55 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
  56 + }).catch((err: Error) => {
  57 + console.log('06-err', JSON.stringify(err))
56 }) 58 })
57 } 59 }
58 60
@@ -168,7 +170,7 @@ export struct ZhSingleRow06 { @@ -168,7 +170,7 @@ export struct ZhSingleRow06 {
168 ? item.operDataList[0]?.commentInfo?.userHeaderUrl 170 ? item.operDataList[0]?.commentInfo?.userHeaderUrl
169 ? item.operDataList[0].commentInfo.userHeaderUrl 171 ? item.operDataList[0].commentInfo.userHeaderUrl
170 : $r('app.media.default_head') 172 : $r('app.media.default_head')
171 - : $r('app.media.comment_rmh_tag')) 173 + : $r('app.media.icon_default_head_mater'))
172 .width(32) 174 .width(32)
173 .height(32) 175 .height(32)
174 .borderRadius(16) 176 .borderRadius(16)
@@ -5,6 +5,8 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; @@ -5,6 +5,8 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
5 import { LazyDataSource, StringUtils } from 'wdKit'; 5 import { LazyDataSource, StringUtils } from 'wdKit';
6 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../../model/MinePageDatasModel';
7 import { EmptyComponent } from '../../view/EmptyComponent'; 7 import { EmptyComponent } from '../../view/EmptyComponent';
  8 +import { Action } from 'wdBean/Index';
  9 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
8 10
9 const TAG = "AppointmentListUI" 11 const TAG = "AppointmentListUI"
10 12
@@ -42,6 +44,17 @@ export struct AppointmentListUI { @@ -42,6 +44,17 @@ export struct AppointmentListUI {
42 } 44 }
43 .onClick(() => { 45 .onClick(() => {
44 //TODO 跳转 46 //TODO 跳转
  47 + let action = {
  48 + type:"2",
  49 + params:{
  50 + extra:{
  51 + relId:item.relId,
  52 + relType:item.relType.toString()
  53 + },
  54 + contentID:item.liveId.toString()
  55 + }
  56 + } as Action
  57 + WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
45 }) 58 })
46 }, (item: MineAppointmentItem, index: number) => index.toString()) 59 }, (item: MineAppointmentItem, index: number) => index.toString())
47 60
@@ -34,7 +34,7 @@ export struct ChildCommentComponent { @@ -34,7 +34,7 @@ export struct ChildCommentComponent {
34 .borderRadius(50) 34 .borderRadius(50)
35 }.width('89lpx') 35 }.width('89lpx')
36 .height('89lpx') 36 .height('89lpx')
37 - .margin({ right: '15lpx' }) 37 + .margin({ right: '3lpx' })
38 38
39 Column() { 39 Column() {
40 Text(this.data.fromUserName) 40 Text(this.data.fromUserName)
@@ -45,10 +45,11 @@ struct EditUserIntroductionPage { @@ -45,10 +45,11 @@ struct EditUserIntroductionPage {
45 Divider() 45 Divider()
46 .margin(20) 46 .margin(20)
47 47
48 - Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。') 48 + Row(){
  49 + Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
49 .fontSize(13) 50 .fontSize(13)
50 - .padding(12)  
51 .fontColor(Color.Gray).lineHeight(25) 51 .fontColor(Color.Gray).lineHeight(25)
  52 + }.padding({left:16}).width('100%')
52 53
53 Button('保存') 54 Button('保存')
54 .type(ButtonType.Normal) 55 .type(ButtonType.Normal)
@@ -47,10 +47,12 @@ struct EditUserNikeNamePage { @@ -47,10 +47,12 @@ struct EditUserNikeNamePage {
47 Divider() 47 Divider()
48 .margin(20) 48 .margin(20)
49 49
  50 + Row(){
50 Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') 51 Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
51 .fontSize(13) 52 .fontSize(13)
52 - .padding(12)  
53 .fontColor(Color.Gray).lineHeight(25) 53 .fontColor(Color.Gray).lineHeight(25)
  54 + }.padding({left:16}).width('100%')
  55 +
54 56
55 Button('保存') 57 Button('保存')
56 .type(ButtonType.Normal) 58 .type(ButtonType.Normal)
@@ -69,7 +69,15 @@ struct InteractMessagePage { @@ -69,7 +69,15 @@ struct InteractMessagePage {
69 // 下拉刷新 69 // 下拉刷新
70 ForEach(this.allDatas, (InteractM: InteractMessageModel, compIndex: number) => { 70 ForEach(this.allDatas, (InteractM: InteractMessageModel, compIndex: number) => {
71 ListItem() { 71 ListItem() {
  72 + Column(){
72 InteractMComponent({messageModel:InteractM}) 73 InteractMComponent({messageModel:InteractM})
  74 +
  75 + Divider()
  76 + .color('#f5f5f5')
  77 + .width('100%')
  78 + .strokeWidth(1)
  79 + .padding({left:16,right:16,top:16})
  80 + }
73 } 81 }
74 }) 82 })
75 // 加载更多 83 // 加载更多
1 import { ContentDTO, LiveRoomDataBean } from 'wdBean'; 1 import { ContentDTO, LiveRoomDataBean } from 'wdBean';
2 import { ProcessUtils } from 'wdRouter'; 2 import { ProcessUtils } from 'wdRouter';
3 -import { CommonConstants } from 'wdConstant/Index';  
4 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
5 import { DateTimeUtils, LazyDataSource, Logger } from 'wdKit/Index'; 4 import { DateTimeUtils, LazyDataSource, Logger } from 'wdKit/Index';
6 import { router } from '@kit.ArkUI'; 5 import { router } from '@kit.ArkUI';
@@ -9,11 +8,16 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; @@ -9,11 +8,16 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
9 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; 8 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
10 import { EmptyComponent } from '../view/EmptyComponent'; 9 import { EmptyComponent } from '../view/EmptyComponent';
11 import { ErrorComponent } from '../view/ErrorComponent'; 10 import { ErrorComponent } from '../view/ErrorComponent';
12 -import LoadMoreLayout from '../page/LoadMoreLayout'  
13 -import { LottieView } from '../../components/lottie/LottieView' 11 +import LoadMoreLayout from '../page/LoadMoreLayout';
  12 +import { LottieView } from '../../components/lottie/LottieView';
  13 +import dataPreferences from '@ohos.data.preferences';
  14 +import { BusinessError } from '@ohos.base';
14 15
15 const TAG: string = 'LiveMorePage'; 16 const TAG: string = 'LiveMorePage';
16 17
  18 +const PREFERENCES_NAME = 'rmrLiveMorePage.db'
  19 +let preferenceTheme: dataPreferences.Preferences | null = null
  20 +
17 /** 21 /**
18 * 直播更多: 22 * 直播更多:
19 * type=1 直播 23 * type=1 直播
@@ -38,7 +42,13 @@ struct LiveMorePage { @@ -38,7 +42,13 @@ struct LiveMorePage {
38 @State viewType: ViewType = ViewType.LOADING 42 @State viewType: ViewType = ViewType.LOADING
39 private scroller: Scroller = new Scroller() 43 private scroller: Scroller = new Scroller()
40 @State liveRoomList: LiveRoomDataBean[] = [] 44 @State liveRoomList: LiveRoomDataBean[] = []
41 - aboutToAppear(): void { 45 + // 点击过的数据
  46 + @State clickDatas: Array<string> = []
  47 +
  48 + async aboutToAppear() {
  49 + await this.getPreferencesFromStorage()
  50 + this.getLivMoreClickPreference()
  51 + Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas))
42 this.currentPage = 1 52 this.currentPage = 1
43 this.getData() 53 this.getData()
44 } 54 }
@@ -94,10 +104,9 @@ struct LiveMorePage { @@ -94,10 +104,9 @@ struct LiveMorePage {
94 LoadingLayout() { 104 LoadingLayout() {
95 } 105 }
96 106
97 -  
98 @Builder 107 @Builder
99 ListLayout() { 108 ListLayout() {
100 - List({scroller: this.scroller}) { 109 + List({ scroller: this.scroller }) {
101 // 下拉刷新 110 // 下拉刷新
102 LazyForEach(this.data, (contentDTO: ContentDTO) => { 111 LazyForEach(this.data, (contentDTO: ContentDTO) => {
103 ListItem() { 112 ListItem() {
@@ -121,7 +130,7 @@ struct LiveMorePage { @@ -121,7 +130,7 @@ struct LiveMorePage {
121 .height('calc(100% - 44vp)') 130 .height('calc(100% - 44vp)')
122 .onReachEnd(() => { 131 .onReachEnd(() => {
123 Logger.debug(TAG, "触底了"); 132 Logger.debug(TAG, "触底了");
124 - if(!this.isLoading && this.hasMore){ 133 + if (!this.isLoading && this.hasMore) {
125 //加载分页数据 134 //加载分页数据
126 this.currentPage++; 135 this.currentPage++;
127 this.getData() 136 this.getData()
@@ -138,11 +147,12 @@ struct LiveMorePage { @@ -138,11 +147,12 @@ struct LiveMorePage {
138 buildItem(item: ContentDTO) { 147 buildItem(item: ContentDTO) {
139 Column() { 148 Column() {
140 Text(item.newsTitle) 149 Text(item.newsTitle)
141 - .fontSize(17) 150 + .fontSize(18)
142 .maxLines(2) 151 .maxLines(2)
143 .textOverflow({ overflow: TextOverflow.Ellipsis }) 152 .textOverflow({ overflow: TextOverflow.Ellipsis })
144 .margin({ top: 16, bottom: 8 }) 153 .margin({ top: 16, bottom: 8 })
145 .alignSelf(ItemAlign.Start) 154 .alignSelf(ItemAlign.Start)
  155 + .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222'))
146 Stack() { 156 Stack() {
147 if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { 157 if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) {
148 Image(item.fullColumnImgUrls[0].url) 158 Image(item.fullColumnImgUrls[0].url)
@@ -192,6 +202,7 @@ struct LiveMorePage { @@ -192,6 +202,7 @@ struct LiveMorePage {
192 } 202 }
193 .width('100%') 203 .width('100%')
194 .onClick(() => { 204 .onClick(() => {
  205 + this.clickRowBuildItem(item)
195 ProcessUtils.processPage(item) 206 ProcessUtils.processPage(item)
196 }) 207 })
197 } 208 }
@@ -300,7 +311,7 @@ struct LiveMorePage { @@ -300,7 +311,7 @@ struct LiveMorePage {
300 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) { 311 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) {
301 this.viewType = ViewType.EMPTY 312 this.viewType = ViewType.EMPTY
302 } 313 }
303 - }catch (exception) { 314 + } catch (exception) {
304 this.resolveEnd(false, resolve) 315 this.resolveEnd(false, resolve)
305 } 316 }
306 // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => { 317 // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => {
@@ -316,7 +327,7 @@ struct LiveMorePage { @@ -316,7 +327,7 @@ struct LiveMorePage {
316 if (resolve) { 327 if (resolve) {
317 if (this.currentPage == 1 && isTop) { 328 if (this.currentPage == 1 && isTop) {
318 resolve('已更新至最新') 329 resolve('已更新至最新')
319 - }else { 330 + } else {
320 resolve('') 331 resolve('')
321 } 332 }
322 } 333 }
@@ -335,17 +346,18 @@ struct LiveMorePage { @@ -335,17 +346,18 @@ struct LiveMorePage {
335 }); 346 });
336 return idList.join(',') 347 return idList.join(',')
337 } 348 }
  349 +
338 // 获取评论数 350 // 获取评论数
339 async getLiveRoomDataInfo(list: ContentDTO[]) { 351 async getLiveRoomDataInfo(list: ContentDTO[]) {
340 const reserveIds = this.getLiveDetailIds(list) 352 const reserveIds = this.getLiveDetailIds(list)
341 - Logger.debug(TAG,'是否预约数据:' +` ${reserveIds}`) 353 + Logger.debug(TAG, '是否预约数据:' + ` ${reserveIds}`)
342 PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => { 354 PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => {
343 - Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`) 355 + Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`)
344 if (result && result.length > 0) { 356 if (result && result.length > 0) {
345 this.liveRoomList.push(...result) 357 this.liveRoomList.push(...result)
346 this.data.reloadData() 358 this.data.reloadData()
347 } 359 }
348 - }).catch(() =>{ 360 + }).catch(() => {
349 // this.data.push(...list) 361 // this.data.push(...list)
350 }) 362 })
351 } 363 }
@@ -363,14 +375,64 @@ struct LiveMorePage { @@ -363,14 +375,64 @@ struct LiveMorePage {
363 375
364 private computeShowNum(count: number): string { 376 private computeShowNum(count: number): string {
365 if (count >= 10000) { 377 if (count >= 10000) {
366 - let num = ( count / 10000).toFixed(1)  
367 - if (Number(num.substring(num.length-1)) == 0) {  
368 - num = num.substring(0, num.length-2) 378 + let num = (count / 10000).toFixed(1)
  379 + if (Number(num.substring(num.length - 1)) == 0) {
  380 + num = num.substring(0, num.length - 2)
369 } 381 }
370 return num + '万人参加' 382 return num + '万人参加'
371 } 383 }
372 return `${count}人参加` 384 return `${count}人参加`
373 } 385 }
374 386
  387 + isClicked(objectId: string) {
  388 + return this.clickDatas.includes(objectId)
  389 + }
  390 +
  391 + clickRowBuildItem(item: ContentDTO) {
  392 + if (item.objectId && !this.clickDatas.includes(item.objectId)) {
  393 + Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas))
  394 + this.clickDatas.push(item.objectId.toString())
  395 + this.putLiveMoreClickPreference()
  396 + }
  397 + }
  398 +
  399 + async getPreferencesFromStorage() {
  400 + let context = getContext(this) as Context
  401 + preferenceTheme = await dataPreferences.getPreferences(context, PREFERENCES_NAME)
  402 + }
375 403
  404 + putLiveMoreClickPreference() {
  405 + Logger.info(TAG, `Put begin` + JSON.stringify(this.clickDatas))
  406 + if (preferenceTheme !== null && this.clickDatas.length > 0) {
  407 + // await
  408 + const arr: Array<string> = []
  409 + arr.push(...this.clickDatas)
  410 + preferenceTheme.put('liveMorePage', arr).then(() => {
  411 + Logger.debug(TAG,"Succeeded in putting value of 'startup'.");
  412 + }).catch((err: BusinessError) => {
  413 + Logger.debug(TAG, "Failed to put value of 'startup'. code =" + err.code + ", message =" + err.message);
  414 + })
  415 + // await preferenceTheme.flush()
  416 + preferenceTheme.flush((err: BusinessError) => {
  417 + if (err) {
  418 + Logger.debug(TAG, "Failed to flush. code =" + err.code + ", message =" + err.message);
  419 + return;
  420 + }
  421 + })
  422 +
  423 + }
  424 + }
  425 +
  426 + getLivMoreClickPreference() {
  427 + Logger.info(TAG, `Get begin`)
  428 + if (preferenceTheme !== null) {
  429 + preferenceTheme.get('liveMorePage', []).then((data: dataPreferences.ValueType) => {
  430 + if (data instanceof Array) {
  431 + this.clickDatas = data as Array<string>
  432 + }
  433 + }).catch((err: BusinessError) => {
  434 + console.error("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message);
  435 + })
  436 + }
  437 + }
376 } 438 }
@@ -20,6 +20,7 @@ struct MyCollectionListPage { @@ -20,6 +20,7 @@ struct MyCollectionListPage {
20 @State private browSingModel: PageModel = new PageModel() 20 @State private browSingModel: PageModel = new PageModel()
21 isloading : boolean = false 21 isloading : boolean = false
22 @Provide isEditState:boolean = false 22 @Provide isEditState:boolean = false
  23 + @State isDisplayButton:boolean = false
23 @State allDatas :ContentDTO[] = []; 24 @State allDatas :ContentDTO[] = [];
24 @State selectDatas :ContentDTO[] = []; 25 @State selectDatas :ContentDTO[] = [];
25 @Provide deleteNum :number = 0; 26 @Provide deleteNum :number = 0;
@@ -48,7 +49,7 @@ struct MyCollectionListPage { @@ -48,7 +49,7 @@ struct MyCollectionListPage {
48 49
49 build() { 50 build() {
50 Column(){ 51 Column(){
51 - CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.browSingModel.viewType == ViewType.ERROR || this.browSingModel.viewType == ViewType.EMPTY?false:true,editCallback:()=>{ 52 + CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{
52 this.allSelectDatas(false) 53 this.allSelectDatas(false)
53 this.isAllSelect = false 54 this.isAllSelect = false
54 this.selectDatas = [] 55 this.selectDatas = []
@@ -159,16 +160,19 @@ struct MyCollectionListPage { @@ -159,16 +160,19 @@ struct MyCollectionListPage {
159 } else { 160 } else {
160 this.browSingModel.hasMore = true; 161 this.browSingModel.hasMore = true;
161 } 162 }
  163 + this.isDisplayButton = true;
162 } else { 164 } else {
163 if (this.currentPage === 1) { 165 if (this.currentPage === 1) {
164 this.browSingModel.viewType = ViewType.EMPTY; 166 this.browSingModel.viewType = ViewType.EMPTY;
165 this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection 167 this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection
  168 + this.isDisplayButton = false;
166 } 169 }
167 } 170 }
168 }) 171 })
169 } else { 172 } else {
170 this.browSingModel.viewType = ViewType.EMPTY; 173 this.browSingModel.viewType = ViewType.EMPTY;
171 this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork; 174 this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork;
  175 + this.isDisplayButton = false;
172 } 176 }
173 } 177 }
174 178
@@ -231,6 +235,7 @@ struct MyCollectionListPage { @@ -231,6 +235,7 @@ struct MyCollectionListPage {
231 if (this.allDatas.length === 0) { 235 if (this.allDatas.length === 0) {
232 this.browSingModel.viewType = ViewType.EMPTY; 236 this.browSingModel.viewType = ViewType.EMPTY;
233 this.browSingModel.hasMore === true 237 this.browSingModel.hasMore === true
  238 + this.isDisplayButton = false;
234 } 239 }
235 } 240 }
236 241
@@ -255,7 +255,7 @@ export struct PageComponent { @@ -255,7 +255,7 @@ export struct PageComponent {
255 this.pageModel.channelId = this.channelId; 255 this.pageModel.channelId = this.channelId;
256 this.pageModel.currentPage = 1; 256 this.pageModel.currentPage = 1;
257 this.pageModel.pageTotalCompSize = 0; 257 this.pageModel.pageTotalCompSize = 0;
258 - // TODO PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel) 258 + PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel)
259 PageHelper.getInitData(this.pageModel, this.pageAdvModel) 259 PageHelper.getInitData(this.pageModel, this.pageAdvModel)
260 }, 100) 260 }, 100)
261 } 261 }
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 import { BottomNavDTO, TopNavDTO } from 'wdBean/Index' 5 import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'
6 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; 6 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
7 import { PageComponent } from './PageComponent'; 7 import { PageComponent } from './PageComponent';
  8 +import { WDRouterPage, WDRouterRule } from 'wdRouter';
8 9
9 const TAG = 'VideoChannelPage' 10 const TAG = 'VideoChannelPage'
10 11
@@ -67,6 +68,7 @@ export struct VideoChannelPage { @@ -67,6 +68,7 @@ export struct VideoChannelPage {
67 68
68 @Builder 69 @Builder
69 topNavView() { 70 topNavView() {
  71 + Stack({alignContent: Alignment.TopEnd}) {
70 Row() { 72 Row() {
71 ForEach(this.topNavList, (item: TopNavDTO, index: number) => { 73 ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
72 Column() { 74 Column() {
@@ -105,6 +107,27 @@ export struct VideoChannelPage { @@ -105,6 +107,27 @@ export struct VideoChannelPage {
105 .width('100%') 107 .width('100%')
106 .justifyContent(FlexAlign.Center) 108 .justifyContent(FlexAlign.Center)
107 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White) 109 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
  110 +
  111 + // 搜索按钮
  112 + Row() {
  113 + Image($r('app.media.icon_search'))
  114 + .width('24vp')
  115 + .height('24vp')
  116 + }
  117 + .width('40vp')
  118 + .margin({
  119 + right: '10vp',
  120 + top: '3vp',
  121 + })
  122 + .alignItems(VerticalAlign.Center)
  123 + .justifyContent(FlexAlign.Center)
  124 + .onClick(() => {
  125 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
  126 + })
  127 + .backgroundColor(Color.Transparent)
  128 +
  129 + }
  130 +
108 } 131 }
109 132
110 @Builder 133 @Builder
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';  
4 3
5 @Component 4 @Component
6 export struct PeopleShipRecommendComponent { 5 export struct PeopleShipRecommendComponent {
@@ -75,8 +74,8 @@ export struct PeopleShipRecommendComponent { @@ -75,8 +74,8 @@ export struct PeopleShipRecommendComponent {
75 } 74 }
76 .columnsTemplate('1fr 1fr 1fr') 75 .columnsTemplate('1fr 1fr 1fr')
77 .columnsGap(20) 76 .columnsGap(20)
78 - .rowsGap(20)  
79 - .height(Math.ceil(this.rmhList.length / 3.0) * 136) 77 + .rowsGap(16)
  78 + .height(Math.ceil(this.rmhList.length / 3.0) * 132)
80 .backgroundColor(Color.Transparent) 79 .backgroundColor(Color.Transparent)
81 .margin({ 80 .margin({
82 right: '20vp', 81 right: '20vp',
@@ -86,7 +85,7 @@ export struct PeopleShipRecommendComponent { @@ -86,7 +85,7 @@ export struct PeopleShipRecommendComponent {
86 // 为你推荐 85 // 为你推荐
87 Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 }) 86 Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 })
88 .margin({ 87 .margin({
89 - top: '24vp', 88 + top: '10vp',
90 bottom: '10vp' 89 bottom: '10vp'
91 }) 90 })
92 .width('120vp') 91 .width('120vp')
@@ -105,6 +104,8 @@ export struct PeopleShipRecommendComponent { @@ -105,6 +104,8 @@ export struct PeopleShipRecommendComponent {
105 }) 104 })
106 } 105 }
107 .width('100%') 106 .width('100%')
  107 + .justifyContent(FlexAlign.Start)
  108 +
108 } 109 }
109 110
110 // 选中 111 // 选中
@@ -115,6 +115,7 @@ export struct PeopleShipHomeAttentionComponent { @@ -115,6 +115,7 @@ export struct PeopleShipHomeAttentionComponent {
115 .onClick(() => { 115 .onClick(() => {
116 ToastUtils.showToast('分享为公共方法,待开发', 1000); 116 ToastUtils.showToast('分享为公共方法,待开发', 1000);
117 }) 117 })
  118 + .visibility(Visibility.Hidden)
118 119
119 } 120 }
120 121
@@ -28,7 +28,7 @@ const TAG: string = 'ReserveMorePage'; @@ -28,7 +28,7 @@ const TAG: string = 'ReserveMorePage';
28 @Component 28 @Component
29 struct ReserveMorePage { 29 struct ReserveMorePage {
30 @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); 30 @State data: LazyDataSource<ContentDTO> = new LazyDataSource();
31 - @State reserveList: ReserveItemBean[] = [] 31 + private reserveList: ReserveItemBean[] = []
32 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; 32 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
33 type: number = 2; 33 type: number = 2;
34 pageSize: number = 20; 34 pageSize: number = 20;
@@ -130,7 +130,10 @@ struct ReserveMorePage { @@ -130,7 +130,10 @@ struct ReserveMorePage {
130 Image(item.fullColumnImgUrls[0]?.url) 130 Image(item.fullColumnImgUrls[0]?.url)
131 .width('100%') 131 .width('100%')
132 .objectFit(ImageFit.Contain) 132 .objectFit(ImageFit.Contain)
133 - .borderRadius(4) 133 + .borderRadius({
  134 + topLeft: '4vp',
  135 + topRight: '4vp'
  136 + })
134 this.LiveImage() 137 this.LiveImage()
135 138
136 } 139 }
@@ -312,8 +315,15 @@ struct ReserveMorePage { @@ -312,8 +315,15 @@ struct ReserveMorePage {
312 Logger.debug(TAG,'是否关注元数据2:' +` ${JSON.stringify(element.subscribe)}`) 315 Logger.debug(TAG,'是否关注元数据2:' +` ${JSON.stringify(element.subscribe)}`)
313 element.subscribe = !element.subscribe 316 element.subscribe = !element.subscribe
314 Logger.debug(TAG,'是否关注元数据3:' +` ${JSON.stringify(element.subscribe)}`) 317 Logger.debug(TAG,'是否关注元数据3:' +` ${JSON.stringify(element.subscribe)}`)
315 - this.data.reloadData()  
316 this.isShow = true 318 this.isShow = true
  319 + if (element.subscribe) {
  320 + this.reservedIds.push(element.liveId.toString())
  321 + }else {
  322 + const num = this.reservedIds.indexOf(element.liveId.toString())
  323 + if (num >= 0 && num < this.reservedIds.length) {
  324 + this.reservedIds.splice(num, 1)
  325 + }
  326 + }
317 } 327 }
318 } 328 }
319 }) 329 })
@@ -349,6 +359,7 @@ struct ReserveMorePage { @@ -349,6 +359,7 @@ struct ReserveMorePage {
349 if (this.currentPage == 1) { 359 if (this.currentPage == 1) {
350 this.data.clear() 360 this.data.clear()
351 this.reserveList = [] 361 this.reserveList = []
  362 + this.reservedIds = []
352 } 363 }
353 this.data.push(...liveReviewDTO.list) 364 this.data.push(...liveReviewDTO.list)
354 //批量查询关注状态 365 //批量查询关注状态
@@ -396,7 +407,12 @@ struct ReserveMorePage { @@ -396,7 +407,12 @@ struct ReserveMorePage {
396 Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`) 407 Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`)
397 if (result && result.length > 0) { 408 if (result && result.length > 0) {
398 this.reserveList.push(...result) 409 this.reserveList.push(...result)
399 - this.data.reloadData() 410 + // this.reserveStatus = res;
  411 + result.map((item: ReserveItemBean) => {
  412 + if (item.subscribe) {
  413 + this.reservedIds.push(item.liveId.toString())
  414 + }
  415 + })
400 } 416 }
401 }).catch(() =>{ 417 }).catch(() =>{
402 // this.data.push(...list) 418 // this.data.push(...list)
@@ -409,11 +425,7 @@ struct ReserveMorePage { @@ -409,11 +425,7 @@ struct ReserveMorePage {
409 425
410 // 判断是否预约 426 // 判断是否预约
411 isReserved(item: ContentDTO) { 427 isReserved(item: ContentDTO) {
412 - const objc = this.getAttentionItem(item)  
413 - if (objc) {  
414 - return objc.subscribe  
415 - }  
416 - return false 428 + return this.reservedIds.includes(item.objectId)
417 } 429 }
418 430
419 getAttentionItem(item: ContentDTO) { 431 getAttentionItem(item: ContentDTO) {
@@ -460,9 +472,17 @@ struct ReserveMorePage { @@ -460,9 +472,17 @@ struct ReserveMorePage {
460 Logger.debug(TAG,'是否关注元数据:' +` ${JSON.stringify(element.subscribe)}`) 472 Logger.debug(TAG,'是否关注元数据:' +` ${JSON.stringify(element.subscribe)}`)
461 element.subscribe = !element.subscribe 473 element.subscribe = !element.subscribe
462 Logger.debug(TAG,'是否关注元数据1:' +` ${JSON.stringify(element.subscribe)}`) 474 Logger.debug(TAG,'是否关注元数据1:' +` ${JSON.stringify(element.subscribe)}`)
463 - this.data.reloadData() 475 + if (element.subscribe) {
  476 + this.reservedIds.push(element.liveId.toString())
  477 + }else {
  478 + const num = this.reservedIds.indexOf(element.liveId.toString())
  479 + if (num >= 0 && num < this.reservedIds.length) {
  480 + this.reservedIds.splice(num, 1)
  481 + }
  482 + }
464 } 483 }
465 }) 484 })
  485 +
466 } 486 }
467 this.isLoadingAttention = false 487 this.isLoadingAttention = false
468 this.liveId = '' 488 this.liveId = ''
@@ -487,15 +507,12 @@ struct ReserveMorePage { @@ -487,15 +507,12 @@ struct ReserveMorePage {
487 const eventMinutes = eventDateTime.getMinutes(); 507 const eventMinutes = eventDateTime.getMinutes();
488 const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数 508 const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数
489 509
490 - // 计算时间差  
491 - const timeDifference = eventDateTime.getTime() - currentDateTime.getTime();  
492 -  
493 - // 如果事件在24小时内  
494 if (type === 1) { 510 if (type === 1) {
495 - if (timeDifference > 0 && timeDifference <= 24 * 60 * 60 * 1000) { 511 + // 如果是今天
  512 + if (eventDateTime.setHours(0,0,0,0) === currentDateTime.setHours(0,0,0,0)) {
496 return `今天`; 513 return `今天`;
497 } else { 514 } else {
498 - // 如果事件不在24小时内 515 + // 如果事件不在今天
499 const month = eventDateTime.getMonth() + 1; // 月份从0开始 516 const month = eventDateTime.getMonth() + 1; // 月份从0开始
500 const date = eventDateTime.getDate(); 517 const date = eventDateTime.getDate();
501 return `${month}月${date}日`; 518 return `${month}月${date}日`;
  1 +import lottie, { AnimationItem } from '@ohos/lottie';
1 import { PullToRefresh, PullToRefreshConfigurator } from '@ohos/pulltorefresh'; 2 import { PullToRefresh, PullToRefreshConfigurator } from '@ohos/pulltorefresh';
2 -import { LazyDataSource } from 'wdKit'; 3 +import { LazyDataSource, Logger } from 'wdKit/Index';
3 4
4 @Component 5 @Component
5 export struct CustomPullToRefresh { 6 export struct CustomPullToRefresh {
@@ -12,28 +13,238 @@ export struct CustomPullToRefresh { @@ -12,28 +13,238 @@ export struct CustomPullToRefresh {
12 } 13 }
13 ///是否存在上拉更多 14 ///是否存在上拉更多
14 @Prop @Watch('hasMoreChange') hasMore: boolean = true 15 @Prop @Watch('hasMoreChange') hasMore: boolean = true
15 - refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); 16 + refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator()
  17 + .setHasLoadMore(this.hasMore)
  18 + .setAnimDuration(500);
  19 + private refreshSettings: RenderingContextSettings = new RenderingContextSettings(true)
  20 + private refreshContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshSettings)
  21 + private loadMoreSettings: RenderingContextSettings = new RenderingContextSettings(true)
  22 + private loadMoreContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.loadMoreSettings)
  23 + private refreshAnimation: AnimationItem | null = null;
  24 + private loadMoreAnimation: AnimationItem | null = null;
  25 + private refreshAnimName: string = "refresh";
  26 + private refreshingAnimName: string = "refreshing";
  27 + private loadMoreAnimName: string = "loadMore";
  28 + private refreshAnimationDestroy = true
  29 + // refresh-1,refreshing-2,refreshed-3,idle-4
  30 + @State @Watch('stateChange') private refreshState: number = 4;
  31 +
16 build() { 32 build() {
17 - Column(){ 33 + Column() {
18 PullToRefresh({ 34 PullToRefresh({
19 - data:$alldata,  
20 - scroller:this.scroller,  
21 - refreshConfigurator:this.refreshConfigurator,  
22 - customList:()=>{ 35 + data: $alldata,
  36 + scroller: this.scroller,
  37 + refreshConfigurator: this.refreshConfigurator,
  38 + customList: () => {
23 this.customList(); 39 this.customList();
24 }, 40 },
25 - onRefresh:()=>{  
26 - return new Promise<string>((resolve, reject) => { 41 + onRefresh: () => {
  42 + return new Promise<string>((success, error) => {
  43 + new Promise<string>((resolve) => {
27 this.onRefresh(resolve) 44 this.onRefresh(resolve)
  45 + }).then((text) => {
  46 + setTimeout(()=>{
  47 + // 延时500,展示第二段动画 TODO 是否去掉?
  48 + this.refreshState = 3
  49 + this.refreshDestroy()
  50 + setTimeout(() => {
  51 + success(text)
  52 + }, 500)
  53 + setTimeout(() => {
  54 + this.refreshState = 4
  55 + // 延时将状态改为空闲,组件closeRefresh做了延时,不能配置,这里配合延时
  56 + }, 1200)
  57 + },500)
  58 + })
28 }); 59 });
29 }, 60 },
30 - onLoadMore:()=>{ 61 + onLoadMore: () => {
31 return new Promise<string>((resolve, reject) => { 62 return new Promise<string>((resolve, reject) => {
32 - this.onLoadMore(resolve) 63 + this.onLoadMore(resolve)// TODO 加层promise处理,延长动画时间
33 }); 64 });
34 }, 65 },
35 - customLoad: null,  
36 - customRefresh: null, 66 + customLoad: () => {
  67 + this.customLoadMoreView()
  68 + },
  69 + // 可选项,自定义下拉刷新动画布局
  70 + customRefresh: () => {
  71 + this.customRefreshView()
  72 + },
  73 + // 可选项,下拉中回调
  74 + onAnimPullDown: (value, width, height) => {
  75 + this.refreshState = 1
  76 + // Logger.error('zzzz', 'onAnimPullDown, ' + value + ', ' + width + ', ' + height)
  77 + this.refreshAnim(value)
  78 + },
  79 + // 可选项,刷新中回调
  80 + onAnimRefreshing: (value, width, height) => {
  81 + if (this.refreshState < 2) {
  82 + this.refreshState = 2
  83 + }
  84 + // Logger.error('zzzz', 'onAnimRefreshing, ' + value + ', ' + width + ', ' + height)
  85 + this.refreshingAnim()
  86 + },
  87 + })
  88 + }
  89 + }
  90 +
  91 + /**
  92 + * 销毁所有动画
  93 + */
  94 + private refreshDestroy() {
  95 + lottie.destroy(this.refreshAnimName);
  96 + lottie.destroy(this.refreshingAnimName);
  97 + this.refreshAnimation?.removeEventListener('DOMLoaded')
  98 + this.refreshAnimation?.removeEventListener('destroy')
  99 + this.refreshAnimation = null
  100 + }
  101 +
  102 + @Builder
  103 + private customRefreshView() {
  104 + Stack({ alignContent: Alignment.Center }) {
  105 + Canvas(this.refreshContext)
  106 + .width(60)
  107 + .height(60)
  108 + .backgroundColor(Color.Transparent)
  109 + .onReady(() => {
  110 + // 可在此生命回调周期中加载动画,可以保证动画尺寸正确
  111 + //抗锯齿的设置
  112 + this.refreshContext.imageSmoothingEnabled = true;
  113 + this.refreshContext.imageSmoothingQuality = 'medium'
  114 + })
  115 + .onDisAppear(() => {
  116 + lottie.destroy(this.refreshAnimName);
  117 + lottie.destroy(this.refreshingAnimName);
  118 + })
  119 + .visibility((this.refreshState == 1 || this.refreshState == 2) ? Visibility.Visible : Visibility.Hidden)
  120 +
  121 + Text('已更新至最新')
  122 + .fontSize(14)
  123 + .textAlign(TextAlign.Center)
  124 + .fontColor('#676767')
  125 + .backgroundColor('#f6f6f6')
  126 + .borderRadius(20)
  127 + .padding({
  128 + left: 19,
  129 + right: 19,
  130 + top: 10,
  131 + bottom: 10
  132 + })
  133 + .visibility(this.refreshState == 3 ? Visibility.Visible : Visibility.Hidden)
  134 + }.padding({ top: 20 })
  135 + }
  136 +
  137 + @Builder
  138 + private customLoadMoreView() {
  139 + Row() {
  140 + Canvas(this.loadMoreContext)
  141 + .width(14)
  142 + .height(14)
  143 + .backgroundColor(Color.Transparent)
  144 + .onReady(() => {
  145 + // 可在此生命回调周期中加载动画,可以保证动画尺寸正确
  146 + //抗锯齿的设置
  147 + this.loadMoreContext.imageSmoothingEnabled = true;
  148 + this.loadMoreContext.imageSmoothingQuality = 'medium'
  149 + this.loadMoreAnimate()
  150 + })
  151 + .onDisAppear(() => {
  152 + // Logger.error('zzzz', 'CustomLoadMoreLayout onDisAppear')
  153 + lottie.destroy(this.loadMoreAnimName);
  154 + })
  155 +
  156 + Text('努力加载中')
  157 + .margin({
  158 + left: 7,
  159 + bottom: 1
  160 + })
  161 + .fontSize(14)
  162 + .fontColor('#888888')
  163 + .textAlign(TextAlign.Center)
  164 + }
  165 + .clip(true)
  166 + .width('100%')
  167 + .justifyContent(FlexAlign.Center)
  168 + .height(60)
  169 + }
  170 +
  171 + private refreshAnim(percent: number) {
  172 + if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshAnimName ||
  173 + this.refreshAnimationDestroy) {
  174 + this.refreshAnimation?.destroy(this.refreshAnimName)
  175 + this.refreshAnimation?.destroy(this.refreshingAnimName)
  176 + this.refreshAnimation = lottie.loadAnimation({
  177 + container: this.refreshContext,
  178 + renderer: 'canvas', // canvas 渲染模式
  179 + loop: 1,
  180 + autoplay: true,
  181 + name: this.refreshAnimName,
  182 + path: "lottie/refresh_step1.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
  183 + })
  184 + this.refreshAnimation?.goToAndStop(1)
  185 + this.addRefreshAnimListener()
  186 + }
  187 + this.refreshAnimation?.goToAndStop(this.getFramesByProgress(percent), true);
  188 + }
  189 +
  190 + /**
  191 + * 获取动画帧
  192 + *
  193 + * @param percent 百分比,如0.76
  194 + * @returns
  195 + */
  196 + private getFramesByProgress(percent: number): number {
  197 + if (this.refreshAnimation == null) {
  198 + return 1;
  199 + }
  200 + let total = this.refreshAnimation.totalFrames;
  201 + let frame = Math.floor(total * percent);
  202 + if (frame >= total - 1) {
  203 + frame = total - 1
  204 + }
  205 + return frame;
  206 + }
  207 +
  208 + private refreshingAnim() {
  209 + // Logger.error('zzzz', 'animate2, 1')
  210 + // 先销毁之前的动画
  211 + if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshingAnimName ||
  212 + this.refreshAnimationDestroy) {
  213 + this.refreshAnimation?.destroy(this.refreshAnimName)
  214 + this.refreshAnimation?.destroy(this.refreshingAnimName)
  215 + this.refreshAnimation = lottie.loadAnimation({
  216 + container: this.refreshContext,
  217 + renderer: 'canvas', // canvas 渲染模式
  218 + loop: 10,
  219 + autoplay: true,
  220 + name: this.refreshingAnimName,
  221 + path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
  222 + })
  223 + this.addRefreshAnimListener()
  224 + }
  225 + // Logger.error('zzzz', 'animate2, 2')
  226 + }
  227 +
  228 + private addRefreshAnimListener() {
  229 + this.refreshAnimation?.addEventListener('DOMLoaded', (args: Object): void => {
  230 + // Logger.error('zzzz', "lottie DOMLoaded");
  231 + this.refreshAnimationDestroy = false
  232 + }); //动画加载完成,播放之前触发
  233 + this.refreshAnimation?.addEventListener('destroy', (args: Object): void => {
  234 + // Logger.error('zzzz', "lottie destroy");
  235 + this.refreshAnimationDestroy = true
  236 + });
  237 + }
  238 +
  239 + loadMoreAnimate() {
  240 + if (this.loadMoreAnimation == null) {
  241 + this.loadMoreAnimation = lottie.loadAnimation({
  242 + container: this.loadMoreContext,
  243 + renderer: 'canvas', // canvas 渲染模式
  244 + loop: 50,
  245 + autoplay: true,
  246 + name: this.loadMoreAnimName,
  247 + path: "lottie/loading_more.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
37 }) 248 })
38 } 249 }
39 } 250 }
@@ -41,4 +252,8 @@ export struct CustomPullToRefresh { @@ -41,4 +252,8 @@ export struct CustomPullToRefresh {
41 hasMoreChange() { 252 hasMoreChange() {
42 this.refreshConfigurator.setHasLoadMore(this.hasMore) 253 this.refreshConfigurator.setHasLoadMore(this.hasMore)
43 } 254 }
  255 +
  256 + stateChange() {
  257 + // Logger.error('zzzz', 'stateChange ' + this.refreshState)
  258 + }
44 } 259 }
@@ -4,7 +4,7 @@ import router from '@ohos.router' @@ -4,7 +4,7 @@ import router from '@ohos.router'
4 export struct CustomTitleAndEditUI { 4 export struct CustomTitleAndEditUI {
5 imgBack:boolean = true 5 imgBack:boolean = true
6 titleName:string = "默认标题" 6 titleName:string = "默认标题"
7 - isDisplayButton:boolean = false 7 + @Link isDisplayButton:boolean
8 @Consume isEditState:boolean 8 @Consume isEditState:boolean
9 editCallback: () => void = () => { 9 editCallback: () => void = () => {
10 } 10 }
@@ -39,6 +39,11 @@ export struct SearchComponent { @@ -39,6 +39,11 @@ export struct SearchComponent {
39 SearcherAboutDataModel.searchHistoryData = [] 39 SearcherAboutDataModel.searchHistoryData = []
40 //获取搜索历史 40 //获取搜索历史
41 this.getSearchHistoryData() 41 this.getSearchHistoryData()
  42 +
  43 + let intervalID = setInterval(() => {
  44 + sendEventByKey("searchId", 10, "")
  45 + clearInterval(intervalID);
  46 + }, 1000);
42 } 47 }
43 48
44 getRelatedSearchContent() { 49 getRelatedSearchContent() {
@@ -56,12 +61,18 @@ export struct SearchComponent { @@ -56,12 +61,18 @@ export struct SearchComponent {
56 while (tempValue.indexOf(this.searchText) != -1){ 61 while (tempValue.indexOf(this.searchText) != -1){
57 let index = tempValue.indexOf(this.searchText) 62 let index = tempValue.indexOf(this.searchText)
58 if(index === 0){ 63 if(index === 0){
  64 + try {
59 tempArr.push(this.searchText) 65 tempArr.push(this.searchText)
60 tempValue = tempValue.substring(this.searchText.length,tempValue.length) 66 tempValue = tempValue.substring(this.searchText.length,tempValue.length)
  67 + } catch (e) {
  68 + }
61 }else { 69 }else {
  70 + try {
62 tempArr.push(tempValue.substring(0,index)) 71 tempArr.push(tempValue.substring(0,index))
63 tempArr.push(this.searchText) 72 tempArr.push(this.searchText)
64 tempValue = tempValue.substring(index+this.searchText.length,tempValue.length) 73 tempValue = tempValue.substring(index+this.searchText.length,tempValue.length)
  74 + } catch (e) {
  75 + }
65 } 76 }
66 } 77 }
67 if(StringUtils.isNotEmpty(tempValue)){ 78 if(StringUtils.isNotEmpty(tempValue)){
@@ -99,6 +110,10 @@ export struct SearchComponent { @@ -99,6 +110,10 @@ export struct SearchComponent {
99 this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData() 110 this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData()
100 } 111 }
101 112
  113 + stopInput(){
  114 + this.controller.stopEditing()
  115 + }
  116 +
102 build() { 117 build() {
103 Column() { 118 Column() {
104 this.searchInputComponent() 119 this.searchInputComponent()
@@ -106,7 +121,7 @@ export struct SearchComponent { @@ -106,7 +121,7 @@ export struct SearchComponent {
106 Scroll(this.scroller) { 121 Scroll(this.scroller) {
107 Column() { 122 Column() {
108 if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ 123 if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
109 - SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index) }) 124 + SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index),onCloseInput : (): void => this.stopInput() })
110 } 125 }
111 126
112 if(this.searchHistoryData.length>0){ 127 if(this.searchHistoryData.length>0){
@@ -129,7 +144,13 @@ export struct SearchComponent { @@ -129,7 +144,13 @@ export struct SearchComponent {
129 } else { 144 } else {
130 if (this.hasChooseSearch) { 145 if (this.hasChooseSearch) {
131 //搜索结果 146 //搜索结果
132 - SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) 147 + SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest,onClickTryAgain: (): void => {
  148 + if(StringUtils.isNotEmpty(this.searchText)){
  149 + SearcherAboutDataModel.putSearchHistoryData(this.searchText)
  150 + this.getSearchHistoryData()
  151 + this.getSearchInputResData(this.searchText)
  152 + }
  153 + }})
133 } else { 154 } else {
134 //联想搜索 155 //联想搜索
135 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) 156 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText})
@@ -218,7 +239,7 @@ export struct SearchComponent { @@ -218,7 +239,7 @@ export struct SearchComponent {
218 .textAlign(TextAlign.Start) 239 .textAlign(TextAlign.Start)
219 .maxLines(1) 240 .maxLines(1)
220 .textOverflow({ overflow: TextOverflow.Clip }) 241 .textOverflow({ overflow: TextOverflow.Clip })
221 - .margin({ left: '70lpx' }) 242 + .margin({ left: '40lpx' })
222 }) 243 })
223 } 244 }
224 .loop(true) 245 .loop(true)
@@ -238,7 +259,14 @@ export struct SearchComponent { @@ -238,7 +259,14 @@ export struct SearchComponent {
238 .height('69lpx') 259 .height('69lpx')
239 .backgroundColor($r('app.color.color_transparent')) 260 .backgroundColor($r('app.color.color_transparent'))
240 .textFont({ size: "27lpx", weight: "400lpx" }) 261 .textFont({ size: "27lpx", weight: "400lpx" })
241 - .defaultFocus(true) 262 + // .defaultFocus(true)
  263 + .id("searchId")
  264 + .searchIcon({
  265 + size:0
  266 + })
  267 + .cancelButton({
  268 + style:CancelButtonStyle.INVISIBLE
  269 + })
242 .caretStyle({color:Color.Pink}) 270 .caretStyle({color:Color.Pink})
243 .onSubmit((value: string) => { 271 .onSubmit((value: string) => {
244 if(StringUtils.isNotEmpty(this.searchText)){ 272 if(StringUtils.isNotEmpty(this.searchText)){
@@ -278,9 +306,20 @@ export struct SearchComponent { @@ -278,9 +306,20 @@ export struct SearchComponent {
278 } 306 }
279 } 307 }
280 }) 308 })
281 -  
282 - }.padding({right:'30lpx'}) 309 + }.padding({right:'70lpx'})
283 .layoutWeight(1) 310 .layoutWeight(1)
  311 +
  312 + Image($r('app.media.search_input_del_icon'))
  313 + .width("31lpx")
  314 + .height("31lpx")
  315 + .objectFit(ImageFit.Auto)
  316 + .interpolation(ImageInterpolation.Medium)
  317 + .margin({left:"495lpx"})
  318 + .onClick(()=>{
  319 + this.searchText = ""
  320 + })
  321 + .visibility(StringUtils.isEmpty(this.searchText) ? Visibility.Hidden : Visibility.Visible)
  322 +
284 } 323 }
285 .backgroundImage($r('app.media.search_page_input_bg')) 324 .backgroundImage($r('app.media.search_page_input_bg'))
286 .backgroundImageSize(ImageSize.Cover) 325 .backgroundImageSize(ImageSize.Cover)
@@ -8,11 +8,14 @@ import { MyCustomDialog } from '../reusable/MyCustomDialog' @@ -8,11 +8,14 @@ import { MyCustomDialog } from '../reusable/MyCustomDialog'
8 @Component 8 @Component
9 export struct SearchHistoryComponent{ 9 export struct SearchHistoryComponent{
10 @Link searchHistoryData:SearchHistoryItem[] 10 @Link searchHistoryData:SearchHistoryItem[]
  11 + onCloseInput?: () => void;
11 onDelHistory?: () => void; 12 onDelHistory?: () => void;
12 onGetSearchRes?: (item:string,index:number) => void; 13 onGetSearchRes?: (item:string,index:number) => void;
13 dialogController: CustomDialogController = new CustomDialogController({ 14 dialogController: CustomDialogController = new CustomDialogController({
14 builder: MyCustomDialog({ 15 builder: MyCustomDialog({
15 - cancel: this.onCancel, 16 + cancel: () => {
  17 + this.onCancel()
  18 + },
16 confirm: () => { 19 confirm: () => {
17 this.onAccept() 20 this.onAccept()
18 }, 21 },
@@ -33,6 +36,9 @@ export struct SearchHistoryComponent{ @@ -33,6 +36,9 @@ export struct SearchHistoryComponent{
33 } 36 }
34 37
35 onCancel() { 38 onCancel() {
  39 + if (this.onCloseInput !== undefined) {
  40 + this.onCloseInput()
  41 + }
36 console.info('Callback when the first button is clicked') 42 console.info('Callback when the first button is clicked')
37 } 43 }
38 44
1 import { CompDTO, ContentDTO } from 'wdBean/Index' 1 import { CompDTO, ContentDTO } from 'wdBean/Index'
2 -import { LazyDataSource, UserDataLocal } from 'wdKit/Index' 2 +import { LazyDataSource, NetworkUtil, UserDataLocal } from 'wdKit/Index'
3 import { HttpUtils } from 'wdNetwork/Index' 3 import { HttpUtils } from 'wdNetwork/Index'
4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
5 import { SearchSuggestRequestItem } from '../../viewmodel/SearchSuggestRequestItem' 5 import { SearchSuggestRequestItem } from '../../viewmodel/SearchSuggestRequestItem'
@@ -26,6 +26,8 @@ export struct SearchResultComponent { @@ -26,6 +26,8 @@ export struct SearchResultComponent {
26 @State suggest_count: number = 0; 26 @State suggest_count: number = 0;
27 @State isLoading: boolean = false 27 @State isLoading: boolean = false
28 scroller: Scroller = new Scroller() 28 scroller: Scroller = new Scroller()
  29 + onClickTryAgain?: () => void;
  30 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
29 31
30 aboutToAppear(): void { 32 aboutToAppear(): void {
31 if (this.count.length === 0 && this.isGetRequest == true) { 33 if (this.count.length === 0 && this.isGetRequest == true) {
@@ -67,9 +69,22 @@ export struct SearchResultComponent { @@ -67,9 +69,22 @@ export struct SearchResultComponent {
67 List() { 69 List() {
68 ListItem() { 70 ListItem() {
69 //缺省图 71 //缺省图
  72 + if(this.isConnectNetwork){
70 EmptyComponent({emptyType:4}) 73 EmptyComponent({emptyType:4})
71 .height('612lpx') 74 .height('612lpx')
72 .width('100%') 75 .width('100%')
  76 + }else{
  77 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  78 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  79 + if(this.isConnectNetwork){
  80 + if (this.onClickTryAgain !== undefined) {
  81 + this.onClickTryAgain()
  82 + }
  83 + }
  84 + }})
  85 + .height("100%")
  86 + .width('100%')
  87 + }
73 } 88 }
74 if(this.suggest_count > 0){ 89 if(this.suggest_count > 0){
75 ListItem() { 90 ListItem() {
@@ -20,7 +20,6 @@ export struct channelSkeleton { @@ -20,7 +20,6 @@ export struct channelSkeleton {
20 } 20 }
21 .RightStyle() 21 .RightStyle()
22 22
23 -  
24 Column() { 23 Column() {
25 textArea('35%', 78) 24 textArea('35%', 78)
26 } 25 }
@@ -70,7 +69,6 @@ function textArea(width: number | Resource | string = '100%', height: number | R @@ -70,7 +69,6 @@ function textArea(width: number | Resource | string = '100%', height: number | R
70 .height(height) 69 .height(height)
71 .backgroundColor('#FFF2F3F4') 70 .backgroundColor('#FFF2F3F4')
72 .margin({ top: 10 }) 71 .margin({ top: 10 })
73 - .borderRadius(4)  
74 } 72 }
75 73
76 // 全局公共样式 74 // 全局公共样式
@@ -18,13 +18,12 @@ export struct detailedSkeleton { @@ -18,13 +18,12 @@ export struct detailedSkeleton {
18 .alignItems(HorizontalAlign.Start) 18 .alignItems(HorizontalAlign.Start)
19 19
20 Column() { 20 Column() {
21 - textArea('40%', 12)  
22 - textArea('40%', 12) 21 + textArea('30%', 12)
  22 + textArea('30%', 12)
23 } 23 }
24 .SkeletonStyle() 24 .SkeletonStyle()
25 .alignItems(HorizontalAlign.Start) 25 .alignItems(HorizontalAlign.Start)
26 26
27 -  
28 Column() { 27 Column() {
29 textArea('100%', 12) 28 textArea('100%', 12)
30 textArea('100%', 12) 29 textArea('100%', 12)
@@ -59,7 +58,7 @@ function textArea(width: number | Resource | string = '100%', height: number | R @@ -59,7 +58,7 @@ function textArea(width: number | Resource | string = '100%', height: number | R
59 Row() 58 Row()
60 .width(width) 59 .width(width)
61 .height(height) 60 .height(height)
62 - .backgroundColor('#FFF2F3F4') 61 + .backgroundColor('#FFF5F5F5')
63 .margin({ top: 10 }) 62 .margin({ top: 10 })
64 // .borderRadius(5) 63 // .borderRadius(5)
65 } 64 }
@@ -131,8 +131,7 @@ export struct EmptyComponent { @@ -131,8 +131,7 @@ export struct EmptyComponent {
131 // .height(this.EMPTY_IMAGE_HEIGHT) 131 // .height(this.EMPTY_IMAGE_HEIGHT)
132 132
133 Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`) 133 Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
134 - .fontSize($r('app.float.font_size_14'))  
135 - .fontColor('#FF999999') 134 + .fontSize($r('app.float.font_size_14'))// .fontColor('#FF999999')
136 .fontWeight(FontWeight.Normal) 135 .fontWeight(FontWeight.Normal)
137 .opacity(this.TEXT_OPACITY) 136 .opacity(this.TEXT_OPACITY)
138 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 137 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
@@ -230,10 +229,10 @@ export struct EmptyComponent { @@ -230,10 +229,10 @@ export struct EmptyComponent {
230 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { 229 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) {
231 imageString = $r('app.media.icon_no_collection') 230 imageString = $r('app.media.icon_no_collection')
232 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { 231 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
233 - imageString = $r('app.media.icon_no_message1') 232 + imageString = $r('app.media.icon_no_message')
234 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment || 233 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment ||
235 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) { 234 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) {
236 - imageString = $r('app.media.icon_no_comment') 235 + imageString = $r('app.media.icon_no_comment1')
237 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { 236 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
238 imageString = $r('app.media.icon_no_result1') 237 imageString = $r('app.media.icon_no_result1')
239 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { 238 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
@@ -243,7 +242,7 @@ export struct EmptyComponent { @@ -243,7 +242,7 @@ export struct EmptyComponent {
243 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { 242 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
244 imageString = $r('app.media.icon_no_works1') 243 imageString = $r('app.media.icon_no_works1')
245 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { 244 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
246 - imageString = $r('app.media.icon_no_appointmentMade') 245 + imageString = $r('app.media.icon_no_appointmentMade1')
247 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { 246 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) {
248 imageString = $r('app.media.icon_no_limiting') 247 imageString = $r('app.media.icon_no_limiting')
249 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVisitAccount) { 248 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVisitAccount) {
@@ -251,7 +250,8 @@ export struct EmptyComponent { @@ -251,7 +250,8 @@ export struct EmptyComponent {
251 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) { 250 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) {
252 imageString = $r('app.media.icon_no_content') 251 imageString = $r('app.media.icon_no_content')
253 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1 || 252 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1 ||
254 - this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { 253 + this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow ||
  254 + this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
255 imageString = $r('app.media.icon_no_appointmentMade1') 255 imageString = $r('app.media.icon_no_appointmentMade1')
256 } 256 }
257 return imageString 257 return imageString
@@ -65,7 +65,12 @@ export struct OperRowListView { @@ -65,7 +65,12 @@ export struct OperRowListView {
65 * 7:图集详情页 65 * 7:图集详情页
66 */ 66 */
67 @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 67 @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
68 - @Prop pageComponentType?: number = -1 //1:视频详情页 2:竖屏直播页 3:图集 4: 横屏直播页 68 + /**
  69 + * 用于区分页面类型,在哪个页面嵌套就传相应的值
  70 + * 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页
  71 + */
  72 + @Prop pageComponentType?: number = -1
  73 + @Prop showBackIcon?: boolean = true
69 @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 74 @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
70 @Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件 75 @Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件
71 @State needLike: boolean = true 76 @State needLike: boolean = true
@@ -138,7 +143,7 @@ export struct OperRowListView { @@ -138,7 +143,7 @@ export struct OperRowListView {
138 Image($r('app.media.ic_news_detail_division')) 143 Image($r('app.media.ic_news_detail_division'))
139 .width('100%') 144 .width('100%')
140 .height($r('app.float.margin_1')) 145 .height($r('app.float.margin_1'))
141 - .margin({bottom: -2}) 146 + // .margin({bottom: -2})
142 147
143 Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { 148 Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
144 // AudioDialog() 149 // AudioDialog()
@@ -151,14 +156,16 @@ export struct OperRowListView { @@ -151,14 +156,16 @@ export struct OperRowListView {
151 .aspectRatio(1) 156 .aspectRatio(1)
152 .interpolation(ImageInterpolation.High) 157 .interpolation(ImageInterpolation.High)
153 } 158 }
  159 + .width(48)
154 .hoverEffect(HoverEffect.Scale) 160 .hoverEffect(HoverEffect.Scale)
  161 + .visibility(this.showBackIcon ? Visibility.Visible : Visibility.None)
155 .onClick(() => { 162 .onClick(() => {
156 if (this.onBack) { 163 if (this.onBack) {
157 this.onBack() 164 this.onBack()
158 } 165 }
159 router.back(); 166 router.back();
160 }) 167 })
161 - .width(48) 168 +
162 169
163 if (this.contentDetailData?.newsId) { 170 if (this.contentDetailData?.newsId) {
164 ForEach(this.operationButtonList, (item: string, index: number) => { 171 ForEach(this.operationButtonList, (item: string, index: number) => {
@@ -209,7 +216,8 @@ export struct OperRowListView { @@ -209,7 +216,8 @@ export struct OperRowListView {
209 } 216 }
210 .layoutWeight(1) 217 .layoutWeight(1)
211 .margin({ 218 .margin({
212 - right: this.pageComponentType === 1 ? 22 : 0, 219 + right: this.pageComponentType === 1 ? 20 : 0,
  220 + left: 16
213 }) 221 })
214 222
215 if (this.showCommentIcon) { 223 if (this.showCommentIcon) {
@@ -39,18 +39,18 @@ export struct AreaPickerDialog { @@ -39,18 +39,18 @@ export struct AreaPickerDialog {
39 this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); 39 this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
40 }) 40 })
41 .backgroundColor(0xffffff) 41 .backgroundColor(0xffffff)
42 - .fontColor(Color.Blue) 42 + .fontColor('#ED2800')
43 .layoutWeight(1) 43 .layoutWeight(1)
44 } 44 }
45 .margin({top:0,bottom:10}) 45 .margin({top:0,bottom:10})
46 46
47 Row(){ 47 Row(){
48 - FirstLevelComponent().width('30%')  
49 - SecondLevelComponent().width('30%')  
50 - ThirdLevelComponent().width('30%') 48 + FirstLevelComponent().width('33%')
  49 + SecondLevelComponent().width('33%')
  50 + ThirdLevelComponent().width('33%')
51 } 51 }
52 } 52 }
53 .height('40%') 53 .height('40%')
54 - 54 + .width('100%')
55 } 55 }
56 } 56 }
1 import { RMCalendar } from '../components/calendar/RMCalendar' 1 import { RMCalendar } from '../components/calendar/RMCalendar'
2 import { RMCalendarBean } from '../components/calendar/RMCalendarBean' 2 import { RMCalendarBean } from '../components/calendar/RMCalendarBean'
  3 +import { ToastUtils, NetworkUtil } from 'wdKit/Index';
3 4
4 @CustomDialog 5 @CustomDialog
5 export struct ENewspaperCalendarDialog { 6 export struct ENewspaperCalendarDialog {
@@ -26,4 +27,9 @@ export struct ENewspaperCalendarDialog { @@ -26,4 +27,9 @@ export struct ENewspaperCalendarDialog {
26 } 27 }
27 }) 28 })
28 } 29 }
  30 + aboutToAppear(): void {
  31 + if (!NetworkUtil.isNetConnected()) {
  32 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  33 + }
  34 + }
29 } 35 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { StringUtils } from 'wdKit'; 2 +import { NetworkUtil, StringUtils } from 'wdKit';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
4 import { editModelParams } from '../model/EditInfoModel'; 4 import { editModelParams } from '../model/EditInfoModel';
5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; 5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
6 import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageBottomFollowComponent'; 6 import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageBottomFollowComponent';
7 import MinePageDatasModel from '../model/MinePageDatasModel'; 7 import MinePageDatasModel from '../model/MinePageDatasModel';
  8 +import { EmptyComponent } from '../components/view/EmptyComponent';
  9 +import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
8 10
9 const TAG = "MineHomePage" 11 const TAG = "MineHomePage"
10 12
@@ -33,6 +35,7 @@ struct MineHomePage { @@ -33,6 +35,7 @@ struct MineHomePage {
33 scroller: Scroller = new Scroller(); 35 scroller: Scroller = new Scroller();
34 @State params:Record<string, string> = router.getParams() as Record<string, string>; 36 @State params:Record<string, string> = router.getParams() as Record<string, string>;
35 @State isCommentEnter:string = ""; 37 @State isCommentEnter:string = "";
  38 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
36 39
37 onPageShow(): void { 40 onPageShow(): void {
38 this.getUserInfo() 41 this.getUserInfo()
@@ -47,6 +50,7 @@ struct MineHomePage { @@ -47,6 +50,7 @@ struct MineHomePage {
47 } 50 }
48 51
49 build() { 52 build() {
  53 + if(this.isConnectNetwork){
50 Stack({ alignContent: Alignment.Top }){ 54 Stack({ alignContent: Alignment.Top }){
51 Image($r('app.media.title_bg')) 55 Image($r('app.media.title_bg'))
52 .width('100%') 56 .width('100%')
@@ -66,19 +70,19 @@ struct MineHomePage { @@ -66,19 +70,19 @@ struct MineHomePage {
66 Stack(){ 70 Stack(){
67 Image(this.headPhotoUrl) 71 Image(this.headPhotoUrl)
68 .alt($r('app.media.default_head')) 72 .alt($r('app.media.default_head'))
69 - .width('100lpx')  
70 - .height('100lpx') 73 + .width('115lpx')
  74 + .height('115lpx')
71 .objectFit(ImageFit.Auto) 75 .objectFit(ImageFit.Auto)
72 - .borderRadius(50) 76 + .clip(new Circle({ width: '115lpx', height: '115lpx' }))
73 Image(this.levelHead) 77 Image(this.levelHead)
74 - .width('130lpx')  
75 - .height('130lpx')  
76 - .objectFit(ImageFit.Cover) 78 + .width('165lpx')
  79 + .height('165lpx')
  80 + .objectFit(ImageFit.Auto)
77 }.onClick(()=>{ 81 }.onClick(()=>{
78 let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>; 82 let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
79 WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) 83 WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
80 - }).width('135lpx')  
81 - .height('135lpx') 84 + }).width('165lpx')
  85 + .height('165lpx')
82 86
83 Column() { 87 Column() {
84 Row() { 88 Row() {
@@ -95,15 +99,17 @@ struct MineHomePage { @@ -95,15 +99,17 @@ struct MineHomePage {
95 } 99 }
96 WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params) 100 WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params)
97 }) 101 })
  102 +
98 if(this.levelId>0){ 103 if(this.levelId>0){
99 Text(`等级${this.levelId}`) 104 Text(`等级${this.levelId}`)
100 - .textAlign(TextAlign.Center)  
101 .fontColor($r('app.color.color_ED2800')) 105 .fontColor($r('app.color.color_ED2800'))
102 - .backgroundColor($r('app.color.white'))  
103 - .fontSize('19lpx')  
104 - .width('96lpx')  
105 - .height('35lpx') 106 + .fontSize('23lpx')
  107 + .fontWeight(500)
106 .margin({ left: '10lpx' }) 108 .margin({ left: '10lpx' })
  109 + .backgroundImage($r("app.media.my_grade_bg"))
  110 + .backgroundImageSize(ImageSize.Cover)
  111 + .padding({left:"17lpx",right:"8lpx"})
  112 + .height('35lpx')
107 } 113 }
108 114
109 Blank() 115 Blank()
@@ -145,7 +151,7 @@ struct MineHomePage { @@ -145,7 +151,7 @@ struct MineHomePage {
145 }.margin({ left: '15lpx' }) 151 }.margin({ left: '15lpx' })
146 }.margin({ top: '23lpx' }) 152 }.margin({ top: '23lpx' })
147 }.alignItems(HorizontalAlign.Start) 153 }.alignItems(HorizontalAlign.Start)
148 - .margin({ left: '32lpx' }) 154 + .margin({ left: StringUtils.isEmpty(this.levelHead)?'32lpx':"3lpx" })
149 } 155 }
150 .onAreaChange((oldValue: Area, newValue: Area) => { 156 .onAreaChange((oldValue: Area, newValue: Area) => {
151 if (this.firstPositionY === 0) { 157 if (this.firstPositionY === 0) {
@@ -161,11 +167,13 @@ struct MineHomePage { @@ -161,11 +167,13 @@ struct MineHomePage {
161 .backgroundColor($r('app.color.color_transparent')) 167 .backgroundColor($r('app.color.color_transparent'))
162 .height('184lpx') 168 .height('184lpx')
163 .width('100%') 169 .width('100%')
164 - .padding({ left: '35lpx' }) 170 + .padding({ left: '6lpx' })
  171 +
  172 +
165 //用户简介区域 173 //用户简介区域
166 Column() { 174 Column() {
167 Row() { 175 Row() {
168 - Text(this.desc) 176 + Text(this.isHasIntroduction?"简介:"+this.desc:this.desc)
169 .fontSize('27lpx') 177 .fontSize('27lpx')
170 .maxLines(3) 178 .maxLines(3)
171 .textOverflow({ overflow: TextOverflow.Ellipsis }) 179 .textOverflow({ overflow: TextOverflow.Ellipsis })
@@ -257,6 +265,20 @@ struct MineHomePage { @@ -257,6 +265,20 @@ struct MineHomePage {
257 } 265 }
258 }.width('100%') 266 }.width('100%')
259 .layoutWeight(1) 267 .layoutWeight(1)
  268 + }else{
  269 + Column(){
  270 + CustomTitleUI({ titleName: "" })
  271 +
  272 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  273 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  274 + if(this.isConnectNetwork){
  275 + this.getUserInfo()
  276 + }
  277 + },})
  278 + .layoutWeight(1)
  279 + .width('100%')
  280 + }
  281 + }
260 282
261 } 283 }
262 @Builder MineHomeTitleTransparent() { 284 @Builder MineHomeTitleTransparent() {
@@ -417,7 +439,7 @@ struct MineHomePage { @@ -417,7 +439,7 @@ struct MineHomePage {
417 this.userName = value.userName 439 this.userName = value.userName
418 this.headPhotoUrl = value.headPhotoUrl 440 this.headPhotoUrl = value.headPhotoUrl
419 if(StringUtils.isNotEmpty(value.introduction)){ 441 if(StringUtils.isNotEmpty(value.introduction)){
420 - this.desc = "简介:" + value.introduction 442 + this.desc = value.introduction
421 this.isHasIntroduction = true 443 this.isHasIntroduction = true
422 }else{ 444 }else{
423 this.desc = "点击添加简介,让大家认识你" 445 this.desc = "点击添加简介,让大家认识你"
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { Params } from 'wdBean'; 2 import { Params } from 'wdBean';
3 -import { StringUtils } from 'wdKit'; 3 +import { NetworkUtil, StringUtils } from 'wdKit';
4 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; 4 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
5 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; 5 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent';
  6 +import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
  7 +import { EmptyComponent } from '../components/view/EmptyComponent';
6 import MinePageDatasModel from '../model/MinePageDatasModel'; 8 import MinePageDatasModel from '../model/MinePageDatasModel';
7 import { OtherUserDetailRequestItem } from '../viewmodel/OtherUserDetailRequestItem'; 9 import { OtherUserDetailRequestItem } from '../viewmodel/OtherUserDetailRequestItem';
8 10
@@ -39,6 +41,7 @@ struct OtherNormalUserHomePage { @@ -39,6 +41,7 @@ struct OtherNormalUserHomePage {
39 @State attentionNum:number = 0//关注数 41 @State attentionNum:number = 0//关注数
40 @State desc:string = "" 42 @State desc:string = ""
41 userType:string = "1" 43 userType:string = "1"
  44 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
42 45
43 aboutToAppear(){ 46 aboutToAppear(){
44 this.getUserInfo() 47 this.getUserInfo()
@@ -47,6 +50,7 @@ struct OtherNormalUserHomePage { @@ -47,6 +50,7 @@ struct OtherNormalUserHomePage {
47 50
48 51
49 build() { 52 build() {
  53 + if(this.isConnectNetwork){
50 Stack({ alignContent: Alignment.Top }){ 54 Stack({ alignContent: Alignment.Top }){
51 Image($r('app.media.title_bg')) 55 Image($r('app.media.title_bg'))
52 .width('100%') 56 .width('100%')
@@ -66,15 +70,14 @@ struct OtherNormalUserHomePage { @@ -66,15 +70,14 @@ struct OtherNormalUserHomePage {
66 Stack(){ 70 Stack(){
67 Image(this.headPhotoUrl) 71 Image(this.headPhotoUrl)
68 .alt($r('app.media.default_head')) 72 .alt($r('app.media.default_head'))
69 - .width('100lpx')  
70 - .height('100lpx') 73 + .width('115lpx')
  74 + .height('115lpx')
71 .objectFit(ImageFit.Cover) 75 .objectFit(ImageFit.Cover)
72 - .borderRadius(50) 76 + .clip(new Circle({ width: '115lpx', height: '115lpx' }))
73 Image(this.levelHead) 77 Image(this.levelHead)
74 - .width('130lpx')  
75 - .height('130lpx') 78 + .width('165lpx')
  79 + .height('165lpx')
76 .objectFit(ImageFit.Cover) 80 .objectFit(ImageFit.Cover)
77 - .borderRadius(50)  
78 } 81 }
79 82
80 Column() { 83 Column() {
@@ -87,14 +90,17 @@ struct OtherNormalUserHomePage { @@ -87,14 +90,17 @@ struct OtherNormalUserHomePage {
87 .lineHeight('50lpx') 90 .lineHeight('50lpx')
88 .fontWeight('500lpx') 91 .fontWeight('500lpx')
89 92
  93 + if(this.levelId>0){
90 Text(`等级${this.levelId}`) 94 Text(`等级${this.levelId}`)
91 - .textAlign(TextAlign.Center)  
92 .fontColor($r('app.color.color_ED2800')) 95 .fontColor($r('app.color.color_ED2800'))
93 - .backgroundColor($r('app.color.white'))  
94 - .fontSize('19lpx')  
95 - .width('96lpx')  
96 - .height('35lpx') 96 + .fontSize('23lpx')
  97 + .fontWeight(500)
97 .margin({ left: '10lpx' }) 98 .margin({ left: '10lpx' })
  99 + .backgroundImage($r("app.media.my_grade_bg"))
  100 + .backgroundImageSize(ImageSize.Cover)
  101 + .padding({left:"17lpx",right:"8lpx"})
  102 + .height('35lpx')
  103 + }
98 Blank() 104 Blank()
99 }.width('507lpx') 105 }.width('507lpx')
100 106
@@ -134,7 +140,7 @@ struct OtherNormalUserHomePage { @@ -134,7 +140,7 @@ struct OtherNormalUserHomePage {
134 }.margin({ left: '15lpx' }) 140 }.margin({ left: '15lpx' })
135 }.margin({ top: '23lpx' }) 141 }.margin({ top: '23lpx' })
136 }.alignItems(HorizontalAlign.Start) 142 }.alignItems(HorizontalAlign.Start)
137 - .margin({ left: '32lpx' }) 143 + .margin({ left: StringUtils.isEmpty(this.levelHead)?'32lpx':"3lpx" })
138 } 144 }
139 .onAreaChange((oldValue: Area, newValue: Area) => { 145 .onAreaChange((oldValue: Area, newValue: Area) => {
140 if (this.firstPositionY === 0) { 146 if (this.firstPositionY === 0) {
@@ -150,7 +156,7 @@ struct OtherNormalUserHomePage { @@ -150,7 +156,7 @@ struct OtherNormalUserHomePage {
150 .backgroundColor($r('app.color.color_transparent')) 156 .backgroundColor($r('app.color.color_transparent'))
151 .height('184lpx') 157 .height('184lpx')
152 .width('100%') 158 .width('100%')
153 - .padding({ left: '35lpx' }) 159 + .padding({ left: '6lpx' })
154 160
155 //用户简介区域 161 //用户简介区域
156 if(StringUtils.isNotEmpty(this.desc)){ 162 if(StringUtils.isNotEmpty(this.desc)){
@@ -226,6 +232,20 @@ struct OtherNormalUserHomePage { @@ -226,6 +232,20 @@ struct OtherNormalUserHomePage {
226 } 232 }
227 }.width('100%') 233 }.width('100%')
228 .layoutWeight(1) 234 .layoutWeight(1)
  235 + }else{
  236 + Column(){
  237 + CustomTitleUI({ titleName: "" })
  238 +
  239 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  240 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  241 + if(this.isChangeToUserEdit){
  242 + this.getUserInfo()
  243 + }
  244 + },})
  245 + .layoutWeight(1)
  246 + .width('100%')
  247 + }
  248 + }
229 249
230 } 250 }
231 @Builder MineHomeTitleTransparent() { 251 @Builder MineHomeTitleTransparent() {
1 import { common } from '@kit.AbilityKit'; 1 import { common } from '@kit.AbilityKit';
2 import { insightIntent } from '@kit.IntentsKit'; 2 import { insightIntent } from '@kit.IntentsKit';
3 import { BusinessError } from '@kit.BasicServicesKit'; 3 import { BusinessError } from '@kit.BasicServicesKit';
4 -import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; 4 +import { CompDTO, CompList, ContentDTO, PageInfoBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
5 5
6 function generateUUID() { 6 function generateUUID() {
7 let dt = new Date().getTime(); // 获取当前时间的时间戳(毫秒) 7 let dt = new Date().getTime(); // 获取当前时间的时间戳(毫秒)
@@ -82,12 +82,58 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent @@ -82,12 +82,58 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
82 } 82 }
83 } 83 }
84 84
  85 +//ViewBlog意图共享-节目详情 目前单独在详情页上报
  86 +export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
  87 + interactData?: InteractDataDTO) {
  88 + let identifier = generateUUID()
  89 + let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
  90 + intentName: 'ViewBlog',
  91 + intentVersion: '1.0.1',
  92 + identifier,
  93 + intentActionInfo: {
  94 + actionMode: ActionMode.EXECUTED,
  95 + currentPercentage: 50,
  96 + },
  97 + intentEntityInfo: {
  98 + entityName: 'Blog',
  99 + entityId: String(item?.newsId),
  100 + displayName: item?.newsTitle,
  101 + entityGroupId: String(item?.reLInfo?.channelId), //channelId
  102 + logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri,
  103 + metadataModificationTime: item?.publishTime,
  104 + blogTitle: item?.newsTitle,
  105 + blogType: 'Normal',
  106 + blogCategory: item,
  107 + categoryDisplayName: '', //TODO 分类名称
  108 + blogSubTitle: item?.newsSummary.length > 20 ?
  109 + item?.newsSummary.substring(0, 20) : item?.newsSummary,
  110 + blogAuthor: item?.newsSourceName,
  111 + blogPublishTime: item?.publishTime,
  112 + tag: item?.newsTags.split(','),
  113 + viewCount: item?.viewCount || 0,
  114 + likeCount: interactData?.likeNum || 0,
  115 + forwardCount: interactData?.shareNum || 0,
  116 + commentCount: interactData?.commentNum || 0,
  117 + favorites: interactData?.collectNum || 0,
  118 + rankingHint: 99,
  119 + isPublicData: true
  120 + }
  121 + }
85 122
86 -//ViewBlog意图共享-早晚报 123 + console.log('yzl', JSON.stringify(viewBlogInsightIntentItem))
  124 + // 共享数据
  125 + insightIntent.shareIntent(context, [viewBlogInsightIntentItem]).then(() => {
  126 + console.log('yzl shareIntent success');
  127 + }).catch((err: BusinessError) => {
  128 + console.error(`yzl failed because ${err?.message}`);
  129 + });
  130 +}
  131 +
  132 +//ViewColumn意图共享-早晚报
87 export function viewColumInsightIntentShare(context: common.UIAbilityContext, entityId: string, 133 export function viewColumInsightIntentShare(context: common.UIAbilityContext, entityId: string,
88 pageInfoBean: PageInfoBean) { 134 pageInfoBean: PageInfoBean) {
89 console.log('viewColumInsightIntentShare') 135 console.log('viewColumInsightIntentShare')
90 - let viewBlogInsightIntentItem: insightIntent.InsightIntent = { 136 + let viewColumInsightIntentItem: insightIntent.InsightIntent = {
91 intentName: 'ViewColumn', 137 intentName: 'ViewColumn',
92 intentVersion: '1.0.1', 138 intentVersion: '1.0.1',
93 identifier: generateUUID(), 139 identifier: generateUUID(),
@@ -108,10 +154,10 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en @@ -108,10 +154,10 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
108 isPublicData: true 154 isPublicData: true
109 } 155 }
110 } 156 }
111 - console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewBlogInsightIntentItem)) 157 + console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem))
112 158
113 // 共享数据 159 // 共享数据
114 - insightIntent.shareIntent(context, [viewBlogInsightIntentItem]).then(() => { 160 + insightIntent.shareIntent(context, [viewColumInsightIntentItem]).then(() => {
115 console.log('yzl shareIntent success'); 161 console.log('yzl shareIntent success');
116 }).catch((err: BusinessError) => { 162 }).catch((err: BusinessError) => {
117 console.error(`yzl failed because ${err?.message}`); 163 console.error(`yzl failed because ${err?.message}`);
@@ -84,6 +84,10 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod @@ -84,6 +84,10 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod
84 * @param pageAdvModel 广告数据 84 * @param pageAdvModel 广告数据
85 */ 85 */
86 export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { 86 export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
  87 + if (pageModel.isRefreshing === true) {
  88 + // 拦截多次刷新
  89 + return
  90 + }
87 pageModel.isVisiblePullDown = true; 91 pageModel.isVisiblePullDown = true;
88 pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); 92 pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
89 pullRefreshState(pageModel, RefreshState.Refreshing); 93 pullRefreshState(pageModel, RefreshState.Refreshing);
@@ -26,7 +26,7 @@ export function touchUpLoadMore(model: PageModel) { @@ -26,7 +26,7 @@ export function touchUpLoadMore(model: PageModel) {
26 }, () => { 26 }, () => {
27 self.offsetY = 0; 27 self.offsetY = 0;
28 }) 28 })
29 - if ((self.isCanLoadMore === true) && (self.hasMore === true)) { 29 + if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) {
30 self.isLoading = true; 30 self.isLoading = true;
31 setTimeout(() => { 31 setTimeout(() => {
32 closeLoadMore(model); 32 closeLoadMore(model);
@@ -47,7 +47,7 @@ export class RefreshConstants { @@ -47,7 +47,7 @@ export class RefreshConstants {
47 * The NoMoreLayout constants. 47 * The NoMoreLayout constants.
48 */ 48 */
49 static readonly NoMoreLayoutConstant_NORMAL_PADDING: number = 8; 49 static readonly NoMoreLayoutConstant_NORMAL_PADDING: number = 8;
50 - static readonly NoMoreLayoutConstant_TITLE_FONT: string = '16vp'; 50 + static readonly NoMoreLayoutConstant_TITLE_FONT: string = '12vp';
51 static readonly NoMoreLayoutConstant_TITLE_COLOR: string = '#666666'; 51 static readonly NoMoreLayoutConstant_TITLE_COLOR: string = '#666666';
52 /** 52 /**
53 * The RefreshLayout constants. 53 * The RefreshLayout constants.
1 -import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, PageDTO, PageInfoDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean';
2 import { CompStyle, ViewType } from 'wdConstant/Index'; 2 import { CompStyle, ViewType } from 'wdConstant/Index';
3 -import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils } from 'wdKit'; 3 +import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit';
4 import { closeRefresh } from '../utils/PullDownRefresh'; 4 import { closeRefresh } from '../utils/PullDownRefresh';
5 import PageModel from './PageModel'; 5 import PageModel from './PageModel';
6 import PageViewModel from './PageViewModel'; 6 import PageViewModel from './PageViewModel';
@@ -17,6 +17,14 @@ import { CacheData } from 'wdNetwork/Index'; @@ -17,6 +17,14 @@ import { CacheData } from 'wdNetwork/Index';
17 17
18 const TAG = 'PageHelper'; 18 const TAG = 'PageHelper';
19 19
  20 +// 本地的一行两图卡 style值
  21 +const OneRowDoubleColumnStyle = CompStyle.Card_Comp_Zh_Grid_Layout_02
  22 +
  23 +const Normal_Page_Size = 20 // 常规每页数量
  24 +
  25 +const Rec_Page_Size = 10 // 推荐每页数量
  26 +
  27 +
20 /** 28 /**
21 * 处理返回后的数据 29 * 处理返回后的数据
22 */ 30 */
@@ -25,9 +33,16 @@ export class PageHelper { @@ -25,9 +33,16 @@ export class PageHelper {
25 * 刷新数据 33 * 刷新数据
26 */ 34 */
27 async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) { 35 async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) {
  36 + let netStatus = NetworkUtil.isNetConnected()
  37 + if (!netStatus) {
  38 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  39 + setTimeout(() => {
  40 + closeRefresh(pageModel, false)
  41 + }, 500)
  42 + return
  43 + }
28 pageModel.loadStrategy = 2 44 pageModel.loadStrategy = 2
29 pageModel.pageTotalCompSize = 0; 45 pageModel.pageTotalCompSize = 0;
30 - // TODO 下拉刷新,是否加载缓存  
31 this.getPageInfo(pageModel, pageAdvModel) 46 this.getPageInfo(pageModel, pageAdvModel)
32 } 47 }
33 48
@@ -35,6 +50,11 @@ export class PageHelper { @@ -35,6 +50,11 @@ export class PageHelper {
35 * 分页加载 50 * 分页加载
36 */ 51 */
37 async loadMore(pageModel: PageModel) { 52 async loadMore(pageModel: PageModel) {
  53 + let netStatus = NetworkUtil.isNetConnected()
  54 + if (!netStatus) {
  55 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  56 + return
  57 + }
38 pageModel.loadStrategy = 3 58 pageModel.loadStrategy = 3
39 // 暂只支持comp分页加载,节目分页加载的得完善框架(如直播回看节目数据分页) 59 // 暂只支持comp分页加载,节目分页加载的得完善框架(如直播回看节目数据分页)
40 this.compLoadMore(pageModel) 60 this.compLoadMore(pageModel)
@@ -44,60 +64,20 @@ export class PageHelper { @@ -44,60 +64,20 @@ export class PageHelper {
44 * 进页面请求数据 64 * 进页面请求数据
45 */ 65 */
46 async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) { 66 async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) {
47 - Logger.error('zzzz','getInitCacheData') 67 + Logger.debug(TAG, 'getInitCacheData')
48 PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => { 68 PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => {
  69 + Logger.debug(TAG, 'getInitCacheData back: ' + pageInfo)
49 if (pageInfo == null) { 70 if (pageInfo == null) {
50 return; 71 return;
51 } 72 }
52 pageModel.pageInfo = pageInfo; 73 pageModel.pageInfo = pageInfo;
  74 + pageModel.cachePageInfoMd5 = pageInfo.md5
53 //解析页面挂角广告资源 75 //解析页面挂角广告资源
54 pageAdvModel.analysisAdvSource(pageInfo); 76 pageAdvModel.analysisAdvSource(pageInfo);
55 - this.parseCacheGroup(pageModel) 77 + this.parseGroup(pageModel, true)
56 }) 78 })
57 } 79 }
58 80
59 - async parseCacheGroup(pageModel: PageModel) {  
60 - Logger.error('zzzz','parseCacheGroup')  
61 - let pageInfo: PageInfoDTO = pageModel.pageInfo  
62 - pageModel.groupList = []  
63 - pageInfo.pageAdList = []  
64 - pageInfo.oneRequestPageGroupCompList = new ArrayList()  
65 - pageModel.groupList.push(...pageInfo.groups)  
66 - Logger.error("ZZZXXXXX", 'parseCacheGroup----1-----');  
67 - for (const group of pageInfo.groups) {  
68 - pageModel.groupId = group.id;  
69 - pageModel.groupData = group  
70 - Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);  
71 - // await,确保groups接口顺序执行  
72 - let pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO  
73 - let index = pageInfo.groups.indexOf(group)  
74 - if (index == 0) {  
75 - // 清空comp列表  
76 - pageModel.compList.clear()  
77 - }  
78 - this.analysisPageGroupCompData(pageModel,pageDto, pageInfo, index == pageInfo.groups.length - 1)  
79 - Logger.error("ZZZXXXXX", '楼层id-end--》' + pageModel.groupId + ' 楼层 comp数量=' + pageDto.compList.length);  
80 - }  
81 -  
82 - // 收集页面所有楼层的组件信息,同步完成广告投放计算,异步完成稿件批查,  
83 -  
84 - pageModel.pageTotalCompSize = pageInfo.oneRequestPageGroupCompList.length + pageModel.pageTotalCompSize  
85 - // 处理页面广告数据,投放到页面的位置  
86 - // TODO 缓存数据不加载广告  
87 - // this.handlePageCompAdvPostion(pageInfo.oneRequestPageGroupCompList, pageModel, pageInfo.pageAdList);  
88 -  
89 - //遍历所有组件和稿件数据 push到页面  
90 - for (let element of pageInfo.oneRequestPageGroupCompList) {  
91 - pageModel.compList.push(CompDTO.createNewsBean(element))  
92 - }  
93 - Logger.error('zzzz', 'parseCacheGroup count: ' + pageModel.compList.totalCount())  
94 - pageModel.currentPage++  
95 - pageModel.viewType = ViewType.LOADED  
96 - closeRefresh(pageModel, true)  
97 -  
98 - Logger.error("ZZZXXXXX", 'parseGroup----3----->' + pageInfo.oneRequestPageGroupCompList.length);  
99 - }  
100 -  
101 /** 81 /**
102 * 进页面请求数据 82 * 进页面请求数据
103 */ 83 */
@@ -131,62 +111,106 @@ export class PageHelper { @@ -131,62 +111,106 @@ export class PageHelper {
131 promptAction.showToast({ message: err }); 111 promptAction.showToast({ message: err });
132 }) 112 })
133 } else { 113 } else {
  114 + Logger.debug(TAG, 'getPageInfo')
134 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { 115 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
  116 + Logger.debug(TAG, 'getPageInfo back: ' + JSON.stringify(pageInfo))
135 if (pageInfo == null) { 117 if (pageInfo == null) {
136 pageModel.viewType = ViewType.EMPTY; 118 pageModel.viewType = ViewType.EMPTY;
137 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; 119 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
138 return; 120 return;
139 } 121 }
140 pageModel.pageInfo = pageInfo; 122 pageModel.pageInfo = pageInfo;
  123 + if (pageInfo.md5 == pageModel.cachePageInfoMd5) {
  124 + // 缓存一致,不解析
  125 + Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。')
  126 + } else {
  127 + Logger.debug(TAG, 'getPageInfo 要解析广告')
  128 + if (pageModel.currentPage == 1) {
  129 + // 保存缓存
  130 + CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5)
  131 + }
141 //解析页面挂角广告资源 132 //解析页面挂角广告资源
142 pageAdvModel.analysisAdvSource(pageInfo); 133 pageAdvModel.analysisAdvSource(pageInfo);
143 - this.parseGroup(pageModel)  
144 - // if (pageModel.currentPage == 1) {  
145 - // // 保存缓存  
146 - // CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5)  
147 - // } 134 + }
  135 + Logger.debug(TAG, 'getPageInfo go on')
  136 + this.parseGroup(pageModel, false)
148 }).catch(() => { 137 }).catch(() => {
  138 + if (this.isPageLoaded(pageModel)) {
  139 + return
  140 + }
149 pageModel.viewType = ViewType.EMPTY; 141 pageModel.viewType = ViewType.EMPTY;
150 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed; 142 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed;
151 }) 143 })
152 } 144 }
153 } 145 }
154 146
  147 + private isPageLoaded(pageModel: PageModel) {
  148 + if (pageModel.compList.size() > 0) {
  149 + return true
  150 + }
  151 + return false
  152 + }
155 153
156 /** 154 /**
157 * 解析信息流页面楼层数据 155 * 解析信息流页面楼层数据
158 * @param pageModel 156 * @param pageModel
159 */ 157 */
160 - async parseGroup(pageModel: PageModel) { 158 + async parseGroup(pageModel: PageModel, isCache: boolean) {
161 let pageInfo: PageInfoDTO = pageModel.pageInfo 159 let pageInfo: PageInfoDTO = pageModel.pageInfo
162 pageModel.groupList = [] 160 pageModel.groupList = []
163 pageInfo.pageAdList = [] 161 pageInfo.pageAdList = []
164 pageInfo.oneRequestPageGroupCompList = new ArrayList() 162 pageInfo.oneRequestPageGroupCompList = new ArrayList()
165 pageModel.groupList.push(...pageInfo.groups) 163 pageModel.groupList.push(...pageInfo.groups)
166 - Logger.error("ZZZXXXXX", 'parseGroup----1-----');  
167 for (const group of pageInfo.groups) { 164 for (const group of pageInfo.groups) {
168 pageModel.isRecGroup = group.groupStrategy === 1; 165 pageModel.isRecGroup = group.groupStrategy === 1;
169 pageModel.groupId = group.id; 166 pageModel.groupId = group.id;
170 if (pageModel.isRecGroup) { 167 if (pageModel.isRecGroup) {
171 - pageModel.pageSize = 10 168 + pageModel.pageSize = Rec_Page_Size
172 } else { 169 } else {
173 - pageModel.pageSize = 20 170 + pageModel.pageSize = Normal_Page_Size
174 } 171 }
175 pageModel.groupData = group 172 pageModel.groupData = group
176 173
177 - Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId); 174 + //Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
  175 + let pageDto: PageDTO
  176 + Logger.debug(TAG, 'parseGroup isCache: ' + isCache)
  177 + if (isCache) {
  178 + pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
  179 + pageModel.cacheGroupInfoMd5 = pageDto.md5
  180 + } else {
  181 + pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
  182 + if (pageDto.md5 == pageModel.cacheGroupInfoMd5) {
  183 + Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5)
  184 + // 缓存数据一致,不再刷新
  185 + return
  186 + }
  187 + Logger.debug(TAG, 'parseGroup cache load, save: ')
  188 + // 保存缓存
  189 + CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto,
  190 + pageDto.md5)
  191 + }
  192 + Logger.debug(TAG, 'parseGroup go on')
178 // await,确保groups接口顺序执行 193 // await,确保groups接口顺序执行
179 - let pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO 194 + // let pageDto = page
180 let index = pageInfo.groups.indexOf(group) 195 let index = pageInfo.groups.indexOf(group)
181 - if (index == 0) {  
182 - // 清空comp列表  
183 - pageModel.compList.clear()  
184 - // // 保存缓存  
185 - // CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto,  
186 - // pageDto.md5) 196 +
  197 + // 解析楼层组件
  198 + this.analysisPageGroupCompData(pageDto, pageInfo)
  199 +
  200 + // 最后一个楼层,特殊处理
  201 + if (index == pageInfo.groups.length - 1) {
  202 + // 检测楼层最后一个组件业务数据是否需要通过访问接口获取
  203 + let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1]
  204 + // 直播回放,需要二次请求数据
  205 + if (comp.compStyle == CompStyle.Zh_Grid_Layout_02) {
  206 + pageInfo.lastCompSourceType = 1
  207 + let listReviewDtoBean = await PageViewModel.getLiveReviewUrl(1, Normal_Page_Size) as LiveReviewDTO
  208 + // 创建一行两图卡组件
  209 + this.createDoubleColumComp(listReviewDtoBean, pageInfo)
  210 + } else {
  211 + pageInfo.lastCompSourceType = 0
  212 + }
187 } 213 }
188 - this.analysisPageGroupCompData(pageModel,pageDto, pageInfo, index == pageInfo.groups.length - 1)  
189 - Logger.error("ZZZXXXXX", '楼层id-end--》' + pageModel.groupId + ' 楼层 comp数量=' + pageDto.compList.length);  
190 } 214 }
191 215
192 /* 216 /*
@@ -196,9 +220,11 @@ export class PageHelper { @@ -196,9 +220,11 @@ export class PageHelper {
196 // 处理页面广告数据,投放到页面的位置 220 // 处理页面广告数据,投放到页面的位置
197 this.handlePageCompAdvPostion(pageInfo.oneRequestPageGroupCompList, pageModel, pageInfo.pageAdList); 221 this.handlePageCompAdvPostion(pageInfo.oneRequestPageGroupCompList, pageModel, pageInfo.pageAdList);
198 222
  223 + // 清空comp列表
  224 + pageModel.compList.clear()
199 //遍历所有组件和稿件数据 push到页面 225 //遍历所有组件和稿件数据 push到页面
200 for (let element of pageInfo.oneRequestPageGroupCompList) { 226 for (let element of pageInfo.oneRequestPageGroupCompList) {
201 - pageModel.compList.push(CompDTO.createNewsBean(element)) 227 + pageModel.compList.push(element)
202 } 228 }
203 229
204 // 批查互动数据 230 // 批查互动数据
@@ -209,7 +235,6 @@ export class PageHelper { @@ -209,7 +235,6 @@ export class PageHelper {
209 pageModel.viewType = ViewType.LOADED 235 pageModel.viewType = ViewType.LOADED
210 closeRefresh(pageModel, true) 236 closeRefresh(pageModel, true)
211 237
212 - Logger.error("ZZZXXXXX", 'parseGroup----3----->' + pageInfo.oneRequestPageGroupCompList.length);  
213 if (pageModel.compList.isEmpty()) { 238 if (pageModel.compList.isEmpty()) {
214 // 没数据,展示空页面 239 // 没数据,展示空页面
215 Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); 240 Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
@@ -225,26 +250,11 @@ export class PageHelper { @@ -225,26 +250,11 @@ export class PageHelper {
225 * @param pageInfo 信息流页面信息 250 * @param pageInfo 信息流页面信息
226 * @param isLastGroup pageDto信息是不是最后一个楼层 251 * @param isLastGroup pageDto信息是不是最后一个楼层
227 */ 252 */
228 - private async analysisPageGroupCompData(pageModel: PageModel,pageDto: PageDTO, pageInfo: PageInfoDTO, isLastGroup: boolean) { 253 + private async analysisPageGroupCompData(pageDto: PageDTO, pageInfo: PageInfoDTO) {
229 254
230 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 255 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
231 256
232 - let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集楼层组件、稿件和本地组件容器  
233 - // 遍历楼层的组件数据  
234 - pageDto.compList.forEach((element: CompDTO) => {  
235 - let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);  
236 - //移除音频 和 活动  
237 - if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {  
238 - Logger.debug(TAG, 'getGroupData 移除音频 和 活动');  
239 - } else {  
240 - // 暂时屏蔽活动和音频详情入口  
241 - if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') {  
242 - } else {  
243 - pageCompList.add(element)  
244 - }  
245 - }  
246 - })  
247 - 257 + let pageCompList = this.factoryCompArray(pageDto.compList)
248 // pageInfor 记录 258 // pageInfor 记录
249 pageCompList.forEach((comp: CompDTO) => { 259 pageCompList.forEach((comp: CompDTO) => {
250 pageInfo.oneRequestPageGroupCompList.add(comp) 260 pageInfo.oneRequestPageGroupCompList.add(comp)
@@ -255,19 +265,6 @@ export class PageHelper { @@ -255,19 +265,6 @@ export class PageHelper {
255 pageInfo.pageAdList.push(...pageDto.compAdList) 265 pageInfo.pageAdList.push(...pageDto.compAdList)
256 } 266 }
257 267
258 - // 检测最后一个楼层是否有一行两图卡  
259 - if (isLastGroup) {  
260 - // 最后一个楼层,特殊处理  
261 - // 检测楼层最后一个组件业务数据是否需要通过访问接口获取  
262 - let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1]  
263 - // 直播回放,需要二次请求数据  
264 - if ( comp.compStyle == CompStyle.Zh_Grid_Layout_02) {  
265 - // 这个comp,数据自己二次请求,自己分页处理,这里加flag,将page层滑动及loadmore ui去掉  
266 - pageModel.contentNeedScroll = true  
267 -  
268 - //this.getLiveReviewData(pageInfo,comp)  
269 - }  
270 - }  
271 } 268 }
272 269
273 } 270 }
@@ -295,8 +292,16 @@ export class PageHelper { @@ -295,8 +292,16 @@ export class PageHelper {
295 promptAction.showToast({ message: err }); 292 promptAction.showToast({ message: err });
296 }) 293 })
297 } else { 294 } else {
  295 +
  296 + if (pageModel.pageInfo.lastCompSourceType == 1) {
  297 + // 加载更多 走 直播回看接口
  298 + this.getLiveReviewData(pageModel, pageModel.pageInfo)
  299 +
  300 + } else {
  301 + // 默认加载更多走 楼层接口
298 PageViewModel.getPageGroupCompData(pageModel.bizCopy()) 302 PageViewModel.getPageGroupCompData(pageModel.bizCopy())
299 .then((data: PageDTO) => { 303 .then((data: PageDTO) => {
  304 +
300 if (data == null || data.compList == null || data.compList.length == 0) { 305 if (data == null || data.compList == null || data.compList.length == 0) {
301 pageModel.hasMore = false; 306 pageModel.hasMore = false;
302 } else { 307 } else {
@@ -314,6 +319,7 @@ export class PageHelper { @@ -314,6 +319,7 @@ export class PageHelper {
314 }) 319 })
315 } 320 }
316 } 321 }
  322 + }
317 323
318 324
319 /** 325 /**
@@ -321,9 +327,34 @@ export class PageHelper { @@ -321,9 +327,34 @@ export class PageHelper {
321 */ 327 */
322 private loadMorePageComp(pageModel: PageModel, pageDto: PageDTO) { 328 private loadMorePageComp(pageModel: PageModel, pageDto: PageDTO) {
323 329
324 - let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 330 + let pageCompList = this.factoryCompArray(pageDto.compList) // 收集页面组件、稿件和本地组件容器
  331 +
  332 + // pageInfor 记录
  333 + pageModel.pageInfo.oneRequestPageGroupCompList.clear()
  334 + pageCompList.forEach((comp: CompDTO) => {
  335 + pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
  336 + })
325 337
326 - pageDto.compList.forEach((element: CompDTO) => { 338 + // 记录
  339 + pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
  340 + // 处理页面广告数据,投放到页面的位置
  341 + this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto.compAdList);
  342 +
  343 + //遍历所有组件和稿件数据 push到页面
  344 + for (let element of pageCompList) {
  345 + pageModel.compList.push(element)
  346 + }
  347 +
  348 + }
  349 +
  350 + /**
  351 + * 加工 组件数组信息
  352 + * @param compList
  353 + * @returns
  354 + */
  355 + private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> {
  356 + let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器
  357 + compList.forEach((element: CompDTO) => {
327 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); 358 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
328 //移除音频 和 活动 359 //移除音频 和 活动
329 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { 360 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
@@ -332,22 +363,17 @@ export class PageHelper { @@ -332,22 +363,17 @@ export class PageHelper {
332 // 暂时屏蔽活动和音频详情入口 363 // 暂时屏蔽活动和音频详情入口
333 if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { 364 if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') {
334 } else { 365 } else {
335 - pageCompList.add(element) 366 + if (element.name == "月度排行卡") {
  367 +
  368 + } else {
  369 + pageCompList.add(CompDTO.createNewsBean(element))
  370 + }
336 } 371 }
337 } 372 }
338 373
339 }) 374 })
340 375
341 - // 记录  
342 - pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize  
343 - // 处理页面广告数据,投放到页面的位置  
344 - this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto.compAdList);  
345 -  
346 - //遍历所有组件和稿件数据 push到页面  
347 - for (let element of pageCompList) {  
348 - pageModel.compList.push(CompDTO.createNewsBean(element))  
349 - }  
350 - 376 + return pageCompList
351 } 377 }
352 378
353 /** 379 /**
@@ -356,6 +382,8 @@ export class PageHelper { @@ -356,6 +382,8 @@ export class PageHelper {
356 * @param pageModel 382 * @param pageModel
357 */ 383 */
358 private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) { 384 private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) {
  385 +
  386 + // 批查人数
359 PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { 387 PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => {
360 // 刷新,替换所有数据 388 // 刷新,替换所有数据
361 this.resetInteract(data, pageModel.compList) 389 this.resetInteract(data, pageModel.compList)
@@ -366,6 +394,10 @@ export class PageHelper { @@ -366,6 +394,10 @@ export class PageHelper {
366 } 394 }
367 }) 395 })
368 396
  397 + // 批查直播观看人数
  398 + this.getLiveRoomDataInfo(compList)
  399 +
  400 +
369 // 测试数据 401 // 测试数据
370 // setTimeout(() => { 402 // setTimeout(() => {
371 // let index = 1 403 // let index = 1
@@ -381,6 +413,59 @@ export class PageHelper { @@ -381,6 +413,59 @@ export class PageHelper {
381 } 413 }
382 414
383 /** 415 /**
  416 + * 直播回看的批查数据
  417 + * @param list
  418 + * @param compList
  419 + */
  420 + private getLiveRoomDataInfo(compList: CompDTO[]) {
  421 +
  422 + let list: ContentDTO[] = []
  423 + compList.forEach((comp: CompDTO) => {
  424 + if (comp.compStyle == OneRowDoubleColumnStyle) {
  425 + list.push(...comp.operDataList)
  426 + }
  427 + })
  428 + let time = DateTimeUtils.getTimeStamp().toString()
  429 +
  430 + let reserveIds = this.getLiveDetailIds(list)
  431 +
  432 + PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => {
  433 + if (result && result.length > 0) {
  434 + result.forEach((bean: LiveRoomDataBean) => {
  435 + for (let item of list) {
  436 + if (item.objectId == bean.liveId.toString()) {
  437 + item.liveRoomDataBean = bean
  438 + outer: for (let compBean of compList) {
  439 + for (let contentBean of compBean.operDataList) {
  440 + if (contentBean === item) {
  441 + compBean.timestamp = time
  442 + break outer
  443 + }
  444 + }
  445 + }
  446 + break
  447 + }
  448 + }
  449 + })
  450 + }
  451 + }).catch(() => {
  452 + })
  453 + }
  454 +
  455 + /**
  456 + * 获取直播详情id入参
  457 + * @param list
  458 + * @returns
  459 + */
  460 + private getLiveDetailIds(list: ContentDTO[]): string {
  461 + let idList: string[] = []
  462 + list.forEach(item => {
  463 + idList.push(item.objectId)
  464 + });
  465 + return idList.join(',')
  466 + }
  467 +
  468 + /**
384 * 刷新互动数据到compList 469 * 刷新互动数据到compList
385 * @param interact 批查互动数据结果 470 * @param interact 批查互动数据结果
386 * @param compList comp list 471 * @param compList comp list
@@ -560,12 +645,98 @@ export class PageHelper { @@ -560,12 +645,98 @@ export class PageHelper {
560 /** 645 /**
561 * 获取直播回看数据 646 * 获取直播回看数据
562 */ 647 */
563 - private async getLiveReviewData(pageInfo: PageInfoDTO,comp: CompDTO) { 648 + private async getLiveReviewData(pageModel: PageModel, pageInfo: PageInfoDTO) {
  649 +
  650 + let currentPage = pageModel.currentPage
  651 + let pageSize = Normal_Page_Size
  652 +
  653 + PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => {
  654 + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
  655 + pageModel.hasMore = false;
  656 + } else {
  657 +
  658 + pageInfo.oneRequestPageGroupCompList.clear()
  659 + // 直接认为有分页,一直加载分页。直到没有数据,再停止
  660 + pageModel.currentPage++;
  661 + pageModel.hasMore = true;
  662 +
  663 + let haveMoveContent = false
  664 + //获取当前页面最后一个组件
  665 + let lastIndex = pageModel.compList.totalCount() - 1
  666 + let lastComp = pageModel.compList.getData(lastIndex) as CompDTO
  667 + // 一行两图卡,需要从奇数 补齐成偶数内容
  668 + if (lastComp.compStyle == OneRowDoubleColumnStyle) {
  669 +
  670 + let operLength = lastComp.operDataList.length
  671 + // 页面的最后一个组件的业务数据是奇数,需要从获取更多的业务数据中补一个数据
  672 + if (operLength === 1) {
  673 + haveMoveContent = true
  674 + lastComp.operDataList.push(liveReviewDTO.list[0])
  675 + // 更新某个组件
  676 + pageModel.compList.updateItem(lastComp, lastIndex)
  677 + // 移走新获取的数据中第一条数据
  678 + liveReviewDTO.list.splice(0, 1)
  679 + }
  680 + }
  681 + // 创建本地一行两图卡
  682 + this.createDoubleColumComp(liveReviewDTO, pageInfo)
  683 + // 统计页面的总的组件和稿件数量
  684 + pageModel.pageTotalCompSize = pageInfo.oneRequestPageGroupCompList.length + pageModel.pageTotalCompSize
  685 + //遍历所有组件和稿件数据 push到页面
  686 + for (let element of pageInfo.oneRequestPageGroupCompList) {
  687 + pageModel.compList.push(element)
  688 + }
564 689
565 - let currentPage = 1  
566 - let pageSize = 20  
567 - let listReviewDtoBean = await PageViewModel.getLiveReviewUrl(currentPage, pageSize) as LiveReviewDTO  
568 - Logger.error("ZZZXXXXX", 'getLiveReviewData---------'+listReviewDtoBean.list.length); 690 + // 批查直播观看人数
  691 + if (haveMoveContent) {
  692 + // 把当前获取到的直播回看数据
  693 + pageInfo.oneRequestPageGroupCompList.add(lastComp)
  694 + }
  695 +
  696 + this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray())
  697 +
  698 + }
  699 +
  700 + }).catch((err: string | Resource) => {
  701 + promptAction.showToast({ message: err });
  702 + })
  703 + }
  704 +
  705 + /**
  706 + * 创建一行两图卡 自定义的业务稿件
  707 + * @param listReviewDtoBean
  708 + * @param pageInfo
  709 + */
  710 + private createDoubleColumComp(listReviewDtoBean: LiveReviewDTO, pageInfo: PageInfoDTO, test?: boolean) {
  711 + /*
  712 + 两个业务 内容 配置一个comp
  713 + */
  714 + let length = listReviewDtoBean.list.length
  715 +
  716 + // if (test) {
  717 + // // 偶数变成奇数
  718 + // if (length % 2 === 0) {
  719 + // listReviewDtoBean.list.splice(length - 1, 1)
  720 + // length = listReviewDtoBean.list.length
  721 + // }
  722 + // }
  723 +
  724 + for (let i = 0; i < length; i = i + 2) {
  725 + let sliceArray: ContentDTO[]
  726 + let j = i + 2
  727 +
  728 + if (j < length) {
  729 + sliceArray = listReviewDtoBean.list.slice(i, j)
  730 + } else {
  731 + sliceArray = listReviewDtoBean.list.slice(i)
  732 + }
  733 + // 创建一行两图卡 自定义的业务稿件
  734 + let doubleColumnLiveReviewComp = new CompDTO()
  735 + doubleColumnLiveReviewComp.compStyle = OneRowDoubleColumnStyle
  736 + let operDataList: ContentDTO[] = sliceArray
  737 + doubleColumnLiveReviewComp.operDataList = operDataList
  738 + pageInfo.oneRequestPageGroupCompList.add(doubleColumnLiveReviewComp)
  739 + }
569 740
570 } 741 }
571 } 742 }
@@ -63,6 +63,10 @@ export default class PageModel { @@ -63,6 +63,10 @@ export default class PageModel {
63 pageType: number = 0; 63 pageType: number = 0;
64 64
65 extra: string = '' 65 extra: string = ''
  66 + // 缓存数据相关
  67 + cachePageInfoMd5: string = ''
  68 + cacheGroupInfoMd5: string = ''
  69 +
66 /** 70 /**
67 * 简单复制业务数据 71 * 简单复制业务数据
68 */ 72 */
@@ -162,13 +162,21 @@ @@ -162,13 +162,21 @@
162 } 162 }
163 , 163 ,
164 { 164 {
165 - "name": "color_9E9E9E_40", 165 + "name": "color_FFFFFF_40",
166 "value": "#40FFFFFF" 166 "value": "#40FFFFFF"
167 } 167 }
168 , 168 ,
169 { 169 {
170 "name": "color_ED2800_99", 170 "name": "color_ED2800_99",
171 "value": "#99ED2800" 171 "value": "#99ED2800"
  172 + },
  173 + {
  174 + "name": "color_white_30",
  175 + "value": "#4D000000"
  176 + },
  177 + {
  178 + "name": "color_848484",
  179 + "value": "#848484"
172 } 180 }
173 ] 181 ]
174 } 182 }
@@ -23,8 +23,8 @@ export struct LiveCountdownComponent { @@ -23,8 +23,8 @@ export struct LiveCountdownComponent {
23 aboutToAppear(): void { 23 aboutToAppear(): void {
24 //注册字体 24 //注册字体
25 font.registerFont({ 25 font.registerFont({
26 - familyName: 'BebasNeue_Regular',  
27 - familySrc: $rawfile('font/BebasNeue_Regular.otf') 26 + familyName: 'BebasNeueBold',
  27 + familySrc: $rawfile('font/BebasNeueBold.otf')
28 }) 28 })
29 setTimeout(() => { 29 setTimeout(() => {
30 this.textTimerController.start() 30 this.textTimerController.start()
@@ -69,13 +69,16 @@ export struct LiveCountdownComponent { @@ -69,13 +69,16 @@ export struct LiveCountdownComponent {
69 .showTimeStyleBold() 69 .showTimeStyleBold()
70 Text('月') 70 Text('月')
71 .showTimeStyleNormal() 71 .showTimeStyleNormal()
72 - .margin({ left: 3 }) 72 + .margin({ left: 1 })
  73 + .baselineOffset('-6vp')
73 Text(this.day) 74 Text(this.day)
74 .showTimeStyleBold() 75 .showTimeStyleBold()
75 .margin({ left: 3 }) 76 .margin({ left: 3 })
76 Text('日') 77 Text('日')
77 .showTimeStyleNormal() 78 .showTimeStyleNormal()
78 - .margin({ left: 3 }) 79 + .margin({ left: 1 })
  80 + .baselineOffset('-6vp')
  81 +
79 Text(this.hour) 82 Text(this.hour)
80 .showTimeStyleBold() 83 .showTimeStyleBold()
81 .margin({ left: 10 }) 84 .margin({ left: 10 })
@@ -85,15 +88,15 @@ export struct LiveCountdownComponent { @@ -85,15 +88,15 @@ export struct LiveCountdownComponent {
85 .showTimeStyleBold() 88 .showTimeStyleBold()
86 } 89 }
87 .margin({ top: 10 }) 90 .margin({ top: 10 })
88 - .visibility(this.isCountDownStart ? Visibility.None : Visibility.Visible  
89 - ) 91 + .visibility(this.isCountDownStart ? Visibility.None : Visibility.Visible)
90 92
  93 + // 倒计时
91 TextTimer({ isCountDown: true, count: this.differenceTimeStamp, controller: this.textTimerController }) 94 TextTimer({ isCountDown: true, count: this.differenceTimeStamp, controller: this.textTimerController })
92 .format(this.format) 95 .format(this.format)
93 - .fontSize('40fp') 96 + .fontSize('40vp')
94 .fontWeight(FontWeight.Bold) 97 .fontWeight(FontWeight.Bold)
95 .fontColor('#222222') 98 .fontColor('#222222')
96 - .fontFamily('BebasNeue_Regular') 99 + .fontFamily('BebasNeueBold')
97 .onTimer((utc: number, elapsedTime: number) => { 100 .onTimer((utc: number, elapsedTime: number) => {
98 console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime) 101 console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime)
99 }) 102 })
@@ -139,7 +142,7 @@ export struct LiveCountdownComponent { @@ -139,7 +142,7 @@ export struct LiveCountdownComponent {
139 //2024-04-01 19:44:00-trim->2024-04-0119:44:00 142 //2024-04-01 19:44:00-trim->2024-04-0119:44:00
140 if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { 143 if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
141 let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim() 144 let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim()
142 - this.month = playStartTimeTmp.substring(5, 7) 145 + this.month = Number(playStartTimeTmp.substring(5, 7)).toString()
143 this.day = playStartTimeTmp.substring(8, 10) 146 this.day = playStartTimeTmp.substring(8, 10)
144 this.hour = playStartTimeTmp.substring(11, 13) 147 this.hour = playStartTimeTmp.substring(11, 13)
145 this.minute = playStartTimeTmp.substring(14, 16) 148 this.minute = playStartTimeTmp.substring(14, 16)
@@ -182,7 +185,7 @@ export struct LiveCountdownComponent { @@ -182,7 +185,7 @@ export struct LiveCountdownComponent {
182 185
183 @Extend(Text) 186 @Extend(Text)
184 function showTimeStyleNormal() { 187 function showTimeStyleNormal() {
185 - .fontSize('16fp') 188 + .fontSize('16vp')
186 .fontWeight(500) 189 .fontWeight(500)
187 .fontColor('#222222') 190 .fontColor('#222222')
188 } 191 }
@@ -190,7 +193,7 @@ function showTimeStyleNormal() { @@ -190,7 +193,7 @@ function showTimeStyleNormal() {
190 @Extend(Text) 193 @Extend(Text)
191 function showTimeStyleBold() { 194 function showTimeStyleBold() {
192 .fontSize('40fp') 195 .fontSize('40fp')
193 - .fontFamily('BebasNeue_Regular') 196 + .fontFamily('BebasNeueBold')
194 .fontWeight(FontWeight.Bold) 197 .fontWeight(FontWeight.Bold)
195 .fontColor('#222222') 198 .fontColor('#222222')
196 } 199 }
@@ -30,7 +30,8 @@ export struct TabInfoComponent { @@ -30,7 +30,8 @@ export struct TabInfoComponent {
30 Text(this.liveDetailsBean.newsTitle) 30 Text(this.liveDetailsBean.newsTitle)
31 .maxLines(2) 31 .maxLines(2)
32 .textOverflow({ overflow: TextOverflow.Ellipsis }) 32 .textOverflow({ overflow: TextOverflow.Ellipsis })
33 - .fontSize('18fp') 33 + .fontSize('18vp')
  34 + .lineHeight('26vp')
34 .fontWeight(500) 35 .fontWeight(500)
35 .fontColor('#222222') 36 .fontColor('#222222')
36 } 37 }
@@ -40,9 +41,10 @@ export struct TabInfoComponent { @@ -40,9 +41,10 @@ export struct TabInfoComponent {
40 Text(this.liveDetailsBean.newIntroduction) 41 Text(this.liveDetailsBean.newIntroduction)
41 .maxLines(5) 42 .maxLines(5)
42 .textOverflow({ overflow: TextOverflow.Ellipsis }) 43 .textOverflow({ overflow: TextOverflow.Ellipsis })
43 - .fontSize('14fp') 44 + .fontSize('14vp')
44 .fontWeight(400) 45 .fontWeight(400)
45 .fontColor('#666666') 46 .fontColor('#666666')
  47 + .lineHeight('22vp')
46 .margin({ top: 8 }) 48 .margin({ top: 8 })
47 } 49 }
48 } 50 }
@@ -25,13 +25,13 @@ export struct TabLiveItemComponent { @@ -25,13 +25,13 @@ export struct TabLiveItemComponent {
25 Text(this.item.senderUserName) 25 Text(this.item.senderUserName)
26 .maxLines(1) 26 .maxLines(1)
27 .textOverflow({ overflow: TextOverflow.Ellipsis }) 27 .textOverflow({ overflow: TextOverflow.Ellipsis })
28 - .fontSize('14fp') 28 + .fontSize('14vp')
29 .fontWeight(400) 29 .fontWeight(400)
30 .fontColor('#222222') 30 .fontColor('#222222')
31 Text(this.item.role === 'host' ? '主持人' : '嘉宾') 31 Text(this.item.role === 'host' ? '主持人' : '嘉宾')
32 .maxLines(1) 32 .maxLines(1)
33 .textOverflow({ overflow: TextOverflow.Ellipsis }) 33 .textOverflow({ overflow: TextOverflow.Ellipsis })
34 - .fontSize('11fp') 34 + .fontSize('11vp')
35 .fontWeight(400) 35 .fontWeight(400)
36 .fontColor('#968562') 36 .fontColor('#968562')
37 .backgroundColor('#F1EFEB') 37 .backgroundColor('#F1EFEB')
@@ -44,17 +44,18 @@ export struct TabLiveItemComponent { @@ -44,17 +44,18 @@ export struct TabLiveItemComponent {
44 .borderRadius(2) 44 .borderRadius(2)
45 .margin({ left: 8 }) 45 .margin({ left: 8 })
46 .visibility(StringUtils.isNotEmpty(this.item.role) ? Visibility.Visible : Visibility.None) 46 .visibility(StringUtils.isNotEmpty(this.item.role) ? Visibility.Visible : Visibility.None)
  47 +
47 Text(DateTimeUtils.getCommentTime(new Date(this.item.time).getTime())) 48 Text(DateTimeUtils.getCommentTime(new Date(this.item.time).getTime()))
48 .maxLines(1) 49 .maxLines(1)
49 .textOverflow({ overflow: TextOverflow.Ellipsis }) 50 .textOverflow({ overflow: TextOverflow.Ellipsis })
50 - .fontSize('12fp') 51 + .fontSize('12vp')
51 .fontWeight(400) 52 .fontWeight(400)
52 .fontColor('#999999') 53 .fontColor('#999999')
53 .margin({ left: 8 }) 54 .margin({ left: 8 })
54 .visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None) 55 .visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None)
55 56
56 Text('置顶') 57 Text('置顶')
57 - .fontSize('11fp') 58 + .fontSize('11vp')
58 .fontWeight(400) 59 .fontWeight(400)
59 .fontColor('#ED2800') 60 .fontColor('#ED2800')
60 .backgroundColor('#F1EFEB') 61 .backgroundColor('#F1EFEB')
@@ -71,9 +72,10 @@ export struct TabLiveItemComponent { @@ -71,9 +72,10 @@ export struct TabLiveItemComponent {
71 } 72 }
72 73
73 Text(this.item.text) 74 Text(this.item.text)
74 - .fontSize('14fp') 75 + .fontSize('14vp')
75 .fontWeight(400) 76 .fontWeight(400)
76 .fontColor('#222222') 77 .fontColor('#222222')
  78 + .lineHeight('20vp')
77 .margin({ 79 .margin({
78 top: 6 80 top: 6
79 }) 81 })
@@ -89,8 +89,8 @@ export struct PlayUIComponent { @@ -89,8 +89,8 @@ export struct PlayUIComponent {
89 Text(this.liveDetailsBean.newsTitle) 89 Text(this.liveDetailsBean.newsTitle)
90 .maxLines(1) 90 .maxLines(1)
91 .textOverflow({ overflow: TextOverflow.MARQUEE }) 91 .textOverflow({ overflow: TextOverflow.MARQUEE })
92 - .fontSize('16fp')  
93 - .fontWeight(500) 92 + .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp')
  93 + .fontWeight(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 600 : 500)
94 .fontColor(Color.White) 94 .fontColor(Color.White)
95 .textAlign(TextAlign.Start) 95 .textAlign(TextAlign.Start)
96 .layoutWeight(1) 96 .layoutWeight(1)
@@ -200,7 +200,7 @@ export struct PlayUIComponent { @@ -200,7 +200,7 @@ export struct PlayUIComponent {
200 else if (this.liveDetailsBean.liveInfo?.liveState == 'end') { 200 else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {
201 Row() { 201 Row() {
202 Text('回看') 202 Text('回看')
203 - .fontSize('11fp') 203 + .fontSize('11vp')
204 .fontWeight(400) 204 .fontWeight(400)
205 .fontColor(Color.White) 205 .fontColor(Color.White)
206 206
@@ -209,7 +209,7 @@ export struct PlayUIComponent { @@ -209,7 +209,7 @@ export struct PlayUIComponent {
209 .width(12) 209 .width(12)
210 .height(12) 210 .height(12)
211 Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) 211 Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)
212 - .fontSize('11fp') 212 + .fontSize('11vp')
213 .fontWeight(400) 213 .fontWeight(400)
214 .fontColor(Color.White) 214 .fontColor(Color.White)
215 } 215 }
@@ -221,6 +221,8 @@ export struct PlayUIComponent { @@ -221,6 +221,8 @@ export struct PlayUIComponent {
221 top: 1, 221 top: 1,
222 right: 4, 222 right: 4,
223 bottom: 1 223 bottom: 1
  224 + }).margin({
  225 + left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '34vp' : 0
224 }) 226 })
225 } 227 }
226 } 228 }
@@ -15,8 +15,7 @@ import { HttpUtils } from 'wdNetwork/Index'; @@ -15,8 +15,7 @@ import { HttpUtils } from 'wdNetwork/Index';
15 import { DateTimeUtils, WindowModel } from 'wdKit/Index'; 15 import { DateTimeUtils, WindowModel } from 'wdKit/Index';
16 import { PlayerBottomView } from '../view/PlayerBottomView'; 16 import { PlayerBottomView } from '../view/PlayerBottomView';
17 import { PlayerRightView } from '../view/PlayerRightView'; 17 import { PlayerRightView } from '../view/PlayerRightView';
18 -import { CommentComponentPage } from '../view/CommentComponentPage';  
19 -import { window } from '@kit.ArkUI'; 18 +import { CommentDialogView } from '../view/CommentDialogView';
20 import { DisplayDirection } from 'wdConstant/Index'; 19 import { DisplayDirection } from 'wdConstant/Index';
21 20
22 const TAG = 'DetailPlayShortVideoPage'; 21 const TAG = 'DetailPlayShortVideoPage';
@@ -39,7 +38,7 @@ export struct DetailPlayShortVideoPage { @@ -39,7 +38,7 @@ export struct DetailPlayShortVideoPage {
39 @Provide followStatus: string = '0' // 关注状态 38 @Provide followStatus: string = '0' // 关注状态
40 @Provide isOpenDetail: boolean = false // 查看详情按钮点击 39 @Provide isOpenDetail: boolean = false // 查看详情按钮点击
41 @Provide isDragging: boolean = false // 拖动时间进度条 40 @Provide isDragging: boolean = false // 拖动时间进度条
42 - @Provide showCommentList: boolean = false 41 + @Consume showCommentList: boolean
43 @Consume displayDirection: DisplayDirection 42 @Consume displayDirection: DisplayDirection
44 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean 43 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean
45 @Consume @Watch('pageShowChange') pageShow: number 44 @Consume @Watch('pageShowChange') pageShow: number
@@ -225,15 +224,7 @@ export struct DetailPlayShortVideoPage { @@ -225,15 +224,7 @@ export struct DetailPlayShortVideoPage {
225 .height('100%') 224 .height('100%')
226 .width('100%') 225 .width('100%')
227 226
228 - // .padding({  
229 - // top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'  
230 - // })  
231 -  
232 - if (this.showCommentList) {  
233 - CommentComponentPage({})  
234 - .position({ y: '100%' })  
235 - .markAnchor({ y: '100%' })  
236 - } 227 + CommentDialogView({ publishCommentModel: this.publishCommentModel })
237 } 228 }
238 .height('100%') 229 .height('100%')
239 .width('100%') 230 .width('100%')
@@ -294,13 +285,14 @@ export struct DetailPlayShortVideoPage { @@ -294,13 +285,14 @@ export struct DetailPlayShortVideoPage {
294 .margin({ left: 8, right: 4 }) 285 .margin({ left: 8, right: 4 })
295 Text("全屏观看") 286 Text("全屏观看")
296 .fontColor(Color.White) 287 .fontColor(Color.White)
  288 + .fontWeight(400)
297 .fontSize(12) 289 .fontSize(12)
298 .layoutWeight(1) 290 .layoutWeight(1)
299 } 291 }
300 .width(84) 292 .width(84)
301 .height(28) 293 .height(28)
302 - .backgroundColor('#0d0d0d')  
303 - .border({ width: 1, color: '#4DFFFFFF', radius: 2 }) 294 + .backgroundColor('#0DFFFFFF')
  295 + .border({ width: 1, color: '#4DFFFFFF', radius: 4 })
304 .alignItems(VerticalAlign.Center) 296 .alignItems(VerticalAlign.Center)
305 .justifyContent(FlexAlign.Center) 297 .justifyContent(FlexAlign.Center)
306 .align(Alignment.Bottom) 298 .align(Alignment.Bottom)
@@ -28,6 +28,7 @@ export struct DetailVideoListPage { @@ -28,6 +28,7 @@ export struct DetailVideoListPage {
28 @Provide pageHide: number = -1 28 @Provide pageHide: number = -1
29 @Provide switchVideoStatus: boolean = true 29 @Provide switchVideoStatus: boolean = true
30 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL 30 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
  31 + @Provide showCommentList: boolean = false
31 @State data: ContentDetailDTO[] = [] 32 @State data: ContentDetailDTO[] = []
32 @State currentIndex: number = 0 33 @State currentIndex: number = 0
33 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 34 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@@ -185,7 +186,6 @@ export struct DetailVideoListPage { @@ -185,7 +186,6 @@ export struct DetailVideoListPage {
185 middle: { anchor: "__container__", align: HorizontalAlign.Center } 186 middle: { anchor: "__container__", align: HorizontalAlign.Center }
186 }) 187 })
187 } else { 188 } else {
188 -  
189 Column() { 189 Column() {
190 Swiper(this.swiperController) { 190 Swiper(this.swiperController) {
191 ForEach(this.data, (item: ContentDetailDTO, index: number) => { 191 ForEach(this.data, (item: ContentDetailDTO, index: number) => {
@@ -197,7 +197,8 @@ export struct DetailVideoListPage { @@ -197,7 +197,8 @@ export struct DetailVideoListPage {
197 }) 197 })
198 }, (item: ContentDetailDTO) => item.newsId + '') 198 }, (item: ContentDetailDTO) => item.newsId + '')
199 } 199 }
200 - .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true) 200 + .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || this.showCommentList ?
  201 + false : true)
201 .indicator(false) 202 .indicator(false)
202 .vertical(true) 203 .vertical(true)
203 .loop(false) 204 .loop(false)
@@ -221,5 +222,6 @@ export struct DetailVideoListPage { @@ -221,5 +222,6 @@ export struct DetailVideoListPage {
221 // bottom: this.bottomSafeHeight + 'px' 222 // bottom: this.bottomSafeHeight + 'px'
222 // }) 223 // })
223 } 224 }
  225 +
224 } 226 }
225 } 227 }
@@ -45,13 +45,15 @@ export struct VideoChannelDetail { @@ -45,13 +45,15 @@ export struct VideoChannelDetail {
45 @Consume barBackgroundColor: Color 45 @Consume barBackgroundColor: Color
46 private swiperController: SwiperController = new SwiperController() 46 private swiperController: SwiperController = new SwiperController()
47 @Provide showComment: boolean = false 47 @Provide showComment: boolean = false
48 - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0  
49 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 48 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
50 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0 49 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
  50 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  51 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
51 @Consume @Watch('pageShowChange') pageShow: number 52 @Consume @Watch('pageShowChange') pageShow: number
52 @Consume @Watch('pageHideChange') pageHide: number 53 @Consume @Watch('pageHideChange') pageHide: number
53 @Provide switchVideoStatus: boolean = true 54 @Provide switchVideoStatus: boolean = true
54 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL 55 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
  56 + @Provide showCommentList: boolean = false
55 @State data: ContentDetailDTO[] = [] 57 @State data: ContentDetailDTO[] = []
56 @State currentIndex: number = 0 58 @State currentIndex: number = 0
57 @State interactDataList: InteractDataDTO[] = [] 59 @State interactDataList: InteractDataDTO[] = []
@@ -267,8 +269,8 @@ export struct VideoChannelDetail { @@ -267,8 +269,8 @@ export struct VideoChannelDetail {
267 }, (item: ContentDetailDTO) => item.newsId + '') 269 }, (item: ContentDetailDTO) => item.newsId + '')
268 } 270 }
269 .displayCount(1, true) 271 .displayCount(1, true)
270 - .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true)  
271 - .visibility(this.isMouted ? Visibility.Visible : Visibility.None) 272 + .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || this.showCommentList ? false : true)
  273 + .visibility(this.isMouted ? Visibility.Visible : Visibility.Hidden)
272 .indicator(false) 274 .indicator(false)
273 .vertical(true) 275 .vertical(true)
274 .loop(false) 276 .loop(false)
1 -import { ContentDetailDTO } from 'wdBean/Index'  
2 -import { WindowModel } from 'wdKit/Index'  
3 -import {  
4 - publishCommentModel  
5 -} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'  
6 -import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent'  
7 -  
8 -import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'  
9 -  
10 -@Component  
11 -export struct CommentComponentPage {  
12 - scroller: Scroller = new Scroller()  
13 - @Consume contentDetailData: ContentDetailDTO  
14 - @Consume showCommentList: boolean  
15 - @State publishCommentModel: publishCommentModel = new publishCommentModel()  
16 -  
17 - aboutToAppear(): void {  
18 -  
19 - this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')  
20 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')  
21 - this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle  
22 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')  
23 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')  
24 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')  
25 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')  
26 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')  
27 - }  
28 -  
29 - build() {  
30 - Column() {  
31 - Scroll(this.scroller) {  
32 - Stack() {  
33 - CommentComponent({  
34 - publishCommentModel: this.publishCommentModel  
35 - })  
36 - Image($r("app.media.ic_close_black"))  
37 - .width(20)  
38 - .height(20)  
39 - .onClick(() => {  
40 - this.showCommentList = false  
41 - })  
42 - .margin({ top: 10, right: 30 })  
43 - .position({ x: '100%' })  
44 - .markAnchor({ x: '100%' })  
45 -  
46 - }  
47 - }  
48 - .layoutWeight(1)  
49 -  
50 - OperRowListView({  
51 - componentType: 1,  
52 - operationButtonList: ['comment', 'like', 'collect', 'share'],  
53 - contentDetailData: this.contentDetailData,  
54 - publishCommentModel: this.publishCommentModel,  
55 - showCommentIcon: true,  
56 - onBack: () => {  
57 - WindowModel.shared.setWindowLayoutFullScreen(false)  
58 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })  
59 - }  
60 - })  
61 - }  
62 - .zIndex(1000)  
63 - .backgroundColor(Color.White)  
64 - .height('60%')  
65 -  
66 - }  
67 -}  
  1 +import { ContentDetailDTO } from 'wdBean/Index'
  2 +import { WindowModel } from 'wdKit/Index'
  3 +import {
  4 + publishCommentModel
  5 +} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
  6 +import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent'
  7 +import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'
  8 +
  9 +
  10 +@Component
  11 +export struct CommentDialogView {
  12 + @Prop publishCommentModel: publishCommentModel
  13 + @Consume windowWidth: number
  14 + @Consume windowHeight: number
  15 + @Consume bottomSafeHeight: number
  16 + @Consume topSafeHeight: number
  17 + @Consume contentDetailData: ContentDetailDTO
  18 + @Consume @Watch('showCommentListChange') showCommentList: boolean
  19 + @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
  20 + @State modifier: DrawModifier = new DrawModifier();
  21 + private dialogController: CustomDialogController = new CustomDialogController({
  22 + builder: DetailDialog({
  23 + publishCommentModel: this.publishCommentModel,
  24 + dialogOffsetY: $dialogOffsetY
  25 + }),
  26 + autoCancel: false,
  27 + customStyle: true,
  28 + alignment: DialogAlignment.Bottom,
  29 + // onWillDismiss: (dismissDialogAction: DismissDialogAction) => {
  30 + // this.showCommentList = false
  31 + // dismissDialogAction.dismiss()
  32 + // },
  33 + openAnimation: { duration: 0 },
  34 + closeAnimation: { duration: 0 },
  35 + })
  36 +
  37 + /**
  38 + * 问题:弹窗从底部到上动画无法添加
  39 + */
  40 +
  41 + showCommentListChange(val: boolean) {
  42 + if (this.showCommentList) {
  43 + this.dialogController.open()
  44 + console.log('open')
  45 + // animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
  46 + // this.dialogOffsetY = 500
  47 + // this.modifier.invalidate()
  48 + // })
  49 + } else {
  50 + this.dialogController.close()
  51 + console.log('close')
  52 + }
  53 + }
  54 +
  55 + build() {
  56 + }
  57 +}
  58 +
  59 +@CustomDialog
  60 +export struct DetailDialog {
  61 + controller: CustomDialogController
  62 + @Prop publishCommentModel: publishCommentModel
  63 + @Link dialogOffsetY: number
  64 + @Consume contentDetailData: ContentDetailDTO
  65 + @Consume showCommentList: boolean
  66 + @Consume windowWidth: number
  67 + @Consume windowHeight: number
  68 +
  69 + build() {
  70 + Column() {
  71 + CommentComponent({
  72 + publishCommentModel: this.publishCommentModel,
  73 + showCloseIcon: true,
  74 + onCloseClick: () => {
  75 + console.log('onCloseClick')
  76 + this.showCommentList = false
  77 + this.controller.close()
  78 + }
  79 + })
  80 + .layoutWeight(1)
  81 + OperRowListView({
  82 + componentType: 1,
  83 + showBackIcon: false,
  84 + operationButtonList: ['comment', 'like', 'collect', 'share'],
  85 + contentDetailData: this.contentDetailData,
  86 + publishCommentModel: this.publishCommentModel,
  87 + showCommentIcon: true,
  88 + onBack: () => {
  89 + WindowModel.shared.setWindowLayoutFullScreen(false)
  90 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  91 + }
  92 + })
  93 + }
  94 + .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
  95 + // .margin({ top: this.dialogOffsetY + 'px' })
  96 + .zIndex(1000)
  97 + .backgroundColor(Color.White)
  98 + }
  99 +}
@@ -109,6 +109,8 @@ export struct OperationListView { @@ -109,6 +109,8 @@ export struct OperationListView {
109 contentList: [{ 109 contentList: [{
110 contentId: this.contentDetailData?.newsId + '', 110 contentId: this.contentDetailData?.newsId + '',
111 contentType: this.contentDetailData?.newsType + '', 111 contentType: this.contentDetailData?.newsType + '',
  112 + relType: this.contentDetailData?.reLInfo?.relType + '',
  113 + contentRelId: this.contentDetailData?.reLInfo?.relId + '',
112 }], 114 }],
113 115
114 } 116 }
@@ -68,6 +68,8 @@ export struct PlayerProgressView { @@ -68,6 +68,8 @@ export struct PlayerProgressView {
68 console.log('slider onChange:', value, mode) 68 console.log('slider onChange:', value, mode)
69 69
70 }) 70 })
71 - }.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible) 71 + }
  72 + .margin({ top: 40 })
  73 + .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
72 } 74 }
73 } 75 }
@@ -87,6 +87,8 @@ export struct PlayerRightView { @@ -87,6 +87,8 @@ export struct PlayerRightView {
87 contentList: [{ 87 contentList: [{
88 contentId: this.contentDetailData?.newsId + '', 88 contentId: this.contentDetailData?.newsId + '',
89 contentType: this.contentDetailData?.newsType + '', 89 contentType: this.contentDetailData?.newsType + '',
  90 + relType: this.contentDetailData?.reLInfo?.relType + '',
  91 + contentRelId: this.contentDetailData?.reLInfo?.relId + '',
90 }], 92 }],
91 93
92 } 94 }
@@ -2,4 +2,5 @@ export { add } from "./src/main/ets/utils/Calc" @@ -2,4 +2,5 @@ export { add } from "./src/main/ets/utils/Calc"
2 2
3 export { HWLocationUtils } from './src/main/ets/location/HWLocationUtils' 3 export { HWLocationUtils } from './src/main/ets/location/HWLocationUtils'
4 4
5 -export { WDPushNotificationManager } from "./src/main/ets/notification/WDPushNotificationManager"  
  5 +// export { WDPushNotificationManager } from "./src/main/ets/notification/WDPushNotificationManager"
  6 +export { GetuiPush } from "./src/main/ets/getuiPush/GetuiPush"
@@ -7,10 +7,12 @@ @@ -7,10 +7,12 @@
7 "license": "Apache-2.0", 7 "license": "Apache-2.0",
8 "packageType": "InterfaceHar", 8 "packageType": "InterfaceHar",
9 "dependencies": { 9 "dependencies": {
  10 + "library": "file:./src/main/ets/getuiPush/GTSDK-1.0.1.0.har",
10 "wdConstant": "file:../../commons/wdConstant", 11 "wdConstant": "file:../../commons/wdConstant",
11 "wdLogin": "file:../../features/wdLogin", 12 "wdLogin": "file:../../features/wdLogin",
12 "wdKit": "file:../../commons/wdKit", 13 "wdKit": "file:../../commons/wdKit",
13 "wdBean": "file:../../features/wdBean", 14 "wdBean": "file:../../features/wdBean",
  15 + "wdRouter": "file:../../commons/wdRouter",
14 "wdNetwork": "file:../../commons/wdNetwork" 16 "wdNetwork": "file:../../commons/wdNetwork"
15 } 17 }
16 } 18 }
  1 +import { common, Want } from '@kit.AbilityKit';
  2 +import PushManager, {
  3 + BindAliasCmdMessage,
  4 + GTCmdMessage, GTNotificationMessage, GTTransmitMessage, PushConst,
  5 + SetTagCmdMessage,
  6 + Tag,
  7 + UnBindAliasCmdMessage } from 'library';
  8 +import { AppUtils, DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper } from 'wdKit/Index';
  9 +import { HostEnum, HostManager, HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index';
  10 +import { notificationManager } from '@kit.NotificationKit';
  11 +import { BusinessError } from '@kit.BasicServicesKit';
  12 +import { SpConstants } from 'wdConstant/Index';
  13 +import { PushContentBean, PushContentParser } from './PushContentParser';
  14 +
  15 +const TAG = "GetuiPush"
  16 +
  17 +export class GetuiPush {
  18 +
  19 + private static GETUI_APPID_ONLINE = "sMkzgp09Ov82nU1MGk7Ae6"
  20 + private static GETUI_APPID_TEST = "ZMi5AAXYHE84VN9p55YpW2"
  21 +
  22 + private readonly ALIAS_SN_USERID = "userID"
  23 + private readonly TAG_SN_TAG = "tag1"
  24 + private readonly TAG_PD_ZH = "peopledaily_zh"
  25 +
  26 + private cid: string = ""
  27 + private deviceToken: string = ""
  28 + private currentUserId = ""
  29 + private lastPushContent?: PushContentBean
  30 +
  31 + private initialed = false
  32 +
  33 + private constructor() {
  34 + }
  35 +
  36 + private static manager: GetuiPush
  37 + static sharedInstance() : GetuiPush {
  38 + if (!GetuiPush.manager) {
  39 + GetuiPush.manager = new GetuiPush()
  40 + }
  41 + return GetuiPush.manager
  42 + }
  43 +
  44 + init(context: common.UIAbilityContext) {
  45 +
  46 + const isOnlineEnv = HostManager.getHost() === HostEnum.HOST_PRODUCT
  47 +
  48 + PushManager.initialize({
  49 + appId:isOnlineEnv ? GetuiPush.GETUI_APPID_TEST : GetuiPush.GETUI_APPID_TEST,
  50 + context: context,
  51 + onSuccess: (cid:string) => {
  52 + Logger.debug(TAG, "个推SDK初始化成功,cid = " + cid)
  53 + this.initialed = true
  54 + this.cid = cid
  55 + this.registerEvents()
  56 + this.checkSetup()
  57 + },
  58 + onFailed: (error:string) => {
  59 + Logger.error(TAG, "个推SDK初始化失败,error = " + error)
  60 + }
  61 + })
  62 + }
  63 +
  64 + async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> {
  65 + let enabled = await notificationManager.isNotificationEnabled()
  66 + if (!enabled) {
  67 + try {
  68 + await notificationManager.requestEnableNotification(context)
  69 + enabled = true
  70 + } catch (err) {
  71 + Logger.error(TAG, "请求通知权限报错: " + JSON.stringify(err))
  72 + let error = err as BusinessError
  73 + if (error.code == 1600004) {
  74 + Logger.error(TAG, "请求通知权限 - 用户已拒绝")
  75 + }
  76 + }
  77 + }
  78 + Logger.info(TAG, "推送 enabled " + enabled)
  79 + return enabled
  80 + }
  81 +
  82 + checkSetup() {
  83 + if (!this.initialed) { return }
  84 + if (HttpUtils.isLogin()) {
  85 + const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
  86 + this.currentUserId = userId
  87 + this.setAlias(true, userId)
  88 + }
  89 + let tags = [this.TAG_PD_ZH, AppUtils.getAppVersionCode()]
  90 + this.setTags(tags)
  91 + }
  92 +
  93 + // 默认是开启的
  94 + switchPush(turnOn: boolean) {
  95 + turnOn ? PushManager.turnOnPush() : PushManager.turnOffPush()
  96 + }
  97 +
  98 + registerEvents() {
  99 +
  100 + // 登录和退出
  101 + EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
  102 + const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
  103 + this.currentUserId = userId
  104 + this.setAlias(true, userId)
  105 + })
  106 + EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
  107 + if (this.currentUserId.length) {
  108 + this.setAlias(false, this.currentUserId)
  109 + }
  110 + })
  111 +
  112 + PushManager.setPushCallback({
  113 + // cid
  114 + onReceiveClientId: (clientId: string) => {
  115 + Logger.debug(TAG, "推送 接收到 clientId = " + clientId)
  116 + this.cid = PushManager.getClientId()
  117 + SPHelper.default.save(SpConstants.GETUI_PUSH_CID, this.cid)
  118 + this.uploadPushInfo(this.cid)
  119 + },
  120 + //接收⼚商token
  121 + onReceiveDeviceToken: (deviceToken:string) => {
  122 + Logger.debug(TAG, "推送 deviceToken = " + deviceToken)
  123 + this.deviceToken = deviceToken;
  124 + SPHelper.default.save(SpConstants.GETUI_PUSH_DEVICE_TOKEN, this.deviceToken)
  125 + },
  126 + // cid 离线上线通知
  127 + onReceiveOnlineState: (onLine:boolean) => {
  128 + Logger.debug(TAG, "推送 onLine State = " + onLine)
  129 + },
  130 + //命令相应回复
  131 + onReceiveCommandResult: (result: GTCmdMessage) => {
  132 + Logger.debug(TAG, "推送 Cmd Message = " + JSON.stringify(result))
  133 + this.dealWithCmdMessage(result)
  134 + },
  135 + //sdk 收到透传消息
  136 + onReceiveMessageData: (message: GTTransmitMessage) => {
  137 + Logger.debug(TAG, "推送 透传 Message = " + JSON.stringify(message))
  138 + this.dealWithTransmitMessage(message)
  139 + },
  140 + //通知到达回调
  141 + onNotificationMessageArrived: (message: GTNotificationMessage) => {
  142 + Logger.debug(TAG, "推送 通知到达回调 " + JSON.stringify(message))
  143 + },
  144 + //通知点击回调, 需要配合PushManager.setClickWant(want)使⽤
  145 + onNotificationMessageClicked: (message: GTNotificationMessage) => {
  146 + Logger.debug(TAG, "推送 通知 点击 回调 " + JSON.stringify(message))
  147 + },
  148 + })
  149 + }
  150 +
  151 + setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) {
  152 + if (!this.initialed) { return }
  153 + if (bind) {
  154 + Logger.debug(TAG, "推送 绑定别名 " + alias)
  155 + PushManager.bindAlias(alias, sn)
  156 + } else {
  157 + Logger.debug(TAG, "推送 解绑别名 " + alias)
  158 + PushManager.unBindAlias(alias, true, sn)
  159 + }
  160 + }
  161 +
  162 + setTags(tags: string[], sn: string = this.TAG_SN_TAG) {
  163 + if (!this.initialed) { return }
  164 + Logger.debug(TAG, "推送 设置标签 " + tags)
  165 + PushManager.setTag(tags.map((tag) => {
  166 + return new Tag().setName(tag)
  167 + }), sn)
  168 + }
  169 +
  170 + setBadgeNumber(number: number) {
  171 + Logger.debug(TAG, "推送 设置角标 " + number)
  172 + PushManager.setBadgeNum(number)
  173 + }
  174 +
  175 + // 接收推送数据,包括启动和二次点击拉起
  176 + // 参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-dev-0000001727885258
  177 + onWant(want: Want) {
  178 + this.onNewWant(want, true)
  179 + }
  180 + onNewWant(want: Want, startup: boolean = false) {
  181 + Logger.debug(TAG, "want: " + JSON.stringify(want))
  182 +
  183 + this.lastPushContent = undefined
  184 + let pushContent = PushContentParser.getPushLinkFromWant(want)
  185 + if (pushContent && pushContent.isPush) {
  186 + Logger.debug(TAG, "接收到推送: " + JSON.stringify(want.parameters))
  187 + this.lastPushContent = pushContent
  188 + if (this.initialed) {
  189 + this.comsumeLastPushContent()
  190 + }
  191 + }
  192 + }
  193 +
  194 + // 首次进入主页,即可解析跳转推送
  195 + onReachMainPage() {
  196 + if (this.initialed) {
  197 + this.comsumeLastPushContent()
  198 + } else {
  199 + this.lastPushContent = undefined
  200 + }
  201 + }
  202 +
  203 + comsumeLastPushContent() {
  204 + if (!this.lastPushContent) {
  205 + return
  206 + }
  207 + if (this.lastPushContent.online) {
  208 + if (this.lastPushContent.want) {
  209 + Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
  210 + PushManager.setClickWant(this.lastPushContent.want)
  211 + }
  212 + }
  213 + if (this.lastPushContent.pushLink) {
  214 + Logger.debug(TAG, "跳转对应页面: " + this.lastPushContent.pushLink)
  215 + PushContentParser.jumpWithPushLink(this.lastPushContent.pushLink)
  216 + }
  217 + this.lastPushContent = undefined
  218 + }
  219 +
  220 + private dealWithCmdMessage(result: GTCmdMessage) {
  221 + let action: Number = result.action;
  222 + if (action === PushConst.BIND_ALIAS_RESULT) {
  223 + let bindAliasCmdMessage = result as BindAliasCmdMessage;
  224 + /* code 结果说明
  225 + 0:成功
  226 + 10099:SDK 未初始化成功
  227 + 30001:绑定别名失败,频率过快,两次调⽤的间隔需⼤于 1s
  228 + 30002:绑定别名失败,参数错误
  229 + 30003:当前 cid 绑定别名次数超限
  230 + 30004:绑定别名失败,未知异常
  231 + 30005:绑定别名时,cid 未获取到
  232 + 30006:绑定别名时,发⽣⽹络错误
  233 + 30007:别名⽆效
  234 + 30008:sn ⽆效 */
  235 + let code = bindAliasCmdMessage.code
  236 + if (code == 0) {
  237 + Logger.debug(TAG, "推送 Cmd BindAlias 成功 " + bindAliasCmdMessage.sn)
  238 + } else {
  239 + Logger.debug(TAG, "推送 Cmd BindAlias 失败 "
  240 + + ",sn = "+bindAliasCmdMessage.sn
  241 + + ",clinetId = "+bindAliasCmdMessage.clientId
  242 + + ",pkgname = "+bindAliasCmdMessage.pkgName
  243 + + ",appId = "+bindAliasCmdMessage.appId
  244 + + ",action = "+result.action
  245 + + ",code ="+bindAliasCmdMessage.code)
  246 + }
  247 + } else if (action === PushConst.UNBIND_ALIAS_RESULT) {
  248 + let unBindAliasCmdMessage = result as UnBindAliasCmdMessage
  249 + /* code 结果说明
  250 + 0:成功
  251 + 10099:SDK 未初始化成功
  252 + 30001:解绑别名失败,频率过快,两次调⽤的间隔需⼤于 1s
  253 + 30002:解绑别名失败,参数错误
  254 + 30003:当前 cid 解绑别名次数超限
  255 + 30004:解绑别名失败,未知异常
  256 + 30005:解绑别名时,cid 未获取到
  257 + 30006:解绑别名时,发⽣⽹络错误
  258 + 30007:别名⽆效
  259 + 30008:sn ⽆效*/
  260 + let code = unBindAliasCmdMessage.code
  261 + if (code == 0) {
  262 + Logger.debug(TAG, "推送 Cmd UnBindAlias 成功 " + unBindAliasCmdMessage.sn)
  263 + } else {
  264 + Logger.debug(TAG, "推送 Cmd UnBindAlias 失败 "
  265 + + ",sn = "+unBindAliasCmdMessage.sn
  266 + + ",clinetId = "+unBindAliasCmdMessage.clientId
  267 + + ",pkgname = "+unBindAliasCmdMessage.pkgName
  268 + + ",appId = "+unBindAliasCmdMessage.appId
  269 + + ",action = "+result.action
  270 + + ",code ="+unBindAliasCmdMessage.code)
  271 + }
  272 + } else if (action === PushConst.SET_TAG_RESULT) {
  273 + let setTagCmdMessage = result as SetTagCmdMessage
  274 + /* code 值说明
  275 + 0:成功
  276 + 10099:SDK 未初始化成功
  277 + 20001:tag 数量过⼤(单次设置的 tag 数量不超过 100)
  278 + 20002:调⽤次数超限(默认⼀天只能成功设置⼀次)
  279 + 20003:标签重复
  280 + 20004:服务初始化失败
  281 + 20005:setTag 异常
  282 + 20006:tag 为空
  283 + 20007:sn 为空
  284 + 20008:离线,还未登陆成功
  285 + 20009:该 appid 已经在⿊名单列表(请联系技术⽀持处理)
  286 + 20010:已存 tag 数⽬超限
  287 + 20011:tag 内容格式不正确 */
  288 + let code = setTagCmdMessage.code
  289 + if (code == 0) {
  290 + Logger.debug(TAG, "推送 Cmd SetTag 成功 " + setTagCmdMessage.sn)
  291 + } else {
  292 + Logger.debug(TAG, "推送 Cmd SetTag 失败 "
  293 + + ",sn = "+setTagCmdMessage.sn
  294 + + ",clinetId = "+setTagCmdMessage.clientId
  295 + + ",pkgname = "+setTagCmdMessage.pkgName
  296 + + ",appId = "+setTagCmdMessage.appId
  297 + + ",action = "+result.action
  298 + + ",code ="+setTagCmdMessage.code)
  299 + }
  300 + }
  301 + }
  302 +
  303 + private dealWithTransmitMessage(message: GTTransmitMessage) {
  304 + // const taskid = message.taskId
  305 + // const messageId = message.messageId
  306 + // /* 上报个推透传消息的展示回执。如果透传消息本地创建通知栏消息“展示”了,则调⽤此⽅法上报。
  307 + // */
  308 + // int gtactionid = 60001;//gtactionid传⼊60001表示个推渠道消息展示了
  309 + // boolean result = PushManager.sendFeedbackMessag(taskid, messageid, gtactionid);
  310 + // /**
  311 + // * 上报个推透传消息的点击回执。如果透传消息本地创建通知栏消息“点击”了,则调⽤此⽅法上报。
  312 + // */
  313 + // int gtactionid = 60002;//gtactionid传⼊60002表示个推渠道消息点击了
  314 + // boolean result = PushManager.sendFeedbackMessage(taskid, messageid, gtactionid);
  315 + }
  316 +
  317 + private uploadPushInfo(cid: string) {
  318 + const url = HttpUrlUtils.getUploadPushInfoUrl()
  319 + let bean: Record<string, string | number> = {}
  320 + bean["deviceId"] = DeviceUtil.clientId()
  321 + bean["cid"] = cid
  322 + bean["userId"] = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
  323 + bean["appVersion"] = AppUtils.getAppVersionName()
  324 + bean["platform"] = 3
  325 + HttpBizUtil.post<ResponseDTO<string>>(url, bean).then((data) => {
  326 + Logger.debug(TAG, "上传cid成功" + JSON.stringify(data))
  327 + }).catch((e: BusinessError) => {
  328 + Logger.debug(TAG, "上传cid失败" + JSON.stringify(e))
  329 + })
  330 + }
  331 +}
  1 +import Want from '@ohos.app.ability.Want';
  2 +import { Logger } from 'wdKit/Index';
  3 +import { JSON } from '@kit.ArkTS';
  4 +import { AppInfo } from '@mpaas/framework';
  5 +import { AppInnerLink } from 'wdRouter/Index';
  6 +
  7 +export interface PushContentBean {
  8 + isPush: boolean // 是否为推送数据
  9 + want?: Want // want参数 (用来在消费时,回执)
  10 + online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道)
  11 + pushLink?: string // 解析want,对应pushLink参数
  12 +}
  13 +
  14 +/*
  15 +
  16 + * */
  17 +export class PushContentParser {
  18 +
  19 + private static LAUNCH_PARAM_GETUI_DATA = "gtdata"
  20 + private static LAUNCH_PARAM_GETUI_TASKID = "taskid"
  21 + private static LAUNCH_PARAM_GETUI_NOTIFYID = "_push_notifyid"
  22 + private static PUSH_PARAM_PUSH_LINK = "pushLink"
  23 +
  24 + static getPushLinkFromWant(want: Want) : PushContentBean {
  25 + // 个推在线消息
  26 + if (want && want.parameters && want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA]) {
  27 + /*
  28 + {
  29 + "age": 12,
  30 + "gtdata": {
  31 + "actionid": "10010",
  32 + "appid": "ZMi5AAXYHE84VN9p55YpW2",
  33 + "bigStyle": 0,
  34 + "checkpackage": "com.peopledailychina.hosactivity",
  35 + "content": "通知内容444",
  36 + "feedbackid": "0",
  37 + "isFloat": false,
  38 + "messageid": "44fd0876c9834214a6b7032b35d9826b",
  39 + "notifID": 62288,
  40 + "notifyStyle": 0,
  41 + "payload": "",
  42 + "taskid": "TEST_0516_03a84918e7df6191502497ed2cbef384",
  43 + "title": "测试通知444",
  44 + "wantUri": "{\"deviceId\":\"\",\"bundleName\":\"com.peopledailychina.hosactivity\",\"abilityName\":\"EntryAbility\",\"uri\":\"rmrbapp://rmrb.app:8080/openwith\",\"action\":\"com.test.pushaction\",\"parameters\":{\"pushLink\":\"Getui\",\"age\":12}}"
  45 + },
  46 + "isCallBySCB": false,
  47 + "moduleName": "phone",
  48 + "pushLink": "Getui",
  49 + "ohos.aafwk.param.callerAbilityName": "",
  50 + "ohos.aafwk.param.callerBundleName": "com.ohos.sceneboard",
  51 + "ohos.aafwk.param.callerPid": 44239,
  52 + "ohos.aafwk.param.callerToken": 537702494,
  53 + "ohos.aafwk.param.callerUid": 20020018,
  54 + "specifyTokenId": 537063794
  55 + }
  56 + },*/
  57 + let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object>
  58 + if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) {
  59 + let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
  60 + if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
  61 + const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
  62 + return {
  63 + isPush: true, online: true, pushLink: pushLink, want: want
  64 + }
  65 + }
  66 + }
  67 + }
  68 +
  69 + /*
  70 + {
  71 + "deviceId": "",
  72 + "bundleName": "com.peopledailychina.hosactivity",
  73 + "abilityName": "EntryAbility",
  74 + "moduleName": "phone",
  75 + "uri": "rmrbapp://rmrb.app:8080/openwith",
  76 + "type": "",
  77 + "flags": 0,
  78 + "action": "com.test.pushaction",
  79 + "parameters": {
  80 + "_push_notifyid": 1,
  81 + "age": 12, // 自定义
  82 + "debugApp": false,
  83 + "isCallBySCB": false,
  84 + "moduleName": "phone",
  85 + "pushLink": "Getui", // 自定义
  86 + "ohos.aafwk.param.callerAbilityName": "PushServiceInnerAbility",
  87 + "ohos.aafwk.param.callerBundleName": "com.huawei.hms.pushservice",
  88 + "ohos.aafwk.param.callerPid": 22808,
  89 + "ohos.aafwk.param.callerToken": 537908725,
  90 + "ohos.aafwk.param.callerUid": 20004,
  91 + "ohos.dlp.params.sandbox": false
  92 + },
  93 + "entities": [
  94 +
  95 + ]
  96 + * */
  97 + // 离线消息,华为直接推送
  98 + if (want && want.parameters && want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_NOTIFYID]) {
  99 + if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
  100 + let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
  101 + return {
  102 + isPush: true, online: false, pushLink: pushLink, want: want
  103 + }
  104 + }
  105 + }
  106 +
  107 + return {
  108 + isPush: false, online: false
  109 + }
  110 + }
  111 +
  112 + static jumpWithPushLink(pushLink: string) {
  113 + AppInnerLink.jumpWithLink(pushLink)
  114 + }
  115 +}
@@ -17,7 +17,7 @@ struct GuidePages { @@ -17,7 +17,7 @@ struct GuidePages {
17 this.ChildItem(index) 17 this.ChildItem(index)
18 18
19 }, (item: number) => JSON.stringify(item)) 19 }, (item: number) => JSON.stringify(item))
20 - }.loop(false) 20 + }.loop(false).disableSwipe(true)
21 .indicator(false) 21 .indicator(false)
22 .width('100%') 22 .width('100%')
23 .height('100%') 23 .height('100%')
@@ -7,7 +7,6 @@ import window from '@ohos.window'; @@ -7,7 +7,6 @@ import window from '@ohos.window';
7 import { BusinessError } from '@ohos.base'; 7 import { BusinessError } from '@ohos.base';
8 import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit'; 8 import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit';
9 import { ConfigurationConstant } from '@kit.AbilityKit'; 9 import { ConfigurationConstant } from '@kit.AbilityKit';
10 -import { WDPushNotificationManager } from 'wdHwAbility/Index';  
11 import { StartupManager } from '../startupmanager/StartupManager'; 10 import { StartupManager } from '../startupmanager/StartupManager';
12 import { UIContext } from '@ohos.arkui.UIContext'; 11 import { UIContext } from '@ohos.arkui.UIContext';
13 12
@@ -29,7 +28,7 @@ export default class EntryAbility extends UIAbility { @@ -29,7 +28,7 @@ export default class EntryAbility extends UIAbility {
29 28
30 // App活着情况下,点击推送通知进入 29 // App活着情况下,点击推送通知进入
31 onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { 30 onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
32 - WDPushNotificationManager.getInstance().onWant(want) 31 + StartupManager.sharedInstance().appOnNewWant(want, launchParam)
33 } 32 }
34 33
35 onDestroy(): void { 34 onDestroy(): void {
1 import { BottomNavigationComponent, LogoutViewModel, PermissionDesComponent } from 'wdComponent'; 1 import { BottomNavigationComponent, LogoutViewModel, PermissionDesComponent } from 'wdComponent';
2 import { BreakpointConstants } from 'wdConstant'; 2 import { BreakpointConstants } from 'wdConstant';
3 3
4 -import { HWLocationUtils, WDPushNotificationManager } from 'wdHwAbility/Index';  
5 import { common } from '@kit.AbilityKit'; 4 import { common } from '@kit.AbilityKit';
6 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit'; 5 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit';
7 import { promptAction, window } from '@kit.ArkUI'; 6 import { promptAction, window } from '@kit.ArkUI';
@@ -33,16 +32,6 @@ struct MainPage { @@ -33,16 +32,6 @@ struct MainPage {
33 32
34 this.breakpointSystem.register() 33 this.breakpointSystem.register()
35 34
36 - let context = getContext(this) as common.UIAbilityContext  
37 - WDPushNotificationManager.getInstance().requestEnableNotifications(context).then((enabled) => {  
38 - if (enabled) {  
39 - WDPushNotificationManager.getInstance().fetchTokenAndBindProfileId()  
40 -  
41 - // WDPushNotificationManager.getInstance().sendLocalNotification()  
42 - }  
43 - HWLocationUtils.startLocationService()  
44 - })  
45 -  
46 Logger.info(TAG, `aboutToAppear `); 35 Logger.info(TAG, `aboutToAppear `);
47 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { 36 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
48 LogoutViewModel.clearLoginInfo() 37 LogoutViewModel.clearLoginInfo()