人民医院前端

setting.vue 4.7KB

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