index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="main">
  3. <view class="user" @click="go('/pages/user/bind/index')">
  4. <image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'" class="head"></image>
  5. <view class="con" v-if="user.id">
  6. <view class="nickName">
  7. {{ user.patientName ? user.patientName : '还未绑定就诊人' }}
  8. <text class="icon" v-if="user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;</text>
  9. </view>
  10. <view class="welcome">欢迎使用岑溪人民医院小程序</view>
  11. </view>
  12. <view class="con" v-else>
  13. <view class="nickName">你还没登录</view>
  14. <view class="welcome">欢迎使用岑溪人民医院小程序</view>
  15. </view>
  16. <view class="icon edit">&#xe62b;</view>
  17. </view>
  18. <view class="cmd">
  19. <view class="s_item" @click="go('/pages/follow/index')">
  20. <text class="icon ic" style="color: #607d8b">&#xe60b;</text>
  21. <text class="title">我的复诊</text>
  22. <text class="icon arrow">&#xe62b;</text>
  23. </view>
  24. <view class="s_item" @click="go('/pages/follow/index')">
  25. <text class="icon ic" style="color: #607d8b">&#xe60b;</text>
  26. <text class="title">我的回访</text>
  27. <text class="icon arrow">&#xe62b;</text>
  28. </view>
  29. <view class="s_item" @click="go('/pages/visit/index')">
  30. <text class="icon ic" style="color: #03a9f4">&#xe614;</text>
  31. <text class="title">就诊记录</text>
  32. <text class="icon arrow">&#xe62b;</text>
  33. </view>
  34. <view class="s_item" @click="go('/pages/detection/index')">
  35. <text class="icon ic" style="color: #607d8b">&#xe615;</text>
  36. <text class="title">检测报告</text>
  37. <text class="icon arrow">&#xe62b;</text>
  38. </view>
  39. <view class="s_item" @click="go('/pages/help/my')">
  40. <text class="icon ic" style="color: #f44336">&#xe7c4;</text>
  41. <text class="title">分享应用</text>
  42. <text class="icon arrow">&#xe62b;</text>
  43. </view>
  44. <view class="s_item" @click="go('/pages/help/my')">
  45. <text class="icon ic" style="color: #4caf50">&#xe62c;</text>
  46. <text class="title">建议反馈</text>
  47. <text class="icon arrow">&#xe62b;</text>
  48. </view>
  49. <view class="s_item" @click="go('/pages/other/setting')">
  50. <text class="icon ic" style="color: #9e9e9e">&#xe60f;</text>
  51. <text class="title">设置</text>
  52. <text class="icon arrow">&#xe62b;</text>
  53. </view>
  54. </view>
  55. <u-action-sheet round="20" title="切换就诊人" :actions="user.bindUserList" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. ip: this.http.ip,
  63. user: {},
  64. show: false
  65. };
  66. },
  67. onShow() {
  68. /* this.user = {
  69. token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI3ZjVlNDYwLThjY2YtNDkxZi1hNTBjLWI1MjQzNDUzNjFkZiJ9.VTDBJ3929h8qGWMZFkfq-dQAkWOptIfQk7f5CaIahgltFV4QACgf3QBabcswisGTMQZaJMkxt5uCzjv3AkN48w'
  70. };
  71. uni.setStorageSync('user', this.user); */
  72. if (this.hasLogin()) {
  73. this.getUserInfo();
  74. } else {
  75. this.user = {};
  76. }
  77. },
  78. methods: {
  79. getUserInfo() {
  80. this.http.request({
  81. url: '/app/user/info',
  82. success: (res) => {
  83. this.user = res.data.data;
  84. }
  85. });
  86. },
  87. //切换就诊人
  88. selectClick(e) {
  89. uni.showModal({
  90. title: '提示',
  91. content: '确定切换就诊人',
  92. success: (res) => {
  93. if (res.confirm) {
  94. this.http.request({
  95. url: '/app/user/bind/change/' + e.id,
  96. success: (res) => {
  97. this.getUserInfo();
  98. }
  99. });
  100. }
  101. }
  102. });
  103. },
  104. go(url) {
  105. if (this.hasLogin()) {
  106. uni.navigateTo({ url: url });
  107. } else {
  108. uni.navigateTo({ url: '/pages/user/login' });
  109. }
  110. }
  111. },
  112. onShareAppMessage: function (res) {
  113. return {
  114. title: '岑溪人民医院小程序',
  115. path: '/pages/index/index',
  116. imageUrl: 'https://chenglantimes.com/prod-api/profile/upload/2024/06/16/blob_20240616055022A009.jpeg',
  117. success: (res) => {},
  118. fail: (res) => {}
  119. };
  120. }
  121. };
  122. </script>
  123. <style lang="scss">
  124. .main {
  125. padding: 5px 15px 25px 15px;
  126. .user {
  127. overflow: hidden;
  128. image {
  129. float: left;
  130. width: 60px;
  131. height: 60px;
  132. border-radius: 50%;
  133. }
  134. .con {
  135. float: left;
  136. padding-left: 15px;
  137. .nickName {
  138. padding-top: 5px;
  139. }
  140. .welcome {
  141. font-size: 14px;
  142. padding-top: 5px;
  143. color: #989898;
  144. .icon {
  145. padding-right: 3px;
  146. }
  147. }
  148. }
  149. .edit {
  150. float: right;
  151. margin-top: 14px;
  152. }
  153. }
  154. }
  155. </style>