Commit 609adeda by hechuantao

论坛详情添加关注

parent 1508d090
......@@ -4,7 +4,7 @@
<view class="u-nav-slot" slot="left">
<view class="d-flex a-center">
<u-icon name="arrow-left" color='#333' size="40rpx" @click="leftClick"></u-icon>
<view class="d-flex a-center" style="margin-left: 20rpx;">
<view class="d-flex a-center" style="margin-left: 20rpx;" @click="handleUser(detailData)">
<u--image :showLoading="true" shape="circle" :src="detailData.sysUser.avatar" width="68rpx"
height="68rpx" ></u--image>
<view class="sysUser-name">
......@@ -13,12 +13,18 @@
<view class="sj">
{{detailData.userType=='app_user'?'用户':'商家'}}
</view>
<view class="index-header-gz" @click.stop="handleLook">
{{ detailData.isFavoritesUser?'已关注':'关注'}}
</view>
</view>
</view>
</view>
</u-navbar>
<u-swiper height="500rpx" :list="imgs"></u-swiper>
<view class="" style="width: 720rpx; margin: 0 auto;">
<u-swiper height="750rpx" :list="imgs" circular imgMode='scaleToFill' duration="500"></u-swiper>
</view>
<view style="padding:36rpx 0 0;">
<view class="px-three">
<view class="detail">
......@@ -224,6 +230,37 @@
handleRefersh() {
this.getCommentList()
},
//用户
handleUser(row){
console.log(row,"====================")
if (row.userType == 'merchant') {
uni.navigateTo({
url: `/homePage/merchant/index?businessId=${row.userId}`
})
} else {
uni.navigateTo({
url: `/homePage/merchant/personHomePage?userId=${row.userId}&type=1`
})
}
},
// 关注
handleLook(){
collectOrUncollect({
forumId: this.detailData.userId,
userId: this.userInfo.userId,
isFavoritesType: 2, // 论坛1商家2
favoriteType: 'merchant'
}).then(res => {
uni.showToast({
title: '成功!',
icon: 'none'
})
this.detailData.isFavoritesUser= !this.detailData.isFavoritesUser
})
},
}
......@@ -238,6 +275,10 @@
.sysUser-name {
font-size: 28rpx;
color: #333333;
width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail {
......@@ -300,4 +341,16 @@
color: #1572FF;
margin-left: 10rpx;
}
.index-header-gz{
width: 100rpx;
height: 32rpx;
background: #4BA1FF;
border-radius: 32rpx;
font-size: 20rpx;
color: #FFFFFF;
text-align: center;
line-height: 32rpx;
margin-left: 20rpx;
}
</style>
\ No newline at end of file
......@@ -90,6 +90,9 @@
listForumGET,
collectOrUncollect
} from '@/api/workbench/index.js';
import {
mapGetters
} from 'vuex'
export default {
components: {
tabsList,
......@@ -124,6 +127,11 @@
clientInfo:{}
}
},
computed: {
...mapGetters({
userInfot: 'userInfo'
})
},
onLoad(option) {
console.log(option.userId, '========')
this.$set(this.queryParams,'userId',option.userId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment