Showing
18 changed files
with
142 additions
and
202 deletions
| @@ -397,7 +397,8 @@ export class HttpUrlUtils { | @@ -397,7 +397,8 @@ export class HttpUrlUtils { | ||
| 397 | if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { | 397 | if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { |
| 398 | return HttpUrlUtils.token | 398 | return HttpUrlUtils.token |
| 399 | } | 399 | } |
| 400 | - return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; | 400 | + // return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; |
| 401 | + return '' | ||
| 401 | } | 402 | } |
| 402 | 403 | ||
| 403 | static getRefreshToken() { | 404 | static getRefreshToken() { |
| @@ -31,60 +31,58 @@ export struct CompParser { | @@ -31,60 +31,58 @@ export struct CompParser { | ||
| 31 | compIndex: number = 0; | 31 | compIndex: number = 0; |
| 32 | 32 | ||
| 33 | build() { | 33 | build() { |
| 34 | - Column(){ | 34 | + Column() { |
| 35 | this.componentBuilder(this.compDTO, this.compIndex); | 35 | this.componentBuilder(this.compDTO, this.compIndex); |
| 36 | - Divider().strokeWidth(1).color('#f5f5f5').padding({left:16,right:16}) | ||
| 37 | } | 36 | } |
| 38 | } | 37 | } |
| 39 | 38 | ||
| 40 | @Builder | 39 | @Builder |
| 41 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 40 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 42 | - if (compDTO.compStyle === CompStyle.Label_03) { | ||
| 43 | - LabelComponent({ compDTO: compDTO }) | ||
| 44 | - } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 45 | - BannerComponent({ compDTO: compDTO }) | ||
| 46 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) { | ||
| 47 | - LiveHorizontalCardComponent({ compDTO: compDTO }) | ||
| 48 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) { | ||
| 49 | - if (compDTO.operDataList.length > 1) { | ||
| 50 | - HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO }) | ||
| 51 | - } else { | ||
| 52 | - HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) | 41 | + if (compDTO.objectType !== '3' && compDTO.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 42 | + if (compDTO.compStyle === CompStyle.Label_03) { | ||
| 43 | + LabelComponent({ compDTO: compDTO }) | ||
| 44 | + } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 45 | + BannerComponent({ compDTO: compDTO }) | ||
| 46 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) { | ||
| 47 | + LiveHorizontalCardComponent({ compDTO: compDTO }) | ||
| 48 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) { | ||
| 49 | + if (compDTO.operDataList.length > 1) { | ||
| 50 | + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO }) | ||
| 51 | + } else { | ||
| 52 | + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) | ||
| 53 | + } | ||
| 54 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | ||
| 55 | + ZhSingleRow02({ compDTO }) | ||
| 56 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | ||
| 57 | + LiveHorizontalReservationComponent({ compDTO: compDTO }) | ||
| 58 | + } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { | ||
| 59 | + ZhGridLayout02({ compDTO: compDTO }) | ||
| 60 | + } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | ||
| 61 | + ZhGridLayout03({ compDTO: compDTO }) | ||
| 62 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | ||
| 63 | + ZhSingleRow04({ compDTO: compDTO }) | ||
| 64 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 65 | + //头图卡 和comStyle 2相同, | ||
| 66 | + Card5Component({ contentDTO: compDTO.operDataList[0] }) | ||
| 67 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | ||
| 68 | + ZhSingleColumn04({ compDTO: compDTO }) | ||
| 69 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | ||
| 70 | + ZhSingleColumn05({ compDTO: compDTO }) | ||
| 71 | + } else if (!Number.isNaN(Number(compDTO.compStyle))) { | ||
| 72 | + CardParser({ contentDTO: compDTO.operDataList[0] }); | ||
| 53 | } | 73 | } |
| 54 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | ||
| 55 | - ZhSingleRow02({ compDTO }) | ||
| 56 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | ||
| 57 | - LiveHorizontalReservationComponent({ compDTO: compDTO }) | ||
| 58 | - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { | ||
| 59 | - ZhGridLayout02({ compDTO: compDTO }) | ||
| 60 | - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | ||
| 61 | - ZhGridLayout03({ compDTO: compDTO }) | ||
| 62 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | ||
| 63 | - ZhSingleRow04({ compDTO: compDTO }) | ||
| 64 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 65 | - //头图卡 和comStyle 2相同, | ||
| 66 | - Card5Component({ contentDTO: compDTO.operDataList[0] }) | ||
| 67 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | ||
| 68 | - ZhSingleColumn04({ compDTO: compDTO }) | ||
| 69 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | ||
| 70 | - ZhSingleColumn05({ compDTO: compDTO }) | ||
| 71 | - } else if (!Number.isNaN(Number(compDTO.compStyle))) { | ||
| 72 | - CardParser({ contentDTO: compDTO.operDataList[0] }); | ||
| 73 | - } | ||
| 74 | - else { | ||
| 75 | - // todo:组件未实现 / Component Not Implemented | ||
| 76 | - Text(compDTO.compStyle) | ||
| 77 | - .width(CommonConstants.FULL_PARENT) | ||
| 78 | - .padding(10) | ||
| 79 | - .onClick(()=>{ | ||
| 80 | - if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {//精选评论 | ||
| 81 | - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 82 | - } | ||
| 83 | - }) | ||
| 84 | - // Text(compDTO.compStyle) | ||
| 85 | - // .width(CommonConstants.FULL_PARENT) | ||
| 86 | - // .padding(10) | ||
| 87 | - // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 74 | + else { |
| 75 | + // todo:组件未实现 / Component Not Implemented | ||
| 76 | + Text(compDTO.compStyle) | ||
| 77 | + .width(CommonConstants.FULL_PARENT) | ||
| 78 | + .padding(10) | ||
| 79 | + .onClick(() => { | ||
| 80 | + if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论 | ||
| 81 | + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 82 | + } | ||
| 83 | + }) | ||
| 84 | + } | ||
| 85 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 88 | } | 86 | } |
| 89 | } | 87 | } |
| 90 | } | 88 | } |
| 1 | -import { CommonConstants } from 'wdConstant'; | ||
| 2 | -import { Logger } from 'wdKit'; | ||
| 3 | - | ||
| 4 | -const TAG = 'EmptyComponent'; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * WDViewDefaultType 缺省页 | ||
| 8 | - */ | ||
| 9 | -export const enum WDViewDefaultType { | ||
| 10 | - ///无网 | ||
| 11 | - WDViewDefaultType_NoNetwork, | ||
| 12 | - ///网络失败 请稍后重试-倒计时 | ||
| 13 | - WDViewDefaultType_NetworkFailed, | ||
| 14 | - ///内容获取失败 | ||
| 15 | - WDViewDefaultType_ContentFailed, | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | -/** | ||
| 19 | - * 空数据/无数据 | ||
| 20 | - */ | ||
| 21 | -@Preview | ||
| 22 | -@Component | ||
| 23 | -export struct MultiPictureDetailEmptyComponent { | ||
| 24 | - // private emptySize: SizeOptions = {}; | ||
| 25 | - @State emptyWidth: string | number = CommonConstants.FULL_PARENT; | ||
| 26 | - @State emptyHeight: string | number = CommonConstants.FULL_PARENT; | ||
| 27 | - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_ContentFailed | ||
| 28 | - /** | ||
| 29 | - * The empty image width percentage setting. | ||
| 30 | - */ | ||
| 31 | - readonly EMPTY_IMAGE_WIDTH: string = '15%'; | ||
| 32 | - /** | ||
| 33 | - * The empty image height percentage setting. | ||
| 34 | - */ | ||
| 35 | - readonly EMPTY_IMAGE_HEIGHT: string = '15%'; | ||
| 36 | - /** | ||
| 37 | - * The empty data text component margin top. | ||
| 38 | - */ | ||
| 39 | - readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10'; | ||
| 40 | - /** | ||
| 41 | - * The empty data text opacity. | ||
| 42 | - */ | ||
| 43 | - readonly TEXT_OPACITY: number = 1; | ||
| 44 | - | ||
| 45 | - build() { | ||
| 46 | - this.noProgrammeData(); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - /** | ||
| 50 | - * 无数据,空白view组件 | ||
| 51 | - */ | ||
| 52 | - @Builder | ||
| 53 | - noProgrammeData() { | ||
| 54 | - Column() { | ||
| 55 | - Image(this.buildNoDataTipImage()) | ||
| 56 | - .width('this.EMPTY_IMAGE_WIDTH') | ||
| 57 | - .height(this.EMPTY_IMAGE_HEIGHT) | ||
| 58 | - .objectFit(ImageFit.Contain) | ||
| 59 | - // .border({ width: 1, color: Color.Red, radius: 6 }) | ||
| 60 | - | ||
| 61 | - Text(this.buildNoDataTip()) | ||
| 62 | - .fontSize($r('app.float.font_size_14')) | ||
| 63 | - .fontColor('#999999') | ||
| 64 | - .fontWeight(FontWeight.Normal) | ||
| 65 | - .opacity(this.TEXT_OPACITY) | ||
| 66 | - .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) | ||
| 67 | - .onClick((event: ClickEvent) => { | ||
| 68 | - Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | ||
| 69 | - }) | ||
| 70 | - Button('点击重试', { type: ButtonType.Normal, stateEffect: true }) | ||
| 71 | - .borderRadius(4) | ||
| 72 | - .margin(16) | ||
| 73 | - .height(28) | ||
| 74 | - .fontSize(12) | ||
| 75 | - .fontColor('#CCCCCC') | ||
| 76 | - .fontFamily('PingFang SC-Medium') | ||
| 77 | - .border({ width: 1, color: '#545454' }) | ||
| 78 | - .backgroundColor(Color.Black) | ||
| 79 | - } | ||
| 80 | - .justifyContent(FlexAlign.Center) | ||
| 81 | - .width(this.emptyWidth) | ||
| 82 | - .height(this.emptyHeight) | ||
| 83 | - .backgroundColor(Color.Black) | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - buildNoDataTip(): string { | ||
| 87 | - Logger.info(TAG, "buildNoDataTip"); | ||
| 88 | - let contentString: string = '获取内容失败请重试' | ||
| 89 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 90 | - contentString = '网络出小差了,请检查网络后重试' | ||
| 91 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | ||
| 92 | - contentString = '获取内容失败请重试' | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - return contentString | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - buildNoDataTipImage(): Resource | string { | ||
| 99 | - Logger.info(TAG, "buildNoDataTip"); | ||
| 100 | - let imageString: Resource | string = $r('app.media.icon_no_content') | ||
| 101 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 102 | - imageString = $r('app.media.icon_no_net') | ||
| 103 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | ||
| 104 | - imageString = $r('app.media.icon_no_content') | ||
| 105 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { | ||
| 106 | - imageString = $r('app.media.icon_no_net') | ||
| 107 | - } | ||
| 108 | - return imageString | ||
| 109 | - } | ||
| 110 | -} |
| @@ -12,7 +12,7 @@ import display from '@ohos.display'; | @@ -12,7 +12,7 @@ import display from '@ohos.display'; | ||
| 12 | import font from '@ohos.font'; | 12 | import font from '@ohos.font'; |
| 13 | import { OperRowListView } from './view/OperRowListView'; | 13 | import { OperRowListView } from './view/OperRowListView'; |
| 14 | import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; | 14 | import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; |
| 15 | -import { MultiPictureDetailEmptyComponent } from './MultiPictureDetailEmptyComponent'; | 15 | +import { EmptyComponent } from './view/EmptyComponent'; |
| 16 | import { DateTimeUtils } from 'wdKit/Index'; | 16 | import { DateTimeUtils } from 'wdKit/Index'; |
| 17 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 17 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 18 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 18 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| @@ -37,7 +37,7 @@ export struct MultiPictureDetailPageComponent { | @@ -37,7 +37,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 37 | @State swiperIndex: number = 0; | 37 | @State swiperIndex: number = 0; |
| 38 | @Provide followStatus: string = '0' // 关注状态 | 38 | @Provide followStatus: string = '0' // 关注状态 |
| 39 | private scroller: Scroller = new Scroller() | 39 | private scroller: Scroller = new Scroller() |
| 40 | - @State netStatus: number = 0 // 存储网络状态用来展示缺省图 | 40 | + @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 41 | 41 | ||
| 42 | //watch监听页码回调 | 42 | //watch监听页码回调 |
| 43 | onCurrentPageNumUpdated(): void { | 43 | onCurrentPageNumUpdated(): void { |
| @@ -239,8 +239,8 @@ export struct MultiPictureDetailPageComponent { | @@ -239,8 +239,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 239 | .height(px2vp(this.titleHeight) + 64) | 239 | .height(px2vp(this.titleHeight) + 64) |
| 240 | 240 | ||
| 241 | } else { | 241 | } else { |
| 242 | - if (this.netStatus === 1) { | ||
| 243 | - MultiPictureDetailEmptyComponent({ emptyType: 2}) | 242 | + if(this.netStatus !== undefined) { |
| 243 | + EmptyComponent({ emptyType: this.netStatus}) | ||
| 244 | .id('e_empty_content') | 244 | .id('e_empty_content') |
| 245 | .alignRules({ | 245 | .alignRules({ |
| 246 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 246 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| @@ -290,6 +290,9 @@ export struct MultiPictureDetailPageComponent { | @@ -290,6 +290,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 290 | return | 290 | return |
| 291 | } | 291 | } |
| 292 | this.contentDetailData = resDTO.data?.[0]; | 292 | this.contentDetailData = resDTO.data?.[0]; |
| 293 | + if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | ||
| 294 | + this.netStatus = 0 | ||
| 295 | + } | ||
| 293 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | 296 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) |
| 294 | if (HttpUrlUtils.getUserId()) { | 297 | if (HttpUrlUtils.getUserId()) { |
| 295 | this.getInteractBrowsOperate() | 298 | this.getInteractBrowsOperate() |
| @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | ||
| 19 | .interpolation(ImageInterpolation.High) | 19 | .interpolation(ImageInterpolation.High) |
| 20 | Text(`${item.msg}`) | 20 | Text(`${item.msg}`) |
| 21 | .margin({top:'8lpx'}) | 21 | .margin({top:'8lpx'}) |
| 22 | - .width('50lpx') | ||
| 23 | .height('23lpx') | 22 | .height('23lpx') |
| 24 | .fontColor($r('app.color.color_222222')) | 23 | .fontColor($r('app.color.color_222222')) |
| 25 | .fontSize('23lpx') | 24 | .fontSize('23lpx') |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | -import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit'; | ||
| 3 | -import { HttpUrlUtils } from 'wdNetwork'; | 2 | +import { DateTimeUtils, LazyDataSource,UserDataLocal } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 6 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 7 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 8 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 7 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| 9 | -import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; | ||
| 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 11 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 12 | 10 | ||
| @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | ||
| 22 | @State count:number = 0; | 20 | @State count:number = 0; |
| 23 | @State isMineAccount:boolean = true; | 21 | @State isMineAccount:boolean = true; |
| 24 | @State userId:string = ""; | 22 | @State userId:string = ""; |
| 23 | + @Link commentNum:number | ||
| 25 | 24 | ||
| 26 | aboutToAppear(){ | 25 | aboutToAppear(){ |
| 27 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -36,30 +35,33 @@ export struct HomePageBottomComponent{ | @@ -36,30 +35,33 @@ export struct HomePageBottomComponent{ | ||
| 36 | 35 | ||
| 37 | if(this.count === 0){ | 36 | if(this.count === 0){ |
| 38 | if(this.style === 1){ | 37 | if(this.style === 1){ |
| 39 | - Row(){ | ||
| 40 | - Text("关注更多人民号") | ||
| 41 | - .fontWeight('400lpx') | ||
| 42 | - .fontColor($r('app.color.color_222222')) | ||
| 43 | - .lineHeight('38lpx') | ||
| 44 | - .fontSize('27lpx') | ||
| 45 | - .textAlign(TextAlign.Center) | ||
| 46 | - .margin({right:'4lpx'}) | ||
| 47 | - Image($r('app.media.arrow_icon_right')) | ||
| 48 | - .objectFit(ImageFit.Auto) | ||
| 49 | - .width('27lpx') | ||
| 50 | - .height('27lpx') | ||
| 51 | - }.height('69lpx') | ||
| 52 | - .width('659lpx') | ||
| 53 | - .alignItems(VerticalAlign.Center) | ||
| 54 | - .justifyContent(FlexAlign.Center) | ||
| 55 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 56 | - .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 57 | - .onClick(()=>{ | ||
| 58 | - let params: Params = { | ||
| 59 | - pageID: "1" | ||
| 60 | - } | ||
| 61 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 62 | - }) | 38 | + Column(){ |
| 39 | + Row(){ | ||
| 40 | + Text("关注更多人民号") | ||
| 41 | + .fontWeight('400lpx') | ||
| 42 | + .fontColor($r('app.color.color_222222')) | ||
| 43 | + .lineHeight('38lpx') | ||
| 44 | + .fontSize('27lpx') | ||
| 45 | + .textAlign(TextAlign.Center) | ||
| 46 | + .margin({right:'4lpx'}) | ||
| 47 | + Image($r('app.media.arrow_icon_right')) | ||
| 48 | + .objectFit(ImageFit.Auto) | ||
| 49 | + .width('27lpx') | ||
| 50 | + .height('27lpx') | ||
| 51 | + }.height('69lpx') | ||
| 52 | + .width('659lpx') | ||
| 53 | + .alignItems(VerticalAlign.Center) | ||
| 54 | + .justifyContent(FlexAlign.Center) | ||
| 55 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 56 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 57 | + .onClick(()=>{ | ||
| 58 | + let params: Params = { | ||
| 59 | + pageID: "1" | ||
| 60 | + } | ||
| 61 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 62 | + }) | ||
| 63 | + }.layoutWeight(1) | ||
| 64 | + .justifyContent(FlexAlign.Start) | ||
| 63 | }else{ | 65 | }else{ |
| 64 | ListHasNoMoreDataUI({style:2}) | 66 | ListHasNoMoreDataUI({style:2}) |
| 65 | .layoutWeight(1) | 67 | .layoutWeight(1) |
| @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | ||
| 211 | this.hasMore = false | 213 | this.hasMore = false |
| 212 | }else{ | 214 | }else{ |
| 213 | value.list.forEach((value)=>{ | 215 | value.list.forEach((value)=>{ |
| 214 | - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | 216 | + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 217 | + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | ||
| 215 | }) | 218 | }) |
| 216 | this.data_comment.notifyDataReload() | 219 | this.data_comment.notifyDataReload() |
| 217 | this.count = this.data_comment.totalCount() | 220 | this.count = this.data_comment.totalCount() |
| @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | ||
| 222 | } | 225 | } |
| 223 | } | 226 | } |
| 224 | this.isLoading = false | 227 | this.isLoading = false |
| 228 | + this.commentNum = value.totalCount | ||
| 225 | }).catch((err:Error)=>{ | 229 | }).catch((err:Error)=>{ |
| 226 | console.log(TAG,"请求失败") | 230 | console.log(TAG,"请求失败") |
| 227 | this.isLoading = false | 231 | this.isLoading = false |
| @@ -60,7 +60,7 @@ class MinePageDatasModel{ | @@ -60,7 +60,7 @@ class MinePageDatasModel{ | ||
| 60 | return this.personalData | 60 | return this.personalData |
| 61 | } | 61 | } |
| 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) | 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) |
| 63 | - this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon'))) | 63 | + this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) |
| @@ -185,10 +185,10 @@ struct MineHomePage { | @@ -185,10 +185,10 @@ struct MineHomePage { | ||
| 185 | //tab 页面 | 185 | //tab 页面 |
| 186 | Tabs({controller: this.controller}) { | 186 | Tabs({controller: this.controller}) { |
| 187 | TabContent() { | 187 | TabContent() { |
| 188 | - HomePageBottomComponent({style:0}) | 188 | + HomePageBottomComponent({style:0,commentNum:$commentNum}) |
| 189 | }.tabBar(this.TabBuilder(0,"评论")) | 189 | }.tabBar(this.TabBuilder(0,"评论")) |
| 190 | TabContent() { | 190 | TabContent() { |
| 191 | - HomePageBottomComponent({style:1}) | 191 | + HomePageBottomComponent({style:1,commentNum:$commentNum}) |
| 192 | }.tabBar(this.TabBuilder(1,"关注")) | 192 | }.tabBar(this.TabBuilder(1,"关注")) |
| 193 | } | 193 | } |
| 194 | .backgroundColor($r('app.color.white')) | 194 | .backgroundColor($r('app.color.white')) |
| 1 | -import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; | 1 | +import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; | 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; |
| 3 | import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; | 3 | import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; |
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| @@ -58,7 +58,6 @@ export class PageHelper { | @@ -58,7 +58,6 @@ export class PageHelper { | ||
| 58 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | 58 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { |
| 59 | pageModel.viewType = ViewType.LOADED; | 59 | pageModel.viewType = ViewType.LOADED; |
| 60 | let sizeBefore: number = pageModel.compList.size(); | 60 | let sizeBefore: number = pageModel.compList.size(); |
| 61 | - pageModel.compList.push(...pageDto.compList) | ||
| 62 | if (pageDto.compList.length === pageModel.pageSize) { | 61 | if (pageDto.compList.length === pageModel.pageSize) { |
| 63 | pageModel.currentPage++; | 62 | pageModel.currentPage++; |
| 64 | pageModel.hasMore = true; | 63 | pageModel.hasMore = true; |
| @@ -66,6 +65,11 @@ export class PageHelper { | @@ -66,6 +65,11 @@ export class PageHelper { | ||
| 66 | pageModel.hasMore = false; | 65 | pageModel.hasMore = false; |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 68 | + //移除音频 和 活动 | ||
| 69 | + this.removeComp(pageModel,pageDto) | ||
| 70 | + | ||
| 71 | + // pageModel.compList.push(...pageDto.compList) | ||
| 72 | + | ||
| 69 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | 73 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) |
| 70 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 | 74 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 |
| 71 | // 二次请求,批查互动数据 | 75 | // 二次请求,批查互动数据 |
| @@ -108,7 +112,11 @@ export class PageHelper { | @@ -108,7 +112,11 @@ export class PageHelper { | ||
| 108 | pageModel.hasMore = false; | 112 | pageModel.hasMore = false; |
| 109 | } | 113 | } |
| 110 | let sizeBefore: number = pageModel.compList.size(); | 114 | let sizeBefore: number = pageModel.compList.size(); |
| 111 | - pageModel.compList.push(...data.compList) | 115 | + |
| 116 | + //移除音频 和 活动 | ||
| 117 | + this.removeComp(pageModel,data) | ||
| 118 | + // | ||
| 119 | + // pageModel.compList.push(...data.compList) | ||
| 112 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | 120 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { |
| 113 | // 刷新,替换所有数据 | 121 | // 刷新,替换所有数据 |
| 114 | pageModel.compList.updateItems(sizeBefore, data) | 122 | pageModel.compList.updateItems(sizeBefore, data) |
| @@ -119,6 +127,23 @@ export class PageHelper { | @@ -119,6 +127,23 @@ export class PageHelper { | ||
| 119 | promptAction.showToast({ message: err }); | 127 | promptAction.showToast({ message: err }); |
| 120 | }) | 128 | }) |
| 121 | } | 129 | } |
| 130 | + | ||
| 131 | + /** | ||
| 132 | + * 移除comp | ||
| 133 | + */ | ||
| 134 | + private removeComp(pageModel: PageModel, pageDto: PageDTO) { | ||
| 135 | + let datas = pageDto.compList | ||
| 136 | + for (let index = 0; index < datas.length; index++) { | ||
| 137 | + const element = datas[index]; | ||
| 138 | + let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | ||
| 139 | + //移除音频 和 活动 | ||
| 140 | + if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | ||
| 141 | + Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | ||
| 142 | + }else { | ||
| 143 | + pageModel.compList.push(element) | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + } | ||
| 122 | } | 147 | } |
| 123 | 148 | ||
| 124 | 149 |
| @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter'; | @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter'; | ||
| 4 | @Entry | 4 | @Entry |
| 5 | @Component | 5 | @Component |
| 6 | struct GuidePages { | 6 | struct GuidePages { |
| 7 | - guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')] | ||
| 8 | - guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')] | ||
| 9 | - guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')] | 7 | + guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')] |
| 8 | + guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')] | ||
| 9 | + guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')] | ||
| 10 | 10 | ||
| 11 | build() { | 11 | build() { |
| 12 | Column() { | 12 | Column() { |
| @@ -57,7 +57,7 @@ struct GuidePages { | @@ -57,7 +57,7 @@ struct GuidePages { | ||
| 57 | .margin({ bottom: 85 }) | 57 | .margin({ bottom: 85 }) |
| 58 | .height(40) | 58 | .height(40) |
| 59 | .onClick(() => { | 59 | .onClick(() => { |
| 60 | - if (index == 3) { | 60 | + if (index == 4) { |
| 61 | // 跳转到首页 | 61 | // 跳转到首页 |
| 62 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 62 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 63 | //跳转到兴趣偏好选择页 | 63 | //跳转到兴趣偏好选择页 |
No preview for this file type
No preview for this file type
| @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 3 | import { WDRouterPage } from 'wdRouter'; | 3 | import { WDRouterPage } from 'wdRouter'; |
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | +import { ButtonOptions, promptAction } from '@kit.ArkUI'; | ||
| 6 | 7 | ||
| 7 | @Entry | 8 | @Entry |
| 8 | @Component | 9 | @Component |
| @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage { | @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage { | ||
| 79 | .margin({top:'2lpx',left:'19lpx'}) | 80 | .margin({top:'2lpx',left:'19lpx'}) |
| 80 | .width('100%') | 81 | .width('100%') |
| 81 | .height('31lpx') | 82 | .height('31lpx') |
| 83 | + Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | ||
| 84 | + .height('32lpx') | ||
| 85 | + .width('32lpx') | ||
| 86 | + .margin({top:'80lpx',left:'110lpx'}) | ||
| 87 | + | ||
| 82 | }.justifyContent(FlexAlign.Start) | 88 | }.justifyContent(FlexAlign.Start) |
| 83 | } | 89 | } |
| 84 | 90 | ||
| @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage { | @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 87 | .width('100%') | 93 | .width('100%') |
| 88 | .height('100%') | 94 | .height('100%') |
| 89 | .backgroundColor(Color.White) | 95 | .backgroundColor(Color.White) |
| 90 | - .opacity(item.choose?0:0.7) | 96 | + .opacity(item.choose?0:0.6) |
| 91 | .borderRadius(5) | 97 | .borderRadius(5) |
| 92 | } | 98 | } |
| 93 | } | 99 | } |
| @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage { | @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage { | ||
| 122 | .borderRadius('10lpx') | 128 | .borderRadius('10lpx') |
| 123 | .width('662lpx') | 129 | .width('662lpx') |
| 124 | .height('84lpx') | 130 | .height('84lpx') |
| 131 | + Image('') | ||
| 132 | + .width('662lpx') | ||
| 133 | + .height('84lpx') | ||
| 134 | + .backgroundColor(Color.White) | ||
| 135 | + .opacity(this.selectCount == 0 ? 0.6 : 0) | ||
| 136 | + .borderRadius('10lpx') | ||
| 125 | .onClick(()=>{ | 137 | .onClick(()=>{ |
| 138 | + if (this.selectCount == 0) { | ||
| 139 | + promptAction.showToast({ | ||
| 140 | + message : '请先选择您感兴趣的内容哦', | ||
| 141 | + duration: 2000, | ||
| 142 | + bottom: 50 | ||
| 143 | + }) | ||
| 144 | + return | ||
| 145 | + } | ||
| 126 | this.saveTagIds() | 146 | this.saveTagIds() |
| 127 | //跳转首页 | 147 | //跳转首页 |
| 128 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 148 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
1.73 KB
-
Please register or login to post a comment