Showing
3 changed files
with
91 additions
and
105 deletions
| @@ -166,6 +166,25 @@ export class ProcessUtils { | @@ -166,6 +166,25 @@ export class ProcessUtils { | ||
| 166 | * @param content | 166 | * @param content |
| 167 | * */ | 167 | * */ |
| 168 | public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) { | 168 | public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) { |
| 169 | + let tempP = [] as PhotoListBean[] | ||
| 170 | + let relIndex = 0; | ||
| 171 | + for (let index = 0; index < photoList.length; index++) { | ||
| 172 | + const element = photoList[index]; | ||
| 173 | + if(!StringUtils.isEmpty(element.picPath)){ | ||
| 174 | + relIndex = relIndex+1 | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + tempP.length = relIndex | ||
| 178 | + relIndex = 0 | ||
| 179 | + for (let index = 0; index < photoList.length; index++) { | ||
| 180 | + const element = photoList[index]; | ||
| 181 | + if(!StringUtils.isEmpty(element.picPath)){ | ||
| 182 | + tempP[relIndex] = element | ||
| 183 | + relIndex = relIndex+1 | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + photoList.length = tempP.length | ||
| 187 | + photoList = tempP | ||
| 169 | let taskAction: Action = { | 188 | let taskAction: Action = { |
| 170 | type: 'JUMP_DETAIL_PAGE', | 189 | type: 'JUMP_DETAIL_PAGE', |
| 171 | params: { | 190 | params: { |
| @@ -312,6 +312,7 @@ struct indicatorAnimations { | @@ -312,6 +312,7 @@ struct indicatorAnimations { | ||
| 312 | .margin({ | 312 | .margin({ |
| 313 | bottom: -2 | 313 | bottom: -2 |
| 314 | }) | 314 | }) |
| 315 | + .fontFamily('BebasNeue') | ||
| 315 | .flexShrink(0) | 316 | .flexShrink(0) |
| 316 | .animation({ | 317 | .animation({ |
| 317 | duration: 300, | 318 | duration: 300, |
| @@ -219,6 +219,7 @@ export struct ZhSingleRow03 { | @@ -219,6 +219,7 @@ export struct ZhSingleRow03 { | ||
| 219 | 219 | ||
| 220 | @Builder | 220 | @Builder |
| 221 | ItemCard(item: ContentDTO) { | 221 | ItemCard(item: ContentDTO) { |
| 222 | + if (this.compDTO.operDataList.length >= 2) { | ||
| 222 | Column() { | 223 | Column() { |
| 223 | Row() { | 224 | Row() { |
| 224 | Image(this.loadImg ? item.coverUrl : '') | 225 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -226,6 +227,7 @@ export struct ZhSingleRow03 { | @@ -226,6 +227,7 @@ export struct ZhSingleRow03 { | ||
| 226 | .height(60) | 227 | .height(60) |
| 227 | .margin({right: 12}) | 228 | .margin({right: 12}) |
| 228 | .backgroundColor(0xf5f5f5) | 229 | .backgroundColor(0xf5f5f5) |
| 230 | + .margin({right: 12}) | ||
| 229 | 231 | ||
| 230 | Text(item.newsTitle) | 232 | Text(item.newsTitle) |
| 231 | .width(154) | 233 | .width(154) |
| @@ -266,27 +268,7 @@ export struct ZhSingleRow03 { | @@ -266,27 +268,7 @@ export struct ZhSingleRow03 { | ||
| 266 | .textAlign(TextAlign.Center) | 268 | .textAlign(TextAlign.Center) |
| 267 | .borderRadius(3) | 269 | .borderRadius(3) |
| 268 | .onClick(() => { | 270 | .onClick(() => { |
| 269 | - const isSubscribe = !this.isReserved(Number(item.objectId)) | ||
| 270 | - | ||
| 271 | - // 直播预约埋点 | ||
| 272 | - const params: ParamType = { | ||
| 273 | - 'contentName': item.newsTitle, | ||
| 274 | - 'contentType': item.objectType, | ||
| 275 | - "liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2, | ||
| 276 | - "vliveId": item.objectId, | ||
| 277 | - "vliveName": item.newsTitle, | ||
| 278 | - "contentId": item.objectId, | ||
| 279 | - "compId": item.relId, | ||
| 280 | - "contentStyle": item.appStyle, | ||
| 281 | - "liveType": getLiveState(item), | ||
| 282 | - 'contentShowChannelId': item.channelId, | ||
| 283 | - 'linkUrl': item.linkUrl, | ||
| 284 | - "pageId": this.pageId, | ||
| 285 | - "pageName": '直播', | ||
| 286 | - } | ||
| 287 | - Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`); | ||
| 288 | - Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params) | ||
| 289 | - this.bookAndCancel(item.relId, item.objectId, isSubscribe) | 271 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) |
| 290 | }) | 272 | }) |
| 291 | 273 | ||
| 292 | } | 274 | } |
| @@ -304,6 +286,74 @@ export struct ZhSingleRow03 { | @@ -304,6 +286,74 @@ export struct ZhSingleRow03 { | ||
| 304 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | 286 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) |
| 305 | ProcessUtils.processPage(item) | 287 | ProcessUtils.processPage(item) |
| 306 | }) | 288 | }) |
| 289 | + } else { | ||
| 290 | + Column() { | ||
| 291 | + Row() { | ||
| 292 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 293 | + .width(106) | ||
| 294 | + .height(60) | ||
| 295 | + .backgroundColor(0xf5f5f5) | ||
| 296 | + .margin({right: 12}) | ||
| 297 | + | ||
| 298 | + Text(item.newsTitle) | ||
| 299 | + .width(201) | ||
| 300 | + .height(60) | ||
| 301 | + .maxLines(3) | ||
| 302 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 303 | + } | ||
| 304 | + .margin({bottom: 16}) | ||
| 305 | + .justifyContent(FlexAlign.Start) | ||
| 306 | + | ||
| 307 | + Row() { | ||
| 308 | + Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 309 | + Row() { | ||
| 310 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 311 | + .margin({right: 6}) | ||
| 312 | + .fontColor(0x000000) | ||
| 313 | + .fontSize(13) | ||
| 314 | + .textAlign(TextAlign.Start) | ||
| 315 | + Image($r('app.media.timeline_rect')) | ||
| 316 | + .width(4) | ||
| 317 | + .height(3) | ||
| 318 | + .margin({right: 6}) | ||
| 319 | + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 320 | + .margin({right: 6}) | ||
| 321 | + .fontColor(0x000000) | ||
| 322 | + .fontSize(13) | ||
| 323 | + Text('开始直播') | ||
| 324 | + .fontColor(0xC8C8C8) | ||
| 325 | + .fontSize(13) | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + Row() { | ||
| 329 | + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | ||
| 330 | + .width(48) | ||
| 331 | + .height(24) | ||
| 332 | + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) | ||
| 333 | + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 334 | + .fontSize(12) | ||
| 335 | + .textAlign(TextAlign.Center) | ||
| 336 | + .borderRadius(3) | ||
| 337 | + .onClick(() => { | ||
| 338 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 339 | + }) | ||
| 340 | + | ||
| 341 | + } | ||
| 342 | + .margin({top: -5}) | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + } | ||
| 346 | + } | ||
| 347 | + .width('100%') | ||
| 348 | + .height(116) | ||
| 349 | + .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 350 | + .backgroundColor(0xf9f9f9) | ||
| 351 | + .margin({right: 8}) | ||
| 352 | + .onClick(() => { | ||
| 353 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 354 | + ProcessUtils.processPage(item) | ||
| 355 | + }) | ||
| 356 | + } | ||
| 307 | } | 357 | } |
| 308 | 358 | ||
| 309 | 359 | ||
| @@ -330,9 +380,6 @@ export struct ZhSingleRow03 { | @@ -330,9 +380,6 @@ export struct ZhSingleRow03 { | ||
| 330 | .width(14) | 380 | .width(14) |
| 331 | .height(14) | 381 | .height(14) |
| 332 | } | 382 | } |
| 333 | - .padding({ | ||
| 334 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 335 | - }) | ||
| 336 | .onClick(() => { | 383 | .onClick(() => { |
| 337 | this.jumpToMore(); | 384 | this.jumpToMore(); |
| 338 | }) | 385 | }) |
| @@ -362,85 +409,4 @@ export struct ZhSingleRow03 { | @@ -362,85 +409,4 @@ export struct ZhSingleRow03 { | ||
| 362 | 409 | ||
| 363 | } | 410 | } |
| 364 | 411 | ||
| 365 | -@Extend(Text) | ||
| 366 | -function textOverflowStyle(maxLine: number) { | ||
| 367 | - .maxLines(maxLine) | ||
| 368 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 369 | -} | ||
| 370 | 412 | ||
| 371 | -@Component | ||
| 372 | -struct CreatorItem { | ||
| 373 | - @Prop item: ContentDTO | ||
| 374 | - @State rmhIsAttention: number = 0 | ||
| 375 | - @State loadImg: boolean = false; | ||
| 376 | - | ||
| 377 | - async aboutToAppear(): Promise<void> { | ||
| 378 | - this.loadImg = await onlyWifiLoadImg(); | ||
| 379 | - } | ||
| 380 | - build() { | ||
| 381 | - ListItem() { | ||
| 382 | - Column() { | ||
| 383 | - Stack({ alignContent: Alignment.Bottom }) { | ||
| 384 | - Image(this.loadImg ? this.item.coverUrl : '') | ||
| 385 | - .backgroundColor(0xf5f5f5) | ||
| 386 | - .width(156) | ||
| 387 | - .height(208) | ||
| 388 | - .border({width: 1}) | ||
| 389 | - .borderRadius(3) | ||
| 390 | - Row() | ||
| 391 | - .width(156) | ||
| 392 | - .height(80) | ||
| 393 | - .linearGradient({ | ||
| 394 | - direction: GradientDirection.Bottom, | ||
| 395 | - colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] | ||
| 396 | - }) | ||
| 397 | - Text(this.item.newsTitle) | ||
| 398 | - .fontColor(0xffffff) | ||
| 399 | - .fontSize(14) | ||
| 400 | - .maxLines(2) | ||
| 401 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 402 | - .width(140) | ||
| 403 | - .margin({bottom: 8}) | ||
| 404 | - } | ||
| 405 | - } | ||
| 406 | - .width(156) | ||
| 407 | - .height(208) | ||
| 408 | - .margin({ right: 11 }) | ||
| 409 | - .borderColor($r('app.color.color_EDEDED')) | ||
| 410 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 411 | - } | ||
| 412 | - .onClick((event: ClickEvent) => { | ||
| 413 | - ProcessUtils.processPage(this.item) | ||
| 414 | - }) | ||
| 415 | - } | ||
| 416 | - | ||
| 417 | - /** | ||
| 418 | - * 关注号主 TODO 这里后面需要抽离 | ||
| 419 | - */ | ||
| 420 | - handleAccention(item: ContentDTO, status: number) { | ||
| 421 | - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 422 | - return | ||
| 423 | - // 未登录,跳转登录 | ||
| 424 | - if (!HttpUtils.getUserId()) { | ||
| 425 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 426 | - return | ||
| 427 | - } | ||
| 428 | - | ||
| 429 | - const params: postInteractAccentionOperateParams = { | ||
| 430 | - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 431 | - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 432 | - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 433 | - // userType: 1, | ||
| 434 | - // userId: '1', // TODO 用户id需要从本地获取 | ||
| 435 | - status: status, | ||
| 436 | - } | ||
| 437 | - PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 438 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 439 | - if (status === 1) { | ||
| 440 | - this.rmhIsAttention = 0 | ||
| 441 | - } else { | ||
| 442 | - this.rmhIsAttention = 1 | ||
| 443 | - } | ||
| 444 | - }) | ||
| 445 | - } | ||
| 446 | -} |
-
Please register or login to post a comment