Showing
9 changed files
with
298 additions
and
225 deletions
| 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,230 +78,236 @@ export struct MultiPictureDetailPageComponent { | @@ -78,230 +78,236 @@ 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() |
| 82 | + } | ||
| 83 | + .width('100%') | ||
| 84 | + .height('100%') | ||
| 85 | + .backgroundColor(Color.Black) | ||
| 86 | + .id('e_picture_container') | ||
| 87 | + // 设置顶部绘制延伸到状态栏 | ||
| 88 | + // 设置底部绘制延伸到导航条 | ||
| 89 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + @Builder | ||
| 93 | + init() { | ||
| 94 | + if (this.contentDetailData.rmhPlatform == 1) { | ||
| 95 | + Row() { | ||
| 96 | + Row({ space: 8 }) { | ||
| 97 | + Row() { | ||
| 98 | + Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl) | ||
| 99 | + .borderRadius(24) | ||
| 100 | + .aspectRatio(1) | ||
| 101 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 102 | + .alt($r('app.media.picture_loading')) | ||
| 103 | + .width(36) | ||
| 104 | + .height(36) | ||
| 105 | + .objectFit(ImageFit.Fill) | ||
| 106 | + .interpolation(ImageInterpolation.High) | ||
| 107 | + } | ||
| 108 | + .width('13%') | ||
| 109 | + .height('100%') | ||
| 110 | + | ||
| 111 | + Row() { | ||
| 112 | + Flex({ | ||
| 113 | + direction: FlexDirection.Column, | ||
| 114 | + justifyContent: FlexAlign.SpaceAround, | ||
| 115 | + alignItems: ItemAlign.Start | ||
| 116 | + }) { | ||
| 117 | + Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 118 | + .fontColor(Color.White) | ||
| 119 | + .fontSize(14) | ||
| 120 | + .fontFamily('PingFang PingFang SC-Medium') | ||
| 121 | + .fontWeight(500) | ||
| 122 | + .lineHeight(17) | ||
| 123 | + .margin(0) | ||
| 124 | + .height(17) | ||
| 125 | + Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 126 | + .fontColor('#676767') | ||
| 127 | + .fontSize(12) | ||
| 128 | + .fontFamily('PingFang SC-Regular') | ||
| 129 | + .fontWeight(400) | ||
| 130 | + .lineHeight(14) | ||
| 131 | + .height(14) | ||
| 132 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 133 | + .margin(0) | ||
| 134 | + .maxLines(1) | ||
| 86 | } | 135 | } |
| 87 | - .width('100%') | ||
| 88 | - .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 | - }) | 136 | + } |
| 137 | + .width('81%') | ||
| 138 | + .height('100%') | ||
| 98 | } | 139 | } |
| 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 | 140 | + .width('74.4%') |
| 141 | + .height('100%') | ||
| 142 | + .margin({ | ||
| 143 | + top: 0, | ||
| 144 | + bottom: 0, | ||
| 145 | + left: 16, | ||
| 146 | + right: 0 | ||
| 115 | }) | 147 | }) |
| 116 | 148 | ||
| 117 | - if (this.contentDetailData.rmhPlatform == 1) { | 149 | + if (this.followStatus == '0') { |
| 118 | Row() { | 150 | Row() { |
| 119 | - Row({ space: 8 }) { | 151 | + Button({ type: ButtonType.Normal, stateEffect: true }) { |
| 120 | Row() { | 152 | Row() { |
| 121 | - Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl) | ||
| 122 | - .borderRadius(24) | ||
| 123 | - .aspectRatio(1) | ||
| 124 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 125 | - .alt($r('app.media.picture_loading')) | ||
| 126 | - .width(36) | ||
| 127 | - .height(36) | ||
| 128 | - .objectFit(ImageFit.Fill) | ||
| 129 | - .interpolation(ImageInterpolation.High) | ||
| 130 | - } | ||
| 131 | - .width('13%') | ||
| 132 | - .height('100%') | ||
| 133 | - | ||
| 134 | - Row() { | ||
| 135 | - Flex({ | ||
| 136 | - direction: FlexDirection.Column, | ||
| 137 | - justifyContent: FlexAlign.SpaceAround, | ||
| 138 | - alignItems: ItemAlign.Start | ||
| 139 | - }) { | ||
| 140 | - Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 141 | - .fontColor(Color.White) | ||
| 142 | - .fontSize(14) | ||
| 143 | - .fontFamily('PingFang PingFang SC-Medium') | ||
| 144 | - .fontWeight(500) | ||
| 145 | - .lineHeight(17) | ||
| 146 | - .margin(0) | ||
| 147 | - .height(17) | ||
| 148 | - Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 149 | - .fontColor('#676767') | ||
| 150 | - .fontSize(12) | ||
| 151 | - .fontFamily('PingFang SC-Regular') | ||
| 152 | - .fontWeight(400) | ||
| 153 | - .lineHeight(14) | ||
| 154 | - .height(14) | ||
| 155 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 156 | - .margin(0) | ||
| 157 | - } | ||
| 158 | - } | ||
| 159 | - .width('81%') | ||
| 160 | - .height('100%') | 153 | + Text('+关注').fontSize(12).fontColor(0xffffff) |
| 154 | + }.alignItems(VerticalAlign.Center) | ||
| 161 | } | 155 | } |
| 162 | - .width('74.4%') | ||
| 163 | - .height('100%') | ||
| 164 | - .margin({ | ||
| 165 | - top: 0, | ||
| 166 | - bottom: 0, | ||
| 167 | - left: 16, | ||
| 168 | - right: 0 | 156 | + .borderRadius(4) |
| 157 | + .backgroundColor('#ED2800') | ||
| 158 | + .width(48) | ||
| 159 | + .height(24) | ||
| 160 | + .onClick(() => { | ||
| 161 | + this.handleAccention() | ||
| 169 | }) | 162 | }) |
| 170 | - | ||
| 171 | - if (this.followStatus == '0') { | ||
| 172 | - Row() { | ||
| 173 | - Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 174 | - Row() { | ||
| 175 | - Text('+关注').fontSize(12).fontColor(0xffffff) | ||
| 176 | - }.alignItems(VerticalAlign.Center) | ||
| 177 | - } | ||
| 178 | - .borderRadius(4) | ||
| 179 | - .backgroundColor('#ED2800') | ||
| 180 | - .width(48) | ||
| 181 | - .height(24) | ||
| 182 | - .onClick(() => { | ||
| 183 | - this.handleAccention() | ||
| 184 | - }) | ||
| 185 | - } | ||
| 186 | - .justifyContent(FlexAlign.Center) | ||
| 187 | - .alignItems(VerticalAlign.Center) | ||
| 188 | - .width('21.6%') | ||
| 189 | - .height('100%') | ||
| 190 | - } | 163 | + } |
| 164 | + .justifyContent(FlexAlign.Center) | ||
| 165 | + .alignItems(VerticalAlign.Center) | ||
| 166 | + .width('21.6%') | ||
| 167 | + .height('100%') | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + .width('100%') | ||
| 171 | + .height(44) | ||
| 172 | + .alignRules({ | ||
| 173 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 174 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 175 | + }) | ||
| 176 | + .id('e_attention') | ||
| 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 }) | ||
| 191 | } | 183 | } |
| 192 | .width('100%') | 184 | .width('100%') |
| 193 | - .height(44) | ||
| 194 | - .alignRules({ | ||
| 195 | - top: { anchor: "e_swiper_content", align: VerticalAlign.Top }, | ||
| 196 | - middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center } | 185 | + .height('100%') |
| 186 | + .vertical(true) | ||
| 187 | + .autoPlay(false) | ||
| 188 | + .cachedCount(1) | ||
| 189 | + .indicator(false) | ||
| 190 | + .displayCount(1) | ||
| 191 | + .onAnimationEnd(event => { | ||
| 192 | + router.back() | ||
| 197 | }) | 193 | }) |
| 198 | - .id('e_attention') | ||
| 199 | - } | ||
| 200 | - Row() { | ||
| 201 | - Scroll(this.scroller) { | ||
| 202 | - Row() { | ||
| 203 | - Flex({ | ||
| 204 | - direction: FlexDirection.Column, | ||
| 205 | - justifyContent: FlexAlign.Start | ||
| 206 | - }) { | ||
| 207 | - Text() { | ||
| 208 | - Span(`${this.swiperIndex + 1}`) | ||
| 209 | - .fontSize(24) | ||
| 210 | - .fontFamily('PingFang SC-Medium') | ||
| 211 | - .fontWeight(500) | ||
| 212 | - .lineHeight(28) | ||
| 213 | - Span(`/${this.contentDetailData.photoList.length}`) | ||
| 214 | - .fontSize(14) | ||
| 215 | - .fontFamily('PingFang SC-Medium') | ||
| 216 | - .fontWeight(500) | ||
| 217 | - .lineHeight(19) | ||
| 218 | - }.fontColor(Color.White).margin(4) | 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 | + }) | ||
| 219 | 213 | ||
| 220 | - Text(`${this.contentDetailData.newsTitle}`) | ||
| 221 | - .fontColor(Color.White) | ||
| 222 | - .fontSize(16) | ||
| 223 | - .fontFamily('PingFang SC-Semibold') | ||
| 224 | - .fontWeight(600) | ||
| 225 | - .lineHeight(24) | ||
| 226 | - .margin({ | ||
| 227 | - top: 4, | ||
| 228 | - left: 0, | ||
| 229 | - bottom: 4, | ||
| 230 | - right: 0 | ||
| 231 | - }) | ||
| 232 | - Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 233 | - .fontColor(Color.White) | 214 | + Row() { |
| 215 | + Scroll(this.scroller) { | ||
| 216 | + Row() { | ||
| 217 | + Flex({ | ||
| 218 | + direction: FlexDirection.Column, | ||
| 219 | + justifyContent: FlexAlign.Start | ||
| 220 | + }) { | ||
| 221 | + Text() { | ||
| 222 | + Span(`${this.swiperIndex + 1}`) | ||
| 223 | + .fontSize(24) | ||
| 224 | + .fontFamily('PingFang SC-Medium') | ||
| 225 | + .fontWeight(500) | ||
| 226 | + .lineHeight(28) | ||
| 227 | + Span(`/${this.contentDetailData.photoList.length}`) | ||
| 234 | .fontSize(14) | 228 | .fontSize(14) |
| 235 | - .fontFamily('PingFang SC-Regular') | ||
| 236 | - .fontWeight(400) | ||
| 237 | - .lineHeight(22) | ||
| 238 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 239 | - .margin({ | ||
| 240 | - top: 4, | ||
| 241 | - left: 0, | ||
| 242 | - bottom: 4, | ||
| 243 | - right: 18 | ||
| 244 | - }) | ||
| 245 | - .maxLines(16) | ||
| 246 | - } | ||
| 247 | - } | ||
| 248 | - .width('100%') | ||
| 249 | - .margin({ | ||
| 250 | - top: 8, | ||
| 251 | - left: 18, | ||
| 252 | - bottom: 24, | ||
| 253 | - right: 18 | ||
| 254 | - }) | ||
| 255 | - } | ||
| 256 | - .scrollable(ScrollDirection.Vertical) | ||
| 257 | - .scrollBarWidth(0) | ||
| 258 | - .height(px2vp(this.titleHeight)) | ||
| 259 | - } | ||
| 260 | - .id('e_swiper_titles') | ||
| 261 | - .alignRules({ | ||
| 262 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 263 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 264 | - }) | ||
| 265 | - .height(px2vp(this.titleHeight) + 64) | 229 | + .fontFamily('PingFang SC-Medium') |
| 230 | + .fontWeight(500) | ||
| 231 | + .lineHeight(19) | ||
| 232 | + }.fontColor(Color.White).margin(4) | ||
| 266 | 233 | ||
| 267 | - } | ||
| 268 | - if (this.netStatus !== undefined) { | ||
| 269 | - EmptyComponent({ | ||
| 270 | - emptyType: this.netStatus, emptyButton: true, retry: () => { | ||
| 271 | - this.getContentDetailData() | 234 | + Text(`${this.contentDetailData.newsTitle}`) |
| 235 | + .fontColor(Color.White) | ||
| 236 | + .fontSize(16) | ||
| 237 | + .fontFamily('PingFang SC-Semibold') | ||
| 238 | + .fontWeight(600) | ||
| 239 | + .lineHeight(24) | ||
| 240 | + .margin({ | ||
| 241 | + top: 4, | ||
| 242 | + left: 0, | ||
| 243 | + bottom: 4, | ||
| 244 | + right: 0 | ||
| 245 | + }) | ||
| 246 | + Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 247 | + .fontColor(Color.White) | ||
| 248 | + .fontSize(14) | ||
| 249 | + .fontFamily('PingFang SC-Regular') | ||
| 250 | + .fontWeight(400) | ||
| 251 | + .lineHeight(22) | ||
| 252 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 253 | + .margin({ | ||
| 254 | + top: 4, | ||
| 255 | + left: 0, | ||
| 256 | + bottom: 4, | ||
| 257 | + right: 18 | ||
| 258 | + }) | ||
| 259 | + .maxLines(16) | ||
| 260 | + } | ||
| 272 | } | 261 | } |
| 273 | - }) | ||
| 274 | - .id('e_empty_content') | ||
| 275 | - .alignRules({ | ||
| 276 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 277 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | 262 | + .width('100%') |
| 263 | + .margin({ | ||
| 264 | + top: 8, | ||
| 265 | + left: 18, | ||
| 266 | + bottom: 24, | ||
| 267 | + right: 18 | ||
| 278 | }) | 268 | }) |
| 269 | + } | ||
| 270 | + .scrollable(ScrollDirection.Vertical) | ||
| 271 | + .scrollBarWidth(0) | ||
| 272 | + .height(px2vp(this.titleHeight)) | ||
| 279 | } | 273 | } |
| 280 | - OperRowListView({ | ||
| 281 | - contentDetailData: this.contentDetailData, | 274 | + .id('e_swiper_titles') |
| 275 | + .alignRules({ | ||
| 276 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 277 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 282 | }) | 278 | }) |
| 279 | + .height(px2vp(this.titleHeight) + 64) | ||
| 280 | + | ||
| 281 | + } | ||
| 282 | + if (this.netStatus !== undefined) { | ||
| 283 | + EmptyComponent({ | ||
| 284 | + emptyType: this.netStatus, emptyButton: true, retry: () => { | ||
| 285 | + this.getContentDetailData() | ||
| 286 | + } | ||
| 287 | + }) | ||
| 288 | + .id('e_empty_content') | ||
| 283 | .alignRules({ | 289 | .alignRules({ |
| 284 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 290 | + center: { anchor: "__container__", align: VerticalAlign.Center }, |
| 285 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 291 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 286 | }) | 292 | }) |
| 287 | - .width('100%') | ||
| 288 | - .height(56) | ||
| 289 | - .margin({ | ||
| 290 | - top: 16, | ||
| 291 | - left: 16, | ||
| 292 | - right: 16, | ||
| 293 | - bottom: 0 | ||
| 294 | - }) | ||
| 295 | - .border({ width: { top: 0.5 }, color: '#FFFFFF' }) | ||
| 296 | - .id('e_oper_row') | ||
| 297 | } | 293 | } |
| 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]) | 294 | + OperRowListView({ |
| 295 | + contentDetailData: this.contentDetailData, | ||
| 296 | + }) | ||
| 297 | + .alignRules({ | ||
| 298 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 299 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 300 | + }) | ||
| 301 | + .width('100%') | ||
| 302 | + .height(56) | ||
| 303 | + .margin({ | ||
| 304 | + top: 16, | ||
| 305 | + left: 16, | ||
| 306 | + right: 16, | ||
| 307 | + bottom: 0 | ||
| 308 | + }) | ||
| 309 | + .border({ width: { top: 0.5 }, color: '#FFFFFF' }) | ||
| 310 | + .id('e_oper_row') | ||
| 305 | } | 311 | } |
| 306 | 312 | ||
| 307 | getContentDetailData() { | 313 | getContentDetailData() { |
| @@ -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 | } |
-
Please register or login to post a comment