Showing
20 changed files
with
174 additions
and
169 deletions
| @@ -32,9 +32,10 @@ export class SpConstants{ | @@ -32,9 +32,10 @@ export class SpConstants{ | ||
| 32 | static PUBLICVISUTORMODE_INTERESTTAGS = 'PublicVisitorMode_InterestTags' | 32 | static PUBLICVISUTORMODE_INTERESTTAGS = 'PublicVisitorMode_InterestTags' |
| 33 | 33 | ||
| 34 | //定位相关 | 34 | //定位相关 |
| 35 | - static LOCATION_CITY_NAME = "location_city_name" //定位 | ||
| 36 | - static LOCATION_CITY_CODE = "location_city_code" //定位 | 35 | + static LOCATION_CITY_NAME = "location_city_name" //城市名称 |
| 36 | + static LOCATION_CITY_CODE = "location_city_code" //城市code | ||
| 37 | static LOCATION_PROVINCE_CODE = "location_province_code" //定位,省份code | 37 | static LOCATION_PROVINCE_CODE = "location_province_code" //定位,省份code |
| 38 | + static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称 | ||
| 38 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 | 39 | static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114 |
| 39 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 | 40 | static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位 |
| 40 | 41 |
| @@ -29,6 +29,8 @@ export struct WdWebComponent { | @@ -29,6 +29,8 @@ export struct WdWebComponent { | ||
| 29 | .mixedMode(MixedMode.All) | 29 | .mixedMode(MixedMode.All) |
| 30 | .onlineImageAccess(true) | 30 | .onlineImageAccess(true) |
| 31 | .enableNativeEmbedMode(true) | 31 | .enableNativeEmbedMode(true) |
| 32 | + .horizontalScrollBarAccess(false) | ||
| 33 | + .verticalScrollBarAccess(false) | ||
| 32 | .onPageBegin((event) => { | 34 | .onPageBegin((event) => { |
| 33 | this.onPageBegin(event?.url); | 35 | this.onPageBegin(event?.url); |
| 34 | }) | 36 | }) |
| @@ -40,6 +40,7 @@ export struct ENewspaperItemComponent { | @@ -40,6 +40,7 @@ export struct ENewspaperItemComponent { | ||
| 40 | Image(this.newspaperListItemBean.pagePic) | 40 | Image(this.newspaperListItemBean.pagePic) |
| 41 | .width(px2vp(this.itemPicWidth)) | 41 | .width(px2vp(this.itemPicWidth)) |
| 42 | .height(px2vp(this.itemPicHeight)) | 42 | .height(px2vp(this.itemPicHeight)) |
| 43 | + .alt($r('app.media.paper_placeholder')) | ||
| 43 | .onComplete((event) => { | 44 | .onComplete((event) => { |
| 44 | if (event?.loadingStatus == 1) { | 45 | if (event?.loadingStatus == 1) { |
| 45 | this.contentWidth = event?.contentWidth | 46 | this.contentWidth = event?.contentWidth |
| @@ -49,8 +50,9 @@ export struct ENewspaperItemComponent { | @@ -49,8 +50,9 @@ export struct ENewspaperItemComponent { | ||
| 49 | }) | 50 | }) |
| 50 | .objectFit(ImageFit.Fill) | 51 | .objectFit(ImageFit.Fill) |
| 51 | .zIndex(10) | 52 | .zIndex(10) |
| 52 | - newsSkeleton() | ||
| 53 | - .zIndex(1) | 53 | + // newsSkeleton() |
| 54 | + // .height('100%') | ||
| 55 | + // .zIndex(1) | ||
| 54 | if (this.contentWidth !== 0) { | 56 | if (this.contentWidth !== 0) { |
| 55 | Canvas(this.context) | 57 | Canvas(this.context) |
| 56 | .width(px2vp(this.contentWidth)) | 58 | .width(px2vp(this.contentWidth)) |
| @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent { | @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent { | ||
| 68 | @Provide progressVal: number = 0; | 68 | @Provide progressVal: number = 0; |
| 69 | @State mixedBgColor: string = '' | 69 | @State mixedBgColor: string = '' |
| 70 | // 顶部安全高度赋值 | 70 | // 顶部安全高度赋值 |
| 71 | - @State topSafeHeight: number = 0; | ||
| 72 | - @State bottomSafeHeight: number = 0; | 71 | + @State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0) |
| 72 | + @State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0) | ||
| 73 | @State isHasTopView: boolean = false; | 73 | @State isHasTopView: boolean = false; |
| 74 | @State scrollOffset: number = 0 | 74 | @State scrollOffset: number = 0 |
| 75 | @State currentStatus: number | string |undefined = 0; | 75 | @State currentStatus: number | string |undefined = 0; |
| @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent { | @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent { | ||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | async aboutToAppear() { | 123 | async aboutToAppear() { |
| 124 | - let windowHight: window.Window = await window.getLastWindow(getContext(this)); | 124 | + // let windowHight: window.Window = await window.getLastWindow(getContext(this)); |
| 125 | // await windowHight.setWindowLayoutFullScreen(true); | 125 | // await windowHight.setWindowLayoutFullScreen(true); |
| 126 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 126 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 127 | - this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | ||
| 128 | - this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | 127 | + // this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) |
| 128 | + // this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 129 | 129 | ||
| 130 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String | 130 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String |
| 131 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) | 131 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) |
| @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent { | @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent { | ||
| 331 | .height('100%') | 331 | .height('100%') |
| 332 | .objectFit(ImageFit.Contain) | 332 | .objectFit(ImageFit.Contain) |
| 333 | Image($r('app.media.icon_listen')) | 333 | Image($r('app.media.icon_listen')) |
| 334 | - .width(24) | ||
| 335 | - .height(24) | ||
| 336 | - .margin({ left: 10 }) | 334 | + .width(20) |
| 335 | + .height(20) | ||
| 336 | + .margin({ left: 20 }) | ||
| 337 | .alignSelf(ItemAlign.Start) | 337 | .alignSelf(ItemAlign.Start) |
| 338 | 338 | ||
| 339 | Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) | 339 | Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) |
| 340 | .fontSize(14) | 340 | .fontSize(14) |
| 341 | + .fontWeight(FontWeight.Medium) | ||
| 341 | .margin({ left: 50 }) | 342 | .margin({ left: 50 }) |
| 342 | .fontColor(Color.Black) | 343 | .fontColor(Color.Black) |
| 343 | .maxLines(1) | 344 | .maxLines(1) |
| 1 | import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 1 | import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; |
| 2 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 3 | -import router from '@ohos.router'; | ||
| 4 | import { CommonConstants } from 'wdConstant' | 3 | import { CommonConstants } from 'wdConstant' |
| 5 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| 6 | -import { detailedSkeleton } from './skeleton/detailSkeleton' | ||
| 7 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; | 5 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; |
| 8 | import { OperRowListView } from './view/OperRowListView'; | 6 | import { OperRowListView } from './view/OperRowListView'; |
| 9 | import DetailViewModel from '../viewmodel/DetailViewModel'; | 7 | import DetailViewModel from '../viewmodel/DetailViewModel'; |
| @@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit'; | @@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit'; | ||
| 15 | import { PageRepository } from '../repository/PageRepository'; | 13 | import { PageRepository } from '../repository/PageRepository'; |
| 16 | import { CommentDialogView } from './CommentDialogView'; | 14 | import { CommentDialogView } from './CommentDialogView'; |
| 17 | import { faceDetector } from '@kit.CoreVisionKit'; | 15 | import { faceDetector } from '@kit.CoreVisionKit'; |
| 16 | +import { channelSkeleton } from './skeleton/channelSkeleton'; | ||
| 18 | 17 | ||
| 19 | const TAG: string = 'SpacialTopicPageComponent' | 18 | const TAG: string = 'SpacialTopicPageComponent' |
| 20 | 19 | ||
| @@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent { | @@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent { | ||
| 117 | let pageId = this.action.params.extra?.pageId | 116 | let pageId = this.action.params.extra?.pageId |
| 118 | console.log('pageIdpageId',pageId) | 117 | console.log('pageIdpageId',pageId) |
| 119 | if(pageId){ | 118 | if(pageId){ |
| 120 | - let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId) | 119 | + let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId,contentId) |
| 121 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | 120 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) |
| 122 | if (detailBeans?.length > 0) { | 121 | if (detailBeans?.length > 0) { |
| 123 | this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); | 122 | this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); |
| @@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent { | @@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent { | ||
| 192 | }).padding({ bottom: 200 }) | 191 | }).padding({ bottom: 200 }) |
| 193 | } else { | 192 | } else { |
| 194 | if (!this.isPageEnd) { | 193 | if (!this.isPageEnd) { |
| 195 | - detailedSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight }) | 194 | + channelSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight }) |
| 196 | } | 195 | } |
| 197 | } | 196 | } |
| 198 | //底部交互区 | 197 | //底部交互区 |
| @@ -574,7 +574,7 @@ export struct PaperSingleColumn999CardView { | @@ -574,7 +574,7 @@ export struct PaperSingleColumn999CardView { | ||
| 574 | .fontColor('#B0B0B0') | 574 | .fontColor('#B0B0B0') |
| 575 | .margin({ left: this.item?.source.length > 0?0:16 }) | 575 | .margin({ left: this.item?.source.length > 0?0:16 }) |
| 576 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { | 576 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { |
| 577 | - Text(this.interactData.commentNum + "评") | 577 | + Text(this.handlerNum(this.interactData.commentNum.toString()) + "评") |
| 578 | .fontSize(12) | 578 | .fontSize(12) |
| 579 | .fontColor('#B0B0B0') | 579 | .fontColor('#B0B0B0') |
| 580 | .margin({ left: this.getPublishTime().length >0? 6:0 }) | 580 | .margin({ left: this.getPublishTime().length >0? 6:0 }) |
| @@ -671,4 +671,28 @@ export struct PaperSingleColumn999CardView { | @@ -671,4 +671,28 @@ export struct PaperSingleColumn999CardView { | ||
| 671 | } | 671 | } |
| 672 | return contentString; | 672 | return contentString; |
| 673 | } | 673 | } |
| 674 | + | ||
| 675 | + /** | ||
| 676 | + * 全域数字显示规则 | ||
| 677 | + * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | ||
| 678 | + * 2、当数量为万位~1亿时,显示xx 万,保留小数点后一位,比如1517.9w、2.9w | ||
| 679 | + * 3、当数量为1亿~千亿时,显示XX 亿,保留小数点后一位,比如1517.9亿、2.9亿 | ||
| 680 | + * 4、不进行四舍五入 | ||
| 681 | + * 5、0 和空 不显示 | ||
| 682 | + */ | ||
| 683 | + handlerNum(number: string) { | ||
| 684 | + const num = number??'0'; | ||
| 685 | + if (Number.parseInt(num) <= 9999) { | ||
| 686 | + return Number.parseInt(num).toString() | ||
| 687 | + } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | ||
| 688 | + const num1: string = num.slice(0, -4); // 万 | ||
| 689 | + const num2: string = num.slice(-4, -3); // 千 | ||
| 690 | + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | ||
| 691 | + } else if (Number.parseInt(num) > 99999999) { | ||
| 692 | + const num1: string = num.slice(0, -8); // 亿 | ||
| 693 | + const num2: string = num.slice(-8, -7); | ||
| 694 | + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | ||
| 695 | + } | ||
| 696 | + return num | ||
| 697 | + } | ||
| 674 | } | 698 | } |
| 1 | import { TopNavDTO } from 'wdBean'; | 1 | import { TopNavDTO } from 'wdBean'; |
| 2 | import curves from '@ohos.curves'; | 2 | import curves from '@ohos.curves'; |
| 3 | +import { Logger } from 'wdKit/Index'; | ||
| 3 | 4 | ||
| 4 | const INDEX_SETTING_TITLE: string = '首页设置' | 5 | const INDEX_SETTING_TITLE: string = '首页设置' |
| 5 | const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页' | 6 | const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页' |
| @@ -29,6 +30,7 @@ struct ChannelSubscriptionLayout { | @@ -29,6 +30,7 @@ struct ChannelSubscriptionLayout { | ||
| 29 | @Link localChannelList: TopNavDTO [] | 30 | @Link localChannelList: TopNavDTO [] |
| 30 | // 收集到的我的频道栏目中的频道id | 31 | // 收集到的我的频道栏目中的频道id |
| 31 | @State channelIds: number [] = [] | 32 | @State channelIds: number [] = [] |
| 33 | + // 是否显示频道编辑页面 | ||
| 32 | @State isShow: boolean = false | 34 | @State isShow: boolean = false |
| 33 | @State dragItem: number = -1 | 35 | @State dragItem: number = -1 |
| 34 | private dragRefOffsetX: number = 0 | 36 | private dragRefOffsetX: number = 0 |
| @@ -39,6 +41,9 @@ struct ChannelSubscriptionLayout { | @@ -39,6 +41,9 @@ struct ChannelSubscriptionLayout { | ||
| 39 | private FIX_VP_Y: number = 48 | 41 | private FIX_VP_Y: number = 48 |
| 40 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 42 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 41 | @State isEditIng: boolean = false | 43 | @State isEditIng: boolean = false |
| 44 | + // 顶部导航栏是否有临时跳转频道数据不 | ||
| 45 | + @Prop haveTempTabData: boolean | ||
| 46 | + | ||
| 42 | changeTab: (index: number) => void = () => { | 47 | changeTab: (index: number) => void = () => { |
| 43 | } | 48 | } |
| 44 | 49 | ||
| @@ -63,7 +68,7 @@ struct ChannelSubscriptionLayout { | @@ -63,7 +68,7 @@ struct ChannelSubscriptionLayout { | ||
| 63 | 68 | ||
| 64 | let item = this.myChannelList.splice(index, 1)[0] | 69 | let item = this.myChannelList.splice(index, 1)[0] |
| 65 | this.channelIds.splice(index, 1) | 70 | this.channelIds.splice(index, 1) |
| 66 | - AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds)) | 71 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 67 | 72 | ||
| 68 | /* | 73 | /* |
| 69 | 删除的频道信息回到原栏目中去 | 74 | 删除的频道信息回到原栏目中去 |
| @@ -75,7 +80,6 @@ struct ChannelSubscriptionLayout { | @@ -75,7 +80,6 @@ struct ChannelSubscriptionLayout { | ||
| 75 | this.localChannelList.unshift(item) | 80 | this.localChannelList.unshift(item) |
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | - | ||
| 79 | // 删除频道的索引值大于 我的栏目中频道最大索引值 | 83 | // 删除频道的索引值大于 我的栏目中频道最大索引值 |
| 80 | if (this.currentTopNavSelectedIndex > this.channelIds.length - 1) { | 84 | if (this.currentTopNavSelectedIndex > this.channelIds.length - 1) { |
| 81 | //使用默认频道 | 85 | //使用默认频道 |
| @@ -126,8 +130,8 @@ struct ChannelSubscriptionLayout { | @@ -126,8 +130,8 @@ struct ChannelSubscriptionLayout { | ||
| 126 | this.myChannelList.push(item) | 130 | this.myChannelList.push(item) |
| 127 | AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) | 131 | AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 128 | 132 | ||
| 129 | - // let storageChannelIds: string = AppStorage.get<string>('channelIds') || '' | ||
| 130 | - // console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds) | 133 | + let storageChannelIds: string = AppStorage.get<string>('channelIds') || '' |
| 134 | + console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds) | ||
| 131 | } | 135 | } |
| 132 | 136 | ||
| 133 | itemMove(index: number, newIndex: number): void { | 137 | itemMove(index: number, newIndex: number): void { |
| @@ -566,15 +570,21 @@ struct ChannelSubscriptionLayout { | @@ -566,15 +570,21 @@ struct ChannelSubscriptionLayout { | ||
| 566 | .backgroundColor(Color.White) | 570 | .backgroundColor(Color.White) |
| 567 | .onClick(() => { | 571 | .onClick(() => { |
| 568 | this.isShow = true | 572 | this.isShow = true |
| 573 | + if(this.haveTempTabData){ | ||
| 574 | + // 存储数据 | ||
| 575 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) | ||
| 576 | + this.haveTempTabData = false | ||
| 577 | + } | ||
| 569 | }) | 578 | }) |
| 570 | .bindContentCover(this.isShow, this.sheetBuilder(), { | 579 | .bindContentCover(this.isShow, this.sheetBuilder(), { |
| 571 | modalTransition: ModalTransition.DEFAULT, | 580 | modalTransition: ModalTransition.DEFAULT, |
| 572 | onWillAppear: () => {console.log("BindContentCover onWillAppear.")}, | 581 | onWillAppear: () => {console.log("BindContentCover onWillAppear.")}, |
| 573 | onAppear: () => {console.log("BindContentCover onAppear.")}, | 582 | onAppear: () => {console.log("BindContentCover onAppear.")}, |
| 574 | - onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")}, | ||
| 575 | - onDisappear: () => {console.log("BindContentCover onDisappear.") | 583 | + onWillDisappear: () => {console.log("BindContentCover onWillDisappear.") |
| 576 | this.isShow = false | 584 | this.isShow = false |
| 577 | - this.isEditIng = false} | 585 | + this.isEditIng = false}, |
| 586 | + onDisappear: () => {console.log("BindContentCover onDisappear.") | ||
| 587 | + } | ||
| 578 | }) | 588 | }) |
| 579 | } | 589 | } |
| 580 | 590 | ||
| @@ -591,6 +601,8 @@ struct ChannelSubscriptionLayout { | @@ -591,6 +601,8 @@ struct ChannelSubscriptionLayout { | ||
| 591 | this.channelIds.push(item.channelId) | 601 | this.channelIds.push(item.channelId) |
| 592 | } | 602 | } |
| 593 | }) | 603 | }) |
| 604 | + console.debug('TopNavigationComponent', '--changeMyChannelData channelIds--->' + this.channelIds.join(',')) | ||
| 605 | + | ||
| 594 | } | 606 | } |
| 595 | } | 607 | } |
| 596 | 608 |
| @@ -64,6 +64,8 @@ export struct TopNavigationComponentNew { | @@ -64,6 +64,8 @@ export struct TopNavigationComponentNew { | ||
| 64 | @State indicatorLeftMargin: number = 0 | 64 | @State indicatorLeftMargin: number = 0 |
| 65 | @State indicatorWidth: number = 0 | 65 | @State indicatorWidth: number = 0 |
| 66 | @State isClickMorningEveningPaper: boolean = false | 66 | @State isClickMorningEveningPaper: boolean = false |
| 67 | + // 顶部导航栏是否有临时跳转频道数据不 | ||
| 68 | + @State haveTempTabData: boolean = false | ||
| 67 | 69 | ||
| 68 | build() { | 70 | build() { |
| 69 | Column() { | 71 | Column() { |
| @@ -215,6 +217,7 @@ export struct TopNavigationComponentNew { | @@ -215,6 +217,7 @@ export struct TopNavigationComponentNew { | ||
| 215 | myChannelList: $myChannelList, | 217 | myChannelList: $myChannelList, |
| 216 | moreChannelList: $moreChannelList, | 218 | moreChannelList: $moreChannelList, |
| 217 | localChannelList: $localChannelList, | 219 | localChannelList: $localChannelList, |
| 220 | + haveTempTabData: this.haveTempTabData, | ||
| 218 | changeTab: (index) => { | 221 | changeTab: (index) => { |
| 219 | this.channelJumpToPage(index) | 222 | this.channelJumpToPage(index) |
| 220 | } | 223 | } |
| @@ -374,7 +377,6 @@ export struct TopNavigationComponentNew { | @@ -374,7 +377,6 @@ export struct TopNavigationComponentNew { | ||
| 374 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) | 377 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) |
| 375 | } | 378 | } |
| 376 | 379 | ||
| 377 | - | ||
| 378 | /** | 380 | /** |
| 379 | * 频道是播报 | 381 | * 频道是播报 |
| 380 | * @param item | 382 | * @param item |
| @@ -501,8 +503,6 @@ export struct TopNavigationComponentNew { | @@ -501,8 +503,6 @@ export struct TopNavigationComponentNew { | ||
| 501 | } | 503 | } |
| 502 | let channelId = this.assignChannel.channelId | 504 | let channelId = this.assignChannel.channelId |
| 503 | 505 | ||
| 504 | - Logger.debug(TAG,'------onAssignChannelChange--------->'+channelId+' ==>'+this._currentNavIndex) | ||
| 505 | - | ||
| 506 | let index = -1 | 506 | let index = -1 |
| 507 | if (this._currentNavIndex === 0) { | 507 | if (this._currentNavIndex === 0) { |
| 508 | // 第一个,新闻,先拿我的,再拿其他 | 508 | // 第一个,新闻,先拿我的,再拿其他 |
| @@ -563,14 +563,16 @@ export struct TopNavigationComponentNew { | @@ -563,14 +563,16 @@ export struct TopNavigationComponentNew { | ||
| 563 | for (let i = 0; i < this.moreChannelList.length; i++) { | 563 | for (let i = 0; i < this.moreChannelList.length; i++) { |
| 564 | let topNavDTO: TopNavDTO = this.moreChannelList[i] | 564 | let topNavDTO: TopNavDTO = this.moreChannelList[i] |
| 565 | if (topNavDTO.channelId?.toString() === channelId) { | 565 | if (topNavDTO.channelId?.toString() === channelId) { |
| 566 | - this.moreChannelList.splice(i,1) | 566 | + this.moreChannelList.splice(i, 1) |
| 567 | + this.haveTempTabData = true | ||
| 567 | return topNavDTO | 568 | return topNavDTO |
| 568 | } | 569 | } |
| 569 | } | 570 | } |
| 570 | for (let j = 0; j < this.localChannelList.length; j++) { | 571 | for (let j = 0; j < this.localChannelList.length; j++) { |
| 571 | let topNavDTO: TopNavDTO = this.localChannelList[j] | 572 | let topNavDTO: TopNavDTO = this.localChannelList[j] |
| 572 | if (topNavDTO.channelId?.toString() === channelId) { | 573 | if (topNavDTO.channelId?.toString() === channelId) { |
| 573 | - this.localChannelList.splice(j,1) | 574 | + this.localChannelList.splice(j, 1) |
| 575 | + this.haveTempTabData = true | ||
| 574 | return topNavDTO | 576 | return topNavDTO |
| 575 | } | 577 | } |
| 576 | } | 578 | } |
| @@ -583,19 +585,14 @@ export struct TopNavigationComponentNew { | @@ -583,19 +585,14 @@ export struct TopNavigationComponentNew { | ||
| 583 | clickMorningEveningPaper() { | 585 | clickMorningEveningPaper() { |
| 584 | 586 | ||
| 585 | // 早晚报埋点 | 587 | // 早晚报埋点 |
| 586 | - const params: ParamType = { | ||
| 587 | - "pageName": this.pageName, | ||
| 588 | - "pageId": this.pageId, | ||
| 589 | - } | ||
| 590 | - Tracking.event("morning_evening_news_click", params) | 588 | + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, |
| 589 | + TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 591 | 590 | ||
| 592 | if (NetworkUtil.isNetConnected()) { | 591 | if (NetworkUtil.isNetConnected()) { |
| 593 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { | 592 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { |
| 594 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | 593 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { |
| 595 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | 594 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); |
| 596 | ProcessUtils.gotoMorningEveningPaper() | 595 | ProcessUtils.gotoMorningEveningPaper() |
| 597 | - TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, | ||
| 598 | - TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 599 | } else { | 596 | } else { |
| 600 | ToastUtils.showToast('暂无早晚报信息', 1000) | 597 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 601 | } | 598 | } |
| @@ -622,127 +619,47 @@ export struct TopNavigationComponentNew { | @@ -622,127 +619,47 @@ export struct TopNavigationComponentNew { | ||
| 622 | //请求顶导数据 | 619 | //请求顶导数据 |
| 623 | async getTopNavList(id: number) { | 620 | async getTopNavList(id: number) { |
| 624 | 621 | ||
| 625 | - Logger.debug(TAG, 'getTopNavList==>' + this.storageChannelIds) | 622 | + Logger.debug(TAG, 'getTopNavList=存储=>' + this.storageChannelIds) |
| 626 | 623 | ||
| 627 | let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds) | 624 | let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds) |
| 628 | let topNavList = bottomNavDetail?.topNavChannelList || [] | 625 | let topNavList = bottomNavDetail?.topNavChannelList || [] |
| 629 | 626 | ||
| 630 | - let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string | 627 | + //let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE_NAME, '') as string |
| 631 | let _myChannelList: TopNavDTO [] = [] | 628 | let _myChannelList: TopNavDTO [] = [] |
| 632 | - let _storageChannelIds: string [] = [] //list1 | ||
| 633 | - let defaultMyChannelList: TopNavDTO[] = [] | ||
| 634 | - let defaultList = [...topNavList] | ||
| 635 | - | ||
| 636 | - Logger.debug(TAG, 'cityName=>' + cityName) | ||
| 637 | - // 排序 | ||
| 638 | - defaultList.sort((a, b) => { | ||
| 639 | - return a.num - b.num; | ||
| 640 | - }); | ||
| 641 | - | ||
| 642 | - //defaultMyChannelList | ||
| 643 | - defaultList.forEach(item => { | ||
| 644 | - if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || | ||
| 645 | - item.headlinesOn === 1) { | ||
| 646 | - defaultMyChannelList.push(item); | ||
| 647 | - } | ||
| 648 | - if (item.defaultPermitted === 1) { | ||
| 649 | - this.homeChannelList.push(item) | ||
| 650 | - } | ||
| 651 | - }) | ||
| 652 | - | ||
| 653 | - //有缓存频道id | ||
| 654 | - if (this.storageChannelIds) { | ||
| 655 | - _storageChannelIds = this.storageChannelIds.split(',') | ||
| 656 | 629 | ||
| 657 | - } | ||
| 658 | - | ||
| 659 | - defaultMyChannelList.forEach(item => { | ||
| 660 | - item.myChannel = '1' | 630 | + topNavList.forEach(item => { |
| 661 | if (item.defaultPermitted === 1) { | 631 | if (item.defaultPermitted === 1) { |
| 662 | - item.homeChannel = '1' | ||
| 663 | - } | ||
| 664 | - let index = defaultList.findIndex(_item => _item.channelId === item.channelId) | ||
| 665 | - if (index !== -1) { | ||
| 666 | - defaultList.splice(index, 1) | 632 | + console.debug('TopNavigationComponent', '--homeChannelList--->' + item.name) |
| 633 | + this.homeChannelList.push(item) | ||
| 667 | } | 634 | } |
| 668 | - }) | ||
| 669 | - defaultList.unshift(...defaultMyChannelList) | ||
| 670 | 635 | ||
| 671 | - defaultList.forEach((item, index) => { | ||
| 672 | - if (item.channelType === 2) { | ||
| 673 | - if (cityName.includes(item.name)) { | ||
| 674 | - item.myChannel = '1' | ||
| 675 | - } | ||
| 676 | - item.localChannel = '1' | ||
| 677 | - } | ||
| 678 | - if (index >= 11) { | ||
| 679 | - if (item.channelType === 1) { | ||
| 680 | - item.moreChannel = '1' | ||
| 681 | - } | ||
| 682 | - } else { | ||
| 683 | - if (item.channelType === 1 && item.myChannel !== '1') { | ||
| 684 | - item.moreChannel = '1' | ||
| 685 | - } | ||
| 686 | - } | ||
| 687 | - if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) { | ||
| 688 | - item.myChannel = '1' | ||
| 689 | - } | ||
| 690 | - //频道分类 | ||
| 691 | //TODO 暂时隐藏播报 | 636 | //TODO 暂时隐藏播报 |
| 692 | if (item.name !== '播报') { | 637 | if (item.name !== '播报') { |
| 693 | if (item.myChannel === '1') { | 638 | if (item.myChannel === '1') { |
| 694 | _myChannelList.push(item) | 639 | _myChannelList.push(item) |
| 695 | - } | ||
| 696 | - if (item.moreChannel === '1' && item.myChannel !== '1') { | 640 | + } else if (item.moreChannel === '1' && item.myChannel !== '1') { |
| 697 | this.moreChannelList.push(item) | 641 | this.moreChannelList.push(item) |
| 698 | - } | ||
| 699 | - if (item.localChannel === '1' && item.myChannel !== '1') { | 642 | + } else if (item.localChannel === '1' && item.myChannel !== '1') { |
| 700 | this.localChannelList.push(item) | 643 | this.localChannelList.push(item) |
| 701 | } | 644 | } |
| 702 | } | 645 | } |
| 703 | }) | 646 | }) |
| 704 | 647 | ||
| 705 | - //根据缓存数组排序 | ||
| 706 | - if (this.storageChannelIds) { | ||
| 707 | - | ||
| 708 | - // let sortedyChannelList: TopNavDTO [] = [] | ||
| 709 | - // | ||
| 710 | - // _storageChannelIds.forEach((channelId) => { | ||
| 711 | - // console.debug(TAG, 'getTopNavList=0=>' + channelId) | ||
| 712 | - // for (let a of _myChannelList) { | ||
| 713 | - // | ||
| 714 | - // console.debug(TAG, | ||
| 715 | - // 'getTopNavList=1=>' + channelId + ' ' + a.channelId + ' ' + (channelId == String(a.channelId))) | ||
| 716 | - // if (channelId == String(a.channelId)) { | ||
| 717 | - // sortedyChannelList.push(a) | ||
| 718 | - // break; | ||
| 719 | - // } | ||
| 720 | - // } | ||
| 721 | - // | ||
| 722 | - // }) | ||
| 723 | - | ||
| 724 | - let sortedyChannelList = _myChannelList.sort((item1, item2) => { | ||
| 725 | - let index1 = this.storageChannelIds.indexOf(String(item1.channelId)); | ||
| 726 | - let index2 = this.storageChannelIds.indexOf(String(item2.channelId)); | ||
| 727 | - return index1 - index2; | ||
| 728 | - }); | ||
| 729 | - _myChannelList = sortedyChannelList | ||
| 730 | - } | ||
| 731 | - | ||
| 732 | - // if (cityName) { | ||
| 733 | - // let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | ||
| 734 | - // const localChannelitem = _myChannelList.splice(index, 1)[0]; | ||
| 735 | - // // 将当前地区频道插入到第四个 | ||
| 736 | - // _myChannelList.splice(3, 0, localChannelitem); | ||
| 737 | - // } | ||
| 738 | - | ||
| 739 | this.myChannelList = _myChannelList | 648 | this.myChannelList = _myChannelList |
| 740 | 649 | ||
| 741 | - | ||
| 742 | //缓存首页频道 | 650 | //缓存首页频道 |
| 743 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | 651 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) |
| 744 | if (index > -1) { | 652 | if (index > -1) { |
| 745 | this.currentTopNavSelectedIndex = index | 653 | this.currentTopNavSelectedIndex = index |
| 746 | } | 654 | } |
| 655 | + | ||
| 656 | + // 存储我的频道栏目中的频道id信息 | ||
| 657 | + let channelIds: number [] = [] | ||
| 658 | + this.myChannelList.forEach(item => { | ||
| 659 | + if (item != undefined && item.channelId != undefined) { | ||
| 660 | + channelIds.push(item.channelId) | ||
| 661 | + } | ||
| 662 | + }) | ||
| 663 | + AppStorage.setOrCreate('channelIds', channelIds.join(',')) | ||
| 747 | } | 664 | } |
| 748 | } | 665 | } |
| @@ -346,7 +346,9 @@ export struct SearchResultContentComponent { | @@ -346,7 +346,9 @@ export struct SearchResultContentComponent { | ||
| 346 | }.offset({ left: this.listLeft }) | 346 | }.offset({ left: this.listLeft }) |
| 347 | 347 | ||
| 348 | ListItem(){ | 348 | ListItem(){ |
| 349 | + if (this.data_rmh.length === 10){ | ||
| 349 | this.itemEnd() | 350 | this.itemEnd() |
| 351 | + } | ||
| 350 | }.height('100%') | 352 | }.height('100%') |
| 351 | .margin({left:'23lpx'}) | 353 | .margin({left:'23lpx'}) |
| 352 | } | 354 | } |
| @@ -375,6 +377,8 @@ export struct SearchResultContentComponent { | @@ -375,6 +377,8 @@ export struct SearchResultContentComponent { | ||
| 375 | console.info(TAG,'Pan start') | 377 | console.info(TAG,'Pan start') |
| 376 | }) | 378 | }) |
| 377 | .onActionUpdate((event: GestureEvent) => { | 379 | .onActionUpdate((event: GestureEvent) => { |
| 380 | + ///小于10个不展示滑动 | ||
| 381 | + if (this.data_rmh.length < 10) return; | ||
| 378 | if (event && this.isEnd) { | 382 | if (event && this.isEnd) { |
| 379 | // console.log('event.offsetX',event.offsetX) | 383 | // console.log('event.offsetX',event.offsetX) |
| 380 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX | 384 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX |
| @@ -384,6 +388,7 @@ export struct SearchResultContentComponent { | @@ -384,6 +388,7 @@ export struct SearchResultContentComponent { | ||
| 384 | } | 388 | } |
| 385 | }) | 389 | }) |
| 386 | .onActionEnd((event: GestureEvent) => { | 390 | .onActionEnd((event: GestureEvent) => { |
| 391 | + if (this.data_rmh.length < 10) return; | ||
| 387 | console.info(TAG,'Pan end') | 392 | console.info(TAG,'Pan end') |
| 388 | this.listLeft = 0 | 393 | this.listLeft = 0 |
| 389 | // this.moreWidth = 20 | 394 | // this.moreWidth = 20 |
| @@ -192,9 +192,12 @@ export class PageRepository { | @@ -192,9 +192,12 @@ export class PageRepository { | ||
| 192 | /** | 192 | /** |
| 193 | * 早晚报pageInfo请求 | 193 | * 早晚报pageInfo请求 |
| 194 | * */ | 194 | * */ |
| 195 | - static getMorningEveningPageInfoUrl(pageId: string) { | 195 | + static getMorningEveningPageInfoUrl(pageId: string,topicId:string) { |
| 196 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; | 196 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; |
| 197 | url = url + "?pageId=" + pageId; | 197 | url = url + "?pageId=" + pageId; |
| 198 | + if(!StringUtils.isEmpty(topicId)){ | ||
| 199 | + url = url+ "&topicId=" + topicId; | ||
| 200 | + } | ||
| 198 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) | 201 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| 199 | return url; | 202 | return url; |
| 200 | } | 203 | } |
| @@ -392,8 +395,8 @@ export class PageRepository { | @@ -392,8 +395,8 @@ export class PageRepository { | ||
| 392 | /** | 395 | /** |
| 393 | * 获取早晚报pageInfo | 396 | * 获取早晚报pageInfo |
| 394 | * */ | 397 | * */ |
| 395 | - static fetchMorningEveningPageInfo(pageId: string) { | ||
| 396 | - let url = PageRepository.getMorningEveningPageInfoUrl(pageId) | 398 | + static fetchMorningEveningPageInfo(pageId: string,topicId:string) { |
| 399 | + let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId) | ||
| 397 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) | 400 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) |
| 398 | }; | 401 | }; |
| 399 | 402 | ||
| @@ -418,7 +421,7 @@ export class PageRepository { | @@ -418,7 +421,7 @@ export class PageRepository { | ||
| 418 | * 获取播报pageInfo | 421 | * 获取播报pageInfo |
| 419 | * */ | 422 | * */ |
| 420 | static fetchBroadcastPageInfo(pageId: string) { | 423 | static fetchBroadcastPageInfo(pageId: string) { |
| 421 | - let url = PageRepository.getMorningEveningPageInfoUrl(pageId) | 424 | + let url = PageRepository.getMorningEveningPageInfoUrl(pageId,'') |
| 422 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) | 425 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) |
| 423 | }; | 426 | }; |
| 424 | 427 |
| @@ -96,7 +96,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -96,7 +96,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 96 | }, | 96 | }, |
| 97 | intentEntityInfo: { | 97 | intentEntityInfo: { |
| 98 | entityName: 'Blog', | 98 | entityName: 'Blog', |
| 99 | - entityId: String(item?.newsId) || '', | 99 | + entityId: `objectId=${item?.newsId}&objectType=${item?.newsType}` || '', |
| 100 | displayName: item?.newsTitle || '', | 100 | displayName: item?.newsTitle || '', |
| 101 | entityGroupId: String(item?.reLInfo?.channelId), //channelId | 101 | entityGroupId: String(item?.reLInfo?.channelId), //channelId |
| 102 | logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | 102 | logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', |
| @@ -145,7 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -145,7 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 145 | entityId, | 145 | entityId, |
| 146 | displayName: pageInfoBean?.topicInfo?.title, | 146 | displayName: pageInfoBean?.topicInfo?.title, |
| 147 | description: pageInfoBean?.shareSummary, | 147 | description: pageInfoBean?.shareSummary, |
| 148 | - logoURL: pageInfoBean?.shareCoverUrl, | 148 | + logoURL: pageInfoBean?.shareCoverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', |
| 149 | activityType: ['RecentViews'], | 149 | activityType: ['RecentViews'], |
| 150 | columnTitle: pageInfoBean?.topicInfo?.title, | 150 | columnTitle: pageInfoBean?.topicInfo?.title, |
| 151 | columnSubTitle: pageInfoBean?.shareSummary, | 151 | columnSubTitle: pageInfoBean?.shareSummary, |
| @@ -9,7 +9,7 @@ export class BroadcastViewModel { | @@ -9,7 +9,7 @@ export class BroadcastViewModel { | ||
| 9 | static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> { | 9 | static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> { |
| 10 | return new Promise<PageInfoBean>((success, error) => { | 10 | return new Promise<PageInfoBean>((success, error) => { |
| 11 | Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`); | 11 | Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`); |
| 12 | - PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => { | 12 | + PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => { |
| 13 | if (!resDTO || !resDTO.data) { | 13 | if (!resDTO || !resDTO.data) { |
| 14 | Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty'); | 14 | Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty'); |
| 15 | error('resDTO is empty'); | 15 | error('resDTO is empty'); |
| @@ -36,7 +36,7 @@ export class MorningEveningViewModel { | @@ -36,7 +36,7 @@ export class MorningEveningViewModel { | ||
| 36 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { | 36 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { |
| 37 | return new Promise<PageInfoBean>((success, error) => { | 37 | return new Promise<PageInfoBean>((success, error) => { |
| 38 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); | 38 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); |
| 39 | - PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => { | 39 | + PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => { |
| 40 | if (!resDTO || !resDTO.data) { | 40 | if (!resDTO || !resDTO.data) { |
| 41 | Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty'); | 41 | Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty'); |
| 42 | error('resDTO is empty'); | 42 | error('resDTO is empty'); |
46.2 KB
| @@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | @@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | ||
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; | 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; |
| 17 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 17 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 18 | +import { LottieView } from 'wdComponent/Index' | ||
| 18 | 19 | ||
| 19 | interface loadMoreData { | 20 | interface loadMoreData { |
| 20 | pageNum: number; | 21 | pageNum: number; |
| @@ -24,6 +25,7 @@ interface loadMoreData { | @@ -24,6 +25,7 @@ interface loadMoreData { | ||
| 24 | 25 | ||
| 25 | const TAG = 'VideoChannelDetail' | 26 | const TAG = 'VideoChannelDetail' |
| 26 | const storage = LocalStorage.getShared(); | 27 | const storage = LocalStorage.getShared(); |
| 28 | +PersistentStorage.persistProp('GestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播 | ||
| 27 | 29 | ||
| 28 | @Entry(storage) | 30 | @Entry(storage) |
| 29 | @Component | 31 | @Component |
| @@ -66,6 +68,7 @@ export struct VideoChannelDetail { | @@ -66,6 +68,7 @@ export struct VideoChannelDetail { | ||
| 66 | pageHideTime: number = 0; | 68 | pageHideTime: number = 0; |
| 67 | @Provide onlyWifiLoadVideo: boolean = false | 69 | @Provide onlyWifiLoadVideo: boolean = false |
| 68 | @Provide toastTextVisible: boolean = false | 70 | @Provide toastTextVisible: boolean = false |
| 71 | + @StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0 | ||
| 69 | 72 | ||
| 70 | autoRefreshChange() { | 73 | autoRefreshChange() { |
| 71 | if (this.topNavIndex === 0 && !this.isRequesting) { | 74 | if (this.topNavIndex === 0 && !this.isRequesting) { |
| @@ -277,7 +280,7 @@ export struct VideoChannelDetail { | @@ -277,7 +280,7 @@ export struct VideoChannelDetail { | ||
| 277 | } | 280 | } |
| 278 | 281 | ||
| 279 | build() { | 282 | build() { |
| 280 | - Column() { | 283 | + Stack({ alignContent: Alignment.Center }) { |
| 281 | if (this.isRequestError) { | 284 | if (this.isRequestError) { |
| 282 | EmptyComponent({ | 285 | EmptyComponent({ |
| 283 | emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo, | 286 | emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo, |
| @@ -289,6 +292,7 @@ export struct VideoChannelDetail { | @@ -289,6 +292,7 @@ export struct VideoChannelDetail { | ||
| 289 | 292 | ||
| 290 | PictureLoading() | 293 | PictureLoading() |
| 291 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) | 294 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) |
| 295 | + | ||
| 292 | Swiper(this.swiperController) { | 296 | Swiper(this.swiperController) { |
| 293 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 297 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 294 | DetailPlayShortVideoPage({ | 298 | DetailPlayShortVideoPage({ |
| @@ -319,6 +323,29 @@ export struct VideoChannelDetail { | @@ -319,6 +323,29 @@ export struct VideoChannelDetail { | ||
| 319 | this.getRecCompInfo() | 323 | this.getRecCompInfo() |
| 320 | } | 324 | } |
| 321 | }) | 325 | }) |
| 326 | + // 作为手势动画的背景 | ||
| 327 | + Row() {} | ||
| 328 | + .justifyContent(FlexAlign.Center) | ||
| 329 | + .width('100%') | ||
| 330 | + .height('100%') | ||
| 331 | + .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 332 | + .backgroundColor('rgba(0, 0, 0, 0.50)') | ||
| 333 | + .onTouch(() => { | ||
| 334 | + this.GestureLoadStrategy = 1 | ||
| 335 | + }) | ||
| 336 | + // 手势动画 初次进入显示 | ||
| 337 | + LottieView({ | ||
| 338 | + name: 'slider_up_view_more', | ||
| 339 | + path: "lottie/slider_up_view_more.json", | ||
| 340 | + lottieWidth: 167, | ||
| 341 | + lottieHeight: 167, | ||
| 342 | + autoplay: true, | ||
| 343 | + loop: true | ||
| 344 | + }) | ||
| 345 | + .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 346 | + .onTouch(() => { | ||
| 347 | + this.GestureLoadStrategy = 1 | ||
| 348 | + }) | ||
| 322 | 349 | ||
| 323 | } | 350 | } |
| 324 | } | 351 | } |
| @@ -51,7 +51,6 @@ export struct PlayerTitleView { | @@ -51,7 +51,6 @@ export struct PlayerTitleView { | ||
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * 截断文本 | 53 | * 截断文本 |
| 54 | - * @author liuzhendong(猩猩G) | ||
| 55 | * @param {string} str 要截断的文本 '啊啊啊啊啊' | 54 | * @param {string} str 要截断的文本 '啊啊啊啊啊' |
| 56 | * @param {number} fontSize 字体大小(px) | 55 | * @param {number} fontSize 字体大小(px) |
| 57 | * @param {number} maxLines 最大行数 3 | 56 | * @param {number} maxLines 最大行数 3 |
| @@ -117,6 +117,7 @@ export class HWLocationUtils { | @@ -117,6 +117,7 @@ export class HWLocationUtils { | ||
| 117 | let code: string[] = await HWLocationUtils.getCityCode(data[0].administrativeArea, data[0].subAdministrativeArea) | 117 | let code: string[] = await HWLocationUtils.getCityCode(data[0].administrativeArea, data[0].subAdministrativeArea) |
| 118 | if (code && code.length >= 2) { | 118 | if (code && code.length >= 2) { |
| 119 | SPHelper.default.save(SpConstants.LOCATION_CITY_NAME, cityName) | 119 | SPHelper.default.save(SpConstants.LOCATION_CITY_NAME, cityName) |
| 120 | + SPHelper.default.save(SpConstants.LOCATION_PROVINCE_NAME, data[0].administrativeArea) | ||
| 120 | SPHelper.default.save(SpConstants.LOCATION_PROVINCE_CODE, code[0]) | 121 | SPHelper.default.save(SpConstants.LOCATION_PROVINCE_CODE, code[0]) |
| 121 | SPHelper.default.save(SpConstants.LOCATION_CITY_CODE, code[1]) | 122 | SPHelper.default.save(SpConstants.LOCATION_CITY_CODE, code[1]) |
| 122 | } | 123 | } |
| @@ -50,7 +50,7 @@ struct OneKeyLoginPage { | @@ -50,7 +50,7 @@ struct OneKeyLoginPage { | ||
| 50 | // 获取到Authorization Code | 50 | // 获取到Authorization Code |
| 51 | let authorizationCode = response.authorizationCode; | 51 | let authorizationCode = response.authorizationCode; |
| 52 | // hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response)); | 52 | // hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response)); |
| 53 | - TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName) | 53 | + TrackingButton.click("oneClickLoginPageLoginButton", TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login) |
| 54 | this.requestLogin() | 54 | this.requestLogin() |
| 55 | return; | 55 | return; |
| 56 | } | 56 | } |
| @@ -58,7 +58,6 @@ struct OneKeyLoginPage { | @@ -58,7 +58,6 @@ struct OneKeyLoginPage { | ||
| 58 | 58 | ||
| 59 | // 埋点计算页面浏览时长 | 59 | // 埋点计算页面浏览时长 |
| 60 | private pageStartDate: number = 0 | 60 | private pageStartDate: number = 0 |
| 61 | - private pageName = TrackConstants.PageName.OneClick_Login | ||
| 62 | 61 | ||
| 63 | aboutToAppear(): void { | 62 | aboutToAppear(): void { |
| 64 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" | 63 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" |
| @@ -70,7 +69,7 @@ struct OneKeyLoginPage { | @@ -70,7 +69,7 @@ struct OneKeyLoginPage { | ||
| 70 | 69 | ||
| 71 | onPageHide(): void { | 70 | onPageHide(): void { |
| 72 | const duration = Math.floor((Date.now() - this.pageStartDate!)/1000) | 71 | const duration = Math.floor((Date.now() - this.pageStartDate!)/1000) |
| 73 | - TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration) | 72 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login, duration) |
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | // pageTransition() { | 75 | // pageTransition() { |
| @@ -161,7 +160,7 @@ struct OneKeyLoginPage { | @@ -161,7 +160,7 @@ struct OneKeyLoginPage { | ||
| 161 | Row() { | 160 | Row() { |
| 162 | Image($r("app.media.huawei_one_key_login_icon")) | 161 | Image($r("app.media.huawei_one_key_login_icon")) |
| 163 | .width(24).height(24) | 162 | .width(24).height(24) |
| 164 | - Text("华为账号一键登录") | 163 | + Text("华为账号快速登录") |
| 165 | .fontColor(Color.White) | 164 | .fontColor(Color.White) |
| 166 | .margin({left:5}) | 165 | .margin({left:5}) |
| 167 | } | 166 | } |
| @@ -171,30 +170,40 @@ struct OneKeyLoginPage { | @@ -171,30 +170,40 @@ struct OneKeyLoginPage { | ||
| 171 | .borderRadius(4) | 170 | .borderRadius(4) |
| 172 | .type(ButtonType.Normal) | 171 | .type(ButtonType.Normal) |
| 173 | .backgroundColor("#ED2800") | 172 | .backgroundColor("#ED2800") |
| 173 | + .onClick(() => { | ||
| 174 | 174 | ||
| 175 | - Stack(){ | ||
| 176 | - //目前不支持文字和图标同时展示,后面优化 | ||
| 177 | - LoginWithHuaweiIDButton({ | ||
| 178 | - params: { | ||
| 179 | - // LoginWithHuaweiIDButton支持的样式。 | ||
| 180 | - style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 181 | - // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 182 | - // borderRadius: 4, | ||
| 183 | - // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 184 | - loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 185 | - // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 186 | - // supportDarkMode: true, | ||
| 187 | - customButtonParams: { | ||
| 188 | - fontColor: loginComponentManager.FontColor.WHITE, | ||
| 189 | - // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 190 | - backgroundColor:"#ED2800" | ||
| 191 | - } | ||
| 192 | - }, | ||
| 193 | - controller: this.controller | ||
| 194 | - }).opacity(0) | 175 | + if (!this.agreeProtocol) { |
| 176 | + this.toastText = "请阅读并勾选用户协议、隐私政策和华为账号用户认证协议" | ||
| 177 | + this.dialogToast.open() | ||
| 178 | + return | ||
| 195 | } | 179 | } |
| 196 | - .width('100%') | ||
| 197 | - .height('100%') | 180 | + TrackingButton.click("oneClickLoginPageLoginButton", TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login) |
| 181 | + this.requestLogin() | ||
| 182 | + }) | ||
| 183 | + | ||
| 184 | + // Stack(){ | ||
| 185 | + // //目前不支持文字和图标同时展示,后面优化 | ||
| 186 | + // LoginWithHuaweiIDButton({ | ||
| 187 | + // params: { | ||
| 188 | + // // LoginWithHuaweiIDButton支持的样式。 | ||
| 189 | + // style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 190 | + // // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 191 | + // // borderRadius: 4, | ||
| 192 | + // // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 193 | + // loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 194 | + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 195 | + // // supportDarkMode: true, | ||
| 196 | + // customButtonParams: { | ||
| 197 | + // fontColor: loginComponentManager.FontColor.WHITE, | ||
| 198 | + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 199 | + // backgroundColor:"#ED2800" | ||
| 200 | + // } | ||
| 201 | + // }, | ||
| 202 | + // controller: this.controller | ||
| 203 | + // }).opacity(0) | ||
| 204 | + // } | ||
| 205 | + // .width('100%') | ||
| 206 | + // .height('100%') | ||
| 198 | } | 207 | } |
| 199 | } | 208 | } |
| 200 | .height(48) | 209 | .height(48) |
| @@ -94,7 +94,7 @@ export default class HuaweiAuth { | @@ -94,7 +94,7 @@ export default class HuaweiAuth { | ||
| 94 | // 创建授权请求,并设置参数 | 94 | // 创建授权请求,并设置参数 |
| 95 | let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); | 95 | let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); |
| 96 | // 获取头像昵称需要传如下scope | 96 | // 获取头像昵称需要传如下scope |
| 97 | - loginRequest.scopes = ['profile']; //, 'phone' | 97 | + loginRequest.scopes = ['profile', 'phone']; //, 'phone' |
| 98 | // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode | 98 | // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode |
| 99 | loginRequest.permissions = ['serviceauthcode']; | 99 | loginRequest.permissions = ['serviceauthcode']; |
| 100 | // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面 | 100 | // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面 |
| @@ -12,6 +12,7 @@ import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopic | @@ -12,6 +12,7 @@ import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopic | ||
| 12 | */ | 12 | */ |
| 13 | export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | 13 | export default class InsightIntentExecutorImpl extends InsightIntentExecutor { |
| 14 | private static readonly ViewBlog = 'ViewBlog'; | 14 | private static readonly ViewBlog = 'ViewBlog'; |
| 15 | + private static readonly ViewColumn = 'ViewColumn'; | ||
| 15 | private static readonly ViewColumnUpdate = 'ViewColumnUpdate'; | 16 | private static readonly ViewColumnUpdate = 'ViewColumnUpdate'; |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| @@ -31,6 +32,8 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -31,6 +32,8 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 31 | return this.jumpToViewBlog(param, pageLoader); | 32 | return this.jumpToViewBlog(param, pageLoader); |
| 32 | case InsightIntentExecutorImpl.ViewColumnUpdate: | 33 | case InsightIntentExecutorImpl.ViewColumnUpdate: |
| 33 | return this.jumpToViewColumnUpdate(param, pageLoader); | 34 | return this.jumpToViewColumnUpdate(param, pageLoader); |
| 35 | + case InsightIntentExecutorImpl.ViewColumn: | ||
| 36 | + return this.jumpToViewColumnUpdate(param, pageLoader); | ||
| 34 | default: | 37 | default: |
| 35 | break; | 38 | break; |
| 36 | } | 39 | } |
-
Please register or login to post a comment