...
|
...
|
@@ -13,16 +13,23 @@ |
|
|
</view>
|
|
|
<view class="mateitem" v-for="(item,index) in historylist" :key="index">
|
|
|
<view class="contentBox">
|
|
|
<image class="photo" src="../../static/logo_img@2x.png"></image>
|
|
|
<image class="photo" :src="item.head_img"></image>
|
|
|
<view class="cont">
|
|
|
<view class="title">红色的战旗</view>
|
|
|
<view class="title">{{item.nickname}}</view>
|
|
|
|
|
|
<view class="fen">就读体验</view>
|
|
|
<view class="fen">{{item.title}}</view>
|
|
|
<view class="txt">{{item.content}}</view>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
<view class="text">已关注</view>
|
|
|
<view class="right" :class="item.is_like_user==0?'like':''">
|
|
|
<view class="text" @click="attention(item,index)" v-if="item.is_like_user==0" style="display:flex;justify-content: center;align-items: center;color:#81C3BF;">
|
|
|
<view class='xin' style="width:28rpx;height:28rpx;font-size: 0;">
|
|
|
<image src="../../static/xin.png" mode=""></image>
|
|
|
</view>
|
|
|
<view class="txt">班主任用“心”战“疫” 全力做好学生防疫工作</view>
|
|
|
关注
|
|
|
</view>
|
|
|
<view class="text" @click="noattention(item,index)" v-else>已关注</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nodata" v-if="historylist.length==0">暂无数据</view>
|
...
|
...
|
@@ -40,15 +47,22 @@ |
|
|
<view class="mateitem" v-for="(item,index) in cellectlist" :key="index">
|
|
|
<image class="delBtn" src="../../static/shanchu_icon@2x.png" v-if="isdel"></image>
|
|
|
<view class="contentBox" :style="{width:width}">
|
|
|
<image class="photo" src="../../static/logo_img@2x.png"></image>
|
|
|
<image class="photo" :src="item.head_img"></image>
|
|
|
<view class="cont">
|
|
|
<view class="title">红色的战旗</view>
|
|
|
<view class="fen">就读体验</view>
|
|
|
<view class="title">{{item.nickname}}</view>
|
|
|
<view class="fen">{{item.title}}</view>
|
|
|
<view class="txt">{{item.content}}</view>
|
|
|
</view>
|
|
|
<view class="right" :class="item.is_like_user==0?'like':''">
|
|
|
<view class="text" @click="attention(item,index)" v-if="item.is_like_user==0" style="display:flex;justify-content: center;align-items: center;color:#81C3BF;">
|
|
|
<view class='xin' style="width:28rpx;height:28rpx;font-size: 0;">
|
|
|
<image src="../../static/xin.png" mode=""></image>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
<view class="text">已关注</view>
|
|
|
关注
|
|
|
</view>
|
|
|
<view class="txt">班主任用“心”战“疫” 全力做好学生防疫工作</view>
|
|
|
<view class="text" @click="noattention(item,index)" v-else>已关注</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
...
|
...
|
@@ -75,6 +89,56 @@ export default { |
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
// 关注和取消关注
|
|
|
attention(item, index) {
|
|
|
var that = this
|
|
|
var url = "article/likeArticle"
|
|
|
var token = uni.getStorageSync('token')
|
|
|
var params = {
|
|
|
article_id: item.id
|
|
|
}
|
|
|
app.post(url, params, "get").then((res) => {
|
|
|
uni.showToast({
|
|
|
title: "关注成功",
|
|
|
icon: 'none'
|
|
|
})
|
|
|
if (that.active1 == true) {
|
|
|
that.historylist[index].is_like_user = 1
|
|
|
} else if (that.active2 == true) {
|
|
|
that.cellectlist[index].is_like_user = 1
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
},
|
|
|
noattention(item, index) {
|
|
|
var that = this
|
|
|
var url = "article/likeArticle"
|
|
|
var token = uni.getStorageSync('token')
|
|
|
var params = {
|
|
|
article_id: item.id
|
|
|
}
|
|
|
app.post(url, params, "get").then((res) => {
|
|
|
uni.showToast({
|
|
|
title: "取消关注成功",
|
|
|
icon: 'none'
|
|
|
})
|
|
|
if (that.active1 == true) {
|
|
|
that.historylist[index].is_like_user = 0
|
|
|
} else if (that.active2 == true) {
|
|
|
that.cellectlist[index].is_like_user = 0
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
|
|
|
},
|
|
|
historyShow(){
|
|
|
this.active1=true,
|
|
|
this.active2=false,
|
...
|
...
|
|