settings.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <view class="user_box">
  4. <view class="box_left">
  5. <image class="user_image" :src="userInfo.userpic" ></image>
  6. </view>
  7. <view class="box_center">
  8. <view class="user_name">{{userInfo.username}}</view>
  9. <view class="user_info">{{userInfo.phone}}</view>
  10. </view>
  11. <view class="box_right">
  12. </view>
  13. </view>
  14. <view class="setting_list">
  15. <navigator class="setting_item" url="/pages/addr/index" >
  16. <text class="setting_title">收货地址</text>
  17. <view class="setting_icon"> &gt; </view>
  18. </navigator>
  19. <!-- <navigator class="setting_item" url="/pages/settings/settings" >
  20. <text class="setting_title">权限管理</text>
  21. <view class="setting_icon">&gt; </view>
  22. </navigator> -->
  23. </view>
  24. <view class="setting_list">
  25. <view class="setting_item" @click="outLogin()" >
  26. <text class="setting_title">退出登录</text>
  27. <view class="setting_icon">&gt; </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  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. this.$http.request('api/custom/get_info').then((re)=>{
  47. if( re.code == 'success' ){
  48. this.userInfo = re.data;
  49. if( !this.userInfo.userpic ) this.userInfo.userpic = "../../static/icon/doctor.png";
  50. }
  51. });
  52. },
  53. onShow() {
  54. },
  55. methods: {
  56. outLogin(){
  57. uni.showModal({
  58. title:"确认退出登录?",
  59. success(re) {
  60. if (re.confirm) {
  61. // 清空登录标识
  62. uni.setStorageSync('userLogin',null);
  63. // 清空用户信息
  64. uni.setStorageSync('userInfo',null);
  65. // 跳转到登录页
  66. uni.redirectTo({
  67. url:"/pages/login/index"
  68. })
  69. }
  70. }
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="less">
  77. .user_box{
  78. width: 680rpx;
  79. height: 180rpx;
  80. overflow: hidden;
  81. background: #FFFFFF;
  82. padding: 10rpx 35rpx;
  83. .box_left{
  84. float: left;
  85. display: block;
  86. width: 140rpx;
  87. height: 140rpx;
  88. .user_image{
  89. display: block;
  90. width: 120rpx;
  91. height: 120rpx;
  92. border-radius: 50%;
  93. margin: 10rpx auto;
  94. }
  95. }
  96. .box_center{
  97. float: left;
  98. width: 300rpx;
  99. height: 140rpx;
  100. margin-left: 35rpx;
  101. .user_name{
  102. font-size: 30rpx;
  103. line-height: 80rpx;
  104. }
  105. .user_info{
  106. color: #999999;
  107. font-size: 24rpx;
  108. line-height: 60rpx;
  109. }
  110. }
  111. .box_right{
  112. float: right;
  113. width: 140rpx;
  114. height: 140rpx;
  115. font-size: 20rpx;
  116. .setting_page{
  117. width: 140rpx;
  118. height: 140rpx;
  119. display: block;
  120. overflow: hidden;
  121. .setting_icon{
  122. width: 60rpx;
  123. height: 60rpx;
  124. display: block;
  125. margin: 40rpx auto;
  126. }
  127. }
  128. }
  129. }
  130. .setting_list{
  131. overflow: hidden;
  132. margin: 10rpx auto;
  133. padding: 0rpx 0rpx;
  134. .setting_item{
  135. height: 80rpx;
  136. display: block;
  137. font-size: 26rpx;
  138. line-height: 80rpx;
  139. margin: 10rpx auto;
  140. padding: 0rpx 35rpx;
  141. background: #FFFFFF;
  142. .setting_title{
  143. }
  144. .setting_icon{
  145. float: right;
  146. color: #999999;
  147. }
  148. }
  149. }
  150. </style>