|
@@ -2,10 +2,13 @@
|
|
|
<view class="container note-and-viewpoint" v-if="detailDataForm.HasPermission == 1">
|
|
|
<view class="content-item">
|
|
|
<view class="author-name">
|
|
|
- <view class="img-box">
|
|
|
- <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
|
|
|
+ <view class="author-box">
|
|
|
+ <view class="img-box">
|
|
|
+ <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
|
|
|
+ </view>
|
|
|
+ <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
|
|
|
</view>
|
|
|
- <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
|
|
|
+ <view class="follow-content" @click="followAuthorHandler">{{ detailDataForm.IsFollowAuthor ? "取消关注" : "关注专栏" }}</view>
|
|
|
</view>
|
|
|
<view class="type-time">
|
|
|
<view class="type"> {{ detailDataForm.Type == 1 ? "笔 记" : "观 点" }} </view>
|
|
@@ -245,6 +248,29 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ // 关注作者
|
|
|
+ async followAuthorHandler() {
|
|
|
+ const res = await purchaserApi.yanxuanSpecialFollow({
|
|
|
+ FollowUserId: this.detailDataForm.UserId,
|
|
|
+ Status: this.detailDataForm.IsFollowAuthor ? 2 : 1,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.detailDataForm.IsFollowAuthor = !this.detailDataForm.IsFollowAuthor;
|
|
|
+ this.detailDataForm.IsFollowAuthor
|
|
|
+ ? uni.showModal({
|
|
|
+ title: "已关注专栏",
|
|
|
+ content: "请关注【查研观向小助手】 公众号,及时获取专栏下内容更新提醒",
|
|
|
+ confirmText: "知道了",
|
|
|
+ showCancel: false,
|
|
|
+ confirmColor: "#376cbb",
|
|
|
+ })
|
|
|
+ : uni.showToast({
|
|
|
+ title: "已取消关注",
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.detailId = Number(options.id) || 0;
|
|
@@ -363,7 +389,12 @@ export default {
|
|
|
.author-name {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
margin-bottom: 50rpx;
|
|
|
+ .author-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
.img-box {
|
|
|
width: 48rpx;
|
|
|
height: 48rpx;
|
|
@@ -375,6 +406,16 @@ export default {
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
+ .follow-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 25rpx;
|
|
|
+ height: 48rpx;
|
|
|
+ border-radius: 150rpx;
|
|
|
+ background-color: #376cbb;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.collect-conten {
|