zhenghy
@@ -11,7 +11,7 @@ import { UserInfoDTO } from './UserInfoDTO' @@ -11,7 +11,7 @@ import { UserInfoDTO } from './UserInfoDTO'
11 * http://192.168.1.3:3300/project/3802/interface/api/200915 11 * http://192.168.1.3:3300/project/3802/interface/api/200915
12 */ 12 */
13 export interface ContentDetailDTO { 13 export interface ContentDetailDTO {
14 - newsId: string; 14 + newsId: number;
15 newsTitle: string; 15 newsTitle: string;
16 newsShortTitle: string; 16 newsShortTitle: string;
17 newsDownTitle: string; 17 newsDownTitle: string;
@@ -42,8 +42,8 @@ export interface ContentDetailDTO { @@ -42,8 +42,8 @@ export interface ContentDetailDTO {
42 videoInfo: VideoInfoDTO[]; 42 videoInfo: VideoInfoDTO[];
43 liveInfo?: any; 43 liveInfo?: any;
44 voteInfo?: any; 44 voteInfo?: any;
45 - rmhInfo?: RmhInfoDTO;  
46 - userInfo?: UserInfoDTO; 45 + rmhInfo?: RmhInfoDTO | null;
  46 + userInfo?: UserInfoDTO | null;
47 openLikes: number; 47 openLikes: number;
48 openComment: number; 48 openComment: number;
49 likesStyle: number; 49 likesStyle: number;
@@ -68,4 +68,7 @@ export interface ContentDetailDTO { @@ -68,4 +68,7 @@ export interface ContentDetailDTO {
68 timeline?: any; 68 timeline?: any;
69 traceInfo: string; 69 traceInfo: string;
70 viewCount: number; 70 viewCount: number;
  71 + isNewspaper: boolean;
  72 + oldNewsId: string;
  73 + serials: any;
71 } 74 }
@@ -2,7 +2,7 @@ export interface FullColumnImgUrlDTO { @@ -2,7 +2,7 @@ export interface FullColumnImgUrlDTO {
2 format?: any; 2 format?: any;
3 height: number; 3 height: number;
4 landscape: number; 4 landscape: number;
5 - size: number; 5 + size: number | null;
6 url: string; 6 url: string;
7 weight: number; 7 weight: number;
8 } 8 }
@@ -9,12 +9,10 @@ export struct MultiPictureDetailItemComponent { @@ -9,12 +9,10 @@ export struct MultiPictureDetailItemComponent {
9 Stack() { 9 Stack() {
10 Image(this.MultiPictureDetailItem.picPath) 10 Image(this.MultiPictureDetailItem.picPath)
11 .width('100%') 11 .width('100%')
12 - .aspectRatio(378 / 566) 12 + .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)
13 .objectFit(ImageFit.Fill) 13 .objectFit(ImageFit.Fill)
14 } 14 }
15 - .padding({ top: 16, right: 16, bottom: 16, left: 16 })  
16 - .margin({ left: 10, right: 10 })  
17 - .backgroundColor(Color.White) 15 + .backgroundColor(Color.Black)
18 .width('100%') 16 .width('100%')
19 } 17 }
20 } 18 }
@@ -8,6 +8,7 @@ import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemCompone @@ -8,6 +8,7 @@ import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemCompone
8 8
9 const TAG = 'MultiPictureDetailPageComponent'; 9 const TAG = 'MultiPictureDetailPageComponent';
10 10
  11 +@Preview
11 @Component 12 @Component
12 export struct MultiPictureDetailPageComponent { 13 export struct MultiPictureDetailPageComponent {
13 private displayTool = display.getDefaultDisplaySync() 14 private displayTool = display.getDefaultDisplaySync()
@@ -17,7 +18,7 @@ export struct MultiPictureDetailPageComponent { @@ -17,7 +18,7 @@ export struct MultiPictureDetailPageComponent {
17 @State relId: string = '500005189942' 18 @State relId: string = '500005189942'
18 @State contentId: string = '30043715146' 19 @State contentId: string = '30043715146'
19 @State relType: string = '1' 20 @State relType: string = '1'
20 - @State contentDetailData: ContentDetailDTO[] = [{}] as ContentDetailDTO[] 21 + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]
21 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 22 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
22 private swiperController: SwiperController = new SwiperController() 23 private swiperController: SwiperController = new SwiperController()
23 @State swiperIndex: number = 0; 24 @State swiperIndex: number = 0;
@@ -50,47 +51,42 @@ export struct MultiPictureDetailPageComponent { @@ -50,47 +51,42 @@ export struct MultiPictureDetailPageComponent {
50 51
51 build() { 52 build() {
52 RelativeContainer() { 53 RelativeContainer() {
53 - RelativeContainer() {  
54 - if (this.contentDetailData?.[0].photoList?.length > 0) {  
55 - Swiper(this.swiperController) {  
56 - ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => {  
57 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })  
58 - })  
59 - }  
60 - .index(this.swiperIndex)  
61 - .width('100%')  
62 - .height(px2vp(this.picHeight) + 32)  
63 - .vertical(true)  
64 - .autoPlay(false)  
65 - .cachedCount(3)  
66 - .indicator(false)  
67 - .displayCount(1)  
68 - .margin({ top: 35, left: 10, right: 10 })  
69 - .id('e_picture_content')  
70 - .alignRules({  
71 - top: { anchor: "e_picture_container", align: VerticalAlign.Bottom },  
72 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
73 - })  
74 - .onChange((index: number) => {  
75 - this.swiperIndex = index 54 + if (this.contentDetailData && this.contentDetailData.length > 0 && this.contentDetailData[0].photoList && this.contentDetailData[0].photoList?.length > 0) {
  55 + Swiper(this.swiperController) {
  56 + ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => {
  57 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
76 }) 58 })
77 } 59 }
  60 + .index(this.swiperIndex)
  61 + .width('100%')
  62 + .height(px2vp(this.picHeight) + 32)
  63 + .vertical(false)
  64 + .autoPlay(false)
  65 + .cachedCount(3)
  66 + .indicator(false)
  67 + .displayCount(1)
  68 + .id('e_swiper_content')
  69 + .alignRules({
  70 + top: { anchor: "__container__", align: VerticalAlign.Top },
  71 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  72 + })
  73 + .onChange((index: number) => {
  74 + this.swiperIndex = index
  75 + })
78 } 76 }
79 - RelativeContainer() {  
80 - OperRowListView()  
81 - .alignRules({  
82 - top: { anchor: "e_picture_container", align: VerticalAlign.Bottom },  
83 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
84 - })  
85 - } 77 + OperRowListView()
  78 + .alignRules({
  79 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  80 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  81 + })
86 .width('100%') 82 .width('100%')
87 - .height(100)  
88 - .margin({ left: 20 })  
89 - .border({ width: 2, color: '#6699FF' }) 83 + .height(56)
  84 + .border({ width: {top: 0.5}, color: '#FFFFFF' })
  85 + .id('e_oper_row')
90 } 86 }
91 .width('100%') 87 .width('100%')
92 .height('100%') 88 .height('100%')
93 - .backgroundColor($r('app.color.color_80000000')) 89 + .backgroundColor(Color.Black)
94 .id('e_picture_container') 90 .id('e_picture_container')
95 } 91 }
96 92
@@ -2,17 +2,12 @@ import { ToastUtils, Logger } from 'wdKit'; @@ -2,17 +2,12 @@ import { ToastUtils, Logger } from 'wdKit';
2 2
3 export interface OperationItem { 3 export interface OperationItem {
4 icon: Resource; 4 icon: Resource;
5 -  
6 - // icon_selected: Resource;  
7 text: string | Resource; 5 text: string | Resource;
8 num?: number; // 个数 6 num?: number; // 个数
9 } 7 }
10 8
11 -const FULL_PARENT: string = '100%';  
12 -  
13 const TAG = 'OperRowListView'; 9 const TAG = 'OperRowListView';
14 10
15 -@Entry  
16 @Component 11 @Component
17 export struct OperRowListView { 12 export struct OperRowListView {
18 @State operationList: OperationItem[] = [ 13 @State operationList: OperationItem[] = [
@@ -41,32 +36,16 @@ export struct OperRowListView { @@ -41,32 +36,16 @@ export struct OperRowListView {
41 } 36 }
42 37
43 build() { 38 build() {
44 - // List({ space: 0, initialIndex: 0 }) {  
45 - // ForEach(this.operationList, (item: OperationItem, index: number) => {  
46 - // ListItem() {  
47 - // this.buildOperationItem(item, index)  
48 - // }  
49 - // }, (item: OperationItem, index: number) => JSON.stringify(item))  
50 - // }  
51 - // .width(48)  
52 - // .height(250)  
53 - // // .margin({ bottom: 100 })  
54 - // .backgroundColor(Color.Red)  
55 - // // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical  
56 - // // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1  
57 - // .cachedCount(2)  
58 - // .scrollBar(BarState.Off)  
59 - // .nestedScroll({  
60 - // scrollForward: NestedScrollMode.PARENT_FIRST,  
61 - // scrollBackward: NestedScrollMode.SELF_FIRST  
62 - // })  
63 39
64 - Column() { 40 + Row() {
65 ForEach(this.operationList, (item: OperationItem, index: number) => { 41 ForEach(this.operationList, (item: OperationItem, index: number) => {
66 this.buildOperationItem(item, index) 42 this.buildOperationItem(item, index)
67 }, (item: OperationItem, index: number) => JSON.stringify(item)) 43 }, (item: OperationItem, index: number) => JSON.stringify(item))
68 } 44 }
69 - .width(48) 45 + .width('100%')
  46 + .height('100%')
  47 + .alignItems(VerticalAlign.Center)
  48 + .justifyContent(FlexAlign.Center)
70 } 49 }
71 50
72 /** 51 /**
@@ -78,21 +57,11 @@ export struct OperRowListView { @@ -78,21 +57,11 @@ export struct OperRowListView {
78 buildOperationItem(item: OperationItem, index: number) { 57 buildOperationItem(item: OperationItem, index: number) {
79 Column() { 58 Column() {
80 Image(item.icon) 59 Image(item.icon)
81 - .width('100%') 60 + .width(24)
  61 + .height(24)
82 .aspectRatio(1) 62 .aspectRatio(1)
83 - // .borderRadius(6)  
84 -  
85 - Text(item.text)  
86 - .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)  
87 - .fontWeight(FontWeight.Normal)  
88 - .textAlign(TextAlign.Center)  
89 - .fontSize(13)  
90 - .fontColor('#FFFFFF')  
91 - .maxLines(1)  
92 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
93 } 63 }
94 .margin(5) 64 .margin(5)
95 - // .backgroundColor(Color.Black)  
96 .alignItems(HorizontalAlign.Center) 65 .alignItems(HorizontalAlign.Center)
97 .hoverEffect(HoverEffect.Scale) 66 .hoverEffect(HoverEffect.Scale)
98 .onClick((event: ClickEvent) => { 67 .onClick((event: ClickEvent) => {
@@ -5,7 +5,7 @@ import { @@ -5,7 +5,7 @@ import {
5 CompInfoBean, 5 CompInfoBean,
6 ContentDetailDTO, 6 ContentDetailDTO,
7 InteractDataDTO, 7 InteractDataDTO,
8 - InteractDataStatusDTO, 8 + InteractDataStatusBean,
9 MorningEveningPaperDTO, 9 MorningEveningPaperDTO,
10 NavigationBodyDTO, 10 NavigationBodyDTO,
11 NewspaperListBean, 11 NewspaperListBean,
@@ -172,7 +172,7 @@ export class PageRepository { @@ -172,7 +172,7 @@ export class PageRepository {
172 static fetchInteractDataStatus(param: object) { 172 static fetchInteractDataStatus(param: object) {
173 let url = PageRepository.getInteractDataStatusUrl() 173 let url = PageRepository.getInteractDataStatusUrl()
174 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 174 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
175 - return WDHttp.post<ResponseDTO<InteractDataStatusDTO[]>>(url, param, headers) 175 + return WDHttp.post<ResponseDTO<InteractDataStatusBean[]>>(url, param, headers)
176 }; 176 };
177 177
178 // 浏览历史新增、删除接口 178 // 浏览历史新增、删除接口
@@ -33,8 +33,8 @@ export struct DetailPlayShortVideoPage { @@ -33,8 +33,8 @@ export struct DetailPlayShortVideoPage {
33 @Provide newsSourceName?: string = '' 33 @Provide newsSourceName?: string = ''
34 @Provide newsTitle?: string = '' 34 @Provide newsTitle?: string = ''
35 @Provide editorName?: string = '' 35 @Provide editorName?: string = ''
36 - @Provide rmhInfo?: RmhInfoDTO = undefined  
37 - @Provide userInfo?: UserInfoDTO = undefined 36 + @Provide rmhInfo?: RmhInfoDTO | null = null
  37 + @Provide userInfo?: UserInfoDTO | null = null
38 @Provide message?: string = '' 38 @Provide message?: string = ''
39 @Provide newsSummary?: string = '' 39 @Provide newsSummary?: string = ''
40 @Provide progressVal: number = 0; 40 @Provide progressVal: number = 0;
@@ -15,8 +15,8 @@ export class PlayViewModel { @@ -15,8 +15,8 @@ export class PlayViewModel {
15 newsTitle?: string 15 newsTitle?: string
16 editorName?: string 16 editorName?: string
17 newsSummary?: string 17 newsSummary?: string
18 - rmhInfo?: RmhInfoDTO  
19 - userInfo?: UserInfoDTO 18 + rmhInfo?: RmhInfoDTO | null
  19 + userInfo?: UserInfoDTO | null
20 url?: string 20 url?: string
21 // 视频朝向, 21 // 视频朝向,
22 // 横屏视频:1(进入竖屏,立即展示半屏播放窗口,当切换横屏时,再展示全部播放窗口;后续可再转换到竖屏): 22 // 横屏视频:1(进入竖屏,立即展示半屏播放窗口,当切换横屏时,再展示全部播放窗口;后续可再转换到竖屏):