王士厅
Showing 24 changed files with 133 additions and 37 deletions
... ... @@ -34,6 +34,7 @@ export struct CardParser {
@ObjectLink compDTO: CompDTO
pageShowTime: number = 0;
pageHideTime: number = 0;
isPeopleShipHome: boolean = false;
aboutToAppear(): void {
console.log('CardParser-', JSON.stringify(this.contentDTO))
... ... @@ -164,7 +165,8 @@ export struct CardParser {
contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
pageName: this.pageName,
isPeopleShipHome:this.isPeopleShipHome
})
} else if (contentDTO.appStyle === CompStyle.Card_21) {
Card21Component({
... ...
... ... @@ -6,6 +6,8 @@ import {
NumberFormatterUtils,
DisplayUtils,
NetworkUtil,
EmitterUtils,
EmitterEventId,
FastClickUtil
} from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
... ... @@ -45,6 +47,7 @@ import { detailedSkeleton } from './skeleton/detailSkeleton';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
import { componentUtils, window } from '@kit.ArkUI';
const TAG = 'DynamicDetailComponent'
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
... ... @@ -79,6 +82,8 @@ export struct DynamicDetailComponent {
@State operationButtonList: string[] = []
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State offsetY: number = 0
@State isScrollTop: boolean = true
pageParam: ParamType = {}
commentListAreaInfo?: Area
... ... @@ -91,6 +96,27 @@ export struct DynamicDetailComponent {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
//注册通知,来自别的组件的评论成功通知
EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => {
if (targetId) {
if (targetId == this.publishCommentModel.targetId) {
// 滚动到评论列表
if (this.commentListAreaInfo) {
// let height = DisplayUtils.getDeviceHeight() / 2
let offSetY = this.commentListAreaInfo?.globalPosition.y as number
Logger.debug(TAG, "滚动至yOffset: " + (offSetY - 100))
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY - 100,
xOffset: 0,
animation: { duration: 1000, curve: Curve.Ease }
})
}
}
}
})
}
onPageHide() {
... ... @@ -577,8 +603,28 @@ export struct DynamicDetailComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
onCommentIconClick:()=>{
const info = componentUtils.getRectangleById('comment');
console.log(JSON.stringify(info))
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
}
// 定位到评论区域
if (this.isScrollTop) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: this.offsetY,
animation: true
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
})
.height(100)
}
.margin({bottom: 65})
}
... ...
... ... @@ -40,6 +40,7 @@ export struct LiveFollowComponent {
bottomLeft: 90
})
Row() {
Stack({alignContent: Alignment.Bottom}){
//号主头像
Image(this.rmhInfo.rmhHeadUrl)
.alt($r('app.media.icon_default_head_mater'))
... ... @@ -56,6 +57,17 @@ export struct LiveFollowComponent {
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
if(this.contentDetailData.rmhInfo?.authIcon){
Row(){
Image(this.contentDetailData.rmhInfo?.authIcon)
.width(10)
.height(10)
.objectFit(ImageFit.Cover)
}.width(24)
.justifyContent(FlexAlign.End)
}
}.width(24).height(24)
//号主名称
Text(this.rmhInfo.rmhName)
.fontColor(Color.White)
... ...
... ... @@ -25,6 +25,7 @@ export struct RmhTitle {
@Prop rmhInfo: RmhInfoDTO
@Prop publishTime: string | undefined
@State loadImg: boolean = false;
isPeopleShipHome: boolean = false;
/**
* 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏
*/
... ... @@ -194,6 +195,8 @@ export struct RmhTitle {
.width(CommonConstants.FULL_WIDTH)
.margin({ bottom: 10 })
.onClick(()=>{
///个人主页 动态头像不能跳转
if (this.isPeopleShipHome) return
// 跳转号主
ProcessUtils.gotoPeopleShipHomePage( this.rmhInfo?.rmhId,this.rmhInfo?.banControl,this.rmhInfo?.cnMainControl,this.rmhInfo?.userId,this.rmhInfo?.userType)
... ...
... ... @@ -9,6 +9,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import { Notes } from './notes';
const TAG = 'Card20Component';
... ... @@ -24,6 +25,7 @@ export struct Card20Component {
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State textArr: textItem[] = []
isPeopleShipHome: boolean = false;
aboutToAppear(): void {
this.titleInit();
... ... @@ -47,12 +49,27 @@ export struct Card20Component {
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
pageName: this.pageName,
isPeopleShipHome:this.isPeopleShipHome
}
) // 标题
if (this.contentDTO.newsTitle) {
Text() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center)
}
if (this.contentDTO.top === 1) {
Notes({ newTags: '置顶' }).height(29).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
... ... @@ -68,10 +85,16 @@ export struct Card20Component {
}
.fontSize($r('app.float.font_size_18'))
.fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.textOverflowStyle(3)
.margin({ bottom: 8 })
.lineHeight(22)
.maxLines(3)
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
0 )
.width('100%')
}.alignContent(Alignment.TopStart)
}
if (this.contentDTO.fullColumnImgUrls[0]) {
createImg({ contentDTO: this.contentDTO })
... ...
... ... @@ -123,7 +123,7 @@ export struct CommentComponent {
.height(16)
.width(3)
Text('全部评论')
.fontSize(18)// .fontColor('#222222')
.fontSize(16)// .fontColor('#222222')
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
... ... @@ -131,7 +131,7 @@ export struct CommentComponent {
.margin({ left: 16 })
Image($r('app.media.close_button'))
Image($r('app.media.comment_close'))
.height(16)
.width(16)
.margin({ right: 16 })
... ...
... ... @@ -146,14 +146,14 @@ struct CommentListDialog {
.height(16)
.width(3)
Text('全部评论')
.fontSize(18)// .fontColor('#222222')
.fontSize(16)// .fontColor('#222222')
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
}
.margin({ left: 16 })
Image($r('app.media.close_button'))
Image($r('app.media.comment_close'))
.height(16)
.width(16)
.margin({ right: 16 })// .visibility(this.showCloseIcon ? Visibility.Visible : Visibility.Hidden)
... ...
... ... @@ -496,7 +496,7 @@ class CommentViewModel {
}
HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => {
if (!result.data || result.data.mainControl != 1) {
ToastUtils.longToast("暂时无法查看该创作者主页")
// ToastUtils.longToast("暂时无法查看该创作者主页")
return
}
... ...
... ... @@ -25,7 +25,11 @@ export default struct MinePageUserSimpleInfoUI {
///已登录状态,先获取本地数据
this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string
this.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
if (userType && userType.length > 0) {
this.userType = userType
}
this.getUserInfo()
}else{
this.headPhotoUrl = ""
... ... @@ -202,6 +206,8 @@ export default struct MinePageUserSimpleInfoUI {
if(StringUtils.isNotEmpty(this.levelHead)){
UserDataLocal.setUserLevelHeaderUrl(this.levelHead + "")
}else {
UserDataLocal.setUserLevelHeaderUrl("")
}
}
}).catch((err:Error)=>{
... ...
... ... @@ -21,7 +21,7 @@ export struct ChildCommentComponent {
Column() {
Row() {
Stack({ alignContent: Alignment.Center }) {
Image(this.data.fromUserHeader)
Image(this.data.fromUserHeader&&this.data.fromUserHeader.length>0?this.data.fromUserHeader:(this.data.fromUserType === 1?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')))
.alt($r('app.media.default_head'))
.objectFit(ImageFit.Auto)
.width('69lpx')
... ...
... ... @@ -167,7 +167,7 @@ export struct HomePageBottomCommentComponent {
if (item.parentCommentVo != null) {
parentCommentUserName = item.parentCommentVo.fromUserName
}
data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime,
data.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle, item.createTime,
commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId,
item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent,
parentCommentUserName))
... ... @@ -177,7 +177,7 @@ export struct HomePageBottomCommentComponent {
data.forEach((item) => {
let publishTime =
DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle,
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle,
publishTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType,
item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus,
item.parentCommentContent, item.parentCommentUserName))
... ... @@ -210,7 +210,7 @@ export struct HomePageBottomCommentComponent {
data.forEach((item) => {
let publishTime =
DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle,
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle,
publishTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType,
item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus,
item.parentCommentContent, item.parentCommentUserName))
... ...
... ... @@ -172,12 +172,12 @@ export struct OtherHomePageBottomCommentComponent {
if (item.parentCommentVo != null) {
parentCommentUserName = item.parentCommentVo.fromUserName
}
data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName))
data.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName))
})
if(status.commentIdList.length === 0){
data.forEach((item) => {
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
})
this.data_comment.notifyDataReload()
... ... @@ -206,7 +206,7 @@ export struct OtherHomePageBottomCommentComponent {
})
data.forEach((item) => {
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
})
this.data_comment.notifyDataReload()
... ...
... ... @@ -535,7 +535,7 @@ export struct PaperSingleColumn999CardView {
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
.fontColor(this.isRead ? 0x848484 : '#222222')
.fontColor(this.isRead ? '#808080' : '#222222')
.fontSize(14)
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
... ...
... ... @@ -88,7 +88,7 @@ export struct PeopleShipHomeArticleListComponent {
ForEach(this.arr, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
CardParser({compDTO:new CompDTO, contentDTO: item })
CardParser({compDTO:new CompDTO, contentDTO: item , isPeopleShipHome:true})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}.width("100%")
... ...
... ... @@ -78,25 +78,28 @@ export struct LiveLikeComponent {
transLikeStyle(): ILikeStyleResp {
if (this.likesStyle === 'love' || this.likesStyle === 'thumb') {
return {
url: this.likeStatus ? $r(`app.media.ic_like_check`) :
this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`),
url: this.likeStatus ? $r('app.media.ic_like_check') :
this.styleType == 1 ? $r('app.media.icon_like_default') : $r('app.media.ic_like_uncheck'),
name: '赞'
}
} else if (this.likesStyle === 'pray') {
return {
url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
url: this.likeStatus ? $r('app.media.ic_thub_check') :
this.styleType == 1 ? $r('app.media.icon_like_unselect_light_pray') :
$r('app.media.icon_like_unselect_night_pray'),
name: '祈祷'
}
} else if (this.likesStyle === 'mourning') {
return {
url: this.likeStatus ? $r(`app.media.ic_candle_check`) :
$r(`app.media.ic_candle_uncheck`),
url: this.likeStatus ? $r('app.media.ic_candle_check') :
this.styleType == 1 ? $r('app.media.icon_like_unselect_light_candle') :
$r('app.media.icon_like_unselect_night_candle'),
name: '默哀'
}
}
return {
url: this.likeStatus ? $r(`app.media.ic_like_check`) :
this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`),
url: this.likeStatus ? $r('app.media.ic_like_check') :
this.styleType == 1 ? $r('app.media.icon_like_default') : $r('app.media.ic_like_uncheck'),
name: '点赞'
}
}
... ... @@ -106,8 +109,8 @@ export struct LiveLikeComponent {
Stack({ alignContent: Alignment.TopEnd }) {
Column() {
Image(this.transLikeStyle().url)
.width(24)
.height(24)
.width(((this.likesStyle === 'mourning'||this.likesStyle === 'pray')&& !this.likeStatus) ?36:24)
.height(((this.likesStyle === 'mourning'||this.likesStyle === 'pray')&& !this.likeStatus)?36:24)
}
.justifyContent(FlexAlign.Center)
.width(36)
... ...
... ... @@ -252,7 +252,7 @@ export struct LiveOperRowListView {
})
}
.width(48)
.margin({left:this.isLlive?0:10})
.margin({left:this.isLlive?0:5})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
}
... ...
... ... @@ -24,7 +24,7 @@ struct MineHomePage {
@State userName:string = ""
@State headPhotoUrl:string = ""
@State levelHead:string = ""
userType:string = "1"
@State userType:string = "1"
@State levelId:number = 0
@State desc:string = "点击添加简介,让大家认识你" //text 搞两个样式,如果三行,就显示 另外一个text 没有显示高度的
@State isHasIntroduction: boolean = false
... ... @@ -101,7 +101,7 @@ struct MineHomePage {
//用户信息区域
Row() {
Stack(){
Image(this.headPhotoUrl)
Image(this.headPhotoUrl&&this.headPhotoUrl.length>0?this.headPhotoUrl:(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')))
.alt($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
... ...
... ... @@ -159,7 +159,7 @@ struct VisitorCommentPage {
let publishTime =
DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, publishTime,
this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName,item.fromUserType, item.targetTitle, publishTime,
commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId,
item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent,
parentCommentUserName))
... ...
... ... @@ -44,9 +44,10 @@ export class CommentListItem{
isShowAll:boolean = false
constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number,targetRelId: string,targetRelObjectId: string,targetRelType: number,targetStatus: number,checkStatus:number,parentCommentContent:string,parentCommentUserName:string) {
constructor(fromUserHeader:string,fromUserName:string,fromUserType: number,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number,targetRelId: string,targetRelObjectId: string,targetRelType: number,targetStatus: number,checkStatus:number,parentCommentContent:string,parentCommentUserName:string) {
this.fromUserHeader = fromUserHeader
this.fromUserName = fromUserName
this.fromUserType = fromUserType
this.commentContent = commentContent
this.targetTitle = targetTitle
this.createTime = createTime
... ...
... ... @@ -148,7 +148,7 @@ export class LoginModel {
HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeUrl(), bean).then((data: ResponseDTO<CheckVerifyBean>) => {
Logger.debug("LoginViewModel:success2 ", data.message)
if (!data || !data.data) {
fail("数据为空")
fail(data.message?data.message:"数据为空")
return
}
if (data.code != 0) {
... ...