王士厅

fix: 图集底部顶部有文字时,添加蒙层

... ... @@ -156,146 +156,157 @@ export struct MultiPictureDetailPageComponent {
@Builder
rmh() {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
Row(){
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
}
.width('13%')
.height('100%')
}
.width('13%')
.height('100%')
}
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
}
.width('81%')
.height('100%')
}
.width('81%')
.width('74.4%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
}
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
.width('100%')
.height(44)
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
.width('100%')
.height(44)
.height(44 + px2vp(this.topSafeHeight))
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
.linearGradient({
direction: GradientDirection.Top, // 渐变方向
colors: [['rgba(18, 18, 18, 0)', 0],
['rgba(18, 18, 18, 1)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
.opacity(0.5)
}
}
... ... @@ -437,6 +448,12 @@ export struct MultiPictureDetailPageComponent {
.edgeEffect(EdgeEffect.None)
.scrollBarWidth(0)
.scrollBar(BarState.Off)
.linearGradient({
direction: GradientDirection.Bottom, // 渐变方向
colors: [['rgba(18, 18, 18, 0)', 0],
['rgba(18, 18, 18, 1)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
.opacity(0.5)
OperRowListView({
contentDetailData: this.contentDetailData,
... ...