王士厅

fix: 兴趣卡关闭添加提示,关闭后列表删除数据

... ... @@ -185,7 +185,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, pageModel: this.pageModel, compIndex: this.compIndex })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
... ...
... ... @@ -7,6 +7,9 @@ import { CommonConstants } from 'wdConstant/Index';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Tracking, TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils'
import { ToastUtils } from 'wdKit';
import PageModel from '../../viewmodel/PageModel';
/**
* 兴趣卡
* Zh_Single_Column-09
... ... @@ -16,6 +19,7 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State private pageModel: PageModel = new PageModel();
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
... ... @@ -23,6 +27,7 @@ export struct ZhSingleColumn09 {
@State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
@State selfClosed: Boolean = false;
@State loadImg: boolean = false;
@State compIndex: number = 0;
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -116,6 +121,8 @@ export struct ZhSingleColumn09 {
.onClick(() => {
this.trackClick('interest_card_selecting_click')
if (this.activeIndexs.length > 0) {
ToastUtils.shortToast('已为您调整推荐内容')
this.pageModel.compList.deleteItem(this.compIndex)
this.selfClosed = true;
}
})
... ... @@ -181,7 +188,9 @@ export struct ZhSingleColumn09 {
}
.onClick(() => {
if (this.compDTO?.operDataList.length > 8) {
this.operDataList = this.shuffleArray(this.operDataList)
if (this.pageModel){
this.pageModel.compList.deleteItem(this.compIndex)
}
this.activeIndexs = [];
}
})
... ... @@ -191,6 +200,8 @@ export struct ZhSingleColumn09 {
.height(9)
.onClick(() => {
this.trackClick('close_interest_card_click')
ToastUtils.shortToast('已为您调整推荐内容')
this.pageModel.compList.deleteItem(this.compIndex)
this.selfClosed = true;
})
}
... ...