wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 升级融云SDK 1.1.0
  ref |> 调整用户注销区分普通用户和号主情况
  滚动条与字重叠
  fix: 时间练卡ui
  长图截取
  fix: 小视频横划卡边缘消失问题,大专题卡底部间距
  动画消失后销毁
@@ -165,10 +165,9 @@ export struct Card10Component { @@ -165,10 +165,9 @@ export struct Card10Component {
165 left: $r('app.float.card_comp_pagePadding_lf'), 165 left: $r('app.float.card_comp_pagePadding_lf'),
166 right: $r('app.float.card_comp_pagePadding_lf'), 166 right: $r('app.float.card_comp_pagePadding_lf'),
167 top: $r('app.float.card_comp_pagePadding_tb'), 167 top: $r('app.float.card_comp_pagePadding_tb'),
168 - bottom: 14 168 + bottom: $r('app.float.card_comp_pagePadding_tb')
169 }) 169 })
170 .backgroundColor($r("app.color.white")) 170 .backgroundColor($r("app.color.white"))
171 - .margin({ bottom: 8 })  
172 } 171 }
173 172
174 @Builder 173 @Builder
@@ -173,6 +173,8 @@ struct createImg { @@ -173,6 +173,8 @@ struct createImg {
173 if (picWidth && picHeight) { 173 if (picWidth && picHeight) {
174 if (picWidth / picHeight > 2/1) { 174 if (picWidth / picHeight > 2/1) {
175 return 1; //横长图 175 return 1; //横长图
  176 + } else if (picWidth/picHeight > 1/2 && picWidth/picHeight < 3/4) { //截取图片
  177 + return 4;
176 } else if (picWidth/picHeight < 1/2) { 178 } else if (picWidth/picHeight < 1/2) {
177 return 2; //竖长图 179 return 2; //竖长图
178 } else { 180 } else {
@@ -236,6 +238,25 @@ struct createImg { @@ -236,6 +238,25 @@ struct createImg {
236 238
237 } 239 }
238 } 240 }
  241 + } else if (this.getPicType(item.weight, item.height) === 4) {
  242 + GridCol({
  243 + span: this.onePicW > this.onePicH ? 12 : 8
  244 + }) {
  245 + Image(this.loadImg ? item.fullUrl : '')
  246 + .backgroundColor(0xf5f5f5)
  247 + // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
  248 + .width('100%')
  249 + .autoResize(true)
  250 + .objectFit(ImageFit.Cover)
  251 + .autoResize(true)
  252 + .aspectRatio(3/4)
  253 + .borderRadius(this.caclImageRadius(index))
  254 + .opacity(!item.weight && !item.height ? 0 : 1)
  255 + .onComplete((event?) => {
  256 + this.onePicW = event?.width || 0;
  257 + this.onePicH = event?.height || 0;
  258 + })
  259 + }
239 } else { 260 } else {
240 GridCol({ 261 GridCol({
241 span: this.onePicW > this.onePicH ? 12 : 8 262 span: this.onePicW > this.onePicH ? 12 : 8
@@ -235,7 +235,7 @@ export struct Card9Component { @@ -235,7 +235,7 @@ export struct Card9Component {
235 .maxLines(2) 235 .maxLines(2)
236 .textOverflow({ overflow: TextOverflow.Ellipsis }) 236 .textOverflow({ overflow: TextOverflow.Ellipsis })
237 .alignSelf(ItemAlign.Start) 237 .alignSelf(ItemAlign.Start)
238 - .padding({ bottom: 20, left: 10 }) 238 + .padding({ bottom: 16, left: 10 })
239 .border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed}) 239 .border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed})
240 .margin({ left: 4 }) 240 .margin({ left: 4 })
241 } 241 }
@@ -125,6 +125,7 @@ export struct ZhSingleRow02 { @@ -125,6 +125,7 @@ export struct ZhSingleRow02 {
125 .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)}) 125 .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
126 } 126 }
127 } 127 }
  128 + .padding({right: 10})
128 } 129 }
129 .width(CommonConstants.FULL_WIDTH) 130 .width(CommonConstants.FULL_WIDTH)
130 .height(208) 131 .height(208)
@@ -159,7 +160,7 @@ export struct ZhSingleRow02 { @@ -159,7 +160,7 @@ export struct ZhSingleRow02 {
159 bottom: $r('app.float.card_comp_pagePadding_tb') 160 bottom: $r('app.float.card_comp_pagePadding_tb')
160 }) 161 })
161 .backgroundColor(0xffffff) 162 .backgroundColor(0xffffff)
162 - .width('101%') 163 + .width('102%')
163 .margin({ bottom: 8, left: -6 }) 164 .margin({ bottom: 8, left: -6 })
164 } 165 }
165 166
@@ -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 })
@@ -16,6 +16,7 @@ import { window } from '@kit.ArkUI'; @@ -16,6 +16,7 @@ import { window } from '@kit.ArkUI';
16 import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; 16 import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
17 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; 17 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
18 import { LottieView } from 'wdComponent/Index' 18 import { LottieView } from 'wdComponent/Index'
  19 +import lottie from '@ohos/lottie';
19 20
20 interface loadMoreData { 21 interface loadMoreData {
21 pageNum: number; 22 pageNum: number;
@@ -356,9 +357,10 @@ export struct VideoChannelDetail { @@ -356,9 +357,10 @@ export struct VideoChannelDetail {
356 autoplay: true, 357 autoplay: true,
357 loop: true 358 loop: true
358 }) 359 })
359 - .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) 360 + .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.None)
360 .onTouch(() => { 361 .onTouch(() => {
361 this.GestureLoadStrategy = 1 362 this.GestureLoadStrategy = 1
  363 + lottie.destroy('slider_up_view_more')
362 }) 364 })
363 365
364 } 366 }
@@ -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 }