Files
dvcp_v2_wxcp_app/src/apps/AppMarryAndDie/FuneralList.vue

270 lines
6.3 KiB
Vue
Raw Normal View History

2021-12-20 16:12:47 +08:00
<template>
<div class="FuneralList">
<div class="top">
<AiCard>
<template #custom>
<div class="left">
2021-12-20 18:19:30 +08:00
<span class="nums"> {{ allNums }} </span>
2021-12-20 16:12:47 +08:00
<span class="hint">全部丧礼</span>
</div>
<div class="right">
2021-12-20 18:19:30 +08:00
<span class="nums">{{ addNums }}</span>
2021-12-20 16:12:47 +08:00
<span class="hint">本月新增</span>
</div>
</template>
</AiCard>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i">
<template #custom>
<div class="names">
<span>事主姓名</span>
<span class="right">{{ item.name }}</span>
</div>
<div class="phones">
<span>联系方式</span>
<span class="right">{{ item.phone }}</span>
</div>
<div class="times">
<span>上报时间</span>
<span class="right" v-if="item.createTime">{{ item.createTime.substring(0, item.createTime.length - 3) }}</span>
</div>
<div class="areaNames">
<span>上报地点</span>
<span class="right">{{ item.address }}</span>
</div>
2021-12-24 17:57:58 +08:00
<div class="contents">
<span>上报内容</span>
<span class="right">{{ item.content }}</span>
</div>
<div class="imgs">
2021-12-24 19:56:03 +08:00
<img :src="e.url" alt="" v-for="(e, i) in item.files" :key="i" @click.stop="previewImage(item.files, e.url)" />
2021-12-24 17:57:58 +08:00
</div>
2021-12-20 16:12:47 +08:00
<span class="types" :style="{ background: item.type == 0 ? '#FF65B8' : item.type == 1 ? '#FF883C' : '#1AAAFF' }">
{{ $dict.getLabel('marriageType', item.type) }}
</span>
2021-12-24 17:57:58 +08:00
<span class="types" :style="{ background: item.modeType == 0 ? '#42D784' : '#1AAAFF' }" style="margin-left: 16px">
{{ $dict.getLabel('modeType', item.modeType) }}
</span>
2021-12-20 16:12:47 +08:00
</template>
<template #menu>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'FuneralList',
components: {},
props: {},
data() {
return {
data: [],
datas: [],
current: 1,
deletShow: false,
deletId: '',
current: 1,
2021-12-20 16:46:33 +08:00
total: '',
2021-12-20 18:19:30 +08:00
allNums: '',
addNums: '',
2021-12-20 16:12:47 +08:00
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load('marriageType', 'modeType').then(() => {
this.getCount()
this.getList()
})
},
2021-12-24 15:27:36 +08:00
onShow() {
2021-12-24 17:57:58 +08:00
document.title = '婚丧嫁娶'
2021-12-24 15:27:36 +08:00
},
2021-12-20 16:12:47 +08:00
methods: {
getCount() {
uni.showLoading({
title: '加载数据中',
})
this.$http.post('/app/appmarriagefuneralinfo/queryDataStatistics').then((res) => {
if (res.code == 0) {
this.data = res.data
2021-12-20 18:19:30 +08:00
this.allNums = res.data[3].v1
this.addNums = res.data[7].v1
2021-12-20 16:12:47 +08:00
uni.hideLoading()
}
})
},
getList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appmarriagefuneralinfo/list', null, {
params: {
size: 6,
current: this.current,
type: 1,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
2021-12-20 16:46:33 +08:00
this.total = res.data.total
2021-12-20 16:12:47 +08:00
uni.hideLoading()
}
})
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
2021-12-20 18:19:30 +08:00
this.$http.post(`//app/appmarriagefuneralinfo/delete?ids=${this.deletId}`).then((res) => {
2021-12-20 16:12:47 +08:00
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
2021-12-24 19:56:03 +08:00
previewImage(images, img) {
uni.previewImage({
urls: images.map((v) => v.url),
current: img,
})
},
2021-12-20 16:12:47 +08:00
},
2021-12-20 16:46:33 +08:00
onReachBottom() {
this.current = this.current + 1
this.getList()
},
2021-12-20 16:12:47 +08:00
}
</script>
<style scoped lang="scss">
.FuneralList {
height: 100%;
.top {
.AiCard {
background: #f3f6f9;
::v-deep .start {
background: #fff;
.fill {
display: flex;
align-items: center;
padding: 38px 0;
.left,
.right {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
.nums {
font-size: 64px;
font-weight: bold;
color: #3192f4;
}
.hint {
font-size: 28px;
font-weight: 500;
}
}
}
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
display: flex;
align-items: center;
background: #fff;
padding: 32px 32px 36px 32px;
border-radius: 16px;
.names,
.phones,
.times,
2021-12-24 17:57:58 +08:00
.areaNames,
.contents {
2021-12-20 16:12:47 +08:00
display: flex;
2021-12-24 17:57:58 +08:00
margin-top: 8px;
2021-12-20 16:12:47 +08:00
.right {
width: 76%;
margin-left: 32px;
font-size: 26px;
color: #333333;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
2021-12-24 17:57:58 +08:00
.contents {
.right {
-webkit-line-clamp: 3;
}
}
.imgs {
margin-top: 8px;
img {
width: 32%;
height: 204px;
margin-right: 8px;
}
img:nth-child(3n) {
margin-right: 0;
}
}
2021-12-20 16:12:47 +08:00
.types {
display: inline-block;
margin-top: 32px;
border-radius: 8px;
padding: 4px 8px;
color: #fff;
}
}
.mask {
.moreMenu {
transform: translate(-175px, 20px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
}
</style>