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

175 lines
4.6 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>
<div class="search"><u-search placeholder="请输入姓名、身份证号" v-model="name" :show-action="false"></u-search></div>
<div class="select">
<div class="left">
2022-07-21 16:03:34 +08:00
<AiAreaPicker v-model="areaId" :areaId="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
<div>
<span v-if="areaId" style="color:#333;fontSize: 14px;" class="areaName">{{ areaName }}</span>
<span v-else style="color: #999;fontSize: 14px;" class="areaName">所在地区</span>
<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>
</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">
<span v-if="!houseType" style="color: #999;">户型类型</span>
<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">
<div class="card" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
<p class="user">
<span class="name">{{ item.name }}</span>
2022-07-21 16:12:58 +08:00
<span :style="{color: item.houseType==1? '#FF6300': '#00D25D'}">{{ $dict.getLabel('fpHouseType', item.houseType) }}</span>
2022-07-21 15:03:23 +08:00
</p>
<div class="idCard">{{ item.idNumber.replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
2022-07-21 16:34:33 +08:00
<div class="tel"><img src="./images/dh@2x.png" alt="">{{ item.phone}}</div>
2022-07-21 15:03:23 +08:00
<div class="address"><img src="./images/dz@2x.png" alt="">
{{ item.countyName + item.townName + item.villageName }}{{ item.currentAddress || '' }}
</div>
</div>
2022-07-21 16:03:34 +08:00
<AiEmpty v-if="!list.length" description="暂无数据"></AiEmpty>
2022-07-21 15:03:23 +08:00
</div>
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 15:03:23 +08:00
methods: {
2022-07-21 16:03:34 +08:00
areaSelect(e) {
this.areaId =e
this.current = 1
this.list = []
this.$nextTick(() => {
this.getList()
})
},
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: ''})
})
},
typeSelect(v) {
this.current = 1
this.list = []
this.houseType = v?.[0].value
this.getList()
},
2022-07-21 15:03:23 +08:00
getList() {
this.$http.post('/app/appgirdmemberpoverty/listByGirdMember', null, {
params: {
current: this.current,
2022-07-21 16:31:12 +08:00
name: this.name,
areaId: this.areaId,
provertyStatus: 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 = '帮扶成效'
2022-07-21 15:03:23 +08:00
this.getList()
2022-07-21 10:19:50 +08:00
}
}
</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 {
width: 28px;
height: 28px;
}
}
}
}
2022-07-21 10:19:50 +08:00
}
</style>