me.vue 4.0 KB

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