Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

user.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <template>
  2. <navBar title="九州ETC" :scrollTop="scrollTop" :isBack="isBack"></navBar>
  3. <filter>
  4. <view class="wrapper">
  5. <image :src="`${$imgUrl}user/bg-user-2.png`" class="bg-head" mode="widthFix"></image>
  6. <!-- <view class="bar" :style="{ top: top, height: height, lineHeight: height }">我的-九州ETC</view> -->
  7. <view class="content" :style="{ top: margin + 'px' }">
  8. <view class="head" :style="{ marinTop: margin + 'px' }">
  9. <view class="avatar">
  10. <image :src="`${$imgUrl}user/icon-avatar.png`" :class="!state.data.opId ? 'unlogin' : ''"></image>
  11. <view v-if="!state.data.opId" class="name" @click="$util.navTo('/login/login')">
  12. <view class="nickname">登录/注册</view>
  13. </view>
  14. <view v-else class="name">
  15. <view class="nickname">{{state.accountInfoVo.nickName}}</view>
  16. <view class="user-id">
  17. <view class="phone">{{state.accountInfoVo.mobile}}</view>
  18. <view @click="$util.navTo('/subpackage/personal-center/setting/change-phone', true)"
  19. class="btn-change">已关联</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="setting" @click="$util.navTo('/subpackage/personal-center/setting/setting', true)">
  24. <!-- <image :src="`${$imgUrl}user/icon-setting.png`"></image> -->
  25. <text>签到</text>
  26. </view>
  27. </view>
  28. <view class="panel-box">
  29. <view class="panel">
  30. <view class="panel-item">
  31. <view class="panel-text"><text class="num">2</text><text class="txt">辆</text></view>
  32. <text class="type">车辆</text>
  33. </view>
  34. <view class="panel-item">
  35. <text class="num">5</text>
  36. <text class="type">待办</text>
  37. </view>
  38. <view class="panel-item">
  39. <view class="panel-text"><text class="num">2</text><text class="txt">张</text></view>
  40. <text class="type">卡券</text>
  41. </view>
  42. <view class="panel-item">
  43. <view class="panel-text"><text class="num">2555</text><text class="txt">分</text></view>
  44. <text class="type">积分</text>
  45. </view>
  46. </view>
  47. <view class="notice">
  48. <image :src="`${$imgUrl}user/icon-tips.png`" class="icon-notice"></image>
  49. <view class="notice-content">您有一笔成功交易,点击查看详情</view>
  50. </view>
  51. </view>
  52. <view class="rights box">
  53. <view class="right-head">
  54. <view class="tit">我的权益</view>
  55. <view class="more">
  56. <text class="more-text">查看全部</text>
  57. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  58. </view>
  59. </view>
  60. <view class="rights-items">
  61. <view class="item">
  62. <image :src="`${$imgUrl}user/icon-car-2.png`" class="icon"></image>
  63. <text class="tit">我的通行</text>
  64. <text class="sub-tit">查询账单、轨迹</text>
  65. </view>
  66. <view class="item">
  67. <image :src="`${$imgUrl}user/icon-door.png`" class="icon"></image>
  68. <text class="tit">上门服务</text>
  69. <text class="sub-tit">8折优惠</text>
  70. </view>
  71. <view class="item">
  72. <image :src="`${$imgUrl}user/icon-obu.png`" class="icon"></image>
  73. <text class="tit">设备险</text>
  74. <text class="sub-tit">享50元更换</text>
  75. </view>
  76. <view class="item">
  77. <image :src="`${$imgUrl}user/icon-bao.png`" class="icon"></image>
  78. <text class="tit">微保驾乘险</text>
  79. <text class="sub-tit">最高享20万</text>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="order box">
  84. <view class="right-head">
  85. <view class="tit">我的订单</view>
  86. <view class="more">
  87. <text class="more-text">查看全部</text>
  88. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  89. </view>
  90. </view>
  91. <view class="order-items">
  92. <view class="item">
  93. <image :src="`${$imgUrl}user/icon-daifahuo.png`" class="icon"></image>
  94. <text class="tit">待发货</text>
  95. </view>
  96. <view class="item">
  97. <image :src="`${$imgUrl}user/icon-daishouhuo.png`" class="icon"></image>
  98. <text class="tit">待收货</text>
  99. </view>
  100. <view class="item">
  101. <image :src="`${$imgUrl}user/icon-daijihuo.png`" class="icon"></image>
  102. <text class="tit">待激活</text>
  103. </view>
  104. <view class="item">
  105. <image :src="`${$imgUrl}user/icon-tuihuanhuo.png`" class="icon"></image>
  106. <text class="tit">退换货/退款</text>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="go-through box">
  111. <view class="right-head">
  112. <view class="tit">本月通行</view>
  113. </view>
  114. <view class="pass">
  115. <view class="total m-top">
  116. <text>通行消费</text>
  117. <text>总消费</text>
  118. </view>
  119. <view class="amount m-top">
  120. <text>¥ {{state.monthFlowingVo.money/100}}</text>
  121. <text>¥ {{state.monthFlowingVo.totalAmount/100}}</text>
  122. </view>
  123. <view class="line m-top">
  124. <view class="line1" :style="{width: state.monthFlowingVo.money*100/state.monthFlowingVo.totalAmount+'%'}"></view>
  125. <view class="line2"></view>
  126. </view>
  127. <view class="mileage">
  128. <view class="txt">
  129. <text class="tit">通行里程</text>
  130. <text class="val">{{state.monthFlowingVo.mileage}}km</text>
  131. </view>
  132. <view class="txt">
  133. <text class="tit">通行时长</text>
  134. <text class="val">{{state.monthFlowingVo.duration}}</text>
  135. </view>
  136. <view class="txt">
  137. <text class="tit ">通行次数</text>
  138. <text class="val">{{state.monthFlowingVo.num}}次</text>
  139. </view>
  140. </view>
  141. <view class="detail">查看通行轨迹</view>
  142. </view>
  143. </view>
  144. <view class="cars box">
  145. <view class="right-head">
  146. <view class="tit">我的车辆</view>
  147. <view class="more">
  148. <text class="more-text">查看全部</text>
  149. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  150. </view>
  151. </view>
  152. <view class="car-item">
  153. <image :src="`${$imgUrl}user/icon-car.png`" class="car-pic"></image>
  154. <view class="car-info">
  155. <view class="car-no"><text class="no">贵ZSC122</text><text class="color">蓝色</text></view>
  156. <view class="card-no">卡号:52011328220202006876</view>
  157. <view class="card-no">签号:5202192509222195</view>
  158. </view>
  159. <view class="btn-unbind">解除绑定</view>
  160. </view>
  161. <view class="sub-bind">
  162. <view class="item-tit">
  163. <image :src="`${$imgUrl}user/icon-car-3.png`" class="icon icon-2"></image>
  164. <text>我要关联车辆</text>
  165. </view>
  166. <view class="right-arrow">
  167. <view class="sub-tit">增加未关联车辆</view>
  168. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  169. </view>
  170. </view>
  171. </view>
  172. <view class="menu">
  173. <view class="item" @click="$util.navTo('/subpackage/personal-center/setting/setting', true)">
  174. <view class="item-tit">
  175. <image :src="`${$imgUrl}user/icon-setting.png`" class="icon icon-2"></image>
  176. <text>设置与资料管理</text>
  177. </view>
  178. <view class="right-arrow">
  179. <view class="sub-tit">隐私、密码管理</view>
  180. <image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. </view>
  186. </filter>
  187. </template>
  188. <script lang="ts" setup>
  189. import { reactive } from "vue";
  190. import { msg, navTo } from "@/utils/utils";
  191. import { onMounted, ref } from "vue";
  192. import { getItem, StorageKeys } from "@/utils/storage";
  193. import navBar from "../../components/nav-bar/nav-bar2.vue";
  194. import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
  195. import {
  196. userInfoIndex
  197. } from "@/utils/network/api.js";
  198. import {
  199. request
  200. } from "@/utils/network/request.js";
  201. import {
  202. stringToJson
  203. } from "@/utils/network/encryption.js";
  204. import filter from '@/components/filter/filter.vue';
  205. const height = ref(null);
  206. const top = ref(null);
  207. const margin = ref(null);
  208. const mobile = ref(null);
  209. const scrollTop = ref(0);
  210. const isBack = ref(false);
  211. const state = reactive({
  212. data: {
  213. opId: "",
  214. },
  215. accountInfoVo: {
  216. nickName: '',
  217. mobile: ''
  218. },
  219. monthFlowingVo: {
  220. duration: "",
  221. mileage: 0,
  222. money: 0,
  223. num: 0,
  224. parkingLotMoney: 0,
  225. parkingLotNum: 0,
  226. totalAmount: 0,
  227. },
  228. vehicleManageList: [],
  229. });
  230. onMounted(() => {
  231. const res = uni.getMenuButtonBoundingClientRect();
  232. height.value = res.height + "px";
  233. top.value = res.top + "px";
  234. margin.value = res.height + res.top;
  235. });
  236. onLoad((option : any) => {
  237. state.data.opId = getItem(StorageKeys.OpenId);
  238. mobile.value = getItem("mobile");
  239. });
  240. //监听页面滚动
  241. onPageScroll((e) => {
  242. scrollTop.value = e.scrollTop;
  243. });
  244. onShow((option : any) => {
  245. state.data.opId = getItem(StorageKeys.OpenId);
  246. if(state.data.opId){
  247. getUserInfo()
  248. }
  249. });
  250. const getUserInfo = () => {
  251. const options = {
  252. type: 2,
  253. data: {
  254. openId: state.data.opId
  255. },
  256. method: "POST",
  257. // showLoading: true,
  258. };
  259. //调用方式
  260. request(userInfoIndex, options)
  261. .then((res) => {
  262. let data = stringToJson(res.bizContent)
  263. console.log(data);
  264. state.accountInfoVo = data.accountInfoVo;
  265. state.monthFlowingVo = data.monthFlowingVo;
  266. state.vehicleManageList = data.monthFlowingVo
  267. })
  268. .catch((err) => {
  269. console.log(err);
  270. });
  271. }
  272. </script>
  273. <style>
  274. page {
  275. background: #eef7f7;
  276. }
  277. </style>
  278. <style scoped>
  279. .unlogin {
  280. filter: grayscale(100%);
  281. opacity: 0.7;
  282. }
  283. .wrapper {
  284. position: relative;
  285. background: #fff;
  286. }
  287. .bar {
  288. width: 100%;
  289. position: fixed;
  290. text-align: center;
  291. font-size: 32rpx;
  292. font-weight: bold;
  293. }
  294. .bg-head {
  295. width: 100%;
  296. position: absolute;
  297. z-index: -99;
  298. top: 0;
  299. left: 0;
  300. }
  301. .content {
  302. position: absolute;
  303. display: flex;
  304. flex-direction: column;
  305. width: 100%;
  306. }
  307. .head {
  308. display: flex;
  309. justify-content: space-between;
  310. align-items: center;
  311. width: 100%;
  312. box-sizing: border-box;
  313. padding: 40rpx 0 46rpx;
  314. }
  315. .head .avatar {
  316. display: flex;
  317. align-items: center;
  318. }
  319. .head .avatar image {
  320. width: 120rpx;
  321. height: 120rpx;
  322. border-radius: 80rpx;
  323. border: 12rpx solid rgba(255, 255, 255, 0.5);
  324. margin: 0 20rpx 0 30rpx;
  325. }
  326. .head .setting {
  327. display: flex;
  328. align-items: center;
  329. background: rgba(0, 179, 139, .1);
  330. border: 1px solid #fff;
  331. height: 60rpx;
  332. border-radius: 30rpx;
  333. padding: 0 34rpx;
  334. color: #fff;
  335. font-size: 28rpx;
  336. margin-right: 30rpx;
  337. }
  338. .head .setting image {
  339. width: 40rpx;
  340. height: 40rpx;
  341. margin-right: 6rpx;
  342. }
  343. .head .nickname {
  344. font-size: 36rpx;
  345. color: #000000;
  346. }
  347. .head .user-id {
  348. font-size: 26rpx;
  349. color: #000000;
  350. padding-top: 30rpx;
  351. display: flex;
  352. align-items: center;
  353. }
  354. .head .btn-change {
  355. font-size: 22rpx;
  356. height: 40rpx;
  357. padding: 0 20rpx;
  358. border: 1px solid #fff;
  359. color: #fff;
  360. box-sizing: border-box;
  361. border-radius: 20rpx;
  362. margin-left: 16rpx;
  363. background: rgba(0, 179, 139, .1);
  364. }
  365. .panel-box {
  366. display: flex;
  367. flex-direction: column;
  368. background: #fff;
  369. margin: 0 30rpx 30rpx;
  370. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  371. border-radius: 20rpx;
  372. padding: 30rpx 0;
  373. }
  374. .panel {
  375. display: flex;
  376. justify-content: space-evenly;
  377. padding: 30rpx 0;
  378. }
  379. .panel-item {
  380. display: flex;
  381. flex-direction: column;
  382. justify-content: center;
  383. align-items: center;
  384. font-size: 32rpx;
  385. }
  386. .panel-item .num {
  387. font-weight: bold;
  388. color: #454545;
  389. }
  390. .panel-item .txt {
  391. font-size: 26rpx;
  392. }
  393. .panel-item .type {
  394. color: #999;
  395. font-size: 26rpx;
  396. padding: 14rpx 0;
  397. }
  398. .panel-box .icon-notice {
  399. width: 48rpx;
  400. height: 48rpx;
  401. }
  402. .panel-box .notice {
  403. display: flex;
  404. font-size: 32rpx;
  405. margin: 0 30rpx;
  406. align-items: center;
  407. background: #f3f3f3;
  408. border-radius: 10rpx;
  409. padding: 0 14rpx;
  410. }
  411. .panel-box .notice .notice-content {
  412. height: 68rpx;
  413. line-height: 68rpx;
  414. padding: 0 12rpx;
  415. font-size: 28rpx;
  416. }
  417. .box .arrow {
  418. width: 14rpx;
  419. height: 26rpx;
  420. }
  421. .box {
  422. background: #ffffff;
  423. margin: 0 30rpx 30rpx;
  424. padding: 30rpx;
  425. border-radius: 20rpx;
  426. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  427. }
  428. .box .more {
  429. display: flex;
  430. font-size: 26rpx;
  431. color: #808080;
  432. align-items: center;
  433. }
  434. .box .more .more-text {
  435. padding-right: 12rpx;
  436. }
  437. .box .right-head {
  438. display: flex;
  439. justify-content: space-between;
  440. }
  441. .box .right-head .tit {
  442. font-size: 32rpx;
  443. /* font-weight: bold; */
  444. }
  445. .rights .rights-items {
  446. display: flex;
  447. justify-content: space-evenly;
  448. padding: 30rpx 0;
  449. }
  450. .rights .item {
  451. display: flex;
  452. flex-direction: column;
  453. align-items: center;
  454. justify-content: center;
  455. }
  456. .rights .item .tit {
  457. font-size: 26rpx;
  458. color: #333;
  459. padding: 20rpx 0 10rpx 0;
  460. }
  461. .rights .item .sub-tit {
  462. font-size: 22rpx;
  463. color: #999;
  464. }
  465. .order .order-items {
  466. display: flex;
  467. justify-content: space-evenly;
  468. padding: 30rpx 0;
  469. }
  470. .order .item {
  471. display: flex;
  472. flex-direction: column;
  473. align-items: center;
  474. justify-content: center;
  475. }
  476. .order .item .tit {
  477. font-size: 26rpx;
  478. color: #333;
  479. padding: 20rpx 0 10rpx 0;
  480. }
  481. .box .icon {
  482. width: 56rpx;
  483. height: 56rpx;
  484. }
  485. .go-through .pass {
  486. display: flex;
  487. flex-direction: column;
  488. }
  489. .go-through .total {
  490. display: flex;
  491. justify-content: space-between;
  492. font-size: 26rpx;
  493. color: #999;
  494. }
  495. .go-through .amount {
  496. display: flex;
  497. justify-content: space-between;
  498. align-items: center;
  499. font-size: 28rpx;
  500. color: #333;
  501. }
  502. .go-through .line {
  503. display: flex;
  504. }
  505. .go-through .line1 {
  506. height: 8rpx;
  507. background: #00B38B;
  508. border-radius: 4rpx;
  509. }
  510. .go-through .line2 {
  511. height: 8rpx;
  512. background: #F1F1F1;
  513. border-radius: 0 4rpx 4rpx 0;
  514. flex: 1;
  515. }
  516. .go-through .mileage {
  517. display: flex;
  518. justify-content: space-evenly;
  519. align-items: center;
  520. text-align: center;
  521. margin: 32rpx 0;
  522. }
  523. .go-through .mileage .txt {
  524. display: flex;
  525. flex-direction: column;
  526. }
  527. .go-through .mileage .tit {
  528. font-size: 26rpx;
  529. color: #999;
  530. }
  531. .go-through .mileage .val {
  532. font-size: 28rpx;
  533. color: #333;
  534. margin-top: 16rpx;
  535. }
  536. .go-through .m-top {
  537. margin-top: 16rpx;
  538. }
  539. .go-through .detail {
  540. width: 100%;
  541. text-align: center;
  542. color: #00B38B;
  543. font-size: 24rpx;
  544. border-top: 1px solid #DCDCDC;
  545. padding-top: 24rpx;
  546. }
  547. .cars .car-item {
  548. display: flex;
  549. align-items: center;
  550. padding: 36rpx 0;
  551. }
  552. .cars .car-item .btn-unbind {
  553. border: 1px solid #00B38B;
  554. border-radius: 30rpx;
  555. height: 60rpx;
  556. box-sizing: border-box;
  557. line-height: 60rpx;
  558. font-size: 24rpx;
  559. padding: 0 20rpx;
  560. background: rgba(0, 179, 139, .1);
  561. color: #00B38B;
  562. }
  563. .cars .car-pic {
  564. width: 120rpx;
  565. height: 120rpx;
  566. margin-right: 12rpx;
  567. }
  568. .cars .car-info {
  569. display: flex;
  570. flex-direction: column;
  571. flex: 1;
  572. color: #999;
  573. font-size: 22rpx;
  574. }
  575. .cars .car-no {
  576. font-size: 30rpx;
  577. color: #333;
  578. }
  579. .cars .card-no {
  580. margin-top: 14rpx;
  581. }
  582. .cars .sub-bind {
  583. display: flex;
  584. align-items: center;
  585. justify-content: space-between;
  586. border-top: 1px solid #F1F1F1;
  587. padding-top: 20rpx;
  588. }
  589. .cars .sub-bind .item-tit {
  590. display: flex;
  591. align-items: center;
  592. font-size: 26rpx;
  593. color: #333;
  594. }
  595. .cars .sub-bind .right-arrow {
  596. font-size: 22rpx;
  597. color: #ccc;
  598. display: flex;
  599. justify-content: center;
  600. align-items: center;
  601. }
  602. .cars .sub-bind .sub-tit {
  603. padding-right: 20rpx;
  604. }
  605. .menu {
  606. background: #ffffff;
  607. /* border-radius: 30rpx 30rpx 0 0; */
  608. padding: 0 30rpx;
  609. margin: 0 30rpx 30rpx;
  610. border-radius: 20rpx;
  611. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  612. }
  613. .menu .arrow {
  614. width: 14rpx;
  615. height: 26rpx;
  616. }
  617. .menu .icon {
  618. width: 48rpx;
  619. height: 48rpx;
  620. margin-right: 10rpx;
  621. }
  622. .menu .item {
  623. display: flex;
  624. justify-content: space-between;
  625. align-items: center;
  626. /* border-bottom: 1px solid #dcdcdc; */
  627. padding: 20rpx 0;
  628. }
  629. .menu .item:first-child {
  630. margin-top: 10rpx;
  631. }
  632. .menu .item-tit {
  633. display: flex;
  634. align-items: center;
  635. font-size: 26rpx;
  636. color: #333;
  637. }
  638. .menu .right-arrow {
  639. font-size: 22rpx;
  640. color: #ccc;
  641. display: flex;
  642. justify-content: center;
  643. align-items: center;
  644. }
  645. .menu .sub-tit {
  646. padding-right: 20rpx;
  647. }
  648. </style>