wangliang_wd

feat:优化他人主页未登录状态逻辑,优化无简介分割线展示逻辑

1 import { ContentDTO } from 'wdBean/Index' 1 import { ContentDTO } from 'wdBean/Index'
2 -import { DateTimeUtils, StringUtils, UserDataLocal } from 'wdKit/Index' 2 +import { DateTimeUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit/Index'
3 import MinePageDatasModel from '../../../model/MinePageDatasModel' 3 import MinePageDatasModel from '../../../model/MinePageDatasModel'
4 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' 4 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
5 import { CommentListItem } from '../../../viewmodel/CommentListItem' 5 import { CommentListItem } from '../../../viewmodel/CommentListItem'
6 import measure from '@ohos.measure' 6 import measure from '@ohos.measure'
7 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' 7 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
8 -import { ProcessUtils } from 'wdRouter/Index' 8 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  9 +import { SpConstants } from 'wdConstant'
9 10
10 @Component 11 @Component
11 export struct ChildCommentComponent { 12 export struct ChildCommentComponent {
@@ -221,6 +222,11 @@ export struct ChildCommentComponent { @@ -221,6 +222,11 @@ export struct ChildCommentComponent {
221 } 222 }
222 223
223 commentLikeOperation() { 224 commentLikeOperation() {
  225 + let userid = SPHelper.default.getSync(SpConstants.USER_ID,"") as string
  226 + if (!userid) {
  227 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  228 + return
  229 + }
224 let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0) 230 let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0)
225 MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => { 231 MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => {
226 if (value != null) { 232 if (value != null) {
@@ -205,9 +205,10 @@ struct OtherNormalUserHomePage { @@ -205,9 +205,10 @@ struct OtherNormalUserHomePage {
205 .justifyContent(FlexAlign.Center) 205 .justifyContent(FlexAlign.Center)
206 .width('100%') 206 .width('100%')
207 .backgroundColor($r('app.color.white')) 207 .backgroundColor($r('app.color.white'))
  208 +
  209 + //间隔符
  210 + Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
208 } 211 }
209 - //间隔符  
210 - Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')  
211 212
212 //tab 页面 213 //tab 页面
213 Stack({ alignContent: Alignment.Top }){ 214 Stack({ alignContent: Alignment.Top }){