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
yanlu
2024-05-17 15:10:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d8699cde5f2163b391e5bfbe6c2df7f9c3d784e2
d8699cde
1 parent
dedcb70a
fix:预约状态修改问题
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipRecommendComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipRecommendComponent.ets
View file @
d8699cd
import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent'
import { RmhRecommendDTO } from 'wdBean';
import { faceDetector } from '@kit.CoreVisionKit';
@Component
export struct PeopleShipRecommendComponent {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
View file @
d8699cd
...
...
@@ -28,7 +28,7 @@ const TAG: string = 'ReserveMorePage';
@Component
struct ReserveMorePage {
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
@State
reserveList: ReserveItemBean[] = []
private
reserveList: ReserveItemBean[] = []
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
type: number = 2;
pageSize: number = 20;
...
...
@@ -312,8 +312,15 @@ struct ReserveMorePage {
Logger.debug(TAG,'是否关注元数据2:' +` ${JSON.stringify(element.subscribe)}`)
element.subscribe = !element.subscribe
Logger.debug(TAG,'是否关注元数据3:' +` ${JSON.stringify(element.subscribe)}`)
this.data.reloadData()
this.isShow = true
if (element.subscribe) {
this.reservedIds.push(element.liveId.toString())
}else {
const num = this.reservedIds.indexOf(element.liveId.toString())
if (num >= 0 && num < this.reservedIds.length) {
this.reservedIds.splice(num, 1)
}
}
}
}
})
...
...
@@ -349,6 +356,7 @@ struct ReserveMorePage {
if (this.currentPage == 1) {
this.data.clear()
this.reserveList = []
this.reservedIds = []
}
this.data.push(...liveReviewDTO.list)
//批量查询关注状态
...
...
@@ -396,7 +404,12 @@ struct ReserveMorePage {
Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`)
if (result && result.length > 0) {
this.reserveList.push(...result)
this.data.reloadData()
// this.reserveStatus = res;
result.map((item: ReserveItemBean) => {
if (item.subscribe) {
this.reservedIds.push(item.liveId.toString())
}
})
}
}).catch(() =>{
// this.data.push(...list)
...
...
@@ -409,11 +422,7 @@ struct ReserveMorePage {
// 判断是否预约
isReserved(item: ContentDTO) {
const objc = this.getAttentionItem(item)
if (objc) {
return objc.subscribe
}
return false
return this.reservedIds.includes(item.objectId)
}
getAttentionItem(item: ContentDTO) {
...
...
@@ -460,9 +469,17 @@ struct ReserveMorePage {
Logger.debug(TAG,'是否关注元数据:' +` ${JSON.stringify(element.subscribe)}`)
element.subscribe = !element.subscribe
Logger.debug(TAG,'是否关注元数据1:' +` ${JSON.stringify(element.subscribe)}`)
this.data.reloadData()
if (element.subscribe) {
this.reservedIds.push(element.liveId.toString())
}else {
const num = this.reservedIds.indexOf(element.liveId.toString())
if (num >= 0 && num < this.reservedIds.length) {
this.reservedIds.splice(num, 1)
}
}
}
})
}
this.isLoadingAttention = false
this.liveId = ''
...
...
Please
register
or
login
to post a comment