index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view>
  3. <u-navbar title-color="#fff" :custom-back="customBack" :border-bottom="false" back-icon-color="#CCE8FF" :background="{background: '#008CFF' }" title="我的"></u-navbar>
  4. <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
  5. <view class="u-m-r-24" @click="login($store.state.vuex_hasLogin)">
  6. <u-avatar :src="userInfo.headImgUrl || userInfo.avatar||pic" size="140"></u-avatar>
  7. </view>
  8. <view class="u-flex-1" @click="login($store.state.vuex_hasLogin)">
  9. <view class="u-font-18 u-p-b-20">{{ userInfo.nickname || userInfo.userName || '请登录' }}</view>
  10. <view class="u-font-14">手机号:{{ userInfo.mobile || '暂无' }}</view>
  11. </view>
  12. <!-- <view class="u-m-l-10 u-p-10">
  13. <u-icon name="arrow-right" color="#fff" size="28"></u-icon>
  14. </view> -->
  15. </view>
  16. <view class="u-m-t-20">
  17. <u-cell-group>
  18. <u-cell-item title="我的车辆" @click="openPage('pages/myCars/myCars')">
  19. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
  20. </u-cell-item>
  21. <u-cell-item title="停车记录" @click="openPage('pages/center/order/order')">
  22. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tingchejilu"></u-icon>
  23. </u-cell-item>
  24. </u-cell-group>
  25. </view>
  26. <view class="u-m-t-20">
  27. <u-cell-group>
  28. <u-cell-item title="充值" @click="openPage('pages/myCars/myCars')">
  29. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="chongzhi"></u-icon>
  30. </u-cell-item>
  31. <u-cell-item title="包月" @click="openPage('pages/center/order/order')">
  32. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="baoyue"></u-icon>
  33. </u-cell-item>
  34. <u-cell-item title="提现" @click="openPage('pages/center/order/order')">
  35. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tixian"></u-icon>
  36. </u-cell-item>
  37. <u-cell-item title="退款" @click="openPage('pages/center/order/order')">
  38. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="tk"></u-icon>
  39. </u-cell-item>
  40. <u-cell-item title="账单记录" @click="openPage('pages/center/order/order')">
  41. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="zhangdanjilu"></u-icon>
  42. </u-cell-item>
  43. </u-cell-group>
  44. </view>
  45. <view class="u-m-t-20">
  46. <u-cell-group>
  47. <u-cell-item title="我的优惠" @click="openPage('pages/myCars/myCars')">
  48. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodeyouhui"></u-icon>
  49. </u-cell-item>
  50. </u-cell-group>
  51. </view>
  52. <view class="u-m-t-20">
  53. <u-cell-group>
  54. <u-cell-item title="发票管理" @click="openPage('pages/center/invoice/invoice')">
  55. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="fapiaoguanli"></u-icon>
  56. </u-cell-item>
  57. </u-cell-group>
  58. </view>
  59. <view class="u-m-t-20 u-m-b-40">
  60. <u-cell-group>
  61. <u-cell-item title="拨打客服电话" @click="phoneCall(phoneNo)">
  62. <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="dianhua"></u-icon>
  63. </u-cell-item>
  64. </u-cell-group>
  65. </view>
  66. <!-- <view class="u-m-t-20">
  67. <u-cell-group>
  68. <u-cell-item icon="phone" title="手机号登录" @click="openPage('/pages/center/phoneLogin/phoneLogin')"></u-cell-item>
  69. </u-cell-group>
  70. </view> -->
  71. <u-toast ref="uToast" />
  72. </view>
  73. </template>
  74. <script>
  75. import getUrlParams from "../../utils/getUrlParams.js";
  76. export default {
  77. data() {
  78. return {
  79. pic:'/static/img/default-avatar.png',
  80. userInfo:[],
  81. code:null,
  82. phoneNo:'114',
  83. }
  84. },
  85. onLoad() {
  86. },
  87. onShow() {
  88. if(this.$store.state.vuex_hasLogin){
  89. this.userInfo = this.$store.state.vuex_user;
  90. if(this.$store.state.vuex_wxinfo){
  91. this.userInfo = Object.assign(this.userInfo,this.$store.state.vuex_wxinfo);
  92. }
  93. }else{
  94. this.userInfo = [];
  95. };
  96. let locationLocaturl = window.location.search;
  97. this.code = getUrlParams(locationLocaturl,"code");
  98. if(this.code&&!this.$store.state.vuex_wxinfo.openId){this.handleGetWXInfo(this.code)};
  99. },
  100. methods: {
  101. openPage(path) {
  102. console.log('path',path);
  103. this.$u.route({
  104. url: path
  105. })
  106. },
  107. //登录判断
  108. login(status){
  109. console.log('this.$store.state.vuex_hasLogin',this.$store.state.vuex_hasLogin);
  110. if(!status){
  111. console.log('config',this.config);
  112. this.$u.route({
  113. url: 'pages/center/phoneLogin/phoneLogin'
  114. });
  115. }
  116. },
  117. customBack(){
  118. this.$u.route({
  119. type:'switchTab',
  120. url: 'pages/index/index'
  121. });
  122. },
  123. phoneCall(phone){
  124. uni.makePhoneCall({
  125. phoneNumber: phone
  126. });
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. page{background-color: $my-page-bg-color;}
  133. .user-box{
  134. position: relative;
  135. background-color: $my-main-color;
  136. color: #fff;
  137. &:after{
  138. position: absolute;
  139. right: 0;
  140. bottom: 0;
  141. content: '';
  142. background: url(../../static/img/center-top-bg.png) no-repeat;
  143. background-position: -90rpx 0;
  144. width: 305rpx;
  145. height: 145rpx;
  146. z-index: 999;
  147. }
  148. }
  149. .u-avatar{border: 10rpx solid #4CAEFF;}
  150. .u-cell-box /deep/ .u-cell__left-icon-wrap,
  151. .u-cell-box /deep/ .custom-icon
  152. {color: $my-main-color;margin-right: 10rpx;}
  153. </style>