index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="mb-5">
  3. <view class="" v-if="userData.id">
  4. <view class="header p-3">
  5. <view class="centerY">
  6. <span class="fs-18 text-white font-bold">个人档案</span>
  7. <span class="p-3 d-inline-block ml-auto text-white1" @click="closet">退出</span>
  8. </view>
  9. <view class="centerY mt-2" @click="$mf.clickNavto('/pages/userinfo/userinfo')">
  10. <view class="w-15 userhead">
  11. <view class="picbox">
  12. <image v-if="userData.sex==1" src="@/static/img/defult/head1.png" mode="widthFix"
  13. class="picimg"></image>
  14. <image v-if="userData.sex==2" src="@/static/img/defult/head2.png" mode="widthFix"
  15. class="picimg"></image>
  16. </view>
  17. </view>
  18. <view class="w-85 ml-3">
  19. <view class="text-white fs-16 font-bold">
  20. {{userData.username||''}}
  21. </view>
  22. <view class="centerY" style="margin-top:10rpx;">
  23. <view
  24. :class="{'iconfont text-white fs-16 font-bold':true,' nv':userData.sex==2,'nanxing':userData.sex==1,} ">
  25. </view>
  26. <view class="py-1 pl-2 text-center centerY text-gry80 bg-white ml-auto"
  27. style="border-radius: 6rpx;">
  28. <view class="">
  29. 基础资料
  30. </view>
  31. <view class="iconfont youla2 fs-12 font-bold">
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="content p-3 bg-white mx-3 my-3 box-border08">
  39. <view class="" style="display:flex;flex-wrap: wrap !important;">
  40. <view class="w-100 border-box">
  41. <view class=""
  42. style="background: linear-gradient(180deg, rgb(151,220,249) 0%, rgb(110,197,246) 100%);border-radius: 16rpx;">
  43. <view class="px-3 pt-2 pb-3 ">
  44. <view class="centerY ">
  45. <view class="bule_line"></view>
  46. <text class="fs-18 ml-2 font-bold" style="color: #1C90D7;">
  47. 个人体征
  48. </text>
  49. </view>
  50. <view class="mt-2" style="color: #000;">
  51. <view class="font-bold" style="display:flex;flex-wrap: wrap !important;">
  52. <view class="w-50 border-box pr-1">
  53. <view class=" d-flex px-2 py-1"
  54. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  55. 身高<span class="ml-auto ml-1">{{physical.height}} cm</span>
  56. </view>
  57. </view>
  58. <view class="w-50 border-box pl-1">
  59. <view class=" d-flex px-2 py-1"
  60. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  61. 体重<span class="ml-auto ml-1">{{physical.waist}} kg</span>
  62. </view>
  63. </view>
  64. <view class="w-50 border-box pr-1 mt-2">
  65. <view class=" d-flex px-2 py-1"
  66. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  67. BMI
  68. <span class="ml-auto ml-1">{{physical.bmi}} kg/m^2</span>
  69. </view>
  70. </view>
  71. <view class="w-50 border-box pl-1 mt-2">
  72. <view class=" d-flex px-2 py-1"
  73. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  74. 血压<span class="ml-auto ml-1">{{physical.diastole}}/{{physical.shrink}}
  75. mmHg</span>
  76. </view>
  77. </view>
  78. <view class="w-50 border-box pr-1 mt-2">
  79. <view class=" d-flex px-2 py-1"
  80. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  81. 心率<span class="ml-auto ml-1">{{physical.pulse}} bmp</span>
  82. </view>
  83. </view>
  84. <view class="w-50 border-box pl-1 mt-2">
  85. <view class=" d-flex px-2 py-1"
  86. style="color: #55afdf;border-radius: 10rpx;background-color: rgba(255,255,255)">
  87. 腰围<span class="ml-auto ml-1">{{physical.weight}} cm</span>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="w-50 pr-2 border-box mt-3">
  96. <image @click="$mf.clickNavto('/pages/medication/medication')" src="@/static/img/index/dqyy.png"
  97. mode="widthFix" class="w-100"></image>
  98. </view>
  99. <view class="w-50 pl-2 border-box mt-3">
  100. <image @click="$mf.clickNavto('/pages/health_report/health_report')"
  101. src="@/static/img/index/jkbg.png" mode="widthFix" class="w-100"></image>
  102. </view>
  103. </view>
  104. <view class="mt-2">
  105. <image @click="$mf.clickNavto('/pages/eye_ground/eye_ground')" src="@/static/img/index/ydjc.png"
  106. mode="widthFix" class="w-100"></image>
  107. </view>
  108. <view class="mt-2">
  109. <image @click="$mf.clickNavto('/pages/home_monitoring/home_monitoring')"
  110. src="@/static/img/index/jjjc.png" mode="widthFix" class="w-100"></image>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="">
  115. <uni-popup ref="popup1" type="center" :mask-click="false">
  116. <view class="bg-white p-3 w-100" style="border-radius: 16rpx;">
  117. <view class="text-center mb-3 fs-14 font-bold py-2">
  118. 查询
  119. </view>
  120. <view class=" centerY mb-3" style="border-radius: 14rpx;border: 1px solid #007aff;">
  121. <input type="text" v-model="valueId" class="p-1 px-2 fs-12" placeholder="请输入身份证号码"
  122. placeholder-class="fs-12">
  123. <button type="primary" class="d-inline-block fs-12 px-3 py-0 ml-auto mr-0"
  124. @click="search">搜索</button>
  125. </view>
  126. </view>
  127. </uni-popup>
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. export default {
  133. data() {
  134. return {
  135. userData: {},
  136. physical: {},
  137. valueId: '330222194512283184'
  138. }
  139. },
  140. mounted() {
  141. // console.log(this.$mf)
  142. // console.log(this.$httpApi)
  143. if (!uni.getStorageSync('idCard')) {
  144. console.log(this.$refs)
  145. this.$refs.popup1.open()
  146. } else {
  147. this.getuserinfo(uni.getStorageSync('idCard'))
  148. }
  149. },
  150. methods: {
  151. closet() {
  152. uni.clearStorage('idCard')
  153. uni.clearStorage('userData')
  154. this.valueId = '';
  155. this.userData = {};
  156. this.physical = {};
  157. this.$refs.popup1.open()
  158. },
  159. search() {
  160. this.getuserinfo(this.valueId)
  161. this.valueId = '';
  162. this.userData = {};
  163. this.physical = {};
  164. },
  165. async find_physical() {
  166. uni.showLoading({
  167. title: '加载中'
  168. });
  169. let idCard = uni.getStorageSync('idCard')
  170. let {
  171. data,
  172. code
  173. } = await this.$api.find_physical({
  174. idCard
  175. })
  176. if (code == 0) {
  177. this.physical = data || {}
  178. uni.hideLoading();
  179. } else {
  180. uni.hideLoading();
  181. }
  182. uni.stopPullDownRefresh()
  183. },
  184. async getuserinfo(idCard) { //330222194512283184
  185. uni.showLoading({
  186. title: '加载中'
  187. });
  188. let {
  189. data,
  190. code
  191. } = await this.$api.getUserInfo({
  192. idCard
  193. })
  194. if (code == 0) {
  195. uni.setStorageSync('userData', data || {});
  196. uni.setStorageSync('idCard', data && data.idCard || '')
  197. this.userData = data || {}
  198. console.log(this.userData)
  199. if (data && data.id) {
  200. this.$refs.popup1.close();
  201. this.find_physical()
  202. } else {
  203. uni.showToast({
  204. title: '未查询到患者',
  205. icon: 'error'
  206. })
  207. }
  208. uni.hideLoading();
  209. } else {
  210. uni.hideLoading();
  211. uni.stopPullDownRefresh()
  212. }
  213. }
  214. },
  215. onPullDownRefresh() {
  216. this.getuserinfo()
  217. }
  218. }
  219. </script>
  220. <style lang="scss">
  221. page {
  222. background: #F5F9FF;
  223. }
  224. .header {
  225. background: linear-gradient(180deg, #096DCB 0%, #6faae1 100%)
  226. }
  227. .userhead {
  228. border-radius: 50%;
  229. box-shadow: 1px 1px 10px 1px #096DCB;
  230. }
  231. .text-gry80 {
  232. color: #808080;
  233. }
  234. .box-border08 {
  235. border-radius: 16rpx;
  236. }
  237. </style>