xugenyuan

ref |> 调整用户注销区分普通用户和号主情况

... ... @@ -12,6 +12,9 @@ import { CustomLogoutDialog } from './CustomLogoutDialog';
import { emitter } from '@kit.BasicServicesKit';
import { ConfirmLogoutDialog } from './ConfirmLogoutDialog';
import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { AccountCenterItem } from '../../viewmodel/AccountCenterItem'
import { it } from '@ohos/hypium';
export { SettingPasswordParams } from "wdLogin"
@Component
... ... @@ -42,6 +45,11 @@ export struct AccountAndSecurityLayout {
maskColor:"#00000000"
})
accountCenterItem?: AccountCenterItem
@State logOffWaitTime: string = "7"
@State logOffMsg: string = ""
@State userType: number = 0
//注销账户 浏览埋点
logoutLayoutHide(){
this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
... ... @@ -68,6 +76,9 @@ export struct AccountAndSecurityLayout {
logoutViewModel = new LogoutViewModel()
dialogController: CustomDialogController = new CustomDialogController({
builder: CustomLogoutDialog({
logOffWaitTime: this.logOffWaitTime,
logOffMsg: this.logOffMsg,
userType: this.userType,
cancel: () => {
},
... ... @@ -98,6 +109,7 @@ export struct AccountAndSecurityLayout {
aboutToAppear() {
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
this.userType = Number(SPHelper.default.getSync(SpConstants.USER_Type, ''))
// 获取设置页面数据
this.getAccountAndSecurityData()
this.addEmitEvent()
... ... @@ -128,6 +140,11 @@ export struct AccountAndSecurityLayout {
}
this.listData = oldList
MineSettingDatasModel.fetchSecurityBindInfo().then((item) => {
this.accountCenterItem = item
this.logOffWaitTime = item.logOffWaitTime > 0 ? item.logOffWaitTime + "" : "7"
this.logOffMsg = item.logOffMsg
})
}
addEmitEvent(){
... ... @@ -341,12 +358,14 @@ export struct AccountAndSecurityLayout {
.padding({ top: 24, left: "62lpx" })
.width('100%')
Text('请注意:注销后7天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册')
.fontColor('#FFED2800')
.fontSize(14)
.fontWeight(400)
.padding({ top: 32, left: "31lpx", right: "31lpx" })
.width('100%')
if (this.userType === 1 && this.logOffWaitTime.length > 0) {
Text(`请注意:注销后${this.logOffWaitTime}天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册`)
.fontColor('#FFED2800')
.fontSize(14)
.fontWeight(400)
.padding({ top: 32, left: "31lpx", right: "31lpx" })
.width('100%')
}
}.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
... ...
import { router } from '@kit.ArkUI'
@CustomDialog
export struct CustomLogoutDialog {
controller: CustomDialogController
... ... @@ -5,25 +7,27 @@ export struct CustomLogoutDialog {
}
confirm: () => void = () => {
}
@Prop logOffWaitTime: string = "7"
@Prop logOffMsg: string = ""
@Prop userType: number = 0
build() {
Column() {
Text("温馨提示")
Text(this.userType !== 1 ? "温馨提醒" : "注销账号")
.fontColor("#222222")
.fontSize(18)
.width("100%")
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Text('注销后7天内无法重新登录注册人民日报app,是否确认注销?') {
}.margin({ top: 12, left: 16, right: 16 })
Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
Row() {
Text('放弃')
if (this.userType !== 1) {
Text(this.logOffMsg.length > 0 ? this.logOffMsg : "您确认要注销账号吗? 请联系rmh@pdnews.cn邮箱") {
}.margin({ top: 12, left: 16, right: 16 })
.fontColor("#999999")
Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
Text('知道了')
.fontSize(16)
.fontColor("#999999")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
... ... @@ -32,30 +36,52 @@ export struct CustomLogoutDialog {
if (this.cancel) {
this.cancel()
}
router.back()
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('同意注销')
.fontSize(16)
.fontColor("#ED2800")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
.onClick(() => {
this.controller.close()
if (this.confirm) {
this.confirm()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
} else {
Text(`注销后${this.logOffWaitTime}天内无法重新登录注册人民日报app,是否确认注销?`) {
}.margin({ top: 12, left: 16, right: 16 })
Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
Row() {
Text('放弃')
.fontSize(16)
.fontColor("#999999")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.onClick(() => {
this.controller.close()
if (this.cancel) {
this.cancel()
}
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('同意注销')
.fontSize(16)
.fontColor("#ED2800")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
.onClick(() => {
this.controller.close()
if (this.confirm) {
this.confirm()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}
}.height(161).backgroundColor(Color.White).borderRadius(6).width('74%')
}
}
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@ import { Logger, SPHelper } from 'wdKit';
import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem';
import { SpConstants } from 'wdConstant/Index';
import { CheckSetPasswordItem } from '../viewmodel/CheckSetPasswordItem';
import { AccountCenterItem } from '../viewmodel/AccountCenterItem';
const TAG = "MineSettingDatasModel"
... ... @@ -111,4 +111,22 @@ export class MineSettingDatasModel {
return WDHttp.get<ResponseDTO<CheckSetPasswordItem>>(url)
};
static fetchSecurityBindInfo() {
return new Promise<AccountCenterItem>((success, error) => {
Logger.info(TAG, `AccountCenterItem start`);
WDHttp.get<ResponseDTO<AccountCenterItem>>(HttpUrlUtils.querySecurity()).then((navResDTO: ResponseDTO<AccountCenterItem>) => {
if (!navResDTO || navResDTO.code != 0) {
error(navResDTO.message)
return
}
Logger.info(TAG, "AccountCenterItem then,checkSetPasswordResDTO.timeStamp:" + navResDTO.timestamp);
let navigationBean = navResDTO.data as AccountCenterItem
success(navigationBean);
}).catch((err: Error) => {
Logger.error(TAG, `AccountCenterItem catch, error.name : ${err.name}, error.message:${err.message}`);
error(err)
})
})
}
}
... ...
export class AccountCenterItem {
id: string = "" // 用户id
phone: string = "" //手机号,脱敏处理中间用****代替
qqBinding: string = ""
wechatBinding: string = ""
weiboBinding: string = ""
appIdBinding: string = ""
///注销冷静期
logOffWaitTime: number = 0
logOffMsg: string = ""
}
\ No newline at end of file
... ...