王士厅
Showing 61 changed files with 1329 additions and 733 deletions
@@ -181,6 +181,10 @@ @@ -181,6 +181,10 @@
181 "value": "40vp" 181 "value": "40vp"
182 }, 182 },
183 { 183 {
  184 + "name": "top_tab_bar_height_common",
  185 + "value": "44vp"
  186 + },
  187 + {
184 "name": "top_tab_item_max_width", 188 "name": "top_tab_item_max_width",
185 "value": "300vp" 189 "value": "300vp"
186 }, 190 },
@@ -68,6 +68,7 @@ export class WDRouterPage { @@ -68,6 +68,7 @@ export class WDRouterPage {
68 static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); 68 static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage");
69 static oneKeyLoginPage = new WDRouterPage("wdLogin", "ets/pages/login/OneKeyLoginPage"); 69 static oneKeyLoginPage = new WDRouterPage("wdLogin", "ets/pages/login/OneKeyLoginPage");
70 static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage"); 70 static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage");
  71 + static verifyPhoneNumberPage = new WDRouterPage("wdLogin", "ets/pages/login/VerifyPhoneNumberPage");
71 static changeBindPhonePage = new WDRouterPage("wdLogin", "ets/pages/login/ChangeBindPhonePage"); 72 static changeBindPhonePage = new WDRouterPage("wdLogin", "ets/pages/login/ChangeBindPhonePage");
72 static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage"); 73 static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage");
73 //我的 预约 74 //我的 预约
@@ -49,6 +49,7 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; @@ -49,6 +49,7 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
49 49
50 50
51 /** 51 /**
  52 + * 动态详情页UI
52 * @author wd-zsz 53 * @author wd-zsz
53 * */ 54 * */
54 // @Preview 55 // @Preview
@@ -533,6 +534,8 @@ export struct DynamicDetailComponent { @@ -533,6 +534,8 @@ export struct DynamicDetailComponent {
533 } 534 }
534 //点赞操作 535 //点赞操作
535 this.toggleLikeStatus() 536 this.toggleLikeStatus()
  537 + //内容点赞/取消点赞埋点
  538 +
536 }) 539 })
537 540
538 // 评论 541 // 评论
1 import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; 1 import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
2 import { StringUtils } from 'wdKit'; 2 import { StringUtils } from 'wdKit';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
  4 +import { TrackingContent,TrackConstants } from 'wdTracking/Index';
4 import { newsSkeleton } from './skeleton/newsSkeleton'; 5 import { newsSkeleton } from './skeleton/newsSkeleton';
5 6
6 @Component 7 @Component
@@ -13,6 +14,20 @@ export struct ENewspaperItemComponent { @@ -13,6 +14,20 @@ export struct ENewspaperItemComponent {
13 private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean 14 private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean
14 @State isShowSkeleton: boolean = true 15 @State isShowSkeleton: boolean = true
15 16
  17 + aboutToAppear(): void {
  18 + for (let index = 0; index < this.newspaperListItemBean.items.length; index++) {
  19 + const element = this.newspaperListItemBean.items[index];
  20 + TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  21 + ,{
  22 + 'contentName':element.title,
  23 + 'contentType':element.newsType,
  24 + 'contentId':element.newsId,
  25 + 'panelNumber':this.newspaperListItemBean.pageNum,
  26 + 'panelName':this.newspaperListItemBean.pageName,
  27 + 'readMode':'1',
  28 + })
  29 + }
  30 + }
16 build() { 31 build() {
17 Stack() { 32 Stack() {
18 newsSkeleton() 33 newsSkeleton()
@@ -70,6 +85,16 @@ export struct ENewspaperItemComponent { @@ -70,6 +85,16 @@ export struct ENewspaperItemComponent {
70 relType:this.itemBeanClicked.relType ?? '0' 85 relType:this.itemBeanClicked.relType ?? '0'
71 } as ContentDTO 86 } as ContentDTO
72 ProcessUtils.processPage(content) 87 ProcessUtils.processPage(content)
  88 + //内容点击
  89 + TrackingContent.commentClickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  90 + ,{
  91 + 'contentName':this.itemBeanClicked.title,
  92 + 'contentType':this.itemBeanClicked.newsType,
  93 + 'contentId':this.itemBeanClicked.newsId,
  94 + 'panelNumber':this.newspaperListItemBean.pageNum,
  95 + 'panelName':this.newspaperListItemBean.pageName,
  96 + 'readMode':'1',
  97 + })
73 this.itemBeanClicked = {} as NewspaperPositionItemBean 98 this.itemBeanClicked = {} as NewspaperPositionItemBean
74 } 99 }
75 } 100 }
@@ -10,7 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; @@ -10,7 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
10 import { RMCalendarBean } from './calendar/RMCalendarBean'; 10 import { RMCalendarBean } from './calendar/RMCalendarBean';
11 import { newsSkeleton } from './skeleton/newsSkeleton'; 11 import { newsSkeleton } from './skeleton/newsSkeleton';
12 import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; 12 import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
13 -import { promptAction } from '@kit.ArkUI'; 13 +import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
14 14
15 @Component 15 @Component
16 export struct ENewspaperPageComponent { 16 export struct ENewspaperPageComponent {
@@ -34,6 +34,15 @@ export struct ENewspaperPageComponent { @@ -34,6 +34,15 @@ export struct ENewspaperPageComponent {
34 let _swiperIndex = Number.parseInt(this.currentPageNum) 34 let _swiperIndex = Number.parseInt(this.currentPageNum)
35 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex) 35 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
36 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex 36 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
  37 +
  38 + //电子报--版面序号选择点击
  39 + TrackingContent.commentClickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  40 + ,{
  41 + 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
  42 + 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
  43 + 'currentPanelDate':this.selectDate.toDateString(),
  44 + 'currentNumber':this.swiperIndex,
  45 + })
37 } 46 }
38 47
39 //日历选择弹框 48 //日历选择弹框
@@ -51,6 +60,14 @@ export struct ENewspaperPageComponent { @@ -51,6 +60,14 @@ export struct ENewspaperPageComponent {
51 this.selectDate = 60 this.selectDate =
52 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) 61 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
53 } 62 }
  63 + //日历选择点击
  64 + TrackingContent.commentClickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  65 + ,{
  66 + 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
  67 + 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
  68 + 'currentPanelDate':this.selectDate.toDateString(),
  69 + 'currentNumber':this.swiperIndex,
  70 + })
54 } 71 }
55 }), 72 }),
56 alignment: DialogAlignment.Top, 73 alignment: DialogAlignment.Top,
@@ -190,7 +207,7 @@ export struct ENewspaperPageComponent { @@ -190,7 +207,7 @@ export struct ENewspaperPageComponent {
190 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 207 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
191 Swiper(this.swiperController) { 208 Swiper(this.swiperController) {
192 ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { 209 ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
193 - ENewspaperItemComponent({ newspaperListItemBean: item }) 210 + ENewspaperItemComponent({ newspaperListItemBean: item})
194 }) 211 })
195 } 212 }
196 .index(this.swiperIndex) 213 .index(this.swiperIndex)
@@ -245,6 +262,12 @@ export struct ENewspaperPageComponent { @@ -245,6 +262,12 @@ export struct ENewspaperPageComponent {
245 .id('e_newspaper_next') 262 .id('e_newspaper_next')
246 .onClick((event: ClickEvent) => { 263 .onClick((event: ClickEvent) => {
247 this.swiperController.showNext() 264 this.swiperController.showNext()
  265 + // 电子报--滑动查看下一版
  266 + TrackingButton.click('panelPageViewNextPanel',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  267 + ,{
  268 + 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
  269 + 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
  270 + })
248 }) 271 })
249 } 272 }
250 273
@@ -316,6 +339,14 @@ export struct ENewspaperPageComponent { @@ -316,6 +339,14 @@ export struct ENewspaperPageComponent {
316 } 339 }
317 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 340 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
318 this.isOpenListDialog = true 341 this.isOpenListDialog = true
  342 + //电子报--读报纸点击
  343 + TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
  344 + ,{
  345 + 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
  346 + 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
  347 + 'currentPanelDate':this.selectDate.toDateString(),
  348 + 'currentNumber':this.swiperIndex,
  349 + })
319 }else { 350 }else {
320 ToastUtils.showToast('暂无数据', 1000) 351 ToastUtils.showToast('暂无数据', 1000)
321 } 352 }
@@ -10,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; @@ -10,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
10 import { router } from '@kit.ArkUI'; 10 import { router } from '@kit.ArkUI';
11 import { CommonConstants } from 'wdConstant/Index'; 11 import { CommonConstants } from 'wdConstant/Index';
12 import { ProcessUtils } from 'wdRouter/Index'; 12 import { ProcessUtils } from 'wdRouter/Index';
13 -import { TrackingPageBrowse } from 'wdTracking/Index'; 13 +import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
14 14
15 const TAG = 'FeedBackActivity' 15 const TAG = 'FeedBackActivity'
16 16
@@ -22,8 +22,6 @@ const TAG = 'FeedBackActivity' @@ -22,8 +22,6 @@ const TAG = 'FeedBackActivity'
22 @Component 22 @Component
23 export struct FeedBackActivity { 23 export struct FeedBackActivity {
24 pageShowTime:number = 0; 24 pageShowTime:number = 0;
25 - pageId:string = 'feedbackPage';  
26 - pageName:string=this.pageId;  
27 @State canSubmit: boolean = false; 25 @State canSubmit: boolean = false;
28 @State textNumLabel: string = '0/500'; 26 @State textNumLabel: string = '0/500';
29 contact: string = ""; 27 contact: string = "";
@@ -66,6 +64,11 @@ export struct FeedBackActivity { @@ -66,6 +64,11 @@ export struct FeedBackActivity {
66 .onChange((select) => { 64 .onChange((select) => {
67 feedbackTypeBean.isSelect = select 65 feedbackTypeBean.isSelect = select
68 this.canSubmit = this.checkSubmit() 66 this.canSubmit = this.checkSubmit()
  67 +
  68 + TrackingButton.click('submit_feedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
  69 + 'feedback_type':feedbackTypeBean.id+''
  70 + })
  71 +
69 }) 72 })
70 Text(feedbackTypeBean.classifyName) 73 Text(feedbackTypeBean.classifyName)
71 .fontColor($r('app.color.color_222222')) 74 .fontColor($r('app.color.color_222222'))
@@ -342,9 +345,13 @@ export struct FeedBackActivity { @@ -342,9 +345,13 @@ export struct FeedBackActivity {
342 }) 345 })
343 if(!StringUtils.isEmpty(selectType)){ 346 if(!StringUtils.isEmpty(selectType)){
344 selectType = selectType.substring(0,selectType.length-1) 347 selectType = selectType.substring(0,selectType.length-1)
  348 + TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
  349 + 'feedbackTypeId':selectType
  350 + })
345 }else{ 351 }else{
346 // 352 //
347 ToastUtils.shortToast($r('app.string.feedback_opinion_type')) 353 ToastUtils.shortToast($r('app.string.feedback_opinion_type'))
  354 + TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
348 return 355 return
349 } 356 }
350 //内容必填 357 //内容必填
@@ -389,7 +396,7 @@ export struct FeedBackActivity { @@ -389,7 +396,7 @@ export struct FeedBackActivity {
389 } 396 }
390 onPageHide() { 397 onPageHide() {
391 //页面浏览 398 //页面浏览
392 - TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) 399 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
393 400
394 } 401 }
395 } 402 }
@@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent { @@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent {
67 // 顶部安全高度赋值 67 // 顶部安全高度赋值
68 @State topSafeHeight: number = 0; 68 @State topSafeHeight: number = 0;
69 @State bottomSafeHeight: number = 0; 69 @State bottomSafeHeight: number = 0;
  70 + @State isHasTopView: boolean = false;
70 71
71 private audioDataList: AudioDataList[] = [] 72 private audioDataList: AudioDataList[] = []
72 private playerController: WDPlayerController = new WDPlayerController(); 73 private playerController: WDPlayerController = new WDPlayerController();
@@ -144,7 +145,10 @@ export struct MorningEveningPaperComponent { @@ -144,7 +145,10 @@ export struct MorningEveningPaperComponent {
144 145
145 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) 146 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
146 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) 147 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
147 - this.setComponentBgColor(pageInfoBean.backgroundImgUrl) 148 +
  149 + this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
  150 + let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
  151 + this.setComponentBgColor(coverUrl)
148 152
149 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) 153 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
150 // this.compInfoBean = compInfoBean 154 // this.compInfoBean = compInfoBean
@@ -201,11 +205,9 @@ export struct MorningEveningPaperComponent { @@ -201,11 +205,9 @@ export struct MorningEveningPaperComponent {
201 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); 205 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
202 Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl) 206 Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl)
203 207
204 - const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)  
205 -  
206 - if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) { 208 + if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
  209 + const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
207 this.pickColor(imageSource) 210 this.pickColor(imageSource)
208 -  
209 } else { 211 } else {
210 if (this.pageInfoBean.topicInfo.topicPattern === 1) { 212 if (this.pageInfoBean.topicInfo.topicPattern === 1) {
211 this.mixedBgColor = '#66BDBD' 213 this.mixedBgColor = '#66BDBD'
@@ -223,8 +225,7 @@ export struct MorningEveningPaperComponent { @@ -223,8 +225,7 @@ export struct MorningEveningPaperComponent {
223 effectKit.createColorPicker(pixelMap, (err, colorPicker) => { 225 effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
224 let color = colorPicker.getMainColorSync(); 226 let color = colorPicker.getMainColorSync();
225 Logger.debug(TAG, "compInfoBean compStyle = " + color) 227 Logger.debug(TAG, "compInfoBean compStyle = " + color)
226 -  
227 - color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) 228 + // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
228 // 将取色器选取的color示例转换为十六进制颜色代码 229 // 将取色器选取的color示例转换为十六进制颜色代码
229 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); 230 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
230 Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) 231 Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
@@ -271,19 +272,24 @@ export struct MorningEveningPaperComponent { @@ -271,19 +272,24 @@ export struct MorningEveningPaperComponent {
271 } 272 }
272 } 273 }
273 .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) 274 .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
  275 + .onAreaChange((oldValue: Area, newValue: Area) => {
  276 + let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
  277 + if (persent > 1) {
  278 + persent = 1
  279 + }
  280 + })
274 281
275 - PaperTitleComponent() 282 + PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1)
276 } 283 }
277 .width('100%') 284 .width('100%')
278 .height('100%') 285 .height('100%')
279 .padding({ 286 .padding({
280 - top: this.topSafeHeight,  
281 - bottom: this.bottomSafeHeight 287 + top: this.isHasTopView?0:this.topSafeHeight,
  288 + // bottom: this.bottomSafeHeight
282 }) 289 })
283 // .backgroundColor(Color.Black) 290 // .backgroundColor(Color.Black)
284 // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) 291 // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
285 .backgroundColor(this.mixedBgColor ?? Color.Black) 292 .backgroundColor(this.mixedBgColor ?? Color.Black)
286 -  
287 } 293 }
288 294
289 @Builder 295 @Builder
@@ -32,36 +32,37 @@ export struct topicInfoView { @@ -32,36 +32,37 @@ export struct topicInfoView {
32 }) 32 })
33 .id('img_cover') 33 .id('img_cover')
34 34
35 - Row() {  
36 - Text("查看详情")  
37 - .fontSize(14)  
38 - .fontColor($r('app.color.white'))  
39 - .maxLines(1)  
40 - .borderRadius(2)  
41 - .padding({ left: 6, top: 4, bottom: 4 }) 35 + if (this.frontLinkObject) {
  36 + Row() {
  37 + Text("查看详情")
  38 + .fontSize(14)
  39 + .fontColor($r('app.color.white'))
  40 + .maxLines(1)
  41 + .borderRadius(2)
  42 + .padding({ left: 6, top: 4, bottom: 4 })
42 43
43 - Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))  
44 - .width(12)  
45 - .height(12)  
46 - .margin({ left: 4, right: 7 })  
47 - }  
48 - .backgroundColor($r('app.color.color_99636363'))  
49 - .margin({ top: 8, left: 16, right: 16, bottom: 16 })  
50 - .borderRadius(2)  
51 - .onClick(()=>{  
52 - if (this.frontLinkObject) { 44 + Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))
  45 + .width(12)
  46 + .height(12)
  47 + .margin({ left: 4, right: 7 })
  48 + }
  49 + .backgroundColor($r('app.color.color_99636363'))
  50 + .margin({ top: 8, left: 16, right: 16, bottom: 16 })
  51 + .borderRadius(2)
  52 + .onClick(()=>{
53 let contentDTO :ContentDTO = new ContentDTO(); 53 let contentDTO :ContentDTO = new ContentDTO();
54 contentDTO.objectType = this.frontLinkObject?.newsType.toString() 54 contentDTO.objectType = this.frontLinkObject?.newsType.toString()
55 contentDTO.objectId = this.frontLinkObject?.newsId 55 contentDTO.objectId = this.frontLinkObject?.newsId
56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl 56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl
57 ProcessUtils.processPage(contentDTO) 57 ProcessUtils.processPage(contentDTO)
58 - }  
59 - }).width(80)  
60 - .alignRules({  
61 - left: { anchor: "__container__", align: HorizontalAlign.Start },  
62 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }  
63 - })  
64 - .id('row_detail') 58 +
  59 + }).width(80)
  60 + .alignRules({
  61 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  62 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
  63 + })
  64 + .id('row_detail')
  65 + }
