Files
dvcp_v2_wxcp_app/library/apps/AppResidentDocument/DetailCard.vue

210 lines
5.3 KiB
Vue
Raw Normal View History

2021-12-23 14:29:45 +08:00
<template>
<div class="DetailCard">
<div class="top"></div>
<div class="middle">
<div class="hint">家庭地址</div>
<div class="areaHint">
<u-icon name="map-fill" color="#73ABFF"></u-icon>
2021-12-24 19:33:28 +08:00
<span>{{ resident.currentAreaName }}</span>
<span v-if="resident.currentAddress">{{ resident.currentAddress }}</span>
2021-12-23 14:29:45 +08:00
</div>
</div>
<div class="bottom">
2021-12-24 09:33:49 +08:00
<div class="hints">家庭成员 {{ data.family && data.family.length }}</div>
2021-12-23 14:29:45 +08:00
<div v-if="data.family && data.family.length > 0">
<div class="card" v-for="(item, i) in data.family" :key="i" @click="toDetailPeople(item)">
<div class="photos">
<img :src="item.photo" alt="" v-if="item.photo" />
2021-12-24 22:50:09 +08:00
<img src="./components/img/44.png" alt="" v-else />
2021-12-23 14:29:45 +08:00
</div>
<div class="right">
<div class="rightTop">
<div class="rightTop-lefts">
<span class="names">{{ item.name }}</span>
2021-12-23 18:43:29 +08:00
<span class="fileStatuss" v-if="item.fileStatus == 1"> {{ $dict.getLabel('fileStatus', item.fileStatus) }}</span>
2021-12-24 19:34:03 +08:00
<span class="householdNames" v-if="item.householdName == 1">户主</span>
<span class="householdNames" v-else>
2021-12-23 16:48:14 +08:00
{{ $dict.getLabel('householdRelation', item.householdRelation) }}
2021-12-23 14:29:45 +08:00
</span>
</div>
<div class="rightTop-rights">
<u-section :show-line="false" sub-title="详情"></u-section>
</div>
</div>
<div class="rightBottom">
<span>身份证号</span>
2021-12-23 16:48:14 +08:00
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1******$2') }}</span>
2021-12-23 14:29:45 +08:00
</div>
</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
</div>
</div>
</template>
<script>
export default {
name: 'DetailCard',
components: {},
props: {},
data() {
return {
id: '',
data: [],
2021-12-24 19:33:28 +08:00
resident: {},
2021-12-23 14:29:45 +08:00
}
},
computed: {},
watch: {},
onLoad(o) {
2021-12-24 19:33:28 +08:00
document.title = '居民档案'
2021-12-23 14:29:45 +08:00
this.id = o.id
2021-12-23 18:43:29 +08:00
this.$dict.load('householdRelation', 'fileStatus').then(() => {
2021-12-23 14:29:45 +08:00
this.getDetail()
})
},
onShow() {},
methods: {
getDetail() {
this.$http.post(`/app/appresident/detail?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.data = res.data
2022-01-14 14:54:04 +08:00
this.$forceUpdate()
2021-12-23 14:29:45 +08:00
this.$nextTick(() => {
2021-12-24 19:33:28 +08:00
this.resident = res.data.resident
2022-01-14 14:54:04 +08:00
this.$forceUpdate()
2021-12-23 14:29:45 +08:00
})
}
})
},
toDetailPeople(item) {
uni.navigateTo({ url: `./DetailPeople?id=${item.id}` })
},
},
}
</script>
<style scoped lang="scss">
.DetailCard {
height: 100%;
.top {
height: 112px;
background: #3975c6;
}
.middle {
margin: -80px 32px 0 32px;
padding: 38px 30px 78px 28px;
background: #ffffff;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.02);
border-radius: 16px;
z-index: 999;
.hint {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.areaHint {
margin-top: 38px;
span {
margin-left: 14px;
}
}
}
.bottom {
margin: 32px 30px 48px 30px;
background: #fff;
padding: 38px 30px 30px 30px;
.hints {
margin-bottom: 38px;
}
.card {
display: flex;
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.08);
border-radius: 16px;
padding: 48px 32px;
margin-bottom: 32px;
.photos {
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 40px;
width: 100%;
.rightTop {
display: flex;
justify-content: space-between;
.rightTop-lefts {
.names {
font-size: 32px;
font-weight: 600;
}
.householdNames {
margin-left: 30px;
font-size: 26px;
font-weight: 500;
color: #5aad6a;
}
2021-12-23 18:43:29 +08:00
.fileStatuss {
display: inline-block;
margin-left: 30px;
color: #ff4466;
background: #ffecef;
border-radius: 8px;
width: 88px;
height: 40px;
line-height: 40px;
text-align: center;
}
2021-12-23 14:29:45 +08:00
}
.rightTop-rights {
::v-deep .u-section {
.u-section__right-info {
color: #3975c6 !important;
.u-section__right-info__icon-arrow {
.u-icon {
.u-icon__icon {
color: #3975c6 !important;
}
}
}
}
}
}
}
.rightBottom {
margin-top: 20px;
}
}
}
.card:nth-child(2n-1) {
// background: royalblue;
background: url(http://respub.sinoecare.net/20211222/装饰-20211222162743.png) no-repeat;
background-size: 100% 100%;
}
.card:nth-child(2n) {
// background: pink;
background: url(http://respub.sinoecare.net/20211222/装饰2-20211222162934.png) no-repeat;
background-size: 100% 100%;
}
}
}
</style>