陈剑华

fix: 17133 功能缺陷-【uta】未登录-点击精品评论卡-点赞按钮,没有跳转到登录页面

import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { HttpUtils } from 'wdNetwork/Index';
import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { DateTimeUtils } from 'wdKit/Index';
import { DateTimeUtils, SPHelper } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import { SpConstants } from 'wdConstant/Index'
/**
* 精选评论卡
... ... @@ -32,6 +30,20 @@ export struct ZhSingleRow06 {
@State compDTO: CompDTO = {} as CompDTO
@State likeBl: boolean = false;
async likeAction() {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
if (this.likeBl) {
this.likeBl = false;
} else {
this.likeBl = true;
}
}
build() {
Column() {
//顶部
... ... @@ -93,11 +105,7 @@ export struct ZhSingleRow06 {
.fontColor(0x999999)
}
.onClick(() => {
if (this.likeBl) {
this.likeBl = false;
} else {
this.likeBl = true;
}
this.likeAction()
})
}
.justifyContent(FlexAlign.SpaceBetween)
... ...