65 66
66 Text(this.frontLinkObject?.summary ?? "") 67 Text(this.frontLinkObject?.summary ?? "")
67 .margin({ top: 10 }) 68 .margin({ top: 10 })
@@ -174,6 +174,7 @@ export struct CardMediaInfo { @@ -174,6 +174,7 @@ export struct CardMediaInfo {
174 .mediaLogo() 174 .mediaLogo()
175 Text(`${this.contentDTO.photoNum}`) 175 Text(`${this.contentDTO.photoNum}`)
176 .mediaTextImgtype() 176 .mediaTextImgtype()
  177 + .fontFamily('BebasNeue')
177 } 178 }
178 .margin({ left: 80,top: 55}) 179 .margin({ left: 80,top: 55})
179 180
@@ -27,6 +27,7 @@ export struct Card17Component { @@ -27,6 +27,7 @@ export struct Card17Component {
27 @State str03: string = ''; 27 @State str03: string = '';
28 28
29 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
  30 + console.log('Card17Component', JSON.stringify(this.contentDTO))
30 this.titleInit(); 31 this.titleInit();
31 this.clicked = hasClicked(this.contentDTO.objectId) 32 this.clicked = hasClicked(this.contentDTO.objectId)
32 this.loadImg = await onlyWifiLoadImg(); 33 this.loadImg = await onlyWifiLoadImg();
@@ -65,7 +66,7 @@ export struct Card17Component { @@ -65,7 +66,7 @@ export struct Card17Component {
65 GridRow({ gutter: 2 }) { 66 GridRow({ gutter: 2 }) {
66 GridCol({ span: { xs: 8 } }) { 67 GridCol({ span: { xs: 8 } }) {
67 Image(this.loadImg ? 68 Image(this.loadImg ?
68 - this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url : '' : '') 69 + this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url || this.contentDTO.fullColumnImgUrls[0].fullUrl : '' : '')
69 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) 70 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
70 .width(CommonConstants.FULL_WIDTH) 71 .width(CommonConstants.FULL_WIDTH)
71 .height(160)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) 72 .height(160)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
@@ -77,7 +78,7 @@ export struct Card17Component { @@ -77,7 +78,7 @@ export struct Card17Component {
77 78
78 GridCol({ span: { xs: 4 } }) { 79 GridCol({ span: { xs: 4 } }) {
79 Image(this.loadImg ? 80 Image(this.loadImg ?
80 - this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url : '' : '') 81 + this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url || this.contentDTO.fullColumnImgUrls[1].fullUrl : '' : '')
81 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) 82 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
82 .width(CommonConstants.FULL_WIDTH) 83 .width(CommonConstants.FULL_WIDTH)
83 .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) 84 .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
@@ -94,7 +95,7 @@ export struct Card17Component { @@ -94,7 +95,7 @@ export struct Card17Component {
94 95
95 GridCol({ span: { xs: 4 } }) { 96 GridCol({ span: { xs: 4 } }) {
96 Image(this.loadImg ? 97 Image(this.loadImg ?
97 - this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url : '' : '') 98 + this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url || this.contentDTO.fullColumnImgUrls[2].fullUrl : '' : '')
98 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) 99 .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
99 .width(CommonConstants.FULL_WIDTH) 100 .width(CommonConstants.FULL_WIDTH)
100 .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) 101 .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
@@ -97,13 +97,14 @@ struct createImg { @@ -97,13 +97,14 @@ struct createImg {
97 @State loadImg: boolean = false; 97 @State loadImg: boolean = false;
98 98
99 async aboutToAppear(): Promise<void> { 99 async aboutToAppear(): Promise<void> {
  100 + console.log("createImg", JSON.stringify(this.contentDTO.fullColumnImgUrls))
100 this.loadImg = await onlyWifiLoadImg(); 101 this.loadImg = await onlyWifiLoadImg();
101 } 102 }
102 103
103 104
104 build() { 105 build() {
105 GridRow() { 106 GridRow() {
106 - if (this.contentDTO.fullColumnImgUrls[0].landscape === 1 || this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height) { 107 + if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
107 // 横屏 108 // 横屏
108 GridCol({ 109 GridCol({
109 span: { xs: 12 } 110 span: { xs: 12 }
@@ -131,6 +132,7 @@ struct createImg { @@ -131,6 +132,7 @@ struct createImg {
131 .backgroundColor(0xf5f5f5) 132 .backgroundColor(0xf5f5f5)
132 .width(CommonConstants.FULL_WIDTH) 133 .width(CommonConstants.FULL_WIDTH)
133 .borderRadius($r('app.float.image_border_radius')) 134 .borderRadius($r('app.float.image_border_radius'))
  135 + .aspectRatio(172 / 230)
134 CardMediaInfo({ contentDTO: this.contentDTO }) 136 CardMediaInfo({ contentDTO: this.contentDTO })
135 } 137 }
136 .align(Alignment.BottomEnd) 138 .align(Alignment.BottomEnd)
@@ -36,18 +36,7 @@ export struct Card2Component { @@ -36,18 +36,7 @@ export struct Card2Component {
36 this.titleInit(); 36 this.titleInit();
37 this.loadImg = await onlyWifiLoadImg(); 37 this.loadImg = await onlyWifiLoadImg();
38 } 38 }
39 - calculateTextIndent() {  
40 - if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {  
41 - return 58;  
42 - } else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {  
43 - // 当newTags或seoTags存在时,应用相同的缩进  
44 - return 35;  
45 - } else if (this.contentDTO.objectType == '5') {  
46 - return 35;  
47 - } else {  
48 - return 0;  
49 - }  
50 - } 39 +
51 titleInit() { 40 titleInit() {
52 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { 41 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
53 this.titleMarked = true; 42 this.titleMarked = true;
@@ -61,15 +50,39 @@ export struct Card2Component { @@ -61,15 +50,39 @@ export struct Card2Component {
61 Column() { 50 Column() {
62 Column() { 51 Column() {
63 Stack() { 52 Stack() {
  53 + // if(this.contentDTO.objectType == '5'){
  54 + // Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
  55 + // }else if(this.contentDTO.objectType == '2'){
  56 + // if(this.contentDTO.seoTags){
  57 + // Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
  58 + // }else if(this.contentDTO.newTags){
  59 + // Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
  60 + //
  61 + // }
  62 + // }else {
  63 + // if(this.contentDTO.newTags){
  64 + // Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
  65 + // }
  66 + // }
64 if(this.contentDTO.objectType == '5'){ 67 if(this.contentDTO.objectType == '5'){
65 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) 68 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
66 } else { 69 } else {
67 if (this.contentDTO.seoTags) { 70 if (this.contentDTO.seoTags) {
68 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) 71 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
69 - } else if (this.contentDTO.newTags) { 72 + }
  73 + if (this.contentDTO.newTags) {
70 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) 74 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
71 } 75 }
72 } 76 }
  77 + //新闻标题
  78 + // if (this.contentDTO.newTags) {
  79 + //
  80 + // //Notes({ newTags: this.contentDTO.newTags })
  81 + // } else if (this.contentDTO.objectType == '5') {
  82 + //
  83 + // //Notes({ objectType: this.contentDTO.objectType })
  84 + // }
  85 +
73 Text() { 86 Text() {
74 if (this.titleMarked) { 87 if (this.titleMarked) {
75 Span(this.str01) 88 Span(this.str01)
@@ -86,7 +99,10 @@ export struct Card2Component { @@ -86,7 +99,10 @@ export struct Card2Component {
86 .lineHeight(27) 99 .lineHeight(27)
87 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 100 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
88 .align(Alignment.Start) 101 .align(Alignment.Start)
89 - .textIndent(this.calculateTextIndent()) 102 + .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
  103 + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
  104 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
  105 + 0 )
90 }.alignContent(Alignment.TopStart) 106 }.alignContent(Alignment.TopStart)
91 107
92 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) 108 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
@@ -27,6 +27,7 @@ export struct Card5Component { @@ -27,6 +27,7 @@ export struct Card5Component {
27 @State str03: string = ''; 27 @State str03: string = '';
28 28
29 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
  30 + console.log('Card2Component', JSON.stringify(this.compDTO))
30 this.clicked = hasClicked(this.contentDTO.objectId) 31 this.clicked = hasClicked(this.contentDTO.objectId)
31 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
32 33
@@ -47,9 +48,9 @@ export struct Card5Component { @@ -47,9 +48,9 @@ export struct Card5Component {
47 Image(this.loadImg ? this.contentDTO.coverUrl : '') 48 Image(this.loadImg ? this.contentDTO.coverUrl : '')
48 .backgroundColor(0xf5f5f5) 49 .backgroundColor(0xf5f5f5)
49 .width(CommonConstants.FULL_WIDTH) 50 .width(CommonConstants.FULL_WIDTH)
50 - .autoResize(true)  
51 .borderRadius($r('app.float.image_border_radius')) 51 .borderRadius($r('app.float.image_border_radius'))
52 - if (this.titleShowPolicy === 1 || this.titleShowPolicy === null) { 52 + .aspectRatio(343 / 225)
  53 + if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') {
53 Row() 54 Row()
54 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
55 .height(59) 56 .height(59)
@@ -32,19 +32,6 @@ export struct Card6Component { @@ -32,19 +32,6 @@ export struct Card6Component {
32 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
33 this.clicked = hasClicked(this.contentDTO.objectId) 33 this.clicked = hasClicked(this.contentDTO.objectId)
34 } 34 }
35 - calculateTextIndent() {  
36 - if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {  
37 - return 58;  
38 - } else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {  
39 - // 当newTags或seoTags存在时,应用相同的缩进  
40 - return 35;  
41 - } else if (this.contentDTO.objectType == '5') {  
42 - return 35;  
43 - } else {  
44 - return 0;  
45 - }  
46 - }  
47 -  
48 titleInit() { 35 titleInit() {
49 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { 36 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
50 this.titleMarked = true; 37 this.titleMarked = true;
@@ -74,7 +61,8 @@ export struct Card6Component { @@ -74,7 +61,8 @@ export struct Card6Component {
74 } else { 61 } else {
75 if (this.contentDTO.seoTags) { 62 if (this.contentDTO.seoTags) {
76 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) 63 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
77 - } else if (this.contentDTO.newTags) { 64 + }
  65 + if (this.contentDTO.newTags) {
78 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) 66 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
79 } 67 }
80 } 68 }
@@ -97,7 +85,10 @@ export struct Card6Component { @@ -97,7 +85,10 @@ export struct Card6Component {
97 .maxLines(3) 85 .maxLines(3)
98 .alignSelf(ItemAlign.Start) 86 .alignSelf(ItemAlign.Start)
99 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 87 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
100 - .textIndent(this.calculateTextIndent()) 88 + .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
  89 + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
  90 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
  91 + 0 )
101 }.alignContent(Alignment.TopStart) 92 }.alignContent(Alignment.TopStart)
102 93
103 } 94 }
@@ -279,6 +279,7 @@ export struct CommentComponent { @@ -279,6 +279,7 @@ export struct CommentComponent {
279 279
280 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { 280 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
281 281
  282 + this.allDatas.clearAllData() // 防止数据重复问题
282 commentListModel.list.forEach(element => { 283 commentListModel.list.forEach(element => {
283 element.hasMore = Number.parseInt(element.childCommentNum) ? true : false 284 element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
284 let newModel = commentViewModel.deepCopyCommentItemModel(element) 285 let newModel = commentViewModel.deepCopyCommentItemModel(element)
1 -import { DisplayUtils, EmitterEventId, EmitterUtils } from 'wdKit/Index' 1 +import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'
2 import { publishCommentModel } from '../model/PublishCommentModel' 2 import { publishCommentModel } from '../model/PublishCommentModel'
3 import { CommentCustomDialog } from './CommentCustomDialog' 3 import { CommentCustomDialog } from './CommentCustomDialog'
4 import measure from '@ohos.measure' 4 import measure from '@ohos.measure'
5 import { ContentDetailDTO } from 'wdBean/Index' 5 import { ContentDetailDTO } from 'wdBean/Index'
  6 +import { HttpUtils } from 'wdNetwork/Index'
  7 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
6 8
7 @Preview 9 @Preview
8 @Component 10 @Component
@@ -120,6 +122,21 @@ export struct CommentTabComponent { @@ -120,6 +122,21 @@ export struct CommentTabComponent {
120 if(this.contentDetail.appstyle === 9) return 122 if(this.contentDetail.appstyle === 9) return
121 this.onCommentFocus && this.onCommentFocus() 123 this.onCommentFocus && this.onCommentFocus()
122 124
  125 + // 未登录,游客评论未打开 则先登录
  126 + if (!HttpUtils.isLogin()) {
  127 + if (this.contentDetail.visitorComment != 1) {
  128 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  129 + return
  130 + }
  131 + }
  132 +
  133 + if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
  134 + ToastUtils.showToast("暂时无法评论", 3000)
  135 + return
  136 + }
  137 +
  138 + //TODO: 用户被禁言 也不能评论
  139 +
123 this.publishCommentModel.rootCommentId = '-1'; 140 this.publishCommentModel.rootCommentId = '-1';
124 this.publishCommentModel.parentId = '-1'; 141 this.publishCommentModel.parentId = '-1';
125 this.publishCommentModel.placeHolderText = "说两句..." 142 this.publishCommentModel.placeHolderText = "说两句..."
1 import { ViewType } from 'wdConstant/Index' 1 import { ViewType } from 'wdConstant/Index'
2 -import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index' 2 +import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index'
3 import { commentItemModel } from '../model/CommentModel' 3 import { commentItemModel } from '../model/CommentModel'
4 import commentViewModel from '../viewmodel/CommentViewModel' 4 import commentViewModel from '../viewmodel/CommentViewModel'
5 import { router, window } from '@kit.ArkUI' 5 import { router, window } from '@kit.ArkUI'
@@ -37,6 +37,7 @@ export struct QualityCommentsComponent { @@ -37,6 +37,7 @@ export struct QualityCommentsComponent {
37 aboutToDisappear(): void { 37 aboutToDisappear(): void {
38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) 38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
39 this.dialogController = null // 将dialogController置空 39 this.dialogController = null // 将dialogController置空
  40 + WindowModel.shared.setWindowLayoutFullScreen(false)
40 } 41 }
41 42
42 onPageShow(): void { 43 onPageShow(): void {
@@ -50,6 +51,7 @@ export struct QualityCommentsComponent { @@ -50,6 +51,7 @@ export struct QualityCommentsComponent {
50 aboutToAppear(): void { 51 aboutToAppear(): void {
51 this.getData(); 52 this.getData();
52 this.showAlert() 53 this.showAlert()
  54 + WindowModel.shared.setWindowLayoutFullScreen(true)
53 } 55 }
54 56
55 showAlert() { 57 showAlert() {
@@ -106,8 +108,15 @@ export struct QualityCommentsComponent { @@ -106,8 +108,15 @@ export struct QualityCommentsComponent {
106 // .aspectRatio(375 / 283); 108 // .aspectRatio(375 / 283);
107 } 109 }
108 .onAreaChange((oldValue: Area, newValue: Area) => { 110 .onAreaChange((oldValue: Area, newValue: Area) => {
109 -  
110 - let persent = Math.abs(Number(newValue.globalPosition.y)) / 150 111 + if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
  112 + this.firstPositionY = Number(newValue.globalPosition.y)
  113 + return
  114 + }
  115 + Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
  116 + Logger.debug(TAG,
  117 + "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
  118 + let persent =
  119 + Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY) / 150 //- this.topSafeHeight) / 283
111 if (persent > 1) { 120 if (persent > 1) {
112 persent = 1 121 persent = 1
113 } 122 }
@@ -129,65 +138,61 @@ export struct QualityCommentsComponent { @@ -129,65 +138,61 @@ export struct QualityCommentsComponent {
129 .alignRules({ 138 .alignRules({
130 center: { anchor: "__container__", align: VerticalAlign.Center }, 139 center: { anchor: "__container__", align: VerticalAlign.Center },
131 left: { anchor: "__container__", align: HorizontalAlign.Start } 140 left: { anchor: "__container__", align: HorizontalAlign.Start }
132 - })  
133 - .offset({  
134 - y: (this.topSafeHeight / 2) + 'px'  
135 - }) 141 + })// .offset({
  142 + // y: (this.topSafeHeight / 2) + 'px'
  143 + // })
136 .margin({ left: 16 }) 144 .margin({ left: 16 })
137 .onClick(() => { 145 .onClick(() => {
138 router.back() 146 router.back()
139 }) 147 })
140 } 148 }
141 .visibility(this.tileOpacity > 0 ? 1 : 0) 149 .visibility(this.tileOpacity > 0 ? 1 : 0)
142 - .height(this.topSafeHeight + vp2px(44) + 'px') 150 + // .height(this.topSafeHeight + vp2px(44) + 'px')
  151 + .height(44)
143 .width('100%') 152 .width('100%')
144 .backgroundColor($r('app.color.color_transparent')) 153 .backgroundColor($r('app.color.color_transparent'))
145 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
146 } 154 }
147 155
148 /*导航栏*/ 156 /*导航栏*/
149 @Builder 157 @Builder
150 TabbarNormal() { 158 TabbarNormal() {
151 - RelativeContainer() {  
152 - //标题栏目  
153 - Image($r('app.media.icon_arrow_left'))  
154 - .width(24)  
155 - .height(24)  
156 - .objectFit(ImageFit.Auto)  
157 - .id("back_icon")  
158 - .alignRules({  
159 - center: { anchor: "__container__", align: VerticalAlign.Center },  
160 - left: { anchor: "__container__", align: HorizontalAlign.Start }  
161 - })  
162 - .offset({  
163 - y: (this.topSafeHeight / 2) + 'px'  
164 - })  
165 - .margin({ left: 16 })  
166 - .onClick(() => {  
167 - router.back()  
168 - }) 159 + Column() {
  160 + Row() {
  161 + }
  162 + .width('100%')
  163 + .height(px2vp(this.topSafeHeight))
  164 + .backgroundColor($r('app.color.white'))
  165 + .opacity(this.tileOpacity)
169 166
170 - Text('精选评论')// .height('42lpx')  
171 - .maxLines(1)  
172 - .id("title")  
173 - .fontSize('35lpx')  
174 - .fontWeight(400)  
175 - .fontColor($r('app.color.color_222222'))  
176 - .lineHeight('42lpx')  
177 - .alignRules({  
178 - center: { anchor: "__container__", align: VerticalAlign.Center },  
179 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
180 - })  
181 - .offset({  
182 - y: (this.topSafeHeight / 2) + 'px'  
183 - }) 167 + Stack({ alignContent: Alignment.Start }) {
  168 + Row() {
  169 + Text('精选评论')// .height('42lpx')
  170 + .maxLines(1)
  171 + .id("title")
  172 + .fontSize('35lpx')
  173 + .fontWeight(400)
  174 + .fontColor($r('app.color.color_222222'))
  175 + .lineHeight('42lpx')
  176 + }
  177 + .height(44)
  178 + .width('100%')
  179 + .justifyContent(FlexAlign.Center)
  180 + .alignItems(VerticalAlign.Center)
  181 + .opacity(this.tileOpacity)
  182 + .backgroundColor($r('app.color.white'))
  183 +
  184 + Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
  185 + .width(24)
  186 + .height(24)
  187 + .objectFit(ImageFit.Auto)
  188 + .margin({ left: 16 })
  189 + .onClick(() => {
  190 + router.back()
  191 + })
  192 +
  193 + }
184 } 194 }
185 - .visibility(this.tileOpacity > 0 ? 0 : 1)  
186 - .opacity(this.tileOpacity)  
187 - .height(this.topSafeHeight + vp2px(44) + 'px')  
188 - .width('100%')  
189 - .backgroundColor($r('app.color.white'))  
190 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 195 +
191 } 196 }
192 197
193 build() { 198 build() {
@@ -212,12 +217,10 @@ export struct QualityCommentsComponent { @@ -212,12 +217,10 @@ export struct QualityCommentsComponent {
212 .friction(0.6) 217 .friction(0.6)
213 .scrollBar(BarState.Off) 218 .scrollBar(BarState.Off)
214 .edgeEffect(EdgeEffect.None) 219 .edgeEffect(EdgeEffect.None)
215 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
216 220
217 - this.TabbarTransparent() 221 + // this.TabbarTransparent()
218 this.TabbarNormal() 222 this.TabbarNormal()
219 } 223 }
220 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
221 224
222 } 225 }
223 226
@@ -276,28 +279,15 @@ struct QualityCommentItem { @@ -276,28 +279,15 @@ struct QualityCommentItem {
276 /*头像以及昵称*/ 279 /*头像以及昵称*/
277 RelativeContainer() { 280 RelativeContainer() {
278 281
279 - Image(this.item.fromUserHeader) 282 + this.headerView()
  283 +
  284 + if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0)
  285 + && this.item.fromUserType === 1
  286 + && ((this.item.api_levelHead && this.item.api_levelHead.length > 0)
  287 + || (this.item.avatarFrame && this.item.avatarFrame.length > 0))) {
  288 + this.borderView()
  289 + }
280 290
281 - .alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ?  
282 - 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon'))  
283 - .width(50)  
284 - .height(50)  
285 - .borderRadius(25)  
286 - .borderWidth(2)  
287 - .borderColor(Color.White)  
288 - .id('image1')  
289 - .alignRules({  
290 - top: { anchor: "__container__", align: VerticalAlign.Top },  
291 - left: { anchor: "__container__", align: HorizontalAlign.Start }  
292 - })  
293 - .offset(  
294 - {  
295 - y: -16  
296 - }  
297 - )  
298 - .onClick(() => {  
299 - this.jumpToAccountOwner()  
300 - })  
301 Text(this.item.fromUserName) 291 Text(this.item.fromUserName)
302 .fontSize(14) 292 .fontSize(14)
303 .fontColor('#222222') 293 .fontColor('#222222')
@@ -401,12 +391,83 @@ struct QualityCommentItem { @@ -401,12 +391,83 @@ struct QualityCommentItem {
401 391
402 } 392 }
403 393
  394 + @Builder headerView() {
  395 + Stack() {
  396 + Stack() {
  397 + Image(this.item.fromUserHeader)
  398 + .alt(commentViewModel.adjustUserType(this.item.fromUserType) ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.WDAccountDefaultIcon'))
  399 + .width(50)
  400 + .height(50)
  401 + .borderRadius(24)
  402 + .borderWidth(2)
  403 + .borderColor(Color.White)
  404 + .objectFit(ImageFit.Cover)
  405 +
  406 + if (this.item.api_authIcon && this.item.api_authIcon.length > 0) {
  407 + Image(this.item.api_authIcon) // 加v
  408 + .width(12).height(12)
  409 + .objectFit(ImageFit.Cover)
  410 + }
  411 + }.width(50).height(50)
  412 + .alignContent(Alignment.BottomEnd)
  413 + }
  414 + .width(50)
  415 + .height(50)
  416 + .alignContent(Alignment.Center)
  417 + .id('image1')
  418 + .alignRules({
  419 + top: { anchor: "__container__", align: VerticalAlign.Top },
  420 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  421 + })
  422 + .offset(
  423 + {
  424 + y: -16
  425 + }
  426 + )
  427 + .onClick(() => {
  428 + this.jumpToAccountOwner()
  429 + })
  430 + }
  431 +
  432 + @Builder borderView() {
  433 + Image(this.customBorderIconURL())
  434 + .objectFit(ImageFit.Cover)
  435 + .width(70)
  436 + .height(70)
  437 + .id('image2')
  438 + .alignRules({
  439 + middle: { anchor: "image1", align: HorizontalAlign.Center },
  440 + center: { anchor: "image1", align: VerticalAlign.Center }
  441 + })
  442 + .offset(
  443 + {
  444 + y: -16
  445 + }
  446 + )
  447 + .onClick(() => {
  448 + this.jumpToAccountOwner()
  449 + })
  450 + }
  451 +
  452 + customBorderIconURL() : string {
  453 + if (this.item.avatarFrame.length > 0) {
  454 + return this.item.avatarFrame
  455 + }
  456 + if (this.item.fromUserType === 1) {
  457 + return this.item.api_levelHead
  458 + }
  459 + return ""
  460 + }
  461 +
404 jumpToAccountOwner() { 462 jumpToAccountOwner() {
405 463
406 - commentViewModel.jumpToAccountPage(this.item) 464 + commentViewModel.jumpToAccountPage(this.item, () => {
  465 + WindowModel.shared.setWindowLayoutFullScreen(false)
  466 + })
407 } 467 }
408 468
409 jumpToDetail() { 469 jumpToDetail() {
  470 + WindowModel.shared.setWindowLayoutFullScreen(false)
410 // programInfoModel.api_isCommentAction = YES; 471 // programInfoModel.api_isCommentAction = YES;
411 let content = new ContentDTO() 472 let content = new ContentDTO()
412 content.objectId = this.item.targetId; 473 content.objectId = this.item.targetId;
@@ -439,6 +500,7 @@ struct QualityCommentItem { @@ -439,6 +500,7 @@ struct QualityCommentItem {
439 // 未登录,跳转登录 500 // 未登录,跳转登录
440 const user_id = HttpUtils.getUserId() 501 const user_id = HttpUtils.getUserId()
441 if (!user_id) { 502 if (!user_id) {
  503 + WindowModel.shared.setWindowLayoutFullScreen(false)
442 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 504 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
443 return 505 return
444 } 506 }
1 -import { CompDTO, ContentDTO, } from 'wdBean'; 1 +import { CompDTO, ContentDTO } from 'wdBean';
2 import { BreakpointConstants, CommonConstants } from 'wdConstant'; 2 import { BreakpointConstants, CommonConstants } from 'wdConstant';
3 import { BreakPointType, Logger } from 'wdKit'; 3 import { BreakPointType, Logger } from 'wdKit';
4 import { CompUtils } from '../../utils/CompUtils'; 4 import { CompUtils } from '../../utils/CompUtils';
@@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick' @@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
11 11
12 const TAG = 'Zh_Carousel_Layout-01'; 12 const TAG = 'Zh_Carousel_Layout-01';
13 13
  14 +
14 /** 15 /**
15 * 轮播组件,即Banner/轮播大图/焦点图/自动滑动 16 * 轮播组件,即Banner/轮播大图/焦点图/自动滑动
16 * 样式: 17 * 样式:
@@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 { @@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 {
47 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = 48 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
48 BreakpointConstants.BREAKPOINT_XS; 49 BreakpointConstants.BREAKPOINT_XS;
49 @State compDTO: CompDTO = {} as CompDTO 50 @State compDTO: CompDTO = {} as CompDTO
  51 +
50 @State firstWd: number = 0 52 @State firstWd: number = 0
51 @State SecondWd: number = 0 53 @State SecondWd: number = 0
52 @State swiperIndex: number = 0 54 @State swiperIndex: number = 0
  55 +
53 private data: MyDataSource = new MyDataSource([]) 56 private data: MyDataSource = new MyDataSource([])
54 57
55 watchCurrentBreakpoint() { 58 watchCurrentBreakpoint() {
@@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 { @@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 {
75 } 78 }
76 79
77 build() { 80 build() {
  81 +
78 if (this.compDTO?.operDataList?.length) { 82 if (this.compDTO?.operDataList?.length) {
79 Stack() { 83 Stack() {
80 Swiper() { 84 Swiper() {
@@ -206,9 +210,19 @@ struct CarouselLayout01CardView { @@ -206,9 +210,19 @@ struct CarouselLayout01CardView {
206 Blank() 210 Blank()
207 // 文本信息 211 // 文本信息
208 Stack() { 212 Stack() {
209 - if (this.item.objectType == '5' || this.item.objectType == '6') { 213 + if(this.item.objectType == '5'){
210 Notes({ objectType: this.item.objectType }) 214 Notes({ objectType: this.item.objectType })
  215 + } else {
  216 + if (this.item.seoTags) {
  217 + Notes({ newTags: this.item.seoTags })
  218 + }
  219 + if (this.item.newTags) {
  220 + Notes({ newTags: this.item.newTags })
  221 + }
211 } 222 }
  223 + // if (this.item.objectType == '5' || this.item.objectType == '6') {
  224 + // Notes({ objectType: this.item.objectType })
  225 + // }
212 Text(`${this.item.corner}${this.item.newsTitle}`) 226 Text(`${this.item.corner}${this.item.newsTitle}`)
213 .width(CommonConstants.FULL_PARENT) 227 .width(CommonConstants.FULL_PARENT)
214 .fontColor(Color.White) 228 .fontColor(Color.White)
@@ -218,7 +232,10 @@ struct CarouselLayout01CardView { @@ -218,7 +232,10 @@ struct CarouselLayout01CardView {
218 .align(Alignment.Bottom) 232 .align(Alignment.Bottom)
219 .maxLines(CompUtils.MAX_LINES_2) 233 .maxLines(CompUtils.MAX_LINES_2)
220 .textOverflow({ overflow: TextOverflow.Ellipsis }) 234 .textOverflow({ overflow: TextOverflow.Ellipsis })
221 - .textIndent(this.item.objectType == '5' ? 35 : 0) 235 + .textIndent((this.item.newTags?.length || this.item.seoTags?.length) > 2 &&
  236 + (this.item.newTags?.length ||this.item.seoTags?.length) < 5 ? 58 :
  237 + ((this.item.newTags?.length > 0 || this.item.seoTags?.length > 0) ||this.item.objectType == '5') ? 35 :
  238 + 0 )
222 } 239 }
223 // .height(39) 240 // .height(39)
224 .padding({ 241 .padding({
@@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; @@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
5 import { LazyDataSource, StringUtils } from 'wdKit'; 5 import { LazyDataSource, StringUtils } from 'wdKit';
6 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../../model/MinePageDatasModel';
7 import { EmptyComponent } from '../../view/EmptyComponent'; 7 import { EmptyComponent } from '../../view/EmptyComponent';
8 -import { Action } from 'wdBean/Index'; 8 +import { Action, ContentDTO } from 'wdBean/Index';
9 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 9 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { TrackingContent, TrackConstants, TrackParamConvert, ParamType } from 'wdTracking/Index';
  12 +import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils';
11 13
12 const TAG = "AppointmentListUI" 14 const TAG = "AppointmentListUI"
13 15
@@ -77,7 +79,9 @@ export struct AppointmentListUI { @@ -77,7 +79,9 @@ export struct AppointmentListUI {
77 AppointmentListChildComponent({ item: item }) 79 AppointmentListChildComponent({ item: item })
78 } 80 }
79 .onClick(() => { 81 .onClick(() => {
80 - //TODO 跳转 82 + let contentDTO = getParams(item)
  83 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,TrackParamConvert.program(contentDTO))
  84 +
81 let action = { 85 let action = {
82 type:"2", 86 type:"2",
83 params:{ 87 params:{
@@ -90,6 +94,12 @@ export struct AppointmentListUI { @@ -90,6 +94,12 @@ export struct AppointmentListUI {
90 } as Action 94 } as Action
91 WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) 95 WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
92 }) 96 })
  97 + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  98 + if (isVisible) {
  99 + let contentDTO = getParams(item)
  100 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live, TrackParamConvert.program(contentDTO))
  101 + }
  102 + })
93 }, (item: MineAppointmentItem, index: number) => index.toString()) 103 }, (item: MineAppointmentItem, index: number) => index.toString())
94 104
95 //没有更多数据 显示提示 105 //没有更多数据 显示提示
@@ -175,4 +185,15 @@ export struct AppointmentListUI { @@ -175,4 +185,15 @@ export struct AppointmentListUI {
175 console.log(TAG, JSON.stringify(dealData)) 185 console.log(TAG, JSON.stringify(dealData))
176 return dealData 186 return dealData
177 } 187 }
178 -}  
  188 +}
  189 +
  190 + function getParams(item: MineAppointmentItem) : ContentDTO{
  191 + let contentDTO = new ContentDTO();
  192 +
  193 + contentDTO.objectType = item.relType + ""
  194 + contentDTO.objectId = item.liveId + ""
  195 + contentDTO.newsTitle = item.title
  196 + // contentDTO.channelId =
  197 + // contentDTO.rmhPlatform
  198 + return contentDTO
  199 + }
@@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
5 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' 5 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
6 import { CommentListItem } from '../../../viewmodel/CommentListItem' 6 import { CommentListItem } from '../../../viewmodel/CommentListItem'
7 import measure from '@ohos.measure' 7 import measure from '@ohos.measure'
  8 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
8 9
9 @Component 10 @Component
10 export struct ChildCommentComponent { 11 export struct ChildCommentComponent {
@@ -16,6 +17,7 @@ export struct ChildCommentComponent { @@ -16,6 +17,7 @@ export struct ChildCommentComponent {
16 @State isOverLines: boolean = false 17 @State isOverLines: boolean = false
17 @State isOverLinesParent: boolean = false 18 @State isOverLinesParent: boolean = false
18 testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸" 19 testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
  20 + @Link fromPage:number
19 21
20 build() { 22 build() {
21 Column() { 23 Column() {
@@ -195,11 +197,12 @@ export struct ChildCommentComponent { @@ -195,11 +197,12 @@ export struct ChildCommentComponent {
195 }.height('69lpx') 197 }.height('69lpx')
196 .justifyContent(FlexAlign.Center) 198 .justifyContent(FlexAlign.Center)
197 .onClick(() => { 199 .onClick(() => {
198 - let content = new ContentDTO()  
199 - content.objectId = this.data.targetId;  
200 - content.relType = this.data.targetRelType + "";  
201 - content.relId = this.data.targetRelId;  
202 - content.objectType = this.data.targetType + ""; 200 + let content = getParams(this.data)
  201 + if(this.fromPage === 0 ){
  202 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
  203 + }else{
  204 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
  205 + }
203 ProcessUtils.processPage(content) 206 ProcessUtils.processPage(content)
204 }) 207 })
205 } 208 }
@@ -284,3 +287,20 @@ function textStyle() { @@ -284,3 +287,20 @@ function textStyle() {
284 .lineHeight('46lpx') 287 .lineHeight('46lpx')
285 } 288 }
286 289
  290 +function getParams(item: CommentListItem) : ContentDTO{
  291 + let contentDTO = new ContentDTO();
  292 +
  293 + // contentDTO.objectType = item.targetType + ""
  294 + // contentDTO.objectId = item.targetId + ""
  295 + // contentDTO.newsTitle = item.targetTitle
  296 + // contentDTO.channelId =
  297 + // contentDTO.rmhPlatform =
  298 +
  299 + contentDTO.objectId = item.targetId;
  300 + contentDTO.relType = item.targetRelType + "";
  301 + contentDTO.relId = item.targetRelId;
  302 + contentDTO.objectType = item.targetType + "";
  303 + contentDTO.newsTitle = item.targetTitle
  304 +
  305 + return contentDTO
  306 +}
@@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent'; @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent';
8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; 8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { ContentDTO } from 'wdBean/Index';
  12 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
11 13
12 const TAG = "HomePageBottomCommentComponent" 14 const TAG = "HomePageBottomCommentComponent"
13 15
@@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent { @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent {
83 ChildCommentComponent({ 85 ChildCommentComponent({
84 data: item, 86 data: item,
85 levelHead: UserDataLocal.getUserLevelHeaderUrl(), 87 levelHead: UserDataLocal.getUserLevelHeaderUrl(),
86 - isLastItem: index === this.data_comment.totalCount() - 1 88 + isLastItem: index === this.data_comment.totalCount() - 1,
  89 + fromPage:0
87 }) 90 })
88 - } 91 + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  92 + if (isVisible) {
  93 + let contentDTO = getParams(item)
  94 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
  95 + }
  96 + })
89 }, (item: CommentListItem, index: number) => index.toString()) 97 }, (item: CommentListItem, index: number) => index.toString())
90 98
91 //没有更多数据 显示提示 99 //没有更多数据 显示提示
@@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent { @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent {
217 this.isGetRequest = true 225 this.isGetRequest = true
218 }) 226 })
219 } 227 }
220 -}  
  228 +}
  229 +
  230 +
  231 +function getParams(item: CommentListItem) : ContentDTO{
  232 + let contentDTO = new ContentDTO();
  233 +
  234 + // contentDTO.objectType = item.targetType + ""
  235 + // contentDTO.objectId = item.targetId + ""
  236 + // contentDTO.newsTitle = item.targetTitle
  237 + // contentDTO.channelId =
  238 + // contentDTO.rmhPlatform =
  239 +
  240 + contentDTO.objectId = item.targetId;
  241 + contentDTO.relType = item.targetRelType + "";
  242 + contentDTO.relId = item.targetRelId;
  243 + contentDTO.objectType = item.targetType + "";
  244 + contentDTO.newsTitle = item.targetTitle
  245 +
  246 + return contentDTO
  247 +}
@@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
8 import { ChildCommentComponent } from './ChildCommentComponent'; 8 import { ChildCommentComponent } from './ChildCommentComponent';
9 import { EmptyComponent } from '../../view/EmptyComponent'; 9 import { EmptyComponent } from '../../view/EmptyComponent';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { ContentDTO } from 'wdBean/Index';
  12 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
11 13
12 const TAG = "HomePageBottomComponent" 14 const TAG = "HomePageBottomComponent"
13 /** 15 /**
@@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent { @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent {
84 ChildCommentComponent({ 86 ChildCommentComponent({
85 data: item, 87 data: item,
86 levelHead: this.levelHead, 88 levelHead: this.levelHead,
87 - isLastItem: index === this.data_comment.totalCount() - 1 89 + isLastItem: index === this.data_comment.totalCount() - 1,
  90 + fromPage:1
88 }) 91 })
89 - } 92 + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  93 + if (isVisible) {
  94 + let contentDTO = getParams(item)
  95 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
  96 + }
  97 + })
90 }, (item: CommentListItem, index: number) => index.toString()) 98 }, (item: CommentListItem, index: number) => index.toString())
91 99
92 //没有更多数据 显示提示 100 //没有更多数据 显示提示
@@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent { @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent {
214 this.isGetRequest = true 222 this.isGetRequest = true
215 }) 223 })
216 } 224 }
217 -}  
  225 +}
  226 +
  227 +function getParams(item: CommentListItem) : ContentDTO{
  228 + let contentDTO = new ContentDTO();
  229 +
  230 + // contentDTO.objectType = item.targetType + ""
  231 + // contentDTO.objectId = item.targetId + ""
  232 + // contentDTO.newsTitle = item.targetTitle
  233 + // contentDTO.channelId =
  234 + // contentDTO.rmhPlatform =
  235 +
  236 + contentDTO.objectId = item.targetId;
  237 + contentDTO.relType = item.targetRelType + "";
  238 + contentDTO.relId = item.targetRelId;
  239 + contentDTO.objectType = item.targetType + "";
  240 + contentDTO.newsTitle = item.targetTitle
  241 +
  242 + return contentDTO
  243 +}
@@ -56,7 +56,7 @@ struct PeopleShipHomePage { @@ -56,7 +56,7 @@ struct PeopleShipHomePage {
56 .height(px2vp(this.topSafeHeight)) 56 .height(px2vp(this.topSafeHeight))
57 .width("100%") 57 .width("100%")
58 .backgroundColor($r('app.color.white')) 58 .backgroundColor($r('app.color.white'))
59 - .visibility(this.attentionOpacity ? 1 : 0) 59 + .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
60 .opacity(this.topOpacity ) 60 .opacity(this.topOpacity )
61 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 61 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
62 } 62 }
  1 +import { WindowModel } from 'wdKit/Index';
1 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent'; 2 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
2 3
3 @Entry 4 @Entry
4 @Component 5 @Component
5 struct QualityCommentsPage { 6 struct QualityCommentsPage {
  7 + onPageShow(): void {
  8 + WindowModel.shared.setWindowLayoutFullScreen(true)
  9 + }
  10 +
  11 + onPageHide(): void {
  12 + WindowModel.shared.setWindowLayoutFullScreen(false)
  13 + }
  14 +
6 build() { 15 build() {
7 - Column(){ 16 + Column() {
8 QualityCommentsComponent(); 17 QualityCommentsComponent();
9 } 18 }
10 19
@@ -368,7 +368,6 @@ export struct TopNavigationComponent { @@ -368,7 +368,6 @@ export struct TopNavigationComponent {
368 .alignItems(VerticalAlign.Center) 368 .alignItems(VerticalAlign.Center)
369 .justifyContent(FlexAlign.Center) 369 .justifyContent(FlexAlign.Center)
370 .onClick(() => { 370 .onClick(() => {
371 - TrackingButton.click("", TrackConstants.PageName.Search, "PEOPLE")  
372 WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 371 WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
373 }) 372 })
374 } 373 }
@@ -172,7 +172,8 @@ export struct TopNavigationComponentNew { @@ -172,7 +172,8 @@ export struct TopNavigationComponentNew {
172 .onClick(() => { 172 .onClick(() => {
173 if (NetworkUtil.isNetConnected()) { 173 if (NetworkUtil.isNetConnected()) {
174 ProcessUtils.gotoMorningEveningPaper() 174 ProcessUtils.gotoMorningEveningPaper()
175 - TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews) 175 + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
  176 + TrackConstants.SummaryType.MorningAndEveningNews)
176 } else { 177 } else {
177 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 178 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
178 } 179 }
@@ -240,7 +241,7 @@ export struct TopNavigationComponentNew { @@ -240,7 +241,7 @@ export struct TopNavigationComponentNew {
240 .width('24vp') 241 .width('24vp')
241 .height('24vp') 242 .height('24vp')
242 } 243 }
243 - .height('40vp') 244 + .height($r('app.float.top_tab_bar_height_common'))
244 .width('40vp') 245 .width('40vp')
245 .margin({ right: 10 }) 246 .margin({ right: 10 })
246 .alignItems(VerticalAlign.Center) 247 .alignItems(VerticalAlign.Center)
@@ -251,7 +252,9 @@ export struct TopNavigationComponentNew { @@ -251,7 +252,9 @@ export struct TopNavigationComponentNew {
251 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End } 252 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End }
252 }) 253 })
253 .onClick(() => { 254 .onClick(() => {
254 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 255 + TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE")
  256 + let params = { 'tabName': "PEOPLE" } as Record<string, string>
  257 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
255 }) 258 })
256 259
257 List({ scroller: this.listScroller }) { 260 List({ scroller: this.listScroller }) {
@@ -264,9 +267,9 @@ export struct TopNavigationComponentNew { @@ -264,9 +267,9 @@ export struct TopNavigationComponentNew {
264 .listDirection(Axis.Horizontal) 267 .listDirection(Axis.Horizontal)
265 .scrollBar(BarState.Off) 268 .scrollBar(BarState.Off)
266 .edgeEffect(EdgeEffect.None) 269 .edgeEffect(EdgeEffect.None)
267 - .height($r('app.float.top_tab_bar_height')) 270 + .height($r('app.float.top_tab_bar_height_common'))
268 .backgroundColor(this.barBackgroundColor) 271 .backgroundColor(this.barBackgroundColor)
269 - .padding({ top: 6 }) 272 + .margin({top:10})
270 .onAreaChange((oldValue: Area, newValue: Area) => { 273 .onAreaChange((oldValue: Area, newValue: Area) => {
271 let width = Number.parseFloat(newValue.width.toString()) 274 let width = Number.parseFloat(newValue.width.toString())
272 this.tabsWidth = Number.isNaN(width) ? 0 : width 275 this.tabsWidth = Number.isNaN(width) ? 0 : width
@@ -97,6 +97,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -97,6 +97,7 @@ export struct PeopleShipHomeArticleListComponent {
97 } 97 }
98 } 98 }
99 } 99 }
  100 + .cachedCount(4)
100 .backgroundColor(Color.Transparent) 101 .backgroundColor(Color.Transparent)
101 .width("100%") 102 .width("100%")
102 .height("100%") 103 .height("100%")
@@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent { @@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent {
8 Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 8 Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
9 Button({type: ButtonType.Normal, stateEffect: false } ) { 9 Button({type: ButtonType.Normal, stateEffect: false } ) {
10 Stack() { 10 Stack() {
11 - Image(this.isAttention == '0'? $r('app.media.home_attention_no_left') : $r('app.media.home_attention_left')) 11 + Row()
12 .width('100%') 12 .width('100%')
13 .height('100%') 13 .height('100%')
14 - .objectFit(ImageFit.Cover) 14 + .backgroundColor(this.isAttention == '0'? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5'))
  15 + .borderRadius("5lpx")
15 Row() { 16 Row() {
16 if(this.isAttention == '0') { 17 if(this.isAttention == '0') {
17 if(this.isLoadingAttention) { 18 if(this.isLoadingAttention) {
@@ -78,8 +78,9 @@ export struct FirstTabTopSearchComponent { @@ -78,8 +78,9 @@ export struct FirstTabTopSearchComponent {
78 .backgroundImage($r('app.media.background_search')) 78 .backgroundImage($r('app.media.background_search'))
79 .backgroundImageSize(ImageSize.Cover) 79 .backgroundImageSize(ImageSize.Cover)
80 .onClick(() => { 80 .onClick(() => {
81 - TrackingButton.click("", TrackConstants.PageName.Search, "NEWS")  
82 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 81 + TrackingButton.searchClick( TrackConstants.PageName.Search, "NEWS")
  82 + let params = { 'tabName': "NEWS" } as Record<string, string>
  83 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
83 }) 84 })
84 } 85 }
85 } 86 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit' 2 import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
  3 +import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
3 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
4 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' 5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
5 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' 6 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
@@ -30,7 +31,8 @@ export struct SearchComponent { @@ -30,7 +31,8 @@ export struct SearchComponent {
30 @State relatedSearchContentsData: SearchRelatedItem[] = [] 31 @State relatedSearchContentsData: SearchRelatedItem[] = []
31 scroller: Scroller = new Scroller() 32 scroller: Scroller = new Scroller()
32 @State count:string[] = [] 33 @State count:string[] = []
33 - @State isGetRequest:boolean = false; 34 + @State isGetRequest:boolean = false
  35 + @Link fromTabName: string
34 36
35 aboutToAppear() { 37 aboutToAppear() {
36 //获取提示滚动 38 //获取提示滚动
@@ -175,6 +177,7 @@ export struct SearchComponent { @@ -175,6 +177,7 @@ export struct SearchComponent {
175 } 177 }
176 178
177 searchResData(content:string){ 179 searchResData(content:string){
  180 + trackSearchClick(this.fromTabName,content)
178 //赋值 181 //赋值
179 this.searchText = content 182 this.searchText = content
180 //保存搜索记录 183 //保存搜索记录
@@ -386,4 +389,16 @@ export struct SearchComponent { @@ -386,4 +389,16 @@ export struct SearchComponent {
386 this.isClickedInputSearch = false 389 this.isClickedInputSearch = false
387 this.isClickedHintSearch = false 390 this.isClickedHintSearch = false
388 } 391 }
  392 +}
  393 +
  394 +function trackSearchClick(upOneLevelPageName: string,keyword:string){
  395 + let params: ParamType = {}
  396 +
  397 + params["keyword"] = keyword
  398 + params["searchType"] = "0"
  399 + params["pageName"] = TrackConstants.PageName.Search
  400 + params["pageId"] = TrackConstants.PageName.Search
  401 + params["upOneLevelPageName"] = upOneLevelPageName
  402 +
  403 + Tracking.event("search_confirm_click", params)
389 } 404 }
@@ -190,12 +190,20 @@ export struct SearchResultContentComponent { @@ -190,12 +190,20 @@ export struct SearchResultContentComponent {
190 }) 190 })
191 let isRemain : boolean = false 191 let isRemain : boolean = false
192 SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { 192 SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
193 - resultData.list.forEach((value) => { 193 + resultData.list.forEach((value: SearchResultContentItem) => {
  194 + const landscape = value.data.landscape
194 let photos: FullColumnImgUrlDTO[] = [] 195 let photos: FullColumnImgUrlDTO[] = []
195 // if (value.data.appStyle === 4) { 196 // if (value.data.appStyle === 4) {
196 value.data.appStyleImages.split("&&").forEach((value) => { 197 value.data.appStyleImages.split("&&").forEach((value) => {
197 const resizeParams = this.extractResizeParams(value) 198 const resizeParams = this.extractResizeParams(value)
198 - photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO) 199 + photos.push(
  200 + {
  201 + fullUrl: value,
  202 + weight:resizeParams.width,
  203 + height:resizeParams.height,
  204 + landscape: Number(landscape),
  205 + } as FullColumnImgUrlDTO
  206 + )
199 }) 207 })
200 // } 208 // }
201 let contentDTO = this.dataTransform(rem,value, photos); 209 let contentDTO = this.dataTransform(rem,value, photos);
@@ -213,8 +213,7 @@ export struct AccountAndSecurityLayout { @@ -213,8 +213,7 @@ export struct AccountAndSecurityLayout {
213 WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage) 213 WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage)
214 }else{ 214 }else{
215 //设置密码 215 //设置密码
216 - let pageType = {'pageType': 1} as Record<string, number>;  
217 - WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 216 + WDRouterRule.jumpWithPage(WDRouterPage.verifyPhoneNumberPage)
218 } 217 }
219 }else if (index == 3) { 218 }else if (index == 3) {
220 trackButtonClick("accountManagementPageAccountCancellation") 219 trackButtonClick("accountManagementPageAccountCancellation")
@@ -7,7 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB @@ -7,7 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB
7 import MinePageDatasModel from '../model/MinePageDatasModel'; 7 import MinePageDatasModel from '../model/MinePageDatasModel';
8 import { EmptyComponent } from '../components/view/EmptyComponent'; 8 import { EmptyComponent } from '../components/view/EmptyComponent';
9 import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; 9 import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
10 -import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; 10 +import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index';
11 11
12 const TAG = "MineHomePage" 12 const TAG = "MineHomePage"
13 13
@@ -251,6 +251,7 @@ struct MineHomePage { @@ -251,6 +251,7 @@ struct MineHomePage {
251 .animationDuration(0) 251 .animationDuration(0)
252 .onChange((index: number) => { 252 .onChange((index: number) => {
253 this.currentIndex = index 253 this.currentIndex = index
  254 + trackTabFirstClick(index === 0 ? "评论":"关注")
254 }) 255 })
255 .vertical(false) 256 .vertical(false)
256 .barHeight("77lpx") 257 .barHeight("77lpx")
@@ -437,6 +438,7 @@ struct MineHomePage { @@ -437,6 +438,7 @@ struct MineHomePage {
437 }.onClick(()=>{ 438 }.onClick(()=>{
438 this.currentIndex = index 439 this.currentIndex = index
439 this.controller.changeIndex(this.currentIndex) 440 this.controller.changeIndex(this.currentIndex)
  441 + trackTabFirstClick(index === 0 ? "评论":"关注")
440 }) 442 })
441 .height('77lpx') 443 .height('77lpx')
442 .width('70lpx') 444 .width('70lpx')
@@ -535,3 +537,12 @@ struct MineHomePage { @@ -535,3 +537,12 @@ struct MineHomePage {
535 .lineHeight('31lpx') 537 .lineHeight('31lpx')
536 } 538 }
537 539
  540 +function trackTabFirstClick(firstLevelTabName: string){
  541 + let params: ParamType = {}
  542 + params["firstLevelTabName"] = firstLevelTabName
  543 + params["pageName"] = TrackConstants.PageName.Main_Personal
  544 + params["pageId"] = TrackConstants.PageName.Main_Personal
  545 +
  546 + Tracking.event("main_personal_home_page_tab_click", params)
  547 +}
  548 +
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { Params } from 'wdBean'; 2 import { Params } from 'wdBean';
3 import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; 3 import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit';
4 -import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; 4 +import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index';
5 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; 5 import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
6 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; 6 import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent';
7 import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; 7 import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
@@ -219,6 +219,7 @@ struct OtherNormalUserHomePage { @@ -219,6 +219,7 @@ struct OtherNormalUserHomePage {
219 .animationDuration(0) 219 .animationDuration(0)
220 .onChange((index: number) => { 220 .onChange((index: number) => {
221 this.currentIndex = index 221 this.currentIndex = index
  222 + trackTabFirstClick(index === 0 ? "评论":"关注")
222 }) 223 })
223 .vertical(false) 224 .vertical(false)
224 .barHeight('77lpx') 225 .barHeight('77lpx')
@@ -370,6 +371,7 @@ struct OtherNormalUserHomePage { @@ -370,6 +371,7 @@ struct OtherNormalUserHomePage {
370 }.onClick(()=>{ 371 }.onClick(()=>{
371 this.currentIndex = index 372 this.currentIndex = index
372 this.controller.changeIndex(this.currentIndex) 373 this.controller.changeIndex(this.currentIndex)
  374 + trackTabFirstClick(index === 0 ? "评论":"关注")
373 }) 375 })
374 .height('77lpx') 376 .height('77lpx')
375 .width('70lpx') 377 .width('70lpx')
@@ -448,3 +450,13 @@ struct OtherNormalUserHomePage { @@ -448,3 +450,13 @@ struct OtherNormalUserHomePage {
448 .lineHeight('31lpx') 450 .lineHeight('31lpx')
449 } 451 }
450 452
  453 +function trackTabFirstClick(firstLevelTabName: string){
  454 + let params: ParamType = {}
  455 + params["firstLevelTabName"] = firstLevelTabName
  456 + params["pageName"] = TrackConstants.PageName.Customer_Personal
  457 + params["pageId"] = TrackConstants.PageName.Customer_Personal
  458 +
  459 + Tracking.event("customer_personal_home_page_tab_click", params)
  460 +}
  461 +
  462 +
1 import { DateTimeUtils } from 'wdKit/Index'; 1 import { DateTimeUtils } from 'wdKit/Index';
2 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; 2 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
3 import { SearchComponent } from '../components/search/SearchComponent' 3 import { SearchComponent } from '../components/search/SearchComponent'
  4 +import { router } from '@kit.ArkUI';
4 5
5 @Entry 6 @Entry
6 @Component 7 @Component
7 struct SearchPage { 8 struct SearchPage {
  9 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  10 + @State fromTabName: string = 'NEWS';
8 pageShowTime:number = 0; 11 pageShowTime:number = 0;
9 pageHideTime:number = 0; 12 pageHideTime:number = 0;
10 13
11 onPageShow() { 14 onPageShow() {
  15 + this.fromTabName = this.params?.['tabName'];
12 this.pageShowTime = DateTimeUtils.getTimeStamp() 16 this.pageShowTime = DateTimeUtils.getTimeStamp()
13 } 17 }
14 18
@@ -21,7 +25,7 @@ struct SearchPage { @@ -21,7 +25,7 @@ struct SearchPage {
21 25
22 build() { 26 build() {
23 Column(){ 27 Column(){
24 - SearchComponent() 28 + SearchComponent({fromTabName:$fromTabName})
25 }.height('100%') 29 }.height('100%')
26 .width('100%') 30 .width('100%')
27 .backgroundColor($r('app.color.white')) 31 .backgroundColor($r('app.color.white'))
@@ -177,9 +177,9 @@ export class ColorUtils { @@ -177,9 +177,9 @@ export class ColorUtils {
177 177
178 public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{ 178 public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{
179 // RGB颜色取值范围是0~255,需要转换为0~1的浮点数 179 // RGB颜色取值范围是0~255,需要转换为0~1的浮点数
180 - const red: number = color.red / MAX_RGB_VALUE;  
181 - const green: number = color.green / MAX_RGB_VALUE;  
182 - const blue: number = color.blue / MAX_RGB_VALUE; 180 + const red: number = color.red ;
  181 + const green: number = color.green ;
  182 + const blue: number = color.blue;
183 183
184 const max: number = Math.max(red, green, blue); 184 const max: number = Math.max(red, green, blue);
185 const min: number = Math.min(red, green, blue); 185 const min: number = Math.min(red, green, blue);
@@ -181,6 +181,10 @@ @@ -181,6 +181,10 @@
181 "value": "40vp" 181 "value": "40vp"
182 }, 182 },
183 { 183 {
  184 + "name": "top_tab_bar_height_common",
  185 + "value": "44vp"
  186 + },
  187 + {
184 "name": "top_tab_item_max_width", 188 "name": "top_tab_item_max_width",
185 "value": "300vp" 189 "value": "300vp"
186 }, 190 },
@@ -38,6 +38,7 @@ export struct DetailPlayLivePage { @@ -38,6 +38,7 @@ export struct DetailPlayLivePage {
38 38
39 aboutToAppear(): void { 39 aboutToAppear(): void {
40 Logger.info(TAG, `wyj-aboutToAppear`) 40 Logger.info(TAG, `wyj-aboutToAppear`)
  41 +
41 this.listener?.on("change", (mediaQueryResult) => { 42 this.listener?.on("change", (mediaQueryResult) => {
42 Logger.info(TAG, `change;${mediaQueryResult.matches}`) 43 Logger.info(TAG, `change;${mediaQueryResult.matches}`)
43 if (mediaQueryResult?.matches) { 44 if (mediaQueryResult?.matches) {
@@ -85,6 +86,7 @@ export struct DetailPlayLivePage { @@ -85,6 +86,7 @@ export struct DetailPlayLivePage {
85 } 86 }
86 .height('100%') 87 .height('100%')
87 .width('100%') 88 .width('100%')
  89 +
88 // 设置底部绘制延伸到导航条 90 // 设置底部绘制延伸到导航条
89 } 91 }
90 92
@@ -17,7 +17,7 @@ const TAG: string = 'TabLiveComponent'; @@ -17,7 +17,7 @@ const TAG: string = 'TabLiveComponent';
17 export struct TabLiveComponent { 17 export struct TabLiveComponent {
18 liveViewModel: LiveViewModel = new LiveViewModel() 18 liveViewModel: LiveViewModel = new LiveViewModel()
19 @State liveList: Array<LiveRoomItemBean> = [] 19 @State liveList: Array<LiveRoomItemBean> = []
20 - @Consume liveDetailsBean: LiveDetailsBean 20 + @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
21 @State private pageModel: PageModel = new PageModel() 21 @State private pageModel: PageModel = new PageModel()
22 22
23 aboutToAppear(): void { 23 aboutToAppear(): void {
@@ -81,6 +81,10 @@ export struct TabLiveComponent { @@ -81,6 +81,10 @@ export struct TabLiveComponent {
81 } 81 }
82 82
83 getLiveList() { 83 getLiveList() {
  84 + if (!this.liveDetailsBean || !this.liveDetailsBean.newsId) {
  85 + // 参数不够,直接拦截接口
  86 + return
  87 + }
84 this.pageModel.currentPage = 1 88 this.pageModel.currentPage = 1
85 this.liveViewModel.getLiveList( 89 this.liveViewModel.getLiveList(
86 this.pageModel.currentPage, 90 this.pageModel.currentPage,
@@ -147,4 +151,12 @@ export struct TabLiveComponent { @@ -147,4 +151,12 @@ export struct TabLiveComponent {
147 151
148 aboutToDisappear(): void { 152 aboutToDisappear(): void {
149 } 153 }
  154 +
  155 + updateData() {
  156 + if (this.liveList.length > 0) {
  157 + // TODO 拦截刷新?根据业务斟酌下
  158 + return
  159 + }
  160 + this.getLiveList()
  161 + }
150 } 162 }
@@ -21,6 +21,8 @@ export struct PlayUIComponent { @@ -21,6 +21,8 @@ export struct PlayUIComponent {
21 @State isPlayStatus: boolean = true 21 @State isPlayStatus: boolean = true
22 @Consume displayDirection: DisplayDirection 22 @Consume displayDirection: DisplayDirection
23 23
  24 + @Prop isShowBottom: boolean
  25 +
24 onChangeMenuVisible() { 26 onChangeMenuVisible() {
25 if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo || 27 if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo ||
26 this.liveDetailsBean?.liveInfo?.liveState === 'wait') { 28 this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
@@ -59,7 +61,10 @@ export struct PlayUIComponent { @@ -59,7 +61,10 @@ export struct PlayUIComponent {
59 if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { 61 if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) {
60 this.getTopUIComponent() 62 this.getTopUIComponent()
61 this.getMiddleUIComponent() 63 this.getMiddleUIComponent()
62 - this.getBottomUIComponent() 64 + if(this.isShowBottom){
  65 + this.getBottomUIComponent()
  66 + }
  67 +
63 } 68 }
64 } 69 }
65 .width('100%') 70 .width('100%')
@@ -92,7 +97,7 @@ export struct PlayUIComponent { @@ -92,7 +97,7 @@ export struct PlayUIComponent {
92 .maxLines(1) 97 .maxLines(1)
93 .textOverflow({ overflow: TextOverflow.MARQUEE }) 98 .textOverflow({ overflow: TextOverflow.MARQUEE })
94 .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') 99 .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp')
95 - .fontWeight(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 600 : 500) 100 + .fontWeight(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 600 : 500)
96 .fontColor(Color.White) 101 .fontColor(Color.White)
97 .textAlign(TextAlign.Start) 102 .textAlign(TextAlign.Start)
98 .layoutWeight(1) 103 .layoutWeight(1)
1 import { LiveDetailsBean } from 'wdBean/Index'; 1 import { LiveDetailsBean } from 'wdBean/Index';
2 import { StringUtils } from 'wdKit/Index'; 2 import { StringUtils } from 'wdKit/Index';
3 -import { WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; 3 +import { PlayerConstants, WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
4 import { PlayUIComponent } from './PlayUIComponent'; 4 import { PlayUIComponent } from './PlayUIComponent';
5 import { Logger } from 'wdKit/Index'; 5 import { Logger } from 'wdKit/Index';
  6 +import { PictureLoading } from '../../vertical/PictureLoading';
6 7
7 const TAG: string = 'TopPlayComponent' 8 const TAG: string = 'TopPlayComponent'
8 9
@@ -16,13 +17,37 @@ export struct TopPlayComponent { @@ -16,13 +17,37 @@ export struct TopPlayComponent {
16 @State isWait: boolean = false 17 @State isWait: boolean = false
17 //已结束直播 18 //已结束直播
18 @State isEnd: boolean = false 19 @State isEnd: boolean = false
  20 + //播放错误
  21 + @State isError: boolean = false
  22 + // loading 控制字段
  23 + @State isLoading: boolean = false
  24 + // 获取播放资源能播放了
  25 + @State isCanPlay: boolean = false
19 private playUrl: string = "" 26 private playUrl: string = ""
20 private xComponentIsLoaded: boolean = false 27 private xComponentIsLoaded: boolean = false
21 28
22 aboutToAppear(): void { 29 aboutToAppear(): void {
23 if (this.playerController) { 30 if (this.playerController) {
24 this.playerController.onCanplay = () => { 31 this.playerController.onCanplay = () => {
  32 +
  33 + this.isCanPlay = true
  34 + this.isLoading = true
25 this.playerController?.play() 35 this.playerController?.play()
  36 +
  37 + }
  38 +
  39 + this.playerController.onStatusChange = (status: number) => {
  40 +
  41 + if (status === PlayerConstants.STATUS_ERROR) {
  42 + this.isError = true
  43 + this.isLoading = true
  44 +
  45 + this.isCanPlay = false
  46 + } else {
  47 + this.isError = false
  48 + }
  49 +
  50 +
26 } 51 }
27 } 52 }
28 this.updateData() 53 this.updateData()
@@ -39,6 +64,9 @@ export struct TopPlayComponent { @@ -39,6 +64,9 @@ export struct TopPlayComponent {
39 Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) 64 Logger.debug(TAG, 'ok-' + `${this.imgUrl}`)
40 } 65 }
41 this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' 66 this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
  67 + if(this.isWait ){
  68 + this.isLoading = true
  69 + }
42 this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' && 70 this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
43 StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri) 71 StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)
44 if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { 72 if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
@@ -74,6 +102,8 @@ export struct TopPlayComponent { @@ -74,6 +102,8 @@ export struct TopPlayComponent {
74 WDPlayerRenderLiveView({ 102 WDPlayerRenderLiveView({
75 playerController: this.playerController, 103 playerController: this.playerController,
76 onLoad: async () => { 104 onLoad: async () => {
  105 + this.isLoading = false
  106 + this.isError = false
77 this.xComponentIsLoaded = true 107 this.xComponentIsLoaded = true
78 this.tryToPlay() 108 this.tryToPlay()
79 } 109 }
@@ -81,18 +111,56 @@ export struct TopPlayComponent { @@ -81,18 +111,56 @@ export struct TopPlayComponent {
81 .height('100%') 111 .height('100%')
82 .width('100%') 112 .width('100%')
83 .visibility(this.isWait ? Visibility.None : Visibility.Visible) 113 .visibility(this.isWait ? Visibility.None : Visibility.Visible)
  114 +
84 Image(this.imgUrl) 115 Image(this.imgUrl)
85 .objectFit(ImageFit.Cover) 116 .objectFit(ImageFit.Cover)
86 .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) 117 .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
87 .contrast(this.isEnd ? 0.2 : 1) 118 .contrast(this.isEnd ? 0.2 : 1)
88 .width('100%') 119 .width('100%')
89 - PlayUIComponent({ playerController: this.playerController }) 120 +
  121 + PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
  122 +
  123 + // 视频播放器上的控制面板和信息
  124 + PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay })
  125 +
90 Text('直播已结束') 126 Text('直播已结束')
91 .fontSize('20fp') 127 .fontSize('20fp')
92 .fontWeight(500) 128 .fontWeight(500)
93 .fontColor(Color.White) 129 .fontColor(Color.White)
94 .visibility(this.isEnd ? Visibility.Visible : 130 .visibility(this.isEnd ? Visibility.Visible :
95 Visibility.None) 131 Visibility.None)
  132 +
  133 +
  134 + Column() {
  135 +
  136 + Text('直播加载中,请稍候重试')
  137 + .fontSize('20fp')
  138 + .fontWeight(500)
  139 + .margin({ top: 16 })
  140 + .fontColor(Color.White)
  141 +
  142 + Button('点击重试')
  143 + .type(ButtonType.Normal)
  144 + .width(80)
  145 + .height(28)
  146 + .backgroundColor(Color.Transparent)
  147 + .fontColor('#ffcccccc')
  148 + .border({ width: 1 })
  149 + .borderColor('#4dffffff')
  150 + .borderRadius(4)
  151 + .fontSize($r('app.float.font_size_12'))
  152 + .margin({ top: 16 })
  153 + .padding(0)
  154 + .onClick(() => {
  155 + this.isLoading = false
  156 + this.isError = false
  157 + this.xComponentIsLoaded = true
  158 + this.tryToPlay()
  159 +
  160 + })
  161 + }.width('100%').visibility(this.isError ? Visibility.Visible :
  162 + Visibility.None)
  163 +
96 } 164 }
97 .width('100%') 165 .width('100%')
98 .alignSelf(ItemAlign.Center) 166 .alignSelf(ItemAlign.Center)
@@ -13,6 +13,11 @@ export struct PictureLoading { @@ -13,6 +13,11 @@ export struct PictureLoading {
13 Logger.info(TAG, 'pictures preview') 13 Logger.info(TAG, 'pictures preview')
14 } 14 }
15 15
  16 + aboutToDisappear(): void {
  17 + Logger.info(TAG, 'aboutToDisappear')
  18 + }
  19 +
  20 +
16 build() { 21 build() {
17 Row() { 22 Row() {
18 Image(this.imagePath) 23 Image(this.imagePath)
@@ -79,6 +79,7 @@ export struct PlayerComponent { @@ -79,6 +79,7 @@ export struct PlayerComponent {
79 playerController: this.playerController, 79 playerController: this.playerController,
80 onLoad: () => { 80 onLoad: () => {
81 this.isCanplay = true 81 this.isCanplay = true
  82 + console.error('WDAliPlayerController','------1------------')
82 this.playerController?.firstPlay(this.playUrl); 83 this.playerController?.firstPlay(this.playUrl);
83 } 84 }
84 }).margin({ top: 195 }).height(211) 85 }).margin({ top: 195 }).height(211)
1 export { add } from "./src/main/ets/utils/Calc" 1 export { add } from "./src/main/ets/utils/Calc"
2 -export { SettingPasswordParams } from "./src/main/ets/pages/login/SettingPasswordLayout" 2 +export { SettingPasswordParams } from "./src/main/ets/pages/login/SettingPasswordPage"
3 3
4 export { LoginModule } from './src/main/ets/LoginModule' 4 export { LoginModule } from './src/main/ets/LoginModule'
@@ -3,7 +3,7 @@ import { LoginInputComponent } from './LoginInputComponent' @@ -3,7 +3,7 @@ import { LoginInputComponent } from './LoginInputComponent'
3 import { LoginViewModel } from './LoginViewModel' 3 import { LoginViewModel } from './LoginViewModel'
4 import router from '@ohos.router' 4 import router from '@ohos.router'
5 import { WDRouterRule, WDRouterPage } from 'wdRouter'; 5 import { WDRouterRule, WDRouterPage } from 'wdRouter';
6 -import { SettingPasswordParams } from './SettingPasswordLayout' 6 +import { SettingPasswordParams } from './SettingPasswordPage'
7 import { Router } from '@ohos.arkui.UIContext' 7 import { Router } from '@ohos.arkui.UIContext'
8 import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, StringUtils, ToastUtils } from 'wdKit/Index' 8 import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, StringUtils, ToastUtils } from 'wdKit/Index'
9 import { SpConstants } from 'wdConstant/Index' 9 import { SpConstants } from 'wdConstant/Index'
@@ -22,7 +22,6 @@ struct ForgetPasswordPage { @@ -22,7 +22,6 @@ struct ForgetPasswordPage {
22 @State isSubmit: boolean = false //是否可以提交 默认不可以 22 @State isSubmit: boolean = false //是否可以提交 默认不可以
23 loginViewModel: LoginViewModel = new LoginViewModel() 23 loginViewModel: LoginViewModel = new LoginViewModel()
24 @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件 24 @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
25 - pageType:number = (router.getParams() as Record<string, number>)['pageType']; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2(不知道是啥)  
26 phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号 25 phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号
27 @State pageTitle:string = '找回密码'; 26 @State pageTitle:string = '找回密码';
28 @State codeStateSuccess:boolean=false 27 @State codeStateSuccess:boolean=false
@@ -57,7 +56,7 @@ struct ForgetPasswordPage { @@ -57,7 +56,7 @@ struct ForgetPasswordPage {
57 codeContent: $codeContent, 56 codeContent: $codeContent,
58 isSubmit: $isSubmit, 57 isSubmit: $isSubmit,
59 isCodeSend: $isCodeSend, 58 isCodeSend: $isCodeSend,
60 - pageType:this.pageType, 59 + pageType:0,
61 codeStateSuccess:$codeStateSuccess 60 codeStateSuccess:$codeStateSuccess
62 }) 61 })
63 Row() { 62 Row() {
@@ -81,21 +80,8 @@ struct ForgetPasswordPage { @@ -81,21 +80,8 @@ struct ForgetPasswordPage {
81 } 80 }
82 81
83 aboutToAppear() { 82 aboutToAppear() {
84 - if (router.getParams()) {  
85 - let params = router.getParams() as Record<string, number>  
86 - this.pageType = params['pageType']  
87 - Logger.info(TAG, 'params.contentID:' + params.contentID);  
88 - }  
89 - if (this.pageType == 0){  
90 - this.pageTitle = '找回密码'  
91 - if(StringUtils.isNotEmpty(this.phone) && this.phone.indexOf("****") === -1){  
92 - this.phoneContent = this.phone  
93 - }  
94 - }else if (this.pageType == 1){  
95 - this.pageTitle = '验证当前手机号'  
96 - }  
97 - if (this.isCodeSend) {  
98 - this.sendVerifyCode() 83 + if(StringUtils.isNotEmpty(this.phone) && this.phone.indexOf("****") === -1){
  84 + this.phoneContent = this.phone
99 } 85 }
100 } 86 }
101 87
@@ -105,20 +91,7 @@ struct ForgetPasswordPage { @@ -105,20 +91,7 @@ struct ForgetPasswordPage {
105 return 91 return
106 } 92 }
107 93
108 - if(this.pageType == 1){  
109 - this.loginViewModel.sendVerifyCodeByToken().then(()=>{  
110 - this.showToastTip("已发送")  
111 - this.codeStateSuccess=true  
112 - this.isCodeSend=false  
113 - }).catch((message: string)=>{  
114 - this.showToastTip(message)  
115 - this.codeStateSuccess=false  
116 - this.isCodeSend=false  
117 - })  
118 - return  
119 - }  
120 -  
121 - if(this.pageType == 0 && this.phoneContent.indexOf("****")!=-1){ 94 + if(this.phoneContent.indexOf("****")!=-1){
122 //设置密码 忘记密码跳转过来的 需要使用上面方法 95 //设置密码 忘记密码跳转过来的 需要使用上面方法
123 this.loginViewModel.sendVerifyCodeByToken().then(()=>{ 96 this.loginViewModel.sendVerifyCodeByToken().then(()=>{
124 this.showToastTip("已发送") 97 this.showToastTip("已发送")
@@ -168,22 +141,8 @@ struct ForgetPasswordPage { @@ -168,22 +141,8 @@ struct ForgetPasswordPage {
168 if (this.isEmpty(this.codeContent)) { 141 if (this.isEmpty(this.codeContent)) {
169 return 142 return
170 } 143 }
171 - if(this.pageType == 1){  
172 - this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{  
173 - let params: SettingPasswordParams = {  
174 - pageID:'1',  
175 - phoneContent:this.phoneContent,  
176 - codeContent:this.codeContent,  
177 - pageType:this.pageType  
178 - }  
179 - WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)  
180 - }).catch((message: string)=>{  
181 - this.showToastTip(message)  
182 - })  
183 - return  
184 - }  
185 144
186 - if(this.pageType == 0 && this.phoneContent.indexOf("****")!=-1){ 145 + if(this.phoneContent.indexOf("****")!=-1){
187 this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{ 146 this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
188 let params: SettingPasswordParams = { 147 let params: SettingPasswordParams = {
189 pageID:'1', 148 pageID:'1',
@@ -203,7 +162,7 @@ struct ForgetPasswordPage { @@ -203,7 +162,7 @@ struct ForgetPasswordPage {
203 pageID:'1', 162 pageID:'1',
204 phoneContent:this.phoneContent, 163 phoneContent:this.phoneContent,
205 codeContent:this.codeContent, 164 codeContent:this.codeContent,
206 - pageType:this.pageType 165 + pageType:0
207 } 166 }
208 WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params) 167 WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params)
209 168
@@ -218,53 +177,6 @@ struct ForgetPasswordPage { @@ -218,53 +177,6 @@ struct ForgetPasswordPage {
218 return (obj == undefined || obj == null || obj == ''); 177 return (obj == undefined || obj == null || obj == '');
219 } 178 }
220 179
221 - changeBindPhone(){  
222 - if (!this.isSubmit) {  
223 - return  
224 - }  
225 - if (this.isEmpty(this.phoneContent)) {  
226 - return  
227 - }  
228 - if (this.isEmpty(this.codeContent)) {  
229 - return  
230 - }  
231 - this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{  
232 - ToastUtils.shortToast('绑定成功')  
233 - this.querySecurity()  
234 - }).catch((message: string) => {  
235 - if (message != '') {  
236 - ToastUtils.shortToast(message)  
237 - }  
238 - })  
239 - }  
240 -  
241 - querySecurity(){  
242 - this.loginViewModel.querySecurity().then(()=>{  
243 - SPHelper.default.save(SpConstants.USER_PHONE,this.phoneContent)  
244 - this.sendEmitEvent()  
245 - router.back()  
246 - }).catch(()=>{  
247 -  
248 - })  
249 - }  
250 -  
251 - sendEmitEvent(){  
252 - // 定义一个eventId为1的事件,事件优先级为Low  
253 - let event: emitter.InnerEvent = {  
254 - eventId: EmitterEventId.PHONE_CHANGE_SUCCESS,  
255 - priority: emitter.EventPriority.LOW  
256 - };  
257 -  
258 - let eventData: emitter.EventData = {  
259 - data: {  
260 - content: this.phoneContent,  
261 - }  
262 - };  
263 -  
264 - // 发送eventId为1的事件,事件内容为eventData  
265 - emitter.emit(event, eventData);  
266 - }  
267 -  
268 showToastTip(msg:string){ 180 showToastTip(msg:string){
269 this.toastText = msg 181 this.toastText = msg
270 this.dialogToast.open() 182 this.dialogToast.open()
@@ -10,7 +10,7 @@ export struct LoginInputComponent { @@ -10,7 +10,7 @@ export struct LoginInputComponent {
10 @Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口 10 @Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口
11 @Link isSubmit: boolean //是否可以提交 11 @Link isSubmit: boolean //是否可以提交
12 isFirst:boolean=true//是否第一次获取验证码 12 isFirst:boolean=true//是否第一次获取验证码
13 - pageType?:number; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2 13 + pageType?:number; //0、登录->忘记密码
14 lastTime: number = 0 14 lastTime: number = 0
15 @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 15 @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
16 @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态 16 @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
@@ -33,9 +33,6 @@ export struct LoginInputComponent { @@ -33,9 +33,6 @@ export struct LoginInputComponent {
33 } 33 }
34 34
35 async aboutToAppear(){ 35 async aboutToAppear(){
36 - if (this.pageType == 1 ) {  
37 - this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;  
38 - }  
39 if(this.pageType == 0 ){ 36 if(this.pageType == 0 ){
40 let phone = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string 37 let phone = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string
41 if(StringUtils.isNotEmpty(phone)){ 38 if(StringUtils.isNotEmpty(phone)){
@@ -43,29 +40,9 @@ export struct LoginInputComponent { @@ -43,29 +40,9 @@ export struct LoginInputComponent {
43 } 40 }
44 } 41 }
45 } 42 }
  43 +
46 @Builder 44 @Builder
47 addCodeLayout() { 45 addCodeLayout() {
48 - if (this.pageType == 1){  
49 - TextInput({ text: this.securityPhone(this.phoneContent) })  
50 - .placeholderColor("#CCCCCC")  
51 - .fontSize(16)  
52 - .height(48)  
53 - .maxLength(11)  
54 - .margin({ top: 36 })  
55 - .backgroundColor("#F5F5F5")  
56 - .borderRadius(4)  
57 - .enabled(false)  
58 - .type(InputType.PhoneNumber)  
59 - .onChange((content) => {  
60 - this.phoneContent = content  
61 - this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)  
62 - if (content.length >= 11) {  
63 - this.codeBtnState = true  
64 - } else {  
65 - this.codeBtnState = false  
66 - }  
67 - })  
68 - }else{  
69 //修改密码 里面的 忘记密码(已登录) 46 //修改密码 里面的 忘记密码(已登录)
70 if(StringUtils.isNotEmpty(this.phoneContent) && this.phoneContent.indexOf("****")!=-1 && this.pageType == 0){ 47 if(StringUtils.isNotEmpty(this.phoneContent) && this.phoneContent.indexOf("****")!=-1 && this.pageType == 0){
71 TextInput({ text: this.securityPhone(this.phoneContent) }) 48 TextInput({ text: this.securityPhone(this.phoneContent) })
@@ -115,7 +92,6 @@ export struct LoginInputComponent { @@ -115,7 +92,6 @@ export struct LoginInputComponent {
115 } 92 }
116 }) 93 })
117 } 94 }
118 - }  
119 95
120 96
121 Row() { 97 Row() {
@@ -177,11 +177,10 @@ struct LoginPage { @@ -177,11 +177,10 @@ struct LoginPage {
177 .onClick(() => { 177 .onClick(() => {
178 TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) 178 TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
179 if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){ 179 if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){
180 - let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>; 180 + let pageType = { 'phone': Number(this.accountContent) } as Record<string, number>;
181 WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 181 WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
182 }else{ 182 }else{
183 - let pageType = { 'pageType': 0 } as Record<string, number>;  
184 - WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 183 + WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
185 } 184 }
186 }) 185 })
187 } 186 }
@@ -378,6 +377,7 @@ struct LoginPage { @@ -378,6 +377,7 @@ struct LoginPage {
378 TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) 377 TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
379 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { 378 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
380 Logger.debug(TAG, "requestLogin: " + data.jwtToken) 379 Logger.debug(TAG, "requestLogin: " + data.jwtToken)
  380 + this.showToastTip('登录成功')
381 ///同步兴趣tag 381 ///同步兴趣tag
382 let interestsModel = new InterestsHobbiesModel() 382 let interestsModel = new InterestsHobbiesModel()
383 interestsModel.updateInterests() 383 interestsModel.updateInterests()
@@ -29,10 +29,12 @@ struct LoginProtocolWebview { @@ -29,10 +29,12 @@ struct LoginProtocolWebview {
29 this.contentID = params.contentID 29 this.contentID = params.contentID
30 } 30 }
31 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" 31 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
  32 + this.webUrl = this.userProtocol
32 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string 33 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
33 this.webviewController.loadUrl(this.webUrl) 34 this.webviewController.loadUrl(this.webUrl)
34 35
35 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" 36 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
  37 + this.webUrl = this.privateProtocol
36 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string 38 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
37 this.webviewController.loadUrl(this.webUrl) 39 this.webviewController.loadUrl(this.webUrl)
38 }else if(params.contentID == "3"){ //注销协议 40 }else if(params.contentID == "3"){ //注销协议
@@ -166,8 +166,7 @@ struct ModifyPasswordPage { @@ -166,8 +166,7 @@ struct ModifyPasswordPage {
166 Column() { 166 Column() {
167 Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) 167 Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
168 .onClick(()=>{ 168 .onClick(()=>{
169 - let pageType = { 'pageType': 0 } as Record<string, number>;  
170 - WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 169 + WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
171 }) 170 })
172 } 171 }
173 .width('100%') 172 .width('100%')
1 -import ArrayList from '@ohos.util.ArrayList';  
2 -import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';  
3 -import router from '@ohos.router';  
4 -import { LoginViewModel } from './LoginViewModel';  
5 -import { CustomToast, Logger, SPHelper, ToastUtils } from 'wdKit';  
6 -import {  
7 - SpConstants  
8 -} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'  
9 -import data_preferences from '@ohos.data.preferences';  
10 -import { WDRouterPage, WDRouterRule } from 'wdRouter';  
11 -  
12 -const TAG = "SettingPasswordLayout"  
13 -  
14 -export interface SettingPasswordParams {  
15 - pageID: string;  
16 - phoneContent?: string;  
17 - codeContent?: string;  
18 - tempToken?:string;  
19 - pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2  
20 -}  
21 -  
22 -export default class AccoutPageDataModel {  
23 - // 页面数据  
24 - compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白  
25 - compLogo: string  
26 - compTitle: string  
27 - compSubTitle: string = '';  
28 - compDesc: string  
29 - compButtonTitle: string  
30 - inputPlacholder: string  
31 - inputTag: number  
32 -  
33 - constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) {  
34 - this.compType = compType  
35 - this.compTitle = compTitle  
36 - this.compLogo = compLogo  
37 - this.compDesc = compDesc  
38 - this.compButtonTitle = compButtonTitle  
39 - this.inputPlacholder = inputPlacholder  
40 - this.inputTag = inputTag  
41 - }  
42 -}  
43 -  
44 -@Entry  
45 -@Component  
46 -export struct SettingPasswordLayout {  
47 - @State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据  
48 - @State btnStatus: boolean = false;  
49 - pageId:number = 0;  
50 - phoneContent:string = '';  
51 - codeContent:string = '';  
52 - tempToken:string = '';  
53 -  
54 - password01: string = '';  
55 - password02: string = '';  
56 - passwordOri: string = '';  
57 - loginViewModel = new LoginViewModel()  
58 - pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机  
59 -  
60 - @State toastText:string = ""  
61 - dialogToast: CustomDialogController = new CustomDialogController({  
62 - builder: CustomToast({  
63 - msg: this.toastText,  
64 - }),  
65 - autoCancel: false,  
66 - alignment: DialogAlignment.Center,  
67 - customStyle: true,  
68 - maskColor:"#00000000"  
69 - })  
70 -  
71 - aboutToAppear() {  
72 - let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;  
73 - this.pageId = parseInt(params.pageID);  
74 - this.getPageListData(this.pageId)  
75 -  
76 - this.phoneContent = params.phoneContent!;  
77 - this.codeContent = params.codeContent!;  
78 - this.pageType = params.pageType;  
79 - }  
80 -  
81 - getPageListData(pageId:number) {  
82 - switch (pageId) {  
83 - case 0:  
84 - // 验证/更换手机号  
85 - this.listData.push(new AccoutPageDataModel(0, '更换手机号', '', '', '', '', 0))  
86 - this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010))  
87 - this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))  
88 - this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))  
89 - break;  
90 -  
91 - case 1:  
92 - // 设置密码  
93 - this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))  
94 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))  
95 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))  
96 - this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))  
97 - this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))  
98 - break;  
99 -  
100 - case 2:  
101 - // 修改密码  
102 - this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0))  
103 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010))  
104 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086))  
105 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087))  
106 - this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))  
107 - this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))  
108 - this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0))  
109 - break;  
110 -  
111 - case 3:  
112 - // 绑定手机号  
113 - this.listData.push(new AccoutPageDataModel(0, '绑定手机号', '', '', '', '', 0))  
114 - this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010))  
115 - this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))  
116 - this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))  
117 - break;  
118 -  
119 - case 4:  
120 - // 有logo的  
121 - this.listData.push(new AccoutPageDataModel(5, '', '', '', '', '' , 0))  
122 - this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0))  
123 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010))  
124 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086))  
125 - this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087))  
126 - this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))  
127 - this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))  
128 - this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))  
129 - this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0))  
130 - break;  
131 -  
132 - default:  
133 - break;  
134 - }  
135 - }  
136 -  
137 - build() {  
138 - Navigation() {  
139 - this.settingList() //滑动区域  
140 - }.titleMode(NavigationTitleMode.Mini)  
141 - .title('')  
142 - }  
143 -  
144 - // 页面布局  
145 - @Builder settingList() {  
146 - Column() {  
147 - List() {  
148 - ForEach(this.listData, (item: AccoutPageDataModel, index: number) => {  
149 - ListItem() {  
150 - if (item.compType == 0) {  
151 - this.getTitleCell(item, HorizontalAlign.Start)  
152 - } else if (item.compType == 1) {  
153 - this.getPasswordCell(item)  
154 - } else if (item.compType == 2) {  
155 - this.getCodeCell(item)  
156 - } else if (item.compType == 3) {  
157 - if (index == this.listData.length - 1) {  
158 - this.getDescCell(item, HorizontalAlign.Center)  
159 - } else {  
160 - this.getDescCell(item, HorizontalAlign.Start)  
161 - }  
162 - } else if (item.compType == 4) {  
163 - this.getButtonCell(item)  
164 - } else if (item.compType == 5) {  
165 - this.getLogoCell(item)  
166 - } else if (item.compType == 7) {  
167 - this.getPhoneCell(item)  
168 - } else {  
169 - Text('' + item.compType)  
170 - }  
171 - }  
172 - })  
173 - }  
174 - // .divider({  
175 - // strokeWidth: 1,  
176 - // startMargin: 15,  
177 - // endMargin: 10,  
178 - // color: '#f0f0f0'  
179 - // })  
180 - }.width('100%').padding('30lpx')  
181 - }  
182 -  
183 - /***************************** UI元素 ******************************************/  
184 -  
185 - // 标题  
186 - @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {  
187 - Column() {  
188 - Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)  
189 - }  
190 - .width('100%')  
191 - .height('75lpx')  
192 - .alignItems(alignTitle)  
193 - }  
194 -  
195 - // 密码输入框  
196 - @Builder getPasswordCell(item: AccoutPageDataModel) {  
197 - Row() {  
198 - Row() {  
199 - TextInput({ placeholder: item.inputPlacholder })  
200 - .placeholderColor("#CCCCCC")  
201 - .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})  
202 - .type(InputType.Password)  
203 - .showPasswordIcon(true)  
204 - .backgroundColor('#00000000')  
205 - .onChange((value: string) => {  
206 - this.inputTextChange(value, item.inputTag)  
207 - })  
208 - .onSubmit((EnterKeyType) => {  
209 - this.showToastTip('submit')  
210 - })  
211 - }  
212 - .alignItems(VerticalAlign.Center)  
213 - .height('80lpx')  
214 - .backgroundColor('#f5f5f5')  
215 - .borderRadius('4vp')  
216 - }  
217 - .width('100%')  
218 - .height('110lpx')  
219 - .backgroundColor(0xffffff0)  
220 - .alignItems(VerticalAlign.Center)  
221 - }  
222 -  
223 - // 手机号输入框  
224 - @Builder getPhoneCell(item: AccoutPageDataModel) {  
225 - Row() {  
226 - Row() {  
227 - TextInput({ placeholder: item.inputPlacholder })  
228 - .placeholderColor("#CCCCCC")  
229 - .backgroundColor('#00000000')  
230 - .onChange((value: string) => {  
231 - this.inputTextChange(value, item.inputTag)  
232 - })  
233 - .onSubmit((EnterKeyType) => {  
234 - this.showToastTip('submit')  
235 - })  
236 - }  
237 - .alignItems(VerticalAlign.Center)  
238 - .height('80lpx')  
239 - .backgroundColor('#f5f5f5')  
240 - .borderRadius('4vp')  
241 - }  
242 - .width('100%')  
243 - .height('110lpx')  
244 - .backgroundColor(0xffffff0)  
245 - .alignItems(VerticalAlign.Center)  
246 - }  
247 -  
248 - // 验证码码输入框  
249 - @Builder getCodeCell(item: AccoutPageDataModel) {  
250 - Row() {  
251 - Stack() {  
252 - Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp')  
253 - Row() {  
254 - TextInput({ placeholder: item.inputPlacholder })  
255 - .placeholderColor("#CCCCCC")  
256 - .backgroundColor('#00000000')  
257 - .width('67.28%')  
258 - .onChange((value: string) => {  
259 - this.inputTextChange(value, item.inputTag)  
260 - })  
261 - Button('发送验证码')  
262 - .width('32.71%')  
263 - .backgroundColor('#00000000')  
264 - .fontColor('#da3e22')  
265 - }  
266 - .width('100%')  
267 - }.height('80lpx')  
268 - }  
269 - .width('100%')  
270 - .height('110lpx')  
271 - .backgroundColor(0xffffff0)  
272 - .alignItems(VerticalAlign.Center)  
273 - }  
274 -  
275 - // desc  
276 - @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {  
277 - Column() {  
278 - Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})  
279 - .onClick(()=>{  
280 - if (item.compDesc == '忘记密码') {  
281 - this.showToastTip('密码不符合密码规范')  
282 - }  
283 - })  
284 - }  
285 - .width('100%')  
286 - .height('85lpx')  
287 - .alignItems(alignTitle)  
288 - }  
289 -  
290 - // 按钮  
291 - @Builder getButtonCell(item: AccoutPageDataModel) {  
292 - Row() {  
293 - Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })  
294 - .width('100%')  
295 - .height('80lpx')  
296 - .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')  
297 - .fontColor('#fff')  
298 - .borderRadius('4vp')  
299 - .onClick(() => {  
300 - this.buttonClick()  
301 - })  
302 - }  
303 - .padding({top:'25lpx'})  
304 - .alignItems(VerticalAlign.Center)  
305 - .width('100%')  
306 - .height('120lpx')  
307 - }  
308 -  
309 - // 标题  
310 - @Builder getLogoCell(item: AccoutPageDataModel) {  
311 - Column() {  
312 - Image(item.compLogo).height('150lpx').width('150lpx')  
313 - }  
314 - .width('100%')  
315 - .height('200lpx')  
316 - }  
317 -  
318 - /***************************** 事件处理 ******************************************/  
319 - // 提交按钮点击事件  
320 - async buttonClick() {  
321 - if (this.btnStatus) {  
322 - // 需要+手机号校验  
323 - if (this.password01.length < 6 || this.password01.length > 20) {  
324 - this.showToastTip('密码不符合密码规范')  
325 - return  
326 - }  
327 - if (this.password01 != this.password02) {  
328 - this.showToastTip('两次输入的密码不一致,请重新输入')  
329 - return  
330 - }  
331 - if(this.pageId == 1){ //设置密码  
332 - SPHelper.default.get(SpConstants.USER_TEMP_TOKEN, '').then((str) => {  
333 - this.loginViewModel.forgotPassword(this.password01, str.toString()).then((data =>{  
334 - if (this.pageType == 0) {//登录页  
335 - this.showToastTip("修改成功")  
336 - router.back({  
337 - url: `${WDRouterPage.getLoginBundleInfo()}`  
338 - })  
339 - }else if(this.pageType == 1){//设置  
340 - let params: Params = {  
341 - pageID: 'AccountAndSecurityLayout'  
342 - }  
343 - this.showToastTip("修改成功")  
344 - router.back({  
345 - params:params,  
346 - url: `${WDRouterPage.getSettingBundleInfo()}`  
347 - })  
348 - // WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params)  
349 - }  
350 - }))  
351 - .catch((err: string) => {  
352 - this.showToastTip(err)  
353 - });  
354 - }).catch((err: string) => {  
355 - this.showToastTip(err)  
356 - Logger.error(TAG, 'catch err:' + JSON.stringify(err));  
357 - });  
358 - }  
359 - }  
360 -  
361 -  
362 - }  
363 -  
364 - // 输入框数据变动:输入数据处理  
365 - inputTextChange(text: string, tag: number) {  
366 - if (tag == 10086) {  
367 - this.password01 = text;  
368 - } else if (tag == 10087) {  
369 - this.password02 = text;  
370 - } else {  
371 - this.passwordOri = text;  
372 - }  
373 -  
374 - if (this.password01) {  
375 - if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) {  
376 - this.btnStatus = true;  
377 - } else {  
378 - this.btnStatus = false;  
379 - }  
380 - }  
381 - }  
382 -  
383 - showToastTip(msg:string){  
384 - this.toastText = msg  
385 - this.dialogToast.open()  
386 - }  
387 -}  
388 -  
1 -import { SettingPasswordLayout } from './SettingPasswordLayout'; 1 +import ArrayList from '@ohos.util.ArrayList';
  2 +import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
  3 +import router from '@ohos.router';
  4 +import { LoginViewModel } from './LoginViewModel';
  5 +import { CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit';
  6 +import {
  7 + SpConstants
  8 +} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
  9 +import data_preferences from '@ohos.data.preferences';
  10 +import { WDRouterPage, WDRouterRule } from 'wdRouter';
  11 +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
  12 +
  13 +const TAG = "SettingPasswordLayout"
  14 +
  15 +export interface SettingPasswordParams {
  16 + pageID: string;
  17 + phoneContent?: string;
  18 + codeContent?: string;
  19 + tempToken?:string;
  20 + pageType?:number; //0、登录->忘记密码 1、设置->重置密码
  21 +}
  22 +
  23 +export default class AccoutPageDataModel {
  24 + // 页面数据
  25 + compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白
  26 + compLogo: string
  27 + compTitle: string
  28 + compSubTitle: string = '';
  29 + compDesc: string
  30 + compButtonTitle: string
  31 + inputPlacholder: string
  32 + inputTag: number
  33 +
  34 + constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) {
  35 + this.compType = compType
  36 + this.compTitle = compTitle
  37 + this.compLogo = compLogo
  38 + this.compDesc = compDesc
  39 + this.compButtonTitle = compButtonTitle
  40 + this.inputPlacholder = inputPlacholder
  41 + this.inputTag = inputTag
  42 + }
  43 +}
2 44
3 @Entry 45 @Entry
4 @Component 46 @Component
5 -struct SettingPasswordPage {  
6 - @State message: string = 'Hello World' 47 +export struct SettingPasswordPage {
  48 + @State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据
  49 + @State btnStatus: boolean = false;
  50 + pageId:number = 0;
  51 + phoneContent:string = '';
  52 + codeContent:string = '';
  53 + tempToken:string = '';
  54 +
  55 + password01: string = '';
  56 + password02: string = '';
  57 + passwordOri: string = '';
  58 + loginViewModel = new LoginViewModel()
  59 + pageType?:number; //0、登录->忘记密码 1、设置->重置密码
  60 +
  61 + @State toastText:string = ""
  62 + dialogToast: CustomDialogController = new CustomDialogController({
  63 + builder: CustomToast({
  64 + msg: this.toastText,
  65 + }),
  66 + autoCancel: false,
  67 + alignment: DialogAlignment.Center,
  68 + customStyle: true,
  69 + maskColor:"#00000000"
  70 + })
  71 +
  72 + pageShowResetTime:number = 0;
  73 + pageHideResetTime:number = 0;
  74 + pageShowSetTime:number = 0;
  75 + pageHideSetTime:number = 0;
  76 +
  77 + onPageShow(): void {
  78 + if (this.pageType === 0){//重置密码
  79 + this.pageShowResetTime = DateTimeUtils.getTimeStamp()
  80 + }else{
  81 + this.pageShowSetTime = DateTimeUtils.getTimeStamp()
  82 + }
  83 + }
  84 +
  85 + onPageHide(): void {
  86 + if (this.pageType === 0){
  87 + this.pageHideResetTime = DateTimeUtils.getTimeStamp()
  88 + }else{
  89 + this.pageHideSetTime = DateTimeUtils.getTimeStamp()
  90 + }
  91 +
  92 + let duration = 0
  93 + if(this.pageType === 0){
  94 + duration = Math.floor((this.pageHideResetTime - this.pageShowResetTime)/1000)
  95 + }else{
  96 + duration = Math.floor((this.pageHideSetTime - this.pageShowSetTime)/1000)
  97 + }
  98 +
  99 + if(this.pageType === 0){
  100 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Reset_Password,TrackConstants.PageName.Reset_Password,duration)
  101 + }else{
  102 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd,duration)
  103 + }
  104 + }
  105 +
  106 + aboutToAppear() {
  107 + let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
  108 + this.pageId = parseInt(params.pageID);
  109 + this.getPageListData(this.pageId)
  110 +
  111 + this.phoneContent = params.phoneContent!;
  112 + this.codeContent = params.codeContent!;
  113 + this.pageType = params.pageType;
  114 + }
  115 +
  116 + getPageListData(pageId:number) {
  117 + switch (pageId) {
  118 + case 0:
  119 + break;
  120 + case 1:
  121 + // 设置密码
  122 + this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))
  123 + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))
  124 + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))
  125 + this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
  126 + this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
  127 + break;
  128 + case 2:
  129 + break;
  130 + case 3:
  131 + break;
  132 + case 4:
  133 + break;
  134 + }
  135 + }
7 136
8 build() { 137 build() {
  138 + Navigation() {
  139 + this.settingList() //滑动区域
  140 + }.titleMode(NavigationTitleMode.Mini)
  141 + .title('')
  142 + }
  143 +
  144 + // 页面布局
  145 + @Builder settingList() {
  146 + Column() {
  147 + List() {
  148 + ForEach(this.listData, (item: AccoutPageDataModel, index: number) => {
  149 + ListItem() {
  150 + if (item.compType == 0) {
  151 + this.getTitleCell(item, HorizontalAlign.Start)
  152 + } else if (item.compType == 1) {
  153 + this.getPasswordCell(item)
  154 + } else if (item.compType == 2) {
  155 + this.getCodeCell(item)
  156 + } else if (item.compType == 3) {
  157 + if (index == this.listData.length - 1) {
  158 + this.getDescCell(item, HorizontalAlign.Center)
  159 + } else {
  160 + this.getDescCell(item, HorizontalAlign.Start)
  161 + }
  162 + } else if (item.compType == 4) {
  163 + this.getButtonCell(item)
  164 + } else if (item.compType == 5) {
  165 + this.getLogoCell(item)
  166 + } else if (item.compType == 7) {
  167 + this.getPhoneCell(item)
  168 + } else {
  169 + Text('' + item.compType)
  170 + }
  171 + }
  172 + })
  173 + }
  174 + }.width('100%')
  175 + .padding('30lpx')
  176 + .height('100%')
  177 + }
  178 +
  179 + /***************************** UI元素 ******************************************/
  180 +
  181 + // 标题
  182 + @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
  183 + Column() {
  184 + Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
  185 + }
  186 + .width('100%')
  187 + .height('75lpx')
  188 + .alignItems(alignTitle)
  189 + }
  190 +
  191 + // 密码输入框
  192 + @Builder getPasswordCell(item: AccoutPageDataModel) {
9 Row() { 193 Row() {
10 - Column() {  
11 - SettingPasswordLayout() 194 + Row() {
  195 + TextInput({ placeholder: item.inputPlacholder })
  196 + .placeholderColor("#CCCCCC")
  197 + .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
  198 + .type(InputType.Password)
  199 + .showPasswordIcon(true)
  200 + .backgroundColor('#00000000')
  201 + .onChange((value: string) => {
  202 + this.inputTextChange(value, item.inputTag)
  203 + })
  204 + .onSubmit((EnterKeyType) => {
  205 + this.showToastTip('submit')
  206 + })
12 } 207 }
13 - .width('100%') 208 + .alignItems(VerticalAlign.Center)
  209 + .height('80lpx')
  210 + .backgroundColor('#f5f5f5')
  211 + .borderRadius('4vp')
14 } 212 }
15 - .height('100%') 213 + .width('100%')
  214 + .height('110lpx')
  215 + .backgroundColor(0xffffff0)
  216 + .alignItems(VerticalAlign.Center)
  217 + }
  218 +
  219 + // 手机号输入框
  220 + @Builder getPhoneCell(item: AccoutPageDataModel) {
  221 + Row() {
  222 + Row() {
  223 + TextInput({ placeholder: item.inputPlacholder })
  224 + .placeholderColor("#CCCCCC")
  225 + .backgroundColor('#00000000')
  226 + .onChange((value: string) => {
  227 + this.inputTextChange(value, item.inputTag)
  228 + })
  229 + .onSubmit((EnterKeyType) => {
  230 + this.showToastTip('submit')
  231 + })
  232 + }
  233 + .alignItems(VerticalAlign.Center)
  234 + .height('80lpx')
  235 + .backgroundColor('#f5f5f5')
  236 + .borderRadius('4vp')
  237 + }
  238 + .width('100%')
  239 + .height('110lpx')
  240 + .backgroundColor(0xffffff0)
  241 + .alignItems(VerticalAlign.Center)
  242 + }
  243 +
  244 + // 验证码码输入框
  245 + @Builder getCodeCell(item: AccoutPageDataModel) {
  246 + Row() {
  247 + Stack() {
  248 + Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp')
  249 + Row() {
  250 + TextInput({ placeholder: item.inputPlacholder })
  251 + .placeholderColor("#CCCCCC")
  252 + .backgroundColor('#00000000')
  253 + .width('67.28%')
  254 + .onChange((value: string) => {
  255 + this.inputTextChange(value, item.inputTag)
  256 + })
  257 + Button('发送验证码')
  258 + .width('32.71%')
  259 + .backgroundColor('#00000000')
  260 + .fontColor('#da3e22')
  261 + }
  262 + .width('100%')
  263 + }.height('80lpx')
  264 + }
  265 + .width('100%')
  266 + .height('110lpx')
  267 + .backgroundColor(0xffffff0)
  268 + .alignItems(VerticalAlign.Center)
  269 + }
  270 +
  271 + // desc
  272 + @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
  273 + Column() {
  274 + Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
  275 + .onClick(()=>{
  276 + if (item.compDesc == '忘记密码') {
  277 + this.showToastTip('密码不符合密码规范')
  278 + }
  279 + })
  280 + }
  281 + .width('100%')
  282 + .height('85lpx')
  283 + .alignItems(alignTitle)
  284 + }
  285 +
  286 + // 按钮
  287 + @Builder getButtonCell(item: AccoutPageDataModel) {
  288 + Row() {
  289 + Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })
  290 + .width('100%')
  291 + .height('80lpx')
  292 + .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
  293 + .fontColor('#fff')
  294 + .borderRadius('4vp')
  295 + .onClick(() => {
  296 + this.buttonClick()
  297 + })
  298 + }
  299 + .padding({top:'25lpx'})
  300 + .alignItems(VerticalAlign.Center)
  301 + .width('100%')
  302 + .height('120lpx')
  303 + }
  304 +
  305 + // 标题
  306 + @Builder getLogoCell(item: AccoutPageDataModel) {
  307 + Column() {
  308 + Image(item.compLogo).height('150lpx').width('150lpx')
  309 + }
  310 + .width('100%')
  311 + .height('200lpx')
16 } 312 }
17 -}  
  313 +
  314 + /***************************** 事件处理 ******************************************/
  315 + // 提交按钮点击事件
  316 + async buttonClick() {
  317 + if (this.btnStatus) {
  318 + if(this.pageType === 0){
  319 + TrackingButton.click("resetPasswordPageConfirmButton",TrackConstants.PageName.Reset_Password,TrackConstants.PageName.Reset_Password)
  320 + }else{
  321 + TrackingButton.click("setPasswordPageConfirm",TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd)
  322 + }
  323 + // 需要+手机号校验
  324 + if (this.password01.length < 6 || this.password01.length > 20) {
  325 + this.showToastTip('密码不符合密码规范')
  326 + return
  327 + }
  328 + if (this.password01 != this.password02) {
  329 + this.showToastTip('两次输入的密码不一致,请重新输入')
  330 + return
  331 + }
  332 + if(this.pageId == 1){ //设置密码
  333 + SPHelper.default.get(SpConstants.USER_TEMP_TOKEN, '').then((str) => {
  334 + this.loginViewModel.forgotPassword(this.password01, str.toString()).then((data =>{
  335 + if (this.pageType == 0) {//登录页
  336 + this.showToastTip("修改成功")
  337 + router.back({
  338 + url: `${WDRouterPage.getLoginBundleInfo()}`
  339 + })
  340 + }else if(this.pageType == 1){//设置
  341 + let params: Params = {
  342 + pageID: 'AccountAndSecurityLayout'
  343 + }
  344 + this.showToastTip("修改成功")
  345 + router.back({
  346 + params:params,
  347 + url: `${WDRouterPage.getSettingBundleInfo()}`
  348 + })
  349 + }
  350 + }))
  351 + .catch((err: string) => {
  352 + this.showToastTip(err)
  353 + });
  354 + }).catch((err: string) => {
  355 + this.showToastTip(err)
  356 + Logger.error(TAG, 'catch err:' + JSON.stringify(err));
  357 + });
  358 + }
  359 + }
  360 +
  361 +
  362 + }
  363 +
  364 + // 输入框数据变动:输入数据处理
  365 + inputTextChange(text: string, tag: number) {
  366 + if (tag == 10086) {
  367 + this.password01 = text;
  368 + } else if (tag == 10087) {
  369 + this.password02 = text;
  370 + } else {
  371 + this.passwordOri = text;
  372 + }
  373 +
  374 + if (this.password01) {
  375 + if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) {
  376 + this.btnStatus = true;
  377 + } else {
  378 + this.btnStatus = false;
  379 + }
  380 + }
  381 + }
  382 +
  383 + showToastTip(msg:string){
  384 + this.toastText = msg
  385 + this.dialogToast.open()
  386 + }
  387 +}
  388 +
  1 +import { CustomToast, DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'
  2 +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
  3 +import { LoginViewModel } from './LoginViewModel'
  4 +import { SettingPasswordParams } from './SettingPasswordPage'
  5 +import { router } from '@kit.ArkUI'
  6 +import { SpConstants } from 'wdConstant/Index'
  7 +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
  8 +
  9 +const TAG = 'VerifyPhoneNumberPage'
  10 +//设置密码(第一次) 验证当前手机号 页面
  11 +@Entry
  12 +@Component
  13 +struct VerifyPhoneNumberPage {
  14 + @State phoneContent: string = ''
  15 + @State codeContent: string = ''
  16 + @State isSubmit: boolean = false //是否可以提交 默认不可以
  17 + loginViewModel: LoginViewModel = new LoginViewModel()
  18 + @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
  19 + @State pageTitle:string = '验证当前手机号';
  20 + @State @Watch('startCount') codeStateSuccess:boolean=false
  21 + lastTime: number = 0
  22 + @State codeBtnState: boolean = false
  23 + @State timeCount: number = 60
  24 + isFirst:boolean=true//是否第一次获取验证码
  25 + pageShowTime:number = 0;
  26 + pageHideTime:number = 0;
  27 +
  28 + onCodeSend() {
  29 + if (this.isCodeSend) {
  30 + TrackingButton.click("checkingPhoneNumberPageSendVerificationCode",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
  31 + this.sendVerifyCode()
  32 + }
  33 + }
  34 +
  35 + onPageShow() {
  36 + this.pageShowTime = DateTimeUtils.getTimeStamp()
  37 + }
  38 +
  39 + onPageHide(): void {
  40 + this.pageHideTime = DateTimeUtils.getTimeStamp()
  41 + let duration = 0
  42 + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
  43 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum,duration)
  44 + }
  45 +
  46 + async aboutToAppear(): Promise<void> {
  47 + this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
  48 + }
  49 +
  50 + @State toastText:string = ""
  51 + dialogToast: CustomDialogController = new CustomDialogController({
  52 + builder: CustomToast({
  53 + msg: this.toastText,
  54 + }),
  55 + autoCancel: false,
  56 + alignment: DialogAlignment.Center,
  57 + customStyle: true,
  58 + maskColor:"#00000000"
  59 + })
  60 +
  61 +
  62 + build() {
  63 + Column() {
  64 + Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
  65 + router.back()
  66 + })
  67 +
  68 + Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 })
  69 +
  70 + Column() {
  71 + TextInput({ text: this.securityPhone(this.phoneContent) })
  72 + .placeholderColor("#CCCCCC")
  73 + .fontSize(16)
  74 + .height(48)
  75 + .maxLength(11)
  76 + .margin({ top: 36 })
  77 + .backgroundColor("#F5F5F5")
  78 + .borderRadius(4)
  79 + .enabled(false)
  80 + .type(InputType.PhoneNumber)
  81 + .onChange((content) => {
  82 + this.phoneContent = content
  83 + this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
  84 + if (content.length >= 11) {
  85 + this.codeBtnState = true
  86 + } else {
  87 + this.codeBtnState = false
  88 + }
  89 + })
  90 +
  91 + Row() {
  92 + TextInput({ text: this.codeContent,placeholder: "验证码" })
  93 + .placeholderColor("#CCCCCC")
  94 + .layoutWeight(1)
  95 + .fontSize(16)
  96 + .height(48)
  97 + .type(InputType.Number)
  98 + .fontColor("#222222")
  99 + .backgroundColor("#00000000")
  100 + .borderRadius({ topLeft: 4, bottomLeft: 4 })
  101 + .onChange((value) => {
  102 + this.codeContent = value
  103 + this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
  104 + })
  105 +
  106 + Text(this.codeStateSuccess ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新获取')
  107 + .fontColor(this.codeBtnState?'#ED2800':'#80ED2800')
  108 + .width(110)
  109 + .fontSize(14)
  110 + .fontWeight( FontWeight.Bold)
  111 + .height(48)
  112 + .textAlign(TextAlign.Center)
  113 + .enabled(this.codeStateSuccess?false:true)
  114 + .onClick(() => {
  115 + if (this.phoneContent.length < 11) {
  116 + return
  117 + }
  118 +
  119 + let currentTime = DateTimeUtils.getTimeStamp()
  120 + if (currentTime - this.lastTime < 500) {
  121 + return
  122 + }
  123 + this.lastTime = currentTime;
  124 + this.isCodeSend = true
  125 +
  126 + })
  127 +
  128 +
  129 + }.margin({ top: 12 })
  130 + .height(48)
  131 + .alignItems(VerticalAlign.Center)
  132 + .justifyContent(FlexAlign.Start)
  133 + .backgroundImage($r('app.media.code_login_bg'))
  134 + .backgroundImageSize({width:'100%',height:48})
  135 +
  136 +
  137 +
  138 + }.width('100%').padding({ left: 25, right: 25 })
  139 +
  140 + Row() {
  141 + Text("确认")
  142 + .layoutWeight(1)
  143 + .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
  144 + .borderRadius(4)
  145 + .fontSize(18)
  146 + .textAlign(TextAlign.Center)
  147 + .fontWeight(FontWeight.Medium)
  148 + .margin({ top: 26 })
  149 + .height(44)
  150 + .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
  151 + .enabled(this.isSubmit ? true : false)
  152 + .onClick(() => {
  153 + this.checkVerifyCode()
  154 + })
  155 + }.padding({ left: 25, right: 25 }).width('100%')
  156 +
  157 + }.width('100%').height('100%').alignItems(HorizontalAlign.Start)
  158 + }
  159 +
  160 + //发送验证码
  161 + sendVerifyCode() {
  162 + if (this.isEmpty(this.phoneContent)) {
  163 + return
  164 + }
  165 +
  166 + this.loginViewModel.sendVerifyCodeByToken().then(()=>{
  167 + this.showToastTip("已发送")
  168 + this.codeStateSuccess=true
  169 + this.isCodeSend=false
  170 + }).catch((message: string)=>{
  171 + this.showToastTip(message)
  172 + this.codeStateSuccess=false
  173 + this.isCodeSend=false
  174 + })
  175 + }
  176 +
  177 +
  178 + //校验验证码
  179 + checkVerifyCode() {
  180 + TrackingButton.click("checkingPhoneNumberPageConfirm",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
  181 + if (!this.isSubmit) {
  182 + return
  183 + }
  184 + if (this.isEmpty(this.phoneContent)) {
  185 + return
  186 + }
  187 + if (this.isEmpty(this.codeContent)) {
  188 + return
  189 + }
  190 +
  191 + this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
  192 + let params: SettingPasswordParams = {
  193 + pageID:'1',
  194 + phoneContent:this.phoneContent,
  195 + codeContent:this.codeContent,
  196 + pageType:1
  197 + }
  198 + WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
  199 + }).catch((message: string)=>{
  200 + this.showToastTip(message)
  201 + })
  202 + }
  203 +
  204 + isEmpty(obj: undefined|null|string): boolean {
  205 + return (obj == undefined || obj == null || obj == '');
  206 + }
  207 +
  208 + showToastTip(msg:string){
  209 + this.toastText = msg
  210 + this.dialogToast.open()
  211 + }
  212 +
  213 + securityPhone(phoneNum:string):string{
  214 + let securityNum:string;
  215 + let needSecurityString = phoneNum.substring(3, phoneNum.length - 4);
  216 + securityNum = phoneNum.replace(needSecurityString,'****')
  217 + return securityNum;
  218 + }
  219 +
  220 + startCount() {
  221 + this.isFirst = false
  222 + let time = setInterval(() => {
  223 + Logger.debug("倒计时:" + this.timeCount)
  224 + this.timeCount--
  225 + if (this.timeCount < 1) {
  226 + this.codeStateSuccess = false
  227 + this.timeCount = 60
  228 + clearInterval(time)
  229 + }
  230 + }, 1000)
  231 + }
  232 +}
@@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
5 "pages/login/ForgetPasswordPage", 5 "pages/login/ForgetPasswordPage",
6 "pages/login/LoginProtocolWebview", 6 "pages/login/LoginProtocolWebview",
7 "pages/login/SettingPasswordPage", 7 "pages/login/SettingPasswordPage",
8 - "pages/login/SettingPasswordLayout",  
9 "pages/guide/GuidePages", 8 "pages/guide/GuidePages",
10 "pages/login/OneKeyLoginPage", 9 "pages/login/OneKeyLoginPage",
11 "pages/login/ModifyPasswordPage", 10 "pages/login/ModifyPasswordPage",
12 - "pages/login/ChangeBindPhonePage" 11 + "pages/login/ChangeBindPhonePage",
  12 + "pages/login/VerifyPhoneNumberPage"
13 ] 13 ]
14 } 14 }
@@ -2,7 +2,8 @@ export namespace TrackConstants { @@ -2,7 +2,8 @@ export namespace TrackConstants {
2 2
3 export enum EventType { 3 export enum EventType {
4 Show = 0, 4 Show = 0,
5 - Click = 1 5 + Click = 1,
  6 + CurrentNumberPanelContentExposure = 2,
6 } 7 }
7 8
8 // 行为类型 9 // 行为类型
@@ -24,7 +25,8 @@ export namespace TrackConstants { @@ -24,7 +25,8 @@ export namespace TrackConstants {
24 UnSubscribe = "unSubscribe", 25 UnSubscribe = "unSubscribe",
25 CloseInterestCard = "closeInterestCard", 26 CloseInterestCard = "closeInterestCard",
26 SelectInterestCard = "selectInterestCard", 27 SelectInterestCard = "selectInterestCard",
27 - 28 + //电子报当前页曝光
  29 + CurrentNumberPanelContentExposure = "current_Number_Panel_content_exposure",
28 } 30 }
29 31
30 // 分享聚道 32 // 分享聚道
@@ -208,5 +210,11 @@ export namespace TrackConstants { @@ -208,5 +210,11 @@ export namespace TrackConstants {
208 210
209 ///兴趣偏好页 211 ///兴趣偏好页
210 Interest = "preferenceSelectionPage", 212 Interest = "preferenceSelectionPage",
  213 + //意见反馈
  214 + FeedbackPage = 'feedbackPage',
  215 + //动态详情
  216 + DynamicDetailPage = 'dynamicDetailPage',
  217 + //早晚报
  218 + NewsPaperPage = 'newsPaperPage',
211 } 219 }
212 } 220 }
@@ -22,7 +22,15 @@ export class TrackParamConvert { @@ -22,7 +22,15 @@ export class TrackParamConvert {
22 22
23 static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { 23 static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
24 let params = TrackingUtils.generateParams() 24 let params = TrackingUtils.generateParams()
25 - 25 + if (program) {
  26 + params["contentType"] = program.objectType
  27 + params["contentId"] = program.objectId
  28 + params["contentName"] = program.newsTitle
  29 + params["channelSourceId"] = program.channelId
  30 + params["rmhPlatform"] = program.rmhPlatform
  31 +
  32 + TrackParamConvert.appendRecommend(program, params)
  33 + }
26 //TODO: 转换参数 34 //TODO: 转换参数
27 35
28 return params 36 return params
@@ -16,6 +16,13 @@ export class TrackingButton { @@ -16,6 +16,13 @@ export class TrackingButton {
16 Tracking.event("name_click", params) 16 Tracking.event("name_click", params)
17 } 17 }
18 18
  19 + static searchClick( pageId: string, pageName: string, extParams?: ParamType) {
  20 + let params = TrackingUtils.generateParams(extParams)
19 21
  22 + params["pageId"] = pageId
  23 + params["pageName"] = pageName
  24 +
  25 + Tracking.event("search_button_click ", params)
  26 + }
20 27
21 } 28 }
@@ -29,6 +29,10 @@ export class TrackingContent { @@ -29,6 +29,10 @@ export class TrackingContent {
29 params["action"] = TrackConstants.ActionType.Show 29 params["action"] = TrackConstants.ActionType.Show
30 TrackingUtils.fillPositionWith(params) 30 TrackingUtils.fillPositionWith(params)
31 Tracking.event("content_exposure", params) 31 Tracking.event("content_exposure", params)
  32 + }else if(eventType === TrackConstants.EventType.CurrentNumberPanelContentExposure){
  33 + params["action"] = TrackConstants.ActionType.Show
  34 + TrackingUtils.fillPositionWith(params)
  35 + Tracking.event(TrackConstants.ActionType.CurrentNumberPanelContentExposure, params)
32 } 36 }
33 } 37 }
34 38
@@ -82,6 +86,10 @@ export class TrackingContent { @@ -82,6 +86,10 @@ export class TrackingContent {
82 } 86 }
83 87
84 static commentClick(pageId: string, pageName: string, extParams?: ParamType) { 88 static commentClick(pageId: string, pageName: string, extParams?: ParamType) {
  89 + TrackingContent.commentClickWithEvent("content_comment_click",pageId,pageName,extParams);
  90 + }
  91 +
  92 + static commentClickWithEvent(event: string,pageId: string, pageName: string, extParams?: ParamType) {
85 let params = TrackingUtils.generateParams(extParams) 93 let params = TrackingUtils.generateParams(extParams)
86 if (pageId.length) { 94 if (pageId.length) {
87 params["pageId"] = pageId 95 params["pageId"] = pageId
@@ -91,7 +99,7 @@ export class TrackingContent { @@ -91,7 +99,7 @@ export class TrackingContent {
91 } 99 }
92 params["action"] =TrackConstants.ActionType.Comment 100 params["action"] =TrackConstants.ActionType.Comment
93 TrackingUtils.fillPositionWith(params) 101 TrackingUtils.fillPositionWith(params)
94 - Tracking.event("content_comment_click", params) 102 + Tracking.event(event, params)
95 } 103 }
96 104
97 static commentShare(pageId: string, pageName: string, extParams?: ParamType) { 105 static commentShare(pageId: string, pageName: string, extParams?: ParamType) {
@@ -2,7 +2,7 @@ import { ENewspaperPageComponent } from 'wdComponent'; @@ -2,7 +2,7 @@ import { ENewspaperPageComponent } from 'wdComponent';
2 import { DateTimeUtils, Logger } from 'wdKit'; 2 import { DateTimeUtils, Logger } from 'wdKit';
3 import common from '@ohos.app.ability.common'; 3 import common from '@ohos.app.ability.common';
4 import window from '@ohos.window'; 4 import window from '@ohos.window';
5 -import { TrackingPageBrowse } from 'wdTracking/Index'; 5 +import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index';
6 6
7 const TAG = 'ENewspaper'; 7 const TAG = 'ENewspaper';
8 8
@@ -10,8 +10,6 @@ const TAG = 'ENewspaper'; @@ -10,8 +10,6 @@ const TAG = 'ENewspaper';
10 @Component 10 @Component
11 struct ENewspaper { 11 struct ENewspaper {
12 pageShowTime:number = 0; 12 pageShowTime:number = 0;
13 - pageId:string = 'newsPaperPage';  
14 - pageName:string=this.pageId;  
15 // 获取UIAbility上下文 13 // 获取UIAbility上下文
16 context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext 14 context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
17 15
@@ -59,7 +57,7 @@ struct ENewspaper { @@ -59,7 +57,7 @@ struct ENewspaper {
59 this.setSystemBar('#FFFFFFFF','#00000000', '#000000') 57 this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
60 Logger.info(TAG, 'onPageHide'); 58 Logger.info(TAG, 'onPageHide');
61 //页面浏览 59 //页面浏览
62 - TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) 60 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
63 } 61 }
64 62
65 onBackPress() { 63 onBackPress() {
@@ -2,15 +2,13 @@ import { DateTimeUtils, Logger } from 'wdKit'; @@ -2,15 +2,13 @@ import { DateTimeUtils, Logger } from 'wdKit';
2 import { DynamicDetailComponent } from 'wdComponent'; 2 import { DynamicDetailComponent } from 'wdComponent';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { Params, Action } from 'wdBean'; 4 import { Params, Action } from 'wdBean';
5 -import { TrackingPageBrowse } from 'wdTracking/Index'; 5 +import { TrackingPageBrowse,TrackConstants } from 'wdTracking/Index';
6 6
7 const TAG = 'DynamicDetailPage'; 7 const TAG = 'DynamicDetailPage';
8 @Entry 8 @Entry
9 @Component 9 @Component
10 struct DynamicDetailPage { 10 struct DynamicDetailPage {
11 pageShowTime:number = 0; 11 pageShowTime:number = 0;
12 - pageId:string = 'dynamicDetailPage';  
13 - pageName:string=this.pageId;  
14 @State relId: string = '' 12 @State relId: string = ''
15 @State contentId: string = '' 13 @State contentId: string = ''
16 @State relType: string = '' 14 @State relType: string = ''
@@ -39,7 +37,7 @@ struct DynamicDetailPage { @@ -39,7 +37,7 @@ struct DynamicDetailPage {
39 } 37 }
40 onPageHide() { 38 onPageHide() {
41 //页面浏览 39 //页面浏览
42 - TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) 40 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetailPage,TrackConstants.PageName.DynamicDetailPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
43 41
44 } 42 }
45 } 43 }
@@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter'; @@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter';
4 import { SPHelper } from 'wdKit/Index'; 4 import { SPHelper } from 'wdKit/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
6 import { ButtonOptions, promptAction } from '@kit.ArkUI'; 6 import { ButtonOptions, promptAction } from '@kit.ArkUI';
  7 +import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
7 8
8 @Entry 9 @Entry
9 @Component 10 @Component
@@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage { @@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage {
34 //直接跳过到首页 35 //直接跳过到首页
35 //跳转首页 36 //跳转首页
36 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 37 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
  38 +
  39 + this.trackingLaunchJumpOver(false)
37 }) 40 })
38 } 41 }
39 .width('100%') 42 .width('100%')
@@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage { @@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage {
148 this.saveTagIds() 151 this.saveTagIds()
149 //跳转首页 152 //跳转首页
150 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 153 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
  154 +
  155 + this.trackingLaunchJumpOver(true)
  156 +
151 }) 157 })
152 } 158 }
153 .width('100%') 159 .width('100%')
@@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage { @@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage {
185 } 191 }
186 SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags) 192 SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags)
187 } 193 }
  194 +
  195 + trackingLaunchJumpOver(selectOrJump:boolean){
  196 + let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string
  197 + let action = selectOrJump?TrackConstants.ActionType.SelectInterestCard:TrackConstants.ActionType.CloseInterestCard
  198 + let pageParam: ParamType = {
  199 + 'interestContentOptions':tags,
  200 + 'itemId':tags,
  201 + 'action':action,
  202 + 'sceneId':'9999',
  203 + 'cnsTraceId':'selfHold',
  204 + }
  205 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Interest,TrackConstants.PageName.Interest,pageParam)
  206 + }
188 } 207 }
@@ -111,6 +111,7 @@ export struct VideoChannelPage { @@ -111,6 +111,7 @@ export struct VideoChannelPage {
111 }, (item: TopNavDTO) => item.channelId + '') 111 }, (item: TopNavDTO) => item.channelId + '')
112 } 112 }
113 .width('100%') 113 .width('100%')
  114 +
114 .justifyContent(FlexAlign.Center) 115 .justifyContent(FlexAlign.Center)
115 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White) 116 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
116 117
@@ -128,13 +129,16 @@ export struct VideoChannelPage { @@ -128,13 +129,16 @@ export struct VideoChannelPage {
128 .alignItems(VerticalAlign.Center) 129 .alignItems(VerticalAlign.Center)
129 .justifyContent(FlexAlign.Center) 130 .justifyContent(FlexAlign.Center)
130 .onClick(() => { 131 .onClick(() => {
131 - TrackingButton.click("", TrackConstants.PageName.Search, "VIDEOS")  
132 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 132 + TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
  133 + let params = { 'tabName': "VIDEOS" } as Record<string, string>
  134 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
133 }) 135 })
134 .backgroundColor(Color.Transparent) 136 .backgroundColor(Color.Transparent)
135 137
136 } 138 }
137 .zIndex(20) 139 .zIndex(20)
  140 + .height($r('app.float.top_tab_bar_height_common'))
  141 + .margin({top:10})
138 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 142 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
139 143
140 } 144 }
@@ -172,6 +176,7 @@ export struct VideoChannelPage { @@ -172,6 +176,7 @@ export struct VideoChannelPage {
172 .cachedCount(-1) 176 .cachedCount(-1)
173 .displayCount(1, true) 177 .displayCount(1, true)
174 .alignSelf(ItemAlign.Start) 178 .alignSelf(ItemAlign.Start)
  179 + .effectMode(EdgeEffect.None)
175 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 180 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
176 .onChange((index: number) => { 181 .onChange((index: number) => {
177 this.currentTopNavSelectedIndex = index 182 this.currentTopNavSelectedIndex = index