Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-10-14 14:26:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
63c1a6fa3306cf2042d0a9ddd95d29f7e6dc330d
63c1a6fa
1 parent
46117715
feat:优化我的收藏刷新逻辑
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
63c1a6f
...
...
@@ -4,7 +4,8 @@ import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import { CompDTO, ContentDTO, contentListParams,contentListItem, InteractDataDTO } from 'wdBean'
import { CompDTO, ContentDTO, contentListParams,contentListItem, InteractDataDTO,
postExecuteCollectRecordParams } from 'wdBean'
import NoMoreLayout from './NoMoreLayout'
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
...
...
@@ -12,7 +13,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams, MyCollectionItem } from '../../model/MyCollectionModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { DateTimeUtils, NetworkUtil } from 'wdKit/Index';
import { DateTimeUtils, NetworkUtil
, SPHelper
} from 'wdKit/Index';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
...
...
@@ -67,12 +68,31 @@ struct MyCollectionListPage {
onPageShow(){
this.pageShow = Math.random()
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
this.refreshCollectList()
}
onPageHide(): void {
TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd(TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect)
}
refreshCollectList(){
let compStr = SPHelper.default.getSync('CompCollectStatus','') as string
if (compStr.length > 0) {
let collectRecordParams:postExecuteCollectRecordParams = JSON.parse(compStr)
if (collectRecordParams.status === '0'){
let deleteIndex:number = 0
this.allDatas.forEach((item,index) => {
if (item.objectId === collectRecordParams.contentList[0].contentId) {
deleteIndex = index
}
})
this.allDatas.splice(deleteIndex,1)
}
SPHelper.default.delete('CompCollectStatus')
}
}
build() {
Column(){
CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.isDisplayButton,editCallback:()=>{
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
63c1a6f
...
...
@@ -432,6 +432,7 @@ export struct LiveOperRowListView {
}
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
SPHelper.default.saveSync('CompCollectStatus',JSON.stringify(params))
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
63c1a6f
...
...
@@ -551,6 +551,7 @@ export struct OperRowListView {
// console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
SPHelper.default.saveSync('CompCollectStatus',JSON.stringify(params))
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
View file @
63c1a6f
...
...
@@ -117,6 +117,7 @@ export struct OperationListView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
SPHelper.default.saveSync('CompCollectStatus',JSON.stringify(params))
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
63c1a6f
...
...
@@ -141,6 +141,7 @@ export struct PlayerRightView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
SPHelper.default.saveSync('CompCollectStatus',JSON.stringify(params))
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
...
...
Please
register
or
login
to post a comment