陈剑华

fix: 信息流卡片互动 debug

... ... @@ -25,7 +25,7 @@ export struct RmhTitle {
/**
* 默认未关注 点击去关注
*/
@State followStatus: String = '0';
@State followStatus: string = '0';
/**
* 关注号主
... ... @@ -45,7 +45,7 @@ export struct RmhTitle {
status: this.followStatus == '0' ? 1 : 0,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('关注号主==', JSON.stringify(res.data))
console.log('rmhTitle-data', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
... ... @@ -63,7 +63,7 @@ export struct RmhTitle {
/**
* 查询当前登录用户是否关注作品号主
* */
private async getBatchAttentionStatus() {
async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.rmhInfo?.rmhId ?? '' }]
... ... @@ -72,17 +72,17 @@ export struct RmhTitle {
this.followStatus = data[0]?.status;
Logger.info(`rmhTitle-followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
Logger.info(`rmhTitle-followStatus:${JSON.stringify(exception)}`)
}
}
aboutToAppear(): void {
this.getBatchAttentionStatus()
let page = router.getState();
if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) {
this.hideTime = true;
}
this.getBatchAttentionStatus()
}
getDaysBetweenDates(date: number) {
... ... @@ -143,13 +143,13 @@ export struct RmhTitle {
Blank()
if (this.rmhInfo.cnIsAttention) {
Row() {
if (this.followStatus === '0') {
if (Number(this.followStatus) === 0) {
Image($r('app.media.rmh_follow'))
.width(16)
.height(16)
}
Text(this.followStatus === '0' ? '关注' : '已关注')
Text(Number(this.followStatus) === 0 ? '关注' : '已关注')
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_ED2800'))
}
... ...
... ... @@ -22,7 +22,9 @@ const TAG = 'Zh_Single_Row-06'
@Component
export struct ZhSingleRow06 {
@State compDTO: CompDTO = {} as CompDTO
@State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult // 点赞、收藏状态
@State newsStatusOfUser: batchLikeAndCollectResult = {
likeStatus: '0'
} as batchLikeAndCollectResult // 点赞、收藏状态
aboutToAppear(): void {
this.getInteractDataStatus()
... ... @@ -49,7 +51,7 @@ export struct ZhSingleRow06 {
}
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
async getInteractDataStatus() {
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
... ...