Commit e5024e9b authored by gengchunlei's avatar gengchunlei

居民端小程序 1.小程序对接

parent f7a1bb7c
<template>
<van-config-provider :theme-vars="themeVars">
<div class="h-full resident-home">
<router-view v-slot="{ Component }">
<Transition name="route" mode="out-in">
<component :is="Component" v-if="visible"/>
<van-config-provider :theme-vars='themeVars'>
<div class='h-full resident-home'>
<router-view v-slot='{ Component }'>
<Transition name='route' mode='out-in'>
<component :is='Component' v-if='visible' />
</Transition>
</router-view>
</div>
......@@ -13,6 +13,8 @@
<script>
import { getDict, getResidentByInfo } from '@/api/base.js'
import { useStore } from './store/index.js'
import { getQueryVariable } from '@/utils/common'
import { showNotify } from 'vant'
export default {
data() {
......@@ -40,7 +42,7 @@ export default {
fieldLabelColor: '#262626',
cellBorderColor: '#d9d9d9',
// 进度条
sliderActiveBackground: '#54CCBD',
sliderActiveBackground: '#54CCBD'
}
}
},
......@@ -56,15 +58,25 @@ export default {
console.log(this.visible)
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
const user = await getResidentByInfo({idCard: '21100319900901301X'})
let idCard = getQueryVariable('idCard')
if (idCard) {
const user = await getResidentByInfo({ idCard: idCard })
if (!user.data) {
showNotify({ type: 'warning', message: '未获取慢病信息', duration: 0 })
return
}
this.store.$patch({ userInfo: user.data || {} })
window.sessionStorage.setItem('userInfo', JSON.stringify(user.data))
} else {
let user = JSON.parse(window.sessionStorage.getItem('userInfo'))
this.store.$patch({ userInfo: user.data || {} })
}
this.visible = true
},
}
}
}
</script>
<style lang="less" scoped>
<style lang='less' scoped>
</style>
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