Showing
5 changed files
with
30 additions
and
7 deletions
| @@ -17,6 +17,8 @@ export enum EmitterEventId { | @@ -17,6 +17,8 @@ export enum EmitterEventId { | ||
| 17 | 17 | ||
| 18 | // 关注,取消关注 | 18 | // 关注,取消关注 |
| 19 | PEOPLE_SHIP_ATTENTION = 7, | 19 | PEOPLE_SHIP_ATTENTION = 7, |
| 20 | + // 我的关注 为null | ||
| 21 | + MY_FOLLOW_EMPTY = 8, | ||
| 20 | 22 | ||
| 21 | // 登录成功 | 23 | // 登录成功 |
| 22 | LOGIN_SUCCESS = 8, | 24 | LOGIN_SUCCESS = 8, |
| 1 | +import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index' | ||
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | import { FollowListItem } from '../../../viewmodel/FollowListItem' | 3 | import { FollowListItem } from '../../../viewmodel/FollowListItem' |
| 3 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | ||
| 20 | }) | 21 | }) |
| 21 | 22 | ||
| 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ | 23 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ |
| 23 | - //个人主页 跳转 关注页 tab 2 | ||
| 24 | - let intervalID = setInterval(() => { | ||
| 25 | - this.currentIndex = this.changeIndex | ||
| 26 | - this.controller.changeIndex(this.currentIndex) | ||
| 27 | - clearInterval(intervalID); | ||
| 28 | - }, 500); | 24 | + this.jumpFollowNextPage() |
| 29 | } | 25 | } |
| 30 | }).catch((err:Error)=>{ | 26 | }).catch((err:Error)=>{ |
| 31 | console.log(TAG,JSON.stringify(err)) | 27 | console.log(TAG,JSON.stringify(err)) |
| 32 | }) | 28 | }) |
| 29 | + | ||
| 30 | + EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => { | ||
| 31 | + if(this.controller != null && this.data.length>1 ){ | ||
| 32 | + this.jumpFollowNextPage() | ||
| 33 | + } | ||
| 34 | + })) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + jumpFollowNextPage(){ | ||
| 38 | + //个人主页 跳转 关注页 tab 2 | ||
| 39 | + let intervalID = setInterval(() => { | ||
| 40 | + this.currentIndex = 1 | ||
| 41 | + this.controller.changeIndex(this.currentIndex) | ||
| 42 | + clearInterval(intervalID); | ||
| 43 | + }, 500); | ||
| 33 | } | 44 | } |
| 34 | 45 | ||
| 35 | @Builder TabBuilder(index: number, item: FollowListItem) { | 46 | @Builder TabBuilder(index: number, item: FollowListItem) { |
| 1 | -import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; | 1 | +import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; | 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; |
| 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; | 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; |
| @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | ||
| 156 | } | 156 | } |
| 157 | this.isLoading = false | 157 | this.isLoading = false |
| 158 | this.isGetRequest = true | 158 | this.isGetRequest = true |
| 159 | + this.sendFollowMessage() | ||
| 159 | }).catch((err: Error) => { | 160 | }).catch((err: Error) => { |
| 160 | console.log(TAG, "请求失败") | 161 | console.log(TAG, "请求失败") |
| 161 | this.isGetRequest = true | 162 | this.isGetRequest = true |
| 162 | this.isLoading = false | 163 | this.isLoading = false |
| 164 | + this.sendFollowMessage() | ||
| 163 | }) | 165 | }) |
| 164 | } else { | 166 | } else { |
| 165 | this.isLoading = false | 167 | this.isLoading = false |
| @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | ||
| 167 | } | 169 | } |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 172 | + sendFollowMessage(){ | ||
| 173 | + if(this.count === 0){ | ||
| 174 | + EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY) | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + | ||
| 170 | getNewPageData() { | 178 | getNewPageData() { |
| 171 | //我的关注列表 | 179 | //我的关注列表 |
| 172 | if (this.creatorDirectoryId === -1) { | 180 | if (this.creatorDirectoryId === -1) { |
| @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | ||
| 284 | if (!this.data_comment || value.list.length == 0){ | 284 | if (!this.data_comment || value.list.length == 0){ |
| 285 | this.hasMore = false | 285 | this.hasMore = false |
| 286 | this.isLoading = false | 286 | this.isLoading = false |
| 287 | + this.isGetRequest = true | ||
| 287 | }else{ | 288 | }else{ |
| 288 | this.getCommentListStatus(value) | 289 | this.getCommentListStatus(value) |
| 289 | } | 290 | } |
| @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 101 | if (!this.data_comment || value.list.length == 0) { | 101 | if (!this.data_comment || value.list.length == 0) { |
| 102 | this.hasMore = false | 102 | this.hasMore = false |
| 103 | this.isLoading = false | 103 | this.isLoading = false |
| 104 | + this.isGetRequest = true | ||
| 104 | } else { | 105 | } else { |
| 105 | this.getCommentListStatus(value) | 106 | this.getCommentListStatus(value) |
| 106 | } | 107 | } |
-
Please register or login to post a comment