陈剑华

Merge remote-tracking branch 'origin/main'

Showing 22 changed files with 182 additions and 141 deletions
... ... @@ -5,6 +5,7 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
ToastUtils,
} from 'wdKit';
import {
Action,
... ... @@ -242,7 +243,7 @@ export struct H5NewsWebPageComponent {
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
... ... @@ -257,7 +258,6 @@ export struct H5NewsWebPageComponent {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
}
... ...
... ... @@ -450,24 +450,20 @@ export struct ImageAndTextPageComponent {
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
// console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
this.likeNum = Number(this.likeNum) - 1
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
if (this.newsStatusOfUser && res.code == 0) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
this.likeNum = Number(this.likeNum) - 1
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
}
... ...
... ... @@ -249,8 +249,7 @@ export struct MorningEveningPaperComponent {
// 图片转换为PixelMap对象
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
// console.log(TAG, "compInfoBean compStyle = " + imageUrl)
if (this.pageInfoBean.backgroundColor.length > 0){
if (this.pageInfoBean.backgroundColor.length > 0 && this.pageInfoBean.topicInfo?.frontLinkObject != undefined){
let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor)
let color = ColorUtils.getMorningEveningPaperRgb({red:colorDatas[0],green:colorDatas[1],blue:colorDatas[2],alpha:1})
this.mixedBgColor = "#ff" + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0');
... ... @@ -258,6 +257,7 @@ export struct MorningEveningPaperComponent {
}
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
this.pickColor(imageSource)
} else {
... ...
... ... @@ -146,6 +146,7 @@ export struct CommentTabComponent {
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
this.publishCommentModel.visitorComment = String(this.contentDetail?.visitorComment || '')
if (this.contentDetail.bestNoticer === 1) {
this.publishCommentModel.placeHolderText = "优质评论会获得最佳评论人的称号"
}
... ...
... ... @@ -113,7 +113,7 @@ export default struct MinePageUserSimpleInfoUI {
.margin({ left: 0,top:8 })
.backgroundImage($r("app.media.mine_grade_bg"))
.backgroundImageSize(ImageSize.FILL)
.padding({left: 6,right: 6})
.padding({left: 9,right: 9})
.height(16)
}
}
... ...
... ... @@ -45,7 +45,7 @@ export struct ChildCommentComponent {
.fontColor($r('app.color.color_222222'))
.margin({ bottom: 1 })
.maxLines(1)
Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.data.createTime)))
Text(`${this.data.createTime}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(12)
.lineHeight(16)
... ...
... ... @@ -626,7 +626,7 @@ export struct PaperSingleColumn999CardView {
}
async aboutToAppear(): Promise<void> {
// this.loadImg = await onlyWifiLoadImg();
this.loadImg = await onlyWifiLoadImg();
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId, '')
}
... ...
... ... @@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent {
}
aboutToAppear() {
console.log(TAG, 'cj2024 aboutToAppear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', this.creatorId)
// console.log(TAG, 'cj2024 aboutToAppear')
if (this.currentIndex == this.currentTopSelectedIndex) {
this.currentPage = 1
this.getPeopleShipPageArticleList()
}
}
aboutToDisappear(): void {
console.log(TAG, 'cj2024 aboutToDisappear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据
}
onChange() {
if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) {
this.currentPage = 1
... ... @@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent {
private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) {
Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
// Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
if (this.isLoading) {
if (resolve) {
resolve('')
... ... @@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent {
try {
this.isLoading = true
let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type)
Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
// Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
// Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
if (resolve ) {
if (this.currentPage == 1) {
... ... @@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent {
if (listData.totalCount === 0) {
this.viewType = 4
}
Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
// Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
}catch (exception) {
if (resolve) {
resolve('')
... ...
... ... @@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
import { EmptyComponent } from '../view/EmptyComponent';
import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
const TAG = 'PeopleShipHomeListComponent'
interface peopleParams {
creatorId: string,
tabName: string
}
@Component
export struct PeopleShipHomeListComponent {
private controller: TabsController = new TabsController()
... ... @@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent {
.onClick(() => {
this.controller.changeIndex(index)
this.currentIndex = index
console.log(TAG, 'name', name)
const params: peopleParams = {
creatorId: this.creatorId,
tabName: name
}
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', JSON.stringify(params))
})
}
... ... @@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent {
this.isLoading = true
// 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频
let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId)
Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`)
// Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`)
this.updateTopBarData(articleModel)
this.isLoading = false
} catch (exception) {
... ... @@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent {
}
}
aboutToDisappear(): void {
// console.log(TAG, 'cj2024 aboutToDisappear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据
}
// 设置顶部数据
updateTopBarData(articleModel: ArticleCountData) {
if (articleModel) {
... ...
... ... @@ -159,7 +159,7 @@ export struct EmptyComponent {
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
// .fontColor(this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1 ? '#999999' : '#666666')
.fontColor('#666666')
.fontColor(this.isBlack ? '#FFFFFF' :'#666666')
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
... ...
... ... @@ -432,7 +432,7 @@ export struct LiveOperRowListView {
}
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
... ...
... ... @@ -526,23 +526,18 @@ export struct OperRowListView {
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
}
/**
... ...
... ... @@ -200,6 +200,7 @@ export class PageHelper {
if (isCache) {
pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
pageModel.displayGroupInfoMd5 = pageDto.md5
pageModel.currentPage = 2
} else {
pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
//增加楼层数据异常判断条件
... ...
import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { ContentDetailDTO, GetPullAddressBean, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
... ... @@ -338,7 +338,7 @@ export class ContentDetailRequest {
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
return WDHttp.post(url, params)
return HttpBizUtil.post(url, params)
}
/**
... ... @@ -348,7 +348,7 @@ export class ContentDetailRequest {
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getExecuteCollcetUrl()
return WDHttp.post(url, params)
return HttpBizUtil.post(url, params)
}
/**
... ...
... ... @@ -10,54 +10,57 @@ export struct ChatItemComponent {
}
build() {
Row() {
Text() {
if (this.item.role == LiveMessageRole.host) {
Span(' 主持人 ')
.fontSize(11)
// .lineHeight(16)
.textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
.fontColor('#FFFFFFFF')
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
Span(' ')
}
if (this.item.role == LiveMessageRole.guest) {
Span(' 嘉宾 ')
.fontSize(11)
// .lineHeight(16)
.textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
Row(){
Row() {
Text() {
if (this.item.role == LiveMessageRole.host) {
Span(' 主持人 ')
.fontSize(11)
// .lineHeight(16)
.textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
.fontColor('#FFFFFFFF')
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
Span(' ')
}
if (this.item.role == LiveMessageRole.guest) {
Span(' 嘉宾 ')
.fontSize(11)
// .lineHeight(16)
.textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
.fontColor('#FFFFFFFF')
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
Span(' ')
}
Span(this.item.senderUserName + ': ')
.fontSize(14)
.lineHeight(22)
.fontColor('#FFFFC63F')
.padding({ right: 118 })
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
Span(this.item.text)
.fontSize(14)
.lineHeight(22)
.fontColor('#FFFFFFFF')
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
Span(' ')
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
}
Span(this.item.senderUserName + ': ')
.fontSize(14)
.lineHeight(22)
.fontColor('#FFFFC63F')
.padding({ right: 118 })
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })
Span(this.item.text)
.fontSize(14)
.lineHeight(22)
.fontColor('#FFFFFFFF')
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
}
.textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })
}
.backgroundColor('#4D000000')
.borderRadius(3)
.padding({
top: 6,
bottom: 6,
left: 8,
right: 8
})
.margin({ left: 16, bottom: 4 })
.backgroundColor('#4D000000')
.borderRadius(3)
.padding({
top: 6,
bottom: 6,
left: 8,
right: 8
})
.margin({ left: 16, bottom: 4 })
}.width("100%")
.backgroundColor(Color.Transparent)
}
}
\ No newline at end of file
... ...
... ... @@ -100,16 +100,22 @@ export struct PlayerCommentComponent {
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
ChatItemComponent({ item: item })
}
}.blendMode(BlendMode.SRC_IN, BlendApplyType.OFFSCREEN)
})
}
.width('80%')
.width('100%')
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
}
.constraintSize({
maxHeight: 280
}).width("80%")
.linearGradient({ angle: 0,
colors: [[0xff000000, 0.85], [0x01000000, 1.0]]
})
.blendMode(BlendMode.SRC_OVER, BlendApplyType.OFFSCREEN)
// 收藏、分享、点赞是否需要根据字段显隐
LiveOperRowListView({
... ...
import { Action, ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index';
import { Action,
ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index';
import { NetworkUtil, WindowModel } from 'wdKit';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
... ... @@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit';
const storage = LocalStorage.getShared();
const TAG = 'DetailVideoListPage'
interface peopleParams {
creatorId: string,
tabName: string
}
@Entry(storage)
@Component
export struct DetailVideoListPage {
@State peopleShipHomeCreatorId: string = '';
@State tabName: string = ''; // 人民好主页全部、文章、视频、动态等name
private contentId: string = ''
private relId: string = ''
private relType: string = ''
... ... @@ -101,6 +108,10 @@ export struct DetailVideoListPage {
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
// console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
const params: peopleParams = JSON.parse(this.peopleShipHomeCreatorId);
this.tabName = params.tabName;
this.peopleShipHomeCreatorId = params.creatorId;
// console.info(TAG, `cj2024 tabName = ${this.tabName}`)
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
} else {
... ... @@ -129,7 +140,6 @@ export struct DetailVideoListPage {
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`)
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`)
await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
}
// console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
} else {
... ... @@ -276,7 +286,7 @@ export struct DetailVideoListPage {
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// console.log(TAG, 'getRmhContentDetail:', JSON.stringify(resDTO.data))
// this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
... ... @@ -293,6 +303,12 @@ export struct DetailVideoListPage {
// console.log('获取互动点赞等数据===', JSON.stringify(res))
})
this.data.push(resDTO.data[0])
if(this.tabName == '全部' || this.tabName == '视频') { // 全部和视频查询号主关联视频
await this.getRmhPublishNexts(this.peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
} else { // 目前动态是查询随机视频
await this.queryVideoList()
}
}
})
}
... ... @@ -307,6 +323,7 @@ export struct DetailVideoListPage {
refreshTime 1694073009294
* */
async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) {
// console.log(TAG, 'cj2024 getRmhPublishNexts:')
await ContentDetailRequest.getRmhPublishNexts({
creatorId: creatorId,
contentId: contentId,
... ... @@ -395,7 +412,7 @@ export struct DetailVideoListPage {
})
} else if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
emptyType: 15, emptyButton: true, isBlack: true, retry: () => {
this.getDetail()
}
})
... ...
... ... @@ -13,17 +13,19 @@ export struct DetailDialog {
build() {
Column() {
Column() {
if (this.name) {
Text(`@${this.name}`)
.fontColor(Color.White)
.fontSize(14)
.fontWeight(600)
.lineHeight(17)
.margin({ top: 8 })
}
}
.alignItems(HorizontalAlign.Start)
Scroll() {
Column() {
if (this.name) {
Text(`@${this.name}`)
.fontColor(Color.White)
.fontSize(14)
.fontWeight(600)
.lineHeight(17)
.margin({ top: 8 })
}
if (this.title) {
Text(this.title)
.fontColor(Color.White)
... ... @@ -55,7 +57,9 @@ export struct DetailDialog {
}
.scrollBar(BarState.Off) //安卓不显示滚动条
.height(200)
.constraintSize({
maxHeight: 200
})
Row() {
Image($r("app.media.icon_arrow_left_white"))
... ...
... ... @@ -80,8 +80,7 @@ export struct OperationListView {
contentType: this.contentDetailData?.newsType + '',
}
ContentDetailRequest.postExecuteLike(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.interactData.likeNum = Number(this.interactData.likeNum) + 1
... ... @@ -91,7 +90,6 @@ export struct OperationListView {
// console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
// this.queryContentInteractCount()
}
})
}
... ... @@ -116,7 +114,7 @@ export struct OperationListView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
... ...
... ... @@ -35,10 +35,12 @@ export struct PlayerFullScreenView {
share() {
this.playerController?.switchPlayOrPause()
WDShare.shareContent(this.contentDetailData)
// WDShare.shareContent(this.contentDetailData).then(() => {
// this.playerController?.switchPlayOrPause()
// })
WDShare.shareContent(this.contentDetailData).then((res) => {
// console.log(TAG, "分享弹框关闭", res);
if(res == 'dismiss') {
this.playerController?.switchPlayOrPause()
}
})
}
updateProgress() {
... ... @@ -103,7 +105,7 @@ export struct PlayerFullScreenView {
Text(this.getTitle())
.fontSize(18)
.lineHeight(24)
.fontWeight(600)
// .fontWeight(600)
.fontColor(Color.White)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
... ...
... ... @@ -99,7 +99,7 @@ export struct PlayerRightView {
// console.log(TAG, '点赞params', JSON.stringify(params))
ContentDetailRequest.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus == '1') {
this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
... ... @@ -138,7 +138,7 @@ export struct PlayerRightView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
... ...
... ... @@ -9,22 +9,28 @@ import { AppInnerLinkGenerator } from 'wdRouter';
export class WDShare {
static shareContent(content: ContentDetailDTO, pageName: string ="", pageId: string = "") {
//TODO: 处理分享弹框交互和 海报逻辑
WDShareBase.getInstance().share({
to: ShareType.System,
scene: ShareScene.System,
type: ShareContentType.Link,
obj: {
title: content.shareInfo.shareTitle,
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),
posterImg:$r("app.media.test_share_poster"),
}
})
static shareContent(content: ContentDetailDTO, pageName: string = "", pageId: string = ""): Promise<string> {
return new Promise((resolve, reject) => {
// 处理分享弹框交互和海报逻辑
WDShareBase.getInstance().share({
to: ShareType.System,
scene: ShareScene.System,
type: ShareContentType.Link,
obj: {
title: content.shareInfo.shareTitle,
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink: AppInnerLinkGenerator.generateDeepLinkWithConent(content),
posterImg: $r("app.media.test_share_poster"),
}
})?.then((res) => {
// console.log("分享成功", res);
resolve(res);
}).catch((() => {
// console.error("分享失败");
reject("error");
}))
});
}
static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {
... ...