Showing
10 changed files
with
74 additions
and
29 deletions
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; | 2 | import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; |
| 3 | -import { ToastUtils } from 'wdKit'; | 3 | +import { DisplayUtils, ToastUtils } from 'wdKit'; |
| 4 | import { WDShare } from 'wdShare/Index'; | 4 | import { WDShare } from 'wdShare/Index'; |
| 5 | import { TrackConstants } from 'wdTracking/Index'; | 5 | import { TrackConstants } from 'wdTracking/Index'; |
| 6 | import font from '@ohos.font'; | 6 | import font from '@ohos.font'; |
| @@ -130,11 +130,11 @@ export struct PaperTitleComponent { | @@ -130,11 +130,11 @@ export struct PaperTitleComponent { | ||
| 130 | @Builder | 130 | @Builder |
| 131 | rightDecorateBuilder() { | 131 | rightDecorateBuilder() { |
| 132 | Row() | 132 | Row() |
| 133 | - .width('80vp') | 133 | + .width(DisplayUtils.getDeviceWidth() - 265) |
| 134 | .height('18vp') | 134 | .height('18vp') |
| 135 | - .clip(new Path({ | ||
| 136 | - commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z` | ||
| 137 | - })) | 135 | + // .clip(new Path({ |
| 136 | + // commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z` | ||
| 137 | + // })) | ||
| 138 | .linearGradient({ | 138 | .linearGradient({ |
| 139 | direction: GradientDirection.Right, // 渐变方向 | 139 | direction: GradientDirection.Right, // 渐变方向 |
| 140 | repeating: false, // 渐变颜色是否重复 | 140 | repeating: false, // 渐变颜色是否重复 |
| @@ -145,7 +145,7 @@ export struct LiveFollowComponent { | @@ -145,7 +145,7 @@ export struct LiveFollowComponent { | ||
| 145 | ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { | 145 | ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { |
| 146 | console.log('关注号主获取积分==', JSON.stringify(res.data)) | 146 | console.log('关注号主获取积分==', JSON.stringify(res.data)) |
| 147 | if (res.data?.showToast) { | 147 | if (res.data?.showToast) { |
| 148 | - ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | 148 | + // ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); |
| 149 | } | 149 | } |
| 150 | }) | 150 | }) |
| 151 | } | 151 | } |
| @@ -16,6 +16,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | @@ -16,6 +16,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | ||
| 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 17 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 17 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 18 | import measure from '@ohos.measure' | 18 | import measure from '@ohos.measure' |
| 19 | +import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | ||
| 19 | @Component | 20 | @Component |
| 20 | export struct RmhTitle { | 21 | export struct RmhTitle { |
| 21 | @State compDTO: CompDTO = new CompDTO() | 22 | @State compDTO: CompDTO = new CompDTO() |
| @@ -74,7 +75,7 @@ export struct RmhTitle { | @@ -74,7 +75,7 @@ export struct RmhTitle { | ||
| 74 | ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { | 75 | ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { |
| 75 | console.log('关注号主获取积分==', JSON.stringify(res.data)) | 76 | console.log('关注号主获取积分==', JSON.stringify(res.data)) |
| 76 | if (res.data?.showToast) { | 77 | if (res.data?.showToast) { |
| 77 | - ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | 78 | + // ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); |
| 78 | } | 79 | } |
| 79 | }) | 80 | }) |
| 80 | } | 81 | } |
| @@ -236,13 +237,24 @@ export struct RmhTitle { | @@ -236,13 +237,24 @@ export struct RmhTitle { | ||
| 236 | .height(36) | 237 | .height(36) |
| 237 | .margin({ bottom: 10 }) | 238 | .margin({ bottom: 10 }) |
| 238 | .onClick(()=>{ | 239 | .onClick(()=>{ |
| 240 | + this.gotoPeopleShipHomePage() | ||
| 241 | + }) | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + async gotoPeopleShipHomePage(){ | ||
| 239 | ///个人主页 动态头像不能跳转 | 245 | ///个人主页 动态头像不能跳转 |
| 240 | if (this.isPeopleShipHome) return | 246 | if (this.isPeopleShipHome) return |
| 241 | - | 247 | + try { |
| 248 | + let detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.rmhInfo?.rmhId, '', '') | ||
| 249 | + if (detailModel) { | ||
| 242 | // 跳转号主 | 250 | // 跳转号主 |
| 243 | - ProcessUtils.gotoPeopleShipHomePage( this.rmhInfo?.rmhId,this.rmhInfo?.banControl,this.rmhInfo?.cnMainControl,this.rmhInfo?.userId,this.rmhInfo?.userType) | ||
| 244 | - | ||
| 245 | - }) | 251 | + ProcessUtils.gotoPeopleShipHomePage(this.rmhInfo?.rmhId,this.rmhInfo?.banControl,this.rmhInfo?.cnMainControl,this.rmhInfo?.userId,this.rmhInfo?.userType) |
| 252 | + }else { | ||
| 253 | + ToastUtils.showToast('暂时无法查看该创作者主页',1000); | ||
| 254 | + } | ||
| 255 | + }catch { | ||
| 256 | + ToastUtils.showToast('暂时无法查看该创作者主页',1000); | ||
| 257 | + } | ||
| 246 | } | 258 | } |
| 247 | 259 | ||
| 248 | // 获取文本宽度 | 260 | // 获取文本宽度 |
| @@ -56,17 +56,17 @@ export default struct MinePageUserSimpleInfoUI { | @@ -56,17 +56,17 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 56 | 56 | ||
| 57 | Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head_userPage')) | 57 | Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head_userPage')) |
| 58 | .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) | 58 | .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) |
| 59 | - .width(63.21) | ||
| 60 | - .height(63.21) | ||
| 61 | - .objectFit(ImageFit.Cover) | ||
| 62 | - .borderRadius(50) | 59 | + .width(64) |
| 60 | + .height(64) | ||
| 61 | + .objectFit(ImageFit.Fill) | ||
| 62 | + .borderRadius(32) | ||
| 63 | 63 | ||
| 64 | if(StringUtils.isNotEmpty(this.levelHead)){ | 64 | if(StringUtils.isNotEmpty(this.levelHead)){ |
| 65 | Image(this.levelHead) | 65 | Image(this.levelHead) |
| 66 | - .width(75.86) | ||
| 67 | - .height(75.86) | 66 | + .width(90) |
| 67 | + .height(90) | ||
| 68 | .objectFit(ImageFit.Cover) | 68 | .objectFit(ImageFit.Cover) |
| 69 | - .borderRadius(50) | 69 | + // .borderRadius(50) |
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | .width(86) | 72 | .width(86) |
| @@ -172,7 +172,7 @@ export struct HomePageBottomCommentComponent { | @@ -172,7 +172,7 @@ export struct HomePageBottomCommentComponent { | ||
| 172 | parentCommentUserName)) | 172 | parentCommentUserName)) |
| 173 | }) | 173 | }) |
| 174 | 174 | ||
| 175 | - this.bottomCompH = DisplayUtils.getDeviceHeight() - data.length*160 | 175 | + this.bottomCompH = DisplayUtils.getDeviceHeight() - data.length*160 - 140 |
| 176 | if (status.commentIdList.length === 0) { | 176 | if (status.commentIdList.length === 0) { |
| 177 | 177 | ||
| 178 | if (this.curPageNum === 1) this.data_comment.clear() | 178 | if (this.curPageNum === 1) this.data_comment.clear() |
| @@ -184,7 +184,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -184,7 +184,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 184 | this.data_comment.notifyDataReload() | 184 | this.data_comment.notifyDataReload() |
| 185 | 185 | ||
| 186 | this.count = this.data_comment.totalCount() | 186 | this.count = this.data_comment.totalCount() |
| 187 | - this.commentNum = value.totalCount | 187 | + // this.commentNum = value.totalCount |
| 188 | if (value.hasNext === 1) { | 188 | if (value.hasNext === 1) { |
| 189 | this.curPageNum++ | 189 | this.curPageNum++ |
| 190 | } else { | 190 | } else { |
| @@ -214,7 +214,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -214,7 +214,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 214 | this.data_comment.notifyDataReload() | 214 | this.data_comment.notifyDataReload() |
| 215 | 215 | ||
| 216 | this.count = this.data_comment.totalCount() | 216 | this.count = this.data_comment.totalCount() |
| 217 | - this.commentNum = value.totalCount | 217 | + // this.commentNum = value.totalCount |
| 218 | if (value.hasNext === 1) { | 218 | if (value.hasNext === 1) { |
| 219 | this.curPageNum++ | 219 | this.curPageNum++ |
| 220 | } else { | 220 | } else { |
| @@ -236,7 +236,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -236,7 +236,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 236 | this.data_comment.notifyDataReload() | 236 | this.data_comment.notifyDataReload() |
| 237 | 237 | ||
| 238 | this.count = this.data_comment.totalCount() | 238 | this.count = this.data_comment.totalCount() |
| 239 | - this.commentNum = value.totalCount | 239 | + // this.commentNum = value.totalCount |
| 240 | if (value.hasNext === 1) { | 240 | if (value.hasNext === 1) { |
| 241 | this.curPageNum++ | 241 | this.curPageNum++ |
| 242 | } else { | 242 | } else { |
| 1 | import { CommonConstants, ViewType } from 'wdConstant'; | 1 | import { CommonConstants, ViewType } from 'wdConstant'; |
| 2 | -import { Logger } from 'wdKit'; | 2 | +import { Logger, NetworkUtil } from 'wdKit'; |
| 3 | import { EmptyComponent } from '../view/EmptyComponent'; | 3 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 4 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; | 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; |
| @@ -41,6 +41,7 @@ export struct PageComponent { | @@ -41,6 +41,7 @@ export struct PageComponent { | ||
| 41 | private pageTrackBean: PageTrackBean = new PageTrackBean() | 41 | private pageTrackBean: PageTrackBean = new PageTrackBean() |
| 42 | // 国殇灰度管理 | 42 | // 国殇灰度管理 |
| 43 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') | 43 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') |
| 44 | + @State netStatus: number | undefined = undefined // 存储网络状态 | ||
| 44 | 45 | ||
| 45 | build() { | 46 | build() { |
| 46 | Column() { | 47 | Column() { |
| @@ -278,19 +279,26 @@ export struct PageComponent { | @@ -278,19 +279,26 @@ export struct PageComponent { | ||
| 278 | if (this.navIndex === this.currentTopNavSelectedIndex) { | 279 | if (this.navIndex === this.currentTopNavSelectedIndex) { |
| 279 | this.getData(); | 280 | this.getData(); |
| 280 | this.needload = false; | 281 | this.needload = false; |
| 282 | + // console.log(TAG, 'aboutToAppear onAutoRefresh111 ' + this.needload) | ||
| 281 | } | 283 | } |
| 282 | } | 284 | } |
| 283 | 285 | ||
| 284 | onChange() { | 286 | onChange() { |
| 285 | - Logger.info(TAG, | ||
| 286 | - `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); | 287 | + // console.log(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); |
| 288 | + // 注册监听网络连接 | ||
| 289 | + this.netStatus = undefined | ||
| 290 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 291 | + if (netStatus) { | ||
| 287 | if (this.navIndex === this.currentTopNavSelectedIndex) { | 292 | if (this.navIndex === this.currentTopNavSelectedIndex) { |
| 288 | - Logger.debug(TAG, 'page onAutoRefresh111 ' + this.needload) | 293 | + // console.log(TAG, 'page onAutoRefresh111 ' + this.needload) |
| 289 | if (this.needload) { | 294 | if (this.needload) { |
| 290 | this.getData(); | 295 | this.getData(); |
| 291 | } | 296 | } |
| 292 | this.needload = false; | 297 | this.needload = false; |
| 293 | } | 298 | } |
| 299 | + } else { | ||
| 300 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 301 | + } | ||
| 294 | } | 302 | } |
| 295 | 303 | ||
| 296 | onAutoRefresh() { | 304 | onAutoRefresh() { |
| @@ -46,7 +46,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -46,7 +46,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 46 | authIcon: this.detailModel.authIcon | 46 | authIcon: this.detailModel.authIcon |
| 47 | }).margin({ | 47 | }).margin({ |
| 48 | left: '10vp', | 48 | left: '10vp', |
| 49 | - bottom: '20vp' | 49 | + bottom: '15vp' |
| 50 | }).onClick(() => { | 50 | }).onClick(() => { |
| 51 | let params = { | 51 | let params = { |
| 52 | 'headPhotoUrl': this.detailModel.headPhotoUrl, | 52 | 'headPhotoUrl': this.detailModel.headPhotoUrl, |
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | postInteractBrowsOperateParams | 8 | postInteractBrowsOperateParams |
| 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 10 | import { HttpUtils } from 'wdNetwork/Index'; | 10 | import { HttpUtils } from 'wdNetwork/Index'; |
| 11 | -import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index'; | 11 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, NetworkType, WindowModel } from 'wdKit/Index'; |
| 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; | 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; |
| 13 | import { PlayerRightView } from '../view/PlayerRightView'; | 13 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 14 | import { DisplayDirection } from 'wdConstant/Index'; | 14 | import { DisplayDirection } from 'wdConstant/Index'; |
| @@ -61,6 +61,7 @@ export struct DetailPlayShortVideoPage { | @@ -61,6 +61,7 @@ export struct DetailPlayShortVideoPage { | ||
| 61 | @Consume toastTextVisible: boolean | 61 | @Consume toastTextVisible: boolean |
| 62 | @StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm'; | 62 | @StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm'; |
| 63 | @State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false | 63 | @State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false |
| 64 | + @State timer: number = -1 | ||
| 64 | 65 | ||
| 65 | currentChanged() { | 66 | currentChanged() { |
| 66 | if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") { | 67 | if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") { |
| @@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage { | @@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage { | ||
| 230 | 231 | ||
| 231 | ///解决初始化竖屏视频时 this.ratio未更新导致显示错误 | 232 | ///解决初始化竖屏视频时 this.ratio未更新导致显示错误 |
| 232 | this.calculatePlayerRect() | 233 | this.calculatePlayerRect() |
| 234 | + | ||
| 235 | + // 注册监听网络连接 | ||
| 236 | + EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => { | ||
| 237 | + if (this.timer) { | ||
| 238 | + clearTimeout(this.timer) | ||
| 239 | + } | ||
| 240 | + this.timer = setTimeout(() => { | ||
| 241 | + let type: NetworkType | null = null | ||
| 242 | + if (str) { | ||
| 243 | + type = JSON.parse(str) as NetworkType | ||
| 244 | + } | ||
| 245 | + // 注册监听网络连接 | ||
| 246 | + if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) { | ||
| 247 | + console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index) | ||
| 248 | + this.currentIndexChange() | ||
| 249 | + } | ||
| 250 | + }, 1000) | ||
| 251 | + })) | ||
| 233 | } | 252 | } |
| 234 | 253 | ||
| 235 | contentTrackingDict() { | 254 | contentTrackingDict() { |
| 1 | import { ContentDetailDTO } from 'wdBean/Index'; | 1 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 2 | -import { DateTimeUtils, ToastUtils } from 'wdKit/Index'; | 2 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'; |
| 3 | import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index'; | 3 | import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index'; |
| 4 | 4 | ||
| 5 | @Reusable | 5 | @Reusable |
| @@ -49,6 +49,12 @@ export struct PlayerProgressView { | @@ -49,6 +49,12 @@ export struct PlayerProgressView { | ||
| 49 | this.playerController?.play() | 49 | this.playerController?.play() |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | + // 注册监听网络连接 | ||
| 53 | + EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => { | ||
| 54 | + if (this.timer) { | ||
| 55 | + clearTimeout(this.timer) | ||
| 56 | + } | ||
| 57 | + })) | ||
| 52 | } | 58 | } |
| 53 | 59 | ||
| 54 | /** | 60 | /** |
-
Please register or login to post a comment