Files
dvcp_v2_wxcp_app/src/apps/AppHelpDeclaration/list.vue

270 lines
6.7 KiB
Vue
Raw Normal View History

2022-05-19 13:35:55 +08:00
<template>
2022-05-19 15:41:49 +08:00
<div class="list">
2022-05-19 13:35:55 +08:00
<AiTopFixed>
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{item}}<span></span></div>
</div>
<div class="select-box">
2022-05-20 09:55:14 +08:00
<div class="left">
2022-05-20 10:37:11 +08:00
<AiAreaPicker v-model="areaId" :areaId="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
2022-05-20 09:22:13 +08:00
<div>
2022-05-20 10:14:39 +08:00
<span v-if="areaId" style="color:#333;fontSize: 14px;" class="areaName">{{ areaName }}</span>
2022-05-19 13:35:55 +08:00
<span v-else style="color: #999;fontSize: 14px;" class="areaName">所在地区</span>
2022-05-20 09:22:13 +08:00
<u-icon name="arrow-down" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;margin-top:18px" @select="areaSelect(e)"></u-icon>
2022-05-19 13:35:55 +08:00
</div>
</AiAreaPicker>
2022-05-20 10:37:11 +08:00
<u-icon name="close-circle" v-if="areaId" @click="clearArea" color="#999" size="24"></u-icon>
2022-05-19 13:35:55 +08:00
</div>
2022-05-20 09:55:14 +08:00
<div class="right">
2022-05-20 10:14:39 +08:00
<AiSelect dict="helpDeclarationReason" v-model="declareReason">
2022-05-19 15:41:49 +08:00
<span v-if="!declareReason" style="color: #999;">风险类型</span>
<span v-else>{{ $dict.getLabel('helpDeclarationReason', declareReason) }}</span>
2022-05-19 13:35:55 +08:00
<u-icon name="arrow-down" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;"></u-icon>
</AiSelect>
2022-05-20 10:37:11 +08:00
<u-icon name="close-circle" v-if="declareReason" @click="clearReason" color="#999" size="24"></u-icon>
<!-- style="margin-left: 4px;width: 14px; display:inline-block;" -->
2022-05-19 13:35:55 +08:00
</div>
</div>
</AiTopFixed>
<div v-if="list.length">
2022-05-19 15:41:49 +08:00
<div class="card_list">
<div class="card" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
2022-05-19 13:35:55 +08:00
<div class="top">
<div class="title">{{ item.riskDescription }}</div>
<div class="time">{{ item.declareTime }}</div>
</div>
<div class="bottom">
<span :style="{background: item.status == 0? '#FF883C':item.status == 1? '#1AAAFF': item.status==2? '#FF4466': '#42D784'}"></span>
<span :class="item.status == 0? 'status0': item.status==1? 'status1': item.status==2? 'status3': 'status2'">{{ $dict.getLabel('helpDeclarationStatus',item.status) }}</span>
</div>
</div>
</div>
</div>
<AiEmpty v-else description="暂无数据"/>
2022-05-19 16:12:11 +08:00
<!-- <AiFixedBtn>
2022-05-19 13:35:55 +08:00
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAdd()"/>
2022-05-19 16:12:11 +08:00
</AiFixedBtn> -->
<div style="height: 56px"></div>
<div class="btn" @click="toAdd">申请帮扶</div>
2022-05-19 13:35:55 +08:00
</div>
</template>
<script>
2022-05-20 10:37:11 +08:00
import { mapState } from 'vuex'
2022-05-19 13:35:55 +08:00
export default {
data() {
return {
tabs: ['全部待办','办理历史'],
tabIndex: 0,
current: 1,
areaId: '',
areaName: '',
2022-05-19 15:41:49 +08:00
declareReason: '',
2022-05-20 09:22:13 +08:00
list: [],
2022-05-19 13:35:55 +08:00
}
},
2022-05-20 10:37:11 +08:00
computed: {
...mapState(['user'])
},
2022-05-19 13:35:55 +08:00
onShow() {
2022-05-19 15:41:49 +08:00
this.$dict.load('helpDeclarationStatus').then(() => {
uni.$on('update', () => {
this.getList()
})
})
2022-05-19 13:35:55 +08:00
this.getList()
},
methods: {
tabClick(index) {
this.current = 1,
this.list = [],
this.tabIndex = index,
this.getList()
},
2022-05-20 10:37:11 +08:00
areaSelect(e) {
console.log(e);
this.areaId =e
this.$nextTick(() => {
this.getList()
})
},
2022-05-20 09:22:13 +08:00
clearArea() {
2022-05-20 09:55:14 +08:00
this.areaId = '',
this.areaName = '',
2022-05-20 09:22:13 +08:00
this.current = 1,
this.list = [],
this.getList()
},
clearReason() {
2022-05-20 09:55:14 +08:00
this.declareReason = '',
2022-05-20 09:22:13 +08:00
this.current = 1,
this.list = [],
this.getList()
},
2022-05-19 13:35:55 +08:00
getList() {
2022-05-19 15:41:49 +08:00
this.$http.post('/app/apphelpdeclarationinfo/listByEw',null,{
2022-05-19 13:35:55 +08:00
params: {
current: this.current,
2022-05-19 15:41:49 +08:00
searchType: this.tabIndex,
2022-05-20 09:22:13 +08:00
areaId: this.areaId,
2022-05-19 15:41:49 +08:00
declareReason: this.declareReason // 风险类型
2022-05-19 13:35:55 +08:00
}
}).then((res) => {
if(res?.data) {
this.list = this.current == 1? res.data.records : [...this.list,...res.data.records]
}
})
},
toAdd() {
uni.navigateTo({url: './add'})
},
2022-05-19 15:41:49 +08:00
toDetail(id) {
uni.navigateTo({url: `./details?id=${id}`})
},
2022-05-19 13:35:55 +08:00
onReachBottom() {
this.current ++
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
2022-05-19 15:41:49 +08:00
.list {
2022-05-19 13:35:55 +08:00
::v-deep .AiTopFixed .content {
padding: 0;
}
2022-05-20 09:55:14 +08:00
::v-deep .AiSelect .display{
justify-content: center;
}
2022-05-19 13:35:55 +08:00
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
.item{
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
.active{
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span{
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.select-box {
display: flex;
height: 96px;
line-height: 96px;
width: 100%;
.left,
.right {
flex: 1;
text-align: center !important;
font-size: 28px;
2022-05-20 09:55:14 +08:00
::v-deep .u-icon .uicon-close-circle{
top: -96px !important;
left: 80px;
2022-05-20 10:37:11 +08:00
margin-left: 30px;
width: 14px;
display:inline-block;
2022-05-20 09:55:14 +08:00
}
2022-05-19 13:35:55 +08:00
}
}
.card_list {
2022-05-19 15:41:49 +08:00
padding: 24px 32px;
2022-05-19 13:35:55 +08:00
box-sizing: border-box;
.card {
background: #FFFFFF;
box-shadow: 0px 0px 8px 0px #00000005;
border-radius: 16px;
margin-bottom: 24px;
.top {
padding: 32px;
box-sizing: border-box;
border-bottom: 2px solid #DDDDDD;
.title {
color: #333333;
font-size: 32px;
font-weight: 600;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
.time {
margin-top: 32px;
color: #999999;
font-size: 26px;
}
}
.bottom {
padding: 32px;
box-sizing: border-box;
span:first-child {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
background: #FF4466;
}
}
.status0 {
color: #FF883C
}
.status1 {
color: #1AAAFF
}
.status2 {
color: #42D784
}
.status3 {
color: #FF4466
}
}
}
2022-05-19 16:12:11 +08:00
.btn {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
color: #FFF;
background: #3975C6;
}
2022-05-19 13:35:55 +08:00
}
</style>