Commit 133b0ee5 authored by gengchunlei's avatar gengchunlei

居民端小程序 1、图片查看组件

            2、展开全部与折叠面板手风琴组件逻辑实现
            3、 未存在慢病档案时不触发列表查询
parent 1528efa0
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script> <script>
import { getDict, getResidentByInfo } from '@/api/base.js' import { getDict, getResidentByInfo } from '@/api/base.js'
import { useStore } from './store/index.js' import { useStore } from './store/index.js'
import { getQueryVariable, showNav } from '@/utils/common' import { getQueryVariable, isResidentInfo, showNav } from '@/utils/common'
import { showNotify } from 'vant' import { showNotify } from 'vant'
export default { export default {
...@@ -55,12 +55,12 @@ export default { ...@@ -55,12 +55,12 @@ export default {
}, },
provide() { provide() {
return { return {
showNav: showNav showNav: showNav,
isResidentInfo: isResidentInfo,
} }
}, },
methods: { methods: {
async init() { async init() {
console.log(this.visible)
const res = await getDict() const res = await getDict()
this.store.$patch({ dict: res.data || {} }) this.store.$patch({ dict: res.data || {} })
let idCard = getQueryVariable('idCard') let idCard = getQueryVariable('idCard')
...@@ -70,12 +70,12 @@ export default { ...@@ -70,12 +70,12 @@ export default {
} }
if (idCard) { if (idCard) {
const user = await getResidentByInfo({ idCard: idCard }) const user = await getResidentByInfo({ idCard: idCard })
if (!user.data) { // if (!user.data) {
showNotify({ type: 'warning', message: '未获取到慢病信息', duration: 0 }) // showNotify({ type: 'warning', message: '未获取到慢病信息', duration: 0 })
return // return
} // }
this.store.$patch({ userInfo: user.data || {} }) this.store.$patch({ userInfo: user.data || {} })
window.sessionStorage.setItem('userInfo', JSON.stringify(user.data)) window.sessionStorage.setItem('userInfo', JSON.stringify(user.data || {}))
} else { } else {
let user = JSON.parse(window.sessionStorage.getItem('userInfo')) let user = JSON.parse(window.sessionStorage.getItem('userInfo'))
this.store.$patch({ userInfo: user || {} }) this.store.$patch({ userInfo: user || {} })
......
<template>
<div>
<div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'>
<div v-for="(url, index) in imgList" :key="index" @click='toPreview(index)'>
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div>
</div>
<van-overlay :show='imgShow' @click='imgShow = false'>
<div class='wrapper'>
<van-swipe class='block' :initial-swipe='initSwipe'>
<van-swipe-item v-for='image in imgList' :key='image'>
<img :src='image.trueDownloadUrl' style='width: 100%;height: 100%'/>
</van-swipe-item>
</van-swipe>
</div>
</van-overlay>
</div>
</template>
<script>
export default {
name: 'imagePreview',
props: {
imgList: Array,
},
data() {
return {
imgShow: false,
initSwipe: 0
}
},
methods: {
//图片预览
toPreview(index) {
this.initSwipe = index
this.imgShow = true
},
}
}
</script>
<style scoped lang='less'>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.block {
width: 100%;
}
}
</style>
\ No newline at end of file
...@@ -54,7 +54,7 @@ import { queryGuideList } from '@/api/residentWX/guide.js' ...@@ -54,7 +54,7 @@ import { queryGuideList } from '@/api/residentWX/guide.js'
import { useStore } from '@/residentWX/store' import { useStore } from '@/residentWX/store'
export default { export default {
inject: ['showNav'], inject: ['showNav', 'isResidentInfo'],
data() { data() {
return { return {
store: useStore(), store: useStore(),
...@@ -83,7 +83,6 @@ export default { ...@@ -83,7 +83,6 @@ export default {
}, },
created() { created() {
document.title = '健康指导' document.title = '健康指导'
this.init()
}, },
mounted() { mounted() {
const list = this.$refs.list const list = this.$refs.list
...@@ -96,10 +95,8 @@ export default { ...@@ -96,10 +95,8 @@ export default {
}) })
}, },
methods: { methods: {
init() {
this.load()
},
load(loading = true) { load(loading = true) {
if (!this.isResidentInfo()) return
const query = { const query = {
residentInfoId: this.userInfo.residentInfoId, residentInfoId: this.userInfo.residentInfoId,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
......
...@@ -40,7 +40,7 @@ import { getServiceDoc } from '@/api/residentWX/nim.js' ...@@ -40,7 +40,7 @@ import { getServiceDoc } from '@/api/residentWX/nim.js'
import { showFailToast } from 'vant' import { showFailToast } from 'vant'
export default { export default {
inject:['showNav'], inject:['showNav', 'isResidentInfo'],
data() { data() {
return { return {
store: useStore(), store: useStore(),
...@@ -64,7 +64,9 @@ export default { ...@@ -64,7 +64,9 @@ export default {
}, },
created() { created() {
document.title = '专家在线咨询' document.title = '专家在线咨询'
this.init() if (this.isResidentInfo()) {
this.init()
}
}, },
methods: { methods: {
init() { init() {
......
...@@ -57,7 +57,7 @@ import { useStore } from '@/residentWX/store' ...@@ -57,7 +57,7 @@ import { useStore } from '@/residentWX/store'
import { queryScreenList } from '@/api/residentWX/screening.js' import { queryScreenList } from '@/api/residentWX/screening.js'
export default { export default {
inject:['showNav'], inject:['showNav', 'isResidentInfo'],
data() { data() {
return { return {
store: useStore(), store: useStore(),
...@@ -91,7 +91,6 @@ export default { ...@@ -91,7 +91,6 @@ export default {
}, },
created() { created() {
document.title = '慢病筛查记录' document.title = '慢病筛查记录'
this.init()
}, },
mounted() { mounted() {
const list = this.$refs.list const list = this.$refs.list
...@@ -104,10 +103,8 @@ export default { ...@@ -104,10 +103,8 @@ export default {
}) })
}, },
methods: { methods: {
init() {
this.load()
},
load(loading = true) { load(loading = true) {
if (!this.isResidentInfo()) return
const query = { const query = {
screeningType: this.activeTab, screeningType: this.activeTab,
residentInfoId: this.userInfo.residentInfoId, residentInfoId: this.userInfo.residentInfoId,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse"
@change="collapseChange"> @change="collapseChange">
<van-collapse-item v-for="collapse in collapseList" :key="collapse.name" <van-collapse-item v-for="collapse in collapseList" :key="collapse.name"
:title="collapse.title" :name="collapse.name"> :title="collapse.title" :name="collapse.name">
...@@ -180,12 +180,16 @@ export default { ...@@ -180,12 +180,16 @@ export default {
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
// console.log(val, this.activeCollapse) // console.log(val, this.activeCollapse)
// if (val && val.length) { if (val && val.length <= 2) {
// this.activeCollapse = val.slice(val.length - 1) this.activeCollapse = val.slice(val.length - 1)
// } else { } else {
// this.activeCollapse = [] if (this.activeCollapse.length > val.length) {
// } this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val && val.length === this.collapseList.length) { if (val && val.length === this.collapseList.length) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</span> </span>
</div> </div>
<van-collapse v-model='activeCollapse' ref='collapse' class='doc-collapse' <van-collapse :model-value='activeCollapse' ref='collapse' class='doc-collapse'
@change='collapseChange'> @change='collapseChange'>
<van-collapse-item key='1' title='居民信息' name='1'> <van-collapse-item key='1' title='居民信息' name='1'>
<template #right-icon> <template #right-icon>
...@@ -799,6 +799,16 @@ export default { ...@@ -799,6 +799,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val && val.length === this.collapseList.length) { if (val && val.length === this.collapseList.length) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -69,7 +69,7 @@ import { useStore } from '@/residentWX/store' ...@@ -69,7 +69,7 @@ import { useStore } from '@/residentWX/store'
import { queryVisitList } from '@/api/residentWX/visit' import { queryVisitList } from '@/api/residentWX/visit'
export default { export default {
inject: ['showNav'], inject: ['showNav', 'isResidentInfo'],
data() { data() {
return { return {
store: useStore(), store: useStore(),
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
}, },
methods: { methods: {
load(loading = true) { load(loading = true) {
if (!this.isResidentInfo()) return
const query = { const query = {
residentInfoId: this.baseInfo.residentInfoId, residentInfoId: this.baseInfo.residentInfoId,
diseaseType: this.activeTab, diseaseType: this.activeTab,
......
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
</div> </div>
<div class='px-4 py-3 flex shrink-0 base-info'> <div class='px-4 py-3 flex shrink-0 base-info'>
<div class='flex w-full'> <div class='flex w-full'>
<img src='@/assets/image/residentWX/avatar.png' alt='' class='shrink-0' <div class='grow flex flex-col justify-between'>
style='width: .56rem;height: .56rem'>
<div class='grow flex flex-col justify-between pl-3'>
<div class='flex justify-between'> <div class='flex justify-between'>
<span class='name'>{{ residentInfo.residentName }}</span> <span class='name'>{{ residentInfo.residentName }}</span>
</div> </div>
...@@ -27,8 +25,8 @@ ...@@ -27,8 +25,8 @@
</div> </div>
<div class='p-3 grow cont-box'> <div class='p-3 grow cont-box'>
<div class='p-3 h-full cont-inner'> <div class='p-3 h-full cont-inner'>
<div class='flex justify-between collapse-head'> <div class='flex justify-between collapse-head mt-2'>
<span class='text-16'>全部内容</span> <span class='text-16 font-semibold'>全部内容</span>
<span @click='toggleAll'> <span @click='toggleAll'>
<span v-if='!collapseAll'>展开全部</span> <span v-if='!collapseAll'>展开全部</span>
<span v-else>收起全部</span> <span v-else>收起全部</span>
...@@ -37,8 +35,7 @@ ...@@ -37,8 +35,7 @@
</span> </span>
</span> </span>
</div> </div>
<van-collapse :model-value="activeCollapse" ref='collapse' class='doc-collapse'
<van-collapse v-model='activeCollapse' ref='collapse' class='doc-collapse'
@change='collapseChange'> @change='collapseChange'>
<van-collapse-item key='1' title='居民信息' name='1'> <van-collapse-item key='1' title='居民信息' name='1'>
<template #right-icon> <template #right-icon>
...@@ -195,24 +192,30 @@ ...@@ -195,24 +192,30 @@
</div> </div>
</div> </div>
</van-collapse-item> </van-collapse-item>
<van-collapse-item key='11' title='上传随访记录' name='11' v-if="showOne && info.visitSituation == 1"> <van-collapse-item key='11' title='上传随访记录' name='11' v-if="showOne">
<template #right-icon> <template #right-icon>
<doc-icon type='doc-down' /> <doc-icon type='doc-down' />
</template> </template>
<div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'> <!-- <div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'>
<div v-for="(url, index) in info.uploadVisitRecordImageList" :key="index" > <div v-for="(url, index) in info.uploadVisitRecordImageList" :key="index" >
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" /> <img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div> </div>
</div>-->
<div>
<image-preview :img-list='info.uploadVisitRecordImageList'></image-preview>
</div> </div>
</van-collapse-item> </van-collapse-item>
<van-collapse-item key='12' title='现场随访照片' name='12' v-if="showOne && info.visitSituation == 1"> <van-collapse-item key='12' title='现场随访照片' name='12' v-if="showOne">
<template #right-icon> <template #right-icon>
<doc-icon type='doc-down' /> <doc-icon type='doc-down' />
</template> </template>
<div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'> <!-- <div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'>
<div v-for="(url, index) in info.sceneVisitImageList" :key="index" > <div v-for="(url, index) in info.sceneVisitImageList" :key="index" >
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" /> <img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div> </div>
</div>-->
<div>
<image-preview :img-list='info.sceneVisitImageList'></image-preview>
</div> </div>
</van-collapse-item> </van-collapse-item>
<van-collapse-item key='13' title='随访机构' name='13'> <van-collapse-item key='13' title='随访机构' name='13'>
...@@ -241,10 +244,11 @@ import { showToast } from 'vant' ...@@ -241,10 +244,11 @@ import { showToast } from 'vant'
import { queryGeneralFUDetail } from '@/api/residentWX/visit' import { queryGeneralFUDetail } from '@/api/residentWX/visit'
import Mp3 from '@/residentWX/components/mediaPlay/Mp3.vue' import Mp3 from '@/residentWX/components/mediaPlay/Mp3.vue'
import Mp4 from '@/residentWX/components/mediaPlay/Mp4' import Mp4 from '@/residentWX/components/mediaPlay/Mp4'
import ImagePreview from '@/residentWX/components/imagePreview/imagePreview'
export default { export default {
name: 'CurrencyFUDetail.vue', name: 'CurrencyFUDetail.vue',
components: { Mp4, Mp3 }, components: { ImagePreview, Mp4, Mp3 },
inject: ['showNav'], inject: ['showNav'],
data() { data() {
return { return {
...@@ -289,7 +293,7 @@ export default { ...@@ -289,7 +293,7 @@ export default {
{ title: '随访单位', key: 'visitUnitName' }, { title: '随访单位', key: 'visitUnitName' },
{ title: '随访科室', key: 'visitOfficeName' }, { title: '随访科室', key: 'visitOfficeName' },
{ title: '随访医生', key: 'visitDoctorName' } { title: '随访医生', key: 'visitDoctorName' }
] ],
} }
}, },
computed: { computed: {
...@@ -397,6 +401,16 @@ export default { ...@@ -397,6 +401,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val && val.length === this.collapseList.length) { if (val && val.length === this.collapseList.length) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -442,6 +442,16 @@ export default { ...@@ -442,6 +442,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 14) { if (val.length === 14) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -442,6 +442,16 @@ export default { ...@@ -442,6 +442,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 14) { if (val.length === 14) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -441,6 +441,16 @@ export default { ...@@ -441,6 +441,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 14) { if (val.length === 14) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -447,6 +447,16 @@ export default { ...@@ -447,6 +447,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 14) { if (val.length === 14) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -442,6 +442,16 @@ export default { ...@@ -442,6 +442,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 14) { if (val.length === 14) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
</div> </div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange"> <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
<van-collapse-item key="1" title="居民信息" name="1"> <van-collapse-item key="1" title="居民信息" name="1">
<template #right-icon> <template #right-icon>
<doc-icon type="doc-down" /> <doc-icon type="doc-down" />
...@@ -502,6 +502,16 @@ export default { ...@@ -502,6 +502,16 @@ export default {
}, },
// 折叠面板切换 // 折叠面板切换
collapseChange(val) { collapseChange(val) {
if (val && val.length <= 2) {
this.activeCollapse = val.slice(val.length - 1)
} else {
if (this.activeCollapse.length > val.length) {
this.activeCollapse = val
}
if (this.activeCollapse.length < val.length) {
this.activeCollapse = val.slice(val.length - 1)
}
}
if (val.length === 15) { if (val.length === 15) {
this.collapseAll = true this.collapseAll = true
} else { } else {
......
...@@ -274,4 +274,16 @@ export function showNav() { ...@@ -274,4 +274,16 @@ export function showNav() {
res = true res = true
} }
return res return res
}
//用户是否存在慢病档案
export function isResidentInfo() {
let res = false
let jsonInfo =window.sessionStorage.getItem('userInfo')
if (jsonInfo == '{}') {
res = false
} else {
res = true
}
return res
} }
\ No newline at end of file
...@@ -39,11 +39,12 @@ module.exports = defineConfig({ ...@@ -39,11 +39,12 @@ module.exports = defineConfig({
} }
}, },
'/chronic-resident': { '/chronic-resident': {
target: 'http://192.168.1.200:8903', // target: 'http://192.168.1.200:8903',
// target: 'https://beta-tumour.zmnyjk.com', target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true, changOrigin: true,
pathRewrite: { pathRewrite: {
'^/chronic-resident': '/' // '^/chronic-resident': '/',
'^/chronic-resident': '/chronic-resident'
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment