douaojie

fix: 1

import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { Logger, LazyDataSource } from 'wdKit/Index';
import { Logger } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import PageViewModel from '../../viewmodel/PageViewModel';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
... ... @@ -8,6 +8,7 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
const TAG = 'Zh_Grid_Layout-02';
const FULL_PARENT: string = '100%';
let listSize: number = 2;
/**
* 双图卡
* 枚举值Zh_Grid_Layout-02
... ... @@ -20,6 +21,8 @@ export struct ZhGridLayout02 {
@State operDataList: ContentDTO[] = []
@State loadImg: boolean = false;
@State liveRoomList: LiveRoomDataBean[] = []
currentPage = 1
pageSize = 12
async aboutToAppear(): Promise<void> {
Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle)
... ... @@ -33,9 +36,6 @@ export struct ZhGridLayout02 {
this.loadImg = await onlyWifiLoadImg();
}
currentPage = 1
pageSize = 12
build() {
Column() {
Scroll() {
... ... @@ -51,7 +51,7 @@ export struct ZhGridLayout02 {
.fontWeight(600)
}
.justifyContent(FlexAlign.Start)
.margin({ top: 16, bottom: 8 })
.margin({ top: 16, bottom: 18 })
.width(CommonConstants.FULL_WIDTH)
GridRow({
... ... @@ -101,7 +101,7 @@ export struct ZhGridLayout02 {
@Builder
buildItemCard(item: ContentDTO) {
Column() {
Stack({alignContent: Alignment.BottomEnd}) {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
... ... @@ -114,10 +114,11 @@ export struct ZhGridLayout02 {
.fontColor(Color.White)
.margin({
right: '5vp',
bottom:'5vp'
bottom: '5vp'
})
}
}
Text(item.newsTitle)
.margin({ top: '5' })
.fontSize(13)
... ... @@ -130,14 +131,6 @@ export struct ZhGridLayout02 {
})
}
private getLiveDetailIds(list: ContentDTO[]): string {
let idList: string[] = []
list.forEach(item => {
idList.push(item.objectId)
});
return idList.join(',')
}
// 获取评论数
async getLiveRoomDataInfo(list: ContentDTO[]) {
const reserveIds = this.getLiveDetailIds(list)
... ... @@ -145,12 +138,12 @@ export struct ZhGridLayout02 {
if (result && result.length > 0) {
this.liveRoomList.push(...result)
}
}).catch(() =>{
}).catch(() => {
})
}
// 判断是否预约
getLiveRoomNumber(item: ContentDTO): string {
getLiveRoomNumber(item: ContentDTO): string {
const objc = this.liveRoomList.find((element: LiveRoomDataBean) => {
return element.liveId.toString() == item.objectId
})
... ... @@ -160,16 +153,6 @@ export struct ZhGridLayout02 {
return ''
}
private computeShowNum(count: number): string {
if (count >= 10000) {
let num = ( count / 10000).toFixed(1)
if (Number(num.substring(num.length-1)) == 0) {
num = num.substring(0, num.length-2)
}
return num + '万人参加'
}
return `${count}人参加`
}
addItems() {
Logger.debug(TAG, 'addItems')
this.currentPage++
... ... @@ -179,6 +162,25 @@ export struct ZhGridLayout02 {
Logger.debug(TAG, 'addItems after: ' + this.operDataList.length)
})
}
private getLiveDetailIds(list: ContentDTO[]): string {
let idList: string[] = []
list.forEach(item => {
idList.push(item.objectId)
});
return idList.join(',')
}
private computeShowNum(count: number): string {
if (count >= 10000) {
let num = (count / 10000).toFixed(1)
if (Number(num.substring(num.length - 1)) == 0) {
num = num.substring(0, num.length - 2)
}
return num + '万人参加'
}
return `${count}人参加`
}
}
... ...