Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

trajectory.vue 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="content">
  3. <view class="des">请查收您的通行记忆,让每段行程都有意义。</view>
  4. <view class="choice-content">
  5. <view class="choice-car">
  6. <picker @change="bindPickerChange" :value="state.index" :range="state.array">
  7. <view class="uni-input">{{state.array[state.index]}}</view>
  8. </picker>
  9. </view>
  10. <view class="content-det">
  11. <view class="left">
  12. <view class="left-item">
  13. <image :src="`${$imgUrl}user/trajectory1.png`"></image>
  14. <view>
  15. <view class="data">{{state.msg.mileages}}km</view>
  16. <view>高速通行总里程</view>
  17. </view>
  18. </view>
  19. <view class="left-item">
  20. <image :src="`${$imgUrl}user/trajectory2.png`"></image>
  21. <view>
  22. <view class="data">{{state.msg.amounts/100}}元</view>
  23. <view>高速通行总金额</view>
  24. </view>
  25. </view>
  26. <view class="left-item">
  27. <image :src="`${$imgUrl}user/trajectory3.png`"></image>
  28. <view>
  29. <view class="data">{{state.msg.frequencys}}次</view>
  30. <view>高速通行总消费次数</view>
  31. </view>
  32. </view>
  33. <view class="left-item">
  34. <image :src="`${$imgUrl}user/trajectory4.png`"></image>
  35. <view>
  36. <view class="data">{{state.msg.cityQuantitys}}个</view>
  37. <view>高速通行曾抵达过的城市教</view>
  38. </view>
  39. </view>
  40. <view class="left-item" style="margin-bottom: 30rpx;">
  41. <image :src="`${$imgUrl}user/trajectory5.png`"></image>
  42. <view>
  43. <view class="data">{{state.msg.frequenteds}}</view>
  44. <view>您最喜爱的目的地,曾累计到访过{{state.msg.frequentedQuantitys}}次</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="right">
  49. <view>您超过了{{state.msg.ranking}}%的九州ETC用户</view>
  50. <image :src="`${$imgUrl}user/trajectory6.png`" mode=""></image>
  51. <view class="see" @click="see()">查看我的轨迹图</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="record" v-for="item in [state.msg.myTrajectoryStatisticsVos][0]">
  56. <view class="current">
  57. <text>{{item.accountDate}}月通行</text>
  58. <view class="more" @click="seeMonth()">查看历史月度统计 <image src="../../../static/image/icon-back.png">
  59. </image>
  60. </view>
  61. </view>
  62. <view class="detail">本月九州ETC通行了{{item.frequency}}次高速通行查看历史月度统计要消费{{item.amount/100}}元要通行</view>
  63. </view>
  64. </view>
  65. </template>
  66. <script setup lang="ts">
  67. import { reactive } from "vue";
  68. import { request } from "@/utils/network/request.js";
  69. import { stringToJson } from "@/utils/network/encryption";
  70. import { onLoad } from "@dcloudio/uni-app";
  71. import { orderList, queryTrajectory, selectCarInfo } from "@/utils/network/api.js";
  72. import { getItem, StorageKeys } from "@/utils/storage";
  73. const state = reactive({
  74. array: [],
  75. index: 0,
  76. arrayVehicleId: [], //要传给后端的vehicleId
  77. msg: '',
  78. })
  79. onLoad((option : any) => {
  80. quanCheckActionTrue();
  81. })
  82. const quanCheckActionTrue = () => {
  83. const options = {
  84. type: 2,
  85. data: {
  86. "openId": getItem('openId')
  87. },
  88. method: "POST",
  89. showLoading: true,
  90. };
  91. //调用方式
  92. request(selectCarInfo, options).then((res) => {
  93. const data = (stringToJson(res.bizContent).vehicleManages)
  94. for (var i = 0; i < data.length; i++) {
  95. state.array.push(data[i].vehiclePlate)
  96. state.arrayVehicleId.push(data[i].vehicleId)
  97. }
  98. getVehicleMsg();
  99. })
  100. .catch((err) => {
  101. console.log('输出内容', err)
  102. });
  103. }
  104. const bindPickerChange = (e) => {
  105. state.index = e.detail.value;
  106. getVehicleMsg();
  107. }
  108. const see = () => {
  109. // const aa="41,51"
  110. uni.navigateTo({
  111. url: `/subpackage/service/trajectory-map?data=${state.msg.provinces}&&mileages=${state.msg.mileages}&&ranking=${state.msg.ranking}`
  112. })
  113. }
  114. const seeMonth = () => {
  115. uni.navigateTo({
  116. url: `./see-month?data=${encodeURIComponent(JSON.stringify(state.msg.myTrajectoryStatisticsVos))}`
  117. })
  118. }
  119. const getVehicleMsg = () => {
  120. console.log("state.arrayVehicleId[state.index]", state.arrayVehicleId[state.index])
  121. const options = {
  122. type: 2,
  123. data: {
  124. vehicleId: state.arrayVehicleId[state.index],
  125. },
  126. method: "POST",
  127. showLoading: true,
  128. };
  129. request(queryTrajectory, options).then((res) => {
  130. const result = stringToJson(res.bizContent)
  131. state.msg = result
  132. console.log("getVehicleMsg", result);
  133. })
  134. };
  135. </script>
  136. <style scoped>
  137. .content {
  138. font-size: 32rpx;
  139. }
  140. .des {
  141. margin: 20rpx 0 20rpx 40rpx;
  142. }
  143. .choice-content {
  144. width: 90%;
  145. margin: 0 auto;
  146. min-height: 500rpx;
  147. box-shadow: 0px 0px 8px 2px rgb(218, 247, 247) inset;
  148. overflow: hidden;
  149. }
  150. .choice-car {
  151. width: 180rpx;
  152. background-color: #f1f1f1;
  153. margin-top: 30rpx;
  154. padding: 10rpx;
  155. }
  156. .left-item {
  157. display: flex;
  158. margin-bottom: 50rpx;
  159. }
  160. .left-item>image {
  161. width: 70rpx;
  162. height: 70rpx;
  163. display: inline-block;
  164. margin-right: 30rpx;
  165. flex-shrink: 0;
  166. }
  167. .data {
  168. font-weight: bold;
  169. }
  170. .content-det {
  171. padding: 30rpx;
  172. box-sizing: border-box;
  173. display: flex;
  174. }
  175. .right>image {
  176. width: 120rpx;
  177. height: 120rpx;
  178. display: inline-block;
  179. margin: 30rpx auto;
  180. margin-left: 40rpx;
  181. }
  182. .see {
  183. background-color: #f1f1f1;
  184. border-radius: 20rpx;
  185. text-align: center;
  186. height: 54rpx;
  187. line-height: 54rpx;
  188. font-size: 28rpx;
  189. }
  190. .left {
  191. flex: 2;
  192. }
  193. .right {
  194. flex: 1;
  195. }
  196. .record {
  197. width: 90%;
  198. min-height: 220rpx;
  199. box-shadow: 0px 0px 8px 2px rgb(218, 247, 247) inset;
  200. margin: 20rpx auto;
  201. padding: 30rpx;
  202. box-sizing: border-box;
  203. }
  204. .current {
  205. border-bottom: 1rpx solid #ccc;
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. padding-bottom: 20rpx;
  210. }
  211. .more>image {
  212. transform: rotate(180deg);
  213. width: 30rpx;
  214. height: 30rpx;
  215. vertical-align: middle;
  216. }
  217. .detail {
  218. margin-top: 20rpx;
  219. line-height: 40rpx;
  220. }
  221. </style>