Files
dvcp_v2_wxcp_app/src/apps/AppHelpEffect/AppHelpEffect.vue

189 lines
5.1 KiB
Vue
Raw Normal View History

2022-07-21 10:19:50 +08:00
<template>
<div class="AppHelpEffect">
2022-07-21 15:03:23 +08:00
<AiTopFixed>
2022-07-21 18:02:04 +08:00
<div class="search"><u-search placeholder="请输入姓名、身份证号" @clear="name='',getList()" clearable v-model="name" :show-action="false" @search="search"></u-search></div>
2022-07-21 15:03:23 +08:00
<div class="select">
<div class="left">
2022-07-21 18:02:04 +08:00
<AiAreaPicker v-model="areaId" :area-id="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
2022-07-21 16:03:34 +08:00
<div>
2022-07-21 17:02:35 +08:00
<u-icon name="map-fill" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;margin-top:18px"></u-icon>
2022-07-21 16:03:34 +08:00
<span v-if="areaId" style="color:#333;fontSize: 14px;" class="areaName">{{ areaName }}</span>
<span v-else style="color: #999;fontSize: 14px;" class="areaName">所在地区</span>
2022-07-21 18:02:04 +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"></u-icon>
2022-07-21 16:03:34 +08:00
</div>
</AiAreaPicker>
2022-07-21 15:03:23 +08:00
</div>
<div class="right">
2022-07-21 16:03:34 +08:00
<AiSelect v-model="houseType" :list="typeList" @data="typeSelect">
2022-07-21 17:02:35 +08:00
<span v-if="!houseType" style="color: #999;">户类型</span>
2022-07-21 16:03:34 +08:00
<span v-else>{{ $dict.getLabel('fpHouseType', houseType) }}</span>
2022-07-21 15:03:23 +08:00
<u-icon name="arrow-down" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;"></u-icon>
</AiSelect>
</div>
</div>
</AiTopFixed>
<div class="cardList">
2022-07-22 09:45:14 +08:00
<div v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
<p class="user">
<span class="name">{{ item.name }}</span>
<span :style="{color: item.houseType==1? '#FF6300': '#00D25D'}">{{ $dict.getLabel('fpHouseType', item.houseType) }}</span>
</p>
<div class="idCard">{{ item.idNumber.replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
<div class="tel"><img src="./images/dh@2x.png" alt="">{{ item.phone}}</div>
<div class="address"><img src="./images/dz@2x.png" alt="">
{{ item.countyName + item.townName + item.villageName }}{{ item.currentAddress || '' }}
</div>
2022-07-21 15:03:23 +08:00
</div>
</div>
2022-07-22 09:45:14 +08:00
<AiEmpty v-else description="暂无数据"></AiEmpty>
2022-07-21 15:03:23 +08:00
</div>
2022-07-22 09:45:14 +08:00
2022-07-21 10:19:50 +08:00
</div>
</template>
<script>
2022-07-21 16:03:34 +08:00
import {mapState} from 'vuex'
2022-07-21 10:19:50 +08:00
export default {
name: "AppHelpEffect",
appName: '帮扶成效',
data() {
2022-07-21 15:03:23 +08:00
return {
name: "",
current: 1,
declareReason: "",
areaList: [],
typeList: [],
houseType: 1,
list: [],
2022-07-21 16:03:34 +08:00
areaId: '',
areaName: '',
houseType: '',
2022-07-21 15:03:23 +08:00
}
},
2022-07-21 16:03:34 +08:00
computed: {
...mapState(['user'])
},
2022-07-21 18:02:04 +08:00
2022-07-21 15:03:23 +08:00
methods: {
2022-07-21 16:03:34 +08:00
areaSelect(e) {
2022-07-21 18:02:04 +08:00
this.areaId = e
2022-07-21 16:03:34 +08:00
this.current = 1
this.list = []
2022-07-21 18:02:04 +08:00
this.getList()
2022-07-21 16:03:34 +08:00
},
onLoad() {
this.$dict.load('fpHouseType').then(() => {
this.typeList = this.$dict.getDict('fpHouseType').map((item) =>{
return {
label: item.dictName,
value: item.dictValue
}
})
this.typeList.unshift({ label: '全部类型', value: ''})
2022-07-22 09:45:14 +08:00
this.areaId = this.user.areaId
this.getList()
2022-07-21 16:03:34 +08:00
})
2022-07-22 09:45:14 +08:00
2022-07-21 16:03:34 +08:00
},
typeSelect(v) {
this.current = 1
this.list = []
this.houseType = v?.[0].value
this.getList()
},
2022-07-21 18:02:04 +08:00
search(value) {
this.name = value
this.list = []
this.current= 1
this.getList()
},
2022-07-21 15:03:23 +08:00
getList() {
2022-07-21 17:02:35 +08:00
this.$http.post('/app/apppreventionreturntopoverty/list', null, {
2022-07-21 15:03:23 +08:00
params: {
current: this.current,
2022-07-21 17:24:40 +08:00
con: this.name,
2022-07-21 16:31:12 +08:00
areaId: this.areaId,
2022-07-21 17:24:40 +08:00
houseType: this.houseType
2022-07-21 15:03:23 +08:00
},
}).then((res) => {
if (res?.data) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
toDetail(id) {
uni.navigateTo({url: `./helpDetail?id=${id}`})
},
onReachBottom() {
this.current ++
this.getList()
}
2022-07-21 10:19:50 +08:00
},
onShow() {
document.title = '帮扶成效'
}
}
</script>
<style lang="scss" scoped>
.AppHelpEffect {
2022-07-21 15:03:23 +08:00
.search {
height: 100px;
line-height: 100px;
}
.select {
width: 100%;
display: flex;
2022-07-21 16:03:34 +08:00
height: 86px;
line-height: 86px;
text-align: center;
2022-07-21 10:19:50 +08:00
2022-07-21 15:03:23 +08:00
::v-deep .AiSelect .display {
justify-content: center;
}
2022-07-21 10:19:50 +08:00
2022-07-21 15:03:23 +08:00
.left,
.right {
2022-07-21 16:03:34 +08:00
flex: 1;
2022-07-21 15:03:23 +08:00
}
2022-07-21 10:19:50 +08:00
}
2022-07-21 15:03:23 +08:00
.cardList {
padding: 32px;
box-sizing: border-box;
.card {
padding: 32px;
box-sizing: border-box;
margin-bottom: 32px;
background: #FFF;
box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.0200);
border-radius: 16px;
.user {
display: flex;
justify-content: space-between;
.name {
font-size: 36px;
font-weight: 600;
}
}
.idCard,
.tel,
.address {
margin-top: 8px;
color: #999999;
img {
2022-07-21 17:24:40 +08:00
margin-right: 16px;
2022-07-21 15:03:23 +08:00
width: 28px;
height: 28px;
}
}
2022-07-21 17:24:40 +08:00
.tel,
.address {
color: #333;
}
2022-07-21 15:03:23 +08:00
}
}
2022-07-21 10:19:50 +08:00
}
</style>