Showing
4 changed files
with
78 additions
and
4 deletions
| @@ -12,6 +12,9 @@ import { CustomLogoutDialog } from './CustomLogoutDialog'; | @@ -12,6 +12,9 @@ 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, TrackingPageBrowse } from 'wdTracking/Index'; | 14 | import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 15 | +import { AccountCenterItem } from '../../viewmodel/AccountCenterItem' | ||
| 16 | +import { it } from '@ohos/hypium'; | ||
| 17 | + | ||
| 15 | export { SettingPasswordParams } from "wdLogin" | 18 | export { SettingPasswordParams } from "wdLogin" |
| 16 | 19 | ||
| 17 | @Component | 20 | @Component |
| @@ -42,6 +45,11 @@ export struct AccountAndSecurityLayout { | @@ -42,6 +45,11 @@ export struct AccountAndSecurityLayout { | ||
| 42 | maskColor:"#00000000" | 45 | maskColor:"#00000000" |
| 43 | }) | 46 | }) |
| 44 | 47 | ||
| 48 | + accountCenterItem?: AccountCenterItem | ||
| 49 | + @State logOffWaitTime: string = "7" | ||
| 50 | + @State logOffMsg: string = "" | ||
| 51 | + @State userType: number = 0 | ||
| 52 | + | ||
| 45 | //注销账户 浏览埋点 | 53 | //注销账户 浏览埋点 |
| 46 | logoutLayoutHide(){ | 54 | logoutLayoutHide(){ |
| 47 | this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() | 55 | this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() |
| @@ -68,6 +76,9 @@ export struct AccountAndSecurityLayout { | @@ -68,6 +76,9 @@ export struct AccountAndSecurityLayout { | ||
| 68 | logoutViewModel = new LogoutViewModel() | 76 | logoutViewModel = new LogoutViewModel() |
| 69 | dialogController: CustomDialogController = new CustomDialogController({ | 77 | dialogController: CustomDialogController = new CustomDialogController({ |
| 70 | builder: CustomLogoutDialog({ | 78 | builder: CustomLogoutDialog({ |
| 79 | + logOffWaitTime: this.logOffWaitTime, | ||
| 80 | + logOffMsg: this.logOffMsg, | ||
| 81 | + userType: this.userType, | ||
| 71 | cancel: () => { | 82 | cancel: () => { |
| 72 | 83 | ||
| 73 | }, | 84 | }, |
| @@ -98,6 +109,7 @@ export struct AccountAndSecurityLayout { | @@ -98,6 +109,7 @@ export struct AccountAndSecurityLayout { | ||
| 98 | 109 | ||
| 99 | aboutToAppear() { | 110 | aboutToAppear() { |
| 100 | this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | 111 | this.pageShowAccountTime = DateTimeUtils.getTimeStamp() |
| 112 | + this.userType = Number(SPHelper.default.getSync(SpConstants.USER_Type, '')) | ||
| 101 | // 获取设置页面数据 | 113 | // 获取设置页面数据 |
| 102 | this.getAccountAndSecurityData() | 114 | this.getAccountAndSecurityData() |
| 103 | this.addEmitEvent() | 115 | this.addEmitEvent() |
| @@ -128,6 +140,11 @@ export struct AccountAndSecurityLayout { | @@ -128,6 +140,11 @@ export struct AccountAndSecurityLayout { | ||
| 128 | } | 140 | } |
| 129 | this.listData = oldList | 141 | this.listData = oldList |
| 130 | 142 | ||
| 143 | + MineSettingDatasModel.fetchSecurityBindInfo().then((item) => { | ||
| 144 | + this.accountCenterItem = item | ||
| 145 | + this.logOffWaitTime = item.logOffWaitTime > 0 ? item.logOffWaitTime + "" : "7" | ||
| 146 | + this.logOffMsg = item.logOffMsg | ||
| 147 | + }) | ||
| 131 | } | 148 | } |
| 132 | 149 | ||
| 133 | addEmitEvent(){ | 150 | addEmitEvent(){ |
| @@ -341,12 +358,14 @@ export struct AccountAndSecurityLayout { | @@ -341,12 +358,14 @@ export struct AccountAndSecurityLayout { | ||
| 341 | .padding({ top: 24, left: "62lpx" }) | 358 | .padding({ top: 24, left: "62lpx" }) |
| 342 | .width('100%') | 359 | .width('100%') |
| 343 | 360 | ||
| 344 | - Text('请注意:注销后7天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册') | 361 | + if (this.userType === 1 && this.logOffWaitTime.length > 0) { |
| 362 | + Text(`请注意:注销后${this.logOffWaitTime}天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册`) | ||
| 345 | .fontColor('#FFED2800') | 363 | .fontColor('#FFED2800') |
| 346 | .fontSize(14) | 364 | .fontSize(14) |
| 347 | .fontWeight(400) | 365 | .fontWeight(400) |
| 348 | .padding({ top: 32, left: "31lpx", right: "31lpx" }) | 366 | .padding({ top: 32, left: "31lpx", right: "31lpx" }) |
| 349 | .width('100%') | 367 | .width('100%') |
| 368 | + } | ||
| 350 | 369 | ||
| 351 | }.alignRules({ | 370 | }.alignRules({ |
| 352 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 371 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 1 | +import { router } from '@kit.ArkUI' | ||
| 2 | + | ||
| 1 | @CustomDialog | 3 | @CustomDialog |
| 2 | export struct CustomLogoutDialog { | 4 | export struct CustomLogoutDialog { |
| 3 | controller: CustomDialogController | 5 | controller: CustomDialogController |
| @@ -5,18 +7,41 @@ export struct CustomLogoutDialog { | @@ -5,18 +7,41 @@ export struct CustomLogoutDialog { | ||
| 5 | } | 7 | } |
| 6 | confirm: () => void = () => { | 8 | confirm: () => void = () => { |
| 7 | } | 9 | } |
| 10 | + @Prop logOffWaitTime: string = "7" | ||
| 11 | + @Prop logOffMsg: string = "" | ||
| 12 | + @Prop userType: number = 0 | ||
| 8 | 13 | ||
| 9 | build() { | 14 | build() { |
| 10 | Column() { | 15 | Column() { |
| 11 | - Text("温馨提示") | 16 | + Text(this.userType !== 1 ? "温馨提醒" : "注销账号") |
| 12 | .fontColor("#222222") | 17 | .fontColor("#222222") |
| 13 | .fontSize(18) | 18 | .fontSize(18) |
| 14 | .width("100%") | 19 | .width("100%") |
| 15 | .fontWeight(FontWeight.Bold) | 20 | .fontWeight(FontWeight.Bold) |
| 16 | .textAlign(TextAlign.Center) | 21 | .textAlign(TextAlign.Center) |
| 17 | .margin({ top: 20 }) | 22 | .margin({ top: 20 }) |
| 18 | - Text('注销后7天内无法重新登录注册人民日报app,是否确认注销?') { | ||
| 19 | 23 | ||
| 24 | + if (this.userType !== 1) { | ||
| 25 | + Text(this.logOffMsg.length > 0 ? this.logOffMsg : "您确认要注销账号吗? 请联系rmh@pdnews.cn邮箱") { | ||
| 26 | + }.margin({ top: 12, left: 16, right: 16 }) | ||
| 27 | + .fontColor("#999999") | ||
| 28 | + Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp') | ||
| 29 | + Text('知道了') | ||
| 30 | + .fontSize(16) | ||
| 31 | + .layoutWeight(1) | ||
| 32 | + .fontWeight(FontWeight.Medium) | ||
| 33 | + .textAlign(TextAlign.Center) | ||
| 34 | + .onClick(() => { | ||
| 35 | + this.controller.close() | ||
| 36 | + if (this.cancel) { | ||
| 37 | + this.cancel() | ||
| 38 | + } | ||
| 39 | + router.back() | ||
| 40 | + }) | ||
| 41 | + .height('100%') | ||
| 42 | + | ||
| 43 | + } else { | ||
| 44 | + Text(`注销后${this.logOffWaitTime}天内无法重新登录注册人民日报app,是否确认注销?`) { | ||
| 20 | }.margin({ top: 12, left: 16, right: 16 }) | 45 | }.margin({ top: 12, left: 16, right: 16 }) |
| 21 | 46 | ||
| 22 | Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp') | 47 | Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp') |
| @@ -56,6 +81,7 @@ export struct CustomLogoutDialog { | @@ -56,6 +81,7 @@ export struct CustomLogoutDialog { | ||
| 56 | }) | 81 | }) |
| 57 | .height('100%') | 82 | .height('100%') |
| 58 | }.layoutWeight(1).justifyContent(FlexAlign.Center) | 83 | }.layoutWeight(1).justifyContent(FlexAlign.Center) |
| 84 | + } | ||
| 59 | }.height(161).backgroundColor(Color.White).borderRadius(6).width('74%') | 85 | }.height(161).backgroundColor(Color.White).borderRadius(6).width('74%') |
| 60 | } | 86 | } |
| 61 | } | 87 | } |
| @@ -5,7 +5,7 @@ import { Logger, SPHelper } from 'wdKit'; | @@ -5,7 +5,7 @@ import { Logger, SPHelper } from 'wdKit'; | ||
| 5 | import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem'; | 5 | import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem'; |
| 6 | import { SpConstants } from 'wdConstant/Index'; | 6 | import { SpConstants } from 'wdConstant/Index'; |
| 7 | import { CheckSetPasswordItem } from '../viewmodel/CheckSetPasswordItem'; | 7 | import { CheckSetPasswordItem } from '../viewmodel/CheckSetPasswordItem'; |
| 8 | - | 8 | +import { AccountCenterItem } from '../viewmodel/AccountCenterItem'; |
| 9 | 9 | ||
| 10 | const TAG = "MineSettingDatasModel" | 10 | const TAG = "MineSettingDatasModel" |
| 11 | 11 | ||
| @@ -111,4 +111,22 @@ export class MineSettingDatasModel { | @@ -111,4 +111,22 @@ export class MineSettingDatasModel { | ||
| 111 | return WDHttp.get<ResponseDTO<CheckSetPasswordItem>>(url) | 111 | return WDHttp.get<ResponseDTO<CheckSetPasswordItem>>(url) |
| 112 | }; | 112 | }; |
| 113 | 113 | ||
| 114 | + static fetchSecurityBindInfo() { | ||
| 115 | + return new Promise<AccountCenterItem>((success, error) => { | ||
| 116 | + Logger.info(TAG, `AccountCenterItem start`); | ||
| 117 | + WDHttp.get<ResponseDTO<AccountCenterItem>>(HttpUrlUtils.querySecurity()).then((navResDTO: ResponseDTO<AccountCenterItem>) => { | ||
| 118 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 119 | + error(navResDTO.message) | ||
| 120 | + return | ||
| 121 | + } | ||
| 122 | + Logger.info(TAG, "AccountCenterItem then,checkSetPasswordResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 123 | + let navigationBean = navResDTO.data as AccountCenterItem | ||
| 124 | + success(navigationBean); | ||
| 125 | + }).catch((err: Error) => { | ||
| 126 | + Logger.error(TAG, `AccountCenterItem catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 127 | + error(err) | ||
| 128 | + }) | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + | ||
| 114 | } | 132 | } |
| 1 | +export class AccountCenterItem { | ||
| 2 | + id: string = "" // 用户id | ||
| 3 | + phone: string = "" //手机号,脱敏处理中间用****代替 | ||
| 4 | + qqBinding: string = "" | ||
| 5 | + wechatBinding: string = "" | ||
| 6 | + weiboBinding: string = "" | ||
| 7 | + appIdBinding: string = "" | ||
| 8 | + ///注销冷静期 | ||
| 9 | + logOffWaitTime: number = 0 | ||
| 10 | + logOffMsg: string = "" | ||
| 11 | +} |
-
Please register or login to post a comment