Merge remote-tracking branch 'origin/main'
# Conflicts: # sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets # sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
Showing
51 changed files
with
625 additions
and
694 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 { InteractDataDTO } from '../content/InteractDataDTO'; | ||
| 1 | import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; | 2 | import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; |
| 2 | -export interface slideShows { | ||
| 3 | - fullColumnImgUrls: FullColumnImgUrlDTO[]; | ||
| 4 | - linkUrl?: string; | ||
| 5 | - newsId: string; | ||
| 6 | - newsTitle?: string; | ||
| 7 | - newsTitleColor?: string; | ||
| 8 | - objectLevel?: string; | ||
| 9 | - objectType: string; | ||
| 10 | - pageId?: string; | ||
| 11 | - photoNum?: string; | ||
| 12 | - publishTime: number; | ||
| 13 | - relId: string; | ||
| 14 | - source?: string; | ||
| 15 | - timeBlurred?: string; | ||
| 16 | - videoDuration?: string; | ||
| 17 | - videoLandscape?: string; | ||
| 18 | - videoUrl?: string; | ||
| 19 | - voiceDuration?: string; | 3 | + |
| 4 | +@Observed | ||
| 5 | +export class slideShows { | ||
| 6 | + fullColumnImgUrls?: FullColumnImgUrlDTO[]; | ||
| 7 | + linkUrl: string=''; | ||
| 8 | + newsId: string = ''; | ||
| 9 | + newsTitle: string=''; | ||
| 10 | + newsTitleColor: string=''; | ||
| 11 | + objectLevel: string=''; | ||
| 12 | + objectType: string =''; | ||
| 13 | + pageId: string=''; | ||
| 14 | + photoNum: string=''; | ||
| 15 | + publishTime: number=0; | ||
| 16 | + relId: string=''; | ||
| 17 | + source: string=''; | ||
| 18 | + timeBlurred: string=''; | ||
| 19 | + videoDuration: string=''; | ||
| 20 | + videoLandscape: string=''; | ||
| 21 | + videoUrl: string=''; | ||
| 22 | + voiceDuration: string=''; | ||
| 23 | + | ||
| 24 | + interactDataDto? :InteractDataDTO | ||
| 20 | } | 25 | } |
| @@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | - "@ohos/lottie": "2.0.10", | ||
| 11 | "wdConstant": "file:../../commons/wdConstant", | 10 | "wdConstant": "file:../../commons/wdConstant", |
| 12 | "wdPlayer": "file:../../features/wdPlayer", | 11 | "wdPlayer": "file:../../features/wdPlayer", |
| 13 | "wdLogin": "file:../../features/wdLogin", | 12 | "wdLogin": "file:../../features/wdLogin", |
| @@ -186,8 +186,8 @@ export struct CardParser { | @@ -186,8 +186,8 @@ export struct CardParser { | ||
| 186 | contentDTO: contentDTO, | 186 | contentDTO: contentDTO, |
| 187 | compDTO: this.compDTO, | 187 | compDTO: this.compDTO, |
| 188 | pageId: this.pageId, | 188 | pageId: this.pageId, |
| 189 | - pageName: this.pageName | ||
| 190 | - | 189 | + pageName: this.pageName, |
| 190 | + index:this.compIndex | ||
| 191 | }) | 191 | }) |
| 192 | } else { | 192 | } else { |
| 193 | // todo:组件未实现 / Component Not Implemented | 193 | // todo:组件未实现 / Component Not Implemented |
| @@ -72,7 +72,7 @@ export struct CompParser { | @@ -72,7 +72,7 @@ export struct CompParser { | ||
| 72 | 72 | ||
| 73 | build() { | 73 | build() { |
| 74 | Column() { | 74 | Column() { |
| 75 | - //Text(JSON.stringify(this.compDTO.compStyle)) | 75 | + // Text(JSON.stringify(this.compDTO.compStyle)) |
| 76 | this.componentBuilder(); | 76 | this.componentBuilder(); |
| 77 | } | 77 | } |
| 78 | } | 78 | } |
| @@ -90,16 +90,18 @@ export struct CompParser { | @@ -90,16 +90,18 @@ export struct CompParser { | ||
| 90 | } | 90 | } |
| 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 92 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 92 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 93 | - | 93 | + // Text('LiveHorizontalCardComponent') |
| 94 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 94 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 96 | if (this.compDTO.operDataList.length > 1) { | 96 | if (this.compDTO.operDataList.length > 1) { |
| 97 | + // Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent') | ||
| 97 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ | 98 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ |
| 98 | compDTO: this.compDTO, | 99 | compDTO: this.compDTO, |
| 99 | pageId: this.pageId, | 100 | pageId: this.pageId, |
| 100 | pageName: this.pageName | 101 | pageName: this.pageName |
| 101 | }) | 102 | }) |
| 102 | } else { | 103 | } else { |
| 104 | + // Text('HorizontalStrokeCardThreeTwoRadioForOneComponent') | ||
| 103 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ | 105 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ |
| 104 | compDTO: this.compDTO, | 106 | compDTO: this.compDTO, |
| 105 | pageId: this.pageId, | 107 | pageId: this.pageId, |
| @@ -5,6 +5,7 @@ import { promptAction } from '@kit.ArkUI'; | @@ -5,6 +5,7 @@ import { promptAction } from '@kit.ArkUI'; | ||
| 5 | import { image } from '@kit.ImageKit'; | 5 | import { image } from '@kit.ImageKit'; |
| 6 | import { photoAccessHelper } from '@kit.MediaLibraryKit'; | 6 | import { photoAccessHelper } from '@kit.MediaLibraryKit'; |
| 7 | import fs from '@ohos.file.fs'; | 7 | import fs from '@ohos.file.fs'; |
| 8 | +import { NetworkUtil } from 'wdKit'; | ||
| 8 | 9 | ||
| 9 | const PERMISSIONS: Array<Permissions> = [ | 10 | const PERMISSIONS: Array<Permissions> = [ |
| 10 | 'ohos.permission.READ_IMAGEVIDEO', | 11 | 'ohos.permission.READ_IMAGEVIDEO', |
| @@ -47,8 +48,13 @@ export struct ImageDownloadComponent { | @@ -47,8 +48,13 @@ export struct ImageDownloadComponent { | ||
| 47 | } | 48 | } |
| 48 | 49 | ||
| 49 | aboutToAppear(): void { | 50 | aboutToAppear(): void { |
| 51 | + // 注册监听网络连接 | ||
| 52 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 53 | + if (netStatus) { | ||
| 54 | + // 有网络 | ||
| 50 | this.onChangeUrl() | 55 | this.onChangeUrl() |
| 51 | } | 56 | } |
| 57 | + } | ||
| 52 | 58 | ||
| 53 | async onChangeUrl(): Promise<void> { | 59 | async onChangeUrl(): Promise<void> { |
| 54 | console.info(`cj2024 图片下载 ${this.url}`) | 60 | console.info(`cj2024 图片下载 ${this.url}`) |
| @@ -27,6 +27,7 @@ export struct MultiPictureDetailItemComponent { | @@ -27,6 +27,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 27 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | 27 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean |
| 28 | //alt app.media.picture_loading 设计稿尺寸 | 28 | //alt app.media.picture_loading 设计稿尺寸 |
| 29 | @State imageWidth:string | number = 167 | 29 | @State imageWidth:string | number = 167 |
| 30 | + private scroller: Scroller = new Scroller() | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | async aboutToAppear() { | 33 | async aboutToAppear() { |
| @@ -179,6 +180,7 @@ export struct MultiPictureDetailItemComponent { | @@ -179,6 +180,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 179 | 180 | ||
| 180 | build() { | 181 | build() { |
| 181 | Row() { | 182 | Row() { |
| 183 | + Scroll(this.scroller) { | ||
| 182 | if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){ | 184 | if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){ |
| 183 | Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | 185 | Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 |
| 184 | .alt($r('app.media.datail_imageLoading_w')) | 186 | .alt($r('app.media.datail_imageLoading_w')) |
| @@ -197,7 +199,7 @@ export struct MultiPictureDetailItemComponent { | @@ -197,7 +199,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 197 | this.imageWidth = '100%' | 199 | this.imageWidth = '100%' |
| 198 | }) | 200 | }) |
| 199 | }else{ | 201 | }else{ |
| 200 | - Image(this.imagePixelMap)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | 202 | + Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 |
| 201 | .alt($r('app.media.datail_imageLoading_w')) | 203 | .alt($r('app.media.datail_imageLoading_w')) |
| 202 | .width(this.imageWidth) | 204 | .width(this.imageWidth) |
| 203 | .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | 205 | .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 |
| @@ -215,6 +217,10 @@ export struct MultiPictureDetailItemComponent { | @@ -215,6 +217,10 @@ export struct MultiPictureDetailItemComponent { | ||
| 215 | }) | 217 | }) |
| 216 | } | 218 | } |
| 217 | } | 219 | } |
| 220 | + .scrollable(ScrollDirection.Vertical) | ||
| 221 | + .scrollBarWidth(0) | ||
| 222 | + .height(this.imageDefaultSize.height || "100%") | ||
| 223 | + } | ||
| 218 | .onBlur(() => { | 224 | .onBlur(() => { |
| 219 | this.resetCurrentImageInfo(); | 225 | this.resetCurrentImageInfo(); |
| 220 | }) | 226 | }) |
| 1 | -import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 1 | +import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo } from 'wdBean'; |
| 2 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 3 | import { CommonConstants } from 'wdConstant' | 3 | import { CommonConstants } from 'wdConstant' |
| 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent { | @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent { | ||
| 41 | @State isNetConnected: boolean = true | 41 | @State isNetConnected: boolean = true |
| 42 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | @State showComment: boolean = false | 43 | @State showComment: boolean = false |
| 44 | + @State topicInfo: TopicInfo = {} as TopicInfo | ||
| 45 | + | ||
| 44 | private trySendData2H5() { | 46 | private trySendData2H5() { |
| 45 | if (!this.webPrepared || !this.dataPrepared) { | 47 | if (!this.webPrepared || !this.dataPrepared) { |
| 46 | return | 48 | return |
| @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent { | @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent { | ||
| 140 | if(pageInfoMsg && pageInfoMsg.data){ | 142 | if(pageInfoMsg && pageInfoMsg.data){ |
| 141 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) | 143 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) |
| 142 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) | 144 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) |
| 143 | - if(pageInfoMsg.data.topicInfo?.shareOpen === 1){ | 145 | + console.log('contentDetailData pageInfoMsg.data', JSON.stringify(pageInfoMsg.data)) |
| 146 | + this.topicInfo = pageInfoMsg.data.topicInfo | ||
| 147 | + this.contentDetailData.newsId = Number(this.topicInfo.topicId) | ||
| 148 | + this.contentDetailData.newsType = this.topicInfo.topicType | ||
| 149 | + if(this.topicInfo?.shareOpen === 1){ | ||
| 150 | + this.contentDetailData.shareInfo.shareOpen = this.topicInfo?.shareOpen | ||
| 151 | + console.log('contentDetailData this.topicInfo', JSON.stringify(this.topicInfo)) | ||
| 144 | if (!this.operationButtonList.includes('share')) { | 152 | if (!this.operationButtonList.includes('share')) { |
| 145 | this.operationButtonList.push('share'); | 153 | this.operationButtonList.push('share'); |
| 146 | } | 154 | } |
| 147 | - }else{ | 155 | + } else { |
| 148 | this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') | 156 | this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') |
| 149 | } | 157 | } |
| 150 | } | 158 | } |
| 151 | 159 | ||
| 152 | - console.log('contentDetailData',this.contentDetailData) | 160 | + console.log('contentDetailData', JSON.stringify(this.contentDetailData)) |
| 153 | } | 161 | } |
| 154 | } | 162 | } |
| 155 | } | 163 | } |
| @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent { | @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent { | ||
| 199 | contentDetailData: this.contentDetailData, | 207 | contentDetailData: this.contentDetailData, |
| 200 | publishCommentModel: this.publishCommentModel, | 208 | publishCommentModel: this.publishCommentModel, |
| 201 | operationButtonList: this.operationButtonList, | 209 | operationButtonList: this.operationButtonList, |
| 210 | + topicInfo: this.topicInfo, | ||
| 202 | styleType: 1, | 211 | styleType: 1, |
| 203 | onCommentIconClick:()=>{ | 212 | onCommentIconClick:()=>{ |
| 204 | this.showCommentList = true | 213 | this.showCommentList = true |
| @@ -6,8 +6,12 @@ import router from '@ohos.router' | @@ -6,8 +6,12 @@ import router from '@ohos.router' | ||
| 6 | @Reusable | 6 | @Reusable |
| 7 | @Component | 7 | @Component |
| 8 | export struct CardSourceInfo { | 8 | export struct CardSourceInfo { |
| 9 | - @State contentDTO: ContentDTO = new ContentDTO(); | 9 | + @State @Watch('checkData') contentDTO: ContentDTO = new ContentDTO(); |
| 10 | @ObjectLink compDTO: CompDTO | 10 | @ObjectLink compDTO: CompDTO |
| 11 | + // 特殊稿件内部item展示的来源信息 | ||
| 12 | + isCompInnerSource: boolean = false | ||
| 13 | + // 是否有展示的信息,如来源,标签、时间、评论 | ||
| 14 | + @State viewShowData: boolean = true | ||
| 11 | 15 | ||
| 12 | aboutToAppear(): void { | 16 | aboutToAppear(): void { |
| 13 | } | 17 | } |
| @@ -21,6 +25,7 @@ export struct CardSourceInfo { | @@ -21,6 +25,7 @@ export struct CardSourceInfo { | ||
| 21 | 25 | ||
| 22 | aboutToDisappear(): void { | 26 | aboutToDisappear(): void { |
| 23 | } | 27 | } |
| 28 | + | ||
| 24 | handleTimeStr() { | 29 | handleTimeStr() { |
| 25 | return DateTimeUtils.getCommentTime( | 30 | return DateTimeUtils.getCommentTime( |
| 26 | this.contentDTO.publishTime.includes(' ') | 31 | this.contentDTO.publishTime.includes(' ') |
| @@ -54,7 +59,6 @@ export struct CardSourceInfo { | @@ -54,7 +59,6 @@ export struct CardSourceInfo { | ||
| 54 | return true | 59 | return true |
| 55 | } | 60 | } |
| 56 | 61 | ||
| 57 | - | ||
| 58 | /** | 62 | /** |
| 59 | * 全域数字显示规则 | 63 | * 全域数字显示规则 |
| 60 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | 64 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 |
| @@ -64,17 +68,17 @@ export struct CardSourceInfo { | @@ -64,17 +68,17 @@ export struct CardSourceInfo { | ||
| 64 | * 5、0 和空 不显示 | 68 | * 5、0 和空 不显示 |
| 65 | */ | 69 | */ |
| 66 | handlerNum(number: string) { | 70 | handlerNum(number: string) { |
| 67 | - const num = number??'0'; | 71 | + const num = number ?? '0'; |
| 68 | if (Number.parseInt(num) <= 9999) { | 72 | if (Number.parseInt(num) <= 9999) { |
| 69 | return Number.parseInt(num).toString() | 73 | return Number.parseInt(num).toString() |
| 70 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | 74 | } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { |
| 71 | const num1: string = num.slice(0, -4); // 万 | 75 | const num1: string = num.slice(0, -4); // 万 |
| 72 | const num2: string = num.slice(-4, -3); // 千 | 76 | const num2: string = num.slice(-4, -3); // 千 |
| 73 | - return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | 77 | + return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万' |
| 74 | } else if (Number.parseInt(num) > 99999999) { | 78 | } else if (Number.parseInt(num) > 99999999) { |
| 75 | const num1: string = num.slice(0, -8); // 亿 | 79 | const num1: string = num.slice(0, -8); // 亿 |
| 76 | const num2: string = num.slice(-8, -7); | 80 | const num2: string = num.slice(-8, -7); |
| 77 | - return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | 81 | + return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿' |
| 78 | } | 82 | } |
| 79 | return num | 83 | return num |
| 80 | } | 84 | } |
| @@ -88,18 +92,20 @@ export struct CardSourceInfo { | @@ -88,18 +92,20 @@ export struct CardSourceInfo { | ||
| 88 | 92 | ||
| 89 | build() { | 93 | build() { |
| 90 | Flex({ alignItems: ItemAlign.Center }) { | 94 | Flex({ alignItems: ItemAlign.Center }) { |
| 95 | + // 标签 | ||
| 91 | if (this.contentDTO.corner) { | 96 | if (this.contentDTO.corner) { |
| 92 | Text(this.contentDTO.corner) | 97 | Text(this.contentDTO.corner) |
| 93 | .fontSize($r("app.float.font_size_11")) | 98 | .fontSize($r("app.float.font_size_11")) |
| 94 | .fontColor($r("app.color.color_ED2800")) | 99 | .fontColor($r("app.color.color_ED2800")) |
| 95 | - .margin({ right: 2 }) | 100 | + .margin({ right: 6 }) |
| 96 | } | 101 | } |
| 97 | - if(this.contentDTO.cornerMark){ | 102 | + if (this.contentDTO.cornerMark) { |
| 98 | Text(this.contentDTO.cornerMark) | 103 | Text(this.contentDTO.cornerMark) |
| 99 | .fontSize($r("app.float.font_size_11")) | 104 | .fontSize($r("app.float.font_size_11")) |
| 100 | .fontColor($r("app.color.color_ED2800")) | 105 | .fontColor($r("app.color.color_ED2800")) |
| 101 | - .margin({ right: 2 }) | 106 | + .margin({ right: 6 }) |
| 102 | } | 107 | } |
| 108 | + // 来源信息 | ||
| 103 | if (this.contentDTO.rmhPlatform === 1) { | 109 | if (this.contentDTO.rmhPlatform === 1) { |
| 104 | Text(this.contentDTO.rmhInfo?.rmhName) | 110 | Text(this.contentDTO.rmhInfo?.rmhName) |
| 105 | .fontSize($r("app.float.font_size_11")) | 111 | .fontSize($r("app.float.font_size_11")) |
| @@ -113,7 +119,11 @@ export struct CardSourceInfo { | @@ -113,7 +119,11 @@ export struct CardSourceInfo { | ||
| 113 | .maxLines(1) | 119 | .maxLines(1) |
| 114 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 120 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 115 | } | 121 | } |
| 116 | - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum | 122 | + |
| 123 | + // 点 | ||
| 124 | + if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | ||
| 125 | + this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 126 | + (this.getContentDtoBean()?.interactData?.commentNum | ||
| 117 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | 127 | // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' |
| 118 | || (this.contentDTO.isSearch || this.contentDTO.isCollection || | 128 | || (this.contentDTO.isSearch || this.contentDTO.isCollection || |
| 119 | !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | 129 | !this.contentDTO.isSearch && DateTimeUtils.getCommentTime |
| @@ -123,52 +133,43 @@ export struct CardSourceInfo { | @@ -123,52 +133,43 @@ export struct CardSourceInfo { | ||
| 123 | .indexOf | 133 | .indexOf |
| 124 | ('-') === -1) | 134 | ('-') === -1) |
| 125 | )) { | 135 | )) { |
| 136 | + | ||
| 126 | Image($r("app.media.point")) | 137 | Image($r("app.media.point")) |
| 127 | .width(11) | 138 | .width(11) |
| 128 | .height(11) | 139 | .height(11) |
| 140 | + | ||
| 129 | } | 141 | } |
| 130 | - // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 | ||
| 131 | - // if (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 132 | - // (!this.contentDTO.isSearch && | ||
| 133 | - // DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) { | ||
| 134 | - // | ||
| 135 | - // Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 136 | - // .fontSize($r("app.float.font_size_11")) | ||
| 137 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 138 | - // .flexShrink(0); | ||
| 139 | - // } | ||
| 140 | - // if (this.contentDTO.source && this.showTime()) { | ||
| 141 | - // Text(this.handleTimeStr()) | ||
| 142 | - // .fontSize($r("app.float.font_size_11")) | ||
| 143 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 144 | - // .flexShrink(0) | ||
| 145 | - // .margin({right: 4}) | ||
| 146 | - // } | 142 | + |
| 143 | + // 发布日期 | ||
| 147 | if (this.showTime()) { | 144 | if (this.showTime()) { |
| 148 | Text(this.handleTimeStr()) | 145 | Text(this.handleTimeStr()) |
| 149 | .fontSize($r("app.float.font_size_11")) | 146 | .fontSize($r("app.float.font_size_11")) |
| 150 | .fontColor($r("app.color.color_B0B0B0")) | 147 | .fontColor($r("app.color.color_B0B0B0")) |
| 151 | .flexShrink(0) | 148 | .flexShrink(0) |
| 152 | - .margin({right: 4}) | 149 | + .margin({ right: 4 }) |
| 153 | } | 150 | } |
| 154 | - if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) { | 151 | + |
| 152 | + // 评论数 | ||
| 153 | + if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 154 | + this.showCommentNum()) { | ||
| 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 156 | .fontSize($r("app.float.font_size_11")) | 156 | .fontSize($r("app.float.font_size_11")) |
| 157 | .fontColor($r("app.color.color_B0B0B0")) | 157 | .fontColor($r("app.color.color_B0B0B0")) |
| 158 | .flexShrink(0) | 158 | .flexShrink(0) |
| 159 | + } else { | ||
| 160 | + | ||
| 161 | + if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | ||
| 162 | + Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) | ||
| 163 | + .fontSize($r("app.float.font_size_11")) | ||
| 164 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 165 | + .flexShrink(0) | ||
| 166 | + } | ||
| 167 | + | ||
| 159 | } | 168 | } |
| 160 | 169 | ||
| 161 | - // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | ||
| 162 | - // Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | ||
| 163 | - // .fontSize($r("app.float.font_size_11")) | ||
| 164 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 165 | - // .flexShrink(0) | ||
| 166 | - // .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | ||
| 167 | - // Visibility.Visible) | ||
| 168 | - // } | ||
| 169 | } | 170 | } |
| 170 | .width(CommonConstants.FULL_WIDTH) | 171 | .width(CommonConstants.FULL_WIDTH) |
| 171 | - .margin({ top: 8 }) | 172 | + .margin({ top: this.viewShowData ? 8 : 0 }) |
| 172 | } | 173 | } |
| 173 | 174 | ||
| 174 | /** | 175 | /** |
| @@ -184,4 +185,45 @@ export struct CardSourceInfo { | @@ -184,4 +185,45 @@ export struct CardSourceInfo { | ||
| 184 | } | 185 | } |
| 185 | return this.compDTO.operDataList[0] | 186 | return this.compDTO.operDataList[0] |
| 186 | } | 187 | } |
| 188 | + | ||
| 189 | + /** | ||
| 190 | + * 检测是否有展示的数据 | ||
| 191 | + */ | ||
| 192 | + checkData() { | ||
| 193 | + | ||
| 194 | + let have = false | ||
| 195 | + | ||
| 196 | + if (this.contentDTO.corner) { | ||
| 197 | + have = true | ||
| 198 | + } | ||
| 199 | + if (this.contentDTO.cornerMark) { | ||
| 200 | + have = true | ||
| 201 | + } | ||
| 202 | + if (this.contentDTO.rmhPlatform === 1) { | ||
| 203 | + have = true | ||
| 204 | + } else if (this.contentDTO.source) { | ||
| 205 | + have = true | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + // 发布日期 | ||
| 209 | + if (this.showTime()) { | ||
| 210 | + have = true | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + // 评论数 | ||
| 214 | + if (!this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 215 | + this.showCommentNum()) { | ||
| 216 | + have = true | ||
| 217 | + } else { | ||
| 218 | + if (this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | ||
| 219 | + have = true | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + if (have) { | ||
| 224 | + | ||
| 225 | + } else { | ||
| 226 | + this.viewShowData = false | ||
| 227 | + } | ||
| 228 | + } | ||
| 187 | } | 229 | } |
| 1 | -import { ContentDTO, slideShows, VideoInfoDTO, CompDTO } from 'wdBean'; | 1 | +import { ContentDTO, slideShows, VideoInfoDTO, CompDTO, InteractDataDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| @@ -8,6 +8,8 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | @@ -8,6 +8,8 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | import router from '@ohos.router' | 10 | import router from '@ohos.router' |
| 11 | +import { BasePageHelp } from '../page/template/BasePageHelp'; | ||
| 12 | +import { Logger } from 'wdKit/Index'; | ||
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 13 | * 大专题卡--CompStyle: 10 | 15 | * 大专题卡--CompStyle: 10 |
| @@ -25,11 +27,39 @@ export struct Card10Component { | @@ -25,11 +27,39 @@ export struct Card10Component { | ||
| 25 | @State titleMarked: boolean = false; | 27 | @State titleMarked: boolean = false; |
| 26 | @State textArr: textItem[] = [] | 28 | @State textArr: textItem[] = [] |
| 27 | @State hideDetail: boolean = false; | 29 | @State hideDetail: boolean = false; |
| 30 | + basePageHelp: BasePageHelp = new BasePageHelp | ||
| 31 | + // 稿件参与批查,需要对列表信息单独重绘 | ||
| 32 | + @State isBatchData: boolean = false | ||
| 28 | 33 | ||
| 29 | async aboutToAppear(): Promise<void> { | 34 | async aboutToAppear(): Promise<void> { |
| 30 | this.titleInit(); | 35 | this.titleInit(); |
| 31 | this.loadImg = await onlyWifiLoadImg(); | 36 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | this.initHideDetail(); | 37 | this.initHideDetail(); |
| 38 | + | ||
| 39 | + if (!this.hideDetail) { | ||
| 40 | + this.isBatchData = false | ||
| 41 | + // 批查评论数据 | ||
| 42 | + let interactArray = this.basePageHelp.getCompInteractParams(this.contentDTO.slideShows) | ||
| 43 | + if (interactArray.contentList != null && interactArray.contentList.length > 0) { | ||
| 44 | + this.basePageHelp.requestCompInteractData(interactArray) | ||
| 45 | + .then((result) => { | ||
| 46 | + if (result != null && result.length > 0) { | ||
| 47 | + this.isBatchData = true | ||
| 48 | + this.contentDTO.slideShows.forEach((slideShowBean) => { | ||
| 49 | + let newsId = slideShowBean.newsId | ||
| 50 | + for (let interactBean of result) { | ||
| 51 | + console.debug(TAG, JSON.stringify(interactBean)) | ||
| 52 | + if (newsId == interactBean.contentId) { | ||
| 53 | + slideShowBean.interactDataDto = interactBean | ||
| 54 | + break | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + }) | ||
| 58 | + } | ||
| 59 | + }) | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + | ||
| 33 | } | 63 | } |
| 34 | 64 | ||
| 35 | initHideDetail() { | 65 | initHideDetail() { |
| @@ -40,7 +70,7 @@ export struct Card10Component { | @@ -40,7 +70,7 @@ export struct Card10Component { | ||
| 40 | } | 70 | } |
| 41 | 71 | ||
| 42 | titleInit() { | 72 | titleInit() { |
| 43 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 73 | + const titleInitRes: titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); |
| 44 | this.titleMarked = titleInitRes.titleMarked; | 74 | this.titleMarked = titleInitRes.titleMarked; |
| 45 | this.textArr = titleInitRes.textArr; | 75 | this.textArr = titleInitRes.textArr; |
| 46 | } | 76 | } |
| @@ -94,17 +124,14 @@ export struct Card10Component { | @@ -94,17 +124,14 @@ export struct Card10Component { | ||
| 94 | 124 | ||
| 95 | // 专题列表--后端返回三个, | 125 | // 专题列表--后端返回三个, |
| 96 | if (!this.hideDetail) { | 126 | if (!this.hideDetail) { |
| 97 | - Column() { | ||
| 98 | - ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 99 | - this.timelineItem(item, index) | ||
| 100 | - if (index < this.contentDTO.slideShows.length - 1) { | ||
| 101 | - // 在不是最后一个元素的情况下添加分隔符 | ||
| 102 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 103 | - } | ||
| 104 | - }) | ||
| 105 | - } | 127 | + |
| 128 | + if (this.isBatchData) { | ||
| 129 | + this.drawCompList() | ||
| 130 | + } else { | ||
| 131 | + this.drawCompList() | ||
| 106 | } | 132 | } |
| 107 | 133 | ||
| 134 | + } | ||
| 108 | 135 | ||
| 109 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 | 136 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 |
| 110 | if (this.contentDTO.hasMore == 1 && !this.hideDetail) { | 137 | if (this.contentDTO.hasMore == 1 && !this.hideDetail) { |
| @@ -141,8 +168,26 @@ export struct Card10Component { | @@ -141,8 +168,26 @@ export struct Card10Component { | ||
| 141 | } | 168 | } |
| 142 | 169 | ||
| 143 | @Builder | 170 | @Builder |
| 171 | + drawCompList() { | ||
| 172 | + | ||
| 173 | + Column() { | ||
| 174 | + ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 175 | + this.timelineItem(item, index) | ||
| 176 | + if (index < this.contentDTO.slideShows.length - 1) { | ||
| 177 | + // 在不是最后一个元素的情况下添加分隔符 | ||
| 178 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 179 | + } | ||
| 180 | + }) | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + @Builder | ||
| 144 | timelineItem(item: slideShows, index: number) { | 186 | timelineItem(item: slideShows, index: number) { |
| 145 | Row() { | 187 | Row() { |
| 188 | + // 有图片资源的 | ||
| 189 | + if (item.fullColumnImgUrls && item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 190 | + | ||
| 146 | Column() { | 191 | Column() { |
| 147 | Stack() { | 192 | Stack() { |
| 148 | if (item.objectType == '5') { | 193 | if (item.objectType == '5') { |
| @@ -161,6 +206,7 @@ export struct Card10Component { | @@ -161,6 +206,7 @@ export struct Card10Component { | ||
| 161 | //bottom 评论等信息 | 206 | //bottom 评论等信息 |
| 162 | CardSourceInfo( | 207 | CardSourceInfo( |
| 163 | { | 208 | { |
| 209 | + isCompInnerSource: true, | ||
| 164 | compDTO: this.compDTO, | 210 | compDTO: this.compDTO, |
| 165 | contentDTO: this.createContent(item) | 211 | contentDTO: this.createContent(item) |
| 166 | } | 212 | } |
| @@ -170,8 +216,6 @@ export struct Card10Component { | @@ -170,8 +216,6 @@ export struct Card10Component { | ||
| 170 | .height(78) | 216 | .height(78) |
| 171 | .alignItems(HorizontalAlign.Start) | 217 | .alignItems(HorizontalAlign.Start) |
| 172 | 218 | ||
| 173 | - // 右侧图片 | ||
| 174 | - if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 175 | Stack() { | 219 | Stack() { |
| 176 | Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') | 220 | Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') |
| 177 | .backgroundColor(0xf5f5f5) | 221 | .backgroundColor(0xf5f5f5) |
| @@ -186,6 +230,33 @@ export struct Card10Component { | @@ -186,6 +230,33 @@ export struct Card10Component { | ||
| 186 | } | 230 | } |
| 187 | .alignContent(Alignment.BottomEnd) | 231 | .alignContent(Alignment.BottomEnd) |
| 188 | .height(78) | 232 | .height(78) |
| 233 | + }else{ | ||
| 234 | + Column() { | ||
| 235 | + Stack() { | ||
| 236 | + if (item.objectType == '5') { | ||
| 237 | + Notes({ objectType: 5 }) | ||
| 238 | + } | ||
| 239 | + Text(item.newsTitle) | ||
| 240 | + .fontSize($r('app.float.font_size_17')) | ||
| 241 | + .fontWeight(400) | ||
| 242 | + .fontColor($r('app.color.color_222222')) | ||
| 243 | + .maxLines(2) | ||
| 244 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 245 | + .textIndent(item.objectType == '5' ? 38 : 0) | ||
| 246 | + }.alignContent(Alignment.TopStart) | ||
| 247 | + | ||
| 248 | + //bottom 评论等信息 | ||
| 249 | + CardSourceInfo( | ||
| 250 | + { | ||
| 251 | + isCompInnerSource: true, | ||
| 252 | + compDTO: this.compDTO, | ||
| 253 | + contentDTO: this.createContent(item) | ||
| 254 | + } | ||
| 255 | + ) | ||
| 256 | + } | ||
| 257 | + .layoutWeight(1) | ||
| 258 | + .alignItems(HorizontalAlign.Start) | ||
| 259 | + | ||
| 189 | } | 260 | } |
| 190 | } | 261 | } |
| 191 | .padding({ top: 10, bottom: 10 }) | 262 | .padding({ top: 10, bottom: 10 }) |
| @@ -201,8 +272,9 @@ export struct Card10Component { | @@ -201,8 +272,9 @@ export struct Card10Component { | ||
| 201 | 272 | ||
| 202 | private createContent(item: slideShows): ContentDTO { | 273 | private createContent(item: slideShows): ContentDTO { |
| 203 | let contentDTO = new ContentDTO() | 274 | let contentDTO = new ContentDTO() |
| 204 | - contentDTO.publishTime = item.publishTime.toString() || ''; | 275 | + contentDTO.publishTime = item.publishTime?.toString() || ''; |
| 205 | contentDTO.source = item.source || ''; | 276 | contentDTO.source = item.source || ''; |
| 277 | + contentDTO.interactData = item.interactDataDto | ||
| 206 | return contentDTO; | 278 | return contentDTO; |
| 207 | } | 279 | } |
| 208 | 280 |
| @@ -55,7 +55,7 @@ export struct Card14Component { | @@ -55,7 +55,7 @@ export struct Card14Component { | ||
| 55 | ) | 55 | ) |
| 56 | } | 56 | } |
| 57 | // 左标题,右图 | 57 | // 左标题,右图 |
| 58 | - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) { | 58 | + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { |
| 59 | 59 | ||
| 60 | Text() { | 60 | Text() { |
| 61 | if (this.titleMarked) { | 61 | if (this.titleMarked) { |
| @@ -19,7 +19,7 @@ export struct LiveBigImage02Component { | @@ -19,7 +19,7 @@ export struct LiveBigImage02Component { | ||
| 19 | @State contentDTO: ContentDTO = new ContentDTO(); | 19 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 20 | @State loadImg: boolean = false; | 20 | @State loadImg: boolean = false; |
| 21 | @State clicked: boolean = false; | 21 | @State clicked: boolean = false; |
| 22 | - | 22 | + index: number = 0 |
| 23 | async aboutToAppear() { | 23 | async aboutToAppear() { |
| 24 | const curRouter = router.getState().name; | 24 | const curRouter = router.getState().name; |
| 25 | this.clicked = hasClicked(this.contentDTO.objectId,curRouter) | 25 | this.clicked = hasClicked(this.contentDTO.objectId,curRouter) |
| @@ -102,8 +102,7 @@ export struct LiveBigImage02Component { | @@ -102,8 +102,7 @@ export struct LiveBigImage02Component { | ||
| 102 | lottieWidth: 14, | 102 | lottieWidth: 14, |
| 103 | lottieHeight: 14, | 103 | lottieHeight: 14, |
| 104 | autoplay: true, | 104 | autoplay: true, |
| 105 | - loop: true, | ||
| 106 | - title: item.newsTitle | 105 | + loop: true |
| 107 | }) | 106 | }) |
| 108 | .margin({ | 107 | .margin({ |
| 109 | right: '2vp' | 108 | right: '2vp' |
| @@ -14,28 +14,16 @@ export struct LottieView { | @@ -14,28 +14,16 @@ export struct LottieView { | ||
| 14 | private politeChickyController: CanvasRenderingContext2D = | 14 | private politeChickyController: CanvasRenderingContext2D = |
| 15 | new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象 | 15 | new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象 |
| 16 | private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象 | 16 | private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象 |
| 17 | - @Prop title: string | ||
| 18 | 17 | ||
| 19 | - // 页面隐藏销毁动画 | ||
| 20 | - // onPageHide(): void { | ||
| 21 | - // this.animateItem?.destroy() | ||
| 22 | - // | ||
| 23 | - // if (this.onComplete) { | ||
| 24 | - // this.animateItem?.removeEventListener('complete', this.onComplete) | ||
| 25 | - // } | ||
| 26 | - // } | 18 | + |
| 27 | 19 | ||
| 28 | /** | 20 | /** |
| 29 | * 加载动画 | 21 | * 加载动画 |
| 30 | * @param autoplay 控制动画是否自动播放参数 | 22 | * @param autoplay 控制动画是否自动播放参数 |
| 31 | */ | 23 | */ |
| 32 | loadAnimation() { | 24 | loadAnimation() { |
| 33 | - // 销毁动画,减少缓存 | ||
| 34 | - if (this.animateItem !== null) { | ||
| 35 | - this.animateItem.destroy(this.name); | ||
| 36 | - this.animateItem = null; | ||
| 37 | - } | ||
| 38 | 25 | ||
| 26 | + this.onDestroyAnimation() | ||
| 39 | this.animateItem = lottie.loadAnimation({ | 27 | this.animateItem = lottie.loadAnimation({ |
| 40 | container: this.politeChickyController, | 28 | container: this.politeChickyController, |
| 41 | renderer: 'canvas', | 29 | renderer: 'canvas', |
| @@ -55,32 +43,19 @@ export struct LottieView { | @@ -55,32 +43,19 @@ export struct LottieView { | ||
| 55 | 43 | ||
| 56 | } | 44 | } |
| 57 | 45 | ||
| 58 | - aboutToAppear(): void { | ||
| 59 | - // console.error('XXXXZZZZ', '-------aboutToAppear-------' + this.title) | ||
| 60 | - //lottie?.play() | ||
| 61 | - | ||
| 62 | - // if(this.init){ | ||
| 63 | - // if(this.animateItem = null){ | ||
| 64 | - // this.loadAnimation(); | ||
| 65 | - // } | ||
| 66 | - // } | ||
| 67 | - | ||
| 68 | - | 46 | + /** |
| 47 | + * 摧毁动画 | ||
| 48 | + */ | ||
| 49 | + onDestroyAnimation(){ | ||
| 50 | + // 销毁动画,减少缓存 | ||
| 51 | + if (this.animateItem !== null) { | ||
| 52 | + this.animateItem.destroy(this.name); | ||
| 53 | + this.animateItem = null; | ||
| 69 | } | 54 | } |
| 70 | 55 | ||
| 71 | - aboutToDisappear(): void { | ||
| 72 | - // console.error('XXXXZZZZ', '-------aboutToDisappear-------' + this.title) | ||
| 73 | - // if(this.init){ | ||
| 74 | - // lottie?.destroy(this.name) | ||
| 75 | - // | ||
| 76 | - // if (this.onComplete) { | ||
| 77 | - // this.animateItem?.removeEventListener('complete', this.onComplete) | ||
| 78 | - // } | ||
| 79 | - // this.animateItem = null; | ||
| 80 | - // // } | ||
| 81 | - | ||
| 82 | } | 56 | } |
| 83 | 57 | ||
| 58 | + | ||
| 84 | build() { | 59 | build() { |
| 85 | Stack({ alignContent: Alignment.TopStart }) { | 60 | Stack({ alignContent: Alignment.TopStart }) { |
| 86 | Canvas(this.politeChickyController) | 61 | Canvas(this.politeChickyController) |
| @@ -92,10 +67,10 @@ export struct LottieView { | @@ -92,10 +67,10 @@ export struct LottieView { | ||
| 92 | this.onReady(this.animateItem) | 67 | this.onReady(this.animateItem) |
| 93 | } | 68 | } |
| 94 | }) | 69 | }) |
| 95 | - .onDisAppear(() => { | ||
| 96 | - lottie.destroy(this.name) | ||
| 97 | - this.animateItem = null; | ||
| 98 | - }).onAppear(()=>{ | 70 | + .onDisAppear(()=>{ |
| 71 | + this.onDestroyAnimation() | ||
| 72 | + }) | ||
| 73 | + .onAppear(()=>{ | ||
| 99 | this.loadAnimation(); | 74 | this.loadAnimation(); |
| 100 | }) | 75 | }) |
| 101 | 76 |
| @@ -34,20 +34,13 @@ export default struct MinePageUserSimpleInfoUI { | @@ -34,20 +34,13 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 34 | Row(){ | 34 | Row(){ |
| 35 | //头像 | 35 | //头像 |
| 36 | Stack(){ | 36 | Stack(){ |
| 37 | - if (this.headPhotoUrl.length > 0){ | ||
| 38 | - Image(this.headPhotoUrl) | ||
| 39 | - .alt(this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')) | ||
| 40 | - .width(`${this.calcHeight(100)}lpx`) | ||
| 41 | - .height(`${this.calcHeight(100)}lpx`) | ||
| 42 | - .objectFit(ImageFit.Cover) | ||
| 43 | - .borderRadius(50) | ||
| 44 | - }else { | ||
| 45 | - Image(this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')) | 37 | + |
| 38 | + Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head')) | ||
| 39 | + .alt($r('app.media.default_head')) | ||
| 46 | .width(`${this.calcHeight(100)}lpx`) | 40 | .width(`${this.calcHeight(100)}lpx`) |
| 47 | .height(`${this.calcHeight(100)}lpx`) | 41 | .height(`${this.calcHeight(100)}lpx`) |
| 48 | .objectFit(ImageFit.Cover) | 42 | .objectFit(ImageFit.Cover) |
| 49 | .borderRadius(50) | 43 | .borderRadius(50) |
| 50 | - } | ||
| 51 | 44 | ||
| 52 | if(StringUtils.isNotEmpty(this.levelHead)){ | 45 | if(StringUtils.isNotEmpty(this.levelHead)){ |
| 53 | Image(this.levelHead) | 46 | Image(this.levelHead) |
| @@ -395,7 +395,7 @@ export struct PaperSingleColumn999CardView { | @@ -395,7 +395,7 @@ export struct PaperSingleColumn999CardView { | ||
| 395 | private item: ContentDTO = new ContentDTO(); | 395 | private item: ContentDTO = new ContentDTO(); |
| 396 | private index: number = -1; | 396 | private index: number = -1; |
| 397 | @State isRead: boolean = false;//已读状态 | 397 | @State isRead: boolean = false;//已读状态 |
| 398 | - @State interactData: InteractDataDTO = {} as InteractDataDTO; | 398 | + @State interactData: InteractDataDTO = new InteractDataDTO |
| 399 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] | 399 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] |
| 400 | 400 | ||
| 401 | getPublishTime(): string { | 401 | getPublishTime(): string { |
| @@ -298,7 +298,7 @@ struct ChannelSubscriptionLayout { | @@ -298,7 +298,7 @@ struct ChannelSubscriptionLayout { | ||
| 298 | Text(INDEX_SETTING_SUBTITLE) | 298 | Text(INDEX_SETTING_SUBTITLE) |
| 299 | .fontSize(12) | 299 | .fontSize(12) |
| 300 | .fontWeight(400) | 300 | .fontWeight(400) |
| 301 | - .fontColor('#222222') | 301 | + .fontColor('#80222222') |
| 302 | } | 302 | } |
| 303 | .width('100%') | 303 | .width('100%') |
| 304 | .margin({ top: 22, bottom: 16 }) | 304 | .margin({ top: 22, bottom: 16 }) |
| 1 | -import { CompDTO, | 1 | +import { |
| 2 | + CompDTO, | ||
| 2 | ContentBean, | 3 | ContentBean, |
| 3 | ContentDTO, | 4 | ContentDTO, |
| 4 | InteractDataDTO, | 5 | InteractDataDTO, |
| 5 | - InteractParam, LiveRoomDataBean, ReserveBean, ReserveItemBean } from 'wdBean/Index' | 6 | + InteractParam, |
| 7 | + LiveRoomDataBean, | ||
| 8 | + ReserveBean, | ||
| 9 | + ReserveItemBean, | ||
| 10 | + slideShows | ||
| 11 | +} from 'wdBean/Index' | ||
| 6 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO' | 12 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO' |
| 7 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index' | 13 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index' |
| 8 | import { HttpUtils, ResponseDTO } from 'wdNetwork/Index' | 14 | import { HttpUtils, ResponseDTO } from 'wdNetwork/Index' |
| @@ -22,7 +28,7 @@ export class BasePageHelp { | @@ -22,7 +28,7 @@ export class BasePageHelp { | ||
| 22 | if (HttpUtils.getUserId()) { | 28 | if (HttpUtils.getUserId()) { |
| 23 | 29 | ||
| 24 | let time = DateTimeUtils.getTimeStamp().toString() | 30 | let time = DateTimeUtils.getTimeStamp().toString() |
| 25 | - Logger.debug(TAG, 'getAppointmentInfo-->'+time) | 31 | + Logger.debug(TAG, 'getAppointmentInfo-->' + time) |
| 26 | const reserveBean = this.transformToLiveDetailsBeans(compList) | 32 | const reserveBean = this.transformToLiveDetailsBeans(compList) |
| 27 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { | 33 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { |
| 28 | Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`) | 34 | Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`) |
| @@ -116,7 +122,7 @@ export class BasePageHelp { | @@ -116,7 +122,7 @@ export class BasePageHelp { | ||
| 116 | return idList.join(',') | 122 | return idList.join(',') |
| 117 | } | 123 | } |
| 118 | 124 | ||
| 119 | -/** | 125 | + /** |
| 120 | * 批查稿件的互动数据,如 评论人数等 | 126 | * 批查稿件的互动数据,如 评论人数等 |
| 121 | * @param compList | 127 | * @param compList |
| 122 | * @returns | 128 | * @returns |
| @@ -165,13 +171,17 @@ export class BasePageHelp { | @@ -165,13 +171,17 @@ export class BasePageHelp { | ||
| 165 | allInteractDataList.push(...value); | 171 | allInteractDataList.push(...value); |
| 166 | } | 172 | } |
| 167 | }) | 173 | }) |
| 168 | - // 批查全部完成,统一设置到comp里 | ||
| 169 | - // this.resetInteract(allInteractDataList, compList); | ||
| 170 | success(allInteractDataList); | 174 | success(allInteractDataList); |
| 171 | }) | 175 | }) |
| 172 | }) | 176 | }) |
| 173 | } | 177 | } |
| 174 | 178 | ||
| 179 | + | ||
| 180 | + /** | ||
| 181 | + * 收集信息流页面,可参与批查稿件的业务信息 | ||
| 182 | + * @param compList | ||
| 183 | + * @returns | ||
| 184 | + */ | ||
| 175 | private getInteractParams(compList: CompDTO[]): InteractParam { | 185 | private getInteractParams(compList: CompDTO[]): InteractParam { |
| 176 | if (compList == null || compList.length == 0) { | 186 | if (compList == null || compList.length == 0) { |
| 177 | return {} as InteractParam; | 187 | return {} as InteractParam; |
| @@ -204,6 +214,34 @@ export class BasePageHelp { | @@ -204,6 +214,34 @@ export class BasePageHelp { | ||
| 204 | return param; | 214 | return param; |
| 205 | } | 215 | } |
| 206 | 216 | ||
| 217 | + /** | ||
| 218 | + * 获取组件中需要参与批查业务信息 | ||
| 219 | + * @param slideShowArray | ||
| 220 | + * @returns | ||
| 221 | + */ | ||
| 222 | + public getCompInteractParams(slideShowArray: slideShows[]): InteractParam { | ||
| 223 | + | ||
| 224 | + if (slideShowArray == null || slideShowArray.length == 0) { | ||
| 225 | + return {} as InteractParam; | ||
| 226 | + } | ||
| 227 | + let param: InteractParam = {} as InteractParam; | ||
| 228 | + param.contentList = new Array<ContentBean>(); | ||
| 229 | + slideShowArray.forEach((value) => { | ||
| 230 | + let bean = {} as ContentBean; | ||
| 231 | + bean.contentId = value.newsId; | ||
| 232 | + bean.contentType = value.objectType; | ||
| 233 | + param.contentList.push(bean); | ||
| 234 | + }) | ||
| 235 | + | ||
| 236 | + return param | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + | ||
| 240 | + /** | ||
| 241 | + * 查询互动相关数据,如收藏数、评论数等 | ||
| 242 | + * @param param | ||
| 243 | + * @returns | ||
| 244 | + */ | ||
| 207 | private createInteractDataPromise(param: InteractParam) { | 245 | private createInteractDataPromise(param: InteractParam) { |
| 208 | return new Promise<InteractDataDTO[]>((success, error) => { | 246 | return new Promise<InteractDataDTO[]>((success, error) => { |
| 209 | PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => { | 247 | PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => { |
| @@ -221,6 +259,18 @@ export class BasePageHelp { | @@ -221,6 +259,18 @@ export class BasePageHelp { | ||
| 221 | }); | 259 | }); |
| 222 | } | 260 | } |
| 223 | 261 | ||
| 262 | + async requestCompInteractData(param: InteractParam): Promise<InteractDataDTO[]> { | ||
| 263 | + return new Promise<InteractDataDTO[]>((success, error) => { | ||
| 264 | + this.createInteractDataPromise(param).then((result) => { | ||
| 265 | + if (!CollectionUtils.isArray(result)) { | ||
| 266 | + success(new Array<InteractDataDTO>()); | ||
| 267 | + return; | ||
| 268 | + } | ||
| 269 | + success(result); | ||
| 270 | + }) | ||
| 271 | + }) | ||
| 272 | + } | ||
| 273 | + | ||
| 224 | /** | 274 | /** |
| 225 | * 刷新互动数据到compList | 275 | * 刷新互动数据到compList |
| 226 | * @param interact 批查互动数据结果 | 276 | * @param interact 批查互动数据结果 |
| @@ -252,6 +302,4 @@ export class BasePageHelp { | @@ -252,6 +302,4 @@ export class BasePageHelp { | ||
| 252 | } | 302 | } |
| 253 | }) | 303 | }) |
| 254 | } | 304 | } |
| 255 | - | ||
| 256 | - | ||
| 257 | } | 305 | } |
| @@ -41,6 +41,7 @@ export default struct TemplatePageComponent { | @@ -41,6 +41,7 @@ export default struct TemplatePageComponent { | ||
| 41 | 41 | ||
| 42 | extra: string = '' | 42 | extra: string = '' |
| 43 | 43 | ||
| 44 | + | ||
| 44 | async aboutToAppear() { | 45 | async aboutToAppear() { |
| 45 | Logger.debug(TAG, 'aboutToAppear') | 46 | Logger.debug(TAG, 'aboutToAppear') |
| 46 | this.requestPageData() | 47 | this.requestPageData() |
| @@ -78,9 +79,6 @@ export default struct TemplatePageComponent { | @@ -78,9 +79,6 @@ export default struct TemplatePageComponent { | ||
| 78 | }) | 79 | }) |
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | - aboutToDisappear(): void { | ||
| 82 | - | ||
| 83 | - } | ||
| 84 | 82 | ||
| 85 | build() { | 83 | build() { |
| 86 | if (this.templatePage.pageCompType === TemplatePageStateType.LOADING) { | 84 | if (this.templatePage.pageCompType === TemplatePageStateType.LOADING) { |
| 1 | -import { ContentDTO } from 'wdBean/Index'; | ||
| 2 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | 1 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; |
| 3 | import { LazyDataSource } from 'wdKit/Index'; | 2 | import { LazyDataSource } from 'wdKit/Index'; |
| 4 | import { WDViewDefaultType } from '../../view/EmptyComponent'; | 3 | import { WDViewDefaultType } from '../../view/EmptyComponent'; |
| @@ -85,8 +85,8 @@ export default struct CustomLayout { | @@ -85,8 +85,8 @@ export default struct CustomLayout { | ||
| 85 | name: this.animateName, | 85 | name: this.animateName, |
| 86 | path: "lottie/refresh_step1.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 | 86 | path: "lottie/refresh_step1.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 |
| 87 | }) | 87 | }) |
| 88 | - } | ||
| 89 | this.animateItem.goToAndStop(1) | 88 | this.animateItem.goToAndStop(1) |
| 89 | + } | ||
| 90 | let total = CustomLayout.REFRESH_HEIGHT | 90 | let total = CustomLayout.REFRESH_HEIGHT |
| 91 | let progress = offset * 100 / total | 91 | let progress = offset * 100 / total |
| 92 | this.animateItem?.goToAndStop(this.getFramesByProgress(progress), true); | 92 | this.animateItem?.goToAndStop(this.getFramesByProgress(progress), true); |
| @@ -103,9 +103,6 @@ export default struct CustomLayout { | @@ -103,9 +103,6 @@ export default struct CustomLayout { | ||
| 103 | path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 | 103 | path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 |
| 104 | }) | 104 | }) |
| 105 | } | 105 | } |
| 106 | - // this.animateItem2.isLoaded | ||
| 107 | - // TODO 是否拦截重复触发 | ||
| 108 | - this.animateItem2.goToAndPlay(1) | ||
| 109 | } | 106 | } |
| 110 | 107 | ||
| 111 | getFramesByProgress(progress: number): number { | 108 | getFramesByProgress(progress: number): number { |
| @@ -18,14 +18,18 @@ export struct CustomPullToRefresh { | @@ -18,14 +18,18 @@ export struct CustomPullToRefresh { | ||
| 18 | .setAnimDuration(500); | 18 | .setAnimDuration(500); |
| 19 | private refreshSettings: RenderingContextSettings = new RenderingContextSettings(true) | 19 | private refreshSettings: RenderingContextSettings = new RenderingContextSettings(true) |
| 20 | private refreshContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshSettings) | 20 | private refreshContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshSettings) |
| 21 | + private refreshingSettings: RenderingContextSettings = new RenderingContextSettings(true) | ||
| 22 | + private refreshingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshingSettings) | ||
| 21 | private loadMoreSettings: RenderingContextSettings = new RenderingContextSettings(true) | 23 | private loadMoreSettings: RenderingContextSettings = new RenderingContextSettings(true) |
| 22 | private loadMoreContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.loadMoreSettings) | 24 | private loadMoreContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.loadMoreSettings) |
| 23 | private refreshAnimation: AnimationItem | null = null; | 25 | private refreshAnimation: AnimationItem | null = null; |
| 26 | + private refreshingAnimation: AnimationItem | null = null; | ||
| 24 | private loadMoreAnimation: AnimationItem | null = null; | 27 | private loadMoreAnimation: AnimationItem | null = null; |
| 25 | private refreshAnimName: string = "refresh"; | 28 | private refreshAnimName: string = "refresh"; |
| 26 | private refreshingAnimName: string = "refreshing"; | 29 | private refreshingAnimName: string = "refreshing"; |
| 27 | private loadMoreAnimName: string = "loadMore"; | 30 | private loadMoreAnimName: string = "loadMore"; |
| 28 | private refreshAnimationDestroy = true | 31 | private refreshAnimationDestroy = true |
| 32 | + private refreshingAnimationDestroy = true | ||
| 29 | // refresh-1,refreshing-2,refreshed-3,idle-4 | 33 | // refresh-1,refreshing-2,refreshed-3,idle-4 |
| 30 | @State @Watch('stateChange') private refreshState: number = 4; | 34 | @State @Watch('stateChange') private refreshState: number = 4; |
| 31 | 35 | ||
| @@ -102,7 +106,10 @@ export struct CustomPullToRefresh { | @@ -102,7 +106,10 @@ export struct CustomPullToRefresh { | ||
| 102 | lottie.destroy(this.refreshingAnimName); | 106 | lottie.destroy(this.refreshingAnimName); |
| 103 | this.refreshAnimation?.removeEventListener('DOMLoaded') | 107 | this.refreshAnimation?.removeEventListener('DOMLoaded') |
| 104 | this.refreshAnimation?.removeEventListener('destroy') | 108 | this.refreshAnimation?.removeEventListener('destroy') |
| 109 | + this.refreshingAnimation?.removeEventListener('DOMLoaded') | ||
| 110 | + this.refreshingAnimation?.removeEventListener('destroy') | ||
| 105 | this.refreshAnimation = null | 111 | this.refreshAnimation = null |
| 112 | + this.refreshingAnimation = null | ||
| 106 | } | 113 | } |
| 107 | 114 | ||
| 108 | @Builder | 115 | @Builder |
| @@ -120,9 +127,23 @@ export struct CustomPullToRefresh { | @@ -120,9 +127,23 @@ export struct CustomPullToRefresh { | ||
| 120 | }) | 127 | }) |
| 121 | .onDisAppear(() => { | 128 | .onDisAppear(() => { |
| 122 | lottie.destroy(this.refreshAnimName); | 129 | lottie.destroy(this.refreshAnimName); |
| 130 | + }) | ||
| 131 | + .visibility(this.refreshState == 1 ? Visibility.Visible : Visibility.Hidden) | ||
| 132 | + | ||
| 133 | + Canvas(this.refreshingContext) | ||
| 134 | + .width(60) | ||
| 135 | + .height(60) | ||
| 136 | + .backgroundColor(Color.Transparent) | ||
| 137 | + .onReady(() => { | ||
| 138 | + // 可在此生命回调周期中加载动画,可以保证动画尺寸正确 | ||
| 139 | + //抗锯齿的设置 | ||
| 140 | + this.refreshContext.imageSmoothingEnabled = true; | ||
| 141 | + this.refreshContext.imageSmoothingQuality = 'medium' | ||
| 142 | + }) | ||
| 143 | + .onDisAppear(() => { | ||
| 123 | lottie.destroy(this.refreshingAnimName); | 144 | lottie.destroy(this.refreshingAnimName); |
| 124 | }) | 145 | }) |
| 125 | - .visibility((this.refreshState == 1 || this.refreshState == 2) ? Visibility.Visible : Visibility.Hidden) | 146 | + .visibility(this.refreshState == 2 ? Visibility.Visible : Visibility.Hidden) |
| 126 | 147 | ||
| 127 | Text('已更新至最新') | 148 | Text('已更新至最新') |
| 128 | .fontSize(14) | 149 | .fontSize(14) |
| @@ -175,10 +196,7 @@ export struct CustomPullToRefresh { | @@ -175,10 +196,7 @@ export struct CustomPullToRefresh { | ||
| 175 | } | 196 | } |
| 176 | 197 | ||
| 177 | private refreshAnim(percent: number) { | 198 | private refreshAnim(percent: number) { |
| 178 | - if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshAnimName || | ||
| 179 | - this.refreshAnimationDestroy) { | ||
| 180 | - this.refreshAnimation?.destroy(this.refreshAnimName) | ||
| 181 | - this.refreshAnimation?.destroy(this.refreshingAnimName) | 199 | + if (this.refreshAnimation == null || this.refreshAnimationDestroy) { |
| 182 | this.refreshAnimation = lottie.loadAnimation({ | 200 | this.refreshAnimation = lottie.loadAnimation({ |
| 183 | container: this.refreshContext, | 201 | container: this.refreshContext, |
| 184 | renderer: 'canvas', // canvas 渲染模式 | 202 | renderer: 'canvas', // canvas 渲染模式 |
| @@ -212,21 +230,19 @@ export struct CustomPullToRefresh { | @@ -212,21 +230,19 @@ export struct CustomPullToRefresh { | ||
| 212 | } | 230 | } |
| 213 | 231 | ||
| 214 | private refreshingAnim() { | 232 | private refreshingAnim() { |
| 215 | - // Logger.error('zzzz', 'animate2, 1') | ||
| 216 | // 先销毁之前的动画 | 233 | // 先销毁之前的动画 |
| 217 | - if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshingAnimName || | ||
| 218 | - this.refreshAnimationDestroy) { | ||
| 219 | - this.refreshAnimation?.destroy(this.refreshAnimName) | ||
| 220 | - this.refreshAnimation?.destroy(this.refreshingAnimName) | ||
| 221 | - this.refreshAnimation = lottie.loadAnimation({ | ||
| 222 | - container: this.refreshContext, | 234 | + if (this.refreshingAnimation == null || this.refreshingAnimationDestroy) { |
| 235 | + this.refreshingAnimation?.destroy(this.refreshingAnimName) | ||
| 236 | + this.refreshingAnimation = lottie.loadAnimation({ | ||
| 237 | + container: this.refreshingContext, | ||
| 223 | renderer: 'canvas', // canvas 渲染模式 | 238 | renderer: 'canvas', // canvas 渲染模式 |
| 224 | loop: 10, | 239 | loop: 10, |
| 225 | autoplay: true, | 240 | autoplay: true, |
| 226 | name: this.refreshingAnimName, | 241 | name: this.refreshingAnimName, |
| 227 | path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 | 242 | path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 |
| 228 | }) | 243 | }) |
| 229 | - this.addRefreshAnimListener() | 244 | + this.refreshingAnimationDestroy = false |
| 245 | + this.addRefreshingAnimListener() | ||
| 230 | } | 246 | } |
| 231 | // Logger.error('zzzz', 'animate2, 2') | 247 | // Logger.error('zzzz', 'animate2, 2') |
| 232 | } | 248 | } |
| @@ -242,6 +258,13 @@ export struct CustomPullToRefresh { | @@ -242,6 +258,13 @@ export struct CustomPullToRefresh { | ||
| 242 | }); | 258 | }); |
| 243 | } | 259 | } |
| 244 | 260 | ||
| 261 | + private addRefreshingAnimListener() { | ||
| 262 | + this.refreshingAnimation?.addEventListener('destroy', (args: Object): void => { | ||
| 263 | + // Logger.error('zzzz', "lottie destroy"); | ||
| 264 | + this.refreshingAnimationDestroy = true | ||
| 265 | + }); | ||
| 266 | + } | ||
| 267 | + | ||
| 245 | loadMoreAnimate() { | 268 | loadMoreAnimate() { |
| 246 | if (this.loadMoreAnimation == null) { | 269 | if (this.loadMoreAnimation == null) { |
| 247 | this.loadMoreAnimation = lottie.loadAnimation({ | 270 | this.loadMoreAnimation = lottie.loadAnimation({ |
| @@ -66,31 +66,31 @@ export struct SearchComponent { | @@ -66,31 +66,31 @@ export struct SearchComponent { | ||
| 66 | this.breakpointSystem.unregister(); | 66 | this.breakpointSystem.unregister(); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | - getRelatedSearchContent() { | ||
| 70 | - if (StringUtils.isNotEmpty(this.searchText)) { | ||
| 71 | - SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText), getContext(this)).then((value) => { | 69 | + getRelatedSearchContent(searchText: string) { |
| 70 | + if (StringUtils.isNotEmpty(searchText)) { | ||
| 71 | + SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(searchText), getContext(this)).then((value) => { | ||
| 72 | if (value != null && value.length > 0) { | 72 | if (value != null && value.length > 0) { |
| 73 | this.relatedSearchContentsData = [] | 73 | this.relatedSearchContentsData = [] |
| 74 | value.forEach(item => { | 74 | value.forEach(item => { |
| 75 | let tempValue: string = item | 75 | let tempValue: string = item |
| 76 | let tempArr: string[] = [] | 76 | let tempArr: string[] = [] |
| 77 | - if (tempValue.indexOf(this.searchText) === -1) { | 77 | + if (tempValue.indexOf(searchText) === -1) { |
| 78 | tempArr.push(item) | 78 | tempArr.push(item) |
| 79 | this.relatedSearchContentsData.push(new SearchRelatedItem(item, tempArr)) | 79 | this.relatedSearchContentsData.push(new SearchRelatedItem(item, tempArr)) |
| 80 | } else { | 80 | } else { |
| 81 | - while (tempValue.indexOf(this.searchText) != -1) { | ||
| 82 | - let index = tempValue.indexOf(this.searchText) | 81 | + while (tempValue.indexOf(searchText) != -1) { |
| 82 | + let index = tempValue.indexOf(searchText) | ||
| 83 | if (index === 0) { | 83 | if (index === 0) { |
| 84 | try { | 84 | try { |
| 85 | - tempArr.push(this.searchText) | ||
| 86 | - tempValue = tempValue.substring(this.searchText.length, tempValue.length) | 85 | + tempArr.push(searchText) |
| 86 | + tempValue = tempValue.substring(searchText.length, tempValue.length) | ||
| 87 | } catch (e) { | 87 | } catch (e) { |
| 88 | } | 88 | } |
| 89 | } else { | 89 | } else { |
| 90 | try { | 90 | try { |
| 91 | tempArr.push(tempValue.substring(0, index)) | 91 | tempArr.push(tempValue.substring(0, index)) |
| 92 | - tempArr.push(this.searchText) | ||
| 93 | - tempValue = tempValue.substring(index + this.searchText.length, tempValue.length) | 92 | + tempArr.push(searchText) |
| 93 | + tempValue = tempValue.substring(index + searchText.length, tempValue.length) | ||
| 94 | } catch (e) { | 94 | } catch (e) { |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| @@ -356,7 +356,7 @@ export struct SearchComponent { | @@ -356,7 +356,7 @@ export struct SearchComponent { | ||
| 356 | this.resetSearch() | 356 | this.resetSearch() |
| 357 | } else { | 357 | } else { |
| 358 | if (this.hasInputContent) { | 358 | if (this.hasInputContent) { |
| 359 | - this.getRelatedSearchContent() | 359 | + this.getRelatedSearchContent(value) |
| 360 | } | 360 | } |
| 361 | } | 361 | } |
| 362 | }) | 362 | }) |
| @@ -142,7 +142,7 @@ export struct SearchResultComponent { | @@ -142,7 +142,7 @@ export struct SearchResultComponent { | ||
| 142 | SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index}) | 142 | SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index}) |
| 143 | }.tabBar(this.TabBuilder(index, item)) | 143 | }.tabBar(this.TabBuilder(index, item)) |
| 144 | .layoutWeight(1) | 144 | .layoutWeight(1) |
| 145 | - }, (item: string, index: number) => index.toString()) | 145 | + }, (item: string) => item) |
| 146 | } | 146 | } |
| 147 | .vertical(false) | 147 | .vertical(false) |
| 148 | .barMode(BarMode.Fixed) | 148 | .barMode(BarMode.Fixed) |
| @@ -19,8 +19,7 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' | @@ -19,8 +19,7 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' | ||
| 19 | import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' | 19 | import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' |
| 20 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' | 20 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' |
| 21 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' | 21 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' |
| 22 | -import { | ||
| 23 | - SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | 22 | +import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' |
| 24 | import { CardParser } from '../CardParser' | 23 | import { CardParser } from '../CardParser' |
| 25 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' | 24 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' |
| 26 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' | 25 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' |
| @@ -30,6 +29,7 @@ import { JSON } from '@kit.ArkTS' | @@ -30,6 +29,7 @@ import { JSON } from '@kit.ArkTS' | ||
| 30 | import { MoreComponent } from '../cardview/MoreComponent' | 29 | import { MoreComponent } from '../cardview/MoreComponent' |
| 31 | import { Card9Component } from '../cardview/Card9Component' | 30 | import { Card9Component } from '../cardview/Card9Component' |
| 32 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | 31 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' |
| 32 | +import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent' | ||
| 33 | 33 | ||
| 34 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 35 | 35 | ||
| @@ -38,7 +38,7 @@ export struct SearchResultContentComponent { | @@ -38,7 +38,7 @@ export struct SearchResultContentComponent { | ||
| 38 | @State keywords: string = "" | 38 | @State keywords: string = "" |
| 39 | @State searchType: string = "" | 39 | @State searchType: string = "" |
| 40 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | 40 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); |
| 41 | - tempList : ContentDTO[] = [] | 41 | + tempList: ContentDTO[] = [] |
| 42 | @State data_rmh: SearchRmhDescription[] = [] | 42 | @State data_rmh: SearchRmhDescription[] = [] |
| 43 | @State count: number = -1; | 43 | @State count: number = -1; |
| 44 | @State isLoading: boolean = false | 44 | @State isLoading: boolean = false |
| @@ -48,14 +48,14 @@ export struct SearchResultContentComponent { | @@ -48,14 +48,14 @@ export struct SearchResultContentComponent { | ||
| 48 | scroller: Scroller = new Scroller() | 48 | scroller: Scroller = new Scroller() |
| 49 | private scroller2: Scroller = new Scroller() | 49 | private scroller2: Scroller = new Scroller() |
| 50 | @State ellipseW: number = 0 | 50 | @State ellipseW: number = 0 |
| 51 | - @State moreWidth:number = 20 | 51 | + @State moreWidth: number = 20 |
| 52 | @State listLeft: number = 0 | 52 | @State listLeft: number = 0 |
| 53 | @State isEnd: boolean = false | 53 | @State isEnd: boolean = false |
| 54 | - @Watch('updateData') @Prop sameSearch:number = 0 | ||
| 55 | - @Prop isCurrentShow:boolean = false; | 54 | + @Watch('updateData') @Prop sameSearch: number = 0 |
| 55 | + @Prop isCurrentShow: boolean = false; | ||
| 56 | 56 | ||
| 57 | - updateData(){ | ||
| 58 | - if(this.isCurrentShow){ | 57 | + updateData() { |
| 58 | + if (this.isCurrentShow) { | ||
| 59 | this.data_rmh = [] | 59 | this.data_rmh = [] |
| 60 | 60 | ||
| 61 | this.data.clearAllData() | 61 | this.data.clearAllData() |
| @@ -115,7 +115,7 @@ export struct SearchResultContentComponent { | @@ -115,7 +115,7 @@ export struct SearchResultContentComponent { | ||
| 115 | data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] | 115 | data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] |
| 116 | data.mainControl = item.mainControl + "" | 116 | data.mainControl = item.mainControl + "" |
| 117 | 117 | ||
| 118 | - if(data_temp.length === 1){ | 118 | + if (data_temp.length === 1) { |
| 119 | this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0] | 119 | this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0] |
| 120 | this.bean.cnUserName = item.userName | 120 | this.bean.cnUserName = item.userName |
| 121 | this.bean.creatorId = item.creatorId | 121 | this.bean.creatorId = item.creatorId |
| @@ -133,8 +133,8 @@ export struct SearchResultContentComponent { | @@ -133,8 +133,8 @@ export struct SearchResultContentComponent { | ||
| 133 | } else { | 133 | } else { |
| 134 | this.bean.cnFansNum = item.fansNum + "" | 134 | this.bean.cnFansNum = item.fansNum + "" |
| 135 | } | 135 | } |
| 136 | - let regex:RegExp = new RegExp('\n','g') | ||
| 137 | - this.bean.introduction = item.introduction.replace(regex,'') | 136 | + let regex: RegExp = new RegExp('\n', 'g') |
| 137 | + this.bean.introduction = item.introduction.replace(regex, '') | ||
| 138 | 138 | ||
| 139 | this.bean.mainControl = item.mainControl | 139 | this.bean.mainControl = item.mainControl |
| 140 | this.bean.banControl = item.banControl | 140 | this.bean.banControl = item.banControl |
| @@ -148,9 +148,13 @@ export struct SearchResultContentComponent { | @@ -148,9 +148,13 @@ export struct SearchResultContentComponent { | ||
| 148 | data_temp.forEach((data) => { | 148 | data_temp.forEach((data) => { |
| 149 | this.data_rmh.push(data) | 149 | this.data_rmh.push(data) |
| 150 | }) | 150 | }) |
| 151 | + | ||
| 152 | + if (this.data_rmh.length > 0) { | ||
| 153 | + this.count = 1 | ||
| 154 | + } | ||
| 151 | //只有一条创作者,获取 创作者信息 | 155 | //只有一条创作者,获取 创作者信息 |
| 152 | if (this.data_rmh.length === 1) { | 156 | if (this.data_rmh.length === 1) { |
| 153 | - if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){ | 157 | + if (StringUtils.isNotEmpty(UserDataLocal.getUserId())) { |
| 154 | //查询是否被关注 | 158 | //查询是否被关注 |
| 155 | let status = new FollowListStatusRequestItem() | 159 | let status = new FollowListStatusRequestItem() |
| 156 | status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId)) | 160 | status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId)) |
| @@ -159,7 +163,7 @@ export struct SearchResultContentComponent { | @@ -159,7 +163,7 @@ export struct SearchResultContentComponent { | ||
| 159 | }).catch((err: Error) => { | 163 | }).catch((err: Error) => { |
| 160 | console.log(TAG, "请求失败") | 164 | console.log(TAG, "请求失败") |
| 161 | }) | 165 | }) |
| 162 | - }else{ | 166 | + } else { |
| 163 | this.bean.status = "" | 167 | this.bean.status = "" |
| 164 | } | 168 | } |
| 165 | } | 169 | } |
| @@ -192,6 +196,8 @@ export struct SearchResultContentComponent { | @@ -192,6 +196,8 @@ export struct SearchResultContentComponent { | ||
| 192 | }) | 196 | }) |
| 193 | }) | 197 | }) |
| 194 | 198 | ||
| 199 | + if (data.contentList.length > 0) { | ||
| 200 | + | ||
| 195 | SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => { | 201 | SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => { |
| 196 | newValue.forEach((item) => { | 202 | newValue.forEach((item) => { |
| 197 | resultData.list.forEach((data) => { | 203 | resultData.list.forEach((data) => { |
| @@ -206,32 +212,32 @@ export struct SearchResultContentComponent { | @@ -206,32 +212,32 @@ export struct SearchResultContentComponent { | ||
| 206 | }) | 212 | }) |
| 207 | // 批量号主信息 | 213 | // 批量号主信息 |
| 208 | let creatorIdList: string[] = [] | 214 | let creatorIdList: string[] = [] |
| 209 | - resultData.list.forEach((value:SearchResultContentItem) => { | 215 | + resultData.list.forEach((value: SearchResultContentItem) => { |
| 210 | creatorIdList.push(value.data.creatorId) | 216 | creatorIdList.push(value.data.creatorId) |
| 211 | }) | 217 | }) |
| 212 | - SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { | 218 | + SearcherAboutDataModel.getCreatorDetailListData({ creatorIdList: creatorIdList }).then((rem) => { |
| 213 | resultData.list.forEach((value: SearchResultContentItem) => { | 219 | resultData.list.forEach((value: SearchResultContentItem) => { |
| 214 | const landscape = value.data.landscape | 220 | const landscape = value.data.landscape |
| 215 | let photos: FullColumnImgUrlDTO[] = [] | 221 | let photos: FullColumnImgUrlDTO[] = [] |
| 216 | // if (value.data.appStyle === 4) { | 222 | // if (value.data.appStyle === 4) { |
| 217 | value.data.appStyleImages.split("&&").forEach((value) => { | 223 | value.data.appStyleImages.split("&&").forEach((value) => { |
| 218 | let resizeParams = MinePageDatasModel.extractResizeParams(value) | 224 | let resizeParams = MinePageDatasModel.extractResizeParams(value) |
| 219 | - if(resizeParams && resizeParams.length === 2){ | 225 | + if (resizeParams && resizeParams.length === 2) { |
| 220 | photos.push( | 226 | photos.push( |
| 221 | { | 227 | { |
| 222 | fullUrl: value, | 228 | fullUrl: value, |
| 223 | - weight:resizeParams[0], | ||
| 224 | - height:resizeParams[1], | 229 | + weight: resizeParams[0], |
| 230 | + height: resizeParams[1], | ||
| 225 | landscape: Number(landscape), | 231 | landscape: Number(landscape), |
| 226 | } as FullColumnImgUrlDTO | 232 | } as FullColumnImgUrlDTO |
| 227 | ) | 233 | ) |
| 228 | } | 234 | } |
| 229 | }) | 235 | }) |
| 230 | // } | 236 | // } |
| 231 | - let contentDTO = this.dataTransform(rem,value, photos); | ||
| 232 | - if(value.data.type != "13"){ | 237 | + let contentDTO = this.dataTransform(rem, value, photos); |
| 238 | + if (value.data.type != "13") { | ||
| 233 | this.data.push(contentDTO) | 239 | this.data.push(contentDTO) |
| 234 | - if(value.data.sameContentList != null && value.data.sameContentList.length > 0) { | 240 | + if (value.data.sameContentList != null && value.data.sameContentList.length > 0) { |
| 235 | let contentDTO2 = new ContentDTO(); | 241 | let contentDTO2 = new ContentDTO(); |
| 236 | contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList) | 242 | contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList) |
| 237 | contentDTO2.sameContentListSize = value.data.sameContentList.length | 243 | contentDTO2.sameContentListSize = value.data.sameContentList.length |
| @@ -257,22 +263,30 @@ export struct SearchResultContentComponent { | @@ -257,22 +263,30 @@ export struct SearchResultContentComponent { | ||
| 257 | this.isLoading = false | 263 | this.isLoading = false |
| 258 | this.count = this.count === -1 ? 0 : this.count | 264 | this.count = this.count === -1 ? 0 : this.count |
| 259 | }) | 265 | }) |
| 266 | + } else { | ||
| 267 | + this.hasMore = false | ||
| 268 | + } | ||
| 260 | } | 269 | } |
| 261 | 270 | ||
| 262 | build() { | 271 | build() { |
| 263 | Column() { | 272 | Column() { |
| 264 | if (this.count == 0) { | 273 | if (this.count == 0) { |
| 265 | - ListHasNoMoreDataUI({ style: 2 }) | 274 | + |
| 275 | + EmptyComponent({ | ||
| 276 | + emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, | ||
| 277 | + emptyButton: false, | ||
| 278 | + }).height('70%') | ||
| 279 | + | ||
| 266 | } else { | 280 | } else { |
| 267 | - List({scroller:this.scroller2}) { | ||
| 268 | - if (this.data_rmh != null && this.data_rmh.length > 0){ | ||
| 269 | - if (this.data_rmh.length === 1){ | ||
| 270 | - ListItem(){ | 281 | + List({ scroller: this.scroller2 }) { |
| 282 | + if (this.data_rmh != null && this.data_rmh.length > 0) { | ||
| 283 | + if (this.data_rmh.length === 1) { | ||
| 284 | + ListItem() { | ||
| 271 | FollowChildComponent({ data: this.bean, type: 1 }) | 285 | FollowChildComponent({ data: this.bean, type: 1 }) |
| 272 | - }.padding({left:"31lpx",right:"31lpx"}) | ||
| 273 | - }else{ | ||
| 274 | - ListItem(){ | ||
| 275 | - Column(){ | 286 | + }.padding({ left: "31lpx", right: "31lpx" }) |
| 287 | + } else { | ||
| 288 | + ListItem() { | ||
| 289 | + Column() { | ||
| 276 | this.SearchListUI() | 290 | this.SearchListUI() |
| 277 | } | 291 | } |
| 278 | } | 292 | } |
| @@ -283,43 +297,46 @@ export struct SearchResultContentComponent { | @@ -283,43 +297,46 @@ export struct SearchResultContentComponent { | ||
| 283 | Column() { | 297 | Column() { |
| 284 | if (this.searchType == "activity") { | 298 | if (this.searchType == "activity") { |
| 285 | ActivityItemComponent({ contentDTO: item }) | 299 | ActivityItemComponent({ contentDTO: item }) |
| 286 | - }else if(item.sameContentListSize > 0){ | 300 | + } else if (item.sameContentListSize > 0) { |
| 287 | MoreComponent({ contentDTO: item }) | 301 | MoreComponent({ contentDTO: item }) |
| 288 | - }else if(item.appStyle == "9"){ | ||
| 289 | - Column(){ | ||
| 290 | - Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) | 302 | + } else if (item.appStyle == "9") { |
| 303 | + Column() { | ||
| 304 | + Card9Component({ | ||
| 305 | + compDTO: new CompDTO, | ||
| 306 | + contentDTO: item, | ||
| 307 | + pageId: "", | ||
| 308 | + pageName: "" | ||
| 309 | + }) | ||
| 291 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 292 | } | 311 | } |
| 293 | } else { | 312 | } else { |
| 294 | - if(this.data?.get(index + 1)?.sameContentListSize > 0) { | 313 | + if (this.data?.get(index + 1)?.sameContentListSize > 0) { |
| 295 | Divider() | 314 | Divider() |
| 296 | .width('100%') | 315 | .width('100%') |
| 297 | .color($r('app.color.color_F5F5F5')) | 316 | .color($r('app.color.color_F5F5F5')) |
| 298 | .strokeWidth(4) | 317 | .strokeWidth(4) |
| 299 | } | 318 | } |
| 300 | - CardParser({compDTO:new CompDTO, contentDTO: item }) | 319 | + CardParser({ compDTO: new CompDTO, contentDTO: item }) |
| 301 | } | 320 | } |
| 302 | if (index != this.data.totalCount() - 1) { | 321 | if (index != this.data.totalCount() - 1) { |
| 303 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 322 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 304 | - // Divider() | ||
| 305 | - // .width('100%') | ||
| 306 | - // .height('1lpx') | ||
| 307 | - // .color($r('app.color.color_F5F5F5')) | ||
| 308 | - // .strokeWidth('1lpx') | 323 | + |
| 309 | } | 324 | } |
| 310 | } | 325 | } |
| 311 | } | 326 | } |
| 312 | }, (item: ContentDTO, index: number) => index.toString()) | 327 | }, (item: ContentDTO, index: number) => index.toString()) |
| 313 | 328 | ||
| 314 | //没有更多数据 显示提示 | 329 | //没有更多数据 显示提示 |
| 315 | - if (!this.hasMore && this.data.totalCount() > 0) { | 330 | + if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) { |
| 316 | ListItem() { | 331 | ListItem() { |
| 317 | ListHasNoMoreDataUI() | 332 | ListHasNoMoreDataUI() |
| 318 | } | 333 | } |
| 319 | } | 334 | } |
| 320 | - }.cachedCount(5) | 335 | + } |
| 336 | + .cachedCount(5) | ||
| 321 | .edgeEffect(EdgeEffect.None) | 337 | .edgeEffect(EdgeEffect.None) |
| 322 | .scrollBar(BarState.Off) | 338 | .scrollBar(BarState.Off) |
| 339 | + .height('100%') | ||
| 323 | .onReachEnd(() => { | 340 | .onReachEnd(() => { |
| 324 | console.log(TAG, "触底了"); | 341 | console.log(TAG, "触底了"); |
| 325 | if (!this.isLoading) { | 342 | if (!this.isLoading) { |
| @@ -329,28 +346,29 @@ export struct SearchResultContentComponent { | @@ -329,28 +346,29 @@ export struct SearchResultContentComponent { | ||
| 329 | } | 346 | } |
| 330 | } | 347 | } |
| 331 | .backgroundColor($r('app.color.white')) | 348 | .backgroundColor($r('app.color.white')) |
| 349 | + .height('100%') | ||
| 332 | .width('100%') | 350 | .width('100%') |
| 333 | } | 351 | } |
| 334 | 352 | ||
| 335 | @Builder | 353 | @Builder |
| 336 | SearchListUI() { | 354 | SearchListUI() { |
| 337 | - List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) { | ||
| 338 | - ListItemGroup(){ | 355 | + List({ initialIndex: 0, space: '8lpx', scroller: this.scroller }) { |
| 356 | + ListItemGroup() { | ||
| 339 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | 357 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { |
| 340 | ListItem() { | 358 | ListItem() { |
| 341 | - SearchCreatorComponent({item:item}) | 359 | + SearchCreatorComponent({ item: item }) |
| 342 | } | 360 | } |
| 343 | .width('150lpx') | 361 | .width('150lpx') |
| 344 | .height('100%') | 362 | .height('100%') |
| 345 | }) | 363 | }) |
| 346 | }.offset({ left: this.listLeft }) | 364 | }.offset({ left: this.listLeft }) |
| 347 | 365 | ||
| 348 | - ListItem(){ | ||
| 349 | - if (this.data_rmh.length === 10){ | 366 | + ListItem() { |
| 367 | + if (this.data_rmh.length === 10) { | ||
| 350 | this.itemEnd() | 368 | this.itemEnd() |
| 351 | } | 369 | } |
| 352 | }.height('100%') | 370 | }.height('100%') |
| 353 | - .margin({left:'23lpx'}) | 371 | + .margin({ left: '23lpx' }) |
| 354 | } | 372 | } |
| 355 | .edgeEffect(EdgeEffect.None) | 373 | .edgeEffect(EdgeEffect.None) |
| 356 | .scrollBar(BarState.Off) | 374 | .scrollBar(BarState.Off) |
| @@ -359,10 +377,10 @@ export struct SearchResultContentComponent { | @@ -359,10 +377,10 @@ export struct SearchResultContentComponent { | ||
| 359 | .height('219lpx') | 377 | .height('219lpx') |
| 360 | .onReachEnd(() => { | 378 | .onReachEnd(() => { |
| 361 | this.isEnd = true | 379 | this.isEnd = true |
| 362 | - console.log(TAG,'is end') | 380 | + console.log(TAG, 'is end') |
| 363 | }) | 381 | }) |
| 364 | .onScrollFrameBegin((offset: number, state: ScrollState) => { | 382 | .onScrollFrameBegin((offset: number, state: ScrollState) => { |
| 365 | - console.log(TAG,'offset', offset) | 383 | + console.log(TAG, 'offset', offset) |
| 366 | if (!this.scroller.isAtEnd()) { | 384 | if (!this.scroller.isAtEnd()) { |
| 367 | this.isEnd = false | 385 | this.isEnd = false |
| 368 | } | 386 | } |
| @@ -374,31 +392,35 @@ export struct SearchResultContentComponent { | @@ -374,31 +392,35 @@ export struct SearchResultContentComponent { | ||
| 374 | .parallelGesture( | 392 | .parallelGesture( |
| 375 | PanGesture({ direction: PanDirection.Horizontal, distance: 1 }) | 393 | PanGesture({ direction: PanDirection.Horizontal, distance: 1 }) |
| 376 | .onActionStart((event: GestureEvent) => { | 394 | .onActionStart((event: GestureEvent) => { |
| 377 | - console.info(TAG,'Pan start') | 395 | + console.info(TAG, 'Pan start') |
| 378 | }) | 396 | }) |
| 379 | .onActionUpdate((event: GestureEvent) => { | 397 | .onActionUpdate((event: GestureEvent) => { |
| 380 | ///小于10个不展示滑动 | 398 | ///小于10个不展示滑动 |
| 381 | - if (this.data_rmh.length < 10) return; | 399 | + if (this.data_rmh.length < 10) { |
| 400 | + return; | ||
| 401 | + } | ||
| 382 | if (event && this.isEnd) { | 402 | if (event && this.isEnd) { |
| 383 | // console.log('event.offsetX',event.offsetX) | 403 | // console.log('event.offsetX',event.offsetX) |
| 384 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX | 404 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX |
| 385 | this.ellipseW = (-this.listLeft) / 1.5 | 405 | this.ellipseW = (-this.listLeft) / 1.5 |
| 386 | 406 | ||
| 387 | - console.log(TAG,"this.ellipseW==>" + this.ellipseW) | 407 | + console.log(TAG, "this.ellipseW==>" + this.ellipseW) |
| 388 | } | 408 | } |
| 389 | }) | 409 | }) |
| 390 | .onActionEnd((event: GestureEvent) => { | 410 | .onActionEnd((event: GestureEvent) => { |
| 391 | - if (this.data_rmh.length < 10) return; | ||
| 392 | - console.info(TAG,'Pan end') | 411 | + if (this.data_rmh.length < 10) { |
| 412 | + return; | ||
| 413 | + } | ||
| 414 | + console.info(TAG, 'Pan end') | ||
| 393 | this.listLeft = 0 | 415 | this.listLeft = 0 |
| 394 | // this.moreWidth = 20 | 416 | // this.moreWidth = 20 |
| 395 | 417 | ||
| 396 | - if (event.offsetX < 0 && this.ellipseW >=20) { | ||
| 397 | - console.log(TAG,'跳转') | 418 | + if (event.offsetX < 0 && this.ellipseW >= 20) { |
| 419 | + console.log(TAG, '跳转') | ||
| 398 | let params: Params = { | 420 | let params: Params = { |
| 399 | pageID: this.keywords | 421 | pageID: this.keywords |
| 400 | } | 422 | } |
| 401 | - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params) | 423 | + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params) |
| 402 | } | 424 | } |
| 403 | this.ellipseW = 0 | 425 | this.ellipseW = 0 |
| 404 | }) | 426 | }) |
| @@ -411,18 +433,17 @@ export struct SearchResultContentComponent { | @@ -411,18 +433,17 @@ export struct SearchResultContentComponent { | ||
| 411 | .strokeWidth('12lpx') | 433 | .strokeWidth('12lpx') |
| 412 | } | 434 | } |
| 413 | 435 | ||
| 414 | - | ||
| 415 | @Builder | 436 | @Builder |
| 416 | itemEnd() { | 437 | itemEnd() { |
| 417 | Row() { | 438 | Row() { |
| 418 | Ellipse() | 439 | Ellipse() |
| 419 | - .width(2* this.ellipseW) | 440 | + .width(2 * this.ellipseW) |
| 420 | .height('100%') | 441 | .height('100%') |
| 421 | .fill('rgb(240,235,238)') | 442 | .fill('rgb(240,235,238)') |
| 422 | .position({ left: -this.ellipseW, top: 0 }) | 443 | .position({ left: -this.ellipseW, top: 0 }) |
| 423 | 444 | ||
| 424 | - Column(){ | ||
| 425 | - Text(this.ellipseW === 0 ? '' : this.ellipseW < 20? '查看更多' : '松手查看') | 445 | + Column() { |
| 446 | + Text(this.ellipseW === 0 ? '' : this.ellipseW < 20 ? '查看更多' : '松手查看') | ||
| 426 | .width('19lpx') | 447 | .width('19lpx') |
| 427 | .fontSize('19lpx') | 448 | .fontSize('19lpx') |
| 428 | .fontWeight('400lpx') | 449 | .fontWeight('400lpx') |
| @@ -437,17 +458,18 @@ export struct SearchResultContentComponent { | @@ -437,17 +458,18 @@ export struct SearchResultContentComponent { | ||
| 437 | .height('100%') | 458 | .height('100%') |
| 438 | } | 459 | } |
| 439 | 460 | ||
| 440 | - private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { | ||
| 441 | - let rmhInfo = this.getRmhInfo(rem,value) | ||
| 442 | - console.log('获取photos',JSON.stringify(photos)) | ||
| 443 | - console.log('获取value2',JSON.stringify(value)) | 461 | + private dataTransform(rem: CreatorDetailResponseItem[], value: SearchResultContentItem, |
| 462 | + photos: FullColumnImgUrlDTO[]): ContentDTO { | ||
| 463 | + let rmhInfo = this.getRmhInfo(rem, value) | ||
| 464 | + console.log('获取photos', JSON.stringify(photos)) | ||
| 465 | + console.log('获取value2', JSON.stringify(value)) | ||
| 444 | let liveType = value.data?.liveType; | 466 | let liveType = value.data?.liveType; |
| 445 | let seoTags = value.data?.seoTags | 467 | let seoTags = value.data?.seoTags |
| 446 | let cornerMark = value.data?.cornerMark | 468 | let cornerMark = value.data?.cornerMark |
| 447 | let contentDTO = new ContentDTO(); | 469 | let contentDTO = new ContentDTO(); |
| 448 | - contentDTO.liveType = liveType?liveType: "" | ||
| 449 | - contentDTO.seoTags = seoTags?seoTags: "" | ||
| 450 | - contentDTO.cornerMark = cornerMark?cornerMark: "" | 470 | + contentDTO.liveType = liveType ? liveType : "" |
| 471 | + contentDTO.seoTags = seoTags ? seoTags : "" | ||
| 472 | + contentDTO.cornerMark = cornerMark ? cornerMark : "" | ||
| 451 | contentDTO.appStyle = value.data.appStyle + "" | 473 | contentDTO.appStyle = value.data.appStyle + "" |
| 452 | contentDTO.cityCode = value.data.cityCode | 474 | contentDTO.cityCode = value.data.cityCode |
| 453 | contentDTO.coverSize = "" | 475 | contentDTO.coverSize = "" |
| @@ -529,13 +551,13 @@ export struct SearchResultContentComponent { | @@ -529,13 +551,13 @@ export struct SearchResultContentComponent { | ||
| 529 | } | 551 | } |
| 530 | 552 | ||
| 531 | // 搜索数据转化rmhInfo | 553 | // 搜索数据转化rmhInfo |
| 532 | - private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){ | 554 | + private getRmhInfo(rem: CreatorDetailResponseItem[], value: SearchResultContentItem) { |
| 533 | let obj = value.data | 555 | let obj = value.data |
| 534 | - let rmhInfo:RmhInfoDTO = { | ||
| 535 | - rmhHeadUrl:obj.headerPhotoUrl, | ||
| 536 | - rmhName:obj.creatorName, | ||
| 537 | - rmhId:obj.creatorId, | ||
| 538 | - authIcon:obj.authIcon, | 556 | + let rmhInfo: RmhInfoDTO = { |
| 557 | + rmhHeadUrl: obj.headerPhotoUrl, | ||
| 558 | + rmhName: obj.creatorName, | ||
| 559 | + rmhId: obj.creatorId, | ||
| 560 | + authIcon: obj.authIcon, | ||
| 539 | authTitle: obj.authTitle, | 561 | authTitle: obj.authTitle, |
| 540 | authTitle2: '', | 562 | authTitle2: '', |
| 541 | banControl: 0, | 563 | banControl: 0, |
| @@ -546,44 +568,43 @@ export struct SearchResultContentComponent { | @@ -546,44 +568,43 @@ export struct SearchResultContentComponent { | ||
| 546 | cnMainControl: 0, | 568 | cnMainControl: 0, |
| 547 | cnShareControl: 0, | 569 | cnShareControl: 0, |
| 548 | cnIsComment: 0, | 570 | cnIsComment: 0, |
| 549 | - cnIsLike:0, | 571 | + cnIsLike: 0, |
| 550 | posterShareControl: 0, | 572 | posterShareControl: 0, |
| 551 | rmhDesc: obj.introduction, | 573 | rmhDesc: obj.introduction, |
| 552 | userId: obj.userId, | 574 | userId: obj.userId, |
| 553 | userType: obj.userType, | 575 | userType: obj.userType, |
| 554 | - honoraryIcon:'', | ||
| 555 | - rmhPlatform:0 | 576 | + honoraryIcon: '', |
| 577 | + rmhPlatform: 0 | ||
| 556 | } | 578 | } |
| 557 | - if(rem.length>0){ | ||
| 558 | - rem.forEach(item=>{ | ||
| 559 | - if(item.creatorId === obj.creatorId){ | 579 | + if (rem.length > 0) { |
| 580 | + rem.forEach(item => { | ||
| 581 | + if (item.creatorId === obj.creatorId) { | ||
| 560 | rmhInfo = { | 582 | rmhInfo = { |
| 561 | - rmhHeadUrl:item.headPhotoUrl, | ||
| 562 | - rmhName:item.userName, | ||
| 563 | - rmhId:item.creatorId, | ||
| 564 | - authIcon:item.authIcon, | 583 | + rmhHeadUrl: item.headPhotoUrl, |
| 584 | + rmhName: item.userName, | ||
| 585 | + rmhId: item.creatorId, | ||
| 586 | + authIcon: item.authIcon, | ||
| 565 | authTitle: item.authTitle, | 587 | authTitle: item.authTitle, |
| 566 | authTitle2: '', | 588 | authTitle2: '', |
| 567 | banControl: 0, | 589 | banControl: 0, |
| 568 | - cnIsAttention:item.isAttention, | 590 | + cnIsAttention: item.isAttention, |
| 569 | cnAttention: 0, | 591 | cnAttention: 0, |
| 570 | cnlsComment: 0, | 592 | cnlsComment: 0, |
| 571 | cnlsLike: 0, | 593 | cnlsLike: 0, |
| 572 | cnMainControl: 0, | 594 | cnMainControl: 0, |
| 573 | cnShareControl: 0, | 595 | cnShareControl: 0, |
| 574 | cnIsComment: 0, | 596 | cnIsComment: 0, |
| 575 | - cnIsLike:0, | 597 | + cnIsLike: 0, |
| 576 | posterShareControl: 0, | 598 | posterShareControl: 0, |
| 577 | rmhDesc: item.introduction, | 599 | rmhDesc: item.introduction, |
| 578 | userId: item.userId, | 600 | userId: item.userId, |
| 579 | userType: item.userType, | 601 | userType: item.userType, |
| 580 | - honoraryIcon:'', | ||
| 581 | - rmhPlatform:0 | 602 | + honoraryIcon: '', |
| 603 | + rmhPlatform: 0 | ||
| 582 | } | 604 | } |
| 583 | } | 605 | } |
| 584 | }) | 606 | }) |
| 585 | } | 607 | } |
| 586 | return rmhInfo | 608 | return rmhInfo |
| 587 | } | 609 | } |
| 588 | - | ||
| 589 | } | 610 | } |
| @@ -58,7 +58,9 @@ export struct EmptyComponent { | @@ -58,7 +58,9 @@ export struct EmptyComponent { | ||
| 58 | @State emptyHeight: string | number = CommonConstants.FULL_PARENT; | 58 | @State emptyHeight: string | number = CommonConstants.FULL_PARENT; |
| 59 | @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举 | 59 | @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举 |
| 60 | @State emptyButton: boolean = false | 60 | @State emptyButton: boolean = false |
| 61 | + @State isBlack: boolean = false // 背景是否为黑色 默认白色 | ||
| 61 | @State timeNum: number = 10 | 62 | @State timeNum: number = 10 |
| 63 | + | ||
| 62 | /** | 64 | /** |
| 63 | * The empty image width percentage setting. | 65 | * The empty image width percentage setting. |
| 64 | */ | 66 | */ |
| @@ -135,7 +137,7 @@ export struct EmptyComponent { | @@ -135,7 +137,7 @@ export struct EmptyComponent { | ||
| 135 | }) | 137 | }) |
| 136 | 138 | ||
| 137 | if (this.isShowButton()) { | 139 | if (this.isShowButton()) { |
| 138 | - if (this.emptyType !== 15) { | 140 | + if (this.emptyType !== 15 && !this.isBlack) { |
| 139 | Button('点击重试') | 141 | Button('点击重试') |
| 140 | .type(ButtonType.Normal) | 142 | .type(ButtonType.Normal) |
| 141 | .width(80) | 143 | .width(80) |
| @@ -253,7 +255,7 @@ export struct EmptyComponent { | @@ -253,7 +255,7 @@ export struct EmptyComponent { | ||
| 253 | } | 255 | } |
| 254 | 256 | ||
| 255 | isShowButton() { | 257 | isShowButton() { |
| 256 | - if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) { | 258 | + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15 && this.emptyButton) { |
| 257 | return true | 259 | return true |
| 258 | } else { | 260 | } else { |
| 259 | return false | 261 | return false |
sight_harmony/features/wdComponent/src/main/ets/components/view/ImageItemView.ets
deleted
100644 → 0
| 1 | -import { image } from '@kit.ImageKit'; | ||
| 2 | -import { matrix4, promptAction, window } from '@kit.ArkUI'; | ||
| 3 | -import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 4 | -import { ScaleModel } from '../../model/ScaleModel'; | ||
| 5 | -import { OffsetModel } from '../../model/OffsetModel'; | ||
| 6 | -import { windowSizeManager } from '../../utils/Managers'; | ||
| 7 | -import { runWithAnimation } from '../../utils/FuncUtils'; | ||
| 8 | -import { PhotoListBean } from 'wdBean/Index'; | ||
| 9 | -import { http } from '@kit.NetworkKit'; | ||
| 10 | - | ||
| 11 | -// TODO:知识点:组件复用 | ||
| 12 | -@Reusable | ||
| 13 | -@Component | ||
| 14 | -export struct ImageItemView { | ||
| 15 | - // @Consume private bgc: Color; | ||
| 16 | - @Link isEnableSwipe: boolean; // TODO:需求:多图切换 | ||
| 17 | - @State isEnableOffset: boolean = false; | ||
| 18 | - @State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3); | ||
| 19 | - @State imageOffsetInfo: OffsetModel = new OffsetModel(0, 0); | ||
| 20 | - @State matrix: matrix4.Matrix4Transit = matrix4.identity().copy(); | ||
| 21 | - @State imagePixelMap: image.PixelMap | null = null; // 当前图片pixelMap,用于Image组件显示 | ||
| 22 | - @State fitWH: "width" | "height" | undefined = undefined; // 表示当前图片是根据宽度适配还是高度适配 | ||
| 23 | - @State imageDefaultSize: image.Size = { width: 0, height: 0 }; // 图片默认大小,即,与屏幕大小最适配的显示大小 | ||
| 24 | - imageUri: string = ""; // 当前图片uri | ||
| 25 | - imageWHRatio: number = 0; // 图片原始宽高比 | ||
| 26 | - private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | ||
| 27 | - @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer | ||
| 28 | - //alt app.media.picture_loading 设计稿尺寸 | ||
| 29 | - @State imageWidth:string | number = 167 | ||
| 30 | - private scroller: Scroller = new Scroller() | ||
| 31 | - | ||
| 32 | - aboutToAppear(): void { | ||
| 33 | - this.imageUri = this.MultiPictureDetailItem.picPath | ||
| 34 | - this.getPicture() | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 通过http的request方法从网络下载图片资源 | ||
| 39 | - */ | ||
| 40 | - async getPicture() { | ||
| 41 | - // 每一个httpRequest对应一个HTTP请求任务,不可复用 | ||
| 42 | - let httpRequest = http.createHttp(); | ||
| 43 | - // 用于订阅HTTP响应头事件 | ||
| 44 | - httpRequest.on('headersReceive', (header: Object) => { | ||
| 45 | - console.info('header: ' + JSON.stringify(header)); | ||
| 46 | - }); | ||
| 47 | - // 用于订阅HTTP流式响应数据接收事件 | ||
| 48 | - let res = new ArrayBuffer(0); | ||
| 49 | - httpRequest.on('dataReceive', (data: ArrayBuffer) => { | ||
| 50 | - const newRes = new ArrayBuffer(res.byteLength + data.byteLength); | ||
| 51 | - const resView = new Uint8Array(newRes); | ||
| 52 | - resView.set(new Uint8Array(res)); | ||
| 53 | - resView.set(new Uint8Array(data), res.byteLength); | ||
| 54 | - res = newRes; | ||
| 55 | - // console.info('dataReceive res length: ' + res.byteLength); | ||
| 56 | - }); | ||
| 57 | - // 用于订阅HTTP流式响应数据接收完毕事件 | ||
| 58 | - httpRequest.on('dataEnd', () => { | ||
| 59 | - this.transcodePixelMap(res); | ||
| 60 | - // 判断网络获取到的资源是否为ArrayBuffer类型 | ||
| 61 | - console.info(`dataEnd getPicture ${res}`) | ||
| 62 | - if (res instanceof ArrayBuffer) { | ||
| 63 | - console.info(`dataEnd getPicture`) | ||
| 64 | - this.imageBuffer = res as ArrayBuffer; | ||
| 65 | - } | ||
| 66 | - console.info('No more data in response, data receive end'); | ||
| 67 | - }); | ||
| 68 | - httpRequest.requestInStream(this.imageUri, | ||
| 69 | - (error: BusinessError, data: number) => { | ||
| 70 | - if (error) { | ||
| 71 | - // 下载失败时弹窗提示检查网络,不执行后续逻辑 | ||
| 72 | - promptAction.showToast({ | ||
| 73 | - message: $r('app.string.image_request_fail'), | ||
| 74 | - duration: 2000 | ||
| 75 | - }) | ||
| 76 | - this.getPicture() | ||
| 77 | - console.error(`http reqeust failed with. Code: ${error.code}, message: ${error.message}`); | ||
| 78 | - return; | ||
| 79 | - } | ||
| 80 | - // 取消订阅HTTP响应头事件 | ||
| 81 | - httpRequest.off('headersReceive'); | ||
| 82 | - // 取消订阅HTTP流式响应数据接收事件 | ||
| 83 | - httpRequest.off('dataReceive'); | ||
| 84 | - // 取消订阅HTTP流式响应数据接收完毕事件 | ||
| 85 | - httpRequest.off('dataEnd'); | ||
| 86 | - // 当该请求使用完毕时,调用destroy方法主动销毁 | ||
| 87 | - httpRequest.destroy(); | ||
| 88 | - } | ||
| 89 | - ) | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - /** | ||
| 93 | - * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型 | ||
| 94 | - * @param data:网络获取到的资源 | ||
| 95 | - */ | ||
| 96 | - transcodePixelMap(data: ArrayBuffer) { | ||
| 97 | - const imageData: ArrayBuffer = data; | ||
| 98 | - // 通过ArrayBuffer创建图片源实例。 | ||
| 99 | - const imageSource: image.ImageSource = image.createImageSource(imageData); | ||
| 100 | - this.initCurrentImageInfo(imageSource); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - /** | ||
| 104 | - * 根据图片宽高比及窗口大小计算图片的默认宽高,即,图片最适配屏幕的大小 | ||
| 105 | - * @param imageWHRatio:图片原始宽高比 | ||
| 106 | - * @param size:窗口大小{with:number,height:number} | ||
| 107 | - * @returns image.Size | ||
| 108 | - */ | ||
| 109 | - calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size { | ||
| 110 | - let width = 0 | ||
| 111 | - let height = 0; | ||
| 112 | - width = size.width; | ||
| 113 | - height = size.width / imageWHRatio; | ||
| 114 | - return { width: width, height: height }; | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - /** | ||
| 118 | - * TODO:知识点:根据图片大小(宽高<=屏幕宽高)和屏幕大小计算图片放大适配屏幕进行显示的缩放倍率 | ||
| 119 | - * @param imageSize:图片当前大小 | ||
| 120 | - * @param windowSize:窗口大小 | ||
| 121 | - * @returns:缩放倍率 | ||
| 122 | - */ | ||
| 123 | - calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number { | ||
| 124 | - let ratio: number = 1.0; | ||
| 125 | - if (windowSize.width > imageSize.width) { | ||
| 126 | - ratio = windowSize.width / imageSize.width; | ||
| 127 | - } else { | ||
| 128 | - ratio = windowSize.height / imageSize.height; | ||
| 129 | - } | ||
| 130 | - return ratio; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - /** | ||
| 134 | - * 设置当前图片的相关信息:uri、whRatio、pixelMap、fitWH、defaultSize、maxScaleValue | ||
| 135 | - * TODO:知识点:提前获取图片的信息,以进行Image组件的尺寸设置及后续的相关计算 | ||
| 136 | - */ | ||
| 137 | - initCurrentImageInfo(imageSource: image.ImageSource): void { | ||
| 138 | - this.matrix = matrix4.identity().copy(); | ||
| 139 | - // const imageSource: image.ImageSource = image.createImageSource(this.imageUri); | ||
| 140 | - imageSource.getImageInfo(0).then((data: image.ImageInfo) => { | ||
| 141 | - this.imageWHRatio = data.size.width / data.size.height; | ||
| 142 | - console.error(`this.imageDefaultSize this.imageWHRatio = ${this.imageWHRatio}`); | ||
| 143 | - console.error(`this.imageDefaultSize width = ${data.size.width}`); | ||
| 144 | - console.error(`this.imageDefaultSize height = ${data.size.height}`); | ||
| 145 | - this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get()); | ||
| 146 | - console.error(`this.imageDefaultSize = ${JSON.stringify(windowSizeManager.get())}`); | ||
| 147 | - console.error(`this.imageDefaultSize = ${JSON.stringify(this.imageDefaultSize)}`); | ||
| 148 | - if (this.imageDefaultSize.width === windowSizeManager.get().width) { | ||
| 149 | - this.fitWH = "width"; | ||
| 150 | - } else { | ||
| 151 | - this.fitWH = "height"; | ||
| 152 | - } | ||
| 153 | - this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ? | ||
| 154 | - (windowSizeManager.get().height / this.imageDefaultSize.height) : | ||
| 155 | - (windowSizeManager.get().width / this.imageDefaultSize.width); | ||
| 156 | - }).catch((err: BusinessError) => { | ||
| 157 | - console.error(`[error][getImageInfo]${err.message}`); | ||
| 158 | - }); | ||
| 159 | - imageSource.createPixelMap().then((data: image.PixelMap) => { | ||
| 160 | - this.imagePixelMap = data; | ||
| 161 | - }).catch((err: BusinessError) => { | ||
| 162 | - console.error(`[error][createPixelMap]${err.message}`); | ||
| 163 | - }); | ||
| 164 | - this.isEnableOffset = false; | ||
| 165 | - this.imageScaleInfo.reset(); | ||
| 166 | - this.imageOffsetInfo.reset(); | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | - /** | ||
| 170 | - * 在图片消失时,将当前图片的信息设置为默认值 | ||
| 171 | - */ | ||
| 172 | - resetCurrentImageInfo(): void { | ||
| 173 | - this.imageScaleInfo.reset(); | ||
| 174 | - this.imageOffsetInfo.reset(); | ||
| 175 | - this.matrix = matrix4.identity().copy(); | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - /** | ||
| 179 | - * TODO:需求:在偏移时评估是否到达边界,以便进行位移限制与图片的切换 | ||
| 180 | - * @returns:长度为4的boolean数组,表示上下左右是否到达边界 | ||
| 181 | - */ | ||
| 182 | - evaluateBound(): boolean[] { | ||
| 183 | - return [false, false, false, false]; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - build() { | ||
| 187 | - Stack() { | ||
| 188 | - Scroll(this.scroller) { | ||
| 189 | - if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){ | ||
| 190 | - Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 191 | - .alt($r('app.media.datail_imageLoading_w')) | ||
| 192 | - .width(this.imageWidth) | ||
| 193 | - .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 194 | - .interpolation(ImageInterpolation.High) | ||
| 195 | - .autoResize(false) | ||
| 196 | - .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 197 | - .defaultFocus(true) | ||
| 198 | - .offset({ | ||
| 199 | - // TODO:知识点:通过offset控制图片的偏移 | ||
| 200 | - x: this.imageOffsetInfo.currentX, | ||
| 201 | - y: this.imageOffsetInfo.currentY | ||
| 202 | - }) | ||
| 203 | - .onComplete(event => { | ||
| 204 | - this.imageWidth = '100%' | ||
| 205 | - }) | ||
| 206 | - } else { | ||
| 207 | - Image(this.imagePixelMap)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 208 | - .alt($r('app.media.datail_imageLoading_w')) | ||
| 209 | - .width(this.imageWidth) | ||
| 210 | - .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 211 | - .interpolation(ImageInterpolation.High) | ||
| 212 | - .autoResize(false) | ||
| 213 | - .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 214 | - .defaultFocus(true) | ||
| 215 | - .offset({ | ||
| 216 | - // TODO:知识点:通过offset控制图片的偏移 | ||
| 217 | - x: this.imageOffsetInfo.currentX, | ||
| 218 | - y: this.imageOffsetInfo.currentY | ||
| 219 | - }) | ||
| 220 | - .onComplete(event => { | ||
| 221 | - this.imageWidth = '100%' | ||
| 222 | - }) | ||
| 223 | - } | ||
| 224 | - } | ||
| 225 | - .scrollable(ScrollDirection.Vertical) | ||
| 226 | - .scrollBarWidth(0) | ||
| 227 | - .constraintSize({ | ||
| 228 | - maxHeight: this.imageDefaultSize.height | ||
| 229 | - }) | ||
| 230 | - } | ||
| 231 | - .onBlur(() => { | ||
| 232 | - this.resetCurrentImageInfo(); | ||
| 233 | - }) | ||
| 234 | - // .backgroundColor(this.bgc) | ||
| 235 | - .alignContent(Alignment.Center) | ||
| 236 | - .width("100%") | ||
| 237 | - .height("100%") | ||
| 238 | - .backgroundColor(Color.Black) | ||
| 239 | - .gesture( | ||
| 240 | - GestureGroup( | ||
| 241 | - GestureMode.Exclusive, | ||
| 242 | - // TODO:知识点:双击切换图片大小 | ||
| 243 | - TapGesture({ count: 2 }) | ||
| 244 | - .onAction(() => { | ||
| 245 | - let fn: Function; | ||
| 246 | - // 已经是放大状态下,双击缩小 | ||
| 247 | - if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.defaultScaleValue) { | ||
| 248 | - fn = () => { | ||
| 249 | - this.isEnableSwipe = true; | ||
| 250 | - this.imageScaleInfo.reset(); | ||
| 251 | - this.imageOffsetInfo.reset(); | ||
| 252 | - this.matrix = matrix4.identity().copy(); | ||
| 253 | - }; | ||
| 254 | - } else { | ||
| 255 | - // 已经是缩小状态,双击放大 | ||
| 256 | - fn = () => { | ||
| 257 | - this.isEnableSwipe = false; | ||
| 258 | - const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get()); | ||
| 259 | - this.imageScaleInfo.scaleValue = ratio; | ||
| 260 | - this.imageOffsetInfo.reset(); | ||
| 261 | - this.matrix = matrix4.identity().scale({ | ||
| 262 | - x: ratio, | ||
| 263 | - y: ratio, | ||
| 264 | - }).copy(); | ||
| 265 | - this.imageScaleInfo.stash(); | ||
| 266 | - } | ||
| 267 | - } | ||
| 268 | - runWithAnimation(fn); | ||
| 269 | - }), | ||
| 270 | - // 单击切换背景色 | ||
| 271 | - // TapGesture({ count: 1 }).onAction(() => { | ||
| 272 | - // runWithAnimation(() => { | ||
| 273 | - // this.bgc = this.bgc === Color.White ? Color.Black : Color.White; | ||
| 274 | - // }); | ||
| 275 | - // }), | ||
| 276 | - // TODO:知识点:双指捏合缩放图片 | ||
| 277 | - PinchGesture({ fingers: 2, distance: 1 }) | ||
| 278 | - .onActionUpdate((event: GestureEvent) => { | ||
| 279 | - this.imageScaleInfo.scaleValue = this.imageScaleInfo.lastValue * event.scale; | ||
| 280 | - // TODO:知识点:缩放时不允许大于最大缩放因子+额外缩放因子,不允许小于默认大小-额外缩放因子,额外缩放因子用于提升用户体验 | ||
| 281 | - if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue * | ||
| 282 | - (1 + this.imageScaleInfo.extraScaleValue) | ||
| 283 | - ) { | ||
| 284 | - this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue * | ||
| 285 | - (1 + this.imageScaleInfo.extraScaleValue); | ||
| 286 | - } | ||
| 287 | - if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue * | ||
| 288 | - (1 - this.imageScaleInfo.extraScaleValue)) { | ||
| 289 | - this.imageScaleInfo.scaleValue = this.imageScaleInfo.defaultScaleValue * | ||
| 290 | - (1 - this.imageScaleInfo.extraScaleValue); | ||
| 291 | - } | ||
| 292 | - // TODO:知识点:matrix默认缩放中心为组件中心 | ||
| 293 | - this.matrix = matrix4.identity().scale({ | ||
| 294 | - x: this.imageScaleInfo.scaleValue, | ||
| 295 | - y: this.imageScaleInfo.scaleValue, | ||
| 296 | - }).copy(); | ||
| 297 | - console.debug(this.imageScaleInfo.toString()); | ||
| 298 | - }) | ||
| 299 | - .onActionEnd((event: GestureEvent) => { | ||
| 300 | - /** | ||
| 301 | - * TODO:知识点:当小于默认大小时,恢复为默认大小 | ||
| 302 | - */ | ||
| 303 | - if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue) { | ||
| 304 | - runWithAnimation(() => { | ||
| 305 | - this.imageScaleInfo.reset(); | ||
| 306 | - this.imageOffsetInfo.reset(); | ||
| 307 | - this.matrix = matrix4.identity().copy(); | ||
| 308 | - }) | ||
| 309 | - } | ||
| 310 | - // TODO:知识点:当大于最大缩放因子时,恢复到最大 | ||
| 311 | - if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue) { | ||
| 312 | - runWithAnimation(() => { | ||
| 313 | - this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue; | ||
| 314 | - this.matrix = matrix4.identity() | ||
| 315 | - .scale({ | ||
| 316 | - x: this.imageScaleInfo.maxScaleValue, | ||
| 317 | - y: this.imageScaleInfo.maxScaleValue | ||
| 318 | - }); | ||
| 319 | - }) | ||
| 320 | - } | ||
| 321 | - this.imageScaleInfo.stash(); | ||
| 322 | - }), | ||
| 323 | - // // TODO:知识点:滑动图片 | ||
| 324 | - // PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片 | ||
| 325 | - // .onActionUpdate((event: GestureEvent) => { | ||
| 326 | - // if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) { | ||
| 327 | - // // 默认大小下不允许移动 | ||
| 328 | - // return; | ||
| 329 | - // } | ||
| 330 | - // this.imageOffsetInfo.currentX = this.imageOffsetInfo.lastX + event.offsetX; | ||
| 331 | - // this.imageOffsetInfo.currentY = this.imageOffsetInfo.lastY + event.offsetY; | ||
| 332 | - // }) | ||
| 333 | - // .onActionEnd((event: GestureEvent) => { | ||
| 334 | - // this.imageOffsetInfo.stash(); | ||
| 335 | - // }) | ||
| 336 | - ), | ||
| 337 | - ) | ||
| 338 | - } | ||
| 339 | -} |
| @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent { | @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent { | ||
| 72 | // } | 72 | // } |
| 73 | if (this.compDTO.linkUrl) { | 73 | if (this.compDTO.linkUrl) { |
| 74 | let taskAction: Action = { | 74 | let taskAction: Action = { |
| 75 | - type: 'JUMP_H5_BY_WEB_VIEW', | 75 | + type: 'JUMP_INNER_NEW_PAGE', |
| 76 | params: { | 76 | params: { |
| 77 | - url: this.compDTO.linkUrl | 77 | + url: this.compDTO.linkUrl, |
| 78 | + pageID: 'SPACIAL_TOPIC_PAGE', | ||
| 79 | + contentID: this.compDTO.objectId, | ||
| 80 | + extra: { | ||
| 81 | + relId: this.compDTO.relId, | ||
| 82 | + relType: this.compDTO.relType, | ||
| 83 | + pageId: this.compDTO.pageId | ||
| 84 | + } | ||
| 78 | } as Params, | 85 | } as Params, |
| 79 | }; | 86 | }; |
| 87 | + this.compDTO.operDataList = [] | ||
| 88 | + console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO)) | ||
| 89 | + console.log('LiveHorizontalCardComponent', this.compDTO.relId) | ||
| 90 | + console.log('LiveHorizontalCardComponent', this.compDTO.relType) | ||
| 91 | + console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction)) | ||
| 80 | WDRouterRule.jumpWithAction(taskAction) | 92 | WDRouterRule.jumpWithAction(taskAction) |
| 81 | } else { | 93 | } else { |
| 94 | + // console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage') | ||
| 82 | this.jumpToLiveMorePage() | 95 | this.jumpToLiveMorePage() |
| 83 | } | 96 | } |
| 84 | } else { | 97 | } else { |
| @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent { | @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent { | ||
| 90 | linkUrl: this.compDTO.linkUrl, | 103 | linkUrl: this.compDTO.linkUrl, |
| 91 | pageId: this.compDTO.pageId | 104 | pageId: this.compDTO.pageId |
| 92 | } as ContentDTO | 105 | } as ContentDTO |
| 106 | + // console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage') | ||
| 93 | ProcessUtils.processPage(contentDTO) | 107 | ProcessUtils.processPage(contentDTO) |
| 94 | } | 108 | } |
| 95 | } | 109 | } |
| @@ -59,7 +59,7 @@ export struct LiveOperRowListView { | @@ -59,7 +59,7 @@ export struct LiveOperRowListView { | ||
| 59 | @State needLike: boolean = true | 59 | @State needLike: boolean = true |
| 60 | @State styleType: number = -1 | 60 | @State styleType: number = -1 |
| 61 | @State bgColor: ResourceColor = Color.White | 61 | @State bgColor: ResourceColor = Color.White |
| 62 | - @State interactData: InteractDataDTO = {} as InteractDataDTO | 62 | + @State interactData: InteractDataDTO = new InteractDataDTO |
| 63 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 63 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 64 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 64 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 65 | @State dialogController: CustomDialogController | null = null; | 65 | @State dialogController: CustomDialogController | null = null; |
| @@ -6,7 +6,8 @@ import { | @@ -6,7 +6,8 @@ import { | ||
| 6 | ContentDetailDTO, | 6 | ContentDetailDTO, |
| 7 | contentListParams, | 7 | contentListParams, |
| 8 | InteractDataDTO, | 8 | InteractDataDTO, |
| 9 | - postExecuteCollectRecordParams | 9 | + postExecuteCollectRecordParams, |
| 10 | + TopicInfo | ||
| 10 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 11 | import router from '@ohos.router'; | 12 | import router from '@ohos.router'; |
| 12 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | 13 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; |
| @@ -94,6 +95,7 @@ export struct OperRowListView { | @@ -94,6 +95,7 @@ export struct OperRowListView { | ||
| 94 | @Consume pageId: string | 95 | @Consume pageId: string |
| 95 | @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 96 | @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 96 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | 97 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 |
| 98 | + @Prop topicInfo?: TopicInfo = {} as TopicInfo | ||
| 97 | 99 | ||
| 98 | async aboutToAppear() { | 100 | async aboutToAppear() { |
| 99 | console.info(TAG, 'this.needLike', this.needLike) | 101 | console.info(TAG, 'this.needLike', this.needLike) |
| @@ -416,8 +418,34 @@ export struct OperRowListView { | @@ -416,8 +418,34 @@ export struct OperRowListView { | ||
| 416 | } | 418 | } |
| 417 | 419 | ||
| 418 | share() { | 420 | share() { |
| 421 | + if (this.topicInfo && Object.keys(this.topicInfo).length > 0) { | ||
| 422 | + console.info(TAG, 'contentDetailData this.topicInfo', JSON.stringify(this.topicInfo)) | ||
| 423 | + let contentDetailData: ContentDetailDTO = { | ||
| 424 | + newsId: this.topicInfo?.topicId && Number.parseInt(this.topicInfo.topicId), | ||
| 425 | + shareInfo:{ | ||
| 426 | + appCustomContentId: this.topicInfo?.topicId, | ||
| 427 | + appCustomContentType: this.topicInfo?.topicType + '', | ||
| 428 | + shareTitle: this.topicInfo?.shareTitle, | ||
| 429 | + shareSummary: this.topicInfo?.shareSummary, | ||
| 430 | + appCustomImageUrl: this.topicInfo?.shareCoverUrl, | ||
| 431 | + sharePosterCoverUrl: this.topicInfo?.sharePosterCoverUrl, | ||
| 432 | + shareUrl: this.topicInfo?.shareUrl, | ||
| 433 | + appCustomTargetRelId: this.topicInfo?.relId, | ||
| 434 | + appCustomTargetRelType: this.topicInfo?.relType, | ||
| 435 | + appCustomShowReport: false, | ||
| 436 | + appCustomShowLike: -1, | ||
| 437 | + shareOpen: 1, | ||
| 438 | + sharePosterOpen: this.topicInfo?.posterFlag, | ||
| 439 | + appCustomShowPoster: this.topicInfo?.posterFlag && this.topicInfo?.posterFlag > 0 ? 1 : -1, | ||
| 440 | + } | ||
| 441 | + } as ContentDetailDTO | ||
| 442 | + WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo , this.topicInfo) | ||
| 443 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper) | ||
| 444 | + } else { | ||
| 445 | + console.info(TAG, 'this.contentDetailData') | ||
| 419 | WDShare.shareContent(this.contentDetailData) | 446 | WDShare.shareContent(this.contentDetailData) |
| 420 | } | 447 | } |
| 448 | + } | ||
| 421 | 449 | ||
| 422 | // 已登录->查询用户对作品收藏状态 | 450 | // 已登录->查询用户对作品收藏状态 |
| 423 | private async getInteractDataStatus() { | 451 | private async getInteractDataStatus() { |
| 1 | import { PhotoListBean } from 'wdBean/Index'; | 1 | import { PhotoListBean } from 'wdBean/Index'; |
| 2 | import { display, router } from '@kit.ArkUI'; | 2 | import { display, router } from '@kit.ArkUI'; |
| 3 | -import { ImageItemView } from '../components/view/ImageItemView'; | ||
| 4 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; | 3 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; |
| 4 | +import { MultiPictureDetailItemComponent } from '../components/MultiPictureDetailItemComponent'; | ||
| 5 | + | ||
| 5 | import { Action } from 'wdBean'; | 6 | import { Action } from 'wdBean'; |
| 6 | import { WindowModel } from 'wdKit/Index'; | 7 | import { WindowModel } from 'wdKit/Index'; |
| 7 | 8 | ||
| @@ -68,11 +69,10 @@ export struct MultiPictureListPage { | @@ -68,11 +69,10 @@ export struct MultiPictureListPage { | ||
| 68 | }) | 69 | }) |
| 69 | .id("backImg") | 70 | .id("backImg") |
| 70 | 71 | ||
| 71 | - | ||
| 72 | if (this.photoList && this.photoList?.length > 0) { | 72 | if (this.photoList && this.photoList?.length > 0) { |
| 73 | Swiper(this.swiperController) { | 73 | Swiper(this.swiperController) { |
| 74 | ForEach(this.photoList, (item: PhotoListBean) => { | 74 | ForEach(this.photoList, (item: PhotoListBean) => { |
| 75 | - ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | 75 | + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) |
| 76 | }) | 76 | }) |
| 77 | } | 77 | } |
| 78 | .index(this.swiperIndex) | 78 | .index(this.swiperIndex) |
| @@ -135,7 +135,6 @@ export struct MultiPictureListPage { | @@ -135,7 +135,6 @@ export struct MultiPictureListPage { | ||
| 135 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 135 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 136 | }) | 136 | }) |
| 137 | } | 137 | } |
| 138 | - | ||
| 139 | ImageDownloadComponent({ url: this.currentUrl }) | 138 | ImageDownloadComponent({ url: this.currentUrl }) |
| 140 | .alignRules({ | 139 | .alignRules({ |
| 141 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 140 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| @@ -152,6 +151,7 @@ export struct MultiPictureListPage { | @@ -152,6 +151,7 @@ export struct MultiPictureListPage { | ||
| 152 | .width('100%') | 151 | .width('100%') |
| 153 | .height('100%') | 152 | .height('100%') |
| 154 | .id('e_picture_container') | 153 | .id('e_picture_container') |
| 154 | + .backgroundColor(Color.Black) | ||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | aboutToDisappear(): void { | 157 | aboutToDisappear(): void { |
| 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}` |
| @@ -5,11 +5,25 @@ | @@ -5,11 +5,25 @@ | ||
| 5 | */ | 5 | */ |
| 6 | export class SearchResultCountItem{ | 6 | export class SearchResultCountItem{ |
| 7 | 7 | ||
| 8 | + /* | ||
| 9 | + "allTotal":0, | ||
| 10 | + "activityTotal":0, | ||
| 11 | + "cmsTotal":0, | ||
| 12 | + "trueTotal":0, | ||
| 13 | + "pageSize":1, | ||
| 14 | + "keyword":"wuhuhuan", | ||
| 15 | + "totalCount":0, | ||
| 16 | + "pageNum":1, | ||
| 17 | + "videoTotal":0, | ||
| 18 | + "rmhTotal":5 | ||
| 19 | + */ | ||
| 8 | 20 | ||
| 21 | + keyword:string ='' //搜索关键字 | ||
| 9 | allTotal: number = 0 //所有tab总量 | 22 | allTotal: number = 0 //所有tab总量 |
| 10 | cmsTotal: number = 0 //精选总量 | 23 | cmsTotal: number = 0 //精选总量 |
| 11 | rmhTotal: number = 0 //人民号总量 | 24 | rmhTotal: number = 0 //人民号总量 |
| 12 | videoTotal: number = 0 //视频总量 | 25 | videoTotal: number = 0 //视频总量 |
| 13 | activityTotal: number = 0 //活动数据总量 | 26 | activityTotal: number = 0 //活动数据总量 |
| 14 | 27 | ||
| 28 | + | ||
| 15 | } | 29 | } |
| @@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | - "@ohos/lottie": "2.0.10", | ||
| 11 | "wdComponent": "file:../../features/wdComponent", | 10 | "wdComponent": "file:../../features/wdComponent", |
| 12 | "wdPlayer": "file:../../features/wdPlayer", | 11 | "wdPlayer": "file:../../features/wdPlayer", |
| 13 | "wdNetwork": "file:../../commons/wdNetwork", | 12 | "wdNetwork": "file:../../commons/wdNetwork", |
| @@ -221,9 +221,15 @@ export struct PlayUIComponent { | @@ -221,9 +221,15 @@ export struct PlayUIComponent { | ||
| 221 | .padding({ | 221 | .padding({ |
| 222 | top: 1, | 222 | top: 1, |
| 223 | right: 4, | 223 | right: 4, |
| 224 | - bottom: 1 | 224 | + bottom: 1, |
| 225 | }) | 225 | }) |
| 226 | - // .margin({left: this.contentDetailData?.rmhInfo ? 0 : 34}) | 226 | + .margin( |
| 227 | + { | ||
| 228 | + left: this.contentDetailData?.rmhInfo | ||
| 229 | + ? 0 | ||
| 230 | + : this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 34 : 0 | ||
| 231 | + } | ||
| 232 | + ) | ||
| 227 | } | 233 | } |
| 228 | //回看 | 234 | //回看 |
| 229 | else if (this.contentDetailData.liveInfo?.liveState == 'end') { | 235 | else if (this.contentDetailData.liveInfo?.liveState == 'end') { |
| @@ -85,6 +85,7 @@ export struct PlayerTitleComponent { | @@ -85,6 +85,7 @@ export struct PlayerTitleComponent { | ||
| 85 | Row() { | 85 | Row() { |
| 86 | this.getLiveStatusView() | 86 | this.getLiveStatusView() |
| 87 | } | 87 | } |
| 88 | + .margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34}) | ||
| 88 | 89 | ||
| 89 | } | 90 | } |
| 90 | .width('100%') | 91 | .width('100%') |
| @@ -144,7 +145,6 @@ export struct PlayerTitleComponent { | @@ -144,7 +145,6 @@ export struct PlayerTitleComponent { | ||
| 144 | .fontWeight(400) | 145 | .fontWeight(400) |
| 145 | .fontColor(Color.White) | 146 | .fontColor(Color.White) |
| 146 | } | 147 | } |
| 147 | - | ||
| 148 | } | 148 | } |
| 149 | .backgroundColor('#4D000000') | 149 | .backgroundColor('#4D000000') |
| 150 | .borderRadius(2) | 150 | .borderRadius(2) |
| @@ -154,7 +154,6 @@ export struct PlayerTitleComponent { | @@ -154,7 +154,6 @@ export struct PlayerTitleComponent { | ||
| 154 | top: 0, | 154 | top: 0, |
| 155 | bottom: 0 | 155 | bottom: 0 |
| 156 | } : 4) | 156 | } : 4) |
| 157 | - .margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34}) | ||
| 158 | } | 157 | } |
| 159 | } | 158 | } |
| 160 | } | 159 | } |
| @@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | - "@ohos/lottie": "2.0.0", | ||
| 11 | "wdPlayer": "file:../../features/wdPlayer", | 10 | "wdPlayer": "file:../../features/wdPlayer", |
| 12 | "wdKit": "file:../../commons/wdKit", | 11 | "wdKit": "file:../../commons/wdKit", |
| 13 | "wdBean": "file:../../features/wdBean", | 12 | "wdBean": "file:../../features/wdBean", |
| @@ -204,7 +204,7 @@ export struct DetailVideoListPage { | @@ -204,7 +204,7 @@ export struct DetailVideoListPage { | ||
| 204 | build() { | 204 | build() { |
| 205 | if (this.netStatus !== undefined) { | 205 | if (this.netStatus !== undefined) { |
| 206 | EmptyComponent({ | 206 | EmptyComponent({ |
| 207 | - emptyType: 1, emptyButton: true, retry: () => { | 207 | + emptyType: 1, emptyButton: true, isBlack: true, retry: () => { |
| 208 | this.getContentDetail(this.contentId, this.relId, this.relType) | 208 | this.getContentDetail(this.contentId, this.relId, this.relType) |
| 209 | } | 209 | } |
| 210 | }) | 210 | }) |
| @@ -86,7 +86,7 @@ export struct PlayerFullScreenView { | @@ -86,7 +86,7 @@ export struct PlayerFullScreenView { | ||
| 86 | .margin({ left: 10 }) | 86 | .margin({ left: 10 }) |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | - Image($r(`app.media.ic_share`)).height(24).width(24) | 89 | + Image($r(`app.media.ic_share_empty`)).height(24).width(24) |
| 90 | .onClick(() => { | 90 | .onClick(() => { |
| 91 | this.share() | 91 | this.share() |
| 92 | }) | 92 | }) |
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_share_empty.png
0 → 100644
1.92 KB
| @@ -36,6 +36,7 @@ struct GuidePages { | @@ -36,6 +36,7 @@ struct GuidePages { | ||
| 36 | ChildItem(index: number) { | 36 | ChildItem(index: number) { |
| 37 | RelativeContainer() { | 37 | RelativeContainer() { |
| 38 | Image(this.guideImage[index]) | 38 | Image(this.guideImage[index]) |
| 39 | + .objectFit(ImageFit.Contain) | ||
| 39 | .alignRules({ | 40 | .alignRules({ |
| 40 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 41 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 41 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 42 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| @@ -124,6 +124,14 @@ struct LoginPage { | @@ -124,6 +124,14 @@ struct LoginPage { | ||
| 124 | 124 | ||
| 125 | 125 | ||
| 126 | onPageHide(): void { | 126 | onPageHide(): void { |
| 127 | + ///关闭禁止截图 | ||
| 128 | + this.isPrivacyMode = false | ||
| 129 | + this.disableScreenCapture() | ||
| 130 | + | ||
| 131 | + this.loginPageBrowse() | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + loginPageBrowse(){ | ||
| 127 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 135 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 128 | let duration = 0 | 136 | let duration = 0 |
| 129 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | 137 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) |
| @@ -261,10 +269,6 @@ struct LoginPage { | @@ -261,10 +269,6 @@ struct LoginPage { | ||
| 261 | right: { anchor: "__container__", align: HorizontalAlign.End } | 269 | right: { anchor: "__container__", align: HorizontalAlign.End } |
| 262 | }) | 270 | }) |
| 263 | .onClick(() => { | 271 | .onClick(() => { |
| 264 | - ///关闭禁止截图 | ||
| 265 | - this.isPrivacyMode = false | ||
| 266 | - this.disableScreenCapture() | ||
| 267 | - | ||
| 268 | router.back() | 272 | router.back() |
| 269 | }) | 273 | }) |
| 270 | .id('id_close') | 274 | .id('id_close') |
| @@ -375,7 +379,7 @@ struct LoginPage { | @@ -375,7 +379,7 @@ struct LoginPage { | ||
| 375 | .lineHeight(`${this.calcHeight(38)}lpx`) | 379 | .lineHeight(`${this.calcHeight(38)}lpx`) |
| 376 | } | 380 | } |
| 377 | .onClick(() => { | 381 | .onClick(() => { |
| 378 | - this.onPageHide() | 382 | + this.loginPageBrowse() |
| 379 | 383 | ||
| 380 | if(this.checkCodePage){ | 384 | if(this.checkCodePage){ |
| 381 | trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page) | 385 | trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page) |
| @@ -221,11 +221,12 @@ struct ModifyPasswordPage { | @@ -221,11 +221,12 @@ struct ModifyPasswordPage { | ||
| 221 | .width('100%') | 221 | .width('100%') |
| 222 | 222 | ||
| 223 | Column() { | 223 | Column() { |
| 224 | - Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) | 224 | + Text("忘记密码").fontSize(14).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) |
| 225 | .onClick(()=>{ | 225 | .onClick(()=>{ |
| 226 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage) | 226 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage) |
| 227 | }) | 227 | }) |
| 228 | } | 228 | } |
| 229 | + .margin({top:15}) | ||
| 229 | .width('100%') | 230 | .width('100%') |
| 230 | .height(`${this.calcHeight(85)}lpx`) | 231 | .height(`${this.calcHeight(85)}lpx`) |
| 231 | .alignItems(HorizontalAlign.Center) | 232 | .alignItems(HorizontalAlign.Center) |
| @@ -45,10 +45,10 @@ export class WDShare { | @@ -45,10 +45,10 @@ export class WDShare { | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | //专题分享数据转换 | 47 | //专题分享数据转换 |
| 48 | - static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){ | ||
| 49 | - shareBean.appCustomTopicType = topicInfoBean.topicType+'' | 48 | + static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean?: TopicInfo){ |
| 49 | + shareBean.appCustomTopicType = topicInfoBean?.topicType+'' | ||
| 50 | //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | 50 | //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 |
| 51 | - if(25 == topicInfoBean.topicType){ | 51 | + if(25 == topicInfoBean?.topicType){ |
| 52 | shareBean.appCustomShowPosterType = 6 | 52 | shareBean.appCustomShowPosterType = 6 |
| 53 | shareBean.appCustomTopicPattern = topicInfoBean.topicPattern | 53 | shareBean.appCustomTopicPattern = topicInfoBean.topicPattern |
| 54 | shareBean.appCustomPublishTime = topicInfoBean.topicDate | 54 | shareBean.appCustomPublishTime = topicInfoBean.topicDate |
| @@ -76,11 +76,11 @@ export class WDShare { | @@ -76,11 +76,11 @@ export class WDShare { | ||
| 76 | //文章/直播/话题专题(H5普通文章专题,包含时间链) | 76 | //文章/直播/话题专题(H5普通文章专题,包含时间链) |
| 77 | shareBean.appCustomShowPosterType = 8 | 77 | shareBean.appCustomShowPosterType = 8 |
| 78 | //海报的头图 | 78 | //海报的头图 |
| 79 | - shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl | 79 | + shareBean.sharePosterCoverUrl = topicInfoBean?.backgroundImgUrl || '' |
| 80 | shareBean.appCustomIsFrontDaily = false | 80 | shareBean.appCustomIsFrontDaily = false |
| 81 | - shareBean.appCustomPosterTitle = topicInfoBean.title | ||
| 82 | - shareBean.appCustomPosterSummary = topicInfoBean.summary | ||
| 83 | - if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | 81 | + shareBean.appCustomPosterTitle = topicInfoBean?.title || '' |
| 82 | + shareBean.appCustomPosterSummary = topicInfoBean?.summary || '' | ||
| 83 | + if(topicInfoBean?.shareContentList != null && topicInfoBean?.shareContentList && topicInfoBean.shareContentList.length > 0){ | ||
| 84 | shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[] | 84 | shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[] |
| 85 | shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length | 85 | shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length |
| 86 | for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | 86 | for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { |
| @@ -10,7 +10,8 @@ | @@ -10,7 +10,8 @@ | ||
| 10 | "main": "", | 10 | "main": "", |
| 11 | "version": "1.0.0", | 11 | "version": "1.0.0", |
| 12 | "dependencies": { | 12 | "dependencies": { |
| 13 | - "@ohos/pulltorefresh": "^2.0.5", | 13 | + "@ohos/pulltorefresh": "^2.0.6-rc.0", |
| 14 | + "@ohos/lottie": "v2.0.11-rc.6", | ||
| 14 | "@mpaas/udid": "0.0.2", | 15 | "@mpaas/udid": "0.0.2", |
| 15 | "@mpaas/upgrade": "0.0.2", | 16 | "@mpaas/upgrade": "0.0.2", |
| 16 | "@mpaas/framework": "0.0.2", | 17 | "@mpaas/framework": "0.0.2", |
| @@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
| 7 | "main": "", | 7 | "main": "", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | - "@ohos/lottie": "v2.0.11-rc.6", | ||
| 11 | "wdComponent": "file:../../features/wdComponent", | 10 | "wdComponent": "file:../../features/wdComponent", |
| 12 | "wdConstant": "file:../../commons/wdConstant", | 11 | "wdConstant": "file:../../commons/wdConstant", |
| 13 | "wdKit": "file:../../commons/wdKit", | 12 | "wdKit": "file:../../commons/wdKit", |
| @@ -91,11 +91,11 @@ struct LaunchAdvertisingPage { | @@ -91,11 +91,11 @@ struct LaunchAdvertisingPage { | ||
| 91 | Text('广告') | 91 | Text('广告') |
| 92 | .fontColor(Color.White) | 92 | .fontColor(Color.White) |
| 93 | .textAlign(TextAlign.Center) | 93 | .textAlign(TextAlign.Center) |
| 94 | - .fontSize('24lpx') | ||
| 95 | - .width('72lpx') | ||
| 96 | - .height('36lpx') | 94 | + .fontSize(12) |
| 95 | + .width(36) | ||
| 96 | + .height(18) | ||
| 97 | .borderRadius(2) | 97 | .borderRadius(2) |
| 98 | - .margin({top:'15lpx',left:'19lpx'}) | 98 | + .margin({top:'8px',left:'10px'}) |
| 99 | .backgroundColor('#80000000') | 99 | .backgroundColor('#80000000') |
| 100 | .margin({left:16}) | 100 | .margin({left:16}) |
| 101 | } | 101 | } |
| @@ -104,13 +104,13 @@ struct LaunchAdvertisingPage { | @@ -104,13 +104,13 @@ struct LaunchAdvertisingPage { | ||
| 104 | 104 | ||
| 105 | Button(){ | 105 | Button(){ |
| 106 | Text(this.time + 's 跳过') | 106 | Text(this.time + 's 跳过') |
| 107 | - .fontSize('27lpx') | 107 | + .fontSize(14) |
| 108 | .fontColor(Color.White) | 108 | .fontColor(Color.White) |
| 109 | - .margin({left:'28lpx',right:'28lpx'}) | 109 | + .margin({left:14,right:14}) |
| 110 | } | 110 | } |
| 111 | - .width('148lpx') | ||
| 112 | - .height('56lpx') | ||
| 113 | - .margin({top:'10lpx',right:'19lpx'}) | 111 | + .width(74) |
| 112 | + .height(28) | ||
| 113 | + .margin({top:5,right:10}) | ||
| 114 | .backgroundColor('#80000000') | 114 | .backgroundColor('#80000000') |
| 115 | .onClick(() => { | 115 | .onClick(() => { |
| 116 | this.trackingLaunchJumpOver() | 116 | this.trackingLaunchJumpOver() |
| @@ -125,21 +125,21 @@ struct LaunchAdvertisingPage { | @@ -125,21 +125,21 @@ struct LaunchAdvertisingPage { | ||
| 125 | Button(){ | 125 | Button(){ |
| 126 | Row(){ | 126 | Row(){ |
| 127 | Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情') | 127 | Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情') |
| 128 | - .fontSize('31lpx') | 128 | + .fontSize(16) |
| 129 | .fontColor(Color.White) | 129 | .fontColor(Color.White) |
| 130 | .margin({ | 130 | .margin({ |
| 131 | - left:'55lpx' | 131 | + left:28 |
| 132 | }) | 132 | }) |
| 133 | Image($r('app.media.Slice')) | 133 | Image($r('app.media.Slice')) |
| 134 | - .width('46lpx') | ||
| 135 | - .height('46lpx') | ||
| 136 | - .margin({right:'55lpx'}) | 134 | + .width(28) |
| 135 | + .height(23) | ||
| 136 | + .margin({right:28}) | ||
| 137 | }.alignItems(VerticalAlign.Center) | 137 | }.alignItems(VerticalAlign.Center) |
| 138 | } | 138 | } |
| 139 | - .width('566lpx') | ||
| 140 | - .height('111lpx') | 139 | + .width(284) |
| 140 | + .height(56) | ||
| 141 | .margin({ | 141 | .margin({ |
| 142 | - bottom: '51lpx' | 142 | + bottom: 26 |
| 143 | }) | 143 | }) |
| 144 | .borderWidth(1) | 144 | .borderWidth(1) |
| 145 | .borderColor(Color.White) | 145 | .borderColor(Color.White) |
| @@ -151,8 +151,8 @@ struct LaunchAdvertisingPage { | @@ -151,8 +151,8 @@ struct LaunchAdvertisingPage { | ||
| 151 | if(this.defaultModel.screenType == '1') { | 151 | if(this.defaultModel.screenType == '1') { |
| 152 | Column(){ | 152 | Column(){ |
| 153 | Image($r('app.media.LaunchPage_logo')) | 153 | Image($r('app.media.LaunchPage_logo')) |
| 154 | - .width('278lpx') | ||
| 155 | - .height('154lpx') | 154 | + .width(140) |
| 155 | + .height(77) | ||
| 156 | .margin({top:20}) | 156 | .margin({top:20}) |
| 157 | }.width('100%').height('16%').backgroundColor(Color.White) | 157 | }.width('100%').height('16%').backgroundColor(Color.White) |
| 158 | // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | 158 | // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) |
| @@ -40,11 +40,11 @@ struct LaunchInterestsHobbiesPage { | @@ -40,11 +40,11 @@ struct LaunchInterestsHobbiesPage { | ||
| 40 | Row(){ | 40 | Row(){ |
| 41 | Blank() | 41 | Blank() |
| 42 | Text('跳过') | 42 | Text('跳过') |
| 43 | - .fontSize('27lpx') | 43 | + .fontSize(14) |
| 44 | .fontColor('#333333') | 44 | .fontColor('#333333') |
| 45 | - .width('54lpx') | ||
| 46 | - .height('35lpx') | ||
| 47 | - .margin({top:'30lpx',right:'46lpx'}) | 45 | + .width(30) |
| 46 | + .height(18) | ||
| 47 | + .margin({top:15,right:23}) | ||
| 48 | .onClick(()=>{ | 48 | .onClick(()=>{ |
| 49 | //直接跳过到首页 | 49 | //直接跳过到首页 |
| 50 | //跳转首页 | 50 | //跳转首页 |
| @@ -58,20 +58,20 @@ struct LaunchInterestsHobbiesPage { | @@ -58,20 +58,20 @@ struct LaunchInterestsHobbiesPage { | ||
| 58 | .justifyContent(FlexAlign.End) | 58 | .justifyContent(FlexAlign.End) |
| 59 | 59 | ||
| 60 | Text('选择感兴趣的内容') | 60 | Text('选择感兴趣的内容') |
| 61 | - .fontSize('46lpx') | 61 | + .fontSize(23) |
| 62 | .fontWeight(FontWeight.Bold) | 62 | .fontWeight(FontWeight.Bold) |
| 63 | .textAlign(TextAlign.Center) | 63 | .textAlign(TextAlign.Center) |
| 64 | .fontColor('#333333') | 64 | .fontColor('#333333') |
| 65 | .width('100%') | 65 | .width('100%') |
| 66 | - .height('61lpx') | ||
| 67 | - .margin({top:'54lpx'}) | 66 | + .height(30) |
| 67 | + .margin({top:27}) | ||
| 68 | Text('完善信息,将为您推荐个性化的内容') | 68 | Text('完善信息,将为您推荐个性化的内容') |
| 69 | - .fontSize('27lpx') | 69 | + .fontSize(14) |
| 70 | .textAlign(TextAlign.Center) | 70 | .textAlign(TextAlign.Center) |
| 71 | .fontColor('#9E9E9E') | 71 | .fontColor('#9E9E9E') |
| 72 | .width('100%') | 72 | .width('100%') |
| 73 | - .height('35lpx') | ||
| 74 | - .margin({top:'12lpx'}) | 73 | + .height(17) |
| 74 | + .margin({top:6}) | ||
| 75 | 75 | ||
| 76 | if(!this.isConnectNetwork){ | 76 | if(!this.isConnectNetwork){ |
| 77 | EmptyComponent({ emptyType: 1,emptyHeight:"60%" ,retry: () => { | 77 | EmptyComponent({ emptyType: 1,emptyHeight:"60%" ,retry: () => { |
| @@ -141,39 +141,36 @@ struct LaunchInterestsHobbiesPage { | @@ -141,39 +141,36 @@ struct LaunchInterestsHobbiesPage { | ||
| 141 | }) | 141 | }) |
| 142 | } | 142 | } |
| 143 | .width('90%') | 143 | .width('90%') |
| 144 | - .margin({top:'61lpx',bottom:'300lpx'}) | 144 | + .margin({top:30,bottom:150}) |
| 145 | .columnsTemplate('1fr 1fr 1fr') | 145 | .columnsTemplate('1fr 1fr 1fr') |
| 146 | .columnsGap('23lpx') | 146 | .columnsGap('23lpx') |
| 147 | .rowsGap('23lpx') | 147 | .rowsGap('23lpx') |
| 148 | .scrollBar(BarState.Off) | 148 | .scrollBar(BarState.Off) |
| 149 | } | 149 | } |
| 150 | - | ||
| 151 | - | ||
| 152 | } | 150 | } |
| 153 | .width('100%') | 151 | .width('100%') |
| 154 | .height('100%') | 152 | .height('100%') |
| 155 | } | 153 | } |
| 156 | .width('100%') | 154 | .width('100%') |
| 157 | - .height(`calc(100% - ${158 + 'lpx'})`) | ||
| 158 | - // .backgroundColor(Color.Red) | 155 | + .height(`calc(100% - ${260 + 'px'})`) |
| 159 | 156 | ||
| 160 | Stack({alignContent:Alignment.Center}){ | 157 | Stack({alignContent:Alignment.Center}){ |
| 161 | Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') | 158 | Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') |
| 162 | - .fontSize('35lpx') | 159 | + .fontSize(18) |
| 163 | .fontColor('#FFFFFF') | 160 | .fontColor('#FFFFFF') |
| 164 | .backgroundColor('#ED2800') | 161 | .backgroundColor('#ED2800') |
| 165 | .type(ButtonType.Normal) | 162 | .type(ButtonType.Normal) |
| 166 | - .borderRadius('10lpx') | ||
| 167 | - .width('662lpx') | ||
| 168 | - .height('84lpx') | ||
| 169 | - .margin({top:'10lpx'}) | 163 | + .borderRadius(5) |
| 164 | + .width(320) | ||
| 165 | + .height(44) | ||
| 166 | + .margin({top:5}) | ||
| 170 | Image('') | 167 | Image('') |
| 171 | - .width('662lpx') | ||
| 172 | - .height('84lpx') | ||
| 173 | - .margin({top:'10lpx'}) | 168 | + .width(320) |
| 169 | + .height(44) | ||
| 170 | + .margin({top:5}) | ||
| 174 | .backgroundColor(Color.White) | 171 | .backgroundColor(Color.White) |
| 175 | .opacity(this.selectCount == 0 ? 0.6 : 0) | 172 | .opacity(this.selectCount == 0 ? 0.6 : 0) |
| 176 | - .borderRadius('10lpx') | 173 | + .borderRadius(5) |
| 177 | .onClick(()=>{ | 174 | .onClick(()=>{ |
| 178 | if (this.selectCount == 0) { | 175 | if (this.selectCount == 0) { |
| 179 | this.dialogToast.open() | 176 | this.dialogToast.open() |
| @@ -188,8 +185,8 @@ struct LaunchInterestsHobbiesPage { | @@ -188,8 +185,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 188 | }) | 185 | }) |
| 189 | } | 186 | } |
| 190 | .width('100%') | 187 | .width('100%') |
| 191 | - .height('108lpx') | ||
| 192 | - .margin({top:0}) | 188 | + .height(54) |
| 189 | + .margin({top:5}) | ||
| 193 | // .backgroundColor(Color.Orange) | 190 | // .backgroundColor(Color.Orange) |
| 194 | } | 191 | } |
| 195 | .width('100%') | 192 | .width('100%') |
| @@ -166,10 +166,10 @@ struct LaunchPage { | @@ -166,10 +166,10 @@ struct LaunchPage { | ||
| 166 | 166 | ||
| 167 | Stack({alignContent:Alignment.Bottom}){ | 167 | Stack({alignContent:Alignment.Bottom}){ |
| 168 | Image($r('app.media.LaunchPage_logo')) | 168 | Image($r('app.media.LaunchPage_logo')) |
| 169 | - .width('278lpx') | ||
| 170 | - .height('154lpx') | 169 | + .width(139) |
| 170 | + .height(87) | ||
| 171 | .margin({ | 171 | .margin({ |
| 172 | - bottom:'48lpx' | 172 | + bottom:24 |
| 173 | }) | 173 | }) |
| 174 | 174 | ||
| 175 | } | 175 | } |
| @@ -525,7 +525,7 @@ export struct MultiPictureDetailPageComponent { | @@ -525,7 +525,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 525 | @Builder | 525 | @Builder |
| 526 | noNet() { | 526 | noNet() { |
| 527 | EmptyComponent({ | 527 | EmptyComponent({ |
| 528 | - emptyType: 1, emptyButton: true, retry: () => { | 528 | + emptyType: 1, emptyButton: true, isBlack: true, retry: () => { |
| 529 | this.getContentDetailData() | 529 | this.getContentDetailData() |
| 530 | } | 530 | } |
| 531 | }) | 531 | }) |
| @@ -534,6 +534,7 @@ export struct MultiPictureDetailPageComponent { | @@ -534,6 +534,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 534 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 534 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| 535 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 535 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 536 | }) | 536 | }) |
| 537 | + .backgroundColor(Color.Black) | ||
| 537 | } | 538 | } |
| 538 | 539 | ||
| 539 | @Builder | 540 | @Builder |
-
Please register or login to post a comment