xugenyuan

ref |> 精选评论列表展示加V和等级头像框

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -279,28 +279,15 @@ struct QualityCommentItem {
/*头像以及昵称*/
RelativeContainer() {
Image(this.item.fromUserHeader)
this.headerView()
.alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ?
'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon'))
.width(50)
.height(50)
.borderRadius(25)
.borderWidth(2)
.borderColor(Color.White)
.id('image1')
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset(
{
y: -16
if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0)
&& this.item.fromUserType === 1
&& ((this.item.api_levelHead && this.item.api_levelHead.length > 0)
|| (this.item.avatarFrame && this.item.avatarFrame.length > 0))) {
this.borderView()
}
)
.onClick(() => {
this.jumpToAccountOwner()
})
Text(this.item.fromUserName)
.fontSize(14)
.fontColor('#222222')
... ... @@ -404,12 +391,83 @@ struct QualityCommentItem {
}
@Builder headerView() {
Stack() {
Stack() {
Image(this.item.fromUserHeader)
.alt(commentViewModel.adjustUserType(this.item.fromUserType) ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.WDAccountDefaultIcon'))
.width(50)
.height(50)
.borderRadius(24)
.borderWidth(2)
.borderColor(Color.White)
.objectFit(ImageFit.Cover)
if (this.item.api_authIcon && this.item.api_authIcon.length > 0) {
Image(this.item.api_authIcon) // 加v
.width(12).height(12)
.objectFit(ImageFit.Cover)
}
}.width(50).height(50)
.alignContent(Alignment.BottomEnd)
}
.width(50)
.height(50)
.alignContent(Alignment.Center)
.id('image1')
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset(
{
y: -16
}
)
.onClick(() => {
this.jumpToAccountOwner()
})
}
@Builder borderView() {
Image(this.customBorderIconURL())
.objectFit(ImageFit.Cover)
.width(70)
.height(70)
.id('image2')
.alignRules({
middle: { anchor: "image1", align: HorizontalAlign.Center },
center: { anchor: "image1", align: VerticalAlign.Center }
})
.offset(
{
y: -16
}
)
.onClick(() => {
this.jumpToAccountOwner()
})
}
customBorderIconURL() : string {
if (this.item.avatarFrame.length > 0) {
return this.item.avatarFrame
}
if (this.item.fromUserType === 1) {
return this.item.api_levelHead
}
return ""
}
jumpToAccountOwner() {
commentViewModel.jumpToAccountPage(this.item)
commentViewModel.jumpToAccountPage(this.item, () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
})
}
jumpToDetail() {
WindowModel.shared.setWindowLayoutFullScreen(false)
// programInfoModel.api_isCommentAction = YES;
let content = new ContentDTO()
content.objectId = this.item.targetId;
... ... @@ -442,6 +500,7 @@ struct QualityCommentItem {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
WindowModel.shared.setWindowLayoutFullScreen(false)
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ...