Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
17 changed files
with
295 additions
and
162 deletions
| @@ -38,6 +38,7 @@ export class SpConstants{ | @@ -38,6 +38,7 @@ export class SpConstants{ | ||
| 38 | static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称 | 38 | static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称 |
| 39 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 | 39 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 |
| 40 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 | 40 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 |
| 41 | + static LOCATION_FIRST_POSITION = 'location_first_position'// 定位后顶导首次使用地理信息 | ||
| 41 | 42 | ||
| 42 | //启动页数据存储key | 43 | //启动页数据存储key |
| 43 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' | 44 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' |
| 1 | -import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean'; | 1 | +import { Action, ContentDTO, Params, PhotoListBean, commentInfo, CompDTO } from 'wdBean'; |
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; | 3 | import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; |
| 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; | 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; |
| @@ -72,6 +72,76 @@ export class ProcessUtils { | @@ -72,6 +72,76 @@ export class ProcessUtils { | ||
| 72 | ProcessUtils.processPage(content); | 72 | ProcessUtils.processPage(content); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | + //更多 | ||
| 76 | + static compJumpPage(bean:CompDTO){ | ||
| 77 | + let contentBean = ProcessUtils.compBeanToContentBean(bean) | ||
| 78 | + if(contentBean == null){ | ||
| 79 | + return | ||
| 80 | + } | ||
| 81 | + if(ProcessUtils.checkMoreJumpPage(bean)){ | ||
| 82 | + ProcessUtils.processPage(contentBean) | ||
| 83 | + }else{ | ||
| 84 | + ProcessUtils.moreTojumpLivePage(contentBean); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + static moreTojumpLivePage(contentBean:ContentDTO){ | ||
| 89 | + if(!StringUtils.isEmpty(contentBean.dataSourceType)){ | ||
| 90 | + if(contentBean.dataSourceType == 'LIVE_HORIZONTAL_CARD') { | ||
| 91 | + //直播中 | ||
| 92 | + WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage) | ||
| 93 | + }else if(contentBean.dataSourceType == 'LIVE_RESERVATION'){ | ||
| 94 | + //预约列表 | ||
| 95 | + WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) | ||
| 96 | + }else if(contentBean.dataSourceType == 'LIVE_MONTHLY_RANKING'){ | ||
| 97 | + contentBean.objectType = '6' | ||
| 98 | + ProcessUtils.processPage(contentBean) | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + static checkMoreJumpPage(content:CompDTO){ | ||
| 104 | + let loacalJump = true | ||
| 105 | + if(content.dataSourceType == 'LIVE_HORIZONTAL_CARD'){ | ||
| 106 | + loacalJump = false | ||
| 107 | + }else if(content.dataSourceType == 'LIVE_RESERVATION'){ | ||
| 108 | + loacalJump = false | ||
| 109 | + }else if(content.dataSourceType == 'LIVE_MONTHLY_RANKING'){ | ||
| 110 | + loacalJump = false | ||
| 111 | + } | ||
| 112 | + return loacalJump | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + static compBeanToContentBean(compDTO:CompDTO){ | ||
| 116 | + if(compDTO == null){ | ||
| 117 | + return | ||
| 118 | + } | ||
| 119 | + let content = new ContentDTO() | ||
| 120 | + content.objectType = compDTO.objectType||'0' | ||
| 121 | + content.objectLevel = compDTO.objectLevel | ||
| 122 | + content.objectId = compDTO.objectId | ||
| 123 | + content.pageId = compDTO.pageId||'' | ||
| 124 | + content.newsTitle = compDTO.objectTitle | ||
| 125 | + content.newsSummary = compDTO.objectSummary | ||
| 126 | + // compContentBean.setTopicInfoBean(getTopicInfoBean()); | ||
| 127 | + // compContentBean.setChannelInfoBean(getChannelInfoBean()); | ||
| 128 | + content.bottomNavId = compDTO.bottomNavId | ||
| 129 | + content.sourceInterfaceVal = compDTO.sourceInterfaceVal | ||
| 130 | + content.dataSourceType = compDTO.dataSourceType | ||
| 131 | + content.compId = compDTO.id+'' | ||
| 132 | + content.linkUrl = compDTO.linkUrl | ||
| 133 | + content.appStyle = compDTO.appStyle | ||
| 134 | + content.recommend = compDTO.recommend | ||
| 135 | + content.expIds = compDTO.expIds | ||
| 136 | + content.relId = compDTO.relId | ||
| 137 | + content.relType = compDTO.relType | ||
| 138 | + content.itemId = compDTO.itemId | ||
| 139 | + content.itemType = compDTO.itemType | ||
| 140 | + content.sceneId = compDTO.sceneId | ||
| 141 | + content.traceId = compDTO.traceId | ||
| 142 | + content.traceInfo = compDTO.traceInfo | ||
| 143 | + return content | ||
| 144 | + } | ||
| 75 | /** | 145 | /** |
| 76 | * 页面跳转 | 146 | * 页面跳转 |
| 77 | */ | 147 | */ |
| @@ -114,6 +184,8 @@ export class ProcessUtils { | @@ -114,6 +184,8 @@ export class ProcessUtils { | ||
| 114 | ProcessUtils.gotoAudio(content) | 184 | ProcessUtils.gotoAudio(content) |
| 115 | break; | 185 | break; |
| 116 | case ContentConstants.TYPE_TELETEXT: | 186 | case ContentConstants.TYPE_TELETEXT: |
| 187 | + ProcessUtils.gotoWeb(content); | ||
| 188 | + break; | ||
| 117 | case ContentConstants.TYPE_Activity: | 189 | case ContentConstants.TYPE_Activity: |
| 118 | // 图文详情,跳转h5 | 190 | // 图文详情,跳转h5 |
| 119 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 | 191 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 |
| @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO { | @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO { | ||
| 25 | // meddleDataList: any[]; | 25 | // meddleDataList: any[]; |
| 26 | name: string = ''; | 26 | name: string = ''; |
| 27 | objectId: string = ''; // 跳转页面id? | 27 | objectId: string = ''; // 跳转页面id? |
| 28 | + /** | ||
| 29 | + * 频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间轴专题) | ||
| 30 | + */ | ||
| 31 | + objectLevel:string = '' | ||
| 28 | objectTitle: string = ''; // comp标题 | 32 | objectTitle: string = ''; // comp标题 |
| 33 | + objectSummary: string = ''; // 跳转频道、专题摘要【BFF聚合】 | ||
| 29 | // objectType?: string; // 跳转类型,枚举: | 34 | // objectType?: string; // 跳转类型,枚举: |
| 30 | operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 | 35 | operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 |
| 31 | // pageId?: any; | 36 | // pageId?: any; |
| @@ -51,8 +56,22 @@ export class CompDTO implements BaseDTO { | @@ -51,8 +56,22 @@ export class CompDTO implements BaseDTO { | ||
| 51 | 56 | ||
| 52 | // keyGenerator相关字符串,用于刷新list布局 | 57 | // keyGenerator相关字符串,用于刷新list布局 |
| 53 | timestamp: String = '1' | 58 | timestamp: String = '1' |
| 54 | - relId?: String = '' | ||
| 55 | - relType?: String = '' | 59 | + |
| 60 | + bottomNavId:string = '' | ||
| 61 | + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口 | ||
| 62 | + sourceInterfaceVal: number = 0 | ||
| 63 | + | ||
| 64 | + appStyle: string = ''; | ||
| 65 | + /** | ||
| 66 | + * 是否推荐数据;默认0:否,1:是 | ||
| 67 | + */ | ||
| 68 | + recommend:number = 0 | ||
| 69 | + relId: string = ''; | ||
| 70 | + relType: string = ''; | ||
| 71 | + itemType: string = ''; | ||
| 72 | + sceneId: string = ''; | ||
| 73 | + traceId: string = ''; | ||
| 74 | + traceInfo: string = ''; | ||
| 56 | /** | 75 | /** |
| 57 | * 创建新的compbean对象 | 76 | * 创建新的compbean对象 |
| 58 | * @param old | 77 | * @param old |
| @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO { | @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO { | ||
| 27 | liveType?: string; // 直播新闻-直播状态 | 27 | liveType?: string; // 直播新闻-直播状态 |
| 28 | expIds: string = ''; | 28 | expIds: string = ''; |
| 29 | itemId: string = ''; | 29 | itemId: string = ''; |
| 30 | + itemType: string = ''; | ||
| 30 | shareFlag?: string = '1'; | 31 | shareFlag?: string = '1'; |
| 31 | appStyle: string = ''; | 32 | appStyle: string = ''; |
| 32 | cityCode: string = ''; | 33 | cityCode: string = ''; |
| @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO { | @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO { | ||
| 123 | timestamp: String = '1' | 124 | timestamp: String = '1' |
| 124 | // 自定义参数,用于跳转对应页面时 传递targetLayout参数用 | 125 | // 自定义参数,用于跳转对应页面时 传递targetLayout参数用 |
| 125 | customParamTargetLayout?: string | 126 | customParamTargetLayout?: string |
| 127 | + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口 | ||
| 128 | + sourceInterfaceVal: number = 0 | ||
| 129 | + /** | ||
| 130 | + * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) | ||
| 131 | + */ | ||
| 132 | + dataSourceType: string = ''; | ||
| 133 | + //组件ID | ||
| 134 | + compId: string = ''; | ||
| 135 | + /** | ||
| 136 | + * 是否推荐数据;默认0:否,1:是 | ||
| 137 | + */ | ||
| 138 | + recommend:number = 0 | ||
| 139 | + traceId: string = ''; | ||
| 140 | + traceInfo: string = ''; | ||
| 126 | 141 | ||
| 127 | static clone(old: ContentDTO): ContentDTO { | 142 | static clone(old: ContentDTO): ContentDTO { |
| 128 | let content = new ContentDTO(); | 143 | let content = new ContentDTO(); |
| @@ -208,14 +208,14 @@ export struct CompParser { | @@ -208,14 +208,14 @@ export struct CompParser { | ||
| 208 | if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { | 208 | if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { |
| 209 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 209 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 210 | } else { | 210 | } else { |
| 211 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) | 211 | + Divider().strokeWidth(5).color('#f5f5f5') |
| 212 | } | 212 | } |
| 213 | } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | 213 | } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { |
| 214 | // 大专题 | 214 | // 大专题 |
| 215 | if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | 215 | if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { |
| 216 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 216 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 217 | } else { | 217 | } else { |
| 218 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) | 218 | + Divider().strokeWidth(5).color('#f5f5f5') |
| 219 | } | 219 | } |
| 220 | } else if (this.compDTO.compType === 'appStyle') { | 220 | } else if (this.compDTO.compType === 'appStyle') { |
| 221 | if ( | 221 | if ( |
| @@ -225,7 +225,7 @@ export struct CompParser { | @@ -225,7 +225,7 @@ export struct CompParser { | ||
| 225 | this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 || | 225 | this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 || |
| 226 | this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 | 226 | this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 |
| 227 | ) { | 227 | ) { |
| 228 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) | 228 | + Divider().strokeWidth(5).color('#f5f5f5') |
| 229 | } else { | 229 | } else { |
| 230 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 230 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 231 | } | 231 | } |
| @@ -76,8 +76,15 @@ export struct CardSourceInfo { | @@ -76,8 +76,15 @@ export struct CardSourceInfo { | ||
| 76 | const num2: string = num.slice(-4, -3); // 千 | 76 | const num2: string = num.slice(-4, -3); // 千 |
| 77 | return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万' | 77 | return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万' |
| 78 | } else if (Number.parseInt(num) > 99999999) { | 78 | } else if (Number.parseInt(num) > 99999999) { |
| 79 | - const num1: string = num.slice(0, -8); // 亿 | ||
| 80 | - const num2: string = num.slice(-8, -7); | 79 | + let num1: string = num.slice(0, -8); // 亿 |
| 80 | + let num2: string = num.slice(-8, -7); | ||
| 81 | + const num3: string = `0.${num.slice(-7, -6)}` | ||
| 82 | + if (Math.round(Number(num3)) > Number(num3)) { | ||
| 83 | + if (`${Number(num2) + 1}`.length === 2) { | ||
| 84 | + num1 = `${Number(num1) + 1}` | ||
| 85 | + num2 = '0' | ||
| 86 | + } | ||
| 87 | + } | ||
| 81 | return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿' | 88 | return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿' |
| 82 | } | 89 | } |
| 83 | return num | 90 | return num |
| @@ -91,29 +98,19 @@ export struct CardSourceInfo { | @@ -91,29 +98,19 @@ export struct CardSourceInfo { | ||
| 91 | } | 98 | } |
| 92 | 99 | ||
| 93 | build() { | 100 | build() { |
| 94 | - Flex({ alignItems: ItemAlign.Center }) { | 101 | + Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { |
| 95 | // 标签 | 102 | // 标签 |
| 96 | - if (this.contentDTO.corner) { | ||
| 97 | - Text(this.contentDTO.corner) | ||
| 98 | - .fontSize($r("app.float.font_size_11")) | ||
| 99 | - .fontColor($r("app.color.color_ED2800")) | ||
| 100 | - .margin({ right: 6 }) | ||
| 101 | - } | ||
| 102 | - if (this.contentDTO.cornerMark) { | ||
| 103 | - Text(this.contentDTO.cornerMark) | 103 | + if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 104 | + Text(this.contentDTO.cornerMark || this.contentDTO.corner) | ||
| 104 | .fontSize($r("app.float.font_size_11")) | 105 | .fontSize($r("app.float.font_size_11")) |
| 105 | .fontColor($r("app.color.color_ED2800")) | 106 | .fontColor($r("app.color.color_ED2800")) |
| 106 | .margin({ right: 6 }) | 107 | .margin({ right: 6 }) |
| 108 | + .flexShrink(0) | ||
| 107 | } | 109 | } |
| 110 | + | ||
| 108 | // 来源信息 | 111 | // 来源信息 |
| 109 | - if (this.contentDTO.rmhPlatform === 1) { | ||
| 110 | - Text(this.contentDTO.rmhInfo?.rmhName) | ||
| 111 | - .fontSize($r("app.float.font_size_11")) | ||
| 112 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 113 | - .maxLines(1) | ||
| 114 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 115 | - } else if (this.contentDTO.source) { | ||
| 116 | - Text(`${this.contentDTO.source}`) | 112 | + if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { |
| 113 | + Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source) | ||
| 117 | .fontSize($r("app.float.font_size_11")) | 114 | .fontSize($r("app.float.font_size_11")) |
| 118 | .fontColor($r("app.color.color_B0B0B0")) | 115 | .fontColor($r("app.color.color_B0B0B0")) |
| 119 | .maxLines(1) | 116 | .maxLines(1) |
| @@ -121,7 +118,7 @@ export struct CardSourceInfo { | @@ -121,7 +118,7 @@ export struct CardSourceInfo { | ||
| 121 | } | 118 | } |
| 122 | 119 | ||
| 123 | // 点 | 120 | // 点 |
| 124 | - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | 121 | + if (this.showTime() || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && |
| 125 | this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | 122 | this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && |
| 126 | (this.getContentDtoBean()?.interactData?.commentNum | 123 | (this.getContentDtoBean()?.interactData?.commentNum |
| 127 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | 124 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' |
| @@ -150,7 +147,7 @@ export struct CardSourceInfo { | @@ -150,7 +147,7 @@ export struct CardSourceInfo { | ||
| 150 | } | 147 | } |
| 151 | 148 | ||
| 152 | // 评论数 | 149 | // 评论数 |
| 153 | - if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | 150 | + if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && |
| 154 | this.showCommentNum()) { | 151 | this.showCommentNum()) { |
| 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 152 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 156 | .fontSize($r("app.float.font_size_11")) | 153 | .fontSize($r("app.float.font_size_11")) |
| @@ -158,7 +155,7 @@ export struct CardSourceInfo { | @@ -158,7 +155,7 @@ export struct CardSourceInfo { | ||
| 158 | .flexShrink(0) | 155 | .flexShrink(0) |
| 159 | } else { | 156 | } else { |
| 160 | 157 | ||
| 161 | - if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 158 | + if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 162 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) | 159 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) |
| 163 | .fontSize($r("app.float.font_size_11")) | 160 | .fontSize($r("app.float.font_size_11")) |
| 164 | .fontColor($r("app.color.color_B0B0B0")) | 161 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -211,11 +208,11 @@ export struct CardSourceInfo { | @@ -211,11 +208,11 @@ export struct CardSourceInfo { | ||
| 211 | } | 208 | } |
| 212 | 209 | ||
| 213 | // 评论数 | 210 | // 评论数 |
| 214 | - if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | 211 | + if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && |
| 215 | this.showCommentNum()) { | 212 | this.showCommentNum()) { |
| 216 | have = true | 213 | have = true |
| 217 | } else { | 214 | } else { |
| 218 | - if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 215 | + if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 219 | have = true | 216 | have = true |
| 220 | } | 217 | } |
| 221 | } | 218 | } |
| @@ -116,7 +116,8 @@ export struct RmhTitle { | @@ -116,7 +116,8 @@ export struct RmhTitle { | ||
| 116 | Stack() { | 116 | Stack() { |
| 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) | 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 118 | .width(36) | 118 | .width(36) |
| 119 | - .height(36).borderRadius(50) | 119 | + .height(36) |
| 120 | + .borderRadius(50) | ||
| 120 | Image(this.rmhInfo?.authIcon) | 121 | Image(this.rmhInfo?.authIcon) |
| 121 | .width(14) | 122 | .width(14) |
| 122 | .height(14) | 123 | .height(14) |
| @@ -128,10 +129,13 @@ export struct RmhTitle { | @@ -128,10 +129,13 @@ export struct RmhTitle { | ||
| 128 | 129 | ||
| 129 | Column() { | 130 | Column() { |
| 130 | Text(this.rmhInfo?.rmhName) | 131 | Text(this.rmhInfo?.rmhName) |
| 131 | - .fontSize($r('app.float.font_size_13')) | 132 | + .fontSize(15) |
| 132 | .fontColor($r('app.color.color_222222')) | 133 | .fontColor($r('app.color.color_222222')) |
| 133 | .fontWeight(600) | 134 | .fontWeight(600) |
| 134 | .alignSelf(ItemAlign.Start) | 135 | .alignSelf(ItemAlign.Start) |
| 136 | + .height(21) | ||
| 137 | + .lineHeight(21) | ||
| 138 | + .margin({bottom: 1}) | ||
| 135 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { | 139 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { |
| 136 | Row() { | 140 | Row() { |
| 137 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { | 141 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { |
| @@ -139,11 +143,13 @@ export struct RmhTitle { | @@ -139,11 +143,13 @@ export struct RmhTitle { | ||
| 139 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) | 143 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) |
| 140 | .fontSize($r("app.float.font_size_12")) | 144 | .fontSize($r("app.float.font_size_12")) |
| 141 | .fontColor($r("app.color.color_B0B0B0")) | 145 | .fontColor($r("app.color.color_B0B0B0")) |
| 146 | + .height(14) | ||
| 147 | + .lineHeight(14) | ||
| 142 | } | 148 | } |
| 143 | if (this.publishTime && this.rmhInfo?.rmhDesc) { | 149 | if (this.publishTime && this.rmhInfo?.rmhDesc) { |
| 144 | Image($r('app.media.point')) | 150 | Image($r('app.media.point')) |
| 145 | - .width(16) | ||
| 146 | - .height(16) | 151 | + .width(14) |
| 152 | + .height(14) | ||
| 147 | } | 153 | } |
| 148 | } | 154 | } |
| 149 | if(this.rmhInfo?.rmhDesc != undefined){ | 155 | if(this.rmhInfo?.rmhDesc != undefined){ |
| @@ -154,12 +160,16 @@ export struct RmhTitle { | @@ -154,12 +160,16 @@ export struct RmhTitle { | ||
| 154 | .alignSelf(ItemAlign.Start) | 160 | .alignSelf(ItemAlign.Start) |
| 155 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 161 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 156 | .textAlign(TextAlign.Start) | 162 | .textAlign(TextAlign.Start) |
| 163 | + .height(14) | ||
| 164 | + .lineHeight(14) | ||
| 157 | } | 165 | } |
| 158 | 166 | ||
| 159 | } | 167 | } |
| 160 | .width('75%') | 168 | .width('75%') |
| 169 | + .height(14) | ||
| 161 | } | 170 | } |
| 162 | } | 171 | } |
| 172 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 163 | 173 | ||
| 164 | Blank() | 174 | Blank() |
| 165 | if (this.rmhInfo?.cnIsAttention) { | 175 | if (this.rmhInfo?.cnIsAttention) { |
| @@ -121,6 +121,7 @@ export struct Card6Component { | @@ -121,6 +121,7 @@ export struct Card6Component { | ||
| 121 | .borderRadius(5) | 121 | .borderRadius(5) |
| 122 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | 122 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) |
| 123 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 123 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 124 | + .border({width: 1, color: 0xf5f5f5}) | ||
| 124 | CardMediaInfo({ contentDTO: this.contentDTO }) | 125 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 125 | } | 126 | } |
| 126 | 127 |
| @@ -300,7 +300,8 @@ struct indicatorAnimations { | @@ -300,7 +300,8 @@ struct indicatorAnimations { | ||
| 300 | // .height(2) | 300 | // .height(2) |
| 301 | 301 | ||
| 302 | Image($r('app.media.swiper_indicator_gray')) | 302 | Image($r('app.media.swiper_indicator_gray')) |
| 303 | - .width('100%') | 303 | + .objectFit(ImageFit.Contain) |
| 304 | + .width('96%') | ||
| 304 | .height(2) | 305 | .height(2) |
| 305 | Image($r('app.media.swiper_indicator_white')) | 306 | Image($r('app.media.swiper_indicator_white')) |
| 306 | .width(this.leftW) | 307 | .width(this.leftW) |
| @@ -334,7 +335,8 @@ struct indicatorAnimations { | @@ -334,7 +335,8 @@ struct indicatorAnimations { | ||
| 334 | // .width('100%') | 335 | // .width('100%') |
| 335 | // .height(2) | 336 | // .height(2) |
| 336 | Image($r('app.media.swiper_indicator_gray')) | 337 | Image($r('app.media.swiper_indicator_gray')) |
| 337 | - .width('100%') | 338 | + .objectFit(ImageFit.Contain) |
| 339 | + .width('96%') | ||
| 338 | .height(2) | 340 | .height(2) |
| 339 | Image($r('app.media.swiper_indicator_white')) | 341 | Image($r('app.media.swiper_indicator_white')) |
| 340 | .width(this.rightW) | 342 | .width(this.rightW) |
| @@ -13,7 +13,7 @@ import { | @@ -13,7 +13,7 @@ import { | ||
| 13 | PeopleShipUserDetailData, | 13 | PeopleShipUserDetailData, |
| 14 | ArticleCountData | 14 | ArticleCountData |
| 15 | } from 'wdBean' | 15 | } from 'wdBean' |
| 16 | -import { EmptyComponent } from '../view/EmptyComponent' | 16 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 17 | import { CustomTitleUI } from '../reusable/CustomTitleUI' | 17 | import { CustomTitleUI } from '../reusable/CustomTitleUI' |
| 18 | 18 | ||
| 19 | @Entry | 19 | @Entry |
| @@ -41,6 +41,7 @@ struct PeopleShipHomePage { | @@ -41,6 +41,7 @@ struct PeopleShipHomePage { | ||
| 41 | @State isLoading: boolean = true | 41 | @State isLoading: boolean = true |
| 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 44 | + @State isHasHomePage: boolean = true | ||
| 44 | 45 | ||
| 45 | onPageShow(): void { | 46 | onPageShow(): void { |
| 46 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) |
| @@ -60,91 +61,100 @@ struct PeopleShipHomePage { | @@ -60,91 +61,100 @@ struct PeopleShipHomePage { | ||
| 60 | 61 | ||
| 61 | build() { | 62 | build() { |
| 62 | if(this.isConnectNetwork){ | 63 | if(this.isConnectNetwork){ |
| 63 | - Stack({ alignContent: Alignment.TopStart }) { | ||
| 64 | - Stack({ alignContent: Alignment.Top }){ | ||
| 65 | - // 顶部图片 | ||
| 66 | - Image($r('app.media.home_page_bg')) | ||
| 67 | - .width('100%') | ||
| 68 | - .height('120vp') | ||
| 69 | - .objectFit(ImageFit.Auto) | ||
| 70 | - .objectRepeat(ImageRepeat.NoRepeat) | ||
| 71 | - .backgroundColor(Color.White) | ||
| 72 | - .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | ||
| 73 | - | ||
| 74 | - Row() | ||
| 75 | - .height(px2vp(this.topSafeHeight)) | ||
| 76 | - .width("100%") | ||
| 77 | - .backgroundColor($r('app.color.white')) | ||
| 78 | - .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None) | ||
| 79 | - .opacity(this.topOpacity ) | ||
| 80 | - } | 64 | + if (this.isHasHomePage){ |
| 65 | + Stack({ alignContent: Alignment.TopStart }) { | ||
| 66 | + Stack({ alignContent: Alignment.Top }){ | ||
| 67 | + // 顶部图片 | ||
| 68 | + Image($r('app.media.home_page_bg')) | ||
| 69 | + .width('100%') | ||
| 70 | + .height('120vp') | ||
| 71 | + .objectFit(ImageFit.Auto) | ||
| 72 | + .objectRepeat(ImageRepeat.NoRepeat) | ||
| 73 | + .backgroundColor(Color.White) | ||
| 74 | + .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | ||
| 75 | + | ||
| 76 | + Row() | ||
| 77 | + .height(px2vp(this.topSafeHeight)) | ||
| 78 | + .width("100%") | ||
| 79 | + .backgroundColor($r('app.color.white')) | ||
| 80 | + .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None) | ||
| 81 | + .opacity(this.topOpacity ) | ||
| 82 | + } | ||
| 81 | 83 | ||
| 82 | - Column(){ | ||
| 83 | - // 头部返回 | ||
| 84 | - PeopleShipHomePageNavComponent({ | ||
| 85 | - attentionOpacity: this.attentionOpacity, | ||
| 86 | - topOpacity: this.topOpacity, | ||
| 87 | - detailModel: this.detailModel | ||
| 88 | - }) | ||
| 89 | - .height($r('app.float.top_bar_height')) | ||
| 90 | - .backgroundColor(Color.Transparent) | ||
| 91 | - if (this.detailModel && this.detailModel.userName) { | ||
| 92 | - Scroll(this.scroller) { | ||
| 93 | - Column() { | ||
| 94 | - // 顶部相关 | ||
| 95 | - PeopleShipHomePageTopComponent({ | ||
| 96 | - creatorId: this.creatorId, | ||
| 97 | - detailModel: this.detailModel, | ||
| 98 | - publishCount: this.publishCount, | ||
| 99 | - topHeight: this.topHeight | ||
| 100 | - }) | ||
| 101 | - .width("100%") | ||
| 102 | - .height(this.topHeight) | ||
| 103 | - // 列表 | ||
| 104 | - Column(){ | ||
| 105 | - PeopleShipHomeListComponent({ | 84 | + Column(){ |
| 85 | + // 头部返回 | ||
| 86 | + PeopleShipHomePageNavComponent({ | ||
| 87 | + attentionOpacity: this.attentionOpacity, | ||
| 88 | + topOpacity: this.topOpacity, | ||
| 89 | + detailModel: this.detailModel | ||
| 90 | + }) | ||
| 91 | + .height($r('app.float.top_bar_height')) | ||
| 92 | + .backgroundColor(Color.Transparent) | ||
| 93 | + if (this.detailModel && this.detailModel.userName) { | ||
| 94 | + Scroll(this.scroller) { | ||
| 95 | + Column() { | ||
| 96 | + // 顶部相关 | ||
| 97 | + PeopleShipHomePageTopComponent({ | ||
| 98 | + creatorId: this.creatorId, | ||
| 99 | + detailModel: this.detailModel, | ||
| 106 | publishCount: this.publishCount, | 100 | publishCount: this.publishCount, |
| 107 | - creatorId: this.creatorId | 101 | + topHeight: this.topHeight |
| 108 | }) | 102 | }) |
| 109 | - }.height('100%') | ||
| 110 | - | ||
| 111 | - | 103 | + .width("100%") |
| 104 | + .height(this.topHeight) | ||
| 105 | + // 列表 | ||
| 106 | + Column(){ | ||
| 107 | + PeopleShipHomeListComponent({ | ||
| 108 | + publishCount: this.publishCount, | ||
| 109 | + creatorId: this.creatorId | ||
| 110 | + }) | ||
| 111 | + }.height('100%') | ||
| 112 | + | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + .width("100%") | ||
| 116 | + .justifyContent(FlexAlign.Start) | ||
| 117 | + .alignItems(HorizontalAlign.Start) | ||
| 118 | + // .height('100%') | ||
| 119 | + // .height(this.publishCount == 0 ? '100%' : '') | ||
| 112 | } | 120 | } |
| 113 | - .width("100%") | ||
| 114 | - .justifyContent(FlexAlign.Start) | ||
| 115 | - .alignItems(HorizontalAlign.Start) | ||
| 116 | - // .height('100%') | ||
| 117 | - // .height(this.publishCount == 0 ? '100%' : '') | 121 | + .scrollable(ScrollDirection.Vertical) |
| 122 | + // .alignSelf(ItemAlign.Start) | ||
| 123 | + // .align(Alignment.Start) | ||
| 124 | + .edgeEffect(EdgeEffect.None) | ||
| 125 | + .friction(0.7) | ||
| 126 | + .backgroundColor(Color.White) | ||
| 127 | + .scrollBar(BarState.Off) | ||
| 128 | + .width('100%') | ||
| 129 | + .height('calc(100% - 44vp)') | ||
| 130 | + // .layoutWeight(1) | ||
| 131 | + .onDidScroll(() => { | ||
| 132 | + // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2) | ||
| 133 | + this.topOpacity = this.scroller.currentOffset().yOffset / 100 | ||
| 134 | + if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) { | ||
| 135 | + this.attentionOpacity = true | ||
| 136 | + } else { | ||
| 137 | + this.attentionOpacity = false | ||
| 138 | + } | ||
| 139 | + Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`) | ||
| 140 | + | ||
| 141 | + }) | ||
| 118 | } | 142 | } |
| 119 | - .scrollable(ScrollDirection.Vertical) | ||
| 120 | - // .alignSelf(ItemAlign.Start) | ||
| 121 | - // .align(Alignment.Start) | ||
| 122 | - .edgeEffect(EdgeEffect.None) | ||
| 123 | - .friction(0.7) | ||
| 124 | - .backgroundColor(Color.White) | ||
| 125 | - .scrollBar(BarState.Off) | ||
| 126 | - .width('100%') | ||
| 127 | - .height('calc(100% - 44vp)') | ||
| 128 | - // .layoutWeight(1) | ||
| 129 | - .onDidScroll(() => { | ||
| 130 | - // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2) | ||
| 131 | - this.topOpacity = this.scroller.currentOffset().yOffset / 100 | ||
| 132 | - if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) { | ||
| 133 | - this.attentionOpacity = true | ||
| 134 | - } else { | ||
| 135 | - this.attentionOpacity = false | ||
| 136 | - } | ||
| 137 | - Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`) | ||
| 138 | - | ||
| 139 | - }) | ||
| 140 | } | 143 | } |
| 144 | + .alignItems(HorizontalAlign.Start) | ||
| 145 | + .justifyContent(FlexAlign.Start) | ||
| 146 | + .width('100%') | ||
| 147 | + .margin({top:px2vp(this.topSafeHeight)}) | ||
| 141 | } | 148 | } |
| 142 | - .alignItems(HorizontalAlign.Start) | ||
| 143 | - .justifyContent(FlexAlign.Start) | ||
| 144 | .width('100%') | 149 | .width('100%') |
| 145 | - .margin({top:px2vp(this.topSafeHeight)}) | 150 | + }else { |
| 151 | + Column(){ | ||
| 152 | + CustomTitleUI({ titleName: "" }) | ||
| 153 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%') | ||
| 154 | + }.width("100%") | ||
| 155 | + .height("100%") | ||
| 156 | + .padding({top:px2vp(this.topSafeHeight)}) | ||
| 146 | } | 157 | } |
| 147 | - .width('100%') | ||
| 148 | }else{ | 158 | }else{ |
| 149 | Column(){ | 159 | Column(){ |
| 150 | CustomTitleUI({ titleName: "" }) | 160 | CustomTitleUI({ titleName: "" }) |
| @@ -184,6 +194,7 @@ struct PeopleShipHomePage { | @@ -184,6 +194,7 @@ struct PeopleShipHomePage { | ||
| 184 | 194 | ||
| 185 | } catch (exception) { | 195 | } catch (exception) { |
| 186 | this.isLoading = false | 196 | this.isLoading = false |
| 197 | + this.isHasHomePage = false | ||
| 187 | } | 198 | } |
| 188 | } | 199 | } |
| 189 | 200 |
| @@ -310,7 +310,7 @@ export struct SearchResultContentComponent { | @@ -310,7 +310,7 @@ export struct SearchResultContentComponent { | ||
| 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 311 | } | 311 | } |
| 312 | } else { | 312 | } else { |
| 313 | - if (this.data?.get(index + 1)?.sameContentListSize > 0) { | 313 | + if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) { |
| 314 | Divider() | 314 | Divider() |
| 315 | .width('100%') | 315 | .width('100%') |
| 316 | .color($r('app.color.color_F5F5F5')) | 316 | .color($r('app.color.color_F5F5F5')) |
| @@ -44,7 +44,9 @@ export const enum WDViewDefaultType { | @@ -44,7 +44,9 @@ export const enum WDViewDefaultType { | ||
| 44 | // 17. 暂无评论快来抢沙发 | 44 | // 17. 暂无评论快来抢沙发 |
| 45 | WDViewDefaultType_NoComment1, | 45 | WDViewDefaultType_NoComment1, |
| 46 | // 18. 内容找不到了 | 46 | // 18. 内容找不到了 |
| 47 | - WDViewDefaultType_NoContent2 | 47 | + WDViewDefaultType_NoContent2, |
| 48 | + // 19. 暂时无法查看该创作者主页 | ||
| 49 | + WDViewDefaultType_NoUserHomepage | ||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | /** | 52 | /** |
| @@ -214,6 +216,8 @@ export struct EmptyComponent { | @@ -214,6 +216,8 @@ export struct EmptyComponent { | ||
| 214 | contentString = '暂无评论,快来抢沙发' | 216 | contentString = '暂无评论,快来抢沙发' |
| 215 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { | 217 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { |
| 216 | contentString = '内容找不到了' | 218 | contentString = '内容找不到了' |
| 219 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){ | ||
| 220 | + contentString = '暂时无法查看该创作者主页' | ||
| 217 | } | 221 | } |
| 218 | 222 | ||
| 219 | return contentString | 223 | return contentString |
| @@ -250,6 +254,8 @@ export struct EmptyComponent { | @@ -250,6 +254,8 @@ export struct EmptyComponent { | ||
| 250 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || | 254 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || |
| 251 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { | 255 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { |
| 252 | imageString = $r('app.media.icon_no_appointmentMade1') | 256 | imageString = $r('app.media.icon_no_appointmentMade1') |
| 257 | + }else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){ | ||
| 258 | + imageString = $r('app.media.icon_no_master1') | ||
| 253 | } | 259 | } |
| 254 | return imageString | 260 | return imageString |
| 255 | } | 261 | } |
| @@ -51,41 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -51,41 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 51 | 51 | ||
| 52 | toMore() { | 52 | toMore() { |
| 53 | if (this.moreWidth > this.initMoreWidth * 2) { | 53 | if (this.moreWidth > this.initMoreWidth * 2) { |
| 54 | - this.liveToMore(); | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - liveToMore() { | ||
| 59 | - if (!!this.compDTO.dataSourceType) { | ||
| 60 | - // if (this.compDTO.dataSourceType === 'OBJECT_POS') { | ||
| 61 | - // ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 62 | - // return; | ||
| 63 | - // } | ||
| 64 | - if (this.compDTO.linkUrl) { | ||
| 65 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'JUMP_H5_BY_WEB_VIEW') | ||
| 66 | - let taskAction: Action = { | ||
| 67 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 68 | - params: { | ||
| 69 | - url: this.compDTO.linkUrl | ||
| 70 | - } as Params, | ||
| 71 | - }; | ||
| 72 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 73 | - } else { | ||
| 74 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'jumpToLiveMorePage') | ||
| 75 | - this.jumpToLiveMorePage() | ||
| 76 | - } | ||
| 77 | - } else { | ||
| 78 | - if (this.compDTO?.objectType === '11') { | ||
| 79 | - } else { | ||
| 80 | - const contentDTO: ContentDTO = { | ||
| 81 | - objectId: this.compDTO.objectId, | ||
| 82 | - objectType: this.compDTO.objectType, | ||
| 83 | - linkUrl: this.compDTO.linkUrl, | ||
| 84 | - pageId: this.compDTO.pageId | ||
| 85 | - } as ContentDTO | ||
| 86 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'ProcessUtils.processPage') | ||
| 87 | - ProcessUtils.processPage(contentDTO) | ||
| 88 | - } | 54 | + ProcessUtils.compJumpPage(this.compDTO) |
| 89 | } | 55 | } |
| 90 | } | 56 | } |
| 91 | 57 | ||
| @@ -118,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -118,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 118 | } | 84 | } |
| 119 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) | 85 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) |
| 120 | .onClick(() => { | 86 | .onClick(() => { |
| 121 | - this.liveToMore(); | 87 | + ProcessUtils.compJumpPage(this.compDTO) |
| 122 | }) | 88 | }) |
| 123 | 89 | ||
| 124 | }.justifyContent(FlexAlign.SpaceBetween) | 90 | }.justifyContent(FlexAlign.SpaceBetween) |
| 1 | import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 1 | import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 2 | -import { DateTimeUtils, Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit'; | 2 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit'; |
| 3 | 3 | ||
| 4 | import { | 4 | import { |
| 5 | batchLikeAndCollectResult, | 5 | batchLikeAndCollectResult, |
| @@ -7,8 +7,11 @@ import { | @@ -7,8 +7,11 @@ import { | ||
| 7 | ContentDetailDTO, | 7 | ContentDetailDTO, |
| 8 | ContentDTO, | 8 | ContentDTO, |
| 9 | contentListParams, | 9 | contentListParams, |
| 10 | + FeedbackTypeBean, | ||
| 11 | + GoldenPositionExtraBean, | ||
| 10 | InteractDataDTO, | 12 | InteractDataDTO, |
| 11 | LiveReviewDTO, | 13 | LiveReviewDTO, |
| 14 | + LiveRoomDataBean, | ||
| 12 | MorningEveningPaperDTO, | 15 | MorningEveningPaperDTO, |
| 13 | NavigationBodyDTO, | 16 | NavigationBodyDTO, |
| 14 | NavigationDetailDTO, | 17 | NavigationDetailDTO, |
| @@ -22,13 +25,10 @@ import { | @@ -22,13 +25,10 @@ import { | ||
| 22 | postExecuteCollectRecordParams, | 25 | postExecuteCollectRecordParams, |
| 23 | postExecuteLikeParams, | 26 | postExecuteLikeParams, |
| 24 | postInteractAccentionOperateParams, | 27 | postInteractAccentionOperateParams, |
| 25 | - postRecommendListParams, | ||
| 26 | - GoldenPositionExtraBean, | ||
| 27 | - FeedbackTypeBean, | ||
| 28 | - LiveRoomDataBean | 28 | + postRecommendListParams |
| 29 | } from 'wdBean'; | 29 | } from 'wdBean'; |
| 30 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | 30 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; |
| 31 | -import { ArrayList } from '@kit.ArkTS'; | 31 | +import { SpConstants } from 'wdConstant/Index'; |
| 32 | 32 | ||
| 33 | const TAG = 'HttpRequest'; | 33 | const TAG = 'HttpRequest'; |
| 34 | 34 | ||
| @@ -243,6 +243,14 @@ export class PageRepository { | @@ -243,6 +243,14 @@ export class PageRepository { | ||
| 243 | url = url + "&districtCode=" + HttpUtils.getDistrictCode() | 243 | url = url + "&districtCode=" + HttpUtils.getDistrictCode() |
| 244 | + "&provinceCode=" + provinceCode | 244 | + "&provinceCode=" + provinceCode |
| 245 | + "&cityCode=" + HttpUtils.getCityCode() | 245 | + "&cityCode=" + HttpUtils.getCityCode() |
| 246 | + | ||
| 247 | + let per=SPHelper.default.getSync(SpConstants.LOCATION_FIRST_POSITION,true) | ||
| 248 | + if(per){ | ||
| 249 | + //检测首次获取地理信息 | ||
| 250 | + url = url+'&firstLocation=1' | ||
| 251 | + SPHelper.default.save(SpConstants.LOCATION_FIRST_POSITION,false) | ||
| 252 | + } | ||
| 253 | + | ||
| 246 | } | 254 | } |
| 247 | if (myChannelIds) { | 255 | if (myChannelIds) { |
| 248 | url = url + `&channelIds=${myChannelIds}` | 256 | url = url + `&channelIds=${myChannelIds}` |
| @@ -7,12 +7,15 @@ import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | @@ -7,12 +7,15 @@ import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | ||
| 7 | import { DisplayDirection } from 'wdConstant/Index'; | 7 | import { DisplayDirection } from 'wdConstant/Index'; |
| 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; | 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; |
| 9 | import { WDShare } from 'wdShare/Index'; | 9 | import { WDShare } from 'wdShare/Index'; |
| 10 | +import { faceDetector } from '@kit.CoreVisionKit'; | ||
| 11 | + | ||
| 10 | //直播间播放器上层覆盖物 | 12 | //直播间播放器上层覆盖物 |
| 11 | @Component | 13 | @Component |
| 12 | export struct PlayUIComponent { | 14 | export struct PlayUIComponent { |
| 13 | playerController?: WDAliPlayerController; | 15 | playerController?: WDAliPlayerController; |
| 14 | //菜单键是否可见 | 16 | //菜单键是否可见 |
| 15 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true | 17 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true |
| 18 | + private ispause:boolean = false | ||
| 16 | @Consume contentDetailData: ContentDetailDTO | 19 | @Consume contentDetailData: ContentDetailDTO |
| 17 | @Consume liveRoomDataBean: LiveRoomDataBean | 20 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 18 | @State currentTime: string = '' | 21 | @State currentTime: string = '' |
| @@ -35,8 +38,11 @@ export struct PlayUIComponent { | @@ -35,8 +38,11 @@ export struct PlayUIComponent { | ||
| 35 | let time: number = 0 | 38 | let time: number = 0 |
| 36 | if (this.isMenuVisible) { | 39 | if (this.isMenuVisible) { |
| 37 | setTimeout(() => { | 40 | setTimeout(() => { |
| 41 | + if(this.ispause){ | ||
| 42 | + return | ||
| 43 | + } | ||
| 38 | this.isMenuVisible = false | 44 | this.isMenuVisible = false |
| 39 | - }, 5 * 1000) | 45 | + }, 4 * 1000) |
| 40 | } else { | 46 | } else { |
| 41 | clearTimeout(time) | 47 | clearTimeout(time) |
| 42 | } | 48 | } |
| @@ -46,6 +52,16 @@ export struct PlayUIComponent { | @@ -46,6 +52,16 @@ export struct PlayUIComponent { | ||
| 46 | this.onChangeMenuVisible() | 52 | this.onChangeMenuVisible() |
| 47 | 53 | ||
| 48 | this.initPlayerSet() | 54 | this.initPlayerSet() |
| 55 | + if(this.playerController){ | ||
| 56 | + this.playerController.onStatusChangeForPlayUIComponent = (status: number) => { | ||
| 57 | + if(1 == status){ | ||
| 58 | + this.ispause = false | ||
| 59 | + this.isMenuVisible = false | ||
| 60 | + }else if(2 == status){ | ||
| 61 | + this.ispause = true | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + } | ||
| 49 | } | 65 | } |
| 50 | 66 | ||
| 51 | aboutToDisappear(): void { | 67 | aboutToDisappear(): void { |
| @@ -271,6 +287,9 @@ export struct PlayUIComponent { | @@ -271,6 +287,9 @@ export struct PlayUIComponent { | ||
| 271 | if (this.contentDetailData?.liveInfo?.liveState === 'wait') { | 287 | if (this.contentDetailData?.liveInfo?.liveState === 'wait') { |
| 272 | return | 288 | return |
| 273 | } | 289 | } |
| 290 | + if(this.ispause){ | ||
| 291 | + return | ||
| 292 | + } | ||
| 274 | this.isMenuVisible = !this.isMenuVisible | 293 | this.isMenuVisible = !this.isMenuVisible |
| 275 | }) | 294 | }) |
| 276 | } | 295 | } |
| @@ -290,7 +309,7 @@ export struct PlayUIComponent { | @@ -290,7 +309,7 @@ export struct PlayUIComponent { | ||
| 290 | .fontWeight(600) | 309 | .fontWeight(600) |
| 291 | .fontSize('12fp') | 310 | .fontSize('12fp') |
| 292 | .margin({ | 311 | .margin({ |
| 293 | - left: 16 | 312 | + left: 20 |
| 294 | }) | 313 | }) |
| 295 | } | 314 | } |
| 296 | 315 | ||
| @@ -308,7 +327,7 @@ export struct PlayUIComponent { | @@ -308,7 +327,7 @@ export struct PlayUIComponent { | ||
| 308 | .fontWeight(600) | 327 | .fontWeight(600) |
| 309 | .fontSize('12fp') | 328 | .fontSize('12fp') |
| 310 | .margin({ | 329 | .margin({ |
| 311 | - right: 16 | 330 | + right: 20 |
| 312 | }) | 331 | }) |
| 313 | } | 332 | } |
| 314 | 333 | ||
| @@ -376,7 +395,9 @@ export struct PlayUIComponent { | @@ -376,7 +395,9 @@ export struct PlayUIComponent { | ||
| 376 | this.playerController?.pause() | 395 | this.playerController?.pause() |
| 377 | } else { | 396 | } else { |
| 378 | this.isPlayStatus = true | 397 | this.isPlayStatus = true |
| 379 | - this.playerController?.firstPlay(this.liveUrl) | 398 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 399 | + this.playerController?.firstPlay(this.liveUrl) | ||
| 400 | + } | ||
| 380 | this.playerController?.play() | 401 | this.playerController?.play() |
| 381 | } | 402 | } |
| 382 | }) | 403 | }) |
| @@ -60,6 +60,7 @@ export class WDAliPlayerController { | @@ -60,6 +60,7 @@ export class WDAliPlayerController { | ||
| 60 | // 准备完成,决定是否播放回调。如果不实现,则自动播放 | 60 | // 准备完成,决定是否播放回调。如果不实现,则自动播放 |
| 61 | public onCanplay?: () => void; | 61 | public onCanplay?: () => void; |
| 62 | public onStatusChange?: (status: number) => void; | 62 | public onStatusChange?: (status: number) => void; |
| 63 | + public onStatusChangeForPlayUIComponent?: (status: number) => void; | ||
| 63 | public onFirstFrameDisplay?: () => void | 64 | public onFirstFrameDisplay?: () => void |
| 64 | // 埋点字段 | 65 | // 埋点字段 |
| 65 | private creatStartTime: number = 0; //开始加载时间 | 66 | private creatStartTime: number = 0; //开始加载时间 |
| @@ -513,6 +514,9 @@ export class WDAliPlayerController { | @@ -513,6 +514,9 @@ export class WDAliPlayerController { | ||
| 513 | if (this.onStatusChange) { | 514 | if (this.onStatusChange) { |
| 514 | this.onStatusChange(this.status) | 515 | this.onStatusChange(this.status) |
| 515 | } | 516 | } |
| 517 | + if(this.onStatusChangeForPlayUIComponent){ | ||
| 518 | + this.onStatusChangeForPlayUIComponent(this.status) | ||
| 519 | + } | ||
| 516 | 520 | ||
| 517 | } | 521 | } |
| 518 | 522 |
| @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences'; | @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences'; | ||
| 7 | import { TrackConstants } from 'wdTracking/Index'; | 7 | import { TrackConstants } from 'wdTracking/Index'; |
| 8 | 8 | ||
| 9 | const TAG = 'SpacialTopicPage'; | 9 | const TAG = 'SpacialTopicPage'; |
| 10 | - | 10 | +//H5专题 |
| 11 | @Entry | 11 | @Entry |
| 12 | @Component | 12 | @Component |
| 13 | struct SpacialTopicPage { | 13 | struct SpacialTopicPage { |
-
Please register or login to post a comment