Files
dvcp_v2_wechat_app/project/sanjianxi/AppNeighborLinkage/AppNeighborLinkage.vue
shijingjing f3ce80b49e bug
2022-04-20 10:00:05 +08:00

217 lines
5.4 KiB
Vue

<template>
<div class="AppNeighborLinkage">
<div class="header">
<div class="search">
<u-search placeholder="请输入需要搜索的内容" v-model="keyword" :show-action="false" @search="search"></u-search>
</div>
<div class="select">
<div class="item" >
<AiSelect class="right" v-model="status" dict="partyFourLinkageStatus" @data="typeSelect">
<span v-if="!status">全部状态</span>
<span v-else>{{ $dict.getLabel('partyFourLinkageStatus',status) }}</span>
<u-icon name="arrow-down-fill" color="#666666" size="28"></u-icon>
</AiSelect>
</div>
<div class="item" @click="isShowDate = true">
<span v-if="!linksageDate">时间选择</span>
<span v-else>{{ linksageDate }}</span>
<u-icon name="arrow-down-fill" color="#666666" size="28"></u-icon>
</div>
<u-picker mode="time" :params="params" v-model="isShowDate" @confirm="onDateChange"></u-picker>
</div>
</div>
<div class="section" v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./neighborDetail?id=${item.id}`)">
<div class="info">
<p>{{ item.description }}</p>
<div><span>事件日期</span><span>{{ item.linksageDate }}</span></div>
<div><span>四邻对象</span><span>{{ item.residentName }}</span></div>
</div>
<div class="status">
<span :style="{background: item.status==0? '#FF883C': item.status==1? '#42D784': '#FF4466'}"></span>
<span :style="{color: item.status==0? '#FF883C': item.status==1? '#42D784': '#FF4466'}">
{{ $dict.getLabel('partyFourLinkageStatus',item.status) }}
</span>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else />
<div class="btn" v-if="isShowDate == false">
<div class="myInfo" @click="$linkTo('./myNeighborInfo')">我的四邻信息</div>
<div class="addBtn" @click="$linkTo('./addLinkage')">添加联动记录</div>
</div>
</div>
</template>
<script>
export default {
name: "AppNeighborLinkage",
appName: "四邻联动",
data() {
return {
keyword:'',
status: '',
linksageDate: '',
isShowDate: false,
params: {
year: true,
month: true,
day: true,
},
list: [],
current: 1,
}
},
onShow() {
this.$dict.load('partyFourLinkageStatus')
uni.$on('update', ()=>{
this.getList()
})
this.getList()
},
methods: {
search(e) {
this.keyword = e
},
typeSelect(e) {
this.list = []
this.status = e.value
this.current = 1
this.getList()
},
onDateChange(e) {
this.list = []
this.linksageDate = `${e.year}-${e.month}-${e.day}`
this.current = 1
this.getList()
},
getList() {
this.$instance.post('/app/apppartyfourlinkage/listByApplet',null,{
params: {
current: this.current,
status: this.status,
linksageDate: this.linksageDate,
}
}).then(res=>{
if (res?.data) {
this.list = this.current==1? res.data.records : [...this.list, ...res.data.records]
}
})
},
},
onReachBottom() {
this.current ++,
this.getList()
}
}
</script>
<style lang="scss" scoped>
.AppNeighborLinkage {
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
.search {
box-sizing: border-box;
padding: 24px 32px;
background: #4181FF;
height: 112px;
}
.select {
display: flex;
height: 112px;
line-height: 112px;
background: #FFF;
.item {
flex: 1;
text-align: center;
}
}
}
.section {
padding: 244px 32px 140px 32px;
box-sizing: border-box;
.card {
background: #FFF;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
border-radius: 16px;
margin-bottom: 24px;
.info {
padding: 20px 30px 30px;
box-sizing: border-box;
border-bottom: 1px solid #DDDDDD;
p {
font-size: 32px;
font-weight: 600;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
div {
span:first-child {
color: #999999;
margin-right: 32px;
}
}
div:first-child {
margin-top: 32px;
}
}
.status {
padding: 32px 32px;
span:first-child {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background: #FF883C;
margin-right: 10px;
}
}
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
display: flex;
background: #F3F6F9;
.myInfo,
.addBtn {
flex: 1;
height: 88px;
line-height: 88px;
text-align: center;
color: #FFF;
background: #4181FF;
border-radius: 16px;
}
.myInfo {
margin-right: 20px;
color: #A0C0FF;
background: #FFF;
border: 1px solid #A0C0FF;
}
}
::v-deep .AiSelect {
display: inline-block;
}
::v-deep .emptyWrap {
margin-top: 200px;
}
}
</style>