index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view>
  3. <top-box></top-box>
  4. <view class="ucenter">
  5. <view class="mydata">我的数据(累计)</view>
  6. <view class="data-box">
  7. <view class="datashow">
  8. <view class="icon"><image src="../../static/ucenter/icon3.png"></image></view>
  9. <view class="num">87</view>
  10. <view>换电次数<text>/次</text></view>
  11. </view>
  12. <view class="datashow">
  13. <view class="icon"><image src="../../static/ucenter/icon4.png"></image></view>
  14. <view class="num">10809.87</view>
  15. <view class="unit">换电量<text>/(kW/h)</text></view>
  16. </view>
  17. <view class="datashow">
  18. <view class="icon"><image src="../../static/ucenter/icon5.png"></image></view>
  19. <view class="num">10800.23</view>
  20. <view class="unit">预估费用<text>/元</text></view>
  21. </view>
  22. </view>
  23. <view class="common">
  24. <view class="title">常用功能</view>
  25. <view class="list" @click="getqrcode">
  26. <view><image src="../../static/ucenter/icon6.png"></image></view>
  27. <view>下载换电二维码</view>
  28. <view>></view>
  29. </view>
  30. <view class="list" @click="toCar">
  31. <view><image src="../../static/ucenter/icon7.png"></image></view>
  32. <view>我的车辆</view>
  33. <view>></view>
  34. </view>
  35. <view class="list" @click="toRecord">
  36. <view><image src="../../static/ucenter/icon8.png"></image></view>
  37. <view>换电记录</view>
  38. <view>></view>
  39. </view>
  40. <view class="list" @click="contact">
  41. <view><image src="../../static/ucenter/icon9.png"></image></view>
  42. <view>联系客服</view>
  43. <view>></view>
  44. </view>
  45. </view>
  46. </view>
  47. <uni-popup ref="popup" background-color="#fff" type="bottom">
  48. <view class="popuplist">
  49. <view><image src="../../static/code.jpg"></image></view>
  50. <view><text>车牌:</text> 渝AUU998</view>
  51. <view><text>车辆识别码:</text> LSPR********8273</view>
  52. <view>保存至相册</view>
  53. </view>
  54. </uni-popup>
  55. <tab-bar></tab-bar>
  56. <getmobile v-if="isAuthShow"></getmobile>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. qrcode:'../../static/code.jpg',
  64. isAuthShow:false,
  65. }
  66. },
  67. onShow() {
  68. this.$store.dispatch("usersToken").then(()=>{
  69. this.isAuthShow = false;
  70. // this.token=this.$store.getters.getToken
  71. // this.userinfo=this.$store.getters.getUser
  72. }).catch(()=>{
  73. this.isAuthShow = true;
  74. });
  75. },
  76. methods: {
  77. //更新头部信息
  78. // updatetopinfo(data){
  79. // if(this.$store.getters.getToken && this.$store.getters.getUser){
  80. // this.token=data.token
  81. // this.userinfo=data
  82. // }
  83. // },
  84. //联系电话
  85. contact(){
  86. uni.showActionSheet({
  87. itemList: ['呼叫:136-1111-9884'],
  88. success: function (res) {
  89. if(!res.tapIndex){
  90. uni.makePhoneCall({
  91. phoneNumber:'136-1111-9884',
  92. })
  93. }
  94. },
  95. });
  96. },
  97. //保存二维码到相册
  98. getqrcode(){
  99. this.$refs.popup.open('bottom')
  100. },
  101. toCar(){
  102. uni.navigateTo({
  103. url:'../ucenter/car'
  104. })
  105. },
  106. toRecord(){
  107. uni.navigateTo({
  108. url:'../ucenter/record'
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .popuplist{
  116. display: flex;
  117. flex-direction: column;
  118. text-align: center;
  119. image{
  120. width: 347rpx;
  121. height: 347rpx;
  122. margin-top: 20rpx;
  123. }
  124. text{
  125. color: #888e9c;
  126. }
  127. view{
  128. margin-top: 15rpx;
  129. }
  130. view:last-child{
  131. padding: 25rpx 0;
  132. border-top: 10rpx solid rgba(149, 150, 151, 0.5);
  133. }
  134. }
  135. .ucenter{
  136. padding: 0 30rpx;
  137. .mydata{
  138. color: #1d2129;
  139. font-size: 32rpx;
  140. font-weight: bold;
  141. margin: 40rpx 0;
  142. text-indent:10rpx;
  143. }
  144. .data-box{
  145. display: flex;
  146. justify-content: space-between;
  147. background-color: #fff;
  148. padding: 25rpx;
  149. box-sizing: border-box;
  150. border-radius: 30rpx;
  151. .icon{
  152. height: 100rpx;
  153. }
  154. .num{
  155. color: #1d2129;
  156. font-weight: bold;
  157. font-size: 32rpx;
  158. height: 50rpx;
  159. }
  160. .unit{
  161. color: #666666;
  162. font-size: 30rpx;
  163. }
  164. image{
  165. width: 80rpx;
  166. height: 80rpx;
  167. }
  168. text{
  169. color: #86909c;
  170. font-size: 28rpx;
  171. }
  172. }
  173. .common{
  174. display: flex;
  175. margin-top: 20rpx;
  176. background-color: #fff;
  177. padding: 25rpx 35rpx;
  178. box-sizing: border-box;
  179. border-radius: 30rpx;
  180. flex-direction: column;
  181. height: 518rpx;
  182. justify-content:space-between;
  183. .title{
  184. color: #1d2129;
  185. font-size: 32rpx;
  186. font-weight: bold;
  187. }
  188. .list{
  189. display: flex;
  190. image{
  191. width: 36rpx;
  192. height: 36rpx;
  193. }
  194. view:first-child{
  195. width: 56rpx;
  196. padding-top: 5rpx;
  197. }
  198. view:nth-child(2){
  199. color: #1d2129;
  200. font-size: 30rpx;
  201. font-weight: 500;
  202. width: 558rpx;
  203. }
  204. view:last-child{
  205. color: #959ea8;
  206. font-weight: bold;
  207. font-size: 32rpx;
  208. }
  209. }
  210. }
  211. }
  212. </style>