2021-08-19 06:40:59 +00:00
|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="disjb fw" v-if="list.length!=0">
|
|
|
|
<!-- 左侧列表 -->
|
|
|
|
<view class="list-box">
|
2022-07-12 07:17:50 +00:00
|
|
|
<view @tap="goDetail(index)" v-if="index%2==0" :class="radiu?'radius15 mar-x10':'radius30 mar-x15'" class="posir colf zou" v-for="(item,index) in list" :key="index">
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 背景图 -->
|
2022-03-09 10:06:05 +00:00
|
|
|
<image lazy-load :class="radiu?'radius15':'radius30'" class=" width100 list-min" :src="item.main_img" mode="widthFix"></image>
|
2022-07-14 09:43:56 +00:00
|
|
|
<view class="posia fon24 colf" style="right: 10rpx;top: 40rpx;z-index: 1;">
|
2022-03-09 10:06:05 +00:00
|
|
|
<view @tap.stop="praiseEv(index)" class="disjcac fc">
|
2022-03-14 10:28:35 +00:00
|
|
|
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/list-nlike.png','/static/public/detail-like.png'][item.is_liked]" mode="aspectFill"></image>
|
2022-07-22 10:39:41 +00:00
|
|
|
<view style="text-shadow: 0px 0px 3px #000000;">{{item.likes>1000 ? '999+':item.likes}}</view>
|
2022-03-04 08:48:40 +00:00
|
|
|
</view>
|
2022-03-09 10:06:05 +00:00
|
|
|
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
|
2022-03-14 10:28:35 +00:00
|
|
|
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/cnllection-no.png','/static/public/yconllection.png'][item.is_collected]" mode="aspectFill"></image>
|
2022-07-22 10:39:41 +00:00
|
|
|
<view style="text-shadow: 0px 0px 3px #000000;">{{item.collects>1000 ? '999+':item.collects}}</view>
|
2022-03-04 08:48:40 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 不喜欢 -->
|
2022-03-04 08:48:40 +00:00
|
|
|
<!-- <image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 喜欢 -->
|
2022-03-04 08:48:40 +00:00
|
|
|
<!-- <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
|
|
|
</view> -->
|
2021-08-22 08:53:12 +00:00
|
|
|
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20">
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 视频标题 -->
|
2022-07-14 09:43:56 +00:00
|
|
|
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon-3+'px'}">
|
|
|
|
<view class="clips2">{{item.title}}</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text> -->
|
|
|
|
</view>
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 视频描述 -->
|
|
|
|
<view class="mar-x10 clips1 opc">{{item.content}}</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<view class="disjbac">
|
|
|
|
<view class="disac">
|
|
|
|
<!-- 发布者头像 -->
|
2022-03-09 10:06:05 +00:00
|
|
|
<image lazy-load class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- 发布者昵称 -->
|
|
|
|
<view class="clips1 opc">{{item.name}}</view>
|
|
|
|
</view>
|
2022-07-14 09:43:56 +00:00
|
|
|
<text :style="{fontSize:(nFon-3)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">{{item.tag_text}}</text>
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 右侧列表 -->
|
|
|
|
<view class="list-box">
|
2022-07-12 07:17:50 +00:00
|
|
|
<view @tap="goDetail(index)" v-if="index%2!=0" :class="radiu?'radius15 mar-x10':'radius30 mar-x15'" class="posir colf zou" v-for="(item,index) in list" :key="index">
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 背景图 -->
|
2022-03-09 10:06:05 +00:00
|
|
|
<image lazy-load :class="radiu?'radius15':'radius30'" class="width100 list-min" :src="item.main_img" mode="widthFix"></image>
|
2022-07-14 09:43:56 +00:00
|
|
|
<view class="posia fon24 colf" style="right: 10rpx;top: 40rpx;z-index: 1;">
|
2022-03-09 10:06:05 +00:00
|
|
|
<view @tap.stop="praiseEv(index)" class="disjcac fc">
|
2022-03-14 10:28:35 +00:00
|
|
|
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/list-nlike.png','/static/public/detail-like.png'][item.is_liked]" mode="aspectFill"></image>
|
2022-07-22 10:39:41 +00:00
|
|
|
<view style="text-shadow: 0px 0px 3px #000000;">{{item.likes>1000 ? '999+':item.likes}}</view>
|
2022-03-04 08:48:40 +00:00
|
|
|
</view>
|
2022-03-09 10:06:05 +00:00
|
|
|
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
|
2022-03-14 10:28:35 +00:00
|
|
|
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/cnllection-no.png','/static/public/yconllection.png'][item.is_collected]" mode="aspectFill"></image>
|
2022-07-22 10:39:41 +00:00
|
|
|
<view style="text-shadow: 0px 0px 3px #000000;">{{item.collects>1000 ? '999+':item.collects}}</view>
|
2022-03-04 08:48:40 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 不喜欢 -->
|
2022-03-04 08:48:40 +00:00
|
|
|
<!-- <image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 喜欢 -->
|
2022-03-04 08:48:40 +00:00
|
|
|
<!-- <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
|
|
|
</view> -->
|
2021-08-22 08:53:12 +00:00
|
|
|
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20 ">
|
2021-08-19 06:40:59 +00:00
|
|
|
<!-- 视频标题 -->
|
2022-07-14 09:43:56 +00:00
|
|
|
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon-3+'px'}">
|
|
|
|
<view class="clips2">{{item.title}}</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
<!-- 视频描述 -->
|
|
|
|
<view class="mar-x10 clips1 opc">{{item.content}}</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<view class="disjbac">
|
|
|
|
<view class="disac">
|
|
|
|
<!-- 发布者头像 -->
|
2022-03-09 10:06:05 +00:00
|
|
|
<image lazy-load class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- 发布者昵称 -->
|
|
|
|
<view class="clips1 opc">{{item.name}}</view>
|
|
|
|
</view>
|
2022-07-14 09:43:56 +00:00
|
|
|
<text :style="{fontSize:(nFon-3)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">{{item.tag_text}}</text>
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
2022-01-28 09:04:37 +00:00
|
|
|
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view v-else class="" style="display: flex;flex-direction: column;align-items: center;">
|
|
|
|
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
|
2021-12-20 08:02:27 +00:00
|
|
|
<!-- <view class="fon24 col3" style="margin-bottom: 60rpx;">暂无内容</view> -->
|
2021-08-19 06:40:59 +00:00
|
|
|
</view>
|
|
|
|
<!-- 弹框 -->
|
|
|
|
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
|
|
|
</view>
|
|
|
|
</template>
|
2021-09-08 00:46:34 +00:00
|
|
|
|
2021-08-19 06:40:59 +00:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name:"list-pu",
|
|
|
|
props:{
|
|
|
|
list:{//数据
|
|
|
|
type:Array,
|
|
|
|
default:function(){
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
nWidth:{
|
|
|
|
type:String,
|
|
|
|
default:'120'
|
|
|
|
},
|
|
|
|
nHeight:{
|
|
|
|
type:String,
|
|
|
|
default:'120'
|
|
|
|
},
|
|
|
|
nFon:{
|
|
|
|
type:String,
|
|
|
|
default:'15'
|
|
|
|
},
|
|
|
|
nmarz:{
|
|
|
|
type:String,
|
|
|
|
default:'10'
|
|
|
|
},
|
|
|
|
radiu:{
|
|
|
|
type:Boolean,
|
|
|
|
default:false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isShowT:false,
|
|
|
|
pu_content:'是否需要取消收藏?',
|
2021-08-22 08:53:12 +00:00
|
|
|
current:'-1',
|
2022-04-13 07:00:35 +00:00
|
|
|
isVedio:false
|
2021-08-19 06:40:59 +00:00
|
|
|
};
|
|
|
|
},
|
2022-04-13 07:00:35 +00:00
|
|
|
mounted() {
|
|
|
|
this.$requst.get('index/base-config').then(res=>{
|
|
|
|
res.data.v==0 ? this.isVedio = false : this.isVedio = true;
|
|
|
|
})
|
|
|
|
},
|
2021-08-19 06:40:59 +00:00
|
|
|
methods:{
|
|
|
|
goDetail(index){//查看详情
|
2022-03-04 08:48:40 +00:00
|
|
|
if(this.$toolAll.tools.judgeAuth()){
|
|
|
|
uni.navigateTo({
|
|
|
|
url:'/pagesB/problemDetail/problemDetail?id='+this.list[index].id+'&category_id='+this.list[index].category_id
|
|
|
|
})
|
2021-08-26 09:57:04 +00:00
|
|
|
}
|
2021-08-19 06:40:59 +00:00
|
|
|
},
|
|
|
|
chooseLike(index){//喜欢不喜欢事件
|
|
|
|
// console.log('喜欢不喜欢:',index);
|
2022-03-04 08:48:40 +00:00
|
|
|
if(this.$toolAll.tools.judgeAuth()){
|
|
|
|
this.$emit('chooseLike',index)
|
|
|
|
this.current = index
|
|
|
|
if(this.list[index].is_collected==1) {
|
|
|
|
this.isShowT = true
|
|
|
|
} else {
|
|
|
|
// 调用tools.js中的种植埋点事件
|
|
|
|
this.$toolAll.tools.plantPoint(3,this.list[index].id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 点赞事件
|
|
|
|
praiseEv(index){
|
|
|
|
if(this.$toolAll.tools.judgeAuth()){
|
|
|
|
this.$emit('praise',index)
|
|
|
|
this.current = index
|
2021-08-19 06:40:59 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
comfirmev(){
|
2021-08-24 00:54:50 +00:00
|
|
|
// console.log('取消收藏成功');
|
2021-08-19 06:40:59 +00:00
|
|
|
this.$emit('comfirmev',this.current)
|
|
|
|
this.isShowT = false
|
|
|
|
},
|
|
|
|
cancleev(){
|
2021-08-24 00:54:50 +00:00
|
|
|
// console.log('关闭弹框');
|
2021-08-19 06:40:59 +00:00
|
|
|
this.isShowT = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2022-03-14 10:28:35 +00:00
|
|
|
.img-box {border-radius: 100%;}
|
2021-08-19 06:40:59 +00:00
|
|
|
</style>
|