张善主

Merge remote-tracking branch 'origin/main'

Showing 20 changed files with 408 additions and 95 deletions
@@ -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 //我的 预约
@@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent { @@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent {
144 144
145 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) 145 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
146 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) 146 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
147 - this.setComponentBgColor(pageInfoBean.backgroundImgUrl) 147 +
  148 + this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string)
148 149
149 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) 150 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
150 // this.compInfoBean = compInfoBean 151 // this.compInfoBean = compInfoBean
@@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent { @@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent {
223 effectKit.createColorPicker(pixelMap, (err, colorPicker) => { 224 effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
224 let color = colorPicker.getMainColorSync(); 225 let color = colorPicker.getMainColorSync();
225 Logger.debug(TAG, "compInfoBean compStyle = " + color) 226 Logger.debug(TAG, "compInfoBean compStyle = " + color)
226 -  
227 - color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) 227 + // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
228 // 将取色器选取的color示例转换为十六进制颜色代码 228 // 将取色器选取的color示例转换为十六进制颜色代码
229 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); 229 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) 230 Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
@@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent { @@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent {
272 } 272 }
273 .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) 273 .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
274 274
275 - PaperTitleComponent() 275 + PaperTitleComponent().margin({top:this.topSafeHeight})
276 } 276 }
277 .width('100%') 277 .width('100%')
278 .height('100%') 278 .height('100%')
279 - .padding({  
280 - top: this.topSafeHeight,  
281 - bottom: this.bottomSafeHeight  
282 - }) 279 + // .padding({
  280 + // top: this.topSafeHeight,
  281 + // bottom: this.bottomSafeHeight
  282 + // })
