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-08-28 11:19:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fe6a19fc73e7cb7b07e81ca507bb5ea7335810f5
fe6a19fc
1 parent
fcee07c4
feat:优化我的收藏评论拉取逻辑
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
30 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/products/phone/src/main/module.json5
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
fe6a19f
...
...
@@ -9,7 +9,7 @@ import NoMoreLayout from './NoMoreLayout'
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams } from '../../model/MyCollectionModel';
import { contentListItemParams
, MyCollectionItem
} from '../../model/MyCollectionModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { NetworkUtil } from 'wdKit/Index';
...
...
@@ -180,18 +180,9 @@ struct MyCollectionListPage {
MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => {
if(resolve) resolve('刷新成功')
if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < collectionItem.list.length; index++) {
const compDTO = collectionItem.list[index];
compDTO.isCollection = true ///用于时间展示
this.allDatas.push(compDTO)
}
if (this.allDatas.length > 0){
this.getContentData()
if (collectionItem.list.length > 0){
this.getContentData(collectionItem)
}
if (collectionItem.hasNext === 0) {
...
...
@@ -279,13 +270,13 @@ struct MyCollectionListPage {
}
}
async getContentData(){
async getContentData(
item:MyCollectionItem
){
try {
// 获取列表数据
const params: contentListParams = {
contentList: []
}
this.allDatas
.forEach((item: ContentDTO) => {
item.list
.forEach((item: ContentDTO) => {
params.contentList.push({
contentId: item.objectId,
contentType: Number(item.objectType ?? '1')
...
...
@@ -293,15 +284,26 @@ struct MyCollectionListPage {
})
this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
let datas: ContentDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < item.list.length; index++) {
const compDTO = item.list[index];
compDTO.isCollection = true ///用于时间展示
compDTO.interactData = this.commentList[index]
d
atas.push(compDTO)
this.allD
atas.push(compDTO)
}
this.allDatas = []
this.allDatas.push(...datas)
} catch (exception) {
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < item.list.length; index++) {
const compDTO = item.list[index];
compDTO.isCollection = true ///用于时间展示
this.allDatas.push(compDTO)
}
}
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/module.json5
View file @
fe6a19f
...
...
@@ -184,16 +184,6 @@
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.CAMERA"
,
"reason"
:
"$string:permission_camera_tip"
,
"usedScene"
:
{
"abilities"
:
[
"FormAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.READ_MEDIA"
,
"reason"
:
"$string:permission_photo_tip"
,
"usedScene"
:
{
...
...
Please
register
or
login
to post a comment