settings.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <Container
  3. title="设置"
  4. :scrollStyle="{
  5. padding: 0
  6. }"
  7. :showBack="false"
  8. bgColor="#f8f8f8"
  9. >
  10. <view>
  11. <!-- <view class="user_box">
  12. <view class="box_left">
  13. <image class="user_image" :src="userInfo.userpic"></image>
  14. </view>
  15. <view class="box_center">
  16. <view class="user_name">{{ userInfo.username }}</view>
  17. <view class="user_info">{{ userInfo.phone }}</view>
  18. </view>
  19. <view class="box_right"></view>
  20. </view>
  21. <view class="setting_list"></view> -->
  22. <view class="setting_list">
  23. <view class="setting_item_loginout" @click="outLogin()">
  24. <text class="setting_title_loginout">退出登录</text>
  25. <view class="setting_icon">&gt;</view>
  26. </view>
  27. </view>
  28. </view>
  29. </Container>
  30. </template>
  31. <script>
  32. import Container from '../../components/Container/Container.vue';
  33. import CustomerService from '@/components/CustomerService/CustomerService.vue';
  34. export default {
  35. data() {
  36. return {
  37. userInfo: {
  38. username: '',
  39. userpic: '',
  40. phone: '',
  41. status: 0,
  42. company_status: 0
  43. }
  44. };
  45. },
  46. onLoad() {
  47. let userInfo = uni.getStorageSync('userInfo');
  48. this.userInfo = userInfo;
  49. if (!this.userInfo.userpic) this.userInfo.userpic = 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png';
  50. },
  51. onShow() {},
  52. methods: {
  53. outLogin() {
  54. uni.showModal({
  55. title: '确认退出登录?',
  56. success(re) {
  57. if (re.confirm) {
  58. // 清空登录标识
  59. uni.setStorageSync('userLogin', null);
  60. // 清空用户信息
  61. uni.setStorageSync('userInfo', null);
  62. // 跳转到登录页
  63. uni.redirectTo({
  64. url: '/pages/login/index'
  65. });
  66. }
  67. }
  68. });
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="less">
  74. .user_box {
  75. width: 680rpx;
  76. height: 180rpx;
  77. overflow: hidden;
  78. background: #ffffff;
  79. padding: 10rpx 35rpx;
  80. .box_left {
  81. float: left;
  82. display: block;
  83. width: 140rpx;
  84. height: 140rpx;
  85. .user_image {
  86. display: block;
  87. width: 120rpx;
  88. height: 120rpx;
  89. border-radius: 50%;
  90. margin: 10rpx auto;
  91. }
  92. }
  93. .box_center {
  94. float: left;
  95. width: 300rpx;
  96. height: 140rpx;
  97. margin-left: 35rpx;
  98. .user_name {
  99. font-size: 30rpx;
  100. line-height: 80rpx;
  101. }
  102. .user_info {
  103. color: #999999;
  104. font-size: 24rpx;
  105. line-height: 60rpx;
  106. }
  107. }
  108. .box_right {
  109. float: right;
  110. width: 140rpx;
  111. height: 140rpx;
  112. font-size: 20rpx;
  113. .setting_page {
  114. width: 140rpx;
  115. height: 140rpx;
  116. display: block;
  117. overflow: hidden;
  118. .setting_icon {
  119. width: 60rpx;
  120. height: 60rpx;
  121. display: block;
  122. margin: 40rpx auto;
  123. }
  124. }
  125. }
  126. }
  127. .setting_list {
  128. overflow: hidden;
  129. margin: 10rpx auto;
  130. padding: 0rpx 0rpx;
  131. .setting_item_loginout {
  132. height: 80rpx;
  133. display: block;
  134. font-size: 26rpx;
  135. line-height: 80rpx;
  136. margin: 10rpx 40rpx;
  137. padding: 0rpx 35rpx;
  138. background: #ffffff;
  139. background: #ffffff;
  140. border-radius: 100rpx 100rpx 100rpx 100rpx;
  141. text-align: center;
  142. }
  143. .setting_item {
  144. height: 80rpx;
  145. display: block;
  146. font-size: 26rpx;
  147. line-height: 80rpx;
  148. margin: 10rpx auto;
  149. padding: 0rpx 35rpx;
  150. background: #ffffff;
  151. .setting_title {
  152. }
  153. .setting_title_loginout{
  154. color: #999999;
  155. }
  156. .setting_icon {
  157. float: right;
  158. color: #999999;
  159. }
  160. }
  161. }
  162. </style>