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.

select-car.vue 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i">
  4. <view class="iten-left">
  5. <image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
  6. <view class="message">
  7. <view>车牌号:{{ item.vehiclePlate }}</view>
  8. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  9. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  10. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatusCode)}}</view>
  11. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  12. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatusCode) }}</view>
  13. </view>
  14. </view>
  15. <view class="choose-item">
  16. <view class="active" v-if="flag==i">
  17. </view>
  18. </view>
  19. </view>
  20. <view v-else class="flex">
  21. 暂无车辆订单信息
  22. </view>
  23. </view>
  24. </template>
  25. <script lang="ts" setup>
  26. import {
  27. reactive,
  28. ref
  29. } from "vue"
  30. import {
  31. navTo, msg,interceptND
  32. } from "@/utils/utils"
  33. import {
  34. onLoad
  35. } from "@dcloudio/uni-app";
  36. import {
  37. deviceUpgradePage
  38. } from "@/utils/network/api.js";
  39. import { requestNew} from "@/utils/network/request.js";
  40. import {
  41. getItem,
  42. StorageKeys,
  43. } from "@/utils/storage";
  44. import {
  45. getCodeName
  46. } from "@/datas/queryKey.js";
  47. import {
  48. getVehiclePlateColor
  49. } from "@/datas/vehiclePlateColor";
  50. const state = reactive({
  51. list: [],
  52. businessType: "",
  53. customerId: "",
  54. vehiclePlate: "",
  55. vehiclePlateColor: ""
  56. });
  57. onLoad(() => {
  58. state.businessType = getItem('key')['DASP_PUSH_TYPE'][0]['code']
  59. quanCheckActionTrue().then((item : any) => {
  60. state.list = item
  61. console.log(item)
  62. })
  63. });
  64. const quanCheckActionTrue = () => {
  65. const options = {
  66. type: 2,
  67. data: {},
  68. method: "POST",
  69. showLoading: true,
  70. };
  71. return new Promise(async (resolve, reject) => {
  72. const res = await requestNew(deviceUpgradePage, options);
  73. const data = res.result;
  74. resolve(data);
  75. }).catch((error) => {
  76. reject(error);
  77. });
  78. }
  79. const flag = ref('0')
  80. const choose = (i, item) => {
  81. const params = encodeURIComponent(JSON.stringify(item))
  82. navTo(`/subpackage/after-sale/equipment-upgrade/upgrade-confirm?params=${params}`)
  83. }
  84. </script>
  85. <style>
  86. page {
  87. width: 100%;
  88. height: 100%;
  89. background-color: #EEF7F7;
  90. }
  91. </style>
  92. <style lang="scss" scoped>
  93. .flex {
  94. display: flex;
  95. justify-content: center;
  96. }
  97. .selectCar-box {
  98. // width: 100%;
  99. height: 100%;
  100. padding: 30rpx;
  101. .item {
  102. padding: 20rpx;
  103. display: flex;
  104. justify-content: space-between;
  105. align-items: center;
  106. // height: 130rpx;
  107. background: #FFFFFF;
  108. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  109. border-radius: 20rpx;
  110. margin-bottom: 30rpx;
  111. .iten-left {
  112. display: flex;
  113. align-items: center;
  114. image {
  115. width: 150rpx;
  116. height: 90rpx;
  117. }
  118. text {
  119. margin-left: 20rpx;
  120. font-size: 32rpx;
  121. font-family: Noto Sans S Chinese;
  122. font-weight: 400;
  123. color: #333333;
  124. }
  125. }
  126. .choose-item {
  127. width: 44rpx;
  128. height: 44rpx;
  129. background: #FFFFFF;
  130. border: 2rpx solid #00B38B;
  131. border-radius: 50%;
  132. margin-right: 20rpx;
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. box-sizing: content-box;
  137. }
  138. .active {
  139. width: 34rpx;
  140. height: 34rpx;
  141. background: #00B38B;
  142. border-radius: 50%;
  143. }
  144. }
  145. }
  146. .message{
  147. font-size: 26rpx;
  148. margin-left: 6rpx;
  149. }
  150. </style>