修改文章列表筛选

master
chen 2022-08-10 18:27:01 +08:00
parent e9abd70445
commit 8809e0d27b
43 changed files with 90 additions and 132 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
/node_modules
/public/storage
/unpackage
/unpackage/dist
/.hbuilderx
Homestead.yaml
Homestead.json

View File

@ -33,7 +33,7 @@
.cateActive{background-color: #F5F5F5;border-radius: 10rpx 0rpx 0rpx 10rpx;padding: 20rpx 10rpx;text-align: center;margin-left: 10rpx;}
.cate-tu-item{padding: 16rpx 20rpx;background-color: #DFDFDF;}
.cate-box{position: fixed;top: 0;left: 0;bottom: 140rpx;background-color: #FFFFFF;}
.list-min{min-height: 360rpx;}
.list-min{min-height: 380rpx;}
.cate-box .fon26 .mar-s20:first-child {margin-top: 50rpx;}
/* 搜索 */
.search-input-box{width: 100%;padding-bottom: 20rpx;}

View File

@ -6,15 +6,19 @@
<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">
<!-- 背景图 -->
<image lazy-load :class="radiu?'radius15':'radius30'" class=" width100 list-min" :src="item.main_img" mode="widthFix"></image>
<view class="posia fon24 colf" style="right: 10rpx;top: 40rpx;z-index: 1;">
<view class="posia fon24 colf" style="right: 10rpx;top: 30rpx;z-index: 1;">
<view @tap.stop="praiseEv(index)" class="disjcac fc">
<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>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.likes>1000 ? '999+':item.likes}}</view>
</view>
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
<view @tap.stop="chooseLike(index)" class="disjcac fc">
<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>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.collects>1000 ? '999+':item.collects}}</view>
</view>
<view class="disjcac fc">
<image class="img-box" lazy-load :style="{width: radiu ?'30rpx':'50rpx',height: radiu ?'30rpx':'50rpx'}" src="/static/public/looks-white.png" mode="aspectFill"></image>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.views>1000 ? '999+':item.views}}</view>
</view>
</view>
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
<!-- 不喜欢 -->
@ -48,15 +52,19 @@
<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">
<!-- 背景图 -->
<image lazy-load :class="radiu?'radius15':'radius30'" class="width100 list-min" :src="item.main_img" mode="widthFix"></image>
<view class="posia fon24 colf" style="right: 10rpx;top: 40rpx;z-index: 1;">
<view class="posia fon24 colf" style="right: 10rpx;top: 30rpx;z-index: 1;">
<view @tap.stop="praiseEv(index)" class="disjcac fc">
<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>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.likes>1000 ? '999+':item.likes}}</view>
</view>
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
<view @tap.stop="chooseLike(index)" class="disjcac fc">
<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>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.collects>1000 ? '999+':item.collects}}</view>
</view>
<view class="disjcac fc">
<image class="img-box" lazy-load :style="{width: radiu ?'30rpx':'50rpx',height: radiu ?'30rpx':'50rpx'}" src="/static/public/looks-white.png" mode="aspectFill"></image>
<view style="text-shadow: 0px 0px 3px #000000;">{{item.views>1000 ? '999+':item.views}}</view>
</view>
</view>
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
<!-- 不喜欢 -->

View File

@ -502,7 +502,8 @@
name:item.published_by || '恒美植发',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
is_liked:item.is_liked,//
tag_text:item.tag_text,
}
this.dataList.push(tObj);
})

View File

@ -9,10 +9,17 @@
<input @confirm="searchEv" @input="inputEv" class="width100 fon34 radius10 problem-input" type="text" v-model="searchVal" placeholder="请输入内容..."/>
<!-- 搜索 -->
<view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
<!-- 筛选 -->
<picker class="flexs" mode="selector" :range="sreenList" @change="chooseSreen">
<view class="disac flexs pad-z25" style="font-size: 34rpx;color: #467df6;">
<image src="/static/public/icon-search.png" style="width: 32rpx;height: 30rpx;" mode=""></image>
筛选
</view>
</picker>
</view>
<view class="pad-s20 pad-zy30 fon34" @click="clickEv">{{diseaseText}}</view>
</view>
<view class="pad-zy20 mar-s20">
<view class="pad-x30 pad-zy30 fon34" v-if="diseaseText">{{diseaseText}}</view>
<!-- 列表 -->
<view v-if="dataList.length!=0">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmevl" :list="dataList"></list-pu>
@ -60,6 +67,7 @@
category_id:'',//ID
diseaseText:'',//
sreenList:[],//
sreenIndex:0,
sreenIdList:[],//id
parentId:'',//id
}
@ -121,22 +129,41 @@
this.$toolAll.tools.showToast('暂无筛选项')
}
},
//
chooseSreen(e){
this.sreenIndex = e.detail.value;
this.page = 1;
this.category_id = this.sreenIdList[this.sreenIndex];
this.diseaseText = this.sreenList[this.sreenIndex];
this.searchEv();
},
//
cateListEv(){
this.$requst.get('archives/disease').then(res=>{
if(res.code==0){
let newList = res.data.filter(item=>item.id==this.category_id);
// let newList = res.data.filter(item=>item.id==this.category_id);
let newList = res.data;
if(newList.length){
this.parentId = newList[0].id;
if(newList[0].children.length){
newList[0].children.forEach(item=>{
newList.forEach(item=>{
if(item.id){
this.sreenList.push(item.name);
this.sreenIdList.push(item.id);
}
})
this.sreenList.unshift('全部');
this.sreenIdList.unshift('');
}
}
// if(newList.length){
// this.parentId = newList[0].id;
// if(newList[0].children.length){
// newList[0].children.forEach(item=>{
// this.sreenList.push(item.name);
// this.sreenIdList.push(item.id);
// })
// this.sreenList.unshift('');
// this.sreenIdList.unshift('');
// }
// }
}
})
},
@ -212,7 +239,8 @@
name:item.published_by || '恒美植发',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
is_liked:item.is_liked,//
tag_text:item.tag_text,
}
this.dataList.push(tObj);
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long