Commit 133b0ee5 authored by gengchunlei's avatar gengchunlei

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

            2、展开全部与折叠面板手风琴组件逻辑实现
            3、 未存在慢病档案时不触发列表查询
parent 1528efa0
......@@ -13,7 +13,7 @@
<script>
import { getDict, getResidentByInfo } from '@/api/base.js'
import { useStore } from './store/index.js'
import { getQueryVariable, showNav } from '@/utils/common'
import { getQueryVariable, isResidentInfo, showNav } from '@/utils/common'
import { showNotify } from 'vant'
export default {
......@@ -55,12 +55,12 @@ export default {
},
provide() {
return {
showNav: showNav
showNav: showNav,
isResidentInfo: isResidentInfo,
}
},
methods: {
async init() {
console.log(this.visible)
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
let idCard = getQueryVariable('idCard')
......@@ -70,12 +70,12 @@ export default {
}
if (idCard) {
const user = await getResidentByInfo({ idCard: idCard })
if (!user.data) {
showNotify({ type: 'warning', message: '未获取到慢病信息', duration: 0 })
return
}
// if (!user.data) {
// showNotify({ type: 'warning', message: '未获取到慢病信息', duration: 0 })
// return
// }
this.store.$patch({ userInfo: user.data || {} })
window.sessionStorage.setItem('userInfo', JSON.stringify(user.data))
window.sessionStorage.setItem('userInfo', JSON.stringify(user.data || {}))
} else {
let user = JSON.parse(window.sessionStorage.getItem('userInfo'))
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'
import { useStore } from '@/residentWX/store'
export default {
inject: ['showNav'],
inject: ['showNav', 'isResidentInfo'],
data() {
return {
store: useStore(),
......@@ -83,7 +83,6 @@ export default {
},
created() {
document.title = '健康指导'
this.init()
},
mounted() {
const list = this.$refs.list
......@@ -96,10 +95,8 @@ export default {
})
},
methods: {
init() {
this.load()
},
load(loading = true) {
if (!this.isResidentInfo()) return
const query = {
residentInfoId: this.userInfo.residentInfoId,
pageIndex: this.pagination.pageIndex,
......
......@@ -40,7 +40,7 @@ import { getServiceDoc } from '@/api/residentWX/nim.js'
import { showFailToast } from 'vant'
export default {
inject:['showNav'],
inject:['showNav', 'isResidentInfo'],
data() {
return {
store: useStore(),
......@@ -64,7 +64,9 @@ export default {
},
created() {
document.title = '专家在线咨询'
this.init()
if (this.isResidentInfo()) {
this.init()
}
},
methods: {
init() {
......
......@@ -57,7 +57,7 @@ import { useStore } from '@/residentWX/store'
import { queryScreenList } from '@/api/residentWX/screening.js'
export default {
inject:['showNav'],
inject:['showNav', 'isResidentInfo'],
data() {
return {
store: useStore(),
......@@ -91,7 +91,6 @@ export default {
},
created() {
document.title = '慢病筛查记录'
this.init()
},
mounted() {
const list = this.$refs.list
......@@ -104,10 +103,8 @@ export default {
})
},
methods: {
init() {
this.load()
},
load(loading = true) {
if (!this.isResidentInfo()) return
const query = {
screeningType: this.activeTab,
residentInfoId: this.userInfo.residentInfoId,
......
......@@ -33,7 +33,7 @@
</span>
</div>
<van-collapse v-model="activeCollapse" ref="collapse" class="doc-collapse"
<van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse"
@change="collapseChange">
<van-collapse-item v-for="collapse in collapseList" :key="collapse.name"
:title="collapse.title" :name="collapse.name">
......@@ -180,12 +180,16 @@ export default {
// 折叠面板切换
collapseChange(val) {
// console.log(val, this.activeCollapse)
// if (val && val.length) {
// this.activeCollapse = val.slice(val.length - 1)
// } else {
// this.activeCollapse = []
// }
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) {
this.collapseAll = true
} else {
......
......@@ -46,7 +46,7 @@
</span>
</div>
<van-collapse v-model='activeCollapse' ref='collapse' class='doc-collapse'
<van-collapse :model-value='activeCollapse' ref='collapse' class='doc-collapse'
@change='collapseChange'>
<van-collapse-item key='1' title='居民信息' name='1'>
<template #right-icon>
......@@ -799,6 +799,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -69,7 +69,7 @@ import { useStore } from '@/residentWX/store'
import { queryVisitList } from '@/api/residentWX/visit'
export default {
inject: ['showNav'],
inject: ['showNav', 'isResidentInfo'],
data() {
return {
store: useStore(),
......@@ -123,6 +123,7 @@ export default {
},
methods: {
load(loading = true) {
if (!this.isResidentInfo()) return
const query = {
residentInfoId: this.baseInfo.residentInfoId,
diseaseType: this.activeTab,
......
......@@ -9,9 +9,7 @@
</div>
<div class='px-4 py-3 flex shrink-0 base-info'>
<div class='flex w-full'>
<img src='@/assets/image/residentWX/avatar.png' alt='' class='shrink-0'
style='width: .56rem;height: .56rem'>
<div class='grow flex flex-col justify-between pl-3'>
<div class='grow flex flex-col justify-between'>
<div class='flex justify-between'>
<span class='name'>{{ residentInfo.residentName }}</span>
</div>
......@@ -27,8 +25,8 @@
</div>
<div class='p-3 grow cont-box'>
<div class='p-3 h-full cont-inner'>
<div class='flex justify-between collapse-head'>
<span class='text-16'>全部内容</span>
<div class='flex justify-between collapse-head mt-2'>
<span class='text-16 font-semibold'>全部内容</span>
<span @click='toggleAll'>
<span v-if='!collapseAll'>展开全部</span>
<span v-else>收起全部</span>
......@@ -37,8 +35,7 @@
</span>
</span>
</div>
<van-collapse v-model='activeCollapse' ref='collapse' class='doc-collapse'
<van-collapse :model-value="activeCollapse" ref='collapse' class='doc-collapse'
@change='collapseChange'>
<van-collapse-item key='1' title='居民信息' name='1'>
<template #right-icon>
......@@ -195,24 +192,30 @@
</div>
</div>
</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>
<doc-icon type='doc-down' />
</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" >
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div>
</div>-->
<div>
<image-preview :img-list='info.uploadVisitRecordImageList'></image-preview>
</div>
</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>
<doc-icon type='doc-down' />
</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" >
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div>
</div>-->
<div>
<image-preview :img-list='info.sceneVisitImageList'></image-preview>
</div>
</van-collapse-item>
<van-collapse-item key='13' title='随访机构' name='13'>
......@@ -241,10 +244,11 @@ import { showToast } from 'vant'
import { queryGeneralFUDetail } from '@/api/residentWX/visit'
import Mp3 from '@/residentWX/components/mediaPlay/Mp3.vue'
import Mp4 from '@/residentWX/components/mediaPlay/Mp4'
import ImagePreview from '@/residentWX/components/imagePreview/imagePreview'
export default {
name: 'CurrencyFUDetail.vue',
components: { Mp4, Mp3 },
components: { ImagePreview, Mp4, Mp3 },
inject: ['showNav'],
data() {
return {
......@@ -289,7 +293,7 @@ export default {
{ title: '随访单位', key: 'visitUnitName' },
{ title: '随访科室', key: 'visitOfficeName' },
{ title: '随访医生', key: 'visitDoctorName' }
]
],
}
},
computed: {
......@@ -397,6 +401,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -442,6 +442,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -442,6 +442,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -441,6 +441,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -447,6 +447,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -442,6 +442,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -12,7 +12,7 @@
</span>
</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">
<template #right-icon>
<doc-icon type="doc-down" />
......@@ -502,6 +502,16 @@ export default {
},
// 折叠面板切换
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) {
this.collapseAll = true
} else {
......
......@@ -274,4 +274,16 @@ export function showNav() {
res = true
}
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({
}
},
'/chronic-resident': {
target: 'http://192.168.1.200:8903',
// target: 'https://beta-tumour.zmnyjk.com',
// target: 'http://192.168.1.200:8903',
target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true,
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