张善主

Merge remote-tracking branch 'origin/main'

1 import { Action } from './Action'; 1 import { Action } from './Action';
2 2
  3 +interface IImgItem {
  4 + pic: string
  5 + width: number
  6 + height: number
  7 +}
  8 +
  9 +export interface IImgListData {
  10 + imgIndex: number
  11 + imgArr: IImgItem[]
  12 +}
  13 +
3 interface dataObject { 14 interface dataObject {
4 // dataSource: 15 // dataSource:
5 // 1、图文详情数据 16 // 1、图文详情数据
@@ -13,7 +24,7 @@ interface dataObject { @@ -13,7 +24,7 @@ interface dataObject {
13 // 9、活动投稿 视频跳转 24 // 9、活动投稿 视频跳转
14 // 10、活动投稿 动态跳转 25 // 10、活动投稿 动态跳转
15 // 11、活动投稿 图集跳转 26 // 11、活动投稿 图集跳转
16 - dataSource: number 27 + dataSource: string
17 operateType?: string 28 operateType?: string
18 webViewHeight?: string 29 webViewHeight?: string
19 dataJson?: string 30 dataJson?: string
@@ -27,6 +38,7 @@ interface dataObject { @@ -27,6 +38,7 @@ interface dataObject {
27 positionLeft?: string 38 positionLeft?: string
28 positionTop?: string 39 positionTop?: string
29 videoLandscape?: string 40 videoLandscape?: string
  41 + imgListData?: string
30 } 42 }
31 43
32 /** 44 /**
@@ -124,4 +124,6 @@ export class WDRouterPage { @@ -124,4 +124,6 @@ export class WDRouterPage {
124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage"); 124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
125 // 栏目页面、频道详情 125 // 栏目页面、频道详情
126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage"); 126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
  127 + //展示头像
  128 + static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
127 } 129 }
1 import HashMap from '@ohos.util.HashMap'; 1 import HashMap from '@ohos.util.HashMap';
2 import { Callback } from 'wdJsBridge'; 2 import { Callback } from 'wdJsBridge';
3 -import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; 3 +import { Message, IImgListData } from 'wdJsBridge/src/main/ets/bean/Message';
4 import { Logger } from 'wdKit'; 4 import { Logger } from 'wdKit';
5 import { H5CallNativeType } from './H5CallNativeType'; 5 import { H5CallNativeType } from './H5CallNativeType';
6 import { H5OperateType } from './H5OperateType'; 6 import { H5OperateType } from './H5OperateType';
@@ -8,7 +8,7 @@ import { ContentConstants } from 'wdConstant'; @@ -8,7 +8,7 @@ import { ContentConstants } from 'wdConstant';
8 import { ProcessUtils } from 'wdRouter'; 8 import { ProcessUtils } from 'wdRouter';
9 import router from '@ohos.router'; 9 import router from '@ohos.router';
10 import Url from '@ohos.url' 10 import Url from '@ohos.url'
11 -import { ContentDTO } from 'wdBean/Index'; 11 +import { ContentDTO, PhotoListBean } from 'wdBean';
12 import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork'; 12 import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork';
13 13
14 const TAG = 'JsBridgeBiz' 14 const TAG = 'JsBridgeBiz'
@@ -96,11 +96,25 @@ function getAppPublicInfo(): string { @@ -96,11 +96,25 @@ function getAppPublicInfo(): string {
96 96
97 function handleJsCallReceiveH5Data(data: Message) { 97 function handleJsCallReceiveH5Data(data: Message) {
98 switch (data?.data?.dataSource) { 98 switch (data?.data?.dataSource) {
99 - case 5:  
100 - if (data?.data?.dataSource === 5) {  
101 - ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}')) 99 + case '3':
  100 + let imgListData: IImgListData = JSON.parse(data?.data?.imgListData || "{}")
  101 + let imgArr = imgListData?.imgArr || []
  102 + if (imgArr.length > 0) {
  103 + const photoList: PhotoListBean[] = imgArr.map(item => {
  104 + const photo: PhotoListBean = {
  105 + width: item.width,
  106 + height: item.height,
  107 + picPath: item.pic,
  108 + picDesc: ''
  109 + }
  110 + return photo
  111 + })
  112 + ProcessUtils.gotoMultiPictureListPage(photoList)
102 } 113 }
103 break; 114 break;
  115 + case '5':
  116 + ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
  117 + break;
104 default: 118 default:
105 break; 119 break;
106 } 120 }
@@ -90,7 +90,7 @@ export struct ImageAndTextPageComponent { @@ -90,7 +90,7 @@ export struct ImageAndTextPageComponent {
90 .height(24) 90 .height(24)
91 .margin({ right: 5 }) 91 .margin({ right: 5 })
92 } 92 }
93 - Text(`${this.interactData?.likeNum || 0}`) 93 + Text(`${this.interactData?.likeNum || 0 }`)
94 .fontSize(16) 94 .fontSize(16)
95 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') 95 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
96 .fontWeight(500) 96 .fontWeight(500)
@@ -100,10 +100,10 @@ export struct ImageAndTextPageComponent { @@ -100,10 +100,10 @@ export struct ImageAndTextPageComponent {
100 .justifyContent(FlexAlign.Center) 100 .justifyContent(FlexAlign.Center)
101 .alignItems(VerticalAlign.Center) 101 .alignItems(VerticalAlign.Center)
102 .borderRadius(20) 102 .borderRadius(20)
103 - .border({  
104 - width: 1,  
105 - color: '#EDEDED',  
106 - }) 103 + // .border({
  104 + // width: 1,
  105 + // color: '#EDEDED',
  106 + // })
107 .onClick(() => { 107 .onClick(() => {
108 this.toggleLikeStatus() 108 this.toggleLikeStatus()
109 }) 109 })
1 -import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit'; 1 +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
3 import { 3 import {
4 ContentDetailDTO, 4 ContentDetailDTO,
@@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent { @@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent {
78 78
79 build() { 79 build() {
80 RelativeContainer() { 80 RelativeContainer() {
81 - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {  
82 - Swiper(this.swiperController) {  
83 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {  
84 - Swiper(this.swiperControllerItem) {  
85 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 81 + this.init()
86 } 82 }
87 .width('100%') 83 .width('100%')
88 .height('100%') 84 .height('100%')
89 - .vertical(true)  
90 - .autoPlay(false)  
91 - .cachedCount(1)  
92 - .indicator(false)  
93 - .displayCount(1)  
94 - .onAnimationEnd(event => {  
95 - router.back()  
96 - })  
97 - }) 85 + .backgroundColor(Color.Black)
  86 + .id('e_picture_container')
  87 + // 设置顶部绘制延伸到状态栏
  88 + // 设置底部绘制延伸到导航条
  89 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
98 } 90 }
99 - .index(this.swiperIndex)  
100 - .width('100%')  
101 - .height(px2vp(this.picHeight) + 32)  
102 - .vertical(false)  
103 - .autoPlay(false)  
104 - .cachedCount(3)  
105 - .indicator(false)  
106 - .displayCount(1)  
107 - .loop(false)  
108 - .id('e_swiper_content')  
109 - .alignRules({  
110 - center: { anchor: "__container__", align: VerticalAlign.Center },  
111 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
112 - })  
113 - .onChange((index: number) => {  
114 - this.swiperIndex = index  
115 - })  
116 91
  92 + @Builder
  93 + init() {
117 if (this.contentDetailData.rmhPlatform == 1) { 94 if (this.contentDetailData.rmhPlatform == 1) {
118 Row() { 95 Row() {
119 Row({ space: 8 }) { 96 Row({ space: 8 }) {
@@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent { @@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent {
154 .height(14) 131 .height(14)
155 .textOverflow({ overflow: TextOverflow.Ellipsis }) 132 .textOverflow({ overflow: TextOverflow.Ellipsis })
156 .margin(0) 133 .margin(0)
  134 + .maxLines(1)
157 } 135 }
158 } 136 }
159 .width('81%') 137 .width('81%')
@@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent { @@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent {
192 .width('100%') 170 .width('100%')
193 .height(44) 171 .height(44)
194 .alignRules({ 172 .alignRules({
195 - top: { anchor: "e_swiper_content", align: VerticalAlign.Top },  
196 - middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center } 173 + top: { anchor: "__container__", align: VerticalAlign.Top },
  174 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
197 }) 175 })
198 .id('e_attention') 176 .id('e_attention')
199 } 177 }
  178 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
  179 + Swiper(this.swiperController) {
  180 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
  181 + Swiper(this.swiperControllerItem) {
  182 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
  183 + }
  184 + .width('100%')
  185 + .height('100%')
  186 + .vertical(true)
  187 + .autoPlay(false)
  188 + .cachedCount(1)
  189 + .indicator(false)
  190 + .displayCount(1)
  191 + .onAnimationEnd(event => {
  192 + router.back()
  193 + })
  194 + })
  195 + }
  196 + .index(this.swiperIndex)
  197 + .width('100%')
  198 + .height(px2vp(this.picHeight) + 32)
  199 + .vertical(false)
  200 + .autoPlay(false)
  201 + .cachedCount(3)
  202 + .indicator(false)
  203 + .displayCount(1)
  204 + .loop(false)
  205 + .id('e_swiper_content')
  206 + .alignRules({
  207 + center: { anchor: "__container__", align: VerticalAlign.Center },
  208 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  209 + })
  210 + .onChange((index: number) => {
  211 + this.swiperIndex = index
  212 + })
  213 +
200 Row() { 214 Row() {
201 Scroll(this.scroller) { 215 Scroll(this.scroller) {
202 Row() { 216 Row() {
@@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent { @@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent {
295 .border({ width: { top: 0.5 }, color: '#FFFFFF' }) 309 .border({ width: { top: 0.5 }, color: '#FFFFFF' })
296 .id('e_oper_row') 310 .id('e_oper_row')
297 } 311 }
298 - .width('100%')  
299 - .height('100%')  
300 - .backgroundColor(Color.Black)  
301 - .id('e_picture_container')  
302 - // 设置顶部绘制延伸到状态栏  
303 - // 设置底部绘制延伸到导航条  
304 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
305 - }  
306 312
307 getContentDetailData() { 313 getContentDetailData() {
308 try { 314 try {
@@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent { @@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent {
318 } 324 }
319 this.netStatus = undefined 325 this.netStatus = undefined
320 this.contentDetailData = resDTO.data?.[0]; 326 this.contentDetailData = resDTO.data?.[0];
  327 + if (this.contentDetailData.rmhPlatform == 1) {
  328 + WindowModel.shared.setWindowSystemBarProperties({
  329 + statusBarContentColor: '#ffffff',
  330 + })
  331 + }
321 // this.contentDetailData.photoList = [] 332 // this.contentDetailData.photoList = []
322 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 333 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
323 // 暂无内容 334 // 暂无内容
@@ -29,13 +29,11 @@ struct MineHomePage { @@ -29,13 +29,11 @@ struct MineHomePage {
29 registTime:number = 0//账号注册时间 29 registTime:number = 0//账号注册时间
30 @State registerTimeForDay:number = 0 30 @State registerTimeForDay:number = 0
31 31
32 - aboutToAppear(){ 32 + onPageShow(): void {
33 this.getUserInfo() 33 this.getUserInfo()
34 this.getUserLevel() 34 this.getUserLevel()
35 } 35 }
36 36
37 -  
38 -  
39 build() { 37 build() {
40 Stack({ alignContent: Alignment.Top }){ 38 Stack({ alignContent: Alignment.Top }){
41 Image($r('app.media.title_bg')) 39 Image($r('app.media.title_bg'))
@@ -65,9 +63,8 @@ struct MineHomePage { @@ -65,9 +63,8 @@ struct MineHomePage {
65 .height('130lpx') 63 .height('130lpx')
66 .objectFit(ImageFit.Cover) 64 .objectFit(ImageFit.Cover)
67 }.onClick(()=>{ 65 }.onClick(()=>{
68 - //TODO 显示头像  
69 - let params = {'userId': "531267787833221"} as Record<string, string>;  
70 - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) 66 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  67 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
71 }).width('135lpx') 68 }).width('135lpx')
72 .height('135lpx') 69 .height('135lpx')
73 70
@@ -370,6 +367,9 @@ struct MineHomePage { @@ -370,6 +367,9 @@ struct MineHomePage {
370 if(StringUtils.isNotEmpty(value.introduction)){ 367 if(StringUtils.isNotEmpty(value.introduction)){
371 this.desc = value.introduction 368 this.desc = value.introduction
372 this.isHasIntroduction = true 369 this.isHasIntroduction = true
  370 + }else{
  371 + this.desc = "点击添加简介,让大家认识你"
  372 + this.isHasIntroduction = false
373 } 373 }
374 this.browseNum = value.browseNum 374 this.browseNum = value.browseNum
375 this.commentNum = value.commentNum 375 this.commentNum = value.commentNum
  1 +import { router } from '@kit.ArkUI';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct ShowUserHeaderPage {
  6 + @State headPhotoUrl: string = '';
  7 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  8 +
  9 + onPageShow() {
  10 + this.headPhotoUrl = this.params?.['headPhotoUrl'];
  11 + }
  12 +
  13 + build() {
  14 + Row() {
  15 + Image(this.headPhotoUrl)
  16 + .alt($r('app.media.default_head'))
  17 + .width('720lpx')
  18 + .height('720lpx')
  19 + .objectFit(ImageFit.Auto)
  20 + .clip(new Circle({ width: '720lpx', height: '720lpx' }))
  21 + }
  22 + .width('100%')
  23 + .height('100%')
  24 + .alignItems(VerticalAlign.Center)
  25 + .backgroundColor($r('app.color.color_000000'))
  26 + .onClick(()=>{
  27 + router.back()
  28 + })
  29 + }
  30 +}
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 "components/page/LiveMorePage", 21 "components/page/LiveMorePage",
22 "components/page/ReserveMorePage", 22 "components/page/ReserveMorePage",
23 "pages/VideoPlayPage", 23 "pages/VideoPlayPage",
24 - "components/page/ThemeListPage" 24 + "components/page/ThemeListPage",
  25 + "pages/ShowUserHeaderPage"
25 ] 26 ]
26 } 27 }
@@ -11,7 +11,7 @@ export struct ChartItemCompereComponent { @@ -11,7 +11,7 @@ export struct ChartItemCompereComponent {
11 ListItem() { 11 ListItem() {
12 Column() { 12 Column() {
13 Row() { 13 Row() {
14 - Image($r('app.media.icon_live_status_running')) 14 + Image($r('app.media.default_head'))
15 .borderRadius(10) 15 .borderRadius(10)
16 .width(20) 16 .width(20)
17 .height(20) 17 .height(20)
@@ -24,13 +24,15 @@ export struct ChartItemCompereComponent { @@ -24,13 +24,15 @@ export struct ChartItemCompereComponent {
24 24
25 Text(' 主持人 ') 25 Text(' 主持人 ')
26 .fontSize(11) 26 .fontSize(11)
27 - .backgroundColor('808562') 27 + .backgroundColor('#FFFFC63F')
28 .fontColor('#FFFFFFFF') 28 .fontColor('#FFFFFFFF')
29 .padding({ top: 2, bottom: 2, left: 4, right: 4 }) 29 .padding({ top: 2, bottom: 2, left: 4, right: 4 })
30 .borderRadius(4) 30 .borderRadius(4)
31 - }.margin({ bottom: 8 }) 31 + }
  32 + .margin({ bottom: 8 })
  33 + .justifyContent(FlexAlign.Start)
32 34
33 - Text(this.liveDetailsBean.newIntroduction).lineHeight(22) 35 + Text(this.liveDetailsBean.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
34 } 36 }
35 .backgroundColor('#4D000000') 37 .backgroundColor('#4D000000')
36 .borderRadius(3) 38 .borderRadius(3)
@@ -41,6 +43,7 @@ export struct ChartItemCompereComponent { @@ -41,6 +43,7 @@ export struct ChartItemCompereComponent {
41 right: 8 43 right: 8
42 }) 44 })
43 .margin({ left: 16, bottom: 4 }) 45 .margin({ left: 16, bottom: 4 })
  46 + .alignItems(HorizontalAlign.Start)
44 } 47 }
45 48
46 } 49 }