me.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="container">
  3. <image src="../../static/img/header_bg.png" style="width:100%;height:300rpx;position: absolute;z-index: -1;"></image>
  4. <view class="page-top">
  5. <u-image width="100rpx" height="100rpx" shape="circle" :src="myInfo.head_photo" border-radius="5rpx"></u-image>
  6. <view style="margin-left:20rpx;color:#ffffff;">
  7. <view style="font-size:38rpx;margin-bottom: 15rpx;font-family: '黑体';">{{myInfo.real_name}}</view>
  8. <view style="font-size:26rpx;">
  9. {{myInfo.phone_num}}
  10. </view>
  11. </view>
  12. </view>
  13. <view class="page-body">
  14. <view class="body-block">
  15. <view style="display: flex; justify-content: space-between;align-items:center;width:100%;" @tap="openPage" data-url="../parking/myparkings">
  16. <view class="block-item">
  17. <view>{{myParkSites.length}}<text style="font-size:28rpx;color:#999999;margin-left:10rpx;">个</text></view>
  18. <text>我的停车场</text>
  19. </view>
  20. <view class="block-item">
  21. <u-icon size="32" name="arrow-right" color="#a8a8a8"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. <u-cell-group>
  26. <u-cell-item v-for="(item, index) in menus" :key="item.value" :index="index" @tap="clickMenu">
  27. <u-icon slot="icon" :size="item.size" :name="item.icon" color="#a8a8a8"></u-icon>
  28. <text slot="title" class="menuName">{{item.name}}</text>
  29. </u-cell-item>
  30. </u-cell-group>
  31. </view>
  32. <u-modal v-model="confirmwin.show" :content="confirmwin.content" :show-cancel-button="true" @confirm="confirmHandle"></u-modal>
  33. </view>
  34. </template>
  35. <script>
  36. import * as api from '@/apis/me.js'
  37. import app from '@/utils/app.js'
  38. export default {
  39. data() {
  40. return {
  41. myInfo:{},
  42. myParkSites:[],
  43. confirmwin:{
  44. show:false,
  45. content:'',
  46. code:''
  47. },
  48. menus:[
  49. {
  50. value: 'whiteBill',
  51. name: '会员管理',
  52. icon: 'order',
  53. size:36,
  54. url:'../whiteList/whiteList'
  55. },
  56. /* {
  57. value: 'alarmSet',
  58. name: '警报通知设置',
  59. icon: 'setting-fill',
  60. size:36
  61. },
  62. {
  63. value: 'sysMsg',
  64. name: '系统消息',
  65. icon: 'email-fill',
  66. size:36
  67. }, */
  68. {
  69. value: 'contact',
  70. name: '联系客服',
  71. icon: 'server-fill',
  72. size:36
  73. },
  74. {
  75. value: 'aboutUs',
  76. name: '关于我们',
  77. icon: 'server-man',
  78. size:36
  79. },
  80. {
  81. value: 'quit',
  82. name: '退出账号',
  83. icon: 'zhuanfa',
  84. size:36
  85. }
  86. ]
  87. }
  88. },
  89. onLoad(){
  90. this.myInfo=api.getMyInfo();
  91. if(!this.myInfo.head_photo){
  92. this.myInfo.head_photo="../../static/img/headphoto.png";
  93. }
  94. this.myParkSites=api.getMyParkSites();
  95. },
  96. methods: {
  97. openPage(evn){
  98. uni.navigateTo({
  99. url:'../parking/myparkings'
  100. })
  101. },
  102. clickMenu(index){
  103. if(this.menus[index].value=="quit"){
  104. this.confirmwin={show:true,content:'确定要退出吗?',code:'quit'};
  105. }
  106. else if(this.menus[index].url){
  107. uni.navigateTo({
  108. url:this.menus[index].url
  109. })
  110. }
  111. },
  112. confirmHandle(){
  113. if(this.confirmwin.code=='quit'){
  114. app.setSetting();
  115. uni.redirectTo({
  116. url:'../login/login2'
  117. });
  118. }
  119. }
  120. }
  121. }
  122. </script>
  123. <style>
  124. page{
  125. background-color: #f4f4f4;
  126. }
  127. .page-top{
  128. box-sizing: border-box;
  129. width:100vw;
  130. padding:80rpx 60rpx;
  131. position: absolute;
  132. display: flex;
  133. flex-flow: row nowrap;
  134. justify-content: flex-start;
  135. align-items: center;
  136. }
  137. .page-body{
  138. position: absolute;
  139. z-index: 10;
  140. top:200rpx;
  141. box-sizing: border-box;
  142. width:100vw;
  143. padding:30rpx;
  144. }
  145. .body-block{
  146. padding:30rpx;
  147. margin-bottom: 30rpx;
  148. border-radius: 10rpx;
  149. display: flex;
  150. flex-flow: row nowrap;
  151. justify-content: flex-start;
  152. align-items: center;
  153. background-color: #ffffff;
  154. }
  155. .body-block .block-item{
  156. text-align: center;
  157. }
  158. .body-block .block-item>view{
  159. font-size: 36rpx;
  160. color:#007AFF;
  161. }
  162. .body-block .block-item>text{
  163. font-size: 24rpx;
  164. color:#6f867d;
  165. margin-bottom:10rpx;
  166. }
  167. .menuName{
  168. font-size:26rpx;
  169. margin-left: 15rpx;
  170. }
  171. </style>