283 // .backgroundColor(Color.Black) 283 // .backgroundColor(Color.Black)
284 // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) 284 // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
285 .backgroundColor(this.mixedBgColor ?? Color.Black) 285 .backgroundColor(this.mixedBgColor ?? Color.Black)
286 -  
287 } 286 }
288 287
289 @Builder 288 @Builder
@@ -32,6 +32,7 @@ export struct topicInfoView { @@ -32,6 +32,7 @@ export struct topicInfoView {
32 }) 32 })
33 .id('img_cover') 33 .id('img_cover')
34 34
  35 + if (this.frontLinkObject) {
35 Row() { 36 Row() {
36 Text("查看详情") 37 Text("查看详情")
37 .fontSize(14) 38 .fontSize(14)
@@ -49,19 +50,19 @@ export struct topicInfoView { @@ -49,19 +50,19 @@ export struct topicInfoView {
49 .margin({ top: 8, left: 16, right: 16, bottom: 16 }) 50 .margin({ top: 8, left: 16, right: 16, bottom: 16 })
50 .borderRadius(2) 51 .borderRadius(2)
51 .onClick(()=>{ 52 .onClick(()=>{
52 - if (this.frontLinkObject) {  
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 - } 58 +
59 }).width(80) 59 }).width(80)
60 .alignRules({ 60 .alignRules({
61 left: { anchor: "__container__", align: HorizontalAlign.Start }, 61 left: { anchor: "__container__", align: HorizontalAlign.Start },
62 bottom: { anchor: "__container__", align: VerticalAlign.Bottom } 62 bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
63 }) 63 })
64 .id('row_detail') 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
@@ -26,14 +26,11 @@ export struct CardSourceInfo { @@ -26,14 +26,11 @@ export struct CardSourceInfo {
26 let flag: boolean = false; 26 let flag: boolean = false;
27 if (curRouter === 'MainPage') { 27 if (curRouter === 'MainPage') {
28 if (this.isTwoDaysAgo(publishTime)) { 28 if (this.isTwoDaysAgo(publishTime)) {
29 - console.log('curRouter 01')  
30 flag = false 29 flag = false
31 } else { 30 } else {
32 - console.log('curRouter 02')  
33 flag = true; 31 flag = true;
34 } 32 }
35 } else { 33 } else {
36 - console.log('curRouter 03')  
37 flag = true; 34 flag = true;
38 } 35 }
39 return flag; 36 return flag;
@@ -111,8 +108,7 @@ export struct CardSourceInfo { @@ -111,8 +108,7 @@ export struct CardSourceInfo {
111 .flexShrink(0) 108 .flexShrink(0)
112 .margin({right: 4}) 109 .margin({right: 4})
113 } 110 }
114 -  
115 - if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { 111 + if (this.getContentDtoBean()?.interactData?.commentNum) {
116 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) 112 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
117 .fontSize($r("app.float.font_size_11")) 113 .fontSize($r("app.float.font_size_11"))
118 .fontColor($r("app.color.color_B0B0B0")) 114 .fontColor($r("app.color.color_B0B0B0"))
@@ -120,6 +116,15 @@ export struct CardSourceInfo { @@ -120,6 +116,15 @@ export struct CardSourceInfo {
120 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : 116 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
121 Visibility.Visible) 117 Visibility.Visible)
122 } 118 }
  119 +
  120 + // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
  121 + // Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
  122 + // .fontSize($r("app.float.font_size_11"))
  123 + // .fontColor($r("app.color.color_B0B0B0"))
  124 + // .flexShrink(0)
  125 + // .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
  126 + // Visibility.Visible)
  127 + // }
123 } 128 }
124 .width(CommonConstants.FULL_WIDTH) 129 .width(CommonConstants.FULL_WIDTH)
125 .margin({ top: 8 }) 130 .margin({ top: 8 })
@@ -80,9 +80,8 @@ export struct RmhTitle { @@ -80,9 +80,8 @@ export struct RmhTitle {
80 80
81 async aboutToAppear(): Promise<void> { 81 async aboutToAppear(): Promise<void> {
82 this.getBatchAttentionStatus() 82 this.getBatchAttentionStatus()
83 -  
84 - let page = router.getState();  
85 - if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { 83 + const curRouter = router.getState().name;
  84 + if (curRouter === 'MainPage') {
86 this.hideTime = true; 85 this.hideTime = true;
87 } 86 }
88 87
@@ -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)
@@ -50,20 +50,39 @@ export struct Card2Component { @@ -50,20 +50,39 @@ export struct Card2Component {
50 Column() { 50 Column() {
51 Column() { 51 Column() {
52 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 + // }
53 if(this.contentDTO.objectType == '5'){ 67 if(this.contentDTO.objectType == '5'){
54 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) 68 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
55 - }else if(this.contentDTO.objectType == '2'){  
56 - if(this.contentDTO.seoTags){ 69 + } else {
  70 + if (this.contentDTO.seoTags) {
57 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) 71 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 } 72 }
62 - }else {  
63 - if(this.contentDTO.newTags){ 73 + if (this.contentDTO.newTags) {
64 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) 74 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
65 } 75 }
66 } 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 +
67 Text() { 86 Text() {
68 if (this.titleMarked) { 87 if (this.titleMarked) {
69 Span(this.str01) 88 Span(this.str01)
@@ -80,10 +99,9 @@ export struct Card2Component { @@ -80,10 +99,9 @@ export struct Card2Component {
80 .lineHeight(27) 99 .lineHeight(27)
81 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 100 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
82 .align(Alignment.Start) 101 .align(Alignment.Start)
83 - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :  
84 - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||  
85 - this.contentDTO.objectType == '5' ? 35 : 0 || (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 :  
86 - (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 : 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 :
87 0 ) 105 0 )
88 }.alignContent(Alignment.TopStart) 106 }.alignContent(Alignment.TopStart)
89 107
@@ -32,7 +32,6 @@ export struct Card6Component { @@ -32,7 +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 -  
36 titleInit() { 35 titleInit() {
37 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { 36 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
38 this.titleMarked = true; 37 this.titleMarked = true;
@@ -57,11 +56,17 @@ export struct Card6Component { @@ -57,11 +56,17 @@ export struct Card6Component {
57 // .margin({ right: 2 }) 56 // .margin({ right: 2 })
58 // } 57 // }
59 Stack() { 58 Stack() {
  59 + if(this.contentDTO.objectType == '5'){
  60 + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
  61 + } else {
  62 + if (this.contentDTO.seoTags) {
  63 + Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
  64 + }
60 if (this.contentDTO.newTags) { 65 if (this.contentDTO.newTags) {
61 - Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)  
62 - } else if (this.contentDTO.objectType == '5') {  
63 - Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) 66 + Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
64 } 67 }
  68 + }
  69 +
65 70
66 Text() { 71 Text() {
67 if (this.titleMarked) { 72 if (this.titleMarked) {
@@ -80,9 +85,10 @@ export struct Card6Component { @@ -80,9 +85,10 @@ export struct Card6Component {
80 .maxLines(3) 85 .maxLines(3)
81 .alignSelf(ItemAlign.Start) 86 .alignSelf(ItemAlign.Start)
82 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 87 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
83 - .textIndent(this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2 ? 58 :  
84 - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||  
85 - this.contentDTO.objectType == '5' ? 35 : 0) 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 )
86 }.alignContent(Alignment.TopStart) 92 }.alignContent(Alignment.TopStart)
87 93
88 } 94 }
1 -import ArrayList from '@ohos.util.ArrayList'  
2 import { MineSettingComponent } from '../setting/MineSettingComponent'; 1 import { MineSettingComponent } from '../setting/MineSettingComponent';
3 import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; 2 import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
4 import router from '@ohos.router'; 3 import router from '@ohos.router';
5 -import { Action, Params } from 'wdBean'; 4 +import { Params } from 'wdBean';
6 import { DateTimeUtils } from 'wdKit/Index'; 5 import { DateTimeUtils } from 'wdKit/Index';
7 -import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; 6 +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
8 7
9 @Entry 8 @Entry
10 @Component 9 @Component
11 struct SettingPage { 10 struct SettingPage {
12 - @State message: string = 'Hello World 02'  
13 @State pageType: string = 'mainSetting'; 11 @State pageType: string = 'mainSetting';
14 @State params:Params = router.getParams() as Params; 12 @State params:Params = router.getParams() as Params;
15 @State enterActivityTime:number = 0; 13 @State enterActivityTime:number = 0;
  14 + @Provide pageShow: number = -1
  15 + @Provide pageHide: number = -1
16 16
17 pageShowSettingTime:number = 0; 17 pageShowSettingTime:number = 0;
18 pageHideSettingTime:number = 0; 18 pageHideSettingTime:number = 0;
19 - pageShowAccountTime:number = 0;  
20 - pageHideAccountTime:number = 0; 19 +
21 20
22 onPageShow() { 21 onPageShow() {
  22 + this.pageShow = Math.random()
  23 +
23 this.pageType = this.params.pageID; 24 this.pageType = this.params.pageID;
24 this.enterActivityTime = DateTimeUtils.getTimeStamp() 25 this.enterActivityTime = DateTimeUtils.getTimeStamp()
25 if (this.pageType == 'mainSetting'){ 26 if (this.pageType == 'mainSetting'){
26 this.pageShowSettingTime = DateTimeUtils.getTimeStamp() 27 this.pageShowSettingTime = DateTimeUtils.getTimeStamp()
27 - }else{  
28 - this.pageShowAccountTime = DateTimeUtils.getTimeStamp()  
29 } 28 }
30 } 29 }
31 30
32 onPageHide(): void { 31 onPageHide(): void {
  32 + this.pageHide = Math.random()
33 if (this.pageType == 'mainSetting'){ 33 if (this.pageType == 'mainSetting'){
34 this.pageHideSettingTime = DateTimeUtils.getTimeStamp() 34 this.pageHideSettingTime = DateTimeUtils.getTimeStamp()
35 - }else{  
36 - this.pageHideAccountTime = DateTimeUtils.getTimeStamp()  
37 } 35 }
38 36
39 let duration = 0 37 let duration = 0
40 if(this.pageType == 'mainSetting'){ 38 if(this.pageType == 'mainSetting'){
41 duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) 39 duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000)
42 - }else{  
43 - duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)  
44 } 40 }
45 if(this.pageType == 'mainSetting'){ 41 if(this.pageType == 'mainSetting'){
46 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) 42 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration)
47 - }else{  
48 - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)  
49 } 43 }
50 } 44 }
51 45
1 import { SpConstants } from 'wdConstant'; 1 import { SpConstants } from 'wdConstant';
2 -import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; 2 +import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit';
3 import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; 3 import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
4 import MineSettingDatasModel from '../../model/MineSettingDatasModel'; 4 import MineSettingDatasModel from '../../model/MineSettingDatasModel';
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
@@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel';
11 import { CustomLogoutDialog } from './CustomLogoutDialog'; 11 import { CustomLogoutDialog } from './CustomLogoutDialog';
12 import { emitter } from '@kit.BasicServicesKit'; 12 import { emitter } from '@kit.BasicServicesKit';
13 import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; 13 import { ConfirmLogoutDialog } from './ConfirmLogoutDialog';
14 -import { TrackingButton, TrackConstants } from 'wdTracking/Index'; 14 +import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
15 export { SettingPasswordParams } from "wdLogin" 15 export { SettingPasswordParams } from "wdLogin"
16 16
17 @Component 17 @Component
@@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout { @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout {
22 @State protocolState: boolean = false //协议勾选状态 22 @State protocolState: boolean = false //协议勾选状态
23 @State isAccountPage: boolean = true 23 @State isAccountPage: boolean = true
24 @State ifSetPassword: boolean = false //是否设置过密码 24 @State ifSetPassword: boolean = false //是否设置过密码
  25 + @Consume pageShow :number
  26 + @Consume @Watch('pageHideForUpdateData') pageHide :number
25 27
26 @Watch("checkSetPassword") @Prop enterActivityTime:number = 0; 28 @Watch("checkSetPassword") @Prop enterActivityTime:number = 0;
  29 + logoutLayoutShowTime:number = 0;
  30 + logoutLayoutHideTime:number = 0;
  31 + pageShowAccountTime:number = 0;
  32 + pageHideAccountTime:number = 0;
  33 +
  34 + //注销账户 浏览埋点
  35 + logoutLayoutHide(){
  36 + this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
  37 + let duration = 0
  38 + duration = Math.floor((this.logoutLayoutHideTime - this.logoutLayoutShowTime)/1000)
  39 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account,duration)
  40 + }
  41 + //账户管理 浏览埋点
  42 + logoutLayoutHide2(){
  43 + this.pageHideAccountTime = DateTimeUtils.getTimeStamp()
  44 + let duration = 0
  45 + duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)
  46 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)
  47 + }
  48 +
  49 + pageHideForUpdateData(){
  50 + if(!this.isAccountPage){
  51 + this.logoutLayoutHide()
  52 + }else{
  53 + this.logoutLayoutHide2()
  54 + }
  55 + }
27 56
28 logoutViewModel = new LogoutViewModel() 57 logoutViewModel = new LogoutViewModel()
29 dialogController: CustomDialogController = new CustomDialogController({ 58 dialogController: CustomDialogController = new CustomDialogController({
@@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout { @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout {
57 86
58 87
59 aboutToAppear() { 88 aboutToAppear() {
  89 + this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
60 // 获取设置页面数据 90 // 获取设置页面数据
61 this.getAccountAndSecurityData() 91 this.getAccountAndSecurityData()
62 this.addEmitEvent() 92 this.addEmitEvent()
@@ -183,13 +213,12 @@ export struct AccountAndSecurityLayout { @@ -183,13 +213,12 @@ export struct AccountAndSecurityLayout {
183 WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage) 213 WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage)
184 }else{ 214 }else{
185 //设置密码 215 //设置密码
186 - let pageType = {'pageType': 1} as Record<string, number>;  
187 - WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 216 + WDRouterRule.jumpWithPage(WDRouterPage.verifyPhoneNumberPage)
188 } 217 }
189 }else if (index == 3) { 218 }else if (index == 3) {
190 trackButtonClick("accountManagementPageAccountCancellation") 219 trackButtonClick("accountManagementPageAccountCancellation")
191 this.isAccountPage=false 220 this.isAccountPage=false
192 - // WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 221 + this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp()
193 } 222 }
194 }) 223 })
195 224
@@ -253,6 +282,8 @@ export struct AccountAndSecurityLayout { @@ -253,6 +282,8 @@ export struct AccountAndSecurityLayout {
253 }) 282 })
254 .onClick(() => { 283 .onClick(() => {
255 this.isAccountPage=true 284 this.isAccountPage=true
  285 + this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
  286 + this.logoutLayoutHide()
256 this.protocolState=false 287 this.protocolState=false
257 }) 288 })
258 .id('backImage') 289 .id('backImage')
@@ -330,6 +361,7 @@ export struct AccountAndSecurityLayout { @@ -330,6 +361,7 @@ export struct AccountAndSecurityLayout {
330 Text() { 361 Text() {
331 Span("我已阅读并同意").fontColor("#999999").fontSize(12) 362 Span("我已阅读并同意").fontColor("#999999").fontSize(12)
332 Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { 363 Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
  364 + TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
333 let bean = { contentID: "3", pageID: "" } as Params 365 let bean = { contentID: "3", pageID: "" } as Params
334 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 366 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
335 }) 367 })
@@ -351,6 +383,7 @@ export struct AccountAndSecurityLayout { @@ -351,6 +383,7 @@ export struct AccountAndSecurityLayout {
351 if (!this.protocolState) { 383 if (!this.protocolState) {
352 return 384 return
353 } 385 }
  386 + TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
354 this.dialogController.open() 387 this.dialogController.open()
355 388
356 }) 389 })
@@ -454,6 +487,7 @@ export struct AccountAndSecurityLayout { @@ -454,6 +487,7 @@ export struct AccountAndSecurityLayout {
454 487
455 //注销账号 488 //注销账号
456 requestLogout() { 489 requestLogout() {
  490 + TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
457 this.logoutViewModel.requestLogout().then(()=>{ 491 this.logoutViewModel.requestLogout().then(()=>{
458 ToastUtils.shortToast("注销成功") 492 ToastUtils.shortToast("注销成功")
459 router.back() 493 router.back()
@@ -22,7 +22,7 @@ interface ILikeStyleResp { @@ -22,7 +22,7 @@ interface ILikeStyleResp {
22 export struct LikeComponent { 22 export struct LikeComponent {
23 @Consume contentDetailData: ContentDetailDTO 23 @Consume contentDetailData: ContentDetailDTO
24 @Prop pageComponentType: number 24 @Prop pageComponentType: number
25 - @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 25 + @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
26 @State likeStatus: boolean = false 26 @State likeStatus: boolean = false
27 viewModel: LikeViewModel = new LikeViewModel() 27 viewModel: LikeViewModel = new LikeViewModel()
28 @Prop @Watch('onDataUpdated') data: Record<string, string> 28 @Prop @Watch('onDataUpdated') data: Record<string, string>
@@ -41,6 +41,14 @@ export struct LikeComponent { @@ -41,6 +41,14 @@ export struct LikeComponent {
41 // this.data['status'] = "1" 41 // this.data['status'] = "1"
42 42
43 aboutToAppear() { 43 aboutToAppear() {
  44 + // 2:竖屏直播页 3:图集 4:横屏直播页
  45 + if(this.pageComponentType == 2 || this.pageComponentType == 4) {
  46 + // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
  47 + this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
  48 + } else {
  49 + // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
  50 + this.likesStyle = this.contentDetailData.likesStyle
  51 + }
44 this.onDataUpdated() 52 this.onDataUpdated()
45 } 53 }
46 54
@@ -80,7 +88,7 @@ export struct LikeComponent { @@ -80,7 +88,7 @@ export struct LikeComponent {
80 * 将点赞样式转换为icon 88 * 将点赞样式转换为icon
81 */ 89 */
82 transLikeStyle(): ILikeStyleResp { 90 transLikeStyle(): ILikeStyleResp {
83 - if (this.likesStyle === 1) { 91 + if (this.likesStyle === 1 || this.likesStyle === 'love' || this.likesStyle === 'thumb') {
84 return { 92 return {
85 url: this.likeStatus ? $r(`app.media.ic_like_check`) : 93 url: this.likeStatus ? $r(`app.media.ic_like_check`) :
86 this.styleType == 1 ? 94 this.styleType == 1 ?
@@ -88,12 +96,12 @@ export struct LikeComponent { @@ -88,12 +96,12 @@ export struct LikeComponent {
88 $r(`app.media.ic_like_uncheck`), 96 $r(`app.media.ic_like_uncheck`),
89 name: '赞' 97 name: '赞'
90 } 98 }
91 - } else if (this.likesStyle === 2) { 99 + } else if (this.likesStyle === 2 || this.likesStyle === 'pray') {
92 return { 100 return {
93 url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), 101 url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
94 name: '祈祷' 102 name: '祈祷'
95 } 103 }
96 - } else if (this.likesStyle === 3) { 104 + } else if (this.likesStyle === 3 || this.likesStyle === 'mourning') {
97 return { 105 return {
98 url: this.likeStatus ? $r(`app.media.ic_candle_check`) : 106 url: this.likeStatus ? $r(`app.media.ic_candle_check`) :
99 $r(`app.media.ic_candle_uncheck`), 107 $r(`app.media.ic_candle_uncheck`),
@@ -143,6 +151,7 @@ export struct LikeComponent { @@ -143,6 +151,7 @@ export struct LikeComponent {
143 } 151 }
144 .width(154) 152 .width(154)
145 .height(40) 153 .height(40)
  154 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
146 } 155 }
147 156
148 @Builder 157 @Builder
@@ -160,6 +169,7 @@ export struct LikeComponent { @@ -160,6 +169,7 @@ export struct LikeComponent {
160 .onClick(() => { 169 .onClick(() => {
161 this.clickButtonEvent() 170 this.clickButtonEvent()
162 }) 171 })
  172 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
163 } 173 }
164 174
165 @Builder 175 @Builder
@@ -173,7 +183,10 @@ export struct LikeComponent { @@ -173,7 +183,10 @@ export struct LikeComponent {
173 .onClick(() => { 183 .onClick(() => {
174 this.clickButtonEvent() 184 this.clickButtonEvent()
175 }) 185 })
176 - }.width(24).height(24) 186 + }
  187 + .width(24)
  188 + .height(24)
  189 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
177 } 190 }
178 191
179 @Builder 192 @Builder
@@ -248,6 +261,7 @@ export struct LikeComponent { @@ -248,6 +261,7 @@ export struct LikeComponent {
248 }.width(24).height(24).onClick(() => { 261 }.width(24).height(24).onClick(() => {
249 this.clickButtonEvent() 262 this.clickButtonEvent()
250 }) 263 })
  264 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
251 } 265 }
252 266
253 @Builder 267 @Builder
@@ -284,6 +298,7 @@ export struct LikeComponent { @@ -284,6 +298,7 @@ export struct LikeComponent {
284 } 298 }
285 .width(36) 299 .width(36)
286 .height(42) 300 .height(42)
  301 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
287 302
288 } 303 }
289 304
@@ -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);
@@ -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、登录->忘记密码 3、设置->更换手机号页面2
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() {
@@ -378,6 +378,7 @@ struct LoginPage { @@ -378,6 +378,7 @@ struct LoginPage {
378 TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) 378 TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
379 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { 379 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
380 Logger.debug(TAG, "requestLogin: " + data.jwtToken) 380 Logger.debug(TAG, "requestLogin: " + data.jwtToken)
  381 + this.showToastTip('登录成功')
381 ///同步兴趣tag 382 ///同步兴趣tag
382 let interestsModel = new InterestsHobbiesModel() 383 let interestsModel = new InterestsHobbiesModel()
383 interestsModel.updateInterests() 384 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"){ //注销协议
  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 './SettingPasswordLayout'
  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 +}
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 "pages/guide/GuidePages", 9 "pages/guide/GuidePages",
10 "pages/login/OneKeyLoginPage", 10 "pages/login/OneKeyLoginPage",
11 "pages/login/ModifyPasswordPage", 11 "pages/login/ModifyPasswordPage",
12 - "pages/login/ChangeBindPhonePage" 12 + "pages/login/ChangeBindPhonePage",
  13 + "pages/login/VerifyPhoneNumberPage"
13 ] 14 ]
14 } 15 }
@@ -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
@@ -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 }