作者 lihongjuan

1

此 diff 太大无法显示。
... ... @@ -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,
... ...
... ... @@ -482,6 +482,7 @@
height: 68rpx;
margin-right: 26rpx;
margin-top: 6rpx;
border-radius: 50%;
}
.cont {
... ...
... ... @@ -7,7 +7,7 @@
<image class="photo" :src="articlelist.head_image"></image>
<view class="nameTime" >
<view class="name">{{articlelist.nickname}}</view>
<view class="time">{{articlelist.date}}</view>
<view class="time">{{articlelist.createtime}}</view>
</view>
</view>
... ... @@ -21,7 +21,11 @@
</view>
</view>
<view class="text">
{{articlelist.des_content}}
{{articlelist.des_content==undefined?'':articlelist.des_content}}
</view>
<view style="display:flex;">
<image :src="item" v-for="(item,index) in articlelist.des_images" :key="indexk" @click.stop="preimg(index)" style="margin-right:10rpx;margin-bottom:10rpx;width:128rpx;
height:128rpx"></image>
</view>
<!-- <image class="pic" src="../../static/bg_img@2x.png"></image>
<view class="text">
... ... @@ -53,6 +57,18 @@ export default {
console.log(err)
})
},
preimg(index){
let that=this;
console.log(that.articlelist.des_images,index)
uni.previewImage({
current: that.articlelist.des_images[index],
urls: that.articlelist.des_images,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
cellect(){
var that = this
var url = "article/likeArticle"
... ... @@ -112,6 +128,7 @@ export default {
width: 68rpx;
height: 68rpx;
margin-right: 20rpx;
border-radius: 50%;
}
.name{
color:rgba(61,68,77,1);
... ...
... ... @@ -35,7 +35,10 @@
<view class="articleBox">
<view class="title">{{item.title}}</view>
<view class="txt">{{item.des_content}}</view>
<image :src="item" v-for="(item,index) in item.des_images" :key="index"></image>
<view style="display:flex;">
<image :src="item" v-for="(item,indexk) in item.des_images" :key="indexk" @click.stop="preimg(index,indexk)" style="margin-right:10rpx;margin-bottom:10rpx"></image>
</view>
<!-- <image src="../../static/bg_img@2x.png"></image> -->
</view>
</view>
... ... @@ -138,6 +141,17 @@ methods:{
url: '../school/article?article_id=' + id
})
},
preimg(index,indexk){
let that=this;
uni.previewImage({
current: that.articleList[index].des_images[indexk],
urls: that.articleList[index].des_images,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
微信程
},
liuyanBoxShow(){
this.isliuyanBoxShow=true
},
... ... @@ -246,6 +260,9 @@ methods:{
token:token
}
app.post(url,params,"get").then((res)=>{
// res.forEach(function(value,index,array){
// value.head_image=app.globalData.imageBaseUrl+value.head_image
// })
this.articleList=res
}).catch((err)=>{
console.log(err)
... ... @@ -711,6 +728,7 @@ methods:{
width: 68rpx;
height: 68rpx;
margin-right: 20rpx;
border-radius: 50%;
}
}
.articleBox{
... ...
... ... @@ -293,7 +293,7 @@
}
app.post(url, params, "get").then((res) => {
console.log(res)
this.schoolmateList = res
this.schoolmateList =this.schoolmateList.concat(res)
}).catch((err) => {
console.log(err)
})
... ... @@ -462,13 +462,18 @@
console.log(options.type)
var type = options.type
this.type = type
this.getmatelist()
// this.getmatelist()
// this.getAllSchool()
this.getAllGraduated()
this.getAllUp()
this.getAllProvince()
},
onShow(){
this.page=1;
this.schoolmateList=[]
this.getmatelist()
}
}
</script>
... ...