Showing
14 changed files
with
329 additions
and
69 deletions
| @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 33 | Stack(){ | 33 | Stack(){ |
| 34 | Image(this.headPhotoUrl) | 34 | Image(this.headPhotoUrl) |
| 35 | .alt($r('app.media.default_head')) | 35 | .alt($r('app.media.default_head')) |
| 36 | - .width('108lpx') | ||
| 37 | - .height('108lpx') | 36 | + .width('100lpx') |
| 37 | + .height('100lpx') | ||
| 38 | .objectFit(ImageFit.Cover) | 38 | .objectFit(ImageFit.Cover) |
| 39 | .borderRadius(50) | 39 | .borderRadius(50) |
| 40 | Image(this.levelHead) | 40 | Image(this.levelHead) |
| @@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{ | @@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{ | ||
| 18 | value.forEach((element)=>{ | 18 | value.forEach((element)=>{ |
| 19 | this.data.push(element) | 19 | this.data.push(element) |
| 20 | }) | 20 | }) |
| 21 | - console.log("ycg",this.data.length.toString()); | 21 | + |
| 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ | 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ |
| 23 | //个人主页 跳转 关注页 tab 2 | 23 | //个人主页 跳转 关注页 tab 2 |
| 24 | let intervalID = setInterval(() => { | 24 | let intervalID = setInterval(() => { |
| @@ -171,6 +171,7 @@ struct ChildComponent { | @@ -171,6 +171,7 @@ struct ChildComponent { | ||
| 171 | .fontSize('31lpx') | 171 | .fontSize('31lpx') |
| 172 | .lineHeight('38lpx') | 172 | .lineHeight('38lpx') |
| 173 | .fontColor($r('app.color.color_222222')) | 173 | .fontColor($r('app.color.color_222222')) |
| 174 | + .maxLines(1) | ||
| 174 | Text(`粉丝${this.data.cnFansNum}`) | 175 | Text(`粉丝${this.data.cnFansNum}`) |
| 175 | .fontColor($r('app.color.color_B0B0B0')) | 176 | .fontColor($r('app.color.color_B0B0B0')) |
| 176 | .fontSize('23lpx') | 177 | .fontSize('23lpx') |
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowSecondTabsComponent.ets
| @@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{ | @@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{ | ||
| 35 | 35 | ||
| 36 | @Builder FollowSecondUI(){ | 36 | @Builder FollowSecondUI(){ |
| 37 | Row() { | 37 | Row() { |
| 38 | + Row(){ | ||
| 39 | + // 页签 | ||
| 40 | + Column({ space: 7 }) { | ||
| 41 | + Scroll() { | ||
| 42 | + Column() { | ||
| 43 | + ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { | ||
| 44 | + this.TabBuilder(index,item) | ||
| 45 | + }) | ||
| 46 | + } | ||
| 47 | + .justifyContent(FlexAlign.Start) | ||
| 48 | + } | ||
| 49 | + .align(Alignment.Top) | ||
| 50 | + .scrollable(ScrollDirection.Vertical) | ||
| 51 | + .scrollBar(BarState.Off) | ||
| 52 | + .height('100%') | ||
| 53 | + }.height('100%') | ||
| 54 | + .alignItems(HorizontalAlign.Center) | ||
| 55 | + } | ||
| 56 | + .alignItems(VerticalAlign.Top) | ||
| 57 | + .height('100%') | ||
| 58 | + | ||
| 38 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 59 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 39 | ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { | 60 | ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { |
| 40 | TabContent(){ | 61 | TabContent(){ |
| 41 | FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) | 62 | FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) |
| 42 | - }.tabBar(this.TabBuilder(index,item)) | 63 | + } |
| 43 | .backgroundColor($r('app.color.white')) | 64 | .backgroundColor($r('app.color.white')) |
| 44 | }, (item: FollowListItem, index: number) => index.toString()) | 65 | }, (item: FollowListItem, index: number) => index.toString()) |
| 45 | } | 66 | } |
| 46 | .vertical(true) | 67 | .vertical(true) |
| 47 | .barMode(BarMode.Scrollable) | 68 | .barMode(BarMode.Scrollable) |
| 48 | - .barWidth('140lpx') | ||
| 49 | .animationDuration(0) | 69 | .animationDuration(0) |
| 50 | .onChange((index: number) => { | 70 | .onChange((index: number) => { |
| 51 | this.currentIndex = index | 71 | this.currentIndex = index |
| 52 | }) | 72 | }) |
| 53 | - .width('100%') | 73 | + .barWidth(0) |
| 74 | + .height('100%') | ||
| 75 | + .layoutWeight(1) | ||
| 54 | }.width('100%') | 76 | }.width('100%') |
| 55 | - .alignItems(VerticalAlign.Top) | ||
| 56 | - .backgroundColor('#0FF') | ||
| 57 | } | 77 | } |
| 58 | 78 | ||
| 59 | @Builder TabBuilder(index: number, item: FollowSecondListItem) { | 79 | @Builder TabBuilder(index: number, item: FollowSecondListItem) { |
| @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ | @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ | ||
| 73 | }) | 93 | }) |
| 74 | .justifyContent(FlexAlign.Center) | 94 | .justifyContent(FlexAlign.Center) |
| 75 | .height('84lpx') | 95 | .height('84lpx') |
| 96 | + .width('140lpx') | ||
| 76 | .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) | 97 | .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) |
| 77 | } | 98 | } |
| 78 | 99 |
| @@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{ | @@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{ | ||
| 34 | .lineHeight('38lpx') | 34 | .lineHeight('38lpx') |
| 35 | .backgroundColor($r('app.color.color_F9F9F9')) | 35 | .backgroundColor($r('app.color.color_F9F9F9')) |
| 36 | .padding('13lpx') | 36 | .padding('13lpx') |
| 37 | + .maxLines(1) | ||
| 37 | } | 38 | } |
| 38 | .onClick(()=>{ | 39 | .onClick(()=>{ |
| 39 | this.currentIndex = index | 40 | this.currentIndex = index |
| 40 | this.controller.changeIndex(this.currentIndex) | 41 | this.controller.changeIndex(this.currentIndex) |
| 41 | }) | 42 | }) |
| 42 | - .height('100%') | 43 | + .height('84lpx') |
| 43 | .margin({right:'9lpx'}) | 44 | .margin({right:'9lpx'}) |
| 44 | .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) | 45 | .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) |
| 45 | .justifyContent(FlexAlign.Center) | 46 | .justifyContent(FlexAlign.Center) |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | @Builder FollowThirdUI(){ | 49 | @Builder FollowThirdUI(){ |
| 49 | - Row() { | 50 | + |
| 51 | + Column(){ | ||
| 52 | + Column() { | ||
| 53 | + // 页签 | ||
| 54 | + Row({ space: 7 }) { | ||
| 55 | + Scroll() { | ||
| 56 | + Row() { | ||
| 57 | + ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | ||
| 58 | + this.TabBuilder(index,item) | ||
| 59 | + }) | ||
| 60 | + } | ||
| 61 | + .justifyContent(FlexAlign.Start) | ||
| 62 | + } | ||
| 63 | + .align(Alignment.Start) | ||
| 64 | + .scrollable(ScrollDirection.Horizontal) | ||
| 65 | + .scrollBar(BarState.Off) | ||
| 66 | + .width('90%') | ||
| 67 | + .padding({left:'11lpx'}) | ||
| 68 | + } | ||
| 69 | + .alignItems(VerticalAlign.Bottom) | ||
| 70 | + .width('100%') | ||
| 71 | + } | ||
| 72 | + .backgroundColor($r('app.color.white')) | ||
| 73 | + .alignItems(HorizontalAlign.Start) | ||
| 74 | + .width('100%') | ||
| 75 | + | ||
| 50 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 76 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 51 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | 77 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { |
| 52 | TabContent(){ | 78 | TabContent(){ |
| @@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{ | @@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{ | ||
| 58 | .margin({left:'20lpx'}) | 84 | .margin({left:'20lpx'}) |
| 59 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) | 85 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) |
| 60 | } | 86 | } |
| 61 | - }.tabBar(this.TabBuilder(index,item)) | 87 | + } |
| 62 | .backgroundColor($r('app.color.white')) | 88 | .backgroundColor($r('app.color.white')) |
| 63 | }, (item: FollowListItem, index: number) => index.toString()) | 89 | }, (item: FollowListItem, index: number) => index.toString()) |
| 64 | } | 90 | } |
| 91 | + .barHeight(0) | ||
| 65 | .vertical(false) | 92 | .vertical(false) |
| 66 | .barMode(BarMode.Scrollable) | 93 | .barMode(BarMode.Scrollable) |
| 67 | - .barWidth('100%') | ||
| 68 | - .barHeight('84lpx') | ||
| 69 | .animationDuration(0) | 94 | .animationDuration(0) |
| 70 | .onChange((index: number) => { | 95 | .onChange((index: number) => { |
| 71 | this.currentIndex = index | 96 | this.currentIndex = index |
| 72 | }) | 97 | }) |
| 73 | .width('100%') | 98 | .width('100%') |
| 74 | - }.width('100%') | 99 | + } |
| 75 | } | 100 | } |
| 76 | 101 | ||
| 77 | } | 102 | } |
| 1 | - | ||
| 2 | -import { Logger, DateTimeUtils, CollectionUtils } from 'wdKit'; | 1 | +import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; |
| 3 | import { CommonConstants, CompStyle, ViewType } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle, ViewType } from 'wdConstant'; |
| 4 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 5 | import { EmptyComponent } from '../view/EmptyComponent'; | 4 | import { EmptyComponent } from '../view/EmptyComponent'; |
| @@ -14,7 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | @@ -14,7 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 14 | import { CompParser } from '../CompParser'; | 13 | import { CompParser } from '../CompParser'; |
| 15 | import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; | 14 | import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; |
| 16 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 15 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 17 | -import { CompDTO, LiveReviewDTO, PageDTO ,PageInfoDTO} from 'wdBean'; | 16 | +import { CompDTO, LiveReviewDTO, PageDTO, PageInfoBean } from 'wdBean'; |
| 18 | 17 | ||
| 19 | 18 | ||
| 20 | const TAG = 'PageComponent'; | 19 | const TAG = 'PageComponent'; |
| @@ -158,6 +157,16 @@ export struct PageComponent { | @@ -158,6 +157,16 @@ export struct PageComponent { | ||
| 158 | this.pageModel.viewType = ViewType.EMPTY; | 157 | this.pageModel.viewType = ViewType.EMPTY; |
| 159 | return; | 158 | return; |
| 160 | } | 159 | } |
| 160 | + if (this.navIndex === 0) { | ||
| 161 | + await this.getVideoListData(pageInfo); | ||
| 162 | + } else { | ||
| 163 | + await this.getLiveListData(pageInfo); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + private async getVideoListData(pageInfo: PageInfoBean) { | ||
| 161 | let groupInfo: GroupInfoDTO = CollectionUtils.getElement(pageInfo.groups, 0); | 170 | let groupInfo: GroupInfoDTO = CollectionUtils.getElement(pageInfo.groups, 0); |
| 162 | if (groupInfo != null) { | 171 | if (groupInfo != null) { |
| 163 | this.pageModel.isRecGroup = groupInfo.groupStrategy === 1; | 172 | this.pageModel.isRecGroup = groupInfo.groupStrategy === 1; |
| @@ -165,7 +174,89 @@ export struct PageComponent { | @@ -165,7 +174,89 @@ export struct PageComponent { | ||
| 165 | } | 174 | } |
| 166 | // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | 175 | // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 |
| 167 | // for (const group of pageInfo.groups) { | 176 | // for (const group of pageInfo.groups) { |
| 168 | - this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)) | 177 | + this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)); |
| 178 | + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString(); | ||
| 179 | + if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | ||
| 180 | + this.pageDto.compList.forEach((comp) => { | ||
| 181 | + if (comp.compStyle === CompStyle.Zh_Grid_Layout_02 && this.liveReviewDTO && this.liveReviewDTO.list && this.liveReviewDTO.list.length > 0) { | ||
| 182 | + comp.operDataList.push(...this.liveReviewDTO.list); | ||
| 183 | + } | ||
| 184 | + }); | ||
| 185 | + | ||
| 186 | + this.pageModel.viewType = ViewType.LOADED; | ||
| 187 | + this.pageModel.compList.push(...this.pageDto.compList); | ||
| 188 | + if (this.pageDto.compList.length === this.pageModel.pageSize) { | ||
| 189 | + this.pageModel.currentPage++; | ||
| 190 | + this.pageModel.hasMore = true; | ||
| 191 | + } else { | ||
| 192 | + this.pageModel.hasMore = false; | ||
| 193 | + } | ||
| 194 | + // // 二次请求,批查互动数据 | ||
| 195 | + // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 196 | + // // 刷新,替换所有数据 | ||
| 197 | + // this.pageModel.compList.replaceAll(...data) | ||
| 198 | + // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 199 | + // }) | ||
| 200 | + this.isFirstIn = false; | ||
| 201 | + Logger.debug(TAG, 'cj111'); | ||
| 202 | + // } else { | ||
| 203 | + // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 204 | + // this.pageModel.viewType = ViewType.EMPTY; | ||
| 205 | + // } | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + // private async getLiveListData(pageInfo: PageInfoBean) { | ||
| 210 | + // // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | ||
| 211 | + // for (const group of pageInfo.groups) { | ||
| 212 | + // this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)); | ||
| 213 | + // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString(); | ||
| 214 | + // if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | ||
| 215 | + // this.pageDto.compList.forEach((comp) => { | ||
| 216 | + // if (comp.compStyle === CompStyle.Zh_Grid_Layout_02 && this.liveReviewDTO && this.liveReviewDTO.list && this.liveReviewDTO.list.length > 0) { | ||
| 217 | + // comp.operDataList.push(...this.liveReviewDTO.list); | ||
| 218 | + // } | ||
| 219 | + // }); | ||
| 220 | + // | ||
| 221 | + // this.pageModel.viewType = ViewType.LOADED; | ||
| 222 | + // this.pageModel.compList.push(...this.pageDto.compList); | ||
| 223 | + // if (this.pageDto.compList.length === this.pageModel.pageSize) { | ||
| 224 | + // this.pageModel.currentPage++; | ||
| 225 | + // this.pageModel.hasMore = true; | ||
| 226 | + // } else { | ||
| 227 | + // this.pageModel.hasMore = false; | ||
| 228 | + // } | ||
| 229 | + // // // 二次请求,批查互动数据 | ||
| 230 | + // // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 231 | + // // // 刷新,替换所有数据 | ||
| 232 | + // // this.pageModel.compList.replaceAll(...data) | ||
| 233 | + // // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 234 | + // // }) | ||
| 235 | + // this.isFirstIn = false; | ||
| 236 | + // Logger.debug(TAG, 'cj111'); | ||
| 237 | + // // } else { | ||
| 238 | + // // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 239 | + // // this.pageModel.viewType = ViewType.EMPTY; | ||
| 240 | + // } | ||
| 241 | + // } | ||
| 242 | + // } | ||
| 243 | + | ||
| 244 | + async getLiveListData(pageInfo: PageInfoBean) { | ||
| 245 | + // Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 246 | + // this.pageModel.pageId = this.pageId; | ||
| 247 | + // this.pageModel.groupId = this.pageId; | ||
| 248 | + // this.pageModel.channelId = this.channelId; | ||
| 249 | + // this.pageModel.currentPage = 1; | ||
| 250 | + // let pageInfo = await PageViewModel.getPageUrlData(this.pageModel.pageId); | ||
| 251 | + // if (pageInfo == null) { | ||
| 252 | + // this.pageModel.viewType = ViewType.EMPTY; | ||
| 253 | + // return; | ||
| 254 | + // } | ||
| 255 | + Logger.debug(TAG, 'getPageUrlData ' + pageInfo.id); | ||
| 256 | + // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | ||
| 257 | + for (const group of pageInfo.groups) { | ||
| 258 | + this.pageDto = await PageViewModel.getLivePageData(this.pageModel.pageId, `${group.id}`, this.pageModel.channelId, group.groupStrategy | ||
| 259 | + , this.pageModel.currentPage, this.pageModel.pageSize, getContext(this)) | ||
| 169 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | 260 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() |
| 170 | if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | 261 | if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { |
| 171 | this.pageDto.compList.forEach((comp) => { | 262 | this.pageDto.compList.forEach((comp) => { |
| @@ -189,12 +280,11 @@ export struct PageComponent { | @@ -189,12 +280,11 @@ export struct PageComponent { | ||
| 189 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | 280 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() |
| 190 | }) | 281 | }) |
| 191 | this.isFirstIn = false | 282 | this.isFirstIn = false |
| 192 | - // } else { | ||
| 193 | - // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 194 | - // this.pageModel.viewType = ViewType.EMPTY; | ||
| 195 | - // } | 283 | + } else { |
| 284 | + Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 285 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 286 | + } | ||
| 196 | } | 287 | } |
| 197 | - | ||
| 198 | } | 288 | } |
| 199 | 289 | ||
| 200 | async getPreviewData() { | 290 | async getPreviewData() { |
| 1 | +import { SearchResultContentComponent } from './SearchResultContentComponent' | ||
| 1 | 2 | ||
| 2 | const TAG = "SearchResultComponent" | 3 | const TAG = "SearchResultComponent" |
| 3 | /** | 4 | /** |
| @@ -19,7 +20,7 @@ export struct SearchResultComponent{ | @@ -19,7 +20,7 @@ export struct SearchResultComponent{ | ||
| 19 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 20 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 20 | ForEach(this.count, (item: string, index: number ) => { | 21 | ForEach(this.count, (item: string, index: number ) => { |
| 21 | TabContent(){ | 22 | TabContent(){ |
| 22 | - Text(item) | 23 | + SearchResultContentComponent() |
| 23 | }.tabBar(this.TabBuilder(index,item)) | 24 | }.tabBar(this.TabBuilder(index,item)) |
| 24 | }, (item: string, index: number) => index.toString()) | 25 | }, (item: string, index: number) => index.toString()) |
| 25 | } | 26 | } |
| @@ -63,4 +64,5 @@ export struct SearchResultComponent{ | @@ -63,4 +64,5 @@ export struct SearchResultComponent{ | ||
| 63 | .margin({right:'9lpx'}) | 64 | .margin({right:'9lpx'}) |
| 64 | .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"}) | 65 | .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"}) |
| 65 | } | 66 | } |
| 67 | + | ||
| 66 | } | 68 | } |
| @@ -2,6 +2,7 @@ import router from '@ohos.router' | @@ -2,6 +2,7 @@ import router from '@ohos.router' | ||
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | import { StringUtils } from 'wdKit'; | 3 | import { StringUtils } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | +import { CardParser } from '../components/CardParser'; | ||
| 5 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; | 6 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; |
| 6 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 7 | 8 | ||
| @@ -182,21 +183,46 @@ struct MineHomePage { | @@ -182,21 +183,46 @@ struct MineHomePage { | ||
| 182 | 183 | ||
| 183 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 184 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 184 | 185 | ||
| 185 | - //tab 页面 | ||
| 186 | - Tabs({controller: this.controller}) { | ||
| 187 | - TabContent() { | ||
| 188 | - HomePageBottomComponent({style:0}) | ||
| 189 | - }.tabBar(this.TabBuilder(0,"评论")) | ||
| 190 | - TabContent() { | ||
| 191 | - HomePageBottomComponent({style:1}) | ||
| 192 | - }.tabBar(this.TabBuilder(1,"关注")) | 186 | + Column(){ |
| 187 | + Column() { | ||
| 188 | + // 页签 | ||
| 189 | + Row({ space: 7 }) { | ||
| 190 | + Scroll() { | ||
| 191 | + Row() { | ||
| 192 | + this.TabBuilder(0,"评论") | ||
| 193 | + this.TabBuilder(1,"关注") | ||
| 194 | + } | ||
| 195 | + .justifyContent(FlexAlign.Start) | ||
| 196 | + } | ||
| 197 | + .align(Alignment.Start) | ||
| 198 | + .scrollable(ScrollDirection.Horizontal) | ||
| 199 | + .scrollBar(BarState.Off) | ||
| 200 | + .width('90%') | ||
| 201 | + .padding({left:'31lpx'}) | ||
| 202 | + } | ||
| 203 | + .alignItems(VerticalAlign.Bottom) | ||
| 204 | + .width('100%') | ||
| 205 | + } | ||
| 206 | + .alignItems(HorizontalAlign.Start) | ||
| 207 | + .width('100%') | ||
| 208 | + | ||
| 209 | + //tab 页面 | ||
| 210 | + Tabs({controller: this.controller}) { | ||
| 211 | + TabContent() { | ||
| 212 | + HomePageBottomComponent({style:0}) | ||
| 213 | + } | ||
| 214 | + TabContent() { | ||
| 215 | + HomePageBottomComponent({style:1}) | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + .backgroundColor($r('app.color.white')) | ||
| 219 | + .animationDuration(0) | ||
| 220 | + .onChange((index: number) => { | ||
| 221 | + this.currentIndex = index | ||
| 222 | + }) | ||
| 223 | + .vertical(false) | ||
| 224 | + .barHeight(0) | ||
| 193 | } | 225 | } |
| 194 | - .backgroundColor($r('app.color.white')) | ||
| 195 | - .animationDuration(0) | ||
| 196 | - .onChange((index: number) => { | ||
| 197 | - this.currentIndex = index | ||
| 198 | - }) | ||
| 199 | - .vertical(false) | ||
| 200 | }.width("100%") | 226 | }.width("100%") |
| 201 | } | 227 | } |
| 202 | .edgeEffect(EdgeEffect.None) | 228 | .edgeEffect(EdgeEffect.None) |
| @@ -206,8 +232,8 @@ struct MineHomePage { | @@ -206,8 +232,8 @@ struct MineHomePage { | ||
| 206 | } | 232 | } |
| 207 | }.width('100%') | 233 | }.width('100%') |
| 208 | .layoutWeight(1) | 234 | .layoutWeight(1) |
| 209 | - | ||
| 210 | } | 235 | } |
| 236 | + | ||
| 211 | @Builder MineHomeTitleTransparent() { | 237 | @Builder MineHomeTitleTransparent() { |
| 212 | RelativeContainer() { | 238 | RelativeContainer() { |
| 213 | //标题栏目 | 239 | //标题栏目 |
| @@ -342,9 +368,9 @@ struct MineHomePage { | @@ -342,9 +368,9 @@ struct MineHomePage { | ||
| 342 | this.currentIndex = index | 368 | this.currentIndex = index |
| 343 | this.controller.changeIndex(this.currentIndex) | 369 | this.controller.changeIndex(this.currentIndex) |
| 344 | }) | 370 | }) |
| 345 | - .height('100%') | ||
| 346 | - .width('100%') | ||
| 347 | - .margin({right:'9lpx'}) | 371 | + .height('77lpx') |
| 372 | + .width('70lpx') | ||
| 373 | + .margin({right:'29lpx'}) | ||
| 348 | } | 374 | } |
| 349 | 375 | ||
| 350 | /** | 376 | /** |
| @@ -172,24 +172,51 @@ struct OtherNormalUserHomePage { | @@ -172,24 +172,51 @@ struct OtherNormalUserHomePage { | ||
| 172 | .width('100%') | 172 | .width('100%') |
| 173 | .backgroundColor($r('app.color.white')) | 173 | .backgroundColor($r('app.color.white')) |
| 174 | } | 174 | } |
| 175 | + | ||
| 175 | //间隔符 | 176 | //间隔符 |
| 176 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 177 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 177 | 178 | ||
| 178 | - //tab 页面 | ||
| 179 | - Tabs({controller: this.controller}) { | ||
| 180 | - TabContent() { | ||
| 181 | - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 182 | - }.tabBar(this.TabBuilder(0,"评论")) | ||
| 183 | - TabContent() { | ||
| 184 | - OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 185 | - }.tabBar(this.TabBuilder(1,"关注")) | 179 | + Column(){ |
| 180 | + Column() { | ||
| 181 | + // 页签 | ||
| 182 | + Row({ space: 7 }) { | ||
| 183 | + Scroll() { | ||
| 184 | + Row() { | ||
| 185 | + this.TabBuilder(0,"评论") | ||
| 186 | + this.TabBuilder(1,"关注") | ||
| 187 | + } | ||
| 188 | + .justifyContent(FlexAlign.Start) | ||
| 189 | + } | ||
| 190 | + .align(Alignment.Start) | ||
| 191 | + .scrollable(ScrollDirection.Horizontal) | ||
| 192 | + .scrollBar(BarState.Off) | ||
| 193 | + .width('90%') | ||
| 194 | + .padding({left:'31lpx'}) | ||
| 195 | + } | ||
| 196 | + .alignItems(VerticalAlign.Bottom) | ||
| 197 | + .width('100%') | ||
| 198 | + } | ||
| 199 | + .backgroundColor($r('app.color.white')) | ||
| 200 | + .alignItems(HorizontalAlign.Start) | ||
| 201 | + .width('100%') | ||
| 202 | + | ||
| 203 | + //tab 页面 | ||
| 204 | + Tabs({controller: this.controller}) { | ||
| 205 | + TabContent() { | ||
| 206 | + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 207 | + } | ||
| 208 | + TabContent() { | ||
| 209 | + OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | + .backgroundColor($r('app.color.white')) | ||
| 213 | + .animationDuration(0) | ||
| 214 | + .onChange((index: number) => { | ||
| 215 | + this.currentIndex = index | ||
| 216 | + }) | ||
| 217 | + .vertical(false) | ||
| 218 | + .barHeight(0) | ||
| 186 | } | 219 | } |
| 187 | - .backgroundColor($r('app.color.white')) | ||
| 188 | - .animationDuration(0) | ||
| 189 | - .onChange((index: number) => { | ||
| 190 | - this.currentIndex = index | ||
| 191 | - }) | ||
| 192 | - .vertical(false) | ||
| 193 | }.width("100%") | 220 | }.width("100%") |
| 194 | } | 221 | } |
| 195 | .edgeEffect(EdgeEffect.None) | 222 | .edgeEffect(EdgeEffect.None) |
| @@ -300,9 +327,9 @@ struct OtherNormalUserHomePage { | @@ -300,9 +327,9 @@ struct OtherNormalUserHomePage { | ||
| 300 | this.currentIndex = index | 327 | this.currentIndex = index |
| 301 | this.controller.changeIndex(this.currentIndex) | 328 | this.controller.changeIndex(this.currentIndex) |
| 302 | }) | 329 | }) |
| 303 | - .height('100%') | ||
| 304 | - .width('100%') | ||
| 305 | - .margin({right:'9lpx'}) | 330 | + .height('77lpx') |
| 331 | + .width('70lpx') | ||
| 332 | + .margin({right:'29lpx'}) | ||
| 306 | } | 333 | } |
| 307 | 334 | ||
| 308 | 335 |
| @@ -6,6 +6,7 @@ import { | @@ -6,6 +6,7 @@ import { | ||
| 6 | CompInfoBean, | 6 | CompInfoBean, |
| 7 | ContentDetailDTO, | 7 | ContentDetailDTO, |
| 8 | ContentDTO, | 8 | ContentDTO, |
| 9 | + contentListParams, | ||
| 9 | InteractDataDTO, | 10 | InteractDataDTO, |
| 10 | LiveReviewDTO, | 11 | LiveReviewDTO, |
| 11 | MorningEveningPaperDTO, | 12 | MorningEveningPaperDTO, |
| @@ -14,11 +15,10 @@ import { | @@ -14,11 +15,10 @@ import { | ||
| 14 | NewspaperTimeInfoBean, | 15 | NewspaperTimeInfoBean, |
| 15 | PageDTO, | 16 | PageDTO, |
| 16 | PageInfoBean, | 17 | PageInfoBean, |
| 18 | + PageInfoDTO, | ||
| 17 | postBatchAttentionStatusParams, | 19 | postBatchAttentionStatusParams, |
| 18 | postBatchAttentionStatusResult, | 20 | postBatchAttentionStatusResult, |
| 19 | postExecuteCollectRecordParams, | 21 | postExecuteCollectRecordParams, |
| 20 | - contentListParams, | ||
| 21 | - PageInfoDTO, | ||
| 22 | postExecuteLikeParams, | 22 | postExecuteLikeParams, |
| 23 | postInteractAccentionOperateParams, | 23 | postInteractAccentionOperateParams, |
| 24 | postRecommendListParams | 24 | postRecommendListParams |
| @@ -48,10 +48,10 @@ export class PageRepository { | @@ -48,10 +48,10 @@ export class PageRepository { | ||
| 48 | 48 | ||
| 49 | static getCompInfoUrl(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { | 49 | static getCompInfoUrl(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { |
| 50 | let url = HttpUrlUtils.getHost(); | 50 | let url = HttpUrlUtils.getHost(); |
| 51 | - if(1 == groupStrategy){ | 51 | + if (1 == groupStrategy) { |
| 52 | //推荐 | 52 | //推荐 |
| 53 | url = url + HttpUrlUtils.COMP_REC_PATH; | 53 | url = url + HttpUrlUtils.COMP_REC_PATH; |
| 54 | - }else{ | 54 | + } else { |
| 55 | //非推荐 | 55 | //非推荐 |
| 56 | url = url + HttpUrlUtils.COMP_PATH; | 56 | url = url + HttpUrlUtils.COMP_PATH; |
| 57 | } | 57 | } |
| @@ -194,8 +194,14 @@ export class PageRepository { | @@ -194,8 +194,14 @@ export class PageRepository { | ||
| 194 | return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers) | 194 | return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers) |
| 195 | }; | 195 | }; |
| 196 | 196 | ||
| 197 | - static fetchCompData(pageId: string, groupId: string, channelId: string,groupStrategy:number, currentPage: number, pageSize: number) { | ||
| 198 | - let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId,groupStrategy, currentPage, pageSize) | 197 | + static fetchLivePageData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { |
| 198 | + let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 199 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 200 | + return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) | ||
| 201 | + }; | ||
| 202 | + | ||
| 203 | + static fetchCompData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { | ||
| 204 | + let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 199 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 205 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 200 | return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) | 206 | return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) |
| 201 | }; | 207 | }; |
| @@ -7,11 +7,9 @@ import { | @@ -7,11 +7,9 @@ import { | ||
| 7 | MorningEveningPaperDTO, | 7 | MorningEveningPaperDTO, |
| 8 | NavigationBodyDTO, | 8 | NavigationBodyDTO, |
| 9 | PageDTO, | 9 | PageDTO, |
| 10 | - PageInfoBean, | ||
| 11 | - PageInfoDTO | 10 | + PageInfoBean |
| 12 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 13 | 12 | ||
| 14 | - | ||
| 15 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; | 13 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; |
| 16 | import { ResponseDTO, } from 'wdNetwork'; | 14 | import { ResponseDTO, } from 'wdNetwork'; |
| 17 | import { PageRepository } from '../repository/PageRepository'; | 15 | import { PageRepository } from '../repository/PageRepository'; |
| @@ -145,7 +143,36 @@ export class PageViewModel extends BaseViewModel { | @@ -145,7 +143,36 @@ export class PageViewModel extends BaseViewModel { | ||
| 145 | 143 | ||
| 146 | async getPageData(pageModel: PageModel, context?: Context): Promise<PageDTO> { | 144 | async getPageData(pageModel: PageModel, context?: Context): Promise<PageDTO> { |
| 147 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); | 145 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); |
| 148 | - return this.parseComp(PageRepository.fetchCompData(pageModel.pageId, pageModel.groupId, pageModel.channelId, pageModel.isRecGroup==true?1:0,pageModel.currentPage, pageModel.pageSize)) | 146 | + return this.parseComp(PageRepository.fetchCompData(pageModel.pageId, pageModel.groupId, pageModel.channelId, pageModel.isRecGroup == true ? 1 : 0, pageModel.currentPage, pageModel.pageSize)) |
| 147 | + } | ||
| 148 | + | ||
| 149 | + async getLivePageData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number | ||
| 150 | + , pageSize: number, context: Context): Promise<PageDTO> { | ||
| 151 | + Logger.debug(TAG, 'getPageData pageId: ' + pageId); | ||
| 152 | + if (mock_switch) { | ||
| 153 | + return this.getPageData1(currentPage, context); | ||
| 154 | + } | ||
| 155 | + return new Promise<PageDTO>((success, error) => { | ||
| 156 | + PageRepository.fetchLivePageData(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 157 | + .then((resDTO: ResponseDTO<PageDTO>) => { | ||
| 158 | + if (!resDTO || !resDTO.data) { | ||
| 159 | + Logger.error(TAG, 'getNavData then resDTO is empty'); | ||
| 160 | + error('resDTO is empty'); | ||
| 161 | + return | ||
| 162 | + } | ||
| 163 | + if (resDTO.code != 0) { | ||
| 164 | + Logger.error(TAG, `getNavData then code:${resDTO.code}, message:${resDTO.message}`); | ||
| 165 | + error('resDTO Response Code is failure'); | ||
| 166 | + return | ||
| 167 | + } | ||
| 168 | + Logger.info(TAG, "getNavData then,resDTO.timestamp:" + resDTO.timestamp); | ||
| 169 | + success(resDTO.data); | ||
| 170 | + }) | ||
| 171 | + .catch((err: Error) => { | ||
| 172 | + Logger.error(TAG, `getPageData catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 173 | + error(err); | ||
| 174 | + }) | ||
| 175 | + }) | ||
| 149 | } | 176 | } |
| 150 | 177 | ||
| 151 | private parseComp(getData: Promise<ResponseDTO<PageDTO>>): Promise<PageDTO> { | 178 | private parseComp(getData: Promise<ResponseDTO<PageDTO>>): Promise<PageDTO> { |
-
Please register or login to post a comment