王士厅

Merge remote-tracking branch 'origin/main'

... ... @@ -189,21 +189,26 @@ export struct CardSourceInfo {
}
calcContentSpace() {
console.log('display-text ,', this.displayText)
if (this.isLimited()) return;
const screenWidth = px2vp(display.getDefaultDisplaySync().width)
const screenWidth = display.getDefaultDisplaySync().width
let leftSpace = screenWidth;
console.log('display-leftSpace ', leftSpace)
const souceSize = this.getContentSize(this.displayText, 12);
const dotSize = 11;
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
leftSpace = leftSpace - cornerSize
console.log('display-cornerMark ', cornerSize)
}
if (this.showTime()) {
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
leftSpace = leftSpace - dotSize - timeSize
console.log('display-showtime')
}
if (!this.isEllipsisActive) {
... ... @@ -213,12 +218,14 @@ export struct CardSourceInfo {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
leftSpace = leftSpace - dotSize - commentSize
console.log('display-commentSize ', commentSize)
}
if (leftSpace < souceSize) {
this.onlyShowCornerAndSource = true;
console.log('display-size 1')
}
console.log('display-size 2,', leftSpace, souceSize, this.onlyShowCornerAndSource)
}
build() {
... ... @@ -313,7 +320,6 @@ export struct CardSourceInfo {
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: this.viewShowData ? 8 : 0 })
.clip(true)
}
... ...