BUG 26212

This commit is contained in:
aixianling
2021-12-31 14:13:00 +08:00
parent c1e3fbd7b5
commit 6392826608

View File

@@ -2,26 +2,31 @@
<div class="AppWalkask"> <div class="AppWalkask">
<template v-if="isList"> <template v-if="isList">
<div class="header-top"> <div class="header-top">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs> <u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6"
inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
</div> </div>
<div class="header-middle"> <div class="header-middle">
<div class="currentLeft"> <div class="currentLeft">
<div class="currentLeft-top"> <div class="currentLeft-top">
<div class="left"> <div class="left">
<AiAreaPicker v-model="areaId" all :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #fff"> <AiAreaPicker v-model="areaId" all :areaId="user.areaId" @select="areaSelect" :name.sync="areaName"
<img :src="$cdn + 'location.svg'" alt="" style="width: 18px; height: 18px; margin-right: 4px; vertical-align: middle" /> style="color: #fff">
<img :src="$cdn + 'location.svg'" alt=""
style="width: 18px; height: 18px; margin-right: 4px; vertical-align: middle"/>
<span class="label" v-if="areaName">{{ areaName }}</span> <span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span> <span v-else>请选择</span>
<u-icon name="arrow-down" color="#fff" size="28" style="margin-left: 4px" /> <u-icon name="arrow-down" color="#fff" size="28" style="margin-left: 4px"/>
</AiAreaPicker> </AiAreaPicker>
</div> </div>
<u-search v-model="keyword" :clearabled="true" placeholder="请输入标题" :show-action="false" bg-color="#1F5CAF" search-icon-color="#E2E8F1" color="#E2E8F1" height="58" @search="handerSearch" @clear="handerClear"></u-search> <u-search v-model="keyword" :clearabled="true" placeholder="请输入标题" :show-action="false" bg-color="#1F5CAF"
search-icon-color="#E2E8F1" color="#E2E8F1" height="58" @search="handerSearch"
@clear="handerClear"></u-search>
</div> </div>
<template v-if="data.length > 0"> <template v-if="data.length > 0">
<AiCard v-for="(item, i) in data" :key="i" @click.native="goDetail(item, 1)"> <AiCard v-for="(item, i) in data" :key="i" @click.native="goDetail(item, 1)" :ref="item.id">
<template #custom> <template #custom>
<div class="cards-left"> <div class="cards-left">
<span class="walkName">走访对象{{ item.name }}</span> <span class="walkName">走访对象{{ item.name }}</span>
@@ -32,7 +37,8 @@
<div class="cards-hint">{{ item.title }}</div> <div class="cards-hint">{{ item.title }}</div>
<div class="imgs"> <div class="imgs">
<img :src="items.url" alt="" v-for="(items, i) in item.images" :key="i" @click.stop="previewImage(item.images, items.url)" v-if="i < 3" /> <img :src="items.url" alt="" v-for="(items, i) in item.images" :key="i"
@click.stop="previewImage(item.images, items.url)" v-if="i < 3"/>
</div> </div>
<div class="cards-bottom"> <div class="cards-bottom">
@@ -60,15 +66,16 @@
</div> </div>
</div> </div>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal> <u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true"
:show-title="false" @confirm="delet"></u-modal>
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()" /> <div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()"/>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: 'AppWalkask', name: 'AppWalkask',
@@ -118,37 +125,38 @@ export default {
onShow() { onShow() {
document.title = '走访慰问' document.title = '走访慰问'
}, },
mounted() {}, mounted() {
},
methods: { methods: {
getList() { getList() {
this.$http this.$http
.post('/app/appvisitvondolence/list', null, { .post('/app/appvisitvondolence/list', null, {
params: { params: {
size: this.size, size: this.size,
current: this.current, current: this.current,
areaId: this.areaId, areaId: this.areaId,
createUserId: this.currentTabs == 1 ? this.user.id : '', createUserId: this.currentTabs == 1 ? this.user.id : '',
title: this.keyword, title: this.keyword,
}, },
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (this.current > res.data.pages) { if (this.current > res.data.pages) {
return return
}
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
this.pages = res.data.pages
if (this.data) {
this.data.map((item) => {
if (item.images) {
item.images = JSON.parse(item.images || '[]')
}
return item
})
}
} }
}) this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
this.pages = res.data.pages
if (this.data) {
this.data.map((item) => {
if (item.images) {
item.images = JSON.parse(item.images || '[]')
}
return item
})
}
}
})
}, },
areaSelect(e) { areaSelect(e) {
@@ -164,24 +172,29 @@ export default {
}, },
goDetail(item, hint) { goDetail(item, hint) {
console.log('详情',hint) if (item?.id) {
this.$refs?.[item.id]?.[0]?.handleClose()
}
if (hint == 1) { if (hint == 1) {
uni.navigateTo({ url: `./detail?id=${item.id}` }) uni.navigateTo({url: `./detail?id=${item.id}`})
} }
}, },
toAdd(item, hint) { toAdd(item, hint) {
console.log('编辑',hint) if (item?.id) {
this.$refs?.[item.id]?.[0]?.handleClose()
}
if (hint == 2) { if (hint == 2) {
uni.navigateTo({ url: `./add?id=${item.id}` }) uni.navigateTo({url: `./add?id=${item.id}`})
} else { } else {
uni.navigateTo({ url: `./add` }) uni.navigateTo({url: `./add`})
} }
}, },
toDetele(item) { toDetele(item) {
this.deletShow = true this.deletShow = true
this.deletId = item.id this.deletId = item.id
this.$refs?.[item.id]?.[0]?.handleClose()
}, },
delet() { delet() {
@@ -224,6 +237,7 @@ uni-page-body {
height: 100%; height: 100%;
background: #fff; background: #fff;
} }
.AppWalkask { .AppWalkask {
height: 100%; height: 100%;