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
yangchenggong1_wd
2024-05-15 10:51:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4d7658dba581e62dd455951b24c3ac415b948b8d
4d7658db
1 parent
4c8ea38e
fix:bug[17166] 无网络状态下进入我的关注列表下鸿蒙无缺省图
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
29 deletions
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowFirstTabsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowFirstTabsComponent.ets
View file @
4d7658d
import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index'
import { EmitterUtils, EmitterEventId, Logger
, NetworkUtil
} from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
import { EmptyComponent } from '../../view/EmptyComponent'
import { FollowSecondTabsComponent } from './FollowSecondTabsComponent'
const TAG = "FollowFirstTabsComponent"
@Component
...
...
@@ -12,13 +13,24 @@ export struct FollowFirstTabsComponent{
@State data:FollowListItem[] = []
fontColor: string = '#999999'
selectedFontColor: string = '#000000'
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
aboutToAppear(){
this.getFollowTabList()
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
getFollowTabList(){
MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{
this.data.push(new FollowListItem("我的"))
value.forEach((element)=>{
this.data.push(element)
})
value.forEach((element)=>{
this.data.push(element)
})
if(this.controller != null && this.data.length>1 && this.changeIndex === 1){
this.jumpFollowNextPage()
...
...
@@ -26,12 +38,6 @@ export struct FollowFirstTabsComponent{
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
jumpFollowNextPage(){
...
...
@@ -75,24 +81,40 @@ export struct FollowFirstTabsComponent{
//标题栏目
CustomTitleUI({titleName:"关注列表"})
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
ForEach(this.data, (item: FollowListItem, index: number ) => {
TabContent(){
FollowSecondTabsComponent({data:$data,firstIndex:index})
}.tabBar(this.TabBuilder(index,item))
}, (item: FollowListItem, index: number) => index.toString())
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.reloadNetWork()
},})
.layoutWeight(1)
.width('100%')
}else{
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
ForEach(this.data, (item: FollowListItem, index: number ) => {
TabContent(){
FollowSecondTabsComponent({data:$data,firstIndex:index})
}.tabBar(this.TabBuilder(index,item))
}, (item: FollowListItem, index: number) => index.toString())
}
.vertical(false)
.barMode(BarMode.Scrollable)
.barWidth('100%')
.barBackgroundColor($r('app.color.white'))
.barHeight('84lpx')
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
})
.width('100%')
.layoutWeight(1)
}
.vertical(false)
.barMode(BarMode.Scrollable)
.barWidth('100%')
.barBackgroundColor($r('app.color.white'))
.barHeight('84lpx')
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
})
.width('100%')
.layoutWeight(1)
}.width('100%')
}
reloadNetWork(){
let c = NetworkUtil.isNetConnected()
if(c){
this.getFollowTabList()
this.isConnectNetwork = c
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
View file @
4d7658d
import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource,
NetworkUtil,
SPHelper, UserDataLocal } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
...
...
@@ -70,7 +70,11 @@ export struct FollowListDetailUI {
Column() {
if (this.count === 0) {
if (this.isGetRequest == true) {
if(this.creatorDirectoryId === -1){
if(!NetworkUtil.isNetConnected()){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
}else if(this.creatorDirectoryId === -1){
EmptyComponent({ emptyType: 14,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
...
...
Please
register
or
login
to post a comment