personData.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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>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>{{userInfo.orgName}}</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>{{shelfInfo.dealerName}}</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. 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. let UserInfo = uni.getStorageSync('userInfo');
  100. this.userInfo = UserInfo;
  101. console.log(UserInfo,"UserInfo")
  102. // 开启分享
  103. uni.showShareMenu({
  104. withShareTicket: true,
  105. menus: ['shareAppMessage', 'shareTimeline']
  106. })
  107. },
  108. onReady() {
  109. }
  110. }
  111. </script>
  112. <style lang="less" scoped>
  113. .content{
  114. padding: 0;
  115. background: rgb(245,245,245);
  116. }
  117. .list-container{
  118. width: 100%;
  119. box-sizing:border-box;
  120. .border-bottom{
  121. padding-left: 32rpx;
  122. border-bottom: 1px solid #E5E5E5;
  123. }
  124. .margin-bot{
  125. margin-bottom: 20rpx;
  126. }
  127. .list-item{
  128. width: 100%;
  129. background-color: #fff;
  130. display: flex;
  131. padding: 30rpx 32rpx;
  132. justify-content: space-between;
  133. align-items:center;
  134. // border-bottom: 1px solid #E5E5E5;
  135. .user-photo{
  136. display: block;
  137. width: 100rpx;
  138. height: 100rpx;
  139. border-radius: 50%;
  140. overflow: hidden;
  141. }
  142. .list-item-left{
  143. font-size: 36rpx;
  144. color: #191919;
  145. }
  146. .list-item-right{
  147. font-size: 36rpx;
  148. color: #666666;
  149. display: flex;
  150. align-items: center;
  151. .back-img{
  152. width: 18rpx;
  153. height: 34rpx;
  154. margin-left: 20rpx;
  155. }
  156. }
  157. }
  158. }
  159. .bottom-cont{
  160. position: fixed;
  161. bottom: 0;
  162. width: 100%;
  163. background-color: #fff;
  164. height: 110rpx;
  165. font-size: 36rpx;
  166. color: #999999;
  167. text-align: center;
  168. line-height: 110rpx;
  169. }
  170. </style>