Showing
10 changed files
with
167 additions
and
78 deletions
| @@ -44,6 +44,9 @@ export class SpConstants{ | @@ -44,6 +44,9 @@ export class SpConstants{ | ||
| 44 | //启动页数据存储key | 44 | //启动页数据存储key |
| 45 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' | 45 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' |
| 46 | 46 | ||
| 47 | + //国殇模式数据存储key | ||
| 48 | + static APP_MOURNS_INFO_DATA_MODEL = 'app_mourns_info_model' | ||
| 49 | + | ||
| 47 | //频道信息流页面左右挂角 | 50 | //频道信息流页面左右挂角 |
| 48 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' | 51 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' |
| 49 | 52 |
| @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | ||
| 14 | @Entry | 14 | @Entry |
| 15 | @Component | 15 | @Component |
| 16 | export struct ZhSingleColumn09 { | 16 | export struct ZhSingleColumn09 { |
| 17 | - @State fullyTraversed: boolean = false; | 17 | + @State fullyTraversed: boolean = false; //换一换置灰标记 |
| 18 | @State private pageModel: PageModel = new PageModel(); | 18 | @State private pageModel: PageModel = new PageModel(); |
| 19 | @State pageId: string = ''; | 19 | @State pageId: string = ''; |
| 20 | @State pageName: string = ''; | 20 | @State pageName: string = ''; |
| @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | ||
| 26 | @State compIndex: number = 0; | 26 | @State compIndex: number = 0; |
| 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 | 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 |
| 28 | @State visitedIndices: Set<number> = new Set<number>(); | 28 | @State visitedIndices: Set<number> = new Set<number>(); |
| 29 | + private currentIndex: number = 0; | ||
| 30 | + @State currentDataList: ContentDTO[] = [] | ||
| 29 | 31 | ||
| 30 | async aboutToAppear(): Promise<void> { | 32 | async aboutToAppear(): Promise<void> { |
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | - this.operDataList = this.shuffleArray(this.compDTO?.operDataList) | 34 | + // this.operDataList = this.shuffleArray(this.compDTO?.operDataList) |
| 35 | + this.operDataList = this.padData(this.compDTO?.operDataList) | ||
| 33 | this.currentOperDataListIndex = this.compDTO?.operDataList.length | 36 | this.currentOperDataListIndex = this.compDTO?.operDataList.length |
| 37 | + this.currentDataList = this.getNextBatch() | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 若数据不满足8个以上直接返回 | ||
| 42 | + * 若最后一屏不够补齐至8个 | ||
| 43 | + * */ | ||
| 44 | + private padData(data: ContentDTO[]): ContentDTO[] { | ||
| 45 | + if (data.length < 9) { | ||
| 46 | + return data | ||
| 47 | + } | ||
| 48 | + const remainder = data.length % 8; | ||
| 49 | + if (remainder === 0) { | ||
| 50 | + return data; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + const paddingCount = 8 - remainder; | ||
| 54 | + const padding = data.slice(0, paddingCount); | ||
| 55 | + | ||
| 56 | + return [...data, ...padding]; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 换一换切换数据 | ||
| 61 | + * */ | ||
| 62 | + public getNextBatch(): ContentDTO[] { | ||
| 63 | + const batch = this.operDataList.slice(this.currentIndex, this.currentIndex + 8); | ||
| 64 | + this.currentIndex += 8; | ||
| 65 | + if (this.currentIndex >= this.operDataList.length) { | ||
| 66 | + this.fullyTraversed = true //数据展现完毕,置灰标记 | ||
| 67 | + } | ||
| 68 | + return batch; | ||
| 34 | } | 69 | } |
| 35 | 70 | ||
| 36 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { | 71 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { |
| @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | ||
| 142 | .justifyContent(FlexAlign.SpaceBetween) | 177 | .justifyContent(FlexAlign.SpaceBetween) |
| 143 | .width('100%') | 178 | .width('100%') |
| 144 | 179 | ||
| 145 | - Flex({wrap: FlexWrap.Wrap}) { | ||
| 146 | - ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => { | 180 | + Flex({ wrap: FlexWrap.Wrap }) { |
| 181 | + ForEach(this.currentDataList, (item: ContentDTO, index: number) => { | ||
| 147 | Row() { | 182 | Row() { |
| 148 | Stack({ alignContent: Alignment.TopEnd }) { | 183 | Stack({ alignContent: Alignment.TopEnd }) { |
| 149 | Image(this.loadImg ? item.coverUrl : '') | 184 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | ||
| 204 | return | 239 | return |
| 205 | } | 240 | } |
| 206 | if (this.compDTO?.operDataList.length > 8) { | 241 | if (this.compDTO?.operDataList.length > 8) { |
| 207 | - this.operDataList = this.shuffleArray(this.operDataList) | 242 | + // this.operDataList = this.shuffleArray(this.operDataList) |
| 208 | // if (this.pageModel) { | 243 | // if (this.pageModel) { |
| 209 | // this.pageModel.compList.deleteItem(this.compIndex) | 244 | // this.pageModel.compList.deleteItem(this.compIndex) |
| 210 | // } | 245 | // } |
| 246 | + if (this.fullyTraversed) { | ||
| 247 | + return; // 所有数据已取完 | ||
| 248 | + } | ||
| 249 | + this.currentDataList = this.getNextBatch() | ||
| 211 | this.activeIndexs = []; | 250 | this.activeIndexs = []; |
| 212 | } | 251 | } |
| 213 | }) | 252 | }) |
| 1 | import { PeopleShipRecommendComponent } from './PeopleShipRecommendComponent'; | 1 | import { PeopleShipRecommendComponent } from './PeopleShipRecommendComponent'; |
| 2 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; | 2 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; |
| 3 | import { HttpUtils } from 'wdNetwork/Index'; | 3 | import { HttpUtils } from 'wdNetwork/Index'; |
| 4 | -import { Logger, DateTimeUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 4 | +import { Logger, DateTimeUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit'; |
| 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate,closeRefresh } from '../../utils/NewPullDownRefresh'; | 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate,closeRefresh } from '../../utils/NewPullDownRefresh'; |
| 6 | 6 | ||
| 7 | import { | 7 | import { |
| @@ -88,27 +88,31 @@ export struct PeopleShipMainComponent { | @@ -88,27 +88,31 @@ export struct PeopleShipMainComponent { | ||
| 88 | Column(){ | 88 | Column(){ |
| 89 | if (this.viewType == ViewType.LOADING) { | 89 | if (this.viewType == ViewType.LOADING) { |
| 90 | this.LoadingLayout() | 90 | this.LoadingLayout() |
| 91 | - } else if (this.viewType == ViewType.ERROR) { | ||
| 92 | - //缺省页 | ||
| 93 | - EmptyComponent({ | ||
| 94 | - emptyType: this.pageModel.emptyType, | ||
| 95 | - emptyButton: true, | ||
| 96 | - retry: () => { | ||
| 97 | - this.getData() | ||
| 98 | - } | ||
| 99 | - }) | ||
| 100 | - .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 101 | - } else if (this.viewType == ViewType.EMPTY) { | ||
| 102 | - //缺省页 | ||
| 103 | - EmptyComponent({ | ||
| 104 | - emptyType: this.pageModel.emptyType, | ||
| 105 | - emptyButton: true, | ||
| 106 | - retry: () => { | ||
| 107 | - this.getData() | ||
| 108 | - } | ||
| 109 | - }) | ||
| 110 | - .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 111 | - }else { | 91 | + } |
| 92 | + // else if (this.viewType == ViewType.ERROR) { | ||
| 93 | + // //缺省页 | ||
| 94 | + // // EmptyComponent({ | ||
| 95 | + // // emptyType: this.pageModel.emptyType, | ||
| 96 | + // // emptyButton: true, | ||
| 97 | + // // retry: () => { | ||
| 98 | + // // this.getData() | ||
| 99 | + // // } | ||
| 100 | + // // }) | ||
| 101 | + // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 102 | + // | ||
| 103 | + // } else if (this.viewType == ViewType.EMPTY) { | ||
| 104 | + // // //缺省页 | ||
| 105 | + // // EmptyComponent({ | ||
| 106 | + // // emptyType: this.pageModel.emptyType, | ||
| 107 | + // // emptyButton: true, | ||
| 108 | + // // retry: () => { | ||
| 109 | + // // this.getData() | ||
| 110 | + // // } | ||
| 111 | + // // }) | ||
| 112 | + // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 113 | + // | ||
| 114 | + // } | ||
| 115 | + else { | ||
| 112 | if (this.followList.length == 0) { | 116 | if (this.followList.length == 0) { |
| 113 | this.ListLayout() | 117 | this.ListLayout() |
| 114 | } else { | 118 | } else { |
| @@ -328,7 +332,7 @@ export struct PeopleShipMainComponent { | @@ -328,7 +332,7 @@ export struct PeopleShipMainComponent { | ||
| 328 | // 获取用户关注人数 | 332 | // 获取用户关注人数 |
| 329 | let object = new FollowListDetailRequestItem(-1, 20, 1) | 333 | let object = new FollowListDetailRequestItem(-1, 20, 1) |
| 330 | let followInfo = await MinePageDatasModel.getMineFollowListData(object, getContext(this)) | 334 | let followInfo = await MinePageDatasModel.getMineFollowListData(object, getContext(this)) |
| 331 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(followInfo)}`) | 335 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(followInfo)}`) |
| 332 | 336 | ||
| 333 | if (followInfo.list.length == 0) { | 337 | if (followInfo.list.length == 0) { |
| 334 | this.followList = [] | 338 | this.followList = [] |
| @@ -347,6 +351,7 @@ export struct PeopleShipMainComponent { | @@ -347,6 +351,7 @@ export struct PeopleShipMainComponent { | ||
| 347 | } catch (exception) { | 351 | } catch (exception) { |
| 348 | this.viewType = ViewType.ERROR | 352 | this.viewType = ViewType.ERROR |
| 349 | this.isLoading = false | 353 | this.isLoading = false |
| 354 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 350 | } | 355 | } |
| 351 | } | 356 | } |
| 352 | 357 | ||
| @@ -362,11 +367,14 @@ export struct PeopleShipMainComponent { | @@ -362,11 +367,14 @@ export struct PeopleShipMainComponent { | ||
| 362 | this.viewType = ViewType.LOADED | 367 | this.viewType = ViewType.LOADED |
| 363 | this.changeButton = false | 368 | this.changeButton = false |
| 364 | this.isLoading = false | 369 | this.isLoading = false |
| 365 | - Logger.debug('PeopleShipMainComponent', 'getRmhRecommendInfo' + `${JSON.stringify(this.rmhList)}`) | 370 | + // Logger.debug('PeopleShipMainComponent', 'getRmhRecommendInfo' + `${JSON.stringify(this.rmhList)}`) |
| 366 | if (resolve) { | 371 | if (resolve) { |
| 367 | resolve('已更新至最新') | 372 | resolve('已更新至最新') |
| 368 | } | 373 | } |
| 369 | this.closeRefresh(true) | 374 | this.closeRefresh(true) |
| 375 | + if(this.rmhList?.length! === 0) { | ||
| 376 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 377 | + } | ||
| 370 | } catch (exception) { | 378 | } catch (exception) { |
| 371 | if (resolve) { | 379 | if (resolve) { |
| 372 | resolve('') | 380 | resolve('') |
| @@ -375,6 +383,7 @@ export struct PeopleShipMainComponent { | @@ -375,6 +383,7 @@ export struct PeopleShipMainComponent { | ||
| 375 | this.viewType = ViewType.ERROR | 383 | this.viewType = ViewType.ERROR |
| 376 | this.changeButton = false | 384 | this.changeButton = false |
| 377 | this.isLoading = false | 385 | this.isLoading = false |
| 386 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 378 | } | 387 | } |
| 379 | } | 388 | } |
| 380 | 389 | ||
| @@ -390,7 +399,7 @@ export struct PeopleShipMainComponent { | @@ -390,7 +399,7 @@ export struct PeopleShipMainComponent { | ||
| 390 | try { | 399 | try { |
| 391 | // 获取列表数据 | 400 | // 获取列表数据 |
| 392 | let listData = await PeopleShipMainViewModel.getAttentionContentListInfo(this.currentPage, 20, this.loadTime) | 401 | let listData = await PeopleShipMainViewModel.getAttentionContentListInfo(this.currentPage, 20, this.loadTime) |
| 393 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) | 402 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) |
| 394 | if (listData && listData.list && listData.list.length > 0) { | 403 | if (listData && listData.list && listData.list.length > 0) { |
| 395 | if (listData.list.length === 20) { | 404 | if (listData.list.length === 20) { |
| 396 | this.hasMore = true; | 405 | this.hasMore = true; |
| @@ -429,7 +438,7 @@ export struct PeopleShipMainComponent { | @@ -429,7 +438,7 @@ export struct PeopleShipMainComponent { | ||
| 429 | }) | 438 | }) |
| 430 | 439 | ||
| 431 | let listData = await PeopleShipMainViewModel.getContentInteractInfo(params) | 440 | let listData = await PeopleShipMainViewModel.getContentInteractInfo(params) |
| 432 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) | 441 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) |
| 433 | this.resolveEnd(true, resolve) | 442 | this.resolveEnd(true, resolve) |
| 434 | 443 | ||
| 435 | if (this.currentPage == 1) { | 444 | if (this.currentPage == 1) { |
| @@ -481,6 +490,7 @@ export struct PeopleShipMainComponent { | @@ -481,6 +490,7 @@ export struct PeopleShipMainComponent { | ||
| 481 | } | 490 | } |
| 482 | if (this.currentPage == 1 && !isTop) { | 491 | if (this.currentPage == 1 && !isTop) { |
| 483 | this.viewType = ViewType.ERROR | 492 | this.viewType = ViewType.ERROR |
| 493 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 484 | } else { | 494 | } else { |
| 485 | this.viewType = ViewType.LOADED | 495 | this.viewType = ViewType.LOADED |
| 486 | } | 496 | } |
| @@ -489,8 +499,8 @@ export struct PeopleShipMainComponent { | @@ -489,8 +499,8 @@ export struct PeopleShipMainComponent { | ||
| 489 | 499 | ||
| 490 | // 说是首页必须要调用 | 500 | // 说是首页必须要调用 |
| 491 | async getInitData() { | 501 | async getInitData() { |
| 492 | - Logger.debug('PeopleShipMainComponent', | ||
| 493 | - `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | 502 | + // Logger.debug('PeopleShipMainComponent', |
| 503 | + // `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 494 | this.pageModel.pageId = this.pageId; | 504 | this.pageModel.pageId = this.pageId; |
| 495 | this.pageModel.groupId = this.pageId; | 505 | this.pageModel.groupId = this.pageId; |
| 496 | this.pageModel.channelId = this.channelId; | 506 | this.pageModel.channelId = this.channelId; |
| @@ -526,7 +536,7 @@ export struct PeopleShipMainComponent { | @@ -526,7 +536,7 @@ export struct PeopleShipMainComponent { | ||
| 526 | objects.creators.push(creator) | 536 | objects.creators.push(creator) |
| 527 | } | 537 | } |
| 528 | }) | 538 | }) |
| 529 | - Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); | 539 | + // Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); |
| 530 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) | 540 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) |
| 531 | this.oneKeyFollow = false | 541 | this.oneKeyFollow = false |
| 532 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { | 542 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { |
| @@ -556,7 +566,7 @@ export struct PeopleShipMainComponent { | @@ -556,7 +566,7 @@ export struct PeopleShipMainComponent { | ||
| 556 | return | 566 | return |
| 557 | } | 567 | } |
| 558 | // 当前页面,自动刷新数据 | 568 | // 当前页面,自动刷新数据 |
| 559 | - Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) | 569 | + // Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) |
| 560 | this.listScroller.scrollToIndex(0) | 570 | this.listScroller.scrollToIndex(0) |
| 561 | autoRefresh(this.pageModel,this.onRefresh) | 571 | autoRefresh(this.pageModel,this.onRefresh) |
| 562 | } | 572 | } |
| @@ -159,6 +159,9 @@ export struct DetailPlayVLivePage { | @@ -159,6 +159,9 @@ export struct DetailPlayVLivePage { | ||
| 159 | } else { | 159 | } else { |
| 160 | // 直播暂停,仍然可以评论 | 160 | // 直播暂停,仍然可以评论 |
| 161 | if (this.liveState === 'pause') { | 161 | if (this.liveState === 'pause') { |
| 162 | + RelativeContainer() | ||
| 163 | + .backgroundColor('#000000') | ||
| 164 | + .opacity(0.5) | ||
| 162 | LiveEmptyComponent({ | 165 | LiveEmptyComponent({ |
| 163 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 166 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 164 | }) | 167 | }) |
| @@ -173,6 +176,9 @@ export struct DetailPlayVLivePage { | @@ -173,6 +176,9 @@ export struct DetailPlayVLivePage { | ||
| 173 | 176 | ||
| 174 | } else { | 177 | } else { |
| 175 | // 没有配置垫片资源 | 178 | // 没有配置垫片资源 |
| 179 | + RelativeContainer() | ||
| 180 | + .backgroundColor('#000000') | ||
| 181 | + .opacity(0.5) | ||
| 176 | LiveEmptyComponent({ | 182 | LiveEmptyComponent({ |
| 177 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 183 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 178 | }) | 184 | }) |
| @@ -98,7 +98,7 @@ export struct DetailPlayShortVideoPage { | @@ -98,7 +98,7 @@ export struct DetailPlayShortVideoPage { | ||
| 98 | this.imageVisible = false | 98 | this.imageVisible = false |
| 99 | }) | 99 | }) |
| 100 | } else { | 100 | } else { |
| 101 | - this.playerController.pause() | 101 | + this.playerController.stop() |
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| @@ -189,6 +189,7 @@ export struct DetailPlayShortVideoPage { | @@ -189,6 +189,7 @@ export struct DetailPlayShortVideoPage { | ||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | async aboutToAppear() { | 191 | async aboutToAppear() { |
| 192 | + this.isPlay = true | ||
| 192 | if (!this.onlyWifiLoadVideo) { | 193 | if (!this.onlyWifiLoadVideo) { |
| 193 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() | 194 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() |
| 194 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true | 195 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true |
| @@ -88,7 +88,7 @@ export struct OperationListView { | @@ -88,7 +88,7 @@ export struct OperationListView { | ||
| 88 | } else { | 88 | } else { |
| 89 | this.interactData.likeNum = Number(this.interactData.likeNum) - 1 | 89 | this.interactData.likeNum = Number(this.interactData.likeNum) - 1 |
| 90 | } | 90 | } |
| 91 | - console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 91 | + // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 92 | // this.queryContentInteractCount() | 92 | // this.queryContentInteractCount() |
| 93 | } | 93 | } |
| 94 | 94 | ||
| @@ -124,7 +124,7 @@ export struct OperationListView { | @@ -124,7 +124,7 @@ export struct OperationListView { | ||
| 124 | } else { | 124 | } else { |
| 125 | this.interactData.collectNum = Number(this.interactData.collectNum) - 1 | 125 | this.interactData.collectNum = Number(this.interactData.collectNum) - 1 |
| 126 | } | 126 | } |
| 127 | - console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 127 | + // console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 128 | } | 128 | } |
| 129 | }) | 129 | }) |
| 130 | 130 | ||
| @@ -146,7 +146,7 @@ export struct OperationListView { | @@ -146,7 +146,7 @@ export struct OperationListView { | ||
| 146 | this.interactData.collectNum = res.data[0]?.collectNum | 146 | this.interactData.collectNum = res.data[0]?.collectNum |
| 147 | this.interactData.commentNum = res.data[0]?.commentNum | 147 | this.interactData.commentNum = res.data[0]?.commentNum |
| 148 | } | 148 | } |
| 149 | - console.log('获取互动点赞等数据===', JSON.stringify(res)) | 149 | + // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 150 | }) | 150 | }) |
| 151 | } | 151 | } |
| 152 | 152 | ||
| @@ -174,7 +174,7 @@ export struct OperationListView { | @@ -174,7 +174,7 @@ export struct OperationListView { | ||
| 174 | status: 1, | 174 | status: 1, |
| 175 | } | 175 | } |
| 176 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 176 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 177 | - console.log('关注号主==', JSON.stringify(res.data)) | 177 | + // console.log('关注号主==', JSON.stringify(res.data)) |
| 178 | if (this.followStatus == '1') { | 178 | if (this.followStatus == '1') { |
| 179 | this.followStatus = '0' | 179 | this.followStatus = '0' |
| 180 | } else { | 180 | } else { |
| @@ -87,21 +87,21 @@ export struct PlayerRightView { | @@ -87,21 +87,21 @@ export struct PlayerRightView { | ||
| 87 | relType: this.contentDetailData?.reLInfo?.relType || '' + '', | 87 | relType: this.contentDetailData?.reLInfo?.relType || '' + '', |
| 88 | userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', | 88 | userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', |
| 89 | } | 89 | } |
| 90 | - console.log(TAG, '点赞params', JSON.stringify(params)) | 90 | + // console.log(TAG, '点赞params', JSON.stringify(params)) |
| 91 | ContentDetailRequest.postExecuteLike(params).then(res => { | 91 | ContentDetailRequest.postExecuteLike(params).then(res => { |
| 92 | - console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 92 | + // console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 93 | if (this.newsStatusOfUser) { | 93 | if (this.newsStatusOfUser) { |
| 94 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 94 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 95 | if (this.newsStatusOfUser.likeStatus == '1') { | 95 | if (this.newsStatusOfUser.likeStatus == '1') { |
| 96 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 96 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 97 | TrackingContent.like(true, this.pageId, this.pageName, this.pageParam) | 97 | TrackingContent.like(true, this.pageId, this.pageName, this.pageParam) |
| 98 | - console.log(TAG, '点赞') | 98 | + // console.log(TAG, '点赞') |
| 99 | } else { | 99 | } else { |
| 100 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) | 100 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| 101 | TrackingContent.like(false, this.pageId, this.pageName, this.pageParam) | 101 | TrackingContent.like(false, this.pageId, this.pageName, this.pageParam) |
| 102 | - console.log(TAG, '取消点赞') | 102 | + // console.log(TAG, '取消点赞') |
| 103 | } | 103 | } |
| 104 | - console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 104 | + // console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 105 | // this.queryContentInteractCount() | 105 | // this.queryContentInteractCount() |
| 106 | } | 106 | } |
| 107 | 107 | ||
| @@ -135,13 +135,13 @@ export struct PlayerRightView { | @@ -135,13 +135,13 @@ export struct PlayerRightView { | ||
| 135 | if (this.newsStatusOfUser.collectStatus === 1) { | 135 | if (this.newsStatusOfUser.collectStatus === 1) { |
| 136 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 | 136 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 |
| 137 | TrackingContent.collect(true, this.pageId, this.pageName, this.pageParam) | 137 | TrackingContent.collect(true, this.pageId, this.pageName, this.pageParam) |
| 138 | - console.log(TAG, '收藏') | 138 | + // console.log(TAG, '收藏') |
| 139 | } else { | 139 | } else { |
| 140 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) | 140 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) |
| 141 | TrackingContent.collect(false, this.pageId, this.pageName, this.pageParam) | 141 | TrackingContent.collect(false, this.pageId, this.pageName, this.pageParam) |
| 142 | - console.log(TAG, '取消收藏') | 142 | + // console.log(TAG, '取消收藏') |
| 143 | } | 143 | } |
| 144 | - console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 144 | + // console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 145 | } | 145 | } |
| 146 | }) | 146 | }) |
| 147 | 147 | ||
| @@ -163,7 +163,7 @@ export struct PlayerRightView { | @@ -163,7 +163,7 @@ export struct PlayerRightView { | ||
| 163 | this.interactData.collectNum = res.data[0]?.collectNum || 0 | 163 | this.interactData.collectNum = res.data[0]?.collectNum || 0 |
| 164 | this.interactData.commentNum = res.data[0]?.commentNum || 0 | 164 | this.interactData.commentNum = res.data[0]?.commentNum || 0 |
| 165 | } | 165 | } |
| 166 | - console.log('获取互动点赞等数据===', JSON.stringify(res)) | 166 | + // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 167 | }) | 167 | }) |
| 168 | } | 168 | } |
| 169 | 169 | ||
| @@ -191,17 +191,18 @@ export struct PlayerRightView { | @@ -191,17 +191,18 @@ export struct PlayerRightView { | ||
| 191 | status: 1, | 191 | status: 1, |
| 192 | } | 192 | } |
| 193 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 193 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 194 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | 194 | + // console.log(TAG, '关注号主==', JSON.stringify(res.data)) |
| 195 | if (this.followStatus == '1') { | 195 | if (this.followStatus == '1') { |
| 196 | this.followStatus = '0' | 196 | this.followStatus = '0' |
| 197 | } else { | 197 | } else { |
| 198 | this.followStatus = '1' | 198 | this.followStatus = '1' |
| 199 | - ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { | ||
| 200 | - if (res.data?.showToast) { | ||
| 201 | - ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | ||
| 202 | - } | ||
| 203 | - }) | ||
| 204 | - console.log(TAG, '关注号主') | 199 | + ContentDetailRequest.postPointLevelOperate({ operateType: 6 }) |
| 200 | + // .then((res) => { | ||
| 201 | + // if (res.data?.showToast) { | ||
| 202 | + // ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | ||
| 203 | + // } | ||
| 204 | + // }) | ||
| 205 | + // console.log(TAG, '关注号主') | ||
| 205 | TrackingContent.follow(true, this.followUserId, this.followUserName, this.pageId, this.pageName, this.pageParam) | 206 | TrackingContent.follow(true, this.followUserId, this.followUserName, this.pageId, this.pageName, this.pageParam) |
| 206 | } | 207 | } |
| 207 | }) | 208 | }) |
| @@ -302,8 +303,7 @@ export struct PlayerRightView { | @@ -302,8 +303,7 @@ export struct PlayerRightView { | ||
| 302 | } | 303 | } |
| 303 | 304 | ||
| 304 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { | 305 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { |
| 305 | - console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum, | ||
| 306 | - this.interactData.commentNum) | 306 | + // console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum,this.interactData.commentNum) |
| 307 | if (name === 'likeNum') { | 307 | if (name === 'likeNum') { |
| 308 | return this.interactData.likeNum != 0 ? | 308 | return this.interactData.likeNum != 0 ? |
| 309 | NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' | 309 | NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' |
| @@ -32,7 +32,7 @@ struct MainPage { | @@ -32,7 +32,7 @@ struct MainPage { | ||
| 32 | upgradeDialogController?: CustomDialogController | 32 | upgradeDialogController?: CustomDialogController |
| 33 | 33 | ||
| 34 | watchCurrentBreakpoint() { | 34 | watchCurrentBreakpoint() { |
| 35 | - Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); | 35 | + // Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | aboutToAppear() { | 38 | aboutToAppear() { |
| @@ -41,14 +41,14 @@ struct MainPage { | @@ -41,14 +41,14 @@ struct MainPage { | ||
| 41 | 41 | ||
| 42 | this.breakpointSystem.register() | 42 | this.breakpointSystem.register() |
| 43 | 43 | ||
| 44 | - Logger.info(TAG, `aboutToAppear `); | 44 | + // Logger.info(TAG, `aboutToAppear `); |
| 45 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | 45 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { |
| 46 | LogoutViewModel.clearLoginInfo() | 46 | LogoutViewModel.clearLoginInfo() |
| 47 | }) | 47 | }) |
| 48 | 48 | ||
| 49 | - let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | 49 | + let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,'') as string |
| 50 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | 50 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) |
| 51 | - console.log(dataModelStr) | 51 | + // console.log(dataModelStr) |
| 52 | // 处理国殇模式数据 | 52 | // 处理国殇模式数据 |
| 53 | let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | 53 | let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel |
| 54 | let GrayManage = new GrayManageModel() | 54 | let GrayManage = new GrayManageModel() |
| @@ -63,22 +63,22 @@ struct MainPage { | @@ -63,22 +63,22 @@ struct MainPage { | ||
| 63 | 63 | ||
| 64 | aboutToDisappear() { | 64 | aboutToDisappear() { |
| 65 | this.breakpointSystem.unregister() | 65 | this.breakpointSystem.unregister() |
| 66 | - Logger.info(TAG, 'aboutToDisappear'); | 66 | + // Logger.info(TAG, 'aboutToDisappear'); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | onPageHide() { | 69 | onPageHide() { |
| 70 | - Logger.info(TAG, 'onPageHide'); | 70 | + // Logger.info(TAG, 'onPageHide'); |
| 71 | this.pageHide = Math.random() | 71 | this.pageHide = Math.random() |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | onPageShow() { | 74 | onPageShow() { |
| 75 | - Logger.info(TAG, 'onPageShow'); | 75 | + // Logger.info(TAG, 'onPageShow'); |
| 76 | this.pageShow = Math.random() | 76 | this.pageShow = Math.random() |
| 77 | 77 | ||
| 78 | // 升级检查 | 78 | // 升级检查 |
| 79 | // this.upgradeCheck() | 79 | // this.upgradeCheck() |
| 80 | 80 | ||
| 81 | - Logger.debug('setBarBackgroundColor','Top onPageShow ') | 81 | + // Logger.debug('setBarBackgroundColor','Top onPageShow ') |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | upgradeCheck() { | 84 | upgradeCheck() { |
| @@ -104,8 +104,6 @@ struct MainPage { | @@ -104,8 +104,6 @@ struct MainPage { | ||
| 104 | }) | 104 | }) |
| 105 | this.upgradeDialogController?.open() | 105 | this.upgradeDialogController?.open() |
| 106 | } | 106 | } |
| 107 | - }).catch(() => { | ||
| 108 | - | ||
| 109 | }) | 107 | }) |
| 110 | } | 108 | } |
| 111 | 109 | ||
| @@ -115,13 +113,13 @@ struct MainPage { | @@ -115,13 +113,13 @@ struct MainPage { | ||
| 115 | // 拦截返回键,切到后台 | 113 | // 拦截返回键,切到后台 |
| 116 | const windowClass = WindowModel.shared.getWindowClass() as window.Window | 114 | const windowClass = WindowModel.shared.getWindowClass() as window.Window |
| 117 | windowClass.minimize().then(() => { | 115 | windowClass.minimize().then(() => { |
| 118 | - Logger.debug(TAG, 'Succeeded in minimizing the window.'); | 116 | + // Logger.debug(TAG, 'Succeeded in minimizing the window.'); |
| 119 | }).catch((err: BusinessError) => { | 117 | }).catch((err: BusinessError) => { |
| 120 | - Logger.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err)); | 118 | + // Logger.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err)); |
| 121 | return false | 119 | return false |
| 122 | }); | 120 | }); |
| 123 | } catch (err) { | 121 | } catch (err) { |
| 124 | - Logger.error(TAG, 'Failed to minimize: ' + JSON.stringify(err)); | 122 | + // Logger.error(TAG, 'Failed to minimize: ' + JSON.stringify(err)); |
| 125 | return false | 123 | return false |
| 126 | } | 124 | } |
| 127 | return true | 125 | return true |
| @@ -105,16 +105,13 @@ struct LaunchPage { | @@ -105,16 +105,13 @@ struct LaunchPage { | ||
| 105 | 105 | ||
| 106 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | 106 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string |
| 107 | if (!dataModelStr) { | 107 | if (!dataModelStr) { |
| 108 | - this.requestLaunchPageData() | ||
| 109 | //直接跳转首页 | 108 | //直接跳转首页 |
| 110 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 109 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 111 | return | 110 | return |
| 112 | } | 111 | } |
| 113 | 112 | ||
| 114 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | 113 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) |
| 115 | - console.log(dataModelStr) | ||
| 116 | - //同意隐私协议后每次启动app请求启动页相关数据,并更新数据 | ||
| 117 | - this.requestLaunchPageData(); | 114 | + // console.log(dataModelStr) |
| 118 | 115 | ||
| 119 | if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) { | 116 | if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) { |
| 120 | //跳转广告页 | 117 | //跳转广告页 |
| @@ -126,6 +123,8 @@ struct LaunchPage { | @@ -126,6 +123,8 @@ struct LaunchPage { | ||
| 126 | //直接跳转首页 | 123 | //直接跳转首页 |
| 127 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 124 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 128 | } | 125 | } |
| 126 | + //同意隐私协议后每次启动app请求启动页相关数据,并更新数据 | ||
| 127 | + this.requestLaunchPageData(); | ||
| 129 | } | 128 | } |
| 130 | }); | 129 | }); |
| 131 | }); | 130 | }); |
| @@ -194,8 +193,15 @@ struct LaunchPage { | @@ -194,8 +193,15 @@ struct LaunchPage { | ||
| 194 | launchPageModel.getLaunchPageData() | 193 | launchPageModel.getLaunchPageData() |
| 195 | } | 194 | } |
| 196 | 195 | ||
| 196 | + requestMournsInfoData() { | ||
| 197 | + //请求国殇模式数据并保存 | ||
| 198 | + let launchPageModel = new LaunchPageModel() | ||
| 199 | + launchPageModel.getMournsInfoData() | ||
| 200 | + } | ||
| 201 | + | ||
| 197 | aboutToAppear(): void { | 202 | aboutToAppear(): void { |
| 198 | this.requestAgreement() | 203 | this.requestAgreement() |
| 204 | + this.requestMournsInfoData() | ||
| 199 | } | 205 | } |
| 200 | 206 | ||
| 201 | 207 |
| @@ -20,15 +20,41 @@ export class LaunchPageModel { | @@ -20,15 +20,41 @@ export class LaunchPageModel { | ||
| 20 | fail(data.message) | 20 | fail(data.message) |
| 21 | return | 21 | return |
| 22 | } | 22 | } |
| 23 | - Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) | 23 | + // Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) |
| 24 | success(data.data); | 24 | success(data.data); |
| 25 | //存储数据 | 25 | //存储数据 |
| 26 | let obj : string = JSON.stringify(data.data) | 26 | let obj : string = JSON.stringify(data.data) |
| 27 | - console.log('LaunchPageModel获取启动相关数据',obj) | 27 | + // console.log(obj) |
| 28 | SPHelper.default.saveSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,obj) | 28 | SPHelper.default.saveSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,obj) |
| 29 | 29 | ||
| 30 | }, (error: Error) => { | 30 | }, (error: Error) => { |
| 31 | - Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) | 31 | + // Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) |
| 32 | + fail(error.message) | ||
| 33 | + }) | ||
| 34 | + }) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + getMournsInfoData(): Promise<LaunchDataModel> { | ||
| 38 | + return new Promise<LaunchDataModel>((success, fail) => { | ||
| 39 | + HttpRequest.get<ResponseDTO<LaunchDataModel>>(HttpUrlUtils.getLaunchPageDataUrl()).then((data: ResponseDTO<LaunchDataModel>) => { | ||
| 40 | + if (!data || !data.data) { | ||
| 41 | + fail("数据为空") | ||
| 42 | + return | ||
| 43 | + } | ||
| 44 | + if (data.code != 0) { | ||
| 45 | + fail(data.message) | ||
| 46 | + return | ||
| 47 | + } | ||
| 48 | + // Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) | ||
| 49 | + // 处理国殇模式数据 | ||
| 50 | + success(data.data); | ||
| 51 | + //存储数据 | ||
| 52 | + let obj : string = JSON.stringify(data.data) | ||
| 53 | + // console.log(obj) | ||
| 54 | + SPHelper.default.saveSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,obj) | ||
| 55 | + | ||
| 56 | + }, (error: Error) => { | ||
| 57 | + // Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) | ||
| 32 | fail(error.message) | 58 | fail(error.message) |
| 33 | }) | 59 | }) |
| 34 | }) | 60 | }) |
-
Please register or login to post a comment