detail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="main">
  3. <view class="one">
  4. <image class="image" :src="user.icon&&user.icon.length>0?user.icon[0].url:config.user_url[0].url" mode="">
  5. </image>
  6. </view>
  7. <view class="two">
  8. <view class="two_1">
  9. <view class="left">姓名</view>
  10. <view class="right textOne">
  11. <text>{{user.name||'暂无姓名'}}</text>
  12. </view>
  13. </view>
  14. <view class="two_1">
  15. <view class="left">手机号</view>
  16. <view class="right textOne">
  17. <text>{{user.mobile||'暂无手机号'}}</text>
  18. </view>
  19. </view>
  20. <view class="two_1">
  21. <view class="left">就诊编号/卡号</view>
  22. <view class="right textOne">
  23. <text>{{user.card_no||'暂无就诊编号/卡号'}}</text>
  24. </view>
  25. </view>
  26. <view class="two_1">
  27. <view class="left">性别</view>
  28. <view class="right textOne">
  29. <text>{{user.gender||'暂无性别'}}</text>
  30. </view>
  31. </view>
  32. <view class="two_1">
  33. <view class="left">年龄</view>
  34. <view class="right textOne">
  35. <text>{{user.age||'暂无年龄'}}</text>
  36. </view>
  37. </view>
  38. <view class="two_1">
  39. <view class="left">住址</view>
  40. <view class="right textOne">
  41. <text>{{user.address||'暂无住址'}}</text>
  42. </view>
  43. </view>
  44. <view class="two_1">
  45. <view class="left">紧急联系人</view>
  46. <view class="right textOne">
  47. <text>{{user.urgent_name||'暂无紧急联系人'}}</text>
  48. </view>
  49. </view>
  50. <view class="two_1">
  51. <view class="left">紧急联系人电话</view>
  52. <view class="right textOne">
  53. <text>{{user.urgent_mobile||'暂无紧急联系人电话'}}</text>
  54. </view>
  55. </view>
  56. <view class="two_1">
  57. <view class="left">病例</view>
  58. <view class="right" @tap="toImage(user.emrs[0].url)">
  59. <image class="image" :src="user.emrs&&user.emrs.length>0?user.emrs[0].url:''" mode="">
  60. </image>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. id: '',
  71. user: {},
  72. config: {},
  73. }
  74. },
  75. onLoad: async function(e) {
  76. const that = this;
  77. that.$set(that, `id`, e && e.id || '');
  78. await that.searchConfig();
  79. await that.search();
  80. },
  81. methods: {
  82. searchConfig() {
  83. const that = this;
  84. try {
  85. const res = uni.getStorageSync('config');
  86. if (res) that.$set(that, `config`, res);
  87. } catch (e) {}
  88. },
  89. // 查询
  90. async search() {
  91. const that = this;
  92. if (that.id) {
  93. let res = await that.$api(`/patient/${that.id}`, 'GET', {})
  94. if (res.errcode == '0') {
  95. that.$set(that, `user`, res.data)
  96. } else {
  97. uni.showToast({
  98. title: res.errmsg,
  99. icon: 'none'
  100. });
  101. }
  102. }
  103. },
  104. // 预览图片
  105. toImage(e) {
  106. uni.previewImage({
  107. urls: [e]
  108. })
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .main {
  115. .one {
  116. display: flex;
  117. justify-content: center;
  118. padding: 2vw;
  119. .image {
  120. width: 25vw;
  121. height: 25vw;
  122. border-radius: 5px;
  123. }
  124. }
  125. .two {
  126. padding: 2vw;
  127. .two_1 {
  128. display: flex;
  129. justify-content: space-between;
  130. padding: 4vw;
  131. border-bottom: 1px solid var(--f9Color);
  132. font-size: var(--font14Size);
  133. color: var(--f69Color);
  134. .right {
  135. text-align: right;
  136. width: 60vw;
  137. .image {
  138. width: 20vw;
  139. height: 20vw;
  140. border-radius: 5px;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>