Showing
17 changed files
with
410 additions
and
263 deletions
| @@ -155,9 +155,15 @@ function buildErrorMsg(httpStatus: number): string { | @@ -155,9 +155,15 @@ function buildErrorMsg(httpStatus: number): string { | ||
| 155 | case HttpStatusCode.HttpVersionNotSupported: | 155 | case HttpStatusCode.HttpVersionNotSupported: |
| 156 | message = "HTTP版本不受支持(505)"; | 156 | message = "HTTP版本不受支持(505)"; |
| 157 | break; | 157 | break; |
| 158 | - default: | ||
| 159 | - // 网络连接故障 | ||
| 160 | - message = `连接出错(${httpStatus})!`; | 158 | + default:{ |
| 159 | + // 网络连接故障 | ||
| 160 | + if(httpStatus != undefined){ | ||
| 161 | + message = `连接出错(${httpStatus})!`; | ||
| 162 | + }else{ | ||
| 163 | + message = `连接出错!`; | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 161 | } | 167 | } |
| 162 | return message; | 168 | return message; |
| 163 | } | 169 | } |
| @@ -211,12 +211,13 @@ export struct MorningEveningPaperComponent { | @@ -211,12 +211,13 @@ export struct MorningEveningPaperComponent { | ||
| 211 | } | 211 | } |
| 212 | .height('100%') | 212 | .height('100%') |
| 213 | 213 | ||
| 214 | - PaperTitleComponent().margin({ | ||
| 215 | - top: this.topSafeHeight | ||
| 216 | - }) | 214 | + PaperTitleComponent() |
| 217 | } | 215 | } |
| 218 | .width('100%') | 216 | .width('100%') |
| 219 | .height('100%') | 217 | .height('100%') |
| 218 | + .padding({ | ||
| 219 | + top: this.topSafeHeight | ||
| 220 | + }) | ||
| 220 | // .backgroundColor(Color.Black) | 221 | // .backgroundColor(Color.Black) |
| 221 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 222 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 222 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 223 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
| @@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent { | @@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 48 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 48 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 49 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | 49 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; |
| 50 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number; | ||
| 50 | @State windowHeight: number = AppStorage.get<number>('windowHeight') as number; | 51 | @State windowHeight: number = AppStorage.get<number>('windowHeight') as number; |
| 51 | @State currentOffset:number = 0 | 52 | @State currentOffset:number = 0 |
| 53 | + @State duration:number = 0 | ||
| 52 | 54 | ||
| 53 | //watch监听页码回调 | 55 | //watch监听页码回调 |
| 54 | onCurrentPageNumUpdated(): void { | 56 | onCurrentPageNumUpdated(): void { |
| @@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent { | @@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 81 | } | 83 | } |
| 82 | } | 84 | } |
| 83 | 85 | ||
| 86 | + | ||
| 84 | aboutToDisappear() { | 87 | aboutToDisappear() { |
| 85 | 88 | ||
| 86 | } | 89 | } |
| @@ -98,130 +101,135 @@ export struct MultiPictureDetailPageComponent { | @@ -98,130 +101,135 @@ export struct MultiPictureDetailPageComponent { | ||
| 98 | @Builder | 101 | @Builder |
| 99 | init() { | 102 | init() { |
| 100 | if (this.contentDetailData.rmhPlatform == 1) { | 103 | if (this.contentDetailData.rmhPlatform == 1) { |
| 101 | - Row() { | ||
| 102 | - Row({ space: 8 }) { | ||
| 103 | - if (this.getImgUrl()){ | ||
| 104 | - Row() { | ||
| 105 | - Stack() { | ||
| 106 | - Image(this.getImgUrl()) | ||
| 107 | - .borderRadius(18) | ||
| 108 | - .aspectRatio(1) | ||
| 109 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 110 | - .width(36) | ||
| 111 | - .height(36) | ||
| 112 | - .objectFit(ImageFit.Fill) | ||
| 113 | - .interpolation(ImageInterpolation.High) | ||
| 114 | - if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 115 | - Stack() { | ||
| 116 | - Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 117 | - .width($r('app.float.vp_13')) | ||
| 118 | - .height($r('app.float.vp_13')) | ||
| 119 | - .objectFit(ImageFit.Cover) | 104 | + if(!this.showDownload) { |
| 105 | + Row() { | ||
| 106 | + Row({ space: 8 }) { | ||
| 107 | + if (this.getImgUrl()){ | ||
| 108 | + Row() { | ||
| 109 | + Stack() { | ||
| 110 | + Image(this.getImgUrl()) | ||
| 111 | + .borderRadius(18) | ||
| 112 | + .aspectRatio(1) | ||
| 113 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 114 | + .width(36) | ||
| 115 | + .height(36) | ||
| 116 | + .objectFit(ImageFit.Fill) | ||
| 117 | + .interpolation(ImageInterpolation.High) | ||
| 118 | + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 119 | + Stack() { | ||
| 120 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 121 | + .width($r('app.float.vp_13')) | ||
| 122 | + .height($r('app.float.vp_13')) | ||
| 123 | + .objectFit(ImageFit.Cover) | ||
| 124 | + } | ||
| 125 | + .width(36) | ||
| 126 | + .height(36) | ||
| 127 | + .alignContent(Alignment.BottomEnd) | ||
| 120 | } | 128 | } |
| 121 | - .width(36) | ||
| 122 | - .height(36) | ||
| 123 | - .alignContent(Alignment.BottomEnd) | ||
| 124 | } | 129 | } |
| 125 | - } | ||
| 126 | - .width(36) | ||
| 127 | - .height(36) | ||
| 128 | - .alignContent(Alignment.Center) | ||
| 129 | - .onClick(() => { | ||
| 130 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 131 | - // 号主页 | ||
| 132 | - const params: Params = { | ||
| 133 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 134 | - pageID: '' | 130 | + .width(36) |
| 131 | + .height(36) | ||
| 132 | + .alignContent(Alignment.Center) | ||
| 133 | + .onClick(() => { | ||
| 134 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 135 | + // 号主页 | ||
| 136 | + const params: Params = { | ||
| 137 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 138 | + pageID: '' | ||
| 139 | + } | ||
| 140 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 135 | } | 141 | } |
| 136 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 137 | - } | ||
| 138 | 142 | ||
| 139 | - }) | 143 | + }) |
| 144 | + } | ||
| 145 | + .width('13%') | ||
| 146 | + .height('100%') | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + Row() { | ||
| 150 | + Flex({ | ||
| 151 | + direction: FlexDirection.Column, | ||
| 152 | + justifyContent: FlexAlign.SpaceAround, | ||
| 153 | + alignItems: ItemAlign.Start | ||
| 154 | + }) { | ||
| 155 | + Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 156 | + .fontColor(Color.White) | ||
| 157 | + .fontSize(14) | ||
| 158 | + .fontFamily('PingFang PingFang SC-Medium') | ||
| 159 | + .fontWeight(500) | ||
| 160 | + .lineHeight(17) | ||
| 161 | + .margin(0) | ||
| 162 | + .height(17) | ||
| 163 | + Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 164 | + .fontColor(Color.White) | ||
| 165 | + .fontSize(12) | ||
| 166 | + .fontFamily('PingFang SC-Regular') | ||
| 167 | + .fontWeight(400) | ||
| 168 | + .lineHeight(14) | ||
| 169 | + .height(14) | ||
| 170 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 171 | + .margin(0) | ||
| 172 | + .maxLines(1) | ||
| 173 | + } | ||
| 140 | } | 174 | } |
| 141 | - .width('13%') | 175 | + .width('81%') |
| 142 | .height('100%') | 176 | .height('100%') |
| 143 | } | 177 | } |
| 178 | + .width('74.4%') | ||
| 179 | + .height('100%') | ||
| 180 | + .margin({ | ||
| 181 | + top: 0, | ||
| 182 | + bottom: 0, | ||
| 183 | + left: 16, | ||
| 184 | + right: 0 | ||
| 185 | + }) | ||
| 144 | 186 | ||
| 145 | Row() { | 187 | Row() { |
| 146 | - Flex({ | ||
| 147 | - direction: FlexDirection.Column, | ||
| 148 | - justifyContent: FlexAlign.SpaceAround, | ||
| 149 | - alignItems: ItemAlign.Start | ||
| 150 | - }) { | ||
| 151 | - Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 152 | - .fontColor(Color.White) | ||
| 153 | - .fontSize(14) | ||
| 154 | - .fontFamily('PingFang PingFang SC-Medium') | ||
| 155 | - .fontWeight(500) | ||
| 156 | - .lineHeight(17) | ||
| 157 | - .margin(0) | ||
| 158 | - .height(17) | ||
| 159 | - Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 160 | - .fontColor(Color.White) | ||
| 161 | - .fontSize(12) | ||
| 162 | - .fontFamily('PingFang SC-Regular') | ||
| 163 | - .fontWeight(400) | ||
| 164 | - .lineHeight(14) | ||
| 165 | - .height(14) | ||
| 166 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 167 | - .margin(0) | ||
| 168 | - .maxLines(1) | 188 | + if (this.followStatus == '0') { |
| 189 | + Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 190 | + Row() { | ||
| 191 | + Text('+关注').fontSize(12).fontColor(0xffffff) | ||
| 192 | + }.alignItems(VerticalAlign.Center) | ||
| 193 | + } | ||
| 194 | + .borderRadius(4) | ||
| 195 | + .backgroundColor('#ED2800') | ||
| 196 | + .width(48) | ||
| 197 | + .height(24) | ||
| 198 | + .onClick(() => { | ||
| 199 | + this.handleAccention() | ||
| 200 | + }) | ||
| 201 | + } else { | ||
| 202 | + Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 203 | + Row() { | ||
| 204 | + Text('已关注').fontSize(12).fontColor(0xffffff) | ||
| 205 | + }.alignItems(VerticalAlign.Center) | ||
| 206 | + } | ||
| 207 | + .borderRadius(4) | ||
| 208 | + .backgroundColor('#333333') | ||
| 209 | + .width(54) | ||
| 210 | + .height(24) | ||
| 169 | } | 211 | } |
| 212 | + | ||
| 170 | } | 213 | } |
| 171 | - .width('81%') | 214 | + .justifyContent(FlexAlign.Center) |
| 215 | + .alignItems(VerticalAlign.Center) | ||
| 216 | + .width('21.6%') | ||
| 172 | .height('100%') | 217 | .height('100%') |
| 173 | } | 218 | } |
| 174 | - .width('74.4%') | ||
| 175 | - .height('100%') | ||
| 176 | - .margin({ | ||
| 177 | - top: 0, | ||
| 178 | - bottom: 0, | ||
| 179 | - left: 16, | ||
| 180 | - right: 0 | 219 | + .width('100%') |
| 220 | + .height(44) | ||
| 221 | + .zIndex(10) | ||
| 222 | + .margin({top:`${this.topSafeHeight + 12}px`}) | ||
| 223 | + .alignRules({ | ||
| 224 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 225 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 181 | }) | 226 | }) |
| 182 | - | ||
| 183 | - Row() { | ||
| 184 | - if (this.followStatus == '0') { | ||
| 185 | - Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 186 | - Row() { | ||
| 187 | - Text('+关注').fontSize(12).fontColor(0xffffff) | ||
| 188 | - }.alignItems(VerticalAlign.Center) | ||
| 189 | - } | ||
| 190 | - .borderRadius(4) | ||
| 191 | - .backgroundColor('#ED2800') | ||
| 192 | - .width(48) | ||
| 193 | - .height(24) | ||
| 194 | - .onClick(() => { | ||
| 195 | - this.handleAccention() | ||
| 196 | - }) | ||
| 197 | - } else { | ||
| 198 | - Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 199 | - Row() { | ||
| 200 | - Text('已关注').fontSize(12).fontColor(0xffffff) | ||
| 201 | - }.alignItems(VerticalAlign.Center) | ||
| 202 | - } | ||
| 203 | - .borderRadius(4) | ||
| 204 | - .backgroundColor('#333333') | ||
| 205 | - .width(54) | ||
| 206 | - .height(24) | ||
| 207 | - } | ||
| 208 | - | ||
| 209 | - } | ||
| 210 | - .justifyContent(FlexAlign.Center) | ||
| 211 | - .alignItems(VerticalAlign.Center) | ||
| 212 | - .width('21.6%') | ||
| 213 | - .height('100%') | 227 | + .id('e_attention') |
| 228 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 229 | + TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` }) | ||
| 230 | + )) | ||
| 214 | } | 231 | } |
| 215 | - .width('100%') | ||
| 216 | - .height(44) | ||
| 217 | - .zIndex(10) | ||
| 218 | - .margin({top:`${this.topSafeHeight + 12}px`}) | ||
| 219 | - .alignRules({ | ||
| 220 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 221 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 222 | - }) | ||
| 223 | - .id('e_attention') | ||
| 224 | - .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | 232 | + |
| 225 | } | 233 | } |
| 226 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | 234 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { |
| 227 | Swiper(this.swiperController) { | 235 | Swiper(this.swiperController) { |
| @@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent { | @@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 241 | this.currentOffset = Math.abs(extraInfo.currentOffset) | 249 | this.currentOffset = Math.abs(extraInfo.currentOffset) |
| 242 | }) | 250 | }) |
| 243 | .onTouch((event: TouchEvent) => { | 251 | .onTouch((event: TouchEvent) => { |
| 252 | + if(this.duration === 0) { | ||
| 253 | + this.duration = 500 | ||
| 254 | + } | ||
| 244 | if(event.type === 1) { | 255 | if(event.type === 1) { |
| 245 | // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | 256 | // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { |
| 246 | if(this.currentOffset > 160) { | 257 | if(this.currentOffset > 160) { |
| @@ -285,113 +296,121 @@ export struct MultiPictureDetailPageComponent { | @@ -285,113 +296,121 @@ export struct MultiPictureDetailPageComponent { | ||
| 285 | }) | 296 | }) |
| 286 | } | 297 | } |
| 287 | Column(){ | 298 | Column(){ |
| 288 | - Column(){ | ||
| 289 | - Row() { | ||
| 290 | - Scroll(this.scroller) { | ||
| 291 | - Row() { | ||
| 292 | - Flex({ | ||
| 293 | - direction: FlexDirection.Column, | ||
| 294 | - justifyContent: FlexAlign.Start | ||
| 295 | - }) { | ||
| 296 | - if(this.contentDetailData?.photoList?.length) { | ||
| 297 | - Text() { | ||
| 298 | - Span(`${this.swiperIndex + 1}`) | ||
| 299 | - .fontSize(24) | ||
| 300 | - .fontFamily('PingFang SC-Medium') | ||
| 301 | - .fontWeight(500) | ||
| 302 | - .lineHeight(28) | ||
| 303 | - Span(`/${this.contentDetailData?.photoList?.length}`) | 299 | + if(!this.showDownload) { |
| 300 | + Column(){ | ||
| 301 | + Row() { | ||
| 302 | + Scroll(this.scroller) { | ||
| 303 | + Row() { | ||
| 304 | + Flex({ | ||
| 305 | + direction: FlexDirection.Column, | ||
| 306 | + justifyContent: FlexAlign.Start | ||
| 307 | + }) { | ||
| 308 | + if(this.contentDetailData?.photoList?.length) { | ||
| 309 | + Text() { | ||
| 310 | + Span(`${this.swiperIndex + 1}`) | ||
| 311 | + .fontSize(24) | ||
| 312 | + .fontFamily('PingFang SC-Medium') | ||
| 313 | + .fontWeight(500) | ||
| 314 | + .lineHeight(28) | ||
| 315 | + Span(`/${this.contentDetailData?.photoList?.length}`) | ||
| 316 | + .fontSize(14) | ||
| 317 | + .fontFamily('PingFang SC-Medium') | ||
| 318 | + .fontWeight(500) | ||
| 319 | + .lineHeight(19) | ||
| 320 | + } | ||
| 321 | + .fontColor(Color.White) | ||
| 322 | + .margin(4) | ||
| 323 | + } | ||
| 324 | + if(this.contentDetailData.newsTitle) { | ||
| 325 | + Text(`${this.contentDetailData.newsTitle}`) | ||
| 326 | + .fontColor(Color.White) | ||
| 327 | + .fontSize(16) | ||
| 328 | + .fontFamily('PingFang SC-Semibold') | ||
| 329 | + .fontWeight(600) | ||
| 330 | + .lineHeight(24) | ||
| 331 | + .margin({ | ||
| 332 | + top: 4, | ||
| 333 | + left: 0, | ||
| 334 | + bottom: 4, | ||
| 335 | + right: 0 | ||
| 336 | + }) | ||
| 337 | + } | ||
| 338 | + if(this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { | ||
| 339 | + Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 340 | + .fontColor(Color.White) | ||
| 304 | .fontSize(14) | 341 | .fontSize(14) |
| 305 | - .fontFamily('PingFang SC-Medium') | ||
| 306 | - .fontWeight(500) | ||
| 307 | - .lineHeight(19) | 342 | + .fontFamily('PingFang SC-Regular') |
| 343 | + .fontWeight(400) | ||
| 344 | + .lineHeight(22) | ||
| 345 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 346 | + .margin({ | ||
| 347 | + top: 4, | ||
| 348 | + left: 0, | ||
| 349 | + bottom: 4, | ||
| 350 | + right: 18 | ||
| 351 | + }) | ||
| 352 | + .maxLines(32) | ||
| 308 | } | 353 | } |
| 309 | - .fontColor(Color.White) | ||
| 310 | - .margin(4) | ||
| 311 | - } | ||
| 312 | - if(this.contentDetailData.newsTitle) { | ||
| 313 | - Text(`${this.contentDetailData.newsTitle}`) | ||
| 314 | - .fontColor(Color.White) | ||
| 315 | - .fontSize(16) | ||
| 316 | - .fontFamily('PingFang SC-Semibold') | ||
| 317 | - .fontWeight(600) | ||
| 318 | - .lineHeight(24) | ||
| 319 | - .margin({ | ||
| 320 | - top: 4, | ||
| 321 | - left: 0, | ||
| 322 | - bottom: 4, | ||
| 323 | - right: 0 | ||
| 324 | - }) | ||
| 325 | - } | ||
| 326 | - if(this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { | ||
| 327 | - Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 328 | - .fontColor(Color.White) | ||
| 329 | - .fontSize(14) | ||
| 330 | - .fontFamily('PingFang SC-Regular') | ||
| 331 | - .fontWeight(400) | ||
| 332 | - .lineHeight(22) | ||
| 333 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 334 | - .margin({ | ||
| 335 | - top: 4, | ||
| 336 | - left: 0, | ||
| 337 | - bottom: 4, | ||
| 338 | - right: 18 | ||
| 339 | - }) | ||
| 340 | - .maxLines(32) | ||
| 341 | } | 354 | } |
| 342 | } | 355 | } |
| 356 | + .width('100%') | ||
| 343 | } | 357 | } |
| 344 | - .width('100%') | 358 | + .scrollable(ScrollDirection.Vertical) |
| 359 | + .scrollBarWidth(0) | ||
| 360 | + .height(px2vp(this.titleHeight)) | ||
| 361 | + .align(Alignment.Bottom) | ||
| 345 | } | 362 | } |
| 346 | - .scrollable(ScrollDirection.Vertical) | ||
| 347 | - .scrollBarWidth(0) | ||
| 348 | - .height(px2vp(this.titleHeight)) | ||
| 349 | - .align(Alignment.Bottom) | 363 | + OperRowListView({ |
| 364 | + contentDetailData: this.contentDetailData, | ||
| 365 | + publishCommentModel: this.publishCommentModel, | ||
| 366 | + operationButtonList: this.operationButtonList, | ||
| 367 | + }) | ||
| 350 | } | 368 | } |
| 351 | - OperRowListView({ | ||
| 352 | - contentDetailData: this.contentDetailData, | ||
| 353 | - publishCommentModel: this.publishCommentModel, | ||
| 354 | - operationButtonList: this.operationButtonList, | ||
| 355 | - }) | 369 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 370 | + TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) | ||
| 371 | + )) | ||
| 356 | } | 372 | } |
| 357 | - .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | ||
| 358 | - Column(){ | ||
| 359 | - Row() { | ||
| 360 | - Flex({ | ||
| 361 | - direction: FlexDirection.Row, | ||
| 362 | - justifyContent: FlexAlign.SpaceBetween | ||
| 363 | - }) { | ||
| 364 | - if(this.contentDetailData?.photoList?.length) { | ||
| 365 | - Text() { | ||
| 366 | - Span(`${this.swiperIndex + 1}`) | ||
| 367 | - .fontSize(24) | ||
| 368 | - .fontFamily('PingFang SC-Medium') | ||
| 369 | - .fontWeight(500) | ||
| 370 | - .lineHeight(28) | ||
| 371 | - Span(`/${this.contentDetailData?.photoList?.length}`) | ||
| 372 | - .fontSize(14) | ||
| 373 | - .fontFamily('PingFang SC-Medium') | ||
| 374 | - .fontWeight(500) | ||
| 375 | - .lineHeight(19) | 373 | + if(this.showDownload) { |
| 374 | + Column(){ | ||
| 375 | + Row() { | ||
| 376 | + Flex({ | ||
| 377 | + direction: FlexDirection.Row, | ||
| 378 | + justifyContent: FlexAlign.SpaceBetween | ||
| 379 | + }) { | ||
| 380 | + if(this.contentDetailData?.photoList?.length) { | ||
| 381 | + Text() { | ||
| 382 | + Span(`${this.swiperIndex + 1}`) | ||
| 383 | + .fontSize(24) | ||
| 384 | + .fontFamily('PingFang SC-Medium') | ||
| 385 | + .fontWeight(500) | ||
| 386 | + .lineHeight(28) | ||
| 387 | + Span(`/${this.contentDetailData?.photoList?.length}`) | ||
| 388 | + .fontSize(14) | ||
| 389 | + .fontFamily('PingFang SC-Medium') | ||
| 390 | + .fontWeight(500) | ||
| 391 | + .lineHeight(19) | ||
| 392 | + } | ||
| 393 | + .fontColor(Color.White) | ||
| 394 | + .margin(4) | ||
| 376 | } | 395 | } |
| 377 | - .fontColor(Color.White) | ||
| 378 | - .margin(4) | ||
| 379 | - } | ||
| 380 | 396 | ||
| 381 | - if(this.contentDetailData.photoList?.[this.swiperIndex].picPath) { | ||
| 382 | - ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) | ||
| 383 | - .margin({ | ||
| 384 | - top: 8, | ||
| 385 | - left: 18, | ||
| 386 | - bottom: 24, | ||
| 387 | - right: 18 | ||
| 388 | - }) | 397 | + if(this.contentDetailData.photoList?.[this.swiperIndex].picPath) { |
| 398 | + ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) | ||
| 399 | + .margin({ | ||
| 400 | + top: 8, | ||
| 401 | + left: 18, | ||
| 402 | + bottom: 24, | ||
| 403 | + right: 18 | ||
| 404 | + }) | ||
| 405 | + } | ||
| 389 | } | 406 | } |
| 390 | } | 407 | } |
| 408 | + .width('100%') | ||
| 391 | } | 409 | } |
| 392 | - .width('100%') | 410 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 411 | + TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) | ||
| 412 | + )) | ||
| 393 | } | 413 | } |
| 394 | - .visibility(this.showDownload ? Visibility.Visible : Visibility.None) | ||
| 395 | } | 414 | } |
| 396 | .zIndex(10) | 415 | .zIndex(10) |
| 397 | .id('e_swiper_bottom') | 416 | .id('e_swiper_bottom') |
| @@ -199,7 +199,9 @@ struct EditUserInfoPage { | @@ -199,7 +199,9 @@ struct EditUserInfoPage { | ||
| 199 | getAccountOwnerInfo(){ | 199 | getAccountOwnerInfo(){ |
| 200 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { | 200 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { |
| 201 | this.listData = [] | 201 | this.listData = [] |
| 202 | - this.headerImg = editModel.userExtend.headPhotoUrl | 202 | + if (editModel.userExtend.headPhotoUrl) { |
| 203 | + this.headerImg = editModel.userExtend.headPhotoUrl | ||
| 204 | + } | ||
| 203 | this.currentUserInfo = editModel as editModel; | 205 | this.currentUserInfo = editModel as editModel; |
| 204 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) | 206 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) |
| 205 | }); | 207 | }); |
| @@ -22,6 +22,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | @@ -22,6 +22,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 22 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 22 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 23 | import { PageRepository } from '../../repository/PageRepository'; | 23 | import { PageRepository } from '../../repository/PageRepository'; |
| 24 | import { SpConstants } from 'wdConstant/Index'; | 24 | import { SpConstants } from 'wdConstant/Index'; |
| 25 | +import { WDShare } from 'wdShare/Index'; | ||
| 25 | 26 | ||
| 26 | const TAG = 'OperRowListView'; | 27 | const TAG = 'OperRowListView'; |
| 27 | 28 | ||
| @@ -49,13 +50,16 @@ export struct OperRowListView { | @@ -49,13 +50,16 @@ export struct OperRowListView { | ||
| 49 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 50 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 50 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 51 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 51 | @State likeBean: Record<string, string> = {} | 52 | @State likeBean: Record<string, string> = {} |
| 52 | - @State audioUrl: string= '' | 53 | + @State audioUrl: string = '' |
| 54 | + @State bgColor: ResourceColor = Color.White | ||
| 53 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 55 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 54 | needLike: boolean = true | 56 | needLike: boolean = true |
| 55 | 57 | ||
| 56 | // async aboutToAppear() { | 58 | // async aboutToAppear() { |
| 57 | async onDetailUpdated() { | 59 | async onDetailUpdated() { |
| 58 | - if (!this.contentDetailData) return | 60 | + if (!this.contentDetailData) { |
| 61 | + return | ||
| 62 | + } | ||
| 59 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 63 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 60 | if (user_id) { | 64 | if (user_id) { |
| 61 | this.getInteractDataStatus() | 65 | this.getInteractDataStatus() |
| @@ -123,7 +127,7 @@ export struct OperRowListView { | @@ -123,7 +127,7 @@ export struct OperRowListView { | ||
| 123 | .justifyContent(FlexAlign.Start) | 127 | .justifyContent(FlexAlign.Start) |
| 124 | } | 128 | } |
| 125 | .width('100%') | 129 | .width('100%') |
| 126 | - .backgroundColor(Color.White) | 130 | + .backgroundColor(this.bgColor) |
| 127 | .padding({ | 131 | .padding({ |
| 128 | top: 10, | 132 | top: 10, |
| 129 | // bottom: `${this.bottomSafeHeight}px` | 133 | // bottom: `${this.bottomSafeHeight}px` |
| @@ -173,7 +177,8 @@ export struct OperRowListView { | @@ -173,7 +177,8 @@ export struct OperRowListView { | ||
| 173 | builderCollect() { | 177 | builderCollect() { |
| 174 | Column() { | 178 | Column() { |
| 175 | Stack({ alignContent: Alignment.TopEnd }) { | 179 | Stack({ alignContent: Alignment.TopEnd }) { |
| 176 | - Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') : $r('app.media.iv_live_comment_collect_un')) | 180 | + Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') : |
| 181 | + $r('app.media.iv_live_comment_collect_un')) | ||
| 177 | .width(24) | 182 | .width(24) |
| 178 | .height(24) | 183 | .height(24) |
| 179 | .interpolation(ImageInterpolation.High) | 184 | .interpolation(ImageInterpolation.High) |
| @@ -225,12 +230,17 @@ export struct OperRowListView { | @@ -225,12 +230,17 @@ export struct OperRowListView { | ||
| 225 | .aspectRatio(1) | 230 | .aspectRatio(1) |
| 226 | .interpolation(ImageInterpolation.High) | 231 | .interpolation(ImageInterpolation.High) |
| 227 | .onClick((event: ClickEvent) => { | 232 | .onClick((event: ClickEvent) => { |
| 228 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | 233 | + // ToastUtils.showToast('分享为公共方法,待开发', 1000); |
| 234 | + this.share() | ||
| 229 | }) | 235 | }) |
| 230 | } | 236 | } |
| 231 | .width(42) | 237 | .width(42) |
| 232 | } | 238 | } |
| 233 | 239 | ||
| 240 | + share() { | ||
| 241 | + WDShare.shareContent(this.contentDetailData) | ||
| 242 | + } | ||
| 243 | + | ||
| 234 | // 已登录->查询用户对作品收藏状态 | 244 | // 已登录->查询用户对作品收藏状态 |
| 235 | private async getInteractDataStatus() { | 245 | private async getInteractDataStatus() { |
| 236 | try { | 246 | try { |
| @@ -273,7 +283,7 @@ export struct OperRowListView { | @@ -273,7 +283,7 @@ export struct OperRowListView { | ||
| 273 | PageRepository.postExecuteCollectRecord(params).then(res => { | 283 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 274 | if (this.newsStatusOfUser) { | 284 | if (this.newsStatusOfUser) { |
| 275 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 285 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 276 | - if(this.newsStatusOfUser.collectStatus === 1){ | 286 | + if (this.newsStatusOfUser.collectStatus === 1) { |
| 277 | promptAction.showToast({ message: '收藏成功' }) | 287 | promptAction.showToast({ message: '收藏成功' }) |
| 278 | } | 288 | } |
| 279 | this.queryContentInteractCount() | 289 | this.queryContentInteractCount() |
| @@ -299,7 +309,8 @@ export struct OperRowListView { | @@ -299,7 +309,8 @@ export struct OperRowListView { | ||
| 299 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 309 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 300 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 310 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 301 | // 评论组件需要数据 | 311 | // 评论组件需要数据 |
| 302 | - if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 312 | + if (Number.parseInt(this.interactData.commentNum) > |
| 313 | + Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | ||
| 303 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | 314 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' |
| 304 | } | 315 | } |
| 305 | } | 316 | } |
| 1 | -import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { Action, ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { LiveCommentComponent } from 'wdComponent/Index' | 2 | import { LiveCommentComponent } from 'wdComponent/Index' |
| 3 | +import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | ||
| 4 | +import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView' | ||
| 3 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | 5 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' |
| 4 | import { DisplayDirection, ViewType } from 'wdConstant/Index' | 6 | import { DisplayDirection, ViewType } from 'wdConstant/Index' |
| 7 | +import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | ||
| 8 | +import { ResponseDTO } from 'wdNetwork/Index' | ||
| 5 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 9 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 6 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' | 10 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' |
| 7 | import { ChatItemComponent } from './ChartItemComponent' | 11 | import { ChatItemComponent } from './ChartItemComponent' |
| 12 | +import { router } from '@kit.ArkUI' | ||
| 8 | 13 | ||
| 14 | +const TAG = "PlayerCommentComponent" | ||
| 9 | 15 | ||
| 10 | @Component | 16 | @Component |
| 11 | export struct PlayerCommentComponent { | 17 | export struct PlayerCommentComponent { |
| @@ -15,10 +21,25 @@ export struct PlayerCommentComponent { | @@ -15,10 +21,25 @@ export struct PlayerCommentComponent { | ||
| 15 | @Consume displayDirection: DisplayDirection | 21 | @Consume displayDirection: DisplayDirection |
| 16 | @State private pageModel: PageModel = new PageModel() | 22 | @State private pageModel: PageModel = new PageModel() |
| 17 | @State liveChatList: Array<LiveRoomItemBean> = [] | 23 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 24 | + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | ||
| 25 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 26 | + @State contentId: string = '' | ||
| 27 | + @State relId: string = '' | ||
| 28 | + @State relType: string = '' | ||
| 18 | scroller: Scroller = new Scroller() | 29 | scroller: Scroller = new Scroller() |
| 19 | 30 | ||
| 20 | aboutToAppear(): void { | 31 | aboutToAppear(): void { |
| 21 | this.getLiveChatList() | 32 | this.getLiveChatList() |
| 33 | + const action: Action = router.getParams() as Action | ||
| 34 | + if (action) { | ||
| 35 | + this.contentId = action.params?.contentID || '' | ||
| 36 | + if (action.params && action.params.extra) { | ||
| 37 | + this.relId = action.params.extra.relId || '' | ||
| 38 | + this.relType = action.params.extra.relType || '' | ||
| 39 | + } | ||
| 40 | + this.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 41 | + } | ||
| 42 | + | ||
| 22 | } | 43 | } |
| 23 | 44 | ||
| 24 | liveDetailsBeanChange() { | 45 | liveDetailsBeanChange() { |
| @@ -58,6 +79,32 @@ export struct PlayerCommentComponent { | @@ -58,6 +79,32 @@ export struct PlayerCommentComponent { | ||
| 58 | }) | 79 | }) |
| 59 | } | 80 | } |
| 60 | 81 | ||
| 82 | + async getContentDetail(contentId: string, relId: string, relType: string) { | ||
| 83 | + await ContentDetailRequest.getContentDetail({ | ||
| 84 | + contentId: contentId, | ||
| 85 | + relId: relId, | ||
| 86 | + relType: relType | ||
| 87 | + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | ||
| 88 | + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | ||
| 89 | + if (resDTO.data) { | ||
| 90 | + | ||
| 91 | + this.contentDetailData = resDTO.data?.[0]; | ||
| 92 | + | ||
| 93 | + if (this.contentDetailData?.openComment) { | ||
| 94 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 95 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 96 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 97 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 98 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 99 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 100 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + } | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + | ||
| 61 | build() { | 108 | build() { |
| 62 | Column() { | 109 | Column() { |
| 63 | List({ scroller: this.scroller }) { | 110 | List({ scroller: this.scroller }) { |
| @@ -76,9 +123,17 @@ export struct PlayerCommentComponent { | @@ -76,9 +123,17 @@ export struct PlayerCommentComponent { | ||
| 76 | .scrollBar(BarState.Off) | 123 | .scrollBar(BarState.Off) |
| 77 | .margin({ bottom: 20 }) | 124 | .margin({ bottom: 20 }) |
| 78 | 125 | ||
| 79 | - LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 126 | + OperRowListView({ |
| 127 | + bgColor: Color.Transparent, | ||
| 128 | + operationButtonList: ['comment', 'collect', 'share', 'like'], | ||
| 129 | + contentDetailData: this.contentDetailData, | ||
| 130 | + publishCommentModel: this.publishCommentModel, | ||
| 131 | + }) | ||
| 80 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 132 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 81 | - .backgroundColor(Color.Black) | 133 | + |
| 134 | + // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | ||
| 135 | + // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | ||
| 136 | + // .backgroundColor(Color.Black) | ||
| 82 | }.alignItems(HorizontalAlign.Start) | 137 | }.alignItems(HorizontalAlign.Start) |
| 83 | 138 | ||
| 84 | } | 139 | } |
| @@ -10,6 +10,8 @@ export struct PlayerComponent { | @@ -10,6 +10,8 @@ export struct PlayerComponent { | ||
| 10 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 10 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 11 | @Consume @Watch('pageShowChange') pageShow: number | 11 | @Consume @Watch('pageShowChange') pageShow: number |
| 12 | @Consume @Watch('pageHideChange') pageHide: number | 12 | @Consume @Watch('pageHideChange') pageHide: number |
| 13 | + @Consume isShowControl: boolean | ||
| 14 | + @Consume liveState: string | ||
| 13 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 15 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 14 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 16 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 15 | @State imgUrl: string = '' | 17 | @State imgUrl: string = '' |
| @@ -92,6 +94,11 @@ export struct PlayerComponent { | @@ -92,6 +94,11 @@ export struct PlayerComponent { | ||
| 92 | .width('100%') | 94 | .width('100%') |
| 93 | .align(Alignment.Top) | 95 | .align(Alignment.Top) |
| 94 | .alignContent(Alignment.Top) | 96 | .alignContent(Alignment.Top) |
| 97 | + .onClick(() => { | ||
| 98 | + if (this.liveState === 'end') { | ||
| 99 | + this.isShowControl = !this.isShowControl | ||
| 100 | + } | ||
| 101 | + }) | ||
| 95 | } | 102 | } |
| 96 | .height('100%') | 103 | .height('100%') |
| 97 | .width('100%') | 104 | .width('100%') |
| @@ -26,11 +26,11 @@ export struct PlayerInfoComponent { | @@ -26,11 +26,11 @@ export struct PlayerInfoComponent { | ||
| 26 | .width('100%') | 26 | .width('100%') |
| 27 | .height('100%') | 27 | .height('100%') |
| 28 | .index(this.swiperIndex) | 28 | .index(this.swiperIndex) |
| 29 | - .onClick(() => { | ||
| 30 | - if (this.liveState === 'end') { | ||
| 31 | - this.isShowControl = !this.isShowControl | ||
| 32 | - } | ||
| 33 | - }) | 29 | + // .onClick(() => { |
| 30 | + // if (this.liveState === 'end') { | ||
| 31 | + // this.isShowControl = !this.isShowControl | ||
| 32 | + // } | ||
| 33 | + // }) | ||
| 34 | .onChange((index) => { | 34 | .onChange((index) => { |
| 35 | this.swiperIndex = index | 35 | this.swiperIndex = index |
| 36 | }) | 36 | }) |
| @@ -4,9 +4,11 @@ import { WDRouterPage } from 'wdRouter'; | @@ -4,9 +4,11 @@ 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'),$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')] | 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 | + guideImage = [$r('app.media.guide_Static')] | ||
| 11 | + guideIndex = [$r('app.media.guide_button')] | ||
| 10 | 12 | ||
| 11 | build() { | 13 | build() { |
| 12 | Column() { | 14 | Column() { |
| @@ -32,32 +34,34 @@ struct GuidePages { | @@ -32,32 +34,34 @@ struct GuidePages { | ||
| 32 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 34 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 33 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 35 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| 34 | }) | 36 | }) |
| 37 | + .margin({bottom:150}) | ||
| 35 | .width('100%') | 38 | .width('100%') |
| 36 | - .height('100%') | 39 | + .height('60%') |
| 37 | .id('image') | 40 | .id('image') |
| 38 | - Image(this.guideTitle[index]) | ||
| 39 | - .objectFit(ImageFit.ScaleDown) | ||
| 40 | - .alignRules({ | ||
| 41 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 42 | - left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 43 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 44 | - }) | ||
| 45 | - .margin({ left: 60, bottom: 150, right: 60 }) | ||
| 46 | - .alignSelf(ItemAlign.Center) | ||
| 47 | - .id('title') | 41 | + // Image('') |
| 42 | + // .objectFit(imagefit.scaledown) | ||
| 43 | + // .alignRules({ | ||
| 44 | + // bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 45 | + // left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 46 | + // right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 47 | + // }) | ||
| 48 | + // .margin({ left: 60, bottom: 150, right: 60 }) | ||
| 49 | + // .alignSelf(ItemAlign.Center) | ||
| 50 | + // .id('title') | ||
| 48 | 51 | ||
| 49 | Image(this.guideIndex[index]) | 52 | Image(this.guideIndex[index]) |
| 50 | - .objectFit(ImageFit.ScaleDown) | 53 | + .objectFit(ImageFit.Fill) |
| 51 | .alignRules({ | 54 | .alignRules({ |
| 52 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 55 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 53 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 56 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 54 | right: { anchor: "__container__", align: HorizontalAlign.End }, | 57 | right: { anchor: "__container__", align: HorizontalAlign.End }, |
| 55 | 58 | ||
| 56 | }) | 59 | }) |
| 57 | - .margin({ bottom: 85 }) | ||
| 58 | - .height(40) | 60 | + .margin({ bottom: 85}) |
| 61 | + .width(191) | ||
| 62 | + .height(44) | ||
| 59 | .onClick(() => { | 63 | .onClick(() => { |
| 60 | - if (index == 4) { | 64 | + if (index == 0) { |
| 61 | // 跳转到首页 | 65 | // 跳转到首页 |
| 62 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 66 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 63 | //跳转到兴趣偏好选择页 | 67 | //跳转到兴趣偏好选择页 |
| @@ -5,7 +5,7 @@ import router from '@ohos.router' | @@ -5,7 +5,7 @@ import router from '@ohos.router' | ||
| 5 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 5 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 6 | import { SettingPasswordParams } from './SettingPasswordLayout' | 6 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 7 | import { Router } from '@ohos.arkui.UIContext' | 7 | import { Router } from '@ohos.arkui.UIContext' |
| 8 | -import { CustomToast, EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' | 8 | +import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, ToastUtils } from 'wdKit/Index' |
| 9 | import { SpConstants } from 'wdConstant/Index' | 9 | import { SpConstants } from 'wdConstant/Index' |
| 10 | import { emitter } from '@kit.BasicServicesKit' | 10 | import { emitter } from '@kit.BasicServicesKit' |
| 11 | 11 | ||
| @@ -128,7 +128,12 @@ struct ForgetPasswordPage { | @@ -128,7 +128,12 @@ struct ForgetPasswordPage { | ||
| 128 | this.isCodeSend=false | 128 | this.isCodeSend=false |
| 129 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) | 129 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) |
| 130 | }).catch((message: string)=>{ | 130 | }).catch((message: string)=>{ |
| 131 | - this.showToastTip(message) | 131 | + let netStatus = NetworkUtil.isNetConnected() |
| 132 | + if (netStatus) { | ||
| 133 | + this.showToastTip(message) | ||
| 134 | + } else { | ||
| 135 | + this.showToastTip("验证码获取失败,请重新尝试") | ||
| 136 | + } | ||
| 132 | this.codeStateSuccess=false | 137 | this.codeStateSuccess=false |
| 133 | this.isCodeSend=false | 138 | this.isCodeSend=false |
| 134 | }) | 139 | }) |
| @@ -13,12 +13,25 @@ export struct LoginInputComponent { | @@ -13,12 +13,25 @@ export struct LoginInputComponent { | ||
| 13 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 | 13 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 |
| 14 | lastTime: number = 0 | 14 | lastTime: number = 0 |
| 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 | 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 |
| 16 | + @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态 | ||
| 17 | + @State isNeedProtocol:boolean = false | ||
| 18 | + | ||
| 16 | build() { | 19 | build() { |
| 17 | Column() { | 20 | Column() { |
| 18 | this.addCodeLayout() | 21 | this.addCodeLayout() |
| 19 | }.width('100%').padding({ left: 25, right: 25 }) | 22 | }.width('100%').padding({ left: 25, right: 25 }) |
| 20 | } | 23 | } |
| 21 | 24 | ||
| 25 | + onCheckChange(){ | ||
| 26 | + if(this.isNeedProtocol){ | ||
| 27 | + if(this.protocolState && this.phoneContent.length >= 11){ | ||
| 28 | + this.codeBtnState = true | ||
| 29 | + }else{ | ||
| 30 | + this.codeBtnState = false | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 22 | async aboutToAppear(){ | 35 | async aboutToAppear(){ |
| 23 | if (this.pageType == 1) { | 36 | if (this.pageType == 1) { |
| 24 | this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string; | 37 | this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string; |
| @@ -27,7 +40,7 @@ export struct LoginInputComponent { | @@ -27,7 +40,7 @@ export struct LoginInputComponent { | ||
| 27 | @Builder | 40 | @Builder |
| 28 | addCodeLayout() { | 41 | addCodeLayout() { |
| 29 | if (this.pageType == 1){ | 42 | if (this.pageType == 1){ |
| 30 | - TextInput({ placeholder: this.securityPhone(this.phoneContent) }) | 43 | + TextInput({ text: this.securityPhone(this.phoneContent) }) |
| 31 | .placeholderColor("#CCCCCC") | 44 | .placeholderColor("#CCCCCC") |
| 32 | .fontSize(16) | 45 | .fontSize(16) |
| 33 | .height(48) | 46 | .height(48) |
| @@ -59,10 +72,19 @@ export struct LoginInputComponent { | @@ -59,10 +72,19 @@ export struct LoginInputComponent { | ||
| 59 | .onChange((content) => { | 72 | .onChange((content) => { |
| 60 | this.phoneContent = content | 73 | this.phoneContent = content |
| 61 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) | 74 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) |
| 62 | - if (content.length >= 11) { | ||
| 63 | - this.codeBtnState = true | ||
| 64 | - } else { | ||
| 65 | - this.codeBtnState = false | 75 | + |
| 76 | + if(this.isNeedProtocol){ | ||
| 77 | + if (content.length >= 11 && this.protocolState) { | ||
| 78 | + this.codeBtnState = true | ||
| 79 | + } else { | ||
| 80 | + this.codeBtnState = false | ||
| 81 | + } | ||
| 82 | + }else{ | ||
| 83 | + if (content.length >= 11 ) { | ||
| 84 | + this.codeBtnState = true | ||
| 85 | + } else { | ||
| 86 | + this.codeBtnState = false | ||
| 87 | + } | ||
| 66 | } | 88 | } |
| 67 | }) | 89 | }) |
| 68 | } | 90 | } |
| @@ -97,6 +119,12 @@ export struct LoginInputComponent { | @@ -97,6 +119,12 @@ export struct LoginInputComponent { | ||
| 97 | if (this.phoneContent.length < 11) { | 119 | if (this.phoneContent.length < 11) { |
| 98 | return | 120 | return |
| 99 | } | 121 | } |
| 122 | + if(this.isNeedProtocol){ | ||
| 123 | + if (!this.protocolState ) { | ||
| 124 | + return | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + | ||
| 100 | let currentTime = DateTimeUtils.getTimeStamp() | 128 | let currentTime = DateTimeUtils.getTimeStamp() |
| 101 | if (currentTime - this.lastTime < 500) { | 129 | if (currentTime - this.lastTime < 500) { |
| 102 | return | 130 | return |
| 1 | -import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils } from 'wdKit' | 1 | +import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit' |
| 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' | 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' |
| 3 | import router from '@ohos.router' | 3 | import router from '@ohos.router' |
| 4 | import { LoginViewModel } from './LoginViewModel' | 4 | import { LoginViewModel } from './LoginViewModel' |
| @@ -106,7 +106,9 @@ struct LoginPage { | @@ -106,7 +106,9 @@ struct LoginPage { | ||
| 106 | codeContent: $codeContent, | 106 | codeContent: $codeContent, |
| 107 | isSubmit: $isSubmit, | 107 | isSubmit: $isSubmit, |
| 108 | isCodeSend: $isCodeSend, | 108 | isCodeSend: $isCodeSend, |
| 109 | - codeStateSuccess:$codeStateSuccess | 109 | + codeStateSuccess:$codeStateSuccess, |
| 110 | + protocolState:this.protocolState, | ||
| 111 | + isNeedProtocol:true | ||
| 110 | }) | 112 | }) |
| 111 | } else { | 113 | } else { |
| 112 | this.addPassword() | 114 | this.addPassword() |
| @@ -347,7 +349,12 @@ struct LoginPage { | @@ -347,7 +349,12 @@ struct LoginPage { | ||
| 347 | this.codeStateSuccess=true | 349 | this.codeStateSuccess=true |
| 348 | this.isCodeSend=false | 350 | this.isCodeSend=false |
| 349 | }).catch((message:string)=>{ | 351 | }).catch((message:string)=>{ |
| 350 | - this.showToastTip(message) | 352 | + let netStatus = NetworkUtil.isNetConnected() |
| 353 | + if (netStatus) { | ||
| 354 | + this.showToastTip(message) | ||
| 355 | + } else { | ||
| 356 | + this.showToastTip("验证码获取失败,请重新尝试") | ||
| 357 | + } | ||
| 351 | this.codeStateSuccess=false | 358 | this.codeStateSuccess=false |
| 352 | this.isCodeSend=false | 359 | this.isCodeSend=false |
| 353 | Logger.debug(TAG, "sendVerifyCode: " + message) | 360 | Logger.debug(TAG, "sendVerifyCode: " + message) |
| @@ -21,7 +21,7 @@ struct MainPage { | @@ -21,7 +21,7 @@ struct MainPage { | ||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | aboutToAppear() { | 23 | aboutToAppear() { |
| 24 | - HWLocationUtils.startLocationService() | 24 | + |
| 25 | this.breakpointSystem.register() | 25 | this.breakpointSystem.register() |
| 26 | 26 | ||
| 27 | let context = getContext(this) as common.UIAbilityContext | 27 | let context = getContext(this) as common.UIAbilityContext |
| @@ -31,6 +31,7 @@ struct MainPage { | @@ -31,6 +31,7 @@ struct MainPage { | ||
| 31 | 31 | ||
| 32 | // WDPushNotificationManager.getInstance().sendLocalNotification() | 32 | // WDPushNotificationManager.getInstance().sendLocalNotification() |
| 33 | } | 33 | } |
| 34 | + HWLocationUtils.startLocationService() | ||
| 34 | }) | 35 | }) |
| 35 | 36 | ||
| 36 | Logger.info(TAG, `aboutToAppear `); | 37 | Logger.info(TAG, `aboutToAppear `); |
| @@ -17,7 +17,7 @@ struct MorningEveningPaperPage { | @@ -17,7 +17,7 @@ struct MorningEveningPaperPage { | ||
| 17 | 17 | ||
| 18 | pageTransition() { | 18 | pageTransition() { |
| 19 | // 定义页面进入时的效果,从底侧滑入 | 19 | // 定义页面进入时的效果,从底侧滑入 |
| 20 | - PageTransitionEnter({ type: RouteType.None, duration: 300 }) | 20 | + PageTransitionEnter({ type: RouteType.Push, duration: 300 }) |
| 21 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { | 21 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { |
| 22 | if (progress >= 0.99) { | 22 | if (progress >= 0.99) { |
| 23 | WindowModel.shared.setWindowLayoutFullScreen(true) | 23 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -25,7 +25,7 @@ struct MorningEveningPaperPage { | @@ -25,7 +25,7 @@ struct MorningEveningPaperPage { | ||
| 25 | } | 25 | } |
| 26 | }) | 26 | }) |
| 27 | // 定义页面退出时的效果,向底侧滑出 | 27 | // 定义页面退出时的效果,向底侧滑出 |
| 28 | - PageTransitionExit({ type: RouteType.None, duration: 300 }) | 28 | + PageTransitionExit({ type: RouteType.Pop, duration: 300 }) |
| 29 | .slide(SlideEffect.Bottom) | 29 | .slide(SlideEffect.Bottom) |
| 30 | } | 30 | } |
| 31 | 31 |
| @@ -66,6 +66,15 @@ struct LaunchInterestsHobbiesPage { | @@ -66,6 +66,15 @@ struct LaunchInterestsHobbiesPage { | ||
| 66 | .backgroundColor(Color.White) | 66 | .backgroundColor(Color.White) |
| 67 | .borderRadius(5) | 67 | .borderRadius(5) |
| 68 | Stack(){ | 68 | Stack(){ |
| 69 | + Image('') | ||
| 70 | + .width('100%') | ||
| 71 | + .height('100%') | ||
| 72 | + .backgroundColor(Color.Gray) | ||
| 73 | + .opacity(item.choose?0.7:0) | ||
| 74 | + .borderRadius(5) | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + Stack(){ | ||
| 69 | Column({}){ | 78 | Column({}){ |
| 70 | Text(item.name) | 79 | Text(item.name) |
| 71 | .fontSize(18) | 80 | .fontSize(18) |
| @@ -88,14 +97,6 @@ struct LaunchInterestsHobbiesPage { | @@ -88,14 +97,6 @@ struct LaunchInterestsHobbiesPage { | ||
| 88 | }.justifyContent(FlexAlign.Start) | 97 | }.justifyContent(FlexAlign.Start) |
| 89 | } | 98 | } |
| 90 | 99 | ||
| 91 | - Stack(){ | ||
| 92 | - Image('') | ||
| 93 | - .width('100%') | ||
| 94 | - .height('100%') | ||
| 95 | - .backgroundColor(Color.White) | ||
| 96 | - .opacity(item.choose?0:0.6) | ||
| 97 | - .borderRadius(5) | ||
| 98 | - } | ||
| 99 | } | 100 | } |
| 100 | } | 101 | } |
| 101 | .width('192lpx') | 102 | .width('192lpx') |
-
Please register or login to post a comment