settings.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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)
  49. this.userInfo.userpic =
  50. "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png";
  51. },
  52. onShow() {},
  53. methods: {
  54. outLogin() {
  55. uni.showModal({
  56. title: "确认退出登录?",
  57. success(re) {
  58. if (re.confirm) {
  59. // 清空登录标识
  60. uni.setStorageSync("userLogin", null);
  61. // 清空用户信息
  62. uni.setStorageSync("userInfo", null);
  63. uni.setStorageSync("pages/challenge/index", null);
  64. // 跳转到登录页
  65. uni.redirectTo({
  66. url: "/pages/login/index",
  67. });
  68. }
  69. },
  70. });
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang="less">
  76. .user_box {
  77. width: 680rpx;
  78. height: 180rpx;
  79. overflow: hidden;
  80. background: #ffffff;
  81. padding: 10rpx 35rpx;
  82. .box_left {
  83. float: left;
  84. display: block;
  85. width: 140rpx;
  86. height: 140rpx;
  87. .user_image {
  88. display: block;
  89. width: 120rpx;
  90. height: 120rpx;
  91. border-radius: 50%;
  92. margin: 10rpx auto;
  93. }
  94. }
  95. .box_center {
  96. float: left;
  97. width: 300rpx;
  98. height: 140rpx;
  99. margin-left: 35rpx;
  100. .user_name {
  101. font-size: 30rpx;
  102. line-height: 80rpx;
  103. }
  104. .user_info {
  105. color: #999999;
  106. font-size: 24rpx;
  107. line-height: 60rpx;
  108. }
  109. }
  110. .box_right {
  111. float: right;
  112. width: 140rpx;
  113. height: 140rpx;
  114. font-size: 20rpx;
  115. .setting_page {
  116. width: 140rpx;
  117. height: 140rpx;
  118. display: block;
  119. overflow: hidden;
  120. .setting_icon {
  121. width: 60rpx;
  122. height: 60rpx;
  123. display: block;
  124. margin: 40rpx auto;
  125. }
  126. }
  127. }
  128. }
  129. .setting_list {
  130. overflow: hidden;
  131. margin: 10rpx auto;
  132. padding: 0rpx 0rpx;
  133. .setting_item_loginout {
  134. height: 80rpx;
  135. display: block;
  136. font-size: 26rpx;
  137. line-height: 80rpx;
  138. margin: 10rpx 40rpx;
  139. padding: 0rpx 35rpx;
  140. background: #ffffff;
  141. background: #ffffff;
  142. border-radius: 100rpx 100rpx 100rpx 100rpx;
  143. text-align: center;
  144. }
  145. .setting_item {
  146. height: 80rpx;
  147. display: block;
  148. font-size: 26rpx;
  149. line-height: 80rpx;
  150. margin: 10rpx auto;
  151. padding: 0rpx 35rpx;
  152. background: #ffffff;
  153. .setting_title {
  154. }
  155. .setting_title_loginout {
  156. color: #999999;
  157. }
  158. .setting_icon {
  159. float: right;
  160. color: #999999;
  161. }
  162. }
  163. }
  164. </style>