陈剑华

Merge remote-tracking branch 'origin/main'

@@ -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天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册')  
345 - .fontColor('#FFED2800')  
346 - .fontSize(14)  
347 - .fontWeight(400)  
348 - .padding({ top: 32, left: "31lpx", right: "31lpx" })  
349 - .width('100%') 361 + if (this.userType === 1 && this.logOffWaitTime.length > 0) {
  362 + Text(`请注意:注销后${this.logOffWaitTime}天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册`)
  363 + .fontColor('#FFED2800')
  364 + .fontSize(14)
  365 + .fontWeight(400)
  366 + .padding({ top: 32, left: "31lpx", right: "31lpx" })
  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,25 +7,27 @@ export struct CustomLogoutDialog { @@ -5,25 +7,27 @@ 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 -  
20 - }.margin({ top: 12, left: 16, right: 16 })  
21 23
22 - Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')  
23 - Row() {  
24 - Text('放弃') 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('知道了')
25 .fontSize(16) 30 .fontSize(16)
26 - .fontColor("#999999")  
27 .layoutWeight(1) 31 .layoutWeight(1)
28 .fontWeight(FontWeight.Medium) 32 .fontWeight(FontWeight.Medium)
29 .textAlign(TextAlign.Center) 33 .textAlign(TextAlign.Center)
@@ -32,30 +36,52 @@ export struct CustomLogoutDialog { @@ -32,30 +36,52 @@ export struct CustomLogoutDialog {
32 if (this.cancel) { 36 if (this.cancel) {
33 this.cancel() 37 this.cancel()
34 } 38 }
35 - 39 + router.back()
36 }) 40 })
37 .height('100%') 41 .height('100%')
38 - // Divider().color("#999999").height('100%').width('0.5vp')  
39 - Text('同意注销')  
40 - .fontSize(16)  
41 - .fontColor("#ED2800")  
42 - .layoutWeight(1)  
43 - .fontWeight(FontWeight.Medium)  
44 - .textAlign(TextAlign.Center)  
45 - .border({  
46 - width: { left: 1 },  
47 - color: "#999999",  
48 - style: { left: BorderStyle.Solid }  
49 42
50 - })  
51 - .onClick(() => {  
52 - this.controller.close()  
53 - if (this.confirm) {  
54 - this.confirm()  
55 - }  
56 - })  
57 - .height('100%')  
58 - }.layoutWeight(1).justifyContent(FlexAlign.Center) 43 + } else {
  44 + Text(`注销后${this.logOffWaitTime}天内无法重新登录注册人民日报app,是否确认注销?`) {
  45 + }.margin({ top: 12, left: 16, right: 16 })
  46 +
  47 + Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
  48 + Row() {
  49 + Text('放弃')
  50 + .fontSize(16)
  51 + .fontColor("#999999")
  52 + .layoutWeight(1)
  53 + .fontWeight(FontWeight.Medium)
  54 + .textAlign(TextAlign.Center)
  55 + .onClick(() => {
  56 + this.controller.close()
  57 + if (this.cancel) {
  58 + this.cancel()
  59 + }
  60 +
  61 + })
  62 + .height('100%')
  63 + // Divider().color("#999999").height('100%').width('0.5vp')
  64 + Text('同意注销')
  65 + .fontSize(16)
  66 + .fontColor("#ED2800")
  67 + .layoutWeight(1)
  68 + .fontWeight(FontWeight.Medium)
  69 + .textAlign(TextAlign.Center)
  70 + .border({
  71 + width: { left: 1 },
  72 + color: "#999999",
  73 + style: { left: BorderStyle.Solid }
  74 +
  75 + })
  76 + .onClick(() => {
  77 + this.controller.close()
  78 + if (this.confirm) {
  79 + this.confirm()
  80 + }
  81 + })
  82 + .height('100%')
  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 +}
@@ -17,6 +17,6 @@ @@ -17,6 +17,6 @@
17 "wdRouter": "file:../../commons/wdRouter", 17 "wdRouter": "file:../../commons/wdRouter",
18 "wdTracking": "file:../../features/wdTracking", 18 "wdTracking": "file:../../features/wdTracking",
19 "wdShare": "file:../../features/wdShare", 19 "wdShare": "file:../../features/wdShare",
20 - "@rongcloud/imlib": "file:./src/main/libs/RongIMLib.har" 20 + "@rongcloud/imlib": "file:./src/main/libs/RongIMLib-HarmonyOS-signed-V1.1.0.har"
21 } 21 }
22 } 22 }
@@ -14,7 +14,7 @@ import { LiveMessageIsHistoryMessage, LiveMessageOptType } from 'wdBean/src/main @@ -14,7 +14,7 @@ import { LiveMessageIsHistoryMessage, LiveMessageOptType } from 'wdBean/src/main
14 14
15 const TAG = "LiveRoomManager" 15 const TAG = "LiveRoomManager"
16 16
17 -export class LiveRoom extends ChatroomStatusListener { 17 +export class LiveRoom implements ChatroomStatusListener {
18 18
19 connectRoomBaseInfo?: LiveRoomBaseInfo 19 connectRoomBaseInfo?: LiveRoomBaseInfo
20 20
@@ -28,7 +28,6 @@ export class LiveRoom extends ChatroomStatusListener { @@ -28,7 +28,6 @@ export class LiveRoom extends ChatroomStatusListener {
28 onLiveMessage?: (liveRoomItemBean: LiveRoomItemBean) => void 28 onLiveMessage?: (liveRoomItemBean: LiveRoomItemBean) => void
29 29
30 constructor(baseInfo?: LiveRoomBaseInfo) { 30 constructor(baseInfo?: LiveRoomBaseInfo) {
31 - super()  
32 this.connectRoomBaseInfo = baseInfo 31 this.connectRoomBaseInfo = baseInfo
33 } 32 }
34 33
@@ -184,9 +184,11 @@ export class LiveRoomManager { @@ -184,9 +184,11 @@ export class LiveRoomManager {
184 if (data.data) { 184 if (data.data) {
185 success(data.data) 185 success(data.data)
186 } else { 186 } else {
  187 + Logger.error(TAG, "接口没返回im token")
187 fail(data.message) 188 fail(data.message)
188 } 189 }
189 }).catch((error: Error) => { 190 }).catch((error: Error) => {
  191 + Logger.error(TAG, "error " + JSON.stringify(error))
190 fail(error.message) 192 fail(error.message)
191 }) 193 })
192 }) 194 })
@@ -51,6 +51,7 @@ export struct DetailDialog { @@ -51,6 +51,7 @@ export struct DetailDialog {
51 .margin({ top: 8, bottom: 8 }) 51 .margin({ top: 8, bottom: 8 })
52 } 52 }
53 .alignItems(HorizontalAlign.Start) 53 .alignItems(HorizontalAlign.Start)
  54 + .margin({right:4})
