陈剑华

Merge remote-tracking branch 'origin/main'

@@ -108,8 +108,7 @@ export struct CardSourceInfo { @@ -108,8 +108,7 @@ export struct CardSourceInfo {
108 .flexShrink(0) 108 .flexShrink(0)
109 .margin({right: 4}) 109 .margin({right: 4})
110 } 110 }
111 -  
112 - if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { 111 + if (this.getContentDtoBean()?.interactData?.commentNum) {
113 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) 112 Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
114 .fontSize($r("app.float.font_size_11")) 113 .fontSize($r("app.float.font_size_11"))
115 .fontColor($r("app.color.color_B0B0B0")) 114 .fontColor($r("app.color.color_B0B0B0"))
@@ -117,6 +116,15 @@ export struct CardSourceInfo { @@ -117,6 +116,15 @@ export struct CardSourceInfo {
117 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : 116 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
118 Visibility.Visible) 117 Visibility.Visible)
119 } 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 + // }
120 } 128 }
121 .width(CommonConstants.FULL_WIDTH) 129 .width(CommonConstants.FULL_WIDTH)
122 .margin({ top: 8 }) 130 .margin({ top: 8 })
@@ -36,7 +36,18 @@ export struct Card2Component { @@ -36,7 +36,18 @@ export struct Card2Component {
36 this.titleInit(); 36 this.titleInit();
37 this.loadImg = await onlyWifiLoadImg(); 37 this.loadImg = await onlyWifiLoadImg();
38 } 38 }
39 - 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 + }
40 titleInit() { 51 titleInit() {
41 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { 52 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
42 this.titleMarked = true; 53 this.titleMarked = true;
@@ -52,15 +63,10 @@ export struct Card2Component { @@ -52,15 +63,10 @@ export struct Card2Component {
52 Stack() { 63 Stack() {
53 if(this.contentDTO.objectType == '5'){ 64 if(this.contentDTO.objectType == '5'){
54 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) 65 Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
55 - }else if(this.contentDTO.objectType == '2'){  
56 - if(this.contentDTO.seoTags){ 66 + } else {
  67 + if (this.contentDTO.seoTags) {
57 Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) 68 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){ 69 + } else if (this.contentDTO.newTags) {
64 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) 70 Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
65 } 71 }
66 } 72 }
@@ -80,11 +86,7 @@ export struct Card2Component { @@ -80,11 +86,7 @@ export struct Card2Component {
80 .lineHeight(27) 86 .lineHeight(27)
81 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 87 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
82 .align(Alignment.Start) 88 .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 :  
87 - 0 ) 89 + .textIndent(this.calculateTextIndent())
88 }.alignContent(Alignment.TopStart) 90 }.alignContent(Alignment.TopStart)
89 91
90 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) 92 //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
@@ -32,6 +32,18 @@ export struct Card6Component { @@ -32,6 +32,18 @@ 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 + }
35 47
36 titleInit() { 48 titleInit() {
37 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { 49 if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
@@ -57,11 +69,16 @@ export struct Card6Component { @@ -57,11 +69,16 @@ export struct Card6Component {
57 // .margin({ right: 2 }) 69 // .margin({ right: 2 })
58 // } 70 // }
59 Stack() { 71 Stack() {
60 - 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) 72 + if(this.contentDTO.objectType == '5'){
  73 + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
  74 + } else {
  75 + if (this.contentDTO.seoTags) {
  76 + Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
  77 + } else if (this.contentDTO.newTags) {
  78 + Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
64 } 79 }
  80 + }
  81 +
65 82
66 Text() { 83 Text() {
67 if (this.titleMarked) { 84 if (this.titleMarked) {
@@ -80,9 +97,7 @@ export struct Card6Component { @@ -80,9 +97,7 @@ export struct Card6Component {
80 .maxLines(3) 97 .maxLines(3)
81 .alignSelf(ItemAlign.Start) 98 .alignSelf(ItemAlign.Start)
82 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 99 .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) 100 + .textIndent(this.calculateTextIndent())
86 }.alignContent(Alignment.TopStart) 101 }.alignContent(Alignment.TopStart)
87 102
88 } 103 }
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()
@@ -189,7 +219,7 @@ export struct AccountAndSecurityLayout { @@ -189,7 +219,7 @@ export struct AccountAndSecurityLayout {
189 }else if (index == 3) { 219 }else if (index == 3) {
190 trackButtonClick("accountManagementPageAccountCancellation") 220 trackButtonClick("accountManagementPageAccountCancellation")
191 this.isAccountPage=false 221 this.isAccountPage=false
192 - // WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) 222 + this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp()
193 } 223 }
194 }) 224 })
195 225
@@ -253,6 +283,8 @@ export struct AccountAndSecurityLayout { @@ -253,6 +283,8 @@ export struct AccountAndSecurityLayout {
253 }) 283 })
254 .onClick(() => { 284 .onClick(() => {
255 this.isAccountPage=true 285 this.isAccountPage=true
  286 + this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
  287 + this.logoutLayoutHide()
256 this.protocolState=false 288 this.protocolState=false
257 }) 289 })
258 .id('backImage') 290 .id('backImage')
@@ -330,6 +362,7 @@ export struct AccountAndSecurityLayout { @@ -330,6 +362,7 @@ export struct AccountAndSecurityLayout {
330 Text() { 362 Text() {
331 Span("我已阅读并同意").fontColor("#999999").fontSize(12) 363 Span("我已阅读并同意").fontColor("#999999").fontSize(12)
332 Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { 364 Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
  365 + TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
333 let bean = { contentID: "3", pageID: "" } as Params 366 let bean = { contentID: "3", pageID: "" } as Params
334 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 367 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
335 }) 368 })
@@ -351,6 +384,7 @@ export struct AccountAndSecurityLayout { @@ -351,6 +384,7 @@ export struct AccountAndSecurityLayout {
351 if (!this.protocolState) { 384 if (!this.protocolState) {
352 return 385 return
353 } 386 }
  387 + TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
354 this.dialogController.open() 388 this.dialogController.open()
355 389
356 }) 390 })
@@ -454,6 +488,7 @@ export struct AccountAndSecurityLayout { @@ -454,6 +488,7 @@ export struct AccountAndSecurityLayout {
454 488
455 //注销账号 489 //注销账号
456 requestLogout() { 490 requestLogout() {
  491 + TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
457 this.logoutViewModel.requestLogout().then(()=>{ 492 this.logoutViewModel.requestLogout().then(()=>{
458 ToastUtils.shortToast("注销成功") 493 ToastUtils.shortToast("注销成功")
459 router.back() 494 router.back()