index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="mine-container" :style="'background: url('+this.imgUrl+'/index/mingbg.png) no-repeat 100% 100%;height:'+windowHeight+'px;background-position: 0 0;background-size: 100% 100%;'">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section">
  5. <view class="flex padding justify-between">
  6. <view class="flex align-center">
  7. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  8. <view class="iconfont icon-people text-gray icon"></view>
  9. </view>
  10. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  11. </image>
  12. <view v-if="!name" @click="handleToLogin" class="login-tip">
  13. 点击登录
  14. </view>
  15. <view v-if="name" @click="handleToInfo" class="user-info">
  16. <view class="u_title" style="color: #8E8E8E">
  17. 你好!
  18. </view>
  19. <view class="u_title">
  20. {{ name }}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="menu-list">
  27. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  28. <view class="menu-item-box">
  29. <image :src="this.imgUrl+'/index/settingicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  30. <view class="menu-text">账户设置</view>
  31. </view>
  32. </view>
  33. <view class="list-cell list-cell-arrow" @click="handleAbout">
  34. <view class="menu-item-box">
  35. <image :src="this.imgUrl+'/index/chargeicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  36. <view class="menu-text">充电记录</view>
  37. </view>
  38. </view>
  39. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  40. <view class="menu-item-box">
  41. <image :src="this.imgUrl+'/index/planicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  42. <view class="menu-text">预约记录</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import storage from '@/utils/storage'
  50. export default {
  51. data() {
  52. return {
  53. name: this.$store.state.user.name,
  54. version: getApp().globalData.config.appInfo.version,
  55. imgUrl:getApp().globalData.config.imgUrl
  56. }
  57. },
  58. computed: {
  59. avatar() {
  60. return getApp().globalData.config.imgUrl+"/index/user.png"
  61. },
  62. windowHeight() {
  63. return uni.getSystemInfoSync().windowHeight - 50
  64. }
  65. },
  66. methods: {
  67. handleToEditInfo() {
  68. this.$tab.navigateTo('/pages/mine/pwd/index')
  69. },
  70. handleToSetting() {
  71. this.$tab.navigateTo('/pages/weitiandi/device/planrecord')
  72. },
  73. handleToLogin() {
  74. this.$tab.reLaunch('/pages/login')
  75. },
  76. handleLogout() {
  77. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  78. this.$store.dispatch('LogOut').then(() => {
  79. this.$tab.reLaunch('/pages/index')
  80. })
  81. })
  82. },
  83. handleAbout() {
  84. this.$tab.navigateTo('/pages/weitiandi/device/chargerecord')
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. page {
  91. background-color: #f5f6f7;
  92. }
  93. .mine-container {
  94. width: 100%;
  95. height: 100%;
  96. .header-section {
  97. padding: 15px 15px 45px 15px;
  98. color: white;
  99. .login-tip {
  100. font-size: 18px;
  101. margin-left: 10px;
  102. }
  103. .cu-avatar {
  104. border: 2px solid #eaeaea;
  105. .icon {
  106. font-size: 40px;
  107. }
  108. }
  109. .user-info {
  110. margin-left: 15px;
  111. .u_title {
  112. font-size: 18px;
  113. line-height: 30px;
  114. color: #000000;
  115. }
  116. }
  117. }
  118. .content-section {
  119. position: relative;
  120. top: -50px;
  121. .mine-actions {
  122. margin: 15px 15px;
  123. padding: 20px 0px;
  124. border-radius: 8px;
  125. .action-item {
  126. .icon {
  127. font-size: 28px;
  128. }
  129. .text {
  130. display: block;
  131. font-size: 13px;
  132. margin: 8px 0px;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. .menu-list{
  139. box-shadow: 0px 2px 24px 0px rgba(0,0,0,0.06);
  140. border-radius: 20px;
  141. }
  142. .list-cell{
  143. padding:17px 15px;
  144. }
  145. .menu-text{
  146. color:#555555
  147. }
  148. </style>