王士厅
Showing 19 changed files with 206 additions and 126 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 })
@@ -14,6 +14,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' @@ -14,6 +14,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
14 import { common } from '@kit.AbilityKit'; 14 import { common } from '@kit.AbilityKit';
15 import { PageRepository } from '../repository/PageRepository'; 15 import { PageRepository } from '../repository/PageRepository';
16 import { CommentDialogView } from './CommentDialogView'; 16 import { CommentDialogView } from './CommentDialogView';
  17 +import { faceDetector } from '@kit.CoreVisionKit';
17 18
18 const TAG: string = 'SpacialTopicPageComponent' 19 const TAG: string = 'SpacialTopicPageComponent'
19 20
@@ -40,7 +41,7 @@ export struct SpacialTopicPageComponent { @@ -40,7 +41,7 @@ export struct SpacialTopicPageComponent {
40 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 41 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
41 @State isNetConnected: boolean = true 42 @State isNetConnected: boolean = true
42 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 43 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
43 - 44 + @State showComment: boolean = false
44 private trySendData2H5() { 45 private trySendData2H5() {
45 if (!this.webPrepared || !this.dataPrepared) { 46 if (!this.webPrepared || !this.dataPrepared) {
46 return 47 return
@@ -211,7 +212,7 @@ export struct SpacialTopicPageComponent { @@ -211,7 +212,7 @@ export struct SpacialTopicPageComponent {
211 showCommentList: $showCommentList, 212 showCommentList: $showCommentList,
212 publishCommentModel: $publishCommentModel, 213 publishCommentModel: $publishCommentModel,
213 interactData: $interactData, 214 interactData: $interactData,
214 - }) 215 + }).visibility(this.showComment?Visibility.Visible:Visibility.Hidden)
215 } 216 }
216 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 217 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
217 } 218 }
@@ -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)
@@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' @@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
4 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' 4 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
5 import { CommentListItem } from '../../../viewmodel/CommentListItem' 5 import { CommentListItem } from '../../../viewmodel/CommentListItem'
6 import measure from '@ohos.measure' 6 import measure from '@ohos.measure'
  7 +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
  8 +import { ProcessUtils } from 'wdRouter/Index'
7 9
8 @Component 10 @Component
9 export struct ChildCommentComponent { 11 export struct ChildCommentComponent {
@@ -189,6 +191,11 @@ export struct ChildCommentComponent { @@ -189,6 +191,11 @@ export struct ChildCommentComponent {
189 .width('100%') 191 .width('100%')
190 .height('69lpx') 192 .height('69lpx')
191 .justifyContent(FlexAlign.SpaceBetween) 193 .justifyContent(FlexAlign.SpaceBetween)
  194 + .onClick(()=>{
  195 + let content = getParams(this.data)
  196 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
  197 + ProcessUtils.processPage(content)
  198 + })
192 199
193 }.height('69lpx') 200 }.height('69lpx')
194 .justifyContent(FlexAlign.Center) 201 .justifyContent(FlexAlign.Center)
@@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent { @@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent {
90 isLastItem: index === this.data_comment.totalCount() - 1 90 isLastItem: index === this.data_comment.totalCount() - 1
91 }) 91 })
92 } 92 }
93 - .onClick(()=>{  
94 - let content = getParams(item)  
95 - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))  
96 - content.customParamTargetLayout = "comment"  
97 - ProcessUtils.processPage(content)  
98 - }) 93 + // .onClick(()=>{
  94 + // let content = getParams(item)
  95 + // TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
  96 + // content.customParamTargetLayout = "comment"
  97 + // ProcessUtils.processPage(content)
  98 + // })
