陈剑华

Merge remote-tracking branch 'origin/main'

1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { StringUtils } from 'wdKit'; 2 +import { NetworkUtil, StringUtils } from 'wdKit';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
4 import { editModelParams } from '../model/EditInfoModel'; 4 import { editModelParams } from '../model/EditInfoModel';
5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; 5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
6 import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageBottomFollowComponent'; 6 import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageBottomFollowComponent';
7 import MinePageDatasModel from '../model/MinePageDatasModel'; 7 import MinePageDatasModel from '../model/MinePageDatasModel';
  8 +import { EmptyComponent } from '../components/view/EmptyComponent';
  9 +import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
8 10
9 const TAG = "MineHomePage" 11 const TAG = "MineHomePage"
10 12
@@ -33,6 +35,7 @@ struct MineHomePage { @@ -33,6 +35,7 @@ struct MineHomePage {
33 scroller: Scroller = new Scroller(); 35 scroller: Scroller = new Scroller();
34 @State params:Record<string, string> = router.getParams() as Record<string, string>; 36 @State params:Record<string, string> = router.getParams() as Record<string, string>;
35 @State isCommentEnter:string = ""; 37 @State isCommentEnter:string = "";
  38 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
36 39
37 onPageShow(): void { 40 onPageShow(): void {
38 this.getUserInfo() 41 this.getUserInfo()
@@ -47,6 +50,7 @@ struct MineHomePage { @@ -47,6 +50,7 @@ struct MineHomePage {
47 } 50 }
48 51
49 build() { 52 build() {
  53 + if(this.isConnectNetwork){
50 Stack({ alignContent: Alignment.Top }){ 54 Stack({ alignContent: Alignment.Top }){
51 Image($r('app.media.title_bg')) 55 Image($r('app.media.title_bg'))
52 .width('100%') 56 .width('100%')
@@ -261,6 +265,20 @@ struct MineHomePage { @@ -261,6 +265,20 @@ struct MineHomePage {
261 } 265 }
262 }.width('100%') 266 }.width('100%')
263 .layoutWeight(1) 267 .layoutWeight(1)
  268 + }else{
  269 + Column(){
  270 + CustomTitleUI({ titleName: "" })
  271 +
  272 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  273 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  274 + if(this.isConnectNetwork){
  275 + this.getUserInfo()
  276 + }
  277 + },})
  278 + .layoutWeight(1)
  279 + .width('100%')
  280 + }
  281 + }
264 282
265 } 283 }
266 @Builder MineHomeTitleTransparent() { 284 @Builder MineHomeTitleTransparent() {
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { Params } from 'wdBean'; 2 import { Params } from 'wdBean';
3 -import { StringUtils } from 'wdKit'; 3 +import { NetworkUtil, StringUtils } from 'wdKit';
4 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; 4 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
5 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; 5 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent';
  6 +import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
  7 +import { EmptyComponent } from '../components/view/EmptyComponent';
6 import MinePageDatasModel from '../model/MinePageDatasModel'; 8 import MinePageDatasModel from '../model/MinePageDatasModel';
7 import { OtherUserDetailRequestItem } from '../viewmodel/OtherUserDetailRequestItem'; 9 import { OtherUserDetailRequestItem } from '../viewmodel/OtherUserDetailRequestItem';
8 10
@@ -39,6 +41,7 @@ struct OtherNormalUserHomePage { @@ -39,6 +41,7 @@ struct OtherNormalUserHomePage {
39 @State attentionNum:number = 0//关注数 41 @State attentionNum:number = 0//关注数
40 @State desc:string = "" 42 @State desc:string = ""
41 userType:string = "1" 43 userType:string = "1"
  44 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
42 45
43 aboutToAppear(){ 46 aboutToAppear(){
44 this.getUserInfo() 47 this.getUserInfo()
@@ -47,6 +50,7 @@ struct OtherNormalUserHomePage { @@ -47,6 +50,7 @@ struct OtherNormalUserHomePage {
47 50
48 51
49 build() { 52 build() {
  53 + if(this.isConnectNetwork){
50 Stack({ alignContent: Alignment.Top }){ 54 Stack({ alignContent: Alignment.Top }){
51 Image($r('app.media.title_bg')) 55 Image($r('app.media.title_bg'))
52 .width('100%') 56 .width('100%')
@@ -228,6 +232,20 @@ struct OtherNormalUserHomePage { @@ -228,6 +232,20 @@ struct OtherNormalUserHomePage {
228 } 232 }
229 }.width('100%') 233 }.width('100%')
230 .layoutWeight(1) 234 .layoutWeight(1)
  235 + }else{
  236 + Column(){
  237 + CustomTitleUI({ titleName: "" })
  238 +
  239 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  240 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  241 + if(this.isChangeToUserEdit){
  242 + this.getUserInfo()
  243 + }
  244 + },})
  245 + .layoutWeight(1)
  246 + .width('100%')
  247 + }
  248 + }
231 249
232 } 250 }
233 @Builder MineHomeTitleTransparent() { 251 @Builder MineHomeTitleTransparent() {