personData.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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>{{userInfo.userNameCN}}</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>{{userInfo.mobile}}</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>{{userInfo.orgName}}</text>
  34. </view>
  35. </view>
  36. <view class="list-item margin-bot" v-if="shelfInfo">
  37. <view class="list-item-left">
  38. <text>汽配经销商</text>
  39. </view>
  40. <view class="list-item-right">
  41. <text>{{shelfInfo.dealerName}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="bottom-cont" style="color: dodgerblue;" @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. title:'',
  69. }
  70. },
  71. onShow() {
  72. //检测是否登录
  73. this.$store.dispatch('checkLogin')
  74. },
  75. computed: {
  76. ...mapState(['hasLogin']),
  77. userInfo(){
  78. return this.$store.state.vuex_userInfo
  79. },
  80. shelfInfo(){
  81. return this.$store.state.vuex_storeShelf
  82. },
  83. },
  84. methods: {
  85. loginOut(){
  86. this.$refs.openModal.open()
  87. },
  88. onOk(){
  89. this.$refs.openModal.close()
  90. this.$store.dispatch('userLogout');
  91. setTimeout(function(){
  92. uni.redirectTo({
  93. url: '/pages/login/login'
  94. });
  95. },300)
  96. }
  97. },
  98. onLoad() {
  99. },
  100. onReady() {
  101. }
  102. }
  103. </script>
  104. <style lang="less" scoped>
  105. .content{
  106. padding: 0;
  107. background: rgb(245,245,245);
  108. }
  109. .list-container{
  110. width: 100%;
  111. box-sizing:border-box;
  112. .border-bottom{
  113. padding-left: 32rpx;
  114. border-bottom: 1px solid #E5E5E5;
  115. }
  116. .margin-bot{
  117. margin-bottom: 20rpx;
  118. }
  119. .list-item{
  120. width: 100%;
  121. background-color: #fff;
  122. display: flex;
  123. padding: 30rpx 32rpx;
  124. justify-content: space-between;
  125. align-items:center;
  126. // border-bottom: 1px solid #E5E5E5;
  127. .user-photo{
  128. display: block;
  129. width: 100rpx;
  130. height: 100rpx;
  131. border-radius: 50%;
  132. overflow: hidden;
  133. }
  134. .list-item-left{
  135. font-size: 36rpx;
  136. color: #191919;
  137. }
  138. .list-item-right{
  139. font-size: 36rpx;
  140. color: #666666;
  141. display: flex;
  142. align-items: center;
  143. .back-img{
  144. width: 18rpx;
  145. height: 34rpx;
  146. margin-left: 20rpx;
  147. }
  148. }
  149. }
  150. }
  151. .bottom-cont{
  152. position: fixed;
  153. bottom: 0;
  154. width: 100%;
  155. background-color: #fff;
  156. height: 110rpx;
  157. font-size: 36rpx;
  158. color: #999999;
  159. text-align: center;
  160. line-height: 110rpx;
  161. }
  162. </style>