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