Showing
10 changed files
with
233 additions
and
256 deletions
| @@ -101,4 +101,9 @@ export class SPHelper { | @@ -101,4 +101,9 @@ export class SPHelper { | ||
| 101 | // preferences.clearSync() | 101 | // preferences.clearSync() |
| 102 | // preferences.flush() | 102 | // preferences.flush() |
| 103 | // } | 103 | // } |
| 104 | + | ||
| 105 | + public getPreferences(){ | ||
| 106 | + let preferences = data_preferences.getPreferences(SPHelper.context, SPHelper.spFilename); | ||
| 107 | + return preferences; | ||
| 108 | + } | ||
| 104 | } | 109 | } |
| @@ -97,4 +97,6 @@ export class WDRouterPage { | @@ -97,4 +97,6 @@ export class WDRouterPage { | ||
| 97 | static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage"); | 97 | static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage"); |
| 98 | //搜索主页 | 98 | //搜索主页 |
| 99 | static searchPage = new WDRouterPage("wdComponent", "ets/pages/SearchPage"); | 99 | static searchPage = new WDRouterPage("wdComponent", "ets/pages/SearchPage"); |
| 100 | + //搜索人民号主页 | ||
| 101 | + static searchCreatorPage = new WDRouterPage("wdComponent", "ets/pages/SearchCreatorPage"); | ||
| 100 | } | 102 | } |
| 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 3 | -import router from '@ohos.router' | ||
| 4 | 3 | ||
| 5 | @Component | 4 | @Component |
| 6 | export default struct MinePagePersonFunctionUI { | 5 | export default struct MinePagePersonFunctionUI { |
| 7 | @Link personalData:MinePagePersonalFunctionsItem[] | 6 | @Link personalData:MinePagePersonalFunctionsItem[] |
| 8 | @Prop isLogin:boolean | 7 | @Prop isLogin:boolean |
| 9 | - @Consume('isLogin')@Watch('loginChange') loginState:Record<string,string> | ||
| 10 | - loginChange(){ | ||
| 11 | - if(this.loginState){ | ||
| 12 | - this.isLogin=true | ||
| 13 | - }else{ | ||
| 14 | - this.isLogin=false | ||
| 15 | - } | ||
| 16 | - } | ||
| 17 | 8 | ||
| 18 | build() { | 9 | build() { |
| 19 | Grid(){ | 10 | Grid(){ |
| 1 | -import { Logger, UserDataLocal } from 'wdKit' | 1 | +import { Logger, StringUtils, UserDataLocal } from 'wdKit' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 3 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 4 | const TAG = "MinePageUserSimpleInfoUI" | 4 | const TAG = "MinePageUserSimpleInfoUI" |
| @@ -12,20 +12,13 @@ export default struct MinePageUserSimpleInfoUI { | @@ -12,20 +12,13 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 12 | @State levelHead:string = "" | 12 | @State levelHead:string = "" |
| 13 | @State levelId:number = 0 | 13 | @State levelId:number = 0 |
| 14 | 14 | ||
| 15 | - | ||
| 16 | - @Consume('isLogin') @Watch('loginChange') loginState:Record<string,string> | ||
| 17 | - loginChange(){ | ||
| 18 | - Logger.debug("isLogin",'MinePageUserSimpleInfoUI') | ||
| 19 | - if(this.loginState){ | ||
| 20 | - this.isLogin=true | ||
| 21 | - }else { | ||
| 22 | - this.isLogin=false | ||
| 23 | - } | ||
| 24 | - } | ||
| 25 | loginStateChange(){ | 15 | loginStateChange(){ |
| 26 | if(this.isLogin){ | 16 | if(this.isLogin){ |
| 27 | this.getUserInfo() | 17 | this.getUserInfo() |
| 28 | this.getUserLevel() | 18 | this.getUserLevel() |
| 19 | + }else{ | ||
| 20 | + this.headPhotoUrl = "" | ||
| 21 | + this.levelHead = "" | ||
| 29 | } | 22 | } |
| 30 | } | 23 | } |
| 31 | 24 | ||
| @@ -33,17 +26,20 @@ export default struct MinePageUserSimpleInfoUI { | @@ -33,17 +26,20 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 33 | Row(){ | 26 | Row(){ |
| 34 | //头像 | 27 | //头像 |
| 35 | Stack(){ | 28 | Stack(){ |
| 36 | - Image(this.headPhotoUrl) | 29 | + Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl) |
| 37 | .alt($r('app.media.default_head')) | 30 | .alt($r('app.media.default_head')) |
| 38 | .width('100lpx') | 31 | .width('100lpx') |
| 39 | .height('100lpx') | 32 | .height('100lpx') |
| 40 | .objectFit(ImageFit.Cover) | 33 | .objectFit(ImageFit.Cover) |
| 41 | .borderRadius(50) | 34 | .borderRadius(50) |
| 42 | - Image(this.levelHead) | ||
| 43 | - .width('130lpx') | ||
| 44 | - .height('130lpx') | ||
| 45 | - .objectFit(ImageFit.Cover) | ||
| 46 | - .borderRadius(50) | 35 | + |
| 36 | + if(StringUtils.isNotEmpty(this.levelHead)){ | ||
| 37 | + Image(this.levelHead) | ||
| 38 | + .width('130lpx') | ||
| 39 | + .height('130lpx') | ||
| 40 | + .objectFit(ImageFit.Cover) | ||
| 41 | + .borderRadius(50) | ||
| 42 | + } | ||
| 47 | }.width('130lpx') | 43 | }.width('130lpx') |
| 48 | .height('130lpx') | 44 | .height('130lpx') |
| 49 | .alignContent(Alignment.Center) | 45 | .alignContent(Alignment.Center) |
| @@ -4,11 +4,10 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | @@ -4,11 +4,10 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | ||
| 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' | 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' |
| 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' | 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' |
| 7 | -import MinePageCardUI from '../mine/MinePageCardUI' | ||
| 8 | -import MinePageCreatorFunctionUI from '../mine/MinePageCreatorFunctionUI' | ||
| 9 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' |
| 10 | import { SPHelper, StringUtils } from 'wdKit' | 8 | import { SPHelper, StringUtils } from 'wdKit' |
| 11 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | +import dataPreferences from '@ohos.data.preferences'; | ||
| 12 | 11 | ||
| 13 | const TAG = 'MinePageComponent'; | 12 | const TAG = 'MinePageComponent'; |
| 14 | 13 | ||
| @@ -24,12 +23,29 @@ export struct MinePageComponent { | @@ -24,12 +23,29 @@ export struct MinePageComponent { | ||
| 24 | @State creatorData:MinePageCreatorFunctionsItem[] = [] | 23 | @State creatorData:MinePageCreatorFunctionsItem[] = [] |
| 25 | @State moreData:MinePageMoreFunctionModel[] = [] | 24 | @State moreData:MinePageMoreFunctionModel[] = [] |
| 26 | scroller: Scroller = new Scroller() | 25 | scroller: Scroller = new Scroller() |
| 26 | + preferences: dataPreferences.Preferences | null = null; | ||
| 27 | 27 | ||
| 28 | aboutToAppear(){ | 28 | aboutToAppear(){ |
| 29 | this.getUserLogin() | 29 | this.getUserLogin() |
| 30 | this.getFunctionData() | 30 | this.getFunctionData() |
| 31 | + this.addLoginStatusObserver() | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 34 | + async addLoginStatusObserver(){ | ||
| 35 | + this.preferences = await SPHelper.default.getPreferences(); | ||
| 36 | + let observer = (key: string) => { | ||
| 37 | + if(key == SpConstants.USER_ID){ | ||
| 38 | + if(StringUtils.isEmpty(SPHelper.default.getSync(SpConstants.USER_ID,""))){ | ||
| 39 | + this.isLogin = false | ||
| 40 | + }else { | ||
| 41 | + this.isLogin = true | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + this.preferences.on('change', observer); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + | ||
| 33 | getFunctionData(){ | 49 | getFunctionData(){ |
| 34 | //个人功能数据 | 50 | //个人功能数据 |
| 35 | this.personalData = MinePageDatasModel.getPersonalFunctionsData() | 51 | this.personalData = MinePageDatasModel.getPersonalFunctionsData() |
| @@ -4,6 +4,7 @@ import { ContentDTO, | @@ -4,6 +4,7 @@ import { ContentDTO, | ||
| 4 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' | 4 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' |
| 5 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' | 5 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' |
| 6 | import { LazyDataSource, StringUtils, ToastUtils } from 'wdKit/Index' | 6 | import { LazyDataSource, StringUtils, ToastUtils } from 'wdKit/Index' |
| 7 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 7 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 8 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| 8 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' | 9 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' |
| 9 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' | 10 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' |
| @@ -20,9 +21,8 @@ export struct SearchResultContentComponent{ | @@ -20,9 +21,8 @@ export struct SearchResultContentComponent{ | ||
| 20 | @State searchType:string = "" | 21 | @State searchType:string = "" |
| 21 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | 22 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); |
| 22 | @State data_rmh: SearchRmhDescription[] = [] | 23 | @State data_rmh: SearchRmhDescription[] = [] |
| 23 | - @State count:number = 0; | 24 | + @State count:number = -1; |
| 24 | @State isLoading:boolean = false | 25 | @State isLoading:boolean = false |
| 25 | - @State isLoading2:boolean = false | ||
| 26 | @State hasMore:boolean = true | 26 | @State hasMore:boolean = true |
| 27 | curPageNum:number = 1; | 27 | curPageNum:number = 1; |
| 28 | 28 | ||
| @@ -80,6 +80,7 @@ export struct SearchResultContentComponent{ | @@ -80,6 +80,7 @@ export struct SearchResultContentComponent{ | ||
| 80 | }).catch((err:Error)=>{ | 80 | }).catch((err:Error)=>{ |
| 81 | console.log(TAG,JSON.stringify(err)) | 81 | console.log(TAG,JSON.stringify(err)) |
| 82 | this.isLoading = false | 82 | this.isLoading = false |
| 83 | + this.count = this.count===-1?0:this.count | ||
| 83 | }) | 84 | }) |
| 84 | } | 85 | } |
| 85 | } | 86 | } |
| @@ -155,7 +156,7 @@ export struct SearchResultContentComponent{ | @@ -155,7 +156,7 @@ export struct SearchResultContentComponent{ | ||
| 155 | vImageUrl: "", | 156 | vImageUrl: "", |
| 156 | screenType: "", | 157 | screenType: "", |
| 157 | source: StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName, | 158 | source: StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName, |
| 158 | - objectId: "", | 159 | + objectId: value.data.id, |
| 159 | objectType: value.data.type, | 160 | objectType: value.data.type, |
| 160 | channelId: value.data.channelId, | 161 | channelId: value.data.channelId, |
| 161 | relId: value.data.relId, | 162 | relId: value.data.relId, |
| @@ -196,6 +197,7 @@ export struct SearchResultContentComponent{ | @@ -196,6 +197,7 @@ export struct SearchResultContentComponent{ | ||
| 196 | }).catch((err:Error)=>{ | 197 | }).catch((err:Error)=>{ |
| 197 | console.log(TAG,"请求失败") | 198 | console.log(TAG,"请求失败") |
| 198 | this.isLoading = false | 199 | this.isLoading = false |
| 200 | + this.count = this.count===-1?0:this.count | ||
| 199 | }) | 201 | }) |
| 200 | } | 202 | } |
| 201 | 203 | ||
| @@ -235,16 +237,24 @@ export struct SearchResultContentComponent{ | @@ -235,16 +237,24 @@ export struct SearchResultContentComponent{ | ||
| 235 | }) | 237 | }) |
| 236 | 238 | ||
| 237 | ListItem(){ | 239 | ListItem(){ |
| 238 | - Text("查看更多") | ||
| 239 | - .height('180lpx') | ||
| 240 | - .textAlign(TextAlign.Center) | ||
| 241 | - .width('77lpx') | ||
| 242 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 243 | - .fontColor($r('app.color.color_9E9E9E')) | ||
| 244 | - .borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'}) | 240 | + Column(){ |
| 241 | + Text("查看更多") | ||
| 242 | + .width('19lpx') | ||
| 243 | + .fontSize('19lpx') | ||
| 244 | + .fontWeight('400lpx') | ||
| 245 | + .lineHeight('27lpx') | ||
| 246 | + .fontColor($r('app.color.color_9E9E9E')) | ||
| 247 | + }.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'}) | ||
| 248 | + .height('180lpx') | ||
| 249 | + .width('77lpx') | ||
| 250 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 251 | + .justifyContent(FlexAlign.Center) | ||
| 252 | + | ||
| 245 | }.height('100%') | 253 | }.height('100%') |
| 246 | .margin({left:'23lpx'}) | 254 | .margin({left:'23lpx'}) |
| 247 | - | 255 | + .onClick(()=>{ |
| 256 | + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage) | ||
| 257 | + }) | ||
| 248 | } | 258 | } |
| 249 | .cachedCount(6) | 259 | .cachedCount(6) |
| 250 | .edgeEffect(EdgeEffect.Spring) | 260 | .edgeEffect(EdgeEffect.Spring) |
| @@ -252,14 +262,6 @@ export struct SearchResultContentComponent{ | @@ -252,14 +262,6 @@ export struct SearchResultContentComponent{ | ||
| 252 | .listDirection(Axis.Horizontal) | 262 | .listDirection(Axis.Horizontal) |
| 253 | .width('100%') | 263 | .width('100%') |
| 254 | .height('219lpx') | 264 | .height('219lpx') |
| 255 | - .onReachEnd(()=>{ | ||
| 256 | - if(!this.isLoading2){ | ||
| 257 | - this.isLoading2 = true | ||
| 258 | - //进入更多关注页 | ||
| 259 | - ToastUtils.shortToast("进入更多关注页") | ||
| 260 | - | ||
| 261 | - } | ||
| 262 | - }) | ||
| 263 | 265 | ||
| 264 | Divider() | 266 | Divider() |
| 265 | .width('100%') | 267 | .width('100%') |
| @@ -2,7 +2,6 @@ import router from '@ohos.router' | @@ -2,7 +2,6 @@ import router from '@ohos.router' | ||
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | import { StringUtils } from 'wdKit'; | 3 | import { StringUtils } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | -import { CardParser } from '../components/CardParser'; | ||
| 6 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; | 5 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; |
| 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 6 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 8 | 7 | ||
| @@ -53,100 +52,100 @@ struct MineHomePage { | @@ -53,100 +52,100 @@ struct MineHomePage { | ||
| 53 | Scroll() { | 52 | Scroll() { |
| 54 | Column() { | 53 | Column() { |
| 55 | //用户信息区域 | 54 | //用户信息区域 |
| 56 | - Row() { | ||
| 57 | - Stack(){ | ||
| 58 | - Image(this.headPhotoUrl) | ||
| 59 | - .alt($r('app.media.default_head')) | ||
| 60 | - .width('100lpx') | ||
| 61 | - .height('100lpx') | ||
| 62 | - .objectFit(ImageFit.Auto) | ||
| 63 | - .borderRadius(50) | ||
| 64 | - Image(this.levelHead) | ||
| 65 | - .width('130lpx') | ||
| 66 | - .height('130lpx') | ||
| 67 | - .objectFit(ImageFit.Cover) | ||
| 68 | - }.onClick(()=>{ | ||
| 69 | - let params: Params = { | ||
| 70 | - pageID: "531267787833221"//sit 测试用 512157124138245 | ||
| 71 | - } | ||
| 72 | - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | ||
| 73 | - }).width('135lpx') | ||
| 74 | - .height('135lpx') | ||
| 75 | - | ||
| 76 | - Column() { | ||
| 77 | - Row() { | ||
| 78 | - Text(`${this.userName}`) | ||
| 79 | - .fontColor($r('app.color.white')) | ||
| 80 | - .maxLines(1) | ||
| 81 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 82 | - .fontSize('38lpx') | ||
| 83 | - .lineHeight('50lpx') | ||
| 84 | - .fontWeight('500lpx') | ||
| 85 | - | ||
| 86 | - Text(`等级${this.levelId}`) | ||
| 87 | - .textAlign(TextAlign.Center) | ||
| 88 | - .fontColor($r('app.color.color_ED2800')) | ||
| 89 | - .backgroundColor($r('app.color.white')) | ||
| 90 | - .fontSize('19lpx') | ||
| 91 | - .width('96lpx') | ||
| 92 | - .height('35lpx') | ||
| 93 | - .margin({ left: '10lpx' }) | ||
| 94 | - Blank() | ||
| 95 | - }.width('507lpx') | 55 | + Row() { |
| 56 | + Stack(){ | ||
| 57 | + Image(this.headPhotoUrl) | ||
| 58 | + .alt($r('app.media.default_head')) | ||
| 59 | + .width('100lpx') | ||
| 60 | + .height('100lpx') | ||
| 61 | + .objectFit(ImageFit.Auto) | ||
| 62 | + .borderRadius(50) | ||
| 63 | + Image(this.levelHead) | ||
| 64 | + .width('130lpx') | ||
| 65 | + .height('130lpx') | ||
| 66 | + .objectFit(ImageFit.Cover) | ||
| 67 | + }.onClick(()=>{ | ||
| 68 | + let params: Params = { | ||
| 69 | + pageID: "531267787833221"//sit 测试用 512157124138245 | ||
| 70 | + } | ||
| 71 | + WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | ||
| 72 | + }).width('135lpx') | ||
| 73 | + .height('135lpx') | ||
| 96 | 74 | ||
| 75 | + Column() { | ||
| 76 | + Row() { | ||
| 77 | + Text(`${this.userName}`) | ||
| 78 | + .fontColor($r('app.color.white')) | ||
| 79 | + .maxLines(1) | ||
| 80 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 81 | + .fontSize('38lpx') | ||
| 82 | + .lineHeight('50lpx') | ||
| 83 | + .fontWeight('500lpx') | ||
| 84 | + | ||
| 85 | + Text(`等级${this.levelId}`) | ||
| 86 | + .textAlign(TextAlign.Center) | ||
| 87 | + .fontColor($r('app.color.color_ED2800')) | ||
| 88 | + .backgroundColor($r('app.color.white')) | ||
| 89 | + .fontSize('19lpx') | ||
| 90 | + .width('96lpx') | ||
| 91 | + .height('35lpx') | ||
| 92 | + .margin({ left: '10lpx' }) | ||
| 93 | + Blank() | ||
| 94 | + }.width('507lpx') | ||
| 95 | + | ||
| 96 | + Row() { | ||
| 97 | Row() { | 97 | Row() { |
| 98 | - Row() { | ||
| 99 | - Text(`${this.browseNum}`) | ||
| 100 | - .textStyle() | ||
| 101 | - Text("阅读") | ||
| 102 | - .textStyle2() | ||
| 103 | - } | ||
| 104 | - .margin({ right: '15lpx' }) | ||
| 105 | - | ||
| 106 | - Divider() | ||
| 107 | - .height('19lpx') | ||
| 108 | - .width('2lpx') | ||
| 109 | - .color($r('app.color.white')) | ||
| 110 | - .vertical(true) | ||
| 111 | - .opacity(0.4) | ||
| 112 | - Row() { | ||
| 113 | - Text(`${this.commentNum}`) | ||
| 114 | - .textStyle() | ||
| 115 | - Text("评论") | ||
| 116 | - .textStyle2() | ||
| 117 | - }.margin({ right: '15lpx', left: '15lpx' }) | ||
| 118 | - | ||
| 119 | - Divider() | ||
| 120 | - .height('19lpx') | ||
| 121 | - .width('2lpx') | ||
| 122 | - .color($r('app.color.white')) | ||
| 123 | - .vertical(true) | ||
| 124 | - .opacity(0.4) | ||
| 125 | - Row() { | ||
| 126 | - Text(`${this.attentionNum}`) | ||
| 127 | - .textStyle() | ||
| 128 | - Text("关注") | ||
| 129 | - .textStyle2() | ||
| 130 | - }.margin({ left: '15lpx' }) | ||
| 131 | - }.margin({ top: '23lpx' }) | ||
| 132 | - }.alignItems(HorizontalAlign.Start) | ||
| 133 | - .margin({ left: '32lpx' }) | ||
| 134 | - } | ||
| 135 | - .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 136 | - if (this.firstPositionY === 0) { | ||
| 137 | - this.firstPositionY = newValue.globalPosition.y as number | ||
| 138 | - }else{ | ||
| 139 | - let persent = (this.firstPositionY - Number(newValue.globalPosition.y)) / (this.firstPositionY * 0.3) | ||
| 140 | - if(persent > 1){ | ||
| 141 | - persent = 1 | 98 | + Text(`${this.browseNum}`) |
| 99 | + .textStyle() | ||
| 100 | + Text("阅读") | ||
| 101 | + .textStyle2() | ||
| 142 | } | 102 | } |
| 143 | - this.tileOpacity = persent | 103 | + .margin({ right: '15lpx' }) |
| 104 | + | ||
| 105 | + Divider() | ||
| 106 | + .height('19lpx') | ||
| 107 | + .width('2lpx') | ||
| 108 | + .color($r('app.color.white')) | ||
| 109 | + .vertical(true) | ||
| 110 | + .opacity(0.4) | ||
| 111 | + Row() { | ||
| 112 | + Text(`${this.commentNum}`) | ||
| 113 | + .textStyle() | ||
| 114 | + Text("评论") | ||
| 115 | + .textStyle2() | ||
| 116 | + }.margin({ right: '15lpx', left: '15lpx' }) | ||
| 117 | + | ||
| 118 | + Divider() | ||
| 119 | + .height('19lpx') | ||
| 120 | + .width('2lpx') | ||
| 121 | + .color($r('app.color.white')) | ||
| 122 | + .vertical(true) | ||
| 123 | + .opacity(0.4) | ||
| 124 | + Row() { | ||
| 125 | + Text(`${this.attentionNum}`) | ||
| 126 | + .textStyle() | ||
| 127 | + Text("关注") | ||
| 128 | + .textStyle2() | ||
| 129 | + }.margin({ left: '15lpx' }) | ||
| 130 | + }.margin({ top: '23lpx' }) | ||
| 131 | + }.alignItems(HorizontalAlign.Start) | ||
| 132 | + .margin({ left: '32lpx' }) | ||
| 133 | + } | ||
| 134 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 135 | + if (this.firstPositionY === 0) { | ||
| 136 | + this.firstPositionY = newValue.globalPosition.y as number | ||
| 137 | + }else{ | ||
| 138 | + let persent = (this.firstPositionY - Number(newValue.globalPosition.y)) / (this.firstPositionY * 0.3) | ||
| 139 | + if(persent > 1){ | ||
| 140 | + persent = 1 | ||
| 144 | } | 141 | } |
| 145 | - }) | ||
| 146 | - .backgroundColor($r('app.color.color_transparent')) | ||
| 147 | - .height('184lpx') | ||
| 148 | - .width('100%') | ||
| 149 | - .padding({ left: '35lpx' }) | 142 | + this.tileOpacity = persent |
| 143 | + } | ||
| 144 | + }) | ||
| 145 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 146 | + .height('184lpx') | ||
| 147 | + .width('100%') | ||
| 148 | + .padding({ left: '35lpx' }) | ||
| 150 | //用户简介区域 | 149 | //用户简介区域 |
| 151 | Column() { | 150 | Column() { |
| 152 | Row() { | 151 | Row() { |
| @@ -183,46 +182,21 @@ struct MineHomePage { | @@ -183,46 +182,21 @@ struct MineHomePage { | ||
| 183 | 182 | ||
| 184 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 183 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 185 | 184 | ||
| 186 | - Column(){ | ||
| 187 | - Column() { | ||
| 188 | - // 页签 | ||
| 189 | - Row({ space: 7 }) { | ||
| 190 | - Scroll() { | ||
| 191 | - Row() { | ||
| 192 | - this.TabBuilder(0,"评论") | ||
| 193 | - this.TabBuilder(1,"关注") | ||
| 194 | - } | ||
| 195 | - .justifyContent(FlexAlign.Start) | ||
| 196 | - } | ||
| 197 | - .align(Alignment.Start) | ||
| 198 | - .scrollable(ScrollDirection.Horizontal) | ||
| 199 | - .scrollBar(BarState.Off) | ||
| 200 | - .width('90%') | ||
| 201 | - .padding({left:'31lpx'}) | ||
| 202 | - } | ||
| 203 | - .alignItems(VerticalAlign.Bottom) | ||
| 204 | - .width('100%') | ||
| 205 | - } | ||
| 206 | - .alignItems(HorizontalAlign.Start) | ||
| 207 | - .width('100%') | ||
| 208 | - | ||
| 209 | - //tab 页面 | ||
| 210 | - Tabs({controller: this.controller}) { | ||
| 211 | - TabContent() { | ||
| 212 | - HomePageBottomComponent({style:0}) | ||
| 213 | - } | ||
| 214 | - TabContent() { | ||
| 215 | - HomePageBottomComponent({style:1}) | ||
| 216 | - } | ||
| 217 | - } | ||
| 218 | - .backgroundColor($r('app.color.white')) | ||
| 219 | - .animationDuration(0) | ||
| 220 | - .onChange((index: number) => { | ||
| 221 | - this.currentIndex = index | ||
| 222 | - }) | ||
| 223 | - .vertical(false) | ||
| 224 | - .barHeight(0) | 185 | + //tab 页面 |
| 186 | + Tabs({controller: this.controller}) { | ||
| 187 | + TabContent() { | ||
| 188 | + HomePageBottomComponent({style:0}) | ||
| 189 | + }.tabBar(this.TabBuilder(0,"评论")) | ||
| 190 | + TabContent() { | ||
| 191 | + HomePageBottomComponent({style:1}) | ||
| 192 | + }.tabBar(this.TabBuilder(1,"关注")) | ||
| 225 | } | 193 | } |
| 194 | + .backgroundColor($r('app.color.white')) | ||
| 195 | + .animationDuration(0) | ||
| 196 | + .onChange((index: number) => { | ||
| 197 | + this.currentIndex = index | ||
| 198 | + }) | ||
| 199 | + .vertical(false) | ||
| 226 | }.width("100%") | 200 | }.width("100%") |
| 227 | } | 201 | } |
| 228 | .edgeEffect(EdgeEffect.None) | 202 | .edgeEffect(EdgeEffect.None) |
| @@ -232,8 +206,8 @@ struct MineHomePage { | @@ -232,8 +206,8 @@ struct MineHomePage { | ||
| 232 | } | 206 | } |
| 233 | }.width('100%') | 207 | }.width('100%') |
| 234 | .layoutWeight(1) | 208 | .layoutWeight(1) |
| 235 | - } | ||
| 236 | 209 | ||
| 210 | + } | ||
| 237 | @Builder MineHomeTitleTransparent() { | 211 | @Builder MineHomeTitleTransparent() { |
| 238 | RelativeContainer() { | 212 | RelativeContainer() { |
| 239 | //标题栏目 | 213 | //标题栏目 |
| @@ -291,35 +265,35 @@ struct MineHomePage { | @@ -291,35 +265,35 @@ struct MineHomePage { | ||
| 291 | .onClick(() => { | 265 | .onClick(() => { |
| 292 | router.back() | 266 | router.back() |
| 293 | }) | 267 | }) |
| 294 | - Image(`${this.headPhotoUrl}`) | ||
| 295 | - .alt($r('app.media.default_head')) | ||
| 296 | - .width('60lpx') | ||
| 297 | - .height('60lpx') | ||
| 298 | - .objectFit(ImageFit.Auto) | ||
| 299 | - .id("head_icon") | ||
| 300 | - .borderRadius(50) | ||
| 301 | - .alignRules({ | ||
| 302 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 303 | - left: { anchor: "back_icon", align: HorizontalAlign.End } | ||
| 304 | - }) | ||
| 305 | - .margin({ left: '31lpx' }) | ||
| 306 | - .onClick(() => { | ||
| 307 | - router.back() | ||
| 308 | - }) | ||
| 309 | - | ||
| 310 | - Text(`${this.userName}`) | ||
| 311 | - .height('42lpx') | ||
| 312 | - .maxLines(1) | ||
| 313 | - .id("title") | ||
| 314 | - .fontSize('35lpx') | ||
| 315 | - .fontWeight('400lpx') | ||
| 316 | - .fontColor($r('app.color.color_222222')) | ||
| 317 | - .lineHeight('42lpx') | ||
| 318 | - .alignRules({ | ||
| 319 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 320 | - left: { anchor: "head_icon", align: HorizontalAlign.End } | ||
| 321 | - }) | ||
| 322 | - .margin({ left: '12lpx' }) | 268 | + Image(`${this.headPhotoUrl}`) |
| 269 | + .alt($r('app.media.default_head')) | ||
| 270 | + .width('60lpx') | ||
| 271 | + .height('60lpx') | ||
| 272 | + .objectFit(ImageFit.Auto) | ||
| 273 | + .id("head_icon") | ||
| 274 | + .borderRadius(50) | ||
| 275 | + .alignRules({ | ||
| 276 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 277 | + left: { anchor: "back_icon", align: HorizontalAlign.End } | ||
| 278 | + }) | ||
| 279 | + .margin({ left: '31lpx' }) | ||
| 280 | + .onClick(() => { | ||
| 281 | + router.back() | ||
| 282 | + }) | ||
| 283 | + | ||
| 284 | + Text(`${this.userName}`) | ||
| 285 | + .height('42lpx') | ||
| 286 | + .maxLines(1) | ||
| 287 | + .id("title") | ||
| 288 | + .fontSize('35lpx') | ||
| 289 | + .fontWeight('400lpx') | ||
| 290 | + .fontColor($r('app.color.color_222222')) | ||
| 291 | + .lineHeight('42lpx') | ||
| 292 | + .alignRules({ | ||
| 293 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 294 | + left: { anchor: "head_icon", align: HorizontalAlign.End } | ||
| 295 | + }) | ||
| 296 | + .margin({ left: '12lpx' }) | ||
| 323 | 297 | ||
| 324 | Text("编辑资料") | 298 | Text("编辑资料") |
| 325 | .height('42lpx') | 299 | .height('42lpx') |
| @@ -368,9 +342,9 @@ struct MineHomePage { | @@ -368,9 +342,9 @@ struct MineHomePage { | ||
| 368 | this.currentIndex = index | 342 | this.currentIndex = index |
| 369 | this.controller.changeIndex(this.currentIndex) | 343 | this.controller.changeIndex(this.currentIndex) |
| 370 | }) | 344 | }) |
| 371 | - .height('77lpx') | ||
| 372 | - .width('70lpx') | ||
| 373 | - .margin({right:'29lpx'}) | 345 | + .height('100%') |
| 346 | + .width('100%') | ||
| 347 | + .margin({right:'9lpx'}) | ||
| 374 | } | 348 | } |
| 375 | 349 | ||
| 376 | /** | 350 | /** |
| @@ -14,7 +14,7 @@ struct OtherNormalUserHomePage { | @@ -14,7 +14,7 @@ struct OtherNormalUserHomePage { | ||
| 14 | @State params:Params = router.getParams() as Params; | 14 | @State params:Params = router.getParams() as Params; |
| 15 | @Watch('change') @State curUserId: string = '-1'; | 15 | @Watch('change') @State curUserId: string = '-1'; |
| 16 | 16 | ||
| 17 | - onPageShow() { | 17 | + onPageShow() { |
| 18 | this.curUserId = this.params?.pageID; | 18 | this.curUserId = this.params?.pageID; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| @@ -172,51 +172,24 @@ struct OtherNormalUserHomePage { | @@ -172,51 +172,24 @@ struct OtherNormalUserHomePage { | ||
| 172 | .width('100%') | 172 | .width('100%') |
| 173 | .backgroundColor($r('app.color.white')) | 173 | .backgroundColor($r('app.color.white')) |
| 174 | } | 174 | } |
| 175 | - | ||
| 176 | //间隔符 | 175 | //间隔符 |
| 177 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 176 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 178 | 177 | ||
| 179 | - Column(){ | ||
| 180 | - Column() { | ||
| 181 | - // 页签 | ||
| 182 | - Row({ space: 7 }) { | ||
| 183 | - Scroll() { | ||
| 184 | - Row() { | ||
| 185 | - this.TabBuilder(0,"评论") | ||
| 186 | - this.TabBuilder(1,"关注") | ||
| 187 | - } | ||
| 188 | - .justifyContent(FlexAlign.Start) | ||
| 189 | - } | ||
| 190 | - .align(Alignment.Start) | ||
| 191 | - .scrollable(ScrollDirection.Horizontal) | ||
| 192 | - .scrollBar(BarState.Off) | ||
| 193 | - .width('90%') | ||
| 194 | - .padding({left:'31lpx'}) | ||
| 195 | - } | ||
| 196 | - .alignItems(VerticalAlign.Bottom) | ||
| 197 | - .width('100%') | ||
| 198 | - } | ||
| 199 | - .backgroundColor($r('app.color.white')) | ||
| 200 | - .alignItems(HorizontalAlign.Start) | ||
| 201 | - .width('100%') | ||
| 202 | - | ||
| 203 | - //tab 页面 | ||
| 204 | - Tabs({controller: this.controller}) { | ||
| 205 | - TabContent() { | ||
| 206 | - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 207 | - } | ||
| 208 | - TabContent() { | ||
| 209 | - OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 210 | - } | ||
| 211 | - } | ||
| 212 | - .backgroundColor($r('app.color.white')) | ||
| 213 | - .animationDuration(0) | ||
| 214 | - .onChange((index: number) => { | ||
| 215 | - this.currentIndex = index | ||
| 216 | - }) | ||
| 217 | - .vertical(false) | ||
| 218 | - .barHeight(0) | 178 | + //tab 页面 |
| 179 | + Tabs({controller: this.controller}) { | ||
| 180 | + TabContent() { | ||
| 181 | + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 182 | + }.tabBar(this.TabBuilder(0,"评论")) | ||
| 183 | + TabContent() { | ||
| 184 | + OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 185 | + }.tabBar(this.TabBuilder(1,"关注")) | ||
| 219 | } | 186 | } |
| 187 | + .backgroundColor($r('app.color.white')) | ||
| 188 | + .animationDuration(0) | ||
| 189 | + .onChange((index: number) => { | ||
| 190 | + this.currentIndex = index | ||
| 191 | + }) | ||
| 192 | + .vertical(false) | ||
| 220 | }.width("100%") | 193 | }.width("100%") |
| 221 | } | 194 | } |
| 222 | .edgeEffect(EdgeEffect.None) | 195 | .edgeEffect(EdgeEffect.None) |
| @@ -327,9 +300,9 @@ struct OtherNormalUserHomePage { | @@ -327,9 +300,9 @@ struct OtherNormalUserHomePage { | ||
| 327 | this.currentIndex = index | 300 | this.currentIndex = index |
| 328 | this.controller.changeIndex(this.currentIndex) | 301 | this.controller.changeIndex(this.currentIndex) |
| 329 | }) | 302 | }) |
| 330 | - .height('77lpx') | ||
| 331 | - .width('70lpx') | ||
| 332 | - .margin({right:'29lpx'}) | 303 | + .height('100%') |
| 304 | + .width('100%') | ||
| 305 | + .margin({right:'9lpx'}) | ||
| 333 | } | 306 | } |
| 334 | 307 | ||
| 335 | 308 |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "components/page/BrowsingHistoryPage", | 13 | "components/page/BrowsingHistoryPage", |
| 14 | "components/page/MyCollectionListPage", | 14 | "components/page/MyCollectionListPage", |
| 15 | "pages/OtherNormalUserHomePage", | 15 | "pages/OtherNormalUserHomePage", |
| 16 | - "pages/SearchPage" | 16 | + "pages/SearchPage", |
| 17 | + "pages/SearchCreatorPage" | ||
| 17 | ] | 18 | ] |
| 18 | } | 19 | } |
-
Please register or login to post a comment