zhenghy

修复频道页双击

@@ -115,6 +115,15 @@ export struct BottomNavigationComponent { @@ -115,6 +115,15 @@ export struct BottomNavigationComponent {
115 .height(CommonConstants.FULL_PARENT) 115 .height(CommonConstants.FULL_PARENT)
116 .padding({ bottom: 15, left: 10, right: 10, top: 2 }) 116 .padding({ bottom: 15, left: 10, right: 10, top: 2 })
117 .aspectRatio(this.ASPECT_RATIO_1_1) 117 .aspectRatio(this.ASPECT_RATIO_1_1)
  118 + .gesture(
  119 + TapGesture({ count: 2 })
  120 + .onAction((event: GestureEvent) => {
  121 + if (this.currentNavIndex === index) {
  122 + // 当前tab,双击事件
  123 + this.autoRefresh++
  124 + }
  125 + })
  126 + )
118 127
119 Text(navItem.name) 128 Text(navItem.name)
120 .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) 129 .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
@@ -126,16 +135,6 @@ export struct BottomNavigationComponent { @@ -126,16 +135,6 @@ export struct BottomNavigationComponent {
126 } 135 }
127 .height($r('app.float.bottom_navigation_barHeight')) 136 .height($r('app.float.bottom_navigation_barHeight'))
128 .hoverEffect(HoverEffect.Highlight) 137 .hoverEffect(HoverEffect.Highlight)
129 - .gesture(  
130 - TapGesture({ count: 2 })  
131 - .onAction((event: GestureEvent) => {  
132 - AlertDialog.show({ message: 'aa' })  
133 - if (this.currentNavIndex === index) {  
134 - // 当前tab,双击事件  
135 - this.autoRefresh++  
136 - }  
137 - })  
138 - )  
139 .onClick(() => { 138 .onClick(() => {
140 if (navItem.name === '我的') { 139 if (navItem.name === '我的') {
141 this.barBackgroundColor = Color.White 140 this.barBackgroundColor = Color.White
@@ -12,9 +12,14 @@ import { WDPlayerController } from 'wdPlayer/Index'; @@ -12,9 +12,14 @@ import { WDPlayerController } from 'wdPlayer/Index';
12 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 12 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
13 import { SpConstants } from 'wdConstant/Index' 13 import { SpConstants } from 'wdConstant/Index'
14 14
  15 +interface ILikeStyleResp {
  16 + url: Resource;
  17 + name: string;
  18 +}
15 19
16 const TAG = 'PlayerRightView'; 20 const TAG = 'PlayerRightView';
17 21
  22 +
18 //视频点播页右侧操作栏:点赞/收藏/评论/分享 竖着排列 23 //视频点播页右侧操作栏:点赞/收藏/评论/分享 竖着排列
19 @Component 24 @Component
20 export struct PlayerRightView { 25 export struct PlayerRightView {
@@ -210,15 +215,26 @@ export struct PlayerRightView { @@ -210,15 +215,26 @@ export struct PlayerRightView {
210 /** 215 /**
211 * 将点赞样式转换为icon 216 * 将点赞样式转换为icon
212 */ 217 */
213 - transLikeStyle2Icon(): Resource { 218 + transLikeStyle(): ILikeStyleResp {
214 if (this.likesStyle === 1) { 219 if (this.likesStyle === 1) {
215 - return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`) 220 + return {
  221 + url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`),
  222 + name: '点赞'
  223 + }
216 } else if (this.likesStyle === 2) { 224 } else if (this.likesStyle === 2) {
217 - return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`) 225 + return {
  226 + url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
  227 + name: '祈祷'
  228 + }
218 } else if (this.likesStyle === 3) { 229 } else if (this.likesStyle === 3) {
219 - return this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`) 230 + return {
  231 + url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`),
  232 + name: '默哀'
  233 + }
  234 + }
  235 + return {
  236 + url: $r(`app.media.icon_like_ckeck`), name: '点赞'
220 } 237 }
221 - return $r(`app.media.icon_like_ckeck`)  
222 } 238 }
223 239
224 transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { 240 transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') {
@@ -238,14 +254,14 @@ export struct PlayerRightView { @@ -238,14 +254,14 @@ export struct PlayerRightView {
238 @Builder 254 @Builder
239 likeBuilderView() { 255 likeBuilderView() {
240 Column() { 256 Column() {
241 - Image(this.transLikeStyle2Icon()) 257 + Image(this.transLikeStyle().url)
242 .width(32) 258 .width(32)
243 .aspectRatio(1) 259 .aspectRatio(1)
244 .onClick(() => { 260 .onClick(() => {
245 // TODO:点赞动画 261 // TODO:点赞动画
246 this.toggleLikeStatus() 262 this.toggleLikeStatus()
247 }) 263 })
248 - Text(this.transNum2String('likeNum') || '赞') 264 + Text(this.transNum2String('likeNum') || this.transLikeStyle().name)
249 .width('100%') 265 .width('100%')
250 .fontWeight(500) 266 .fontWeight(500)
251 .textAlign(TextAlign.Center) 267 .textAlign(TextAlign.Center)
@@ -253,6 +269,7 @@ export struct PlayerRightView { @@ -253,6 +269,7 @@ export struct PlayerRightView {
253 .fontColor('#FFFFFF') 269 .fontColor('#FFFFFF')
254 .maxLines(1) 270 .maxLines(1)
255 .textOverflow({ overflow: TextOverflow.Ellipsis }) 271 .textOverflow({ overflow: TextOverflow.Ellipsis })
  272 + .margin({ top: 2 })
256 } 273 }
257 .margin({ bottom: 20 }) 274 .margin({ bottom: 20 })
258 .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None) 275 .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None)
@@ -278,6 +295,7 @@ export struct PlayerRightView { @@ -278,6 +295,7 @@ export struct PlayerRightView {
278 .fontColor('#FFFFFF') 295 .fontColor('#FFFFFF')
279 .maxLines(1) 296 .maxLines(1)
280 .textOverflow({ overflow: TextOverflow.Ellipsis }) 297 .textOverflow({ overflow: TextOverflow.Ellipsis })
  298 + .margin({ top: 2 })
281 } 299 }
282 .margin({ bottom: 20 }) 300 .margin({ bottom: 20 })
283 } 301 }
@@ -302,6 +320,7 @@ export struct PlayerRightView { @@ -302,6 +320,7 @@ export struct PlayerRightView {
302 .fontColor('#FFFFFF') 320 .fontColor('#FFFFFF')
303 .maxLines(1) 321 .maxLines(1)
304 .textOverflow({ overflow: TextOverflow.Ellipsis }) 322 .textOverflow({ overflow: TextOverflow.Ellipsis })
  323 + .margin({ top: 2 })
305 } 324 }
306 .margin({ bottom: 20 }) 325 .margin({ bottom: 20 })
307 } 326 }
@@ -326,6 +345,7 @@ export struct PlayerRightView { @@ -326,6 +345,7 @@ export struct PlayerRightView {
326 .fontColor('#FFFFFF') 345 .fontColor('#FFFFFF')
327 .maxLines(1) 346 .maxLines(1)
328 .textOverflow({ overflow: TextOverflow.Ellipsis }) 347 .textOverflow({ overflow: TextOverflow.Ellipsis })
  348 + .margin({ top: 2 })
329 } 349 }
330 .margin({ bottom: 20 }) 350 .margin({ bottom: 20 })
331 } 351 }