personData.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="content">
  3. <view class="list-container">
  4. <view class="list-item margin-bot">
  5. <view class="list-item-left">
  6. <text>头像</text>
  7. </view>
  8. <view class="list-item-right">
  9. <open-data class="user-photo" type="userAvatarUrl"></open-data>
  10. </view>
  11. </view>
  12. <view class="list-item border-bottom">
  13. <view class="list-item-left">
  14. <text>姓名</text>
  15. </view>
  16. <view class="list-item-right">
  17. <text>王杰</text>
  18. </view>
  19. </view>
  20. <view class="list-item border-bottom">
  21. <view class="list-item-left">
  22. <text>手机号</text>
  23. </view>
  24. <view class="list-item-right">
  25. <text>188****1111</text>
  26. </view>
  27. </view>
  28. <view class="list-item border-bottom">
  29. <view class="list-item-left">
  30. <text>门店名称</text>
  31. </view>
  32. <view class="list-item-right">
  33. <text>宇博极速汽车维修养护中心</text>
  34. </view>
  35. </view>
  36. <view class="list-item margin-bot">
  37. <view class="list-item-left">
  38. <text>汽配经销商</text>
  39. </view>
  40. <view class="list-item-right">
  41. <text>箭冠汽配西安大兴店</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="bottom-cont" @click="loginOut">
  46. 退出登录
  47. </view>
  48. <uni-popup ref="openModal" type="center">
  49. <uni-popup-dialog content="确定退出登录吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
  50. </uni-popup>
  51. </view>
  52. </template>
  53. <script>
  54. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  55. import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
  56. import service from '../../service.js';
  57. import mIcon from '../../components/m-icon/m-icon.vue'
  58. import {
  59. mapState,
  60. mapMutations
  61. } from 'vuex'
  62. export default {
  63. components: {
  64. mIcon,uniPopup,uniPopupDialog
  65. },
  66. data() {
  67. return {
  68. userInfo:'',
  69. title:'',
  70. }
  71. },
  72. onShow() {
  73. //检测是否登录
  74. this.$store.dispatch('checkLogin')
  75. },
  76. computed: {
  77. ...mapState(['hasLogin'])
  78. },
  79. methods: {
  80. loginOut(){
  81. this.$refs.openModal.open()
  82. },
  83. onOk(){
  84. this.$refs.openModal.close()
  85. this.$store.dispatch('userLogout');
  86. setTimeout(function(){
  87. uni.redirectTo({
  88. url: '/pages/login/login'
  89. });
  90. },300)
  91. }
  92. },
  93. onLoad() {
  94. let UserInfo = uni.getStorageSync('userInfo');
  95. this.userInfo = UserInfo;
  96. console.log(UserInfo,"UserInfo")
  97. // 开启分享
  98. uni.showShareMenu({
  99. withShareTicket: true,
  100. menus: ['shareAppMessage', 'shareTimeline']
  101. })
  102. },
  103. onReady() {
  104. }
  105. }
  106. </script>
  107. <style lang="less" scoped>
  108. .content{
  109. padding: 0;
  110. background: rgb(245,245,245);
  111. }
  112. .list-container{
  113. width: 100%;
  114. box-sizing:border-box;
  115. .border-bottom{
  116. padding-left: 32rpx;
  117. border-bottom: 1px solid #E5E5E5;
  118. }
  119. .margin-bot{
  120. margin-bottom: 20rpx;
  121. }
  122. .list-item{
  123. width: 100%;
  124. background-color: #fff;
  125. display: flex;
  126. padding: 30rpx 32rpx;
  127. justify-content: space-between;
  128. align-items:center;
  129. // border-bottom: 1px solid #E5E5E5;
  130. .user-photo{
  131. display: block;
  132. width: 100rpx;
  133. height: 100rpx;
  134. border-radius: 50%;
  135. overflow: hidden;
  136. }
  137. .list-item-left{
  138. font-size: 36rpx;
  139. color: #191919;
  140. }
  141. .list-item-right{
  142. font-size: 36rpx;
  143. color: #666666;
  144. display: flex;
  145. align-items: center;
  146. .back-img{
  147. width: 18rpx;
  148. height: 34rpx;
  149. margin-left: 20rpx;
  150. }
  151. }
  152. }
  153. }
  154. .bottom-cont{
  155. position: fixed;
  156. bottom: 0;
  157. width: 100%;
  158. background-color: #fff;
  159. height: 110rpx;
  160. font-size: 36rpx;
  161. color: #999999;
  162. text-align: center;
  163. line-height: 110rpx;
  164. }
  165. </style>