人民医院前端

setting.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="content">
  3. <view class="userInfo" @click="infoHandle">
  4. <view class="userInfoLeft">
  5. <image src="/static/person.png" mode=""></image>
  6. </view>
  7. <view class="userInfoRight">
  8. <view>{{userName}}--{{userCode}}</view>
  9. <view>{{deptName}}</view>
  10. </view>
  11. </view>
  12. <view class="userList">
  13. <view class="listCell" v-for="(item,index) in listCell" :key="index">
  14. <image :src="item.imgPath"></image>
  15. <text>{{item.itemText}}</text>
  16. <uni-icons class="fontIcon" type="arrowright" color="#d6d6d4" size="18"></uni-icons>
  17. </view>
  18. <view class="listCell" @touchend="touchHandle">
  19. <image src="/static/Wd.png"></image>
  20. <text>版本</text>
  21. <text class="versionNum">{{version}}</text>
  22. </view>
  23. </view>
  24. <view class="btnExit">
  25. <button type="primary" @click="btnExit">退出登录</button>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { debuggerModule, installDebugger } from 'uni_modules/imengyu-IMDebuggerWindow/common/debuggerExtern.js'
  31. import {
  32. mapGetters
  33. } from 'vuex';
  34. import store from '@/store';
  35. export default {
  36. data() {
  37. return {
  38. version: '',
  39. touchHandleTime:0,
  40. listCell: [
  41. // {
  42. // imgPath:'../../static/Wa.png',
  43. // itemText:'服务守则'
  44. // },
  45. ]
  46. }
  47. },
  48. onLoad() {
  49. store.dispatch("GetInfo")
  50. // 页面
  51. this.updateList()
  52. // #ifdef APP-PLUS
  53. this.version = 'v' + plus.runtime.version
  54. // #endif
  55. },
  56. methods: {
  57. updateList(){
  58. uni.$on("updateList", (res) => {
  59. store.dispatch("GetInfo")
  60. })
  61. },
  62. touchHandle(e) {
  63. this.touchHandleTime++
  64. console.log(this.touchHandleTime)
  65. if(this.touchHandleTime === 5){
  66. this.touchHandleTime = 0
  67. installDebugger({
  68. enableRequestInterceptor: true, //默认为false,指示是否拦截网络请求,参见下一条
  69. showGlobalFloatWindow: true //默认为true,指定是否添加一个全局的调试按钮,点击可跳转至窗口
  70. });
  71. }
  72. },
  73. btnExit() {
  74. uni.showModal({
  75. title: '确定退出吗?',
  76. content: '退出到登录页面',
  77. success: function(res) {
  78. if (res.confirm) {
  79. uni.setStorageSync('Username', '');
  80. uni.setStorageSync('Password', '');
  81. uni.setStorageSync('token', '');
  82. uni.reLaunch({
  83. url: '/pages/login/login'
  84. });
  85. } else if (res.cancel) {
  86. console.log('用户点击取消');
  87. }
  88. }
  89. });
  90. },
  91. infoHandle(){
  92. uni.navigateTo({
  93. url:"personDetail/personDetail?userCode="+this.userCode
  94. })
  95. }
  96. },
  97. computed: {
  98. ...mapGetters([
  99. "userCode", // 用户工号
  100. "userName", // 用户名称
  101. "deptName", // 部门名称
  102. ])
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. .userInfo {
  108. // background: url(/static/setting_banner.png) no-repeat;
  109. background-color: rgb(0, 122, 255);
  110. background-size: 100% 100%;
  111. width: 100%;
  112. height: 260rpx;
  113. display: flex;
  114. .userInfoLeft {
  115. width: 150rpx;
  116. height: 150rpx;
  117. border-radius: 75rpx;
  118. margin: 30rpx 30rpx 0rpx 30rpx;
  119. background: #FFFFFF;
  120. image {
  121. width: 100%;
  122. height: 100%;
  123. padding: 30rpx 20rpx 30rpx 35rpx;
  124. box-sizing: border-box;
  125. }
  126. }
  127. .userInfoRight {
  128. margin-top: 50rpx;
  129. view {
  130. color: #FFFFFF;
  131. font-size: 30rpx;
  132. }
  133. }
  134. }
  135. .userList {
  136. width: 100%;
  137. border-top: 1rpx solid #d6d6d4;
  138. border-bottom: 1rpx solid #d6d6d4;
  139. background: #FFFFFF;
  140. margin-top: 40rpx;
  141. overflow: hidden;
  142. .listCell {
  143. width: 720rpx;
  144. margin-left: 30rpx;
  145. height: 84rpx;
  146. line-height: 84rpx;
  147. border-bottom: 1rpx solid #d6d6d4;
  148. position: relative;
  149. display: flex;
  150. image {
  151. width: 40rpx;
  152. height: 40rpx;
  153. margin: 22rpx 22rpx 0 22rpx;
  154. box-sizing: border-box;
  155. }
  156. .fontIcon {
  157. position: absolute;
  158. right: 40rpx;
  159. }
  160. .versionNum {
  161. position: absolute;
  162. right: 80rpx;
  163. color: #999998;
  164. }
  165. }
  166. .listCell:last-child {
  167. border: none;
  168. }
  169. }
  170. .btnExit {
  171. width: 80%;
  172. margin: 30rpx auto;
  173. }
  174. </style>