Showing
13 changed files
with
148 additions
and
97 deletions
| @@ -60,12 +60,14 @@ export struct WdWebLocalComponent { | @@ -60,12 +60,14 @@ export struct WdWebLocalComponent { | ||
| 60 | .imageAccess(true) | 60 | .imageAccess(true) |
| 61 | .mixedMode(MixedMode.All) | 61 | .mixedMode(MixedMode.All) |
| 62 | .onlineImageAccess(true) | 62 | .onlineImageAccess(true) |
| 63 | - .enableNativeEmbedMode(true) | ||
| 64 | - .layoutMode(WebLayoutMode.FIT_CONTENT) | 63 | + // .enableNativeEmbedMode(true) |
| 64 | + // .layoutMode(WebLayoutMode.FIT_CONTENT) | ||
| 65 | .nestedScroll({ | 65 | .nestedScroll({ |
| 66 | scrollForward: NestedScrollMode.SELF_FIRST, | 66 | scrollForward: NestedScrollMode.SELF_FIRST, |
| 67 | scrollBackward: NestedScrollMode.PARENT_FIRST | 67 | scrollBackward: NestedScrollMode.PARENT_FIRST |
| 68 | - })// .height(this.webHeight) | 68 | + }) |
| 69 | + .width('100%') | ||
| 70 | + .height(this.webHeight) | ||
| 69 | .onPageBegin((event) => { | 71 | .onPageBegin((event) => { |
| 70 | this.onPageBegin(event?.url); | 72 | this.onPageBegin(event?.url); |
| 71 | }) | 73 | }) |
| @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | ||
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | import { Notes } from '../cardview/notes'; | 9 | import { Notes } from '../cardview/notes'; |
| 10 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 10 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 11 | +import font from '@ohos.font'; | ||
| 11 | 12 | ||
| 12 | const TAG = 'Zh_Carousel_Layout-01'; | 13 | const TAG = 'Zh_Carousel_Layout-01'; |
| 13 | 14 | ||
| @@ -67,6 +68,11 @@ export struct ZhCarouselLayout01 { | @@ -67,6 +68,11 @@ export struct ZhCarouselLayout01 { | ||
| 67 | list.push(i); | 68 | list.push(i); |
| 68 | } | 69 | } |
| 69 | this.data = new MyDataSource(list) | 70 | this.data = new MyDataSource(list) |
| 71 | + | ||
| 72 | + font.registerFont({ | ||
| 73 | + familyName: 'BebasNeue', | ||
| 74 | + familySrc: $rawfile('font/BebasNeue.ttf') | ||
| 75 | + }) | ||
| 70 | } | 76 | } |
| 71 | 77 | ||
| 72 | isAutoPlay() { | 78 | isAutoPlay() { |
| @@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent { | @@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent { | ||
| 45 | buildItemCard(item: ContentDTO, index: number) { | 45 | buildItemCard(item: ContentDTO, index: number) { |
| 46 | Column() { | 46 | Column() { |
| 47 | Stack({ alignContent: Alignment.BottomEnd }) { | 47 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 48 | - Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '') | 48 | + Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls?.[0]?.url : '') |
| 49 | .backgroundColor(0xf5f5f5) | 49 | .backgroundColor(0xf5f5f5) |
| 50 | .width('100%') | 50 | .width('100%') |
| 51 | // .height(95) | 51 | // .height(95) |
| @@ -19,8 +19,8 @@ export struct ZhSingleRow02 { | @@ -19,8 +19,8 @@ export struct ZhSingleRow02 { | ||
| 19 | @State pageId: string = ''; | 19 | @State pageId: string = ''; |
| 20 | @State pageName: string = ''; | 20 | @State pageName: string = ''; |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | - @State initMoreWidth: number = 16; | ||
| 23 | - @State moreWidth:number = 16 | 22 | + @State initMoreWidth: number = 22; |
| 23 | + @State moreWidth:number = 22 | ||
| 24 | @State moreTips: string = '' | 24 | @State moreTips: string = '' |
| 25 | scroller: Scroller = new Scroller() | 25 | scroller: Scroller = new Scroller() |
| 26 | 26 | ||
| @@ -53,7 +53,7 @@ export struct ZhSingleRow02 { | @@ -53,7 +53,7 @@ export struct ZhSingleRow02 { | ||
| 53 | 53 | ||
| 54 | resetEdgeAnimation() { | 54 | resetEdgeAnimation() { |
| 55 | if (this.moreWidth > this.initMoreWidth) { | 55 | if (this.moreWidth > this.initMoreWidth) { |
| 56 | - this.moreWidth = 16 | 56 | + this.moreWidth = 22 |
| 57 | } | 57 | } |
| 58 | this.resetMoreTips() | 58 | this.resetMoreTips() |
| 59 | } | 59 | } |
| @@ -43,8 +43,8 @@ export struct ZhSingleRow03 { | @@ -43,8 +43,8 @@ export struct ZhSingleRow03 { | ||
| 43 | // @State reserveStatus: reserveItem[] = [] | 43 | // @State reserveStatus: reserveItem[] = [] |
| 44 | @State reservedIds: string[] = []; | 44 | @State reservedIds: string[] = []; |
| 45 | @State loadImg: boolean = false; | 45 | @State loadImg: boolean = false; |
| 46 | - @State initMoreWidth: number = 16; | ||
| 47 | - @State moreWidth:number = 16 | 46 | + @State initMoreWidth: number = 22; |
| 47 | + @State moreWidth:number = 22 | ||
| 48 | @State moreTips: string = '' | 48 | @State moreTips: string = '' |
| 49 | scroller: Scroller = new Scroller() | 49 | scroller: Scroller = new Scroller() |
| 50 | 50 | ||
| @@ -78,7 +78,7 @@ export struct ZhSingleRow03 { | @@ -78,7 +78,7 @@ export struct ZhSingleRow03 { | ||
| 78 | 78 | ||
| 79 | resetEdgeAnimation() { | 79 | resetEdgeAnimation() { |
| 80 | if (this.moreWidth > this.initMoreWidth) { | 80 | if (this.moreWidth > this.initMoreWidth) { |
| 81 | - this.moreWidth = 16 | 81 | + this.moreWidth = 22 |
| 82 | } | 82 | } |
| 83 | this.resetMoreTips() | 83 | this.resetMoreTips() |
| 84 | } | 84 | } |
| @@ -260,7 +260,7 @@ export struct ZhSingleRow03 { | @@ -260,7 +260,7 @@ export struct ZhSingleRow03 { | ||
| 260 | .fontSize(12) | 260 | .fontSize(12) |
| 261 | .textAlign(TextAlign.Start) | 261 | .textAlign(TextAlign.Start) |
| 262 | .fontFamily('PingFang SC-Semibold') | 262 | .fontFamily('PingFang SC-Semibold') |
| 263 | - .fontWeight(600) | 263 | + .fontWeight(500) |
| 264 | Image($r('app.media.timeline_rect')) | 264 | Image($r('app.media.timeline_rect')) |
| 265 | .width(4) | 265 | .width(4) |
| 266 | .height(3) | 266 | .height(3) |
| @@ -270,7 +270,7 @@ export struct ZhSingleRow03 { | @@ -270,7 +270,7 @@ export struct ZhSingleRow03 { | ||
| 270 | .fontColor(0x000000) | 270 | .fontColor(0x000000) |
| 271 | .fontSize(12) | 271 | .fontSize(12) |
| 272 | .fontFamily('PingFang SC-Semibold') | 272 | .fontFamily('PingFang SC-Semibold') |
| 273 | - .fontWeight(600) | 273 | + .fontWeight(500) |
| 274 | Text('开始直播') | 274 | Text('开始直播') |
| 275 | .fontColor(0xC8C8C8) | 275 | .fontColor(0xC8C8C8) |
| 276 | .fontSize(12) | 276 | .fontSize(12) |
| @@ -19,10 +19,15 @@ struct ChannelSubscriptionLayout { | @@ -19,10 +19,15 @@ struct ChannelSubscriptionLayout { | ||
| 19 | //当前选中的频道 | 19 | //当前选中的频道 |
| 20 | @Link currentTopNavSelectedIndex: number; | 20 | @Link currentTopNavSelectedIndex: number; |
| 21 | @Prop homeChannelList: TopNavDTO [] | 21 | @Prop homeChannelList: TopNavDTO [] |
| 22 | + // 我的频道栏目的频道信息数组 | ||
| 22 | @Link myChannelList: TopNavDTO [] | 23 | @Link myChannelList: TopNavDTO [] |
| 24 | + // 更多频道栏目频道信息数组 | ||
| 23 | @Link moreChannelList: TopNavDTO [] | 25 | @Link moreChannelList: TopNavDTO [] |
| 26 | + // 地方频道栏目频道信息数组 | ||
| 24 | @Link localChannelList: TopNavDTO [] | 27 | @Link localChannelList: TopNavDTO [] |
| 28 | + // 收集到的我的频道栏目中的频道id | ||
| 25 | @State channelIds: number [] = [] | 29 | @State channelIds: number [] = [] |
| 30 | + | ||
| 26 | @State isShow: boolean = false | 31 | @State isShow: boolean = false |
| 27 | @State dragItem: number = -1 | 32 | @State dragItem: number = -1 |
| 28 | private dragRefOffsetX: number = 0 | 33 | private dragRefOffsetX: number = 0 |
| @@ -33,12 +38,12 @@ struct ChannelSubscriptionLayout { | @@ -33,12 +38,12 @@ struct ChannelSubscriptionLayout { | ||
| 33 | private FIX_VP_Y: number = 48 | 38 | private FIX_VP_Y: number = 48 |
| 34 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 39 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 35 | @State isEditIng: boolean = false | 40 | @State isEditIng: boolean = false |
| 36 | - @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO | 41 | + // @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO |
| 37 | changeTab: (index: number) => void = () => { | 42 | changeTab: (index: number) => void = () => { |
| 38 | } | 43 | } |
| 39 | 44 | ||
| 40 | aboutToAppear() { | 45 | aboutToAppear() { |
| 41 | - this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] | 46 | + // this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] |
| 42 | this.myChannelList.forEach(item => { | 47 | this.myChannelList.forEach(item => { |
| 43 | if(item != undefined && item.channelId != undefined){ | 48 | if(item != undefined && item.channelId != undefined){ |
| 44 | this.channelIds.push(item.channelId) | 49 | this.channelIds.push(item.channelId) |
| @@ -57,15 +62,66 @@ struct ChannelSubscriptionLayout { | @@ -57,15 +62,66 @@ struct ChannelSubscriptionLayout { | ||
| 57 | 62 | ||
| 58 | //删除频道 | 63 | //删除频道 |
| 59 | delChannelItem(index: number) { | 64 | delChannelItem(index: number) { |
| 65 | + | ||
| 60 | let item = this.myChannelList.splice(index, 1)[0] | 66 | let item = this.myChannelList.splice(index, 1)[0] |
| 61 | this.channelIds.splice(index, 1) | 67 | this.channelIds.splice(index, 1) |
| 62 | AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds)) | 68 | AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds)) |
| 69 | + | ||
| 70 | + /* | ||
| 71 | + 删除的频道信息回到原栏目中去 | ||
| 72 | + */ | ||
| 63 | if (item.moreChannel === '1') { | 73 | if (item.moreChannel === '1') { |
| 64 | this.moreChannelList.unshift(item) | 74 | this.moreChannelList.unshift(item) |
| 65 | } | 75 | } |
| 66 | if (item.localChannel === '1') { | 76 | if (item.localChannel === '1') { |
| 67 | this.localChannelList.unshift(item) | 77 | this.localChannelList.unshift(item) |
| 68 | } | 78 | } |
| 79 | + | ||
| 80 | + | ||
| 81 | + // 删除频道的索引值大于 我的栏目中频道最大索引值 | ||
| 82 | + if(this.currentTopNavSelectedIndex > this.channelIds.length-1){ | ||
| 83 | + //使用默认频道 | ||
| 84 | + //缓存首页频道 | ||
| 85 | + let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | ||
| 86 | + console.debug('TopNavigationComponent','index='+index) | ||
| 87 | + if (index > -1) { | ||
| 88 | + this.currentTopNavSelectedIndex = index | ||
| 89 | + } | ||
| 90 | + }else { | ||
| 91 | + //检测删除频道后的当前频道是否是特殊频道 | ||
| 92 | + let item = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 93 | + if(this.isBroadcast(item) || this.isLayout(item)){ | ||
| 94 | + | ||
| 95 | + this.changeTab(this.currentTopNavSelectedIndex) | ||
| 96 | + this.isShow = false | ||
| 97 | + | ||
| 98 | + let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | ||
| 99 | + console.debug('TopNavigationComponent','index='+index) | ||
| 100 | + if (index > -1) { | ||
| 101 | + this.currentTopNavSelectedIndex = index | ||
| 102 | + this.changeTab(this.currentTopNavSelectedIndex) | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 频道是播报 | ||
| 111 | + * @param item | ||
| 112 | + * @returns | ||
| 113 | + */ | ||
| 114 | + private isBroadcast(item?: TopNavDTO): boolean { | ||
| 115 | + return item?.channelId === 2066 | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /** | ||
| 119 | + * 频道是电子报 | ||
| 120 | + * @param item | ||
| 121 | + * @returns | ||
| 122 | + */ | ||
| 123 | + private isLayout(item?: TopNavDTO): boolean { | ||
| 124 | + return item?.channelId === 2006 | ||
| 69 | } | 125 | } |
| 70 | 126 | ||
| 71 | // 添加频道 | 127 | // 添加频道 |
| @@ -12,8 +12,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ | @@ -12,8 +12,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ | ||
| 12 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; | 12 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; |
| 13 | import { CompUtils } from '../../utils/CompUtils'; | 13 | import { CompUtils } from '../../utils/CompUtils'; |
| 14 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; | 14 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; |
| 15 | -import { JSON } from '@kit.ArkTS'; | ||
| 16 | -import text from '@ohos.graphics.text'; | ||
| 17 | 15 | ||
| 18 | const TAG = 'TopNavigationComponent'; | 16 | const TAG = 'TopNavigationComponent'; |
| 19 | 17 | ||
| @@ -95,7 +93,6 @@ export struct TopNavigationComponentNew { | @@ -95,7 +93,6 @@ export struct TopNavigationComponentNew { | ||
| 95 | }) | 93 | }) |
| 96 | } else { | 94 | } else { |
| 97 | channelSkeleton() | 95 | channelSkeleton() |
| 98 | - //Text('特殊频道').fontColor(Color.Red).fontSize(20).width('100%').height('100%') | ||
| 99 | } | 96 | } |
| 100 | } | 97 | } |
| 101 | }) | 98 | }) |
| @@ -117,17 +114,8 @@ export struct TopNavigationComponentNew { | @@ -117,17 +114,8 @@ export struct TopNavigationComponentNew { | ||
| 117 | return | 114 | return |
| 118 | } | 115 | } |
| 119 | 116 | ||
| 120 | - if (this.isBroadcastByIndex(index)) { | ||
| 121 | - // 跳转到播报页面 | ||
| 122 | - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 117 | + this.channelJumpToPage(index) |
| 123 | 118 | ||
| 124 | - } else if (this.isLayoutByIndex(index)) { | ||
| 125 | - // 跳转到电子报页面 | ||
| 126 | - ProcessUtils.gotoENewsPaper() | ||
| 127 | - | ||
| 128 | - } else { | ||
| 129 | - this.changePage(index) | ||
| 130 | - } | ||
| 131 | }) | 119 | }) |
| 132 | .onAnimationEnd((index: number) => { | 120 | .onAnimationEnd((index: number) => { |
| 133 | Logger.info(TAG, `onAnimationEnd ${index}`); | 121 | Logger.info(TAG, `onAnimationEnd ${index}`); |
| @@ -153,6 +141,7 @@ export struct TopNavigationComponentNew { | @@ -153,6 +141,7 @@ export struct TopNavigationComponentNew { | ||
| 153 | // 极左极右有特殊频道,用旧值 | 141 | // 极左极右有特殊频道,用旧值 |
| 154 | this.changePage(this.currentTopNavSelectedIndex) | 142 | this.changePage(this.currentTopNavSelectedIndex) |
| 155 | } | 143 | } |
| 144 | + } else { | ||
| 156 | } | 145 | } |
| 157 | 146 | ||
| 158 | }) | 147 | }) |
| @@ -227,7 +216,7 @@ export struct TopNavigationComponentNew { | @@ -227,7 +216,7 @@ export struct TopNavigationComponentNew { | ||
| 227 | moreChannelList: $moreChannelList, | 216 | moreChannelList: $moreChannelList, |
| 228 | localChannelList: $localChannelList, | 217 | localChannelList: $localChannelList, |
| 229 | changeTab: (index) => { | 218 | changeTab: (index) => { |
| 230 | - this.changePage(index) | 219 | + this.channelJumpToPage(index) |
| 231 | } | 220 | } |
| 232 | }) | 221 | }) |
| 233 | .id('channelManageBtn') | 222 | .id('channelManageBtn') |
| @@ -352,23 +341,35 @@ export struct TopNavigationComponentNew { | @@ -352,23 +341,35 @@ export struct TopNavigationComponentNew { | ||
| 352 | // 当前tab,单击事件 | 341 | // 当前tab,单击事件 |
| 353 | this.doAutoRefresh() | 342 | this.doAutoRefresh() |
| 354 | } else { | 343 | } else { |
| 355 | - if (this.isBroadcastByIndex(index)) { | ||
| 356 | - // 跳转到播报页面 | ||
| 357 | - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | ||
| 358 | - } else if (this.isLayoutByIndex(index)) { | ||
| 359 | - ProcessUtils.gotoENewsPaper() | ||
| 360 | - } else { | ||
| 361 | - this.changePage(index) | ||
| 362 | - } | 344 | + this.channelJumpToPage(index) |
| 363 | } | 345 | } |
| 364 | }) | 346 | }) |
| 365 | } | 347 | } |
| 366 | 348 | ||
| 349 | + | ||
| 350 | + /** | ||
| 351 | + * 频道信息跳转页面方法 | ||
| 352 | + * @param index | ||
| 353 | + */ | ||
| 354 | + private channelJumpToPage(index :number){ | ||
| 355 | + if (this.isBroadcastByIndex(index)) { | ||
| 356 | + // 跳转到播报页面 | ||
| 357 | + ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | ||
| 358 | + } else if (this.isLayoutByIndex(index)) { | ||
| 359 | + // 跳转到电子报页面 | ||
| 360 | + ProcessUtils.gotoENewsPaper() | ||
| 361 | + } else { | ||
| 362 | + this.changePage(index) | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | /** | 367 | /** |
| 368 | * 改变频道页 | 368 | * 改变频道页 |
| 369 | * @param index 频道所在的序列号 | 369 | * @param index 频道所在的序列号 |
| 370 | */ | 370 | */ |
| 371 | private changePage(index: number) { | 371 | private changePage(index: number) { |
| 372 | + Logger.info(TAG, `修改页面 changePage index : ${index}`); | ||
| 372 | this.currentTopNavSelectedIndex = index | 373 | this.currentTopNavSelectedIndex = index |
| 373 | this.swiperController.changeIndex(index) | 374 | this.swiperController.changeIndex(index) |
| 374 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) | 375 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) |
| @@ -521,7 +522,6 @@ export struct TopNavigationComponentNew { | @@ -521,7 +522,6 @@ export struct TopNavigationComponentNew { | ||
| 521 | this.topNavListHandle() | 522 | this.topNavListHandle() |
| 522 | this.changePage(this.currentTopNavSelectedIndex) | 523 | this.changePage(this.currentTopNavSelectedIndex) |
| 523 | 524 | ||
| 524 | - console.log('XY', '----TopNavigation-------aboutToAppear' + this.navItem.name) | ||
| 525 | this.getTopNavList(this.navItem.id) | 525 | this.getTopNavList(this.navItem.id) |
| 526 | } | 526 | } |
| 527 | 527 | ||
| @@ -534,11 +534,9 @@ export struct TopNavigationComponentNew { | @@ -534,11 +534,9 @@ export struct TopNavigationComponentNew { | ||
| 534 | * | 534 | * |
| 535 | */ | 535 | */ |
| 536 | updateCurrentTopNavSelectedIndex() { | 536 | updateCurrentTopNavSelectedIndex() { |
| 537 | - | 537 | + console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex) |
| 538 | if (CompUtils.isNews(this.navItem)) { | 538 | if (CompUtils.isNews(this.navItem)) { |
| 539 | const tab = this.myChannelList[this.currentTopNavSelectedIndex] | 539 | const tab = this.myChannelList[this.currentTopNavSelectedIndex] |
| 540 | - //Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`); | ||
| 541 | - | ||
| 542 | // 埋点 | 540 | // 埋点 |
| 543 | const params: ParamType = { | 541 | const params: ParamType = { |
| 544 | "pageName": tab.name, | 542 | "pageName": tab.name, |
| @@ -548,8 +546,6 @@ export struct TopNavigationComponentNew { | @@ -548,8 +546,6 @@ export struct TopNavigationComponentNew { | ||
| 548 | Tracking.event("home_page_tab_click", params) | 546 | Tracking.event("home_page_tab_click", params) |
| 549 | } else if (CompUtils.isRMH(this.navItem)) { | 547 | } else if (CompUtils.isRMH(this.navItem)) { |
| 550 | const tab = this.topNavList[this.currentTopNavSelectedIndex] | 548 | const tab = this.topNavList[this.currentTopNavSelectedIndex] |
| 551 | - Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`); | ||
| 552 | - | ||
| 553 | // 埋点 | 549 | // 埋点 |
| 554 | const params: ParamType = { | 550 | const params: ParamType = { |
| 555 | "pageName": tab.name, | 551 | "pageName": tab.name, |
| @@ -663,21 +659,6 @@ export struct TopNavigationComponentNew { | @@ -663,21 +659,6 @@ export struct TopNavigationComponentNew { | ||
| 663 | return null | 659 | return null |
| 664 | } | 660 | } |
| 665 | 661 | ||
| 666 | - // | ||
| 667 | - // private startAnimateTo(duration: number, leftMargin: number, width: number) { | ||
| 668 | - // animateTo({ | ||
| 669 | - // duration: duration, // 动画时长 | ||
| 670 | - // curve: Curve.Linear, // 动画曲线 | ||
| 671 | - // iterations: 1, // 播放次数 | ||
| 672 | - // playMode: PlayMode.Normal, // 动画模式 | ||
| 673 | - // onFinish: () => { | ||
| 674 | - // console.info('play end') | ||
| 675 | - // } | ||
| 676 | - // }, () => { | ||
| 677 | - // this.indicatorLeftMargin = leftMargin | ||
| 678 | - // this.indicatorWidth = width | ||
| 679 | - // }) | ||
| 680 | - // } | ||
| 681 | 662 | ||
| 682 | /** | 663 | /** |
| 683 | * 进入早晚报专题 | 664 | * 进入早晚报专题 |
| @@ -701,15 +682,23 @@ export struct TopNavigationComponentNew { | @@ -701,15 +682,23 @@ export struct TopNavigationComponentNew { | ||
| 701 | } else { | 682 | } else { |
| 702 | ToastUtils.showToast('暂无早晚报信息', 1000) | 683 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 703 | } | 684 | } |
| 704 | - | ||
| 705 | - this.isClickMorningEveningPaper = false | 685 | + let timer = setInterval(() => { |
| 686 | + this.isClickMorningEveningPaper = false | ||
| 687 | + clearInterval(timer); | ||
| 688 | + }, 1000); | ||
| 706 | }).catch((err: string) => { | 689 | }).catch((err: string) => { |
| 707 | ToastUtils.showToast('暂无早晚报信息', 1000) | 690 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 708 | - this.isClickMorningEveningPaper = false | 691 | + let timer = setInterval(() => { |
| 692 | + this.isClickMorningEveningPaper = false | ||
| 693 | + clearInterval(timer); | ||
| 694 | + }, 1000); | ||
| 709 | }) | 695 | }) |
| 710 | } else { | 696 | } else { |
| 711 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 697 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| 712 | - this.isClickMorningEveningPaper = false | 698 | + let timer = setInterval(() => { |
| 699 | + this.isClickMorningEveningPaper = false | ||
| 700 | + clearInterval(timer); | ||
| 701 | + }, 1000); | ||
| 713 | } | 702 | } |
| 714 | } | 703 | } |
| 715 | 704 | ||
| @@ -717,9 +706,9 @@ export struct TopNavigationComponentNew { | @@ -717,9 +706,9 @@ export struct TopNavigationComponentNew { | ||
| 717 | async getTopNavList(id: number) { | 706 | async getTopNavList(id: number) { |
| 718 | let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id) | 707 | let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id) |
| 719 | let topNavList = bottomNavDetail?.topNavChannelList || [] | 708 | let topNavList = bottomNavDetail?.topNavChannelList || [] |
| 720 | - for (let topNav of topNavList) { | ||
| 721 | - console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav)) | ||
| 722 | - | ||
| 723 | - } | 709 | + // for (let topNav of topNavList) { |
| 710 | + // console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav)) | ||
| 711 | + // | ||
| 712 | + // } | ||
| 724 | } | 713 | } |
| 725 | } | 714 | } |
| @@ -120,15 +120,15 @@ export struct PeopleShipHomePageNavComponent { | @@ -120,15 +120,15 @@ export struct PeopleShipHomePageNavComponent { | ||
| 120 | } | 120 | } |
| 121 | .height('100%') | 121 | .height('100%') |
| 122 | Blank() | 122 | Blank() |
| 123 | - // 分享 | ||
| 124 | - Image((this.topOpacity > 0.5 ? $r('app.media.icon_forward') : $r('app.media.icon_share'))) | ||
| 125 | - .width('24vp') | ||
| 126 | - .height('24vp') | ||
| 127 | - .objectFit(ImageFit.Auto) | ||
| 128 | - .margin({ right: '10vp' }) | ||
| 129 | - .onClick(() => { | ||
| 130 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | ||
| 131 | - }) | 123 | + // 分享 分享暂不展示 |
| 124 | + // Image((this.topOpacity > 0.5 ? $r('app.media.icon_forward') : $r('app.media.icon_share'))) | ||
| 125 | + // .width('24vp') | ||
| 126 | + // .height('24vp') | ||
| 127 | + // .objectFit(ImageFit.Auto) | ||
| 128 | + // .margin({ right: '10vp' }) | ||
| 129 | + // .onClick(() => { | ||
| 130 | + // ToastUtils.showToast('分享为公共方法,待开发', 1000); | ||
| 131 | + // }) | ||
| 132 | } | 132 | } |
| 133 | .width('100%') | 133 | .width('100%') |
| 134 | .height('100%') | 134 | .height('100%') |
| @@ -9,8 +9,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -9,8 +9,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 9 | @State compDTO: CompDTO = {} as CompDTO | 9 | @State compDTO: CompDTO = {} as CompDTO |
| 10 | @State pageId: string = ''; | 10 | @State pageId: string = ''; |
| 11 | @State pageName: string = ''; | 11 | @State pageName: string = ''; |
| 12 | - @State initMoreWidth: number = 16; | ||
| 13 | - @State moreWidth:number = 16 | 12 | + @State initMoreWidth: number = 22; |
| 13 | + @State moreWidth:number = 22 | ||
| 14 | @State moreTips: string = '' | 14 | @State moreTips: string = '' |
| 15 | scroller: Scroller = new Scroller() | 15 | scroller: Scroller = new Scroller() |
| 16 | 16 | ||
| @@ -44,7 +44,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -44,7 +44,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 44 | 44 | ||
| 45 | resetEdgeAnimation() { | 45 | resetEdgeAnimation() { |
| 46 | if (this.moreWidth > this.initMoreWidth) { | 46 | if (this.moreWidth > this.initMoreWidth) { |
| 47 | - this.moreWidth = 16 | 47 | + this.moreWidth = 22 |
| 48 | } | 48 | } |
| 49 | this.resetMoreTips() | 49 | this.resetMoreTips() |
| 50 | } | 50 | } |
| @@ -18,8 +18,8 @@ export struct LiveHorizontalCardComponent { | @@ -18,8 +18,8 @@ export struct LiveHorizontalCardComponent { | ||
| 18 | @State pageName: string = ''; | 18 | @State pageName: string = ''; |
| 19 | @State compDTO: CompDTO = {} as CompDTO | 19 | @State compDTO: CompDTO = {} as CompDTO |
| 20 | @State loadImg: boolean = false; | 20 | @State loadImg: boolean = false; |
| 21 | - @State initMoreWidth: number = 16; | ||
| 22 | - @State moreWidth:number = 16 | 21 | + @State initMoreWidth: number = 22; |
| 22 | + @State moreWidth:number = 22 | ||
| 23 | @State moreTips: string = '' | 23 | @State moreTips: string = '' |
| 24 | scroller: Scroller = new Scroller() | 24 | scroller: Scroller = new Scroller() |
| 25 | 25 | ||
| @@ -53,7 +53,7 @@ export struct LiveHorizontalCardComponent { | @@ -53,7 +53,7 @@ export struct LiveHorizontalCardComponent { | ||
| 53 | 53 | ||
| 54 | resetEdgeAnimation() { | 54 | resetEdgeAnimation() { |
| 55 | if (this.moreWidth > this.initMoreWidth) { | 55 | if (this.moreWidth > this.initMoreWidth) { |
| 56 | - this.moreWidth = 16 | 56 | + this.moreWidth = 22 |
| 57 | } | 57 | } |
| 58 | this.resetMoreTips() | 58 | this.resetMoreTips() |
| 59 | } | 59 | } |
| @@ -33,13 +33,11 @@ struct LoginProtocolWebview { | @@ -33,13 +33,11 @@ struct LoginProtocolWebview { | ||
| 33 | this.contentID = params.contentID | 33 | this.contentID = params.contentID |
| 34 | } | 34 | } |
| 35 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" | 35 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" |
| 36 | - this.webUrl = this.userProtocol | ||
| 37 | - this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string | 36 | + this.webUrl = SPHelper.default.getSync(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string |
| 38 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" | 37 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" |
| 39 | - this.webUrl = this.privateProtocol | ||
| 40 | - this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string | 38 | + this.webUrl = SPHelper.default.getSync(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string |
| 41 | }else if(params.contentID == "3"){ //注销协议 | 39 | }else if(params.contentID == "3"){ //注销协议 |
| 42 | - this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string | 40 | + this.webUrl = SPHelper.default.getSync(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string |
| 43 | } else if(params.contentID == "4"){ //华为用户认证协议 | 41 | } else if(params.contentID == "4"){ //华为用户认证协议 |
| 44 | this.webUrl = this.huaweiAuthProtocol | 42 | this.webUrl = this.huaweiAuthProtocol |
| 45 | } else if(params.contentID == "5"){ //收集个人信息明示清单 | 43 | } else if(params.contentID == "5"){ //收集个人信息明示清单 |
| @@ -21,7 +21,7 @@ export class PublicParams { | @@ -21,7 +21,7 @@ export class PublicParams { | ||
| 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", | 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", |
| 22 | "environment": PublicParams.getEnv(), | 22 | "environment": PublicParams.getEnv(), |
| 23 | "os": AppUtils.getOSName(), | 23 | "os": AppUtils.getOSName(), |
| 24 | - "actionTime": new Date().getTime() * 0.001, | 24 | + "actionTime": Math.log(new Date().getTime() / 1000), |
| 25 | "channel": AppUtils.getAppChannel(), | 25 | "channel": AppUtils.getAppChannel(), |
| 26 | "version": AppUtils.getAppVersionName(), | 26 | "version": AppUtils.getAppVersionName(), |
| 27 | "deviceId": DeviceUtil.clientId(), | 27 | "deviceId": DeviceUtil.clientId(), |
| @@ -24,17 +24,17 @@ export class Tracking { | @@ -24,17 +24,17 @@ export class Tracking { | ||
| 24 | // Logger.error('yyyy','event track failed') | 24 | // Logger.error('yyyy','event track failed') |
| 25 | // }) | 25 | // }) |
| 26 | 26 | ||
| 27 | - let publicParams = new PublicParams() | ||
| 28 | - publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | - | ||
| 30 | - if (params) { | ||
| 31 | - for (const obj of Object.entries(params)) { | ||
| 32 | - // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | - pubParams[obj[0]] = obj[1] | ||
| 34 | - } | ||
| 35 | - } | ||
| 36 | - sensors.track(eventId, pubParams) | ||
| 37 | - }) | 27 | + // let publicParams = new PublicParams() |
| 28 | + // publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | + // | ||
| 30 | + // if (params) { | ||
| 31 | + // for (const obj of Object.entries(params)) { | ||
| 32 | + // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | + // pubParams[obj[0]] = obj[1] | ||
| 34 | + // } | ||
| 35 | + // } | ||
| 36 | + // sensors.track(eventId, pubParams) | ||
| 37 | + // }) | ||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 |
-
Please register or login to post a comment