99 .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 99 .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
100 if (isVisible) { 100 if (isVisible) {
101 let contentDTO = getParams(item) 101 let contentDTO = getParams(item)
@@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent { @@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent {
91 isLastItem: index === this.data_comment.totalCount() - 1, 91 isLastItem: index === this.data_comment.totalCount() - 1,
92 }) 92 })
93 } 93 }
94 - .onClick(()=>{  
95 - let content = getParams(item)  
96 - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))  
97 - ProcessUtils.processPage(content)  
98 - }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 94 + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
99 if (isVisible) { 95 if (isVisible) {
100 let contentDTO = getParams(item) 96 let contentDTO = getParams(item)
101 //埋点crash 后面看看 97 //埋点crash 后面看看
@@ -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,16 +341,27 @@ export struct TopNavigationComponentNew { @@ -352,16 +341,27 @@ export struct TopNavigationComponentNew {
352 // 当前tab,单击事件 341 // 当前tab,单击事件
353 this.doAutoRefresh() 342 this.doAutoRefresh()
354 } else { 343 } else {
  344 + this.channelJumpToPage(index)
  345 + }
  346 + })
  347 + }
  348 +
  349 +
  350 + /**
  351 + * 频道信息跳转页面方法
  352 + * @param index
  353 + */
  354 + private channelJumpToPage(index :number){
355 if (this.isBroadcastByIndex(index)) { 355 if (this.isBroadcastByIndex(index)) {
356 // 跳转到播报页面 356 // 跳转到播报页面
357 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 357 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
358 } else if (this.isLayoutByIndex(index)) { 358 } else if (this.isLayoutByIndex(index)) {
  359 + // 跳转到电子报页面
359 ProcessUtils.gotoENewsPaper() 360 ProcessUtils.gotoENewsPaper()
360 } else { 361 } else {
361 this.changePage(index) 362 this.changePage(index)
362 } 363 }
363 - }  
364 - }) 364 +
365 } 365 }
366 366
367 /** 367 /**
@@ -369,6 +369,7 @@ export struct TopNavigationComponentNew { @@ -369,6 +369,7 @@ export struct TopNavigationComponentNew {
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 - 685 + let timer = setInterval(() => {
705 this.isClickMorningEveningPaper = false 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)
  691 + let timer = setInterval(() => {
708 this.isClickMorningEveningPaper = false 692 this.isClickMorningEveningPaper = false
  693 + clearInterval(timer);
  694 + }, 1000);
709 }) 695 })
710 } else { 696 } else {
711 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 697 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  698 + let timer = setInterval(() => {
712 this.isClickMorningEveningPaper = false 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 }
@@ -44,12 +44,12 @@ export struct PlayerTitleComponent { @@ -44,12 +44,12 @@ export struct PlayerTitleComponent {
44 Image($r('app.media.icon_arrow_left_white')) 44 Image($r('app.media.icon_arrow_left_white'))
45 .width(24) 45 .width(24)
46 .aspectRatio(1) 46 .aspectRatio(1)
47 - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) 47 + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
48 .margin({ 48 .margin({
49 right: 10 49 right: 10
50 }) 50 })
51 .onClick(() => { 51 .onClick(() => {
52 - WindowModel.shared.setPreferredOrientation(this.isLarge ? 52 + WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?
53 window.Orientation.PORTRAIT : 53 window.Orientation.PORTRAIT :
54 window.Orientation.LANDSCAPE_INVERTED) 54 window.Orientation.LANDSCAPE_INVERTED)
55 WindowModel.shared.setSpecificSystemBarEnabled(true) 55 WindowModel.shared.setSpecificSystemBarEnabled(true)
@@ -74,7 +74,7 @@ export struct PlayerTitleComponent { @@ -74,7 +74,7 @@ export struct PlayerTitleComponent {
74 Image($r('app.media.icon_share')) 74 Image($r('app.media.icon_share'))
75 .width(24) 75 .width(24)
76 .aspectRatio(1) 76 .aspectRatio(1)
77 - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) 77 + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
78 .margin({right:16}) 78 .margin({right:16})
79 }.margin({ bottom: 10 }) 79 }.margin({ bottom: 10 })
80 80
@@ -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"){ //收集个人信息明示清单
@@ -128,18 +128,62 @@ struct OneKeyLoginPage { @@ -128,18 +128,62 @@ struct OneKeyLoginPage {
128 .padding({top: `${this.topSafeHeight}px`}) 128 .padding({top: `${this.topSafeHeight}px`})
129 } 129 }
130 130
  131 + // @Builder loginButton() {
  132 + // Column() {
  133 + // LoginWithHuaweiIDButton({
  134 + // params: {
  135 + // // LoginWithHuaweiIDButton支持的样式。
  136 + // style: loginComponentManager.Style.BUTTON_CUSTOM,
  137 + // // LoginWithHuaweiIDButton的边框圆角半径。
  138 + // borderRadius: 4,
  139 + // // LoginWithHuaweiIDButton支持的登录类型。
  140 + // loginType: loginComponentManager.LoginType.QUICK_LOGIN,
  141 + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
  142 + // supportDarkMode: true,
  143 + // customButtonParams: {
  144 + // fontColor: loginComponentManager.FontColor.WHITE,
  145 + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
  146 + // backgroundColor:"#ED2800"
  147 + // }
  148 + // },
  149 + // controller: this.controller
  150 + // })
  151 + // }
  152 + // .backgroundColor("#ED2800")
  153 + // .height(48)
  154 + // .margin({ top: 20 ,left: 25, right: 25 })
  155 + // }
  156 +
131 @Builder loginButton() { 157 @Builder loginButton() {
132 - Column() { 158 + Row() {
  159 + Stack(){
  160 + Button() {
  161 + Row() {
  162 + Image($r("app.media.huawei_one_key_login_icon"))
  163 + .width(24).height(24)
  164 + Text("华为账号一键登录")
  165 + .fontColor(Color.White)
  166 + .margin({left:5})
  167 + }
  168 + }
  169 + .width('100%')
  170 + .height(48)
  171 + .borderRadius(4)
  172 + .type(ButtonType.Normal)
  173 + .backgroundColor("#ED2800")
  174 +
  175 + Stack(){
  176 + //目前不支持文字和图标同时展示,后面优化
133 LoginWithHuaweiIDButton({ 177 LoginWithHuaweiIDButton({
134 params: { 178 params: {
135 // LoginWithHuaweiIDButton支持的样式。 179 // LoginWithHuaweiIDButton支持的样式。
136 style: loginComponentManager.Style.BUTTON_CUSTOM, 180 style: loginComponentManager.Style.BUTTON_CUSTOM,
137 // LoginWithHuaweiIDButton的边框圆角半径。 181 // LoginWithHuaweiIDButton的边框圆角半径。
138 - borderRadius: 4, 182 + // borderRadius: 4,
139 // LoginWithHuaweiIDButton支持的登录类型。 183 // LoginWithHuaweiIDButton支持的登录类型。
140 loginType: loginComponentManager.LoginType.QUICK_LOGIN, 184 loginType: loginComponentManager.LoginType.QUICK_LOGIN,
141 // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 185 // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
142 - supportDarkMode: true, 186 + // supportDarkMode: true,
143 customButtonParams: { 187 customButtonParams: {
144 fontColor: loginComponentManager.FontColor.WHITE, 188 fontColor: loginComponentManager.FontColor.WHITE,
145 // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" 189 // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
@@ -147,39 +191,18 @@ struct OneKeyLoginPage { @@ -147,39 +191,18 @@ struct OneKeyLoginPage {
147 } 191 }
148 }, 192 },
149 controller: this.controller 193 controller: this.controller
150 - }) 194 + }).opacity(0)
  195 + }
  196 + .width('100%')
  197 + .height('100%')
  198 + }
151 } 199 }
152 .height(48) 200 .height(48)
153 - .margin({ top: 20 ,left: 25, right: 25 }) 201 + .width("100%")
  202 + .padding({ left: 25, right: 25 })
  203 + .margin({top: 20})
154 } 204 }
155 205
156 - // @Builder loginButton() {  
157 - // Row() {  
158 - // Button() {  
159 - // Row() {  
160 - // Image($r("app.media.huawei_one_key_login_icon"))  
161 - // .width(24).height(24)  
162 - // Text("华为账号一键登录")  
163 - // .fontColor(Color.White)  
164 - // }  
165 - // }  
166 - // .type(ButtonType.Normal)  
167 - // .height(48)  
168 - // .backgroundColor(!this.agreeProtocol ? "#60ED2800" : "#ED2800")  
169 - // .width("100%")  
170 - // .onClick((event) => {  
171 - // if (!this.agreeProtocol) {  
172 - // return  
173 - // }  
174 - //  
175 - // TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)  
176 - // this.requestLogin()  
177 - // })  
178 - // }  
179 - // .padding({ left: 25, right: 25 })  
180 - // .margin({top: 20})  
181 - // }  
182 -  
183 @Builder ProtocolRow() { 206 @Builder ProtocolRow() {
184 Row({space: 4}) { 207 Row({space: 4}) {
185 Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) 208 Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
@@ -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.floor(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(),
@@ -394,6 +394,7 @@ export struct MultiPictureDetailPageComponent { @@ -394,6 +394,7 @@ export struct MultiPictureDetailPageComponent {
394 bottom: 4, 394 bottom: 4,
395 right: 18 395 right: 18
396 }) 396 })
  397 + .width('92%')
397 } 398 }
398 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { 399 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
399 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) 400 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
@@ -405,11 +406,12 @@ export struct MultiPictureDetailPageComponent { @@ -405,11 +406,12 @@ export struct MultiPictureDetailPageComponent {
405 .textOverflow({ overflow: TextOverflow.Ellipsis }) 406 .textOverflow({ overflow: TextOverflow.Ellipsis })
406 .margin({ 407 .margin({
407 top: 4, 408 top: 4,
408 - left: 0, 409 + left: 18,
409 bottom: 4, 410 bottom: 4,
410 right: 18 411 right: 18
411 }) 412 })
412 .maxLines(32) 413 .maxLines(32)
  414 + .width('92%')
413 } 415 }
414 } 416 }
415 } 417 }