47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
|
|
import { VideoMore } from '../model/VideoMoreModel'
|
|
import { BasicConstant } from '@itcast/basic'
|
|
import HashMap from '@ohos.util.HashMap';
|
|
import { videoTools } from '../polyv/VideoUtil'
|
|
@Preview
|
|
@Component
|
|
export struct ItemCompVideo {
|
|
@Prop item: VideoMore ;
|
|
|
|
hashMap: HashMap<string, string> = new HashMap();
|
|
@State heightss:Length=247
|
|
aboutToAppear(): void {
|
|
|
|
}
|
|
|
|
|
|
build() {
|
|
Column() {
|
|
|
|
Image(BasicConstant.urlHtml+this.item.imgpath).alt($r('app.media.default_video')).width('100%').height(102)
|
|
.objectFit(ImageFit.Fill)
|
|
|
|
Text(this.item.name).maxLines(2).fontSize(15).fontColor('app.color.666666').textAlign(TextAlign.Start).height(36)
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis }).id('title').width('100%').margin({top:10}).padding({left:10,right:10})
|
|
|
|
Row(){
|
|
Text(this.item.public_name).fontSize(14)
|
|
.fontColor($r('app.color.999999')).maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis }).layoutWeight(1)
|
|
Blank()
|
|
Image($r('app.media.video_look')).width(18).height(11)
|
|
Text(this.item.readnum+'').fontSize(14)
|
|
.fontColor($r('app.color.999999'))
|
|
}
|
|
.padding({left:10,right:10,bottom:10})
|
|
.width('100%')
|
|
.margin({top:6})
|
|
}.backgroundColor(Color.White)
|
|
.borderRadius(5)
|
|
.onClick(()=>{
|
|
const newReadNumber:number = Number(this.item.readnum)+1;
|
|
this.item.readnum = newReadNumber.toString();
|
|
videoTools.getVideoDetail(this.item.uuid)
|
|
})
|
|
.width('100%').clip(true)
|
|
}
|
|
} |