54 55
55 } 56 }
56 .height(200) 57 .height(200)
@@ -79,7 +80,7 @@ export struct DetailDialog { @@ -79,7 +80,7 @@ export struct DetailDialog {
79 top: 20, 80 top: 20,
80 bottom: 30, 81 bottom: 30,
81 left: 16, 82 left: 16,
82 - right: 16 83 + right: 12 //给滚动条预留4像素
83 }) 84 })
84 85
85 } 86 }
@@ -136,9 +136,9 @@ const TAG = 'VoiceRecoginizer' @@ -136,9 +136,9 @@ const TAG = 'VoiceRecoginizer'
136 136
137 export class VoiceRecoginizer { 137 export class VoiceRecoginizer {
138 private static MICROPHONEMISSION: Permissions = 'ohos.permission.MICROPHONE' 138 private static MICROPHONEMISSION: Permissions = 'ohos.permission.MICROPHONE'
139 - private static READMEDIA: Permissions = 'ohos.permission.READ_MEDIA' 139 + private static READMEDIA: Permissions = 'ohos.permission.READ_IMAGEVIDEO'
140 private static INTENT: Permissions = "ohos.permission.INTERNET" 140 private static INTENT: Permissions = "ohos.permission.INTERNET"
141 - private static WRITE_MEDIA: Permissions = "ohos.permission.WRITE_MEDIA" 141 + private static WRITE_MEDIA: Permissions = "ohos.permission.WRITE_IMAGEVIDEO"
142 142
143 private static appKey = "EospGmM6mdPljjjm" 143 private static appKey = "EospGmM6mdPljjjm"
144 private static url = "wss://nls-gateway.cn-shanghai.aliyuncs.com:443/ws/v1" 144 private static url = "wss://nls-gateway.cn-shanghai.aliyuncs.com:443/ws/v1"
@@ -184,7 +184,7 @@ @@ -184,7 +184,7 @@
184 ], 184 ],
185 "requestPermissions": [ 185 "requestPermissions": [
186 { 186 {
187 - "name": "ohos.permission.READ_MEDIA", 187 + "name": "ohos.permission.READ_IMAGEVIDEO",
188 "reason": "$string:permission_photo_tip", 188 "reason": "$string:permission_photo_tip",
189 "usedScene": { 189 "usedScene": {
190 "abilities": [ 190 "abilities": [
@@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
194 } 194 }
195 }, 195 },
196 { 196 {
197 - "name": "ohos.permission.WRITE_MEDIA", 197 + "name": "ohos.permission.WRITE_IMAGEVIDEO",
198 "reason": "$string:permission_photo_tip", 198 "reason": "$string:permission_photo_tip",
199 "usedScene": { 199 "usedScene": {
200 "abilities": [ 200 "abilities": [