zhenghy

修复频道页双击

... ... @@ -115,6 +115,15 @@ export struct BottomNavigationComponent {
.height(CommonConstants.FULL_PARENT)
.padding({ bottom: 15, left: 10, right: 10, top: 2 })
.aspectRatio(this.ASPECT_RATIO_1_1)
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.autoRefresh++
}
})
)
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
... ... @@ -126,16 +135,6 @@ export struct BottomNavigationComponent {
}
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
AlertDialog.show({ message: 'aa' })
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.autoRefresh++
}
})
)
.onClick(() => {
if (navItem.name === '我的') {
this.barBackgroundColor = Color.White
... ...
... ... @@ -12,9 +12,14 @@ import { WDPlayerController } from 'wdPlayer/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index'
interface ILikeStyleResp {
url: Resource;
name: string;
}
const TAG = 'PlayerRightView';
//视频点播页右侧操作栏:点赞/收藏/评论/分享 竖着排列
@Component
export struct PlayerRightView {
... ... @@ -210,15 +215,26 @@ export struct PlayerRightView {
/**
* 将点赞样式转换为icon
*/
transLikeStyle2Icon(): Resource {
transLikeStyle(): ILikeStyleResp {
if (this.likesStyle === 1) {
return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`)
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`),
name: '点赞'
}
} else if (this.likesStyle === 2) {
return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`)
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
name: '祈祷'
}
} else if (this.likesStyle === 3) {
return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`)
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`),
name: '默哀'
}
}
return {
url: $r(`app.media.icon_like_ckeck`), name: '点赞'
}
return $r(`app.media.icon_like_ckeck`)
}
transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') {
... ... @@ -238,14 +254,14 @@ export struct PlayerRightView {
@Builder
likeBuilderView() {
Column() {
Image(this.transLikeStyle2Icon())
Image(this.transLikeStyle().url)
.width(32)
.aspectRatio(1)
.onClick(() => {
// TODO:点赞动画
this.toggleLikeStatus()
})
Text(this.transNum2String('likeNum') || '赞')
Text(this.transNum2String('likeNum') || this.transLikeStyle().name)
.width('100%')
.fontWeight(500)
.textAlign(TextAlign.Center)
... ... @@ -253,6 +269,7 @@ export struct PlayerRightView {
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 2 })
}
.margin({ bottom: 20 })
.visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None)
... ... @@ -278,6 +295,7 @@ export struct PlayerRightView {
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 2 })
}
.margin({ bottom: 20 })
}
... ... @@ -302,6 +320,7 @@ export struct PlayerRightView {
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 2 })
}
.margin({ bottom: 20 })
}
... ... @@ -326,6 +345,7 @@ export struct PlayerRightView {
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ top: 2 })
}
.margin({ bottom: 20 })
}
... ...