settings.vue 3.1 KB

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