123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <template>
- <view class="mb-5">
- <view class="" v-if="userData.id">
- <view class="header p-3">
- <view class="centerY">
- <span class="d-inline-block fs-18 text-white font-bold">个人档案</span>
- <span v-if="ipArr.find((item)=>item.ip==prodIp)&&ipArr.find((item)=>item.ip==prodIp).name!=='兰溪'"
- class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="closet">[ 退出 ]</span>
- <span v-if="ipArr.find((item)=>item.ip==prodIp)&&ipArr.find((item)=>item.ip==prodIp).name=='兰溪'"
- class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="operation">[ 切换 ]</span>
- </view>
- <view class="centerY mt-2" @click="$mf.clickNavto('/pages/userinfo/userinfo')">
- <view class="w-15 userhead">
- <view class="picbox">
- <image v-if="userData.sex==1" src="@/static/img/defult/head1.png" mode="widthFix"
- class="picimg"></image>
- <image v-if="userData.sex==2" src="@/static/img/defult/head2.png" mode="widthFix"
- class="picimg"></image>
- </view>
- </view>
- <view class="w-85 ml-3">
- <view class="text-white fs-16 font-bold">
- {{userData.username||''}}
- </view>
- <view class="centerY" style="margin-top:10rpx;">
- <view
- :class="{'iconfont text-white fs-16 font-bold':true,' nv':userData.sex==2,'nanxing':userData.sex==1,} ">
- </view>
- <view class="py-1 pl-2 text-center centerY text-gry80 bg-white ml-auto"
- style="border-radius: 6rpx;">
- <view class="">
- 基础资料
- </view>
- <view class="iconfont youla2 fs-12 font-bold">
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="content p-3 bg-white mx-3 my-3 box-border08">
- <view class="" style="display:flex;flex-wrap: wrap !important;">
- <view class="w-100 border-box">
- <view class=""
- style="background: linear-gradient(180deg, rgb(151,220,249) 0%, rgb(110,197,246) 100%);border-radius: 16rpx;">
- <view class="px-3 pt-2 pb-3 ">
- <view class="centerY ">
- <view class="bule_line"></view>
- <text class="fs-18 ml-2 font-bold" style="color: #1C90D7;">
- 个人体征
- </text>
- </view>
- <view class="mt-2" style="color: #000;">
- <view class="font-bold" style="display:flex;flex-wrap: wrap !important;">
- <view class="w-50 border-box pr-1">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- 身高<span class="ml-auto ml-1">{{physical.height}} cm</span>
- </view>
- </view>
- <view class="w-50 border-box pl-1">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- 体重<span class="ml-auto ml-1">{{physical.waist}} kg</span>
- </view>
- </view>
- <view class="w-50 border-box pr-1 mt-2">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- BMI
- <span class="ml-auto ml-1">{{physical.bmi}} kg/m^2</span>
- </view>
- </view>
- <view class="w-50 border-box pl-1 mt-2">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- 血压<span class="ml-auto ml-1">{{physical.diastole}}/{{physical.shrink}}
- mmHg</span>
- </view>
- </view>
- <view class="w-50 border-box pr-1 mt-2">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- 心率<span class="ml-auto ml-1">{{physical.pulse}} bmp</span>
- </view>
- </view>
- <view class="w-50 border-box pl-1 mt-2">
- <view class=" d-flex px-2 py-1"
- style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
- 腰围<span class="ml-auto ml-1">{{physical.weight}} cm</span>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="w-50 pr-2 border-box mt-3">
- <image @click="$mf.clickNavto('/pages/medication/medication')" src="@/static/img/index/dqyy.png"
- mode="widthFix" class="w-100"></image>
- </view>
- <view class="w-50 pl-2 border-box mt-3">
- <image @click="$mf.clickNavto('/pages/health_report/health_report')"
- src="@/static/img/index/jkbg.png" mode="widthFix" class="w-100"></image>
- </view>
- </view>
- <view class="mt-2">
- <image @click="$mf.clickNavto('/pages/eye_ground/eye_ground')" src="@/static/img/index/ydjc.png"
- mode="widthFix" class="w-100"></image>
- </view>
- <view class="mt-2">
- <image @click="$mf.clickNavto('/pages/home_monitoring/home_monitoring')"
- src="@/static/img/index/jjjc.png" mode="widthFix" class="w-100"></image>
- </view>
- </view>
- </view>
- <view class="">
- <uni-popup ref="popup1" type="center" :mask-click="false" class="w-100">
- <view class="bg-white p-3 w-100" style="border-radius: 16rpx;">
- <view class="text-center mb-3 fs-14 font-bold py-2">
- 查询
- </view>
- <view class=" centerY mb-3 w-100 border-box" style="overflow: hidden; ">
- <input type="text" v-model="valueId" class="px-2 py-2 fs-12 w-70"
- style="border: 2px solid #007aff;border-top-left-radius: 2rpx;border-bottom-left-radius: 2rpx;"
- placeholder="请输入身份证号码" placeholder-class="fs-12" />
- <uni-button type="primary" class="my-button fs-12 px-2 ml-auto border-box w-30"
- style="padding: 0x ;border: 1px solid #007aff;border-top-right-radius: 12rpx;border-bottom-right-radius: 12rpx;"
- @click="search">搜索
- </uni-button>
- </view>
- </view>
- </uni-popup>
- <uni-popup ref="popup2" type="center" :mask-click="false" class="w-100">
- <view class="bg-white p-3 w-80 text-center" style="border-radius: 16rpx;min-width: 400rpx;">
- <view class="text-center mb-3 fs-14 font-bold py-2">
- 患者列表
- </view>
- <view class="text-left centerY mb-3" style="border-radius: 14rpx;border: 2px solid #007aff;">
- <uni-data-select v-model="userIndex" :localdata="userArr" @change="bindPickerChange"
- placeholder="请选择身份">
- </uni-data-select>
- </view>
- </view>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- const ipArr = [{
- name: '开发',
- ip: 'http://192.168.1.103:10066'
- },
- {
- name: '测试',
- ip: 'http://testapi.xklr.net:8601'
- },
- {
- name: '正式',
- ip: 'http://apiv3.xklr.net'
- },
- {
- name: '兰溪',
- ip: 'http://10.50.13.200:10066'
- }
- ]
- let globalData = getApp().globalData
- export default {
- data() {
- return {
- userData: {},
- physical: {},
- valueId: '',
- prodIp: '',
- ipArr,
- userArr: [],
- userIndex: null,
- }
- },
- onLoad() {
- this.decrypt()
- },
- methods: {
- //切换
- operation() {
- uni.clearStorage('idCard')
- uni.clearStorage('userData')
- this.valueId = '';
- this.userData = {};
- this.physical = {};
- this.$refs.popup2.open()
- },
- bindPickerChange(e) {
- if (this.userArr[e] && this.userArr[e].text) {
- this.getuserinfo(this.userArr[e].text)
- }
- },
- decrypt() {
- uni.showLoading({
- title: '加载中'
- })
- let t = this;
- uni.getStorage({
- key: 'token',
- success(res) {
- console.log(res)
- if (res.data !== '') {
- ipArr.map((item) => {
- console.log(globalData.configData.prodIp)
- let timer = setInterval(async () => {
- if (globalData.configData.prodIp) {
- t.prodIp = globalData.configData.prodIp
- clearInterval(timer)
- }
- if (item.ip == globalData.configData.prodIp) {
- //兰溪
- if (item.name == '兰溪') {
- if (!res.data.length > 10) return
- console.log(res)
- let res2 = await t.$api.decrypt({
- toKen: res.data
- });
- if (res2.code !== -1) {
- if (res2.data.users && res2.data.users.length >
- 0) {
- t.$refs.popup2.open()
- t.userArr = []
- res2.data.users.map((item, index) => {
- t.userArr.push({
- value: index,
- text: item.idcard
- })
- })
- console.log(t.userArr)
- uni.hideLoading()
- }
- } else {
- console.log(1)
- if (!uni.getStorageSync('idCard')) {
- t.$refs.popup1.open()
- uni.hideLoading()
- } else {
- t.getuserinfo(uni.getStorageSync('idCard'))
- }
- }
- }
- } else {
- if (!uni.getStorageSync('idCard')) {
- t.$refs.popup1.open()
- uni.hideLoading()
- } else {
- t.getuserinfo(uni.getStorageSync('idCard'))
- }
- }
- }, 300)
- })
- } else {
- let timer = setInterval(async () => {
- if (globalData.configData.prodIp) {
- t.prodIp = globalData.configData.prodIp
- clearInterval(timer)
- }
- let i = ipArr.find((item) => item.ip == globalData.configData.prodIp)
- .name == '兰溪'
- if (!i) {
- if (!uni.getStorageSync('idCard')) {
- t.$refs.popup1.open()
- uni.hideLoading()
- } else {
- t.getuserinfo(uni.getStorageSync('idCard'))
- }
- }
- }, 300)
- }
- },
- fail(res) {
- console.log(res)
- let timer = setInterval(async () => {
- if (globalData.configData.prodIp) {
- t.prodIp = globalData.configData.prodIp
- clearInterval(timer)
- }
- let i = ipArr.find((item) => item.ip == globalData.configData.prodIp)
- .name == '兰溪'
- if (!i) {
- if (!uni.getStorageSync('idCard')) {
- t.$refs.popup1.open()
- uni.hideLoading()
- } else {
- t.getuserinfo(uni.getStorageSync('idCard'))
- }
- }
- }, 300)
- }
- })
- },
- closet() {
- uni.clearStorage('idCard')
- uni.clearStorage('userData')
- this.valueId = '';
- this.userData = {};
- this.physical = {};
- this.$refs.popup1.open()
- },
- search() {
- this.getuserinfo(this.valueId)
- this.valueId = '';
- this.userData = {};
- this.physical = {};
- },
- async find_physical() {
- uni.showLoading({
- title: '加载中'
- });
- let idCard = uni.getStorageSync('idCard')
- let {
- data,
- code
- } = await this.$api.find_physical({
- idCard
- })
- if (code == 0) {
- this.physical = data || {}
- uni.hideLoading();
- } else {
- uni.hideLoading();
- }
- uni.stopPullDownRefresh()
- },
- async getuserinfo(idCard) { //330222194512283184
- uni.showLoading({
- title: '加载中'
- });
- let {
- data,
- code
- } = await this.$api.getUserInfo({
- idCard
- })
- if (code == 0) {
- uni.setStorageSync('userData', data || {});
- uni.setStorageSync('idCard', data && data.idCard || '')
- this.userData = data || {}
- if (data && data.id) {
- this.$refs.popup1.close();
- this.find_physical()
- this.$refs.popup2.close();
- } else {
- uni.showToast({
- title: '未查询到患者',
- icon: 'error'
- })
- }
- uni.hideLoading();
- } else {
- uni.hideLoading();
- uni.stopPullDownRefresh()
- }
- }
- },
- onPullDownRefresh() {
- this.getuserinfo()
- }
- }
- </script>
- <style lang="scss">
- page {
- background: #F5F9FF;
- }
- .header {
- background: linear-gradient(180deg, #096DCB 0%, #6faae1 100%)
- }
- .userhead {
- border-radius: 50%;
- box-shadow: 1px 1px 10px 1px #096DCB;
- }
- .text-gry80 {
- color: #808080;
- }
- .box-border08 {
- border-radius: 16rpx;
- }
- </style>
|