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 {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: 14
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
@Builder
... ...
... ... @@ -173,6 +173,8 @@ struct createImg {
if (picWidth && picHeight) {
if (picWidth / picHeight > 2/1) {
return 1; //横长图
} else if (picWidth/picHeight > 1/2 && picWidth/picHeight < 3/4) { //截取图片
return 4;
} else if (picWidth/picHeight < 1/2) {
return 2; //竖长图
} else {
... ... @@ -236,6 +238,25 @@ struct createImg {
}
}
} else if (this.getPicType(item.weight, item.height) === 4) {
GridCol({
span: this.onePicW > this.onePicH ? 12 : 8
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
// .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
.width('100%')
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
}
} else {
GridCol({
span: this.onePicW > this.onePicH ? 12 : 8
... ...
... ... @@ -235,7 +235,7 @@ export struct Card9Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignSelf(ItemAlign.Start)
.padding({ bottom: 20, left: 10 })
.padding({ bottom: 16, left: 10 })
.border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed})
.margin({ left: 4 })
}
... ...
... ... @@ -125,6 +125,7 @@ export struct ZhSingleRow02 {
.margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
}
}
.padding({right: 10})
}
.width(CommonConstants.FULL_WIDTH)
.height(208)
... ... @@ -159,7 +160,7 @@ export struct ZhSingleRow02 {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width('101%')
.width('102%')
.margin({ bottom: 8, left: -6 })
}
... ...
... ... @@ -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
... ...
... ... @@ -17,6 +17,6 @@
"wdRouter": "file:../../commons/wdRouter",
"wdTracking": "file:../../features/wdTracking",
"wdShare": "file:../../features/wdShare",
"@rongcloud/imlib": "file:./src/main/libs/RongIMLib.har"
"@rongcloud/imlib": "file:./src/main/libs/RongIMLib-HarmonyOS-signed-V1.1.0.har"
}
}
... ...
... ... @@ -14,7 +14,7 @@ import { LiveMessageIsHistoryMessage, LiveMessageOptType } from 'wdBean/src/main
const TAG = "LiveRoomManager"
export class LiveRoom extends ChatroomStatusListener {
export class LiveRoom implements ChatroomStatusListener {
connectRoomBaseInfo?: LiveRoomBaseInfo
... ... @@ -28,7 +28,6 @@ export class LiveRoom extends ChatroomStatusListener {
onLiveMessage?: (liveRoomItemBean: LiveRoomItemBean) => void
constructor(baseInfo?: LiveRoomBaseInfo) {
super()
this.connectRoomBaseInfo = baseInfo
}
... ...
... ... @@ -184,9 +184,11 @@ export class LiveRoomManager {
if (data.data) {
success(data.data)
} else {
Logger.error(TAG, "接口没返回im token")
fail(data.message)
}
}).catch((error: Error) => {
Logger.error(TAG, "error " + JSON.stringify(error))
fail(error.message)
})
})
... ...
... ... @@ -16,6 +16,7 @@ import { window } from '@kit.ArkUI';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LottieView } from 'wdComponent/Index'
import lottie from '@ohos/lottie';
interface loadMoreData {
pageNum: number;
... ... @@ -356,9 +357,10 @@ export struct VideoChannelDetail {
autoplay: true,
loop: true
})
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.None)
.onTouch(() => {
this.GestureLoadStrategy = 1
lottie.destroy('slider_up_view_more')
})
}
... ...
... ... @@ -51,6 +51,7 @@ export struct DetailDialog {
.margin({ top: 8, bottom: 8 })
}
.alignItems(HorizontalAlign.Start)
.margin({right:4})
}
.height(200)
... ... @@ -79,7 +80,7 @@ export struct DetailDialog {
top: 20,
bottom: 30,
left: 16,
right: 16
right: 12 //给滚动条预留4像素
})
}
... ...