You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.vue 16KB

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