Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-05-24 16:04:35 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
b262ef06d0917b371295f5123e6da27efe95c72e
b262ef06
2 parents
fb19a5f5
abe9f9e8
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
42 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/SettingPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
View file @
b262ef0
...
...
@@ -108,8 +108,7 @@ export struct CardSourceInfo {
.flexShrink(0)
.margin({right: 4})
}
if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
if (this.getContentDtoBean()?.interactData?.commentNum) {
Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
...
...
@@ -117,6 +116,15 @@ export struct CardSourceInfo {
.visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
Visibility.Visible)
}
// if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
// Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0)
// .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
// Visibility.Visible)
// }
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: 8 })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
b262ef0
...
...
@@ -36,7 +36,18 @@ export struct Card2Component {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
}
calculateTextIndent() {
if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {
return 58;
} else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {
// 当newTags或seoTags存在时,应用相同的缩进
return 35;
} else if (this.contentDTO.objectType == '5') {
return 35;
} else {
return 0;
}
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
...
...
@@ -52,15 +63,10 @@ export struct Card2Component {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
}else if(this.contentDTO.objectType == '2'){
if(this.contentDTO.seoTags){
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}else if(this.contentDTO.newTags){
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}else {
if(this.contentDTO.newTags){
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
...
...
@@ -80,11 +86,7 @@ export struct Card2Component {
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
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 :
(this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 :
0 )
.textIndent(this.calculateTextIndent())
}.alignContent(Alignment.TopStart)
//.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
b262ef0
...
...
@@ -32,6 +32,18 @@ export struct Card6Component {
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
calculateTextIndent() {
if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {
return 58;
} else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {
// 当newTags或seoTags存在时,应用相同的缩进
return 35;
} else if (this.contentDTO.objectType == '5') {
return 35;
} else {
return 0;
}
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
...
...
@@ -57,12 +69,17 @@ export struct Card6Component {
// .margin({ right: 2 })
// }
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
Span(this.str01)
...
...
@@ -80,9 +97,7 @@ export struct Card6Component {
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent(this.calculateTextIndent())
}.alignContent(Alignment.TopStart)
}
...
...
@@ -123,4 +138,4 @@ export struct Card6Component {
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}
}
\ No newline at end of file
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/SettingPage.ets
View file @
b262ef0
import ArrayList from '@ohos.util.ArrayList'
import { MineSettingComponent } from '../setting/MineSettingComponent';
import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
import router from '@ohos.router';
import {
Action,
Params } from 'wdBean';
import { Params } from 'wdBean';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackingPageBrowse, TrackConstants
, TrackingButton
} from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
@Entry
@Component
struct SettingPage {
@State message: string = 'Hello World 02'
@State pageType: string = 'mainSetting';
@State params:Params = router.getParams() as Params;
@State enterActivityTime:number = 0;
@Provide pageShow: number = -1
@Provide pageHide: number = -1
pageShowSettingTime:number = 0;
pageHideSettingTime:number = 0;
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
onPageShow() {
this.pageShow = Math.random()
this.pageType = this.params.pageID;
this.enterActivityTime = DateTimeUtils.getTimeStamp()
if (this.pageType == 'mainSetting'){
this.pageShowSettingTime = DateTimeUtils.getTimeStamp()
}else{
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
}
}
onPageHide(): void {
this.pageHide = Math.random()
if (this.pageType == 'mainSetting'){
this.pageHideSettingTime = DateTimeUtils.getTimeStamp()
}else{
this.pageHideAccountTime = DateTimeUtils.getTimeStamp()
}
let duration = 0
if(this.pageType == 'mainSetting'){
duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000)
}else{
duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)
}
if(this.pageType == 'mainSetting'){
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration)
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
View file @
b262ef0
import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils
, DateTimeUtils
} from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import router from '@ohos.router';
...
...
@@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel';
import { CustomLogoutDialog } from './CustomLogoutDialog';
import { emitter } from '@kit.BasicServicesKit';
import { ConfirmLogoutDialog } from './ConfirmLogoutDialog';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { TrackingButton, TrackConstants
, TrackingPageBrowse
} from 'wdTracking/Index';
export { SettingPasswordParams } from "wdLogin"
@Component
...
...
@@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout {
@State protocolState: boolean = false //协议勾选状态
@State isAccountPage: boolean = true
@State ifSetPassword: boolean = false //是否设置过密码
@Consume pageShow :number
@Consume @Watch('pageHideForUpdateData') pageHide :number
@Watch("checkSetPassword") @Prop enterActivityTime:number = 0;
logoutLayoutShowTime:number = 0;
logoutLayoutHideTime:number = 0;
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
//注销账户 浏览埋点
logoutLayoutHide(){
this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.logoutLayoutHideTime - this.logoutLayoutShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account,duration)
}
//账户管理 浏览埋点
logoutLayoutHide2(){
this.pageHideAccountTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)
}
pageHideForUpdateData(){
if(!this.isAccountPage){
this.logoutLayoutHide()
}else{
this.logoutLayoutHide2()
}
}
logoutViewModel = new LogoutViewModel()
dialogController: CustomDialogController = new CustomDialogController({
...
...
@@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout {
aboutToAppear() {
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
// 获取设置页面数据
this.getAccountAndSecurityData()
this.addEmitEvent()
...
...
@@ -189,7 +219,7 @@ export struct AccountAndSecurityLayout {
}else if (index == 3) {
trackButtonClick("accountManagementPageAccountCancellation")
this.isAccountPage=false
// WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType
)
this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp(
)
}
})
...
...
@@ -253,6 +283,8 @@ export struct AccountAndSecurityLayout {
})
.onClick(() => {
this.isAccountPage=true
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
this.logoutLayoutHide()
this.protocolState=false
})
.id('backImage')
...
...
@@ -330,6 +362,7 @@ export struct AccountAndSecurityLayout {
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
let bean = { contentID: "3", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
...
...
@@ -351,6 +384,7 @@ export struct AccountAndSecurityLayout {
if (!this.protocolState) {
return
}
TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.dialogController.open()
})
...
...
@@ -454,6 +488,7 @@ export struct AccountAndSecurityLayout {
//注销账号
requestLogout() {
TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.logoutViewModel.requestLogout().then(()=>{
ToastUtils.shortToast("注销成功")
router.back()
...
...
Please
register
or
login
to post a comment