first commit
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view class="min-height bg-white">
|
||||
<HeaderItem title="自助查询"/>
|
||||
<view class="p-20 pos-r bg-linear" style="padding-bottom: 70rpx">
|
||||
<u-input v-model="keyword" shape="circle" :custom-style="{background: 'white', height: '65rpx'}"
|
||||
placeholder="请输入您要查找的内容"/>
|
||||
<view class="pos-a" style="right: 30rpx; top: 30rpx">
|
||||
<u-button shape="circle" type="primary" :custom-style="{width: '200rpx', zIndex: 9999}" @click="getList">
|
||||
搜索
|
||||
</u-button>
|
||||
</view>
|
||||
<view class="pos-a" style="width: 100%; left: 0; bottom: -70rpx">
|
||||
<view class="bg-main-light p-20 text-25 flex justify-start items-center overflow-x m-25 rounded-sm">
|
||||
<text v-for="(item, index) in cateList" :key="index" class="tag"
|
||||
@click="changeCate(index)"
|
||||
:class="[item.id === cateId ? 'selected-tag' : '']">{{ item.title }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="50rpx"></u-gap>
|
||||
<template v-if="list.length">
|
||||
<view class="py-15 border-bottom m-25" v-for="(item, index) in list" :key="index"
|
||||
@click="$jump(`/articlePages/pages/info?id=${item.articleId}`)">
|
||||
<view class="flex-1 flex justify-between items-center w-100p">
|
||||
<text class="text-25 font-bold">{{ item.title }}</text>
|
||||
<text class="text-20 text-gray">{{ item.createTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<u-empty v-else icon="/lawOrgPages/static/empty.png"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderItem from "@/components/HeaderItem.vue";
|
||||
import {listArticleReq} from "@/api/common";
|
||||
|
||||
export default {
|
||||
name: "list",
|
||||
components: {HeaderItem},
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
cateId: 55,
|
||||
cateList: [
|
||||
{
|
||||
title: '法律法规',
|
||||
id: 55
|
||||
},
|
||||
{
|
||||
title: '案例查询',
|
||||
id: 56
|
||||
},
|
||||
{
|
||||
title: '文书模板',
|
||||
id: 67
|
||||
},
|
||||
|
||||
],
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeCate(index) {
|
||||
this.cateId = this.cateList[index].id
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const {data} = await listArticleReq({
|
||||
categoryId: this.cateId,
|
||||
title: this.keyword
|
||||
})
|
||||
this.list = data
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tag {
|
||||
padding: 10rpx 25rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
background-color: #FFCA68;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user