wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 兴趣卡取消关闭会提示已为您调整推荐内容
  标题更换,换一换如果全部试过后置灰
  fix: 图集底部顶部有文字时,添加蒙层
  fix: 图集底部顶部有文字时,添加蒙层
  fix: 关注号主后,进去号主图集稿件页,关注状态会由未关注变为已关注
  fix: 兴趣卡关闭添加提示,关闭后列表删除数据
  fix: 兴趣卡关闭添加提示,关闭后列表删除数据
  fix |> 横屏直播详情标题和直播状态之间间距过小问题
  fix |> 修复竖屏直播详情直播状态标签与标题没有左对齐问题
  ref |> 调整横屏直播详情播放控制层自动隐藏时间
  动态详情页面UI优化
... ... @@ -185,7 +185,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, pageModel: this.pageModel, compIndex: this.compIndex })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
... ...
... ... @@ -173,10 +173,15 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.alt(this.contentDetailData.rmhInfo?.userType == '1' ? $r('app.media.default_head') :
$r('app.media.icon_default_head_mater'))
.width($r('app.float.margin_32'))
.height($r('app.float.margin_32'))
.width($r('app.float.margin_36'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_16'))
.borderRadius(50)
.border({
width: 0.5,
color: '#0D000000', // 5% 透明度的黑色
style: BorderStyle.Solid
})
Image(this.contentDetailData.rmhInfo?.honoraryIcon)
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
... ... @@ -185,12 +190,12 @@ export struct DynamicDetailComponent {
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_12'))
.height($r('app.float.vp_12'))
.width($r('app.float.vp_14'))
.height($r('app.float.vp_14'))
.objectFit(ImageFit.Cover)
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.width($r('app.float.margin_36'))
.height($r('app.float.margin_36'))
.alignContent(Alignment.BottomEnd)
}
}
... ... @@ -209,24 +214,32 @@ export struct DynamicDetailComponent {
Column() {
//昵称
Text(this.contentDetailData.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_14'))
.fontSize(15)
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.margin_5') })
.fontWeight(600)
.alignSelf(ItemAlign.Start)
.height(21)
.lineHeight(21)
.margin({bottom: 1})
// .fontSize($r('app.float.font_size_14'))
// .fontColor($r('app.color.color_222222'))
// .fontWeight(FontWeight.Medium)
// .margin({ left: $r('app.float.margin_5') })
// .alignSelf(ItemAlign.Start)
//简介
Text(this.contentDetailData.rmhInfo?.rmhDesc)
.fontSize($r('app.float.font_size_14'))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
.fontWeight(FontWeight.Medium)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
.height(14)
.lineHeight(14)
}
.width('63%')
.width('70%')
.margin({ right: $r('app.float.margin_6') })
Blank()
if (!StringUtils.isEmpty(this.followStatus)) {
if (this.followStatus == '0') {
Row() {
... ... @@ -272,25 +285,22 @@ export struct DynamicDetailComponent {
})
}
}
}
.width('100%')
.margin({ left: $r('app.float.margin_16') })
//内容
Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
? StringUtils.isEmpty(this.contentDetailData.newsSummary)
? this.contentDetailData.newsTitle
: this.contentDetailData.newsSummary
: this.contentDetailData.newsContent)
}.padding({
left: $r('app.float.vp_16')
, right: $r('app.float.vp_16')
})
//标题
Text(this.titleText())
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_18'))
.lineHeight($r('app.float.margin_25'))
.margin({
.width('100%')
.padding({
top: $r('app.float.margin_6')
, left: $r('app.float.margin_16')
, right: $r('app.float.margin_16')
, left: $r('app.float.vp_16')
, right: $r('app.float.margin_6')
})
.alignSelf(ItemAlign.Start)
//内容
if (this.contentDetailData.newsType + "" == ContentConstants.TYPE_FOURTEEN) {
//附件内容:图片/视频
if (this.contentDetailData.photoList != null && this.contentDetailData.photoList.length > 0) {
... ... @@ -637,6 +647,16 @@ export struct DynamicDetailComponent {
.height('100%')
}
private titleText() {
if(!StringUtils.isEmpty(this.contentDetailData.newsContent)){
return this.contentDetailData.newsContent
}
if(StringUtils.isEmpty(this.contentDetailData.newsSummary)){
return this.contentDetailData.newsTitle
}
return this.contentDetailData.newsSummary
}
/**
* 请求(动态)详情页数据
* */
... ...
import { CompDTO, ContentDTO, Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { CommonConstants } from 'wdConstant/Index';
import { CompDTO, ContentDTO } from 'wdBean';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Tracking, TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils'
import { ParamType, Tracking } from 'wdTracking';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils';
import { ToastUtils } from 'wdKit';
import PageModel from '../../viewmodel/PageModel';
/**
* 兴趣卡
* Zh_Single_Column-09
... ... @@ -16,17 +14,21 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State private pageModel: PageModel = new PageModel();
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State activeIndexs: Array<number> = []
@State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
@State selfClosed: Boolean = false;
@StorageLink('selfClosed') selfClosed: boolean = false
@State loadImg: boolean = false;
@State compIndex: number = 0;
@State currentOperDataListIndex: number = 0; //记录换一换点击次数
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
this.currentOperDataListIndex = this.compDTO?.operDataList.length
}
trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') {
... ... @@ -75,7 +77,7 @@ export struct ZhSingleColumn09 {
}
shuffleArray(array: ContentDTO[]) {
for(let i = array.length - 1; i > 0; i--) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
const tempArray = array[i];
array[i] = array[j];
... ... @@ -89,17 +91,17 @@ export struct ZhSingleColumn09 {
//顶部
Row() {
Column() {
Text('以下是否有您感兴趣?')
Text('以下是否有您感兴趣的分类?')
.fontSize(18)
.fontColor(0x000000)
.fontWeight(600)
.width('70%')
.padding({bottom: 4})
.padding({ bottom: 4 })
Text('选中标签,为您推荐更多您感兴趣的内容')
.fontSize(12)
.fontColor(0xB0B0B0)
.padding({bottom: 10})
.padding({ bottom: 10 })
.width('70%')
}
... ... @@ -108,14 +110,20 @@ export struct ZhSingleColumn09 {
.fontSize(14)
.width(62)
.height(26)
.backgroundColor(this.activeIndexs.length > 0 ? 0xfdf0ed : 0xf5f5f5)
// .lineHeight(26)
.backgroundColor(this.activeIndexs.length > 0 ? 0xfdf0ed : 0xf5f5f5)// .lineHeight(26)
.borderRadius(4)
.margin({top: -10})
.padding({top: 0, bottom: 0, left: 0, right: 0})
.margin({ top: -10 })
.padding({
top: 0,
bottom: 0,
left: 0,
right: 0
})
.onClick(() => {
this.trackClick('interest_card_selecting_click')
if (this.activeIndexs.length > 0) {
ToastUtils.shortToast('已为您调整推荐内容')
this.pageModel.compList.deleteItem(this.compIndex)
this.selfClosed = true;
}
})
... ... @@ -126,18 +134,20 @@ export struct ZhSingleColumn09 {
Grid() {
ForEach(this.operDataList, (item: ContentDTO, index: number) => {
GridItem() {
Stack({alignContent: Alignment.TopEnd}) {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.loadImg ? item.coverUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height('100%')
.borderRadius(3)
Row(){}
Row() {
}
.width('100%')
.height('100%')
.backgroundColor('rgba(0, 0, 0, 1)')
.opacity(0.4)
.borderRadius(3)
Text(item.newsTitle)
.width('100%')
.height('100%')
... ... @@ -153,7 +163,7 @@ export struct ZhSingleColumn09 {
.width('100%')
.height('100%')
}
.margin({right: index % 4 === 3 ? 0 : 6, bottom: 6})
.margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 })
.onClick(() => {
if (this.activeIndexs.includes(index)) {
const ind = this.activeIndexs.indexOf(index);
... ... @@ -167,30 +177,37 @@ export struct ZhSingleColumn09 {
.height(90)
.columnsTemplate('1fr 1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.margin({bottom: 5})
.margin({ bottom: 5 })
Row() {
Row() {
Text('换一换')
.fontSize(14)
.fontColor(this.compDTO?.operDataList.length > 8 ? 0xed2800 : 0xB0B0B0)
.margin({right: 4})
.fontColor(this.compDTO?.operDataList.length > 8 && this.currentOperDataListIndex > 0 ? 0xed2800 : 0xB0B0B0)
.margin({ right: 4 })
Image(this.compDTO?.operDataList.length > 8 ? $r('app.media.icon_refresh') : $r('app.media.ic_refresh'))
.width(14)
.height(14)
}
.onClick(() => {
if (this.currentOperDataListIndex > 0) {
this.currentOperDataListIndex--
}
if (this.compDTO?.operDataList.length > 8) {
this.operDataList = this.shuffleArray(this.operDataList)
if (this.pageModel) {
this.pageModel.compList.deleteItem(this.compIndex)
}
this.activeIndexs = [];
}
})
Row() {
Image($r("app.media.close_button_new"))
.width(9)
.height(9)
.onClick(() => {
this.trackClick('close_interest_card_click')
this.pageModel.compList.deleteItem(this.compIndex)
this.selfClosed = true;
})
}
... ...
... ... @@ -44,7 +44,7 @@ export struct PlayUIComponent {
return
}
this.isMenuVisible = false
}, 4 * 1000)
}, 5 * 1000)
} else {
clearTimeout(time)
}
... ... @@ -168,7 +168,7 @@ export struct PlayUIComponent {
}
//第二行右边直播状态参与人数
this.getLiveStatusView()
}.margin({top:-7})
}.margin({top:this.contentDetailData.liveInfo?.liveState != 'wait' ? 0 : -10})
}
.width('100%')
// .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)')
... ...
... ... @@ -88,7 +88,7 @@ export struct PlayerTitleComponent {
Row() {
this.getLiveStatusView()
}
.margin({left: this.contentDetailData.rmhInfo?.rmhName ? 0 : 34})
.margin({left: this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 34 : 0})
}
.width('100%')
... ...
... ... @@ -18,6 +18,7 @@ const TAG = 'MainPage';
PersistentStorage.persistProp('GestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播
PersistentStorage.persistProp('clickedIds', []); // 频道稿件已读存放稿件ID结合用户频道列表已读置灰回显
PersistentStorage.persistProp('selfClosed', false); // 新闻频道推荐兴趣卡,默认显示
@Entry
@Component
... ...
... ... @@ -44,6 +44,7 @@ export struct MultiPictureDetailPageComponent {
private swiperController: SwiperController = new SwiperController()
@State swiperIndex: number = 0;
@Provide followStatus: string | undefined = '0' // 关注状态
@State isShowButton: boolean = false // 展示关注按钮,默认不展示
@Provide showCommentList: boolean = false
private scroller: Scroller = new Scroller()
private listScroller: ListScroller = new ListScroller()
... ... @@ -155,146 +156,156 @@ export struct MultiPictureDetailPageComponent {
@Builder
rmh() {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
Row(){
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
}
.width('13%')
.height('100%')
}
.width('13%')
.height('100%')
}
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
}
.width('81%')
.height('100%')
}
.width('81%')
.width('74.4%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
}).visibility(this.isShowButton ? Visibility.Visible : Visibility.None)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
})
}
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
.width('100%')
.height(44)
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
.width('100%')
.height(44)
.height(44 + px2vp(this.topSafeHeight))
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
.linearGradient({
direction: GradientDirection.Top, // 渐变方向
colors: [['rgba(18, 18, 18, 0)', 0],
['rgba(18, 18, 18, 0.8)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
}
... ... @@ -436,6 +447,11 @@ export struct MultiPictureDetailPageComponent {
.edgeEffect(EdgeEffect.None)
.scrollBarWidth(0)
.scrollBar(BarState.Off)
.linearGradient({
direction: GradientDirection.Bottom, // 渐变方向
colors: [['rgba(18, 18, 18, 0)', 0],
['rgba(18, 18, 18, 0.8)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
OperRowListView({
contentDetailData: this.contentDetailData,
... ... @@ -536,11 +552,11 @@ export struct MultiPictureDetailPageComponent {
.then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
this.isOffLine = resDTO.data == null ? true : false
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchDetailData is empty');
// Logger.error(TAG, 'fetchDetailData is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
// Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
return
}
this.netStatus = undefined
... ... @@ -565,9 +581,9 @@ export struct MultiPictureDetailPageComponent {
// 暂无内容
this.netStatus = 0
this.operationButtonList = []
Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
// Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
}
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
// Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (user_id) {
... ... @@ -576,7 +592,7 @@ export struct MultiPictureDetailPageComponent {
}
})
.catch((err: Error) => {
console.log(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
// console.log(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
// 内容获取失败
this.netStatus = 9
this.operationButtonList = []
... ... @@ -592,35 +608,26 @@ export struct MultiPictureDetailPageComponent {
// 记录浏览历史
private getInteractBrowsOperate() {
try {
const params: postInteractBrowsOperateParams = {
delStatus: 0,
contentList: [{
browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType || 0,
}]
}
MultiPictureDetailViewModel.getInteractBrowsOperate(params).then(res => {
console.log(TAG, '记录浏览历史==', JSON.stringify(res.data))
})
} catch (exception) {
const params: postInteractBrowsOperateParams = {
delStatus: 0,
contentList: [{
browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType || 0,
}]
}
MultiPictureDetailViewModel.getInteractBrowsOperate(params)
}
// 已登录->批量查作品是否被号主关注
private async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
this.isShowButton = true
// Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
}
/**
... ... @@ -643,7 +650,7 @@ export struct MultiPictureDetailPageComponent {
status: this.followStatus == '1' ? 0 : 1,
}
PageRepository.postInteractAccentionOperate(params).then(res => {
console.log(TAG, '关注号主==', JSON.stringify(res.data))
// console.log(TAG, '关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
... ...