douaojie

Merge remote-tracking branch 'origin/main'

... ... @@ -340,6 +340,11 @@ export class HttpUrlUtils {
static readonly SEND_MESSAGE_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/touch?createTime=";
/**
* 点击具体某个消息
*/
static readonly ENTER_MESSAGE_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/readAll?contentType=";
/**
* 推送消息
*/
static readonly HISTORY_PUSH_MESSAGE_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/push";
... ... @@ -780,4 +785,10 @@ export class HttpUrlUtils {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.HISTORY_PUSH_MESSAGE_PATH
return url
}
//点击具体某个消息
static getEnterClickMessageUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.ENTER_MESSAGE_PATH
return url
}
}
... ...
... ... @@ -52,35 +52,11 @@ export struct ImageAndTextPageComponent {
@State isNetConnected: boolean = true
@State info: Area | null = null
@State likeNum: number = 0
@State reachEndIncreament : number = 0
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
build() {
Column() {
// 发布时间
Row() {
Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(13)
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.padding({ left: 15, right: 15, })
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Bottom)
Row() {
Image($r('app.media.line'))
.width('100%')
.height(6)
.objectFit(ImageFit.Cover)
.margin({ top: 10 })
}
.padding({ left: 15, right: 15 })
.backgroundColor(Color.White)
Stack({ alignContent: Alignment.Top }) {
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
... ... @@ -89,7 +65,7 @@ export struct ImageAndTextPageComponent {
action: this.action,
isPageEnd: $isPageEnd
})
.padding({ bottom: 10 })
.padding({ top: 15, bottom: 10 })
Column() {
// 点赞
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
... ... @@ -156,11 +132,9 @@ export struct ImageAndTextPageComponent {
}
}
}
}
.width(CommonConstants.FULL_WIDTH)
// .height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: 76 })
.height(CommonConstants.FULL_HEIGHT)
.scrollBar(BarState.Off)
.align(Alignment.Top)
.onReachEnd(() => {
... ... @@ -177,24 +151,52 @@ export struct ImageAndTextPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton()
detailedSkeleton().padding({ bottom: this.bottomSafeHeight })
}
}
//底部交互区
if (this.operationButtonList.length) {
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
})
}
// 底部交互区
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({ top: 38 })
// 发布时间
Column() {
Row() {
Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(13)
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.padding({ left: 15, right: 15, })
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Bottom)
Row() {
Image($r('app.media.line'))
.width('100%')
.height(6)
.objectFit(ImageFit.Cover)
.margin({ top: 10 })
}
.padding({ left: 15, right: 15 })
.backgroundColor(Color.White)
}.backgroundColor(Color.White)
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
}
private async getDetail() {
... ... @@ -260,7 +262,11 @@ export struct ImageAndTextPageComponent {
channelId: String(this.contentDetailData?.reLInfo?.channelId)
}
let recommendList = await DetailViewModel.postRecommendList(params)
this.recommendList = recommendList;
if (recommendList.length > 0) {
//推荐列表过滤音频和活动入口
this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
}
}
// 已登录->查询用户对作品点赞、收藏状态
... ...
... ... @@ -8,6 +8,8 @@ import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5
import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil } from 'wdKit';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -24,6 +26,8 @@ export struct SpacialTopicPageComponent {
private dataPrepared = false;
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'collect', 'share']
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isNetConnected: boolean = true
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
... ... @@ -45,6 +49,8 @@ export struct SpacialTopicPageComponent {
}
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
let contentId: string = ''
let relId: string = ''
let relType: string = ''
... ... @@ -95,8 +101,18 @@ export struct SpacialTopicPageComponent {
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: 75 })
if (!this.isPageEnd) {
detailedSkeleton()
if (!this.isNetConnected) {
EmptyComponent({
emptyType: 1,
emptyButton: true,
retry: () => {
this.getDetail()
}
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton()
}
}
//底部交互区
OperRowListView({
... ... @@ -104,6 +120,9 @@ export struct SpacialTopicPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
.padding({
bottom: `${this.bottomSafeHeight}px`
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
... ...
import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { WDMessageCenterMessageType } from '../../../model/InteractMessageModel'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { MessageItem } from '../../../viewmodel/MessageItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
... ... @@ -146,9 +147,15 @@ export struct MessageListUI {
.onClick(() => {
switch (index) {
case 0: //互动消息
if(item.unReadCount > 0){
this.sendEnterEvent(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact)
}
WDRouterRule.jumpWithPage(WDRouterPage.interactMessagePage)
break;
case 1: //预约消息
if(item.unReadCount > 0){
this.sendEnterEvent(WDMessageCenterMessageType.WDMessageCenterMessageType_Subscribe)
}
WDRouterRule.jumpWithPage(WDRouterPage.subscribeMessagePage)
break;
case 2: //历史推送
... ... @@ -166,4 +173,12 @@ export struct MessageListUI {
.height('100%')
.width('100%')
}
sendEnterEvent(type:number){
MinePageDatasModel.sendEnterMessageData(type).then((value) => {
console.log(TAG, "消息已读")
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
})
}
}
\ No newline at end of file
... ...
... ... @@ -61,7 +61,7 @@ export struct OperRowListView {
@Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
@Prop pageComponentType: number = -1 //1:视频详情页
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@State needLike: boolean = true
@ObjectLink publishCommentModel: publishCommentModel
@State styleType: number = 1
... ... @@ -138,7 +138,7 @@ export struct OperRowListView {
})
.width(42)
if (this.contentDetailData) {
if (this.contentDetailData?.newsId) {
ForEach(this.operationButtonList, (item: string, index: number) => {
if (item == 'comment') {
this.builderComment()
... ... @@ -162,7 +162,8 @@ export struct OperRowListView {
.backgroundColor(this.bgColor)
.padding({
top: 10,
bottom: `${this.bottomSafeHeight}px`
bottom: 10
// bottom: `${this.bottomSafeHeight}px`
// bottom: 50
})
... ...
... ... @@ -701,6 +701,29 @@ class MinePageDatasModel{
};
/**
* 点击预约消息(进入预约页面) 主要为了 未读 变出 已读
* @returns
*/
sendEnterMessageData(type:number): Promise<String> {
return new Promise<String>((success, error) => {
this.fetchEnterMessageData(type).then((navResDTO: ResponseDTO<String>) => {
if (!navResDTO || navResDTO.code != 0) {
error(null)
return
}
success("1");
}).catch((err: Error) => {
error(err)
})
})
}
fetchEnterMessageData(type:number) {
let url = HttpUrlUtils.getEnterClickMessageUrl() + `${type}`
return WDHttp.get<ResponseDTO<String>>(url)
};
}
const minePageDatasModel = MinePageDatasModel.getInstance()
... ...
... ... @@ -65,6 +65,8 @@ export struct MultiPictureListPage {
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.loop(false)
.effectMode(EdgeEffect.None)
.cachedCount(3)
.indicator(false)
.displayCount(1)
... ...
import { SubscribeMessageComponent } from '../components/mine/message/subscribe/SubscribeMessageComponent'
const TAG = "SubscribeMessagePage"
//预约消息 页面
@Entry
@Component
... ...