Showing
1 changed file
with
17 additions
and
9 deletions
| 1 | import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean'; | 1 | import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean'; |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 3 | -import { HttpUtils } from 'wdNetwork/Index'; | ||
| 4 | -import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | -import { PageRepository } from '../../repository/PageRepository'; | ||
| 6 | -import { DateTimeUtils } from 'wdKit/Index'; | 3 | +import { DateTimeUtils, SPHelper } from 'wdKit/Index'; |
| 7 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import { SpConstants } from 'wdConstant/Index' | ||
| 8 | 6 | ||
| 9 | /** | 7 | /** |
| 10 | * 精选评论卡 | 8 | * 精选评论卡 |
| @@ -32,6 +30,20 @@ export struct ZhSingleRow06 { | @@ -32,6 +30,20 @@ export struct ZhSingleRow06 { | ||
| 32 | @State compDTO: CompDTO = {} as CompDTO | 30 | @State compDTO: CompDTO = {} as CompDTO |
| 33 | @State likeBl: boolean = false; | 31 | @State likeBl: boolean = false; |
| 34 | 32 | ||
| 33 | + async likeAction() { | ||
| 34 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 35 | + if (!user_id) { | ||
| 36 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 37 | + return | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + if (this.likeBl) { | ||
| 41 | + this.likeBl = false; | ||
| 42 | + } else { | ||
| 43 | + this.likeBl = true; | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 35 | build() { | 47 | build() { |
| 36 | Column() { | 48 | Column() { |
| 37 | //顶部 | 49 | //顶部 |
| @@ -93,11 +105,7 @@ export struct ZhSingleRow06 { | @@ -93,11 +105,7 @@ export struct ZhSingleRow06 { | ||
| 93 | .fontColor(0x999999) | 105 | .fontColor(0x999999) |
| 94 | } | 106 | } |
| 95 | .onClick(() => { | 107 | .onClick(() => { |
| 96 | - if (this.likeBl) { | ||
| 97 | - this.likeBl = false; | ||
| 98 | - } else { | ||
| 99 | - this.likeBl = true; | ||
| 100 | - } | 108 | + this.likeAction() |
| 101 | }) | 109 | }) |
| 102 | } | 110 | } |
| 103 | .justifyContent(FlexAlign.SpaceBetween) | 111 | .justifyContent(FlexAlign.SpaceBetween) |
-
Please register or login to post a comment