王士厅

人民号主页下文章详情页,视频详情页,动态详情页与图集详情页均无法收藏

... ... @@ -88,8 +88,7 @@ export struct OperRowListView {
@State dialogController: CustomDialogController | null = null;
async aboutToAppear() {
console.info(TAG, '22222----', this.styleType)
console.info(TAG, '3333----', this.needLike)
console.info(TAG, 'this.needLike', this.needLike)
this.handleStyle()
this.onDetailUpdated()
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
... ... @@ -108,7 +107,7 @@ export struct OperRowListView {
}
async onDetailUpdated() {
console.info(TAG, '111111----', this.styleType)
console.info(TAG, 'this.styleType', this.styleType)
this.handleStyle()
if (!this.contentDetailData) {
return
... ... @@ -380,7 +379,7 @@ export struct OperRowListView {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}
]
}
... ... @@ -397,7 +396,6 @@ export struct OperRowListView {
* 收藏、取消收藏
*/
async toggleCollectStatus() {
console.log(TAG, '收藏点击')
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
console.log(TAG, '收藏点击,登录', user_id)
... ... @@ -411,15 +409,13 @@ export struct OperRowListView {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
relType: this.contentDetailData?.reLInfo?.relType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
relType: this.contentDetailData?.reLInfo?.relType || '' + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}],
}
// console.log(TAG, '收藏点击', JSON.stringify(params))
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
console.log(TAG, '收藏点击 res', JSON.stringify(res))
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
... ... @@ -427,6 +423,7 @@ export struct OperRowListView {
}
this.queryContentInteractCount()
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
}
... ...