陈剑华

feat: 17052 UI还原问题--【生产环境】直播预告-横滑卡左右边距问题,看图

@@ -208,71 +208,141 @@ export struct ZhSingleRow03 { @@ -208,71 +208,141 @@ export struct ZhSingleRow03 {
208 208
209 @Builder 209 @Builder
210 ItemCard(item: ContentDTO) { 210 ItemCard(item: ContentDTO) {
211 - Column() {  
212 - Row() {  
213 - Image(this.loadImg ? item.coverUrl : '')  
214 - .width(106)  
215 - .height(60)  
216 - .margin({right: 12})  
217 - .backgroundColor(0xf5f5f5)  
218 -  
219 - Text(item.newsTitle)  
220 - .width(154)  
221 - .height(60)  
222 - .maxLines(3)  
223 - .textOverflow({overflow: TextOverflow.Ellipsis})  
224 - }  
225 - .margin({bottom: 16}) 211 + if (this.compDTO.operDataList.length >= 2) {
  212 + Column() {
  213 + Row() {
  214 + Image(this.loadImg ? item.coverUrl : '')
  215 + .width(106)
  216 + .height(60)
  217 + .margin({right: 12})
  218 + .backgroundColor(0xf5f5f5)
  219 + .margin({right: 12})
226 220
227 - Row() {  
228 - Flex({justifyContent: FlexAlign.SpaceBetween}){  
229 - Row() {  
230 - Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))  
231 - .margin({right: 6})  
232 - .fontColor(0x000000)  
233 - .fontSize(13)  
234 - .textAlign(TextAlign.Start)  
235 - Image($r('app.media.timeline_rect'))  
236 - .width(4)  
237 - .height(3)  
238 - .margin({right: 6})  
239 - Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))  
240 - .margin({right: 6})  
241 - .fontColor(0x000000)  
242 - .fontSize(13)  
243 - Text('开始直播')  
244 - .fontColor(0xC8C8C8)  
245 - .fontSize(13)  
246 - } 221 + Text(item.newsTitle)
  222 + .width(154)
  223 + .height(60)
  224 + .maxLines(3)
  225 + .textOverflow({overflow: TextOverflow.Ellipsis})
  226 + }
  227 + .margin({bottom: 16})
247 228
248 - Row() {  
249 - Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')  
250 - .width(48)  
251 - .height(24)  
252 - .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)  
253 - .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)  
254 - .fontSize(12)  
255 - .textAlign(TextAlign.Center)  
256 - .borderRadius(3)  
257 - .onClick(() => {  
258 - this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))  
259 - }) 229 + Row() {
  230 + Flex({justifyContent: FlexAlign.SpaceBetween}){
  231 + Row() {
  232 + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
  233 + .margin({right: 6})
  234 + .fontColor(0x000000)
  235 + .fontSize(13)
  236 + .textAlign(TextAlign.Start)
  237 + Image($r('app.media.timeline_rect'))
  238 + .width(4)
  239 + .height(3)
  240 + .margin({right: 6})
  241 + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
  242 + .margin({right: 6})
  243 + .fontColor(0x000000)
  244 + .fontSize(13)
  245 + Text('开始直播')
  246 + .fontColor(0xC8C8C8)
  247 + .fontSize(13)
  248 + }
  249 +
  250 + Row() {
  251 + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
  252 + .width(48)
  253 + .height(24)
  254 + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)
  255 + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)
  256 + .fontSize(12)
  257 + .textAlign(TextAlign.Center)
  258 + .borderRadius(3)
  259 + .onClick(() => {
  260 + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
  261 + })
260 262
  263 + }
  264 + .margin({top: -5})
261 } 265 }
262 - .margin({top: -5}) 266 +
263 } 267 }
  268 + }
  269 + .width(298)
  270 + .height(116)
  271 + .padding({top: 12, bottom: 12, left: 12, right: 12})
  272 + .backgroundColor(0xf9f9f9)
  273 + .margin({right: 8})
  274 + .onClick(() => {
  275 + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
  276 + ProcessUtils.processPage(item)
  277 + })
  278 + } else {
  279 + Column() {
  280 + Row() {
  281 + Image(this.loadImg ? item.coverUrl : '')
  282 + .width(106)
  283 + .height(60)
  284 + .backgroundColor(0xf5f5f5)
  285 + .margin({right: 12})
  286 +
  287 + Text(item.newsTitle)
  288 + .width(201)
  289 + .height(60)
  290 + .maxLines(3)
  291 + .textOverflow({overflow: TextOverflow.Ellipsis})
  292 + }
  293 + .margin({bottom: 16})
  294 + .justifyContent(FlexAlign.Start)
  295 +
  296 + Row() {
  297 + Flex({justifyContent: FlexAlign.SpaceBetween}){
  298 + Row() {
  299 + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
  300 + .margin({right: 6})
  301 + .fontColor(0x000000)
  302 + .fontSize(13)
  303 + .textAlign(TextAlign.Start)
  304 + Image($r('app.media.timeline_rect'))
  305 + .width(4)
  306 + .height(3)
  307 + .margin({right: 6})
  308 + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
  309 + .margin({right: 6})
  310 + .fontColor(0x000000)
  311 + .fontSize(13)
  312 + Text('开始直播')
  313 + .fontColor(0xC8C8C8)
  314 + .fontSize(13)
  315 + }
  316 +
  317 + Row() {
  318 + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
  319 + .width(48)
  320 + .height(24)
  321 + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)
  322 + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)
  323 + .fontSize(12)
  324 + .textAlign(TextAlign.Center)
  325 + .borderRadius(3)
  326 + .onClick(() => {
  327 + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
  328 + })
  329 +
  330 + }
  331 + .margin({top: -5})
  332 + }
264 333
  334 + }
265 } 335 }
  336 + .width('100%')
  337 + .height(116)
  338 + .padding({top: 12, bottom: 12, left: 12, right: 12})
  339 + .backgroundColor(0xf9f9f9)
  340 + .margin({right: 8})
  341 + .onClick(() => {
  342 + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
  343 + ProcessUtils.processPage(item)
  344 + })
266 } 345 }
267 - .width(298)  
268 - .height(116)  
269 - .padding({top: 12, bottom: 12, left: 12, right: 12})  
270 - .backgroundColor(0xf9f9f9)  
271 - .margin({right: 8})  
272 - .onClick(() => {  
273 - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)  
274 - ProcessUtils.processPage(item)  
275 - })  
276 } 346 }
277 347
278 348
@@ -299,9 +369,6 @@ export struct ZhSingleRow03 { @@ -299,9 +369,6 @@ export struct ZhSingleRow03 {
299 .width(14) 369 .width(14)
300 .height(14) 370 .height(14)
301 } 371 }
302 - .padding({  
303 - right: $r('app.float.card_comp_pagePadding_lf'),  
304 - })  
305 .onClick(() => { 372 .onClick(() => {
306 this.jumpToMore(); 373 this.jumpToMore();
307 }) 374 })
@@ -337,79 +404,3 @@ function textOverflowStyle(maxLine: number) { @@ -337,79 +404,3 @@ function textOverflowStyle(maxLine: number) {
337 .textOverflow({ overflow: TextOverflow.Ellipsis }) 404 .textOverflow({ overflow: TextOverflow.Ellipsis })
338 } 405 }
339 406
340 -@Component  
341 -struct CreatorItem {  
342 - @Prop item: ContentDTO  
343 - @State rmhIsAttention: number = 0  
344 - @State loadImg: boolean = false;  
345 -  
346 - async aboutToAppear(): Promise<void> {  
347 - this.loadImg = await onlyWifiLoadImg();  
348 - }  
349 - build() {  
350 - ListItem() {  
351 - Column() {  
352 - Stack({ alignContent: Alignment.Bottom }) {  
353 - Image(this.loadImg ? this.item.coverUrl : '')  
354 - .backgroundColor(0xf5f5f5)  
355 - .width(156)  
356 - .height(208)  
357 - .border({width: 1})  
358 - .borderRadius(3)  
359 - Row()  
360 - .width(156)  
361 - .height(80)  
362 - .linearGradient({  
363 - direction: GradientDirection.Bottom,  
364 - colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]]  
365 - })  
366 - Text(this.item.newsTitle)  
367 - .fontColor(0xffffff)  
368 - .fontSize(14)  
369 - .maxLines(2)  
370 - .textOverflow({overflow: TextOverflow.Ellipsis})  
371 - .width(140)  
372 - .margin({bottom: 8})  
373 - }  
374 - }  
375 - .width(156)  
376 - .height(208)  
377 - .margin({ right: 11 })  
378 - .borderColor($r('app.color.color_EDEDED'))  
379 - .borderRadius($r('app.float.image_border_radius'))  
380 - }  
381 - .onClick((event: ClickEvent) => {  
382 - ProcessUtils.processPage(this.item)  
383 - })  
384 - }  
385 -  
386 - /**  
387 - * 关注号主 TODO 这里后面需要抽离  
388 - */  
389 - handleAccention(item: ContentDTO, status: number) {  
390 - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1  
391 - return  
392 - // 未登录,跳转登录  
393 - if (!HttpUtils.getUserId()) {  
394 - WDRouterRule.jumpWithPage(WDRouterPage.loginPage)  
395 - return  
396 - }  
397 -  
398 - const params: postInteractAccentionOperateParams = {  
399 - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)  
400 - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id  
401 - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id  
402 - // userType: 1,  
403 - // userId: '1', // TODO 用户id需要从本地获取  
404 - status: status,  
405 - }  
406 - PageRepository.postInteractAccentionOperate(params).then(res => {  
407 - console.log(TAG, '关注号主==', JSON.stringify(res.data))  
408 - if (status === 1) {  
409 - this.rmhIsAttention = 0  
410 - } else {  
411 - this.rmhIsAttention = 1  
412 - }  
413 - })  
414 - }  
415 -}