1
0

index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="main">
  3. <view class="user">
  4. <image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'"></image>
  5. <view class="con" v-if="user.id || user.token">
  6. <view v-if="user.doctor" @click="go('/pages/user/info')">
  7. <view class="nickName">{{ user.nickName }}</view>
  8. <view class="welcome">{{ user.dept.deptName || '欢迎使用岑溪人民医院小程序' }}</view>
  9. </view>
  10. <view v-else @click="go('/pages/user/bind/index')">
  11. <view class="nickName">
  12. <text>{{ user.patientName ? user.patientName : '还未绑定就诊人' }}</text>
  13. <text class="icon" v-if="user.bindUserList && user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;切换就诊人</text>
  14. </view>
  15. <view class="welcome">欢迎使用岑溪人民医院小程序</view>
  16. </view>
  17. </view>
  18. <view class="con" v-else @click="go('/pages/user/info')">
  19. <view class="nickName">你还没登录</view>
  20. <view class="welcome">欢迎使用岑溪人民医院小程序</view>
  21. </view>
  22. <view class="icon edit">&#xe62b;</view>
  23. </view>
  24. <view class="cmd">
  25. <!--医生菜单-->
  26. <view v-if="user.doctor">
  27. <view class="s_item" @click="go('/pages/follow/doctor/index?type=0')">
  28. <text class="icon ic" style="color: #03a9f4">&#xe716;</text>
  29. <text class="title">复诊提醒</text>
  30. <text class="icon arrow">&#xe62b;</text>
  31. </view>
  32. <view class="s_item" @click="go('/pages/follow/doctor/index?type=1')">
  33. <text class="icon ic" style="color: #607d8b">&#xe60b;</text>
  34. <text class="title">随访记录</text>
  35. <text class="icon arrow">&#xe62b;</text>
  36. </view>
  37. <view class="s_item" @click="go('/pages/knowledge/doctor/index')">
  38. <text class="icon ic" style="color: #ff5722">&#xe69a;</text>
  39. <text class="title">我的知识库</text>
  40. <text class="icon arrow">&#xe62b;</text>
  41. </view>
  42. <view class="s_item" @click="go('/pages/visit/doctor/selectUser')">
  43. <text class="icon ic" style="color: #03a9f4">&#xe685;</text>
  44. <text class="title">就诊记录</text>
  45. <text class="icon arrow">&#xe62b;</text>
  46. </view>
  47. <view class="s_item" @click="go('/pages/detection/index')">
  48. <text class="icon ic" style="color: #ff9800">&#xe63a;</text>
  49. <text class="title">检测报告</text>
  50. <text class="icon arrow">&#xe62b;</text>
  51. </view>
  52. </view>
  53. <!--患者菜单-->
  54. <view v-else>
  55. <view class="s_item" @click="go('/pages/follow/remind')">
  56. <text class="icon ic" style="color: #03a9f4">&#xe6a3;</text>
  57. <text class="title">复诊提醒</text>
  58. <text class="icon arrow">&#xe62b;</text>
  59. </view>
  60. <view class="s_item" @click="go('/pages/follow/index')">
  61. <text class="icon ic" style="color: #607d8b">&#xe60b;</text>
  62. <text class="title">我的随访</text>
  63. <text class="icon arrow">&#xe62b;</text>
  64. </view>
  65. <view class="s_item" @click="go('/pages/visit/index')">
  66. <text class="icon ic" style="color: #03a9f4">&#xe685;</text>
  67. <text class="title">就诊记录</text>
  68. <text class="icon arrow">&#xe62b;</text>
  69. </view>
  70. <view class="s_item" @click="go('/pages/detection/index')">
  71. <text class="icon ic" style="color: #ff9800">&#xe63a;</text>
  72. <text class="title">检测报告</text>
  73. <text class="icon arrow">&#xe62b;</text>
  74. </view>
  75. </view>
  76. <button class="s_item" open-type="share" @click="go('/pages/help/my')" hover-class="none">
  77. <text class="icon ic" style="color: #f44336">&#xe7c4;</text>
  78. <text class="title">分享应用</text>
  79. <text class="icon arrow">&#xe62b;</text>
  80. </button>
  81. <button class="s_item" open-type="feedback" @click="go('/pages/help/my')">
  82. <text class="icon ic" style="color: #4caf50">&#xe62c;</text>
  83. <text class="title">建议反馈</text>
  84. <text class="icon arrow">&#xe62b;</text>
  85. </button>
  86. <view class="s_item" @click="go('/pages/other/setting')">
  87. <text class="icon ic" style="color: #9e9e9e">&#xe60f;</text>
  88. <text class="title">设置</text>
  89. <text class="icon arrow">&#xe62b;</text>
  90. </view>
  91. </view>
  92. <u-action-sheet round="20" title="切换就诊人" :actions="user.bindUserList" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data() {
  98. return {
  99. ip: this.http.ip,
  100. user: {},
  101. show: false
  102. };
  103. },
  104. onShow() {
  105. /* this.user = {
  106. token: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI3ZjVlNDYwLThjY2YtNDkxZi1hNTBjLWI1MjQzNDUzNjFkZiJ9.VTDBJ3929h8qGWMZFkfq-dQAkWOptIfQk7f5CaIahgltFV4QACgf3QBabcswisGTMQZaJMkxt5uCzjv3AkN48w'
  107. };
  108. uni.setStorageSync('user', this.user); */
  109. this.user = this.getUser();
  110. if (this.hasLogin() && !this.user.doctor) {
  111. this.getUserInfo();
  112. }
  113. },
  114. methods: {
  115. getUserInfo() {
  116. this.http.request({
  117. url: '/app/user/info',
  118. success: (res) => {
  119. this.user = res.data.data;
  120. }
  121. });
  122. },
  123. //切换就诊人
  124. selectClick(e) {
  125. uni.showModal({
  126. title: '提示',
  127. content: '确定切换就诊人',
  128. success: (res) => {
  129. if (res.confirm) {
  130. this.http.request({
  131. url: '/app/user/bind/change/' + e.id,
  132. success: (res) => {
  133. this.getUserInfo();
  134. }
  135. });
  136. }
  137. }
  138. });
  139. },
  140. go(url) {
  141. if (this.hasLogin()) {
  142. uni.navigateTo({ url: url });
  143. } else {
  144. uni.navigateTo({ url: '/pages/user/login' });
  145. }
  146. }
  147. },
  148. onShareAppMessage: function (res) {
  149. return {
  150. title: '岑溪人民医院小程序',
  151. path: '/pages/index/index',
  152. imageUrl: '../../static/favicon.png',
  153. success: (res) => {},
  154. fail: (res) => {}
  155. };
  156. }
  157. };
  158. </script>
  159. <style lang="scss">
  160. .main {
  161. padding: 5px 15px 25px 15px;
  162. .user {
  163. overflow: hidden;
  164. image {
  165. float: left;
  166. width: 60px;
  167. height: 60px;
  168. border-radius: 50%;
  169. }
  170. .con {
  171. float: left;
  172. padding-left: 15px;
  173. .nickName {
  174. padding-top: 5px;
  175. .icon {
  176. padding-left: 6px;
  177. font-size: 13px;
  178. color: $main-color;
  179. }
  180. }
  181. .welcome {
  182. font-size: 14px;
  183. padding-top: 5px;
  184. color: #989898;
  185. }
  186. }
  187. .edit {
  188. float: right;
  189. margin-top: 14px;
  190. }
  191. }
  192. button {
  193. border-radius: 0px;
  194. line-height: 1;
  195. font-size: 15px;
  196. }
  197. }
  198. </style>