yangchenggong1_wd

fix |> 19826 搜索结果,点击内容,提示内容不存在,页面会闪黑边,见比对视频

@@ -11,6 +11,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; @@ -11,6 +11,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
11 import { InfomationCardClick } from '../../utils/infomationCardClick'; 11 import { InfomationCardClick } from '../../utils/infomationCardClick';
12 import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; 12 import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
13 import router from '@ohos.router' 13 import router from '@ohos.router'
  14 +import { ToastUtils } from 'wdKit';
  15 +import MinePageDatasModel from '../../model/MinePageDatasModel';
14 16
15 const TAG: string = 'Card2Component' 17 const TAG: string = 'Card2Component'
16 /** 18 /**
@@ -140,7 +142,22 @@ export struct Card2Component { @@ -140,7 +142,22 @@ export struct Card2Component {
140 this.clicked = true; 142 this.clicked = true;
141 } 143 }
142 persistentStorage(this.contentDTO.objectId); 144 persistentStorage(this.contentDTO.objectId);
  145 + this.jumpDetail()
  146 + })
  147 + }
  148 +
  149 + /**
  150 + * 是否需要判断某种类型才需要判断内容是否存在的场景,目前测试没发现问题
  151 + */
  152 + jumpDetail(){
  153 + MinePageDatasModel.getAssertDetailData(this.contentDTO.relId,this.contentDTO.objectId,this.contentDTO.relType).then((value) => {
  154 + if(value == "1"){
143 ProcessUtils.processPage(this.contentDTO) 155 ProcessUtils.processPage(this.contentDTO)
  156 + }else{
  157 + ToastUtils.shortToast("内容不存在")
  158 + }
  159 + }).catch((err: Error) => {
  160 + console.log(TAG, JSON.stringify(err))
144 }) 161 })
145 } 162 }
146 } 163 }