王士厅
... ... @@ -257,9 +257,9 @@ export struct WdWebLocalComponent {
startProgressTimer() {
this.progressTimerNumber = setTimeout(() => {
animateTo({duration: 1000}, () => {
// animateTo({duration: 1000}, () => {
this.progressOpacity = 0
})
// })
}, 3000)
}
cancelProgressTimer() {
... ... @@ -313,13 +313,13 @@ export struct WdWebLocalComponent {
}
})
.onClick(() => {
animateTo({duration: 1000}, () => {
// animateTo({duration: 1000}, () => {
if (this.progressOpacity <= 0) {
this.progressOpacity = 1
} else {
this.progressOpacity = 0
}
})
// })
})
if (this.isEndPlay){
... ...
... ... @@ -84,6 +84,8 @@ export struct InteractMComponent {
contentDTO.objectId = this.messageModel.InteractMsubM.contentId
contentDTO.relId = this.messageModel.InteractMsubM.contentRelId
contentDTO.relType = this.messageModel.InteractMsubM.contentRelType
contentDTO.customParamTargetLayout = "comment"
ProcessUtils.processPage(contentDTO)
})
}
... ...
... ... @@ -56,7 +56,7 @@ export struct PaperTitleComponent {
})
Text(this.title ?? "")
.margin({ left: 10 })
.margin({ left: 10,top:-3 })
.fontSize(22)
.fontColor($r('app.color.white'))
.fontFamily('SourceHanSerifSC-Heavy')
... ... @@ -132,9 +132,9 @@ export struct PaperTitleComponent {
Row()
.width(DisplayUtils.getDeviceWidth() - 265)
.height('18vp')
// .clip(new Path({
// commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z`
// }))
.clip(new Path({
commands: `M${vp2px(9)} 0 H${vp2px(300)} V${vp2px(18)} L0 ${vp2px(18)} Z`
}))
.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: false, // 渐变颜色是否重复
... ...
... ... @@ -100,12 +100,6 @@ export struct CardSourceInfo {
return flag;
}
showCommentNum() {
const curRouter = router.getState().name;
// return curRouter !== 'PeopleShipHomePage'
return true
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
... ... @@ -150,25 +144,12 @@ export struct CardSourceInfo {
}
showDot() {
// return (this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
// this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
// (this.getContentDtoBean()?.interactData?.commentNum
// // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
// || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
// !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
// (Number
// .parseFloat(this
// .contentDTO.publishTime))
// .indexOf
// ('-') === -1)
// )
let flag = false;
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
if (this.showTime() && !this.isEllipsisActive) {
flag = true
} else if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
flag = true;
} else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
flag = true;
... ... @@ -271,10 +252,8 @@ export struct CardSourceInfo {
}
// 评论数
// if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize(12)
.fontColor($r("app.color.color_B0B0B0"))
... ... @@ -328,17 +307,11 @@ export struct CardSourceInfo {
* @returns
*/
private getContentDtoBean(): ContentDTO {
let content = new ContentDTO
if (this.compDTO == undefined) {
content = this.contentDTO
}
if (this.compDTO.operDataList.length == 0) {
content = this.contentDTO
}
if (!content) {
content = this.compDTO.operDataList[0]
if (this.compDTO.operDataList.length > 0) {
return this.compDTO.operDataList[0]
} else {
return this.contentDTO
}
return content;
}
/**
... ... @@ -366,8 +339,7 @@ export struct CardSourceInfo {
}
// 评论数
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
have = true
} else {
if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
... ...
... ... @@ -196,7 +196,7 @@ export struct RmhTitle {
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
.width('calc(100% - 54vp)')
.width('calc(100% - 65vp)')
// .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))})
}
... ...
... ... @@ -300,6 +300,7 @@ function getParams(item: CommentListItem) : ContentDTO{
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
contentDTO.showComment = true
contentDTO.customParamTargetLayout = "comment"
return contentDTO
}
... ...
... ... @@ -2,7 +2,8 @@ import router from '@ohos.router'
import { PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { ToastUtils } from 'wdKit';
import { SPHelper, ToastUtils } from 'wdKit';
import { SpConstants } from 'wdConstant'
@Component
export struct PeopleShipHomePageNavComponent {
... ... @@ -10,10 +11,16 @@ export struct PeopleShipHomePageNavComponent {
@Consume isAttention: string
@Consume isLoadingAttention: boolean
@Prop attentionOpacity: boolean
@State userId:string = ''
// 页面详情数据
@Prop detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData
aboutToAppear(): void {
this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
}
build() {
RelativeContainer() {
Row() {
... ... @@ -67,52 +74,36 @@ export struct PeopleShipHomePageNavComponent {
})
.visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden))
if (this.isAttention == '0') {
// 关注
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('13vp')
.height('13pv')
.margin({
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
if (this.userId != this.detailModel.userId){
if (this.isAttention == '0') {
// 关注
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('13vp')
.height('13pv')
.margin({
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
}
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.borderRadius(4)
.backgroundColor($r('app.color.color_ED2800'))
.width('54vp')
.height('24vp')
.onClick(() => {
if (this.isLoadingAttention){
return
}
this.isLoadingAttention = true
})
.margin({
left: '12vp',
})
.padding(0)
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
} else {
Button('已关注', { type: ButtonType.Normal, stateEffect: true })
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.borderRadius(4)
.backgroundColor($r('app.color.color_F5F5F5'))
.backgroundColor($r('app.color.color_ED2800'))
.width('54vp')
.height('24vp')
.onClick(() => {
... ... @@ -124,15 +115,33 @@ export struct PeopleShipHomePageNavComponent {
.margin({
left: '12vp',
})
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.padding(0)
.fontSize($r('app.float.vp_12'))
.fontColor($r('app.color.color_999999'))
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
} else {
Button('已关注', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.backgroundColor($r('app.color.color_F5F5F5'))
.width('54vp')
.height('24vp')
.onClick(() => {
if (this.isLoadingAttention){
return
}
this.isLoadingAttention = true
})
.margin({
left: '12vp',
})
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.padding(0)
.fontSize($r('app.float.vp_12'))
.fontColor($r('app.color.color_999999'))
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
}
}
}
.height('100%')
... ...
import measure from '@ohos.measure'
import { DisplayUtils, NumberFormatterUtils } from 'wdKit'
import { DisplayUtils, NumberFormatterUtils, SPHelper } from 'wdKit'
import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent'
import { Logger } from 'wdKit'
... ... @@ -8,6 +8,7 @@ import { InfluenceData, PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent'
import { HWLocationUtils } from 'wdHwAbility'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { SpConstants } from 'wdConstant'
@Component
... ... @@ -32,6 +33,7 @@ export struct PeopleShipHomePageTopComponent {
@State lineInNum: number = 1
@Link topHeight: number
@State provinceName: string = ''
@State userId:string = ''
build() {
Column() {
... ... @@ -242,13 +244,15 @@ export struct PeopleShipHomePageTopComponent {
top: '16vp'
})
// 分享-关注
PeopleShipHomeAttentionComponent()
.width(`calc(100% - ${32 + 'vp'})`)
.margin({
top: '10vp',
bottom: '16vp'
})
if (this.userId != this.detailModel.userId) {
// 分享-关注
PeopleShipHomeAttentionComponent()
.width(`calc(100% - ${32 + 'vp'})`)
.margin({
top: '10vp',
bottom: '16vp'
})
}
Row()
.backgroundColor($r('app.color.color_F5F5F5'))
.width('100%')
... ... @@ -277,6 +281,7 @@ export struct PeopleShipHomePageTopComponent {
this.onIntroductionUpdated()
}
this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
}
// 不听减去2个字-一直到时3行
... ...
... ... @@ -361,7 +361,7 @@ export struct LikeComponent {
.height(24)
if (this.likeCount > 0){
RelativeContainer() {
Image($r('app.media.ic_like_white_Select'))
Image(this.styleType == 1 ? $r('app.media.ic_like_white_Select') : $r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
... ...
import router from '@ohos.router'
import { Params } from 'wdBean';
import { DateTimeUtils, NetworkUtil, NumberFormatterUtils, StringUtils } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index';
import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent';
... ... @@ -102,7 +103,10 @@ struct OtherNormalUserHomePage {
.width('165lpx')
.height('165lpx')
.objectFit(ImageFit.Cover)
}
}.onClick(()=>{
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
})
Column() {
Row() {
... ... @@ -325,7 +329,8 @@ struct OtherNormalUserHomePage {
})
.margin({ left: '31lpx' })
.onClick(() => {
router.back()
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
})
Text(`${this.userName}`)
... ...
... ... @@ -126,6 +126,7 @@ export struct DetailPlayVLivePage {
} break
case LiveMessageOptType.ZH_STOP_LIVE: {
this.liveState = "end"
this.playUrl = ""
this.contentDetailData.liveInfo.liveState = "end"
} break
case LiveMessageOptType.ZH_CHANGE_PAD: {
... ...
... ... @@ -28,7 +28,7 @@ export struct PlayerEndView {
DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
let en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
if (this.contentDetailData.liveInfo?.endTime == null) {
en = DateTimeUtils.getTimeStamp()
en = DateTimeUtils.parseDate(DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
}
const sd = DateTimeUtils.getDuration(sn, en)
this.duration = DateTimeUtils.liveDurationSecondToTime(sd / 1000)
... ...