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.

select-car.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list&&state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list"
  4. :key="i">
  5. <view class="iten-left">
  6. <image :src="`${$imgUrl}che.png`" mode=""></image>
  7. <view class="message">
  8. <view>车牌号:{{ item.vehiclePlate }}</view>
  9. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  10. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  11. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatus)}}</view>
  12. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  13. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatus) }}</view>
  14. </view>
  15. </view>
  16. <view class="choose-item">
  17. <view class="active" v-if="flag==i">
  18. </view>
  19. </view>
  20. </view>
  21. <view v-else>
  22. <empty title='暂无找到相关车辆信息' />
  23. </view>
  24. </view>
  25. </template>
  26. <script lang="ts" setup>
  27. import empty from "@/components/empty/empty.vue";
  28. import {
  29. reactive,
  30. ref
  31. } from "vue"
  32. import {
  33. navTo
  34. } from "@/utils/utils"
  35. import {
  36. onLoad, onShow
  37. } from "@dcloudio/uni-app";
  38. import {queryRefund, getUserMsg
  39. } from "@/utils/network/api.js";
  40. import {
  41. request,requestNew
  42. } from "@/utils/network/request.js";
  43. import {
  44. getItem
  45. } from "@/utils/storage";
  46. import {
  47. stringToJson
  48. } from "@/utils/network/encryption";
  49. import {
  50. getCodeName
  51. } from "@/datas/queryKey.js";
  52. import {
  53. getVehiclePlateColor
  54. } from "@/datas/vehiclePlateColor";
  55. import {interceptND} from "@/utils/utils";
  56. const state = reactive({
  57. customerIdNum: "",
  58. list: [] //车辆list
  59. });
  60. const flag = ref('0') //默认选择0
  61. onLoad(() => {
  62. queryUserMsg()
  63. });
  64. onShow(() => {
  65. })
  66. // 通过opneId查询用户信息
  67. const queryUserMsg = () => {
  68. const options = {
  69. type: 2,
  70. data: {
  71. "openId": getItem('openId')
  72. },
  73. method: "POST",
  74. showLoading: true,
  75. };
  76. requestNew(getUserMsg, options).then((res) => {
  77. const data = res;
  78. console.log("通过opneId查询用户信息", res)
  79. state.customerIdNum = data.customerIdNum;
  80. queryRefundAction().then((item : any) => {
  81. state.list = item.data
  82. })
  83. })
  84. }
  85. //储值卡注销退费查询接口
  86. const queryRefundAction = () => {
  87. var data = {
  88. customerIdNum: state.customerIdNum,
  89. type: "2"
  90. };
  91. const options = {
  92. type: 2,
  93. data: data,
  94. method: "POST",
  95. showLoading: true,
  96. };
  97. return new Promise(async (resolve, reject) => {
  98. const res = await request(queryRefund, options);
  99. const data = stringToJson(res.bizContent);
  100. console.log("data", data)
  101. resolve(data);
  102. }).catch((error) => {
  103. reject(error);
  104. });
  105. }
  106. const choose = (i, item) => {
  107. // interceptND(item.vehicleId).then(()=>{
  108. flag.value = i
  109. navTo(`/subpackage/after-sale/refund-order-balance/refund-order-balance?vehicleId=${item.vehicleId}`)
  110. // })
  111. }
  112. </script>
  113. <style>
  114. page {
  115. width: 100%;
  116. height: 100%;
  117. background-color: #EEF7F7;
  118. }
  119. </style>
  120. <style lang="scss" scoped>
  121. .flex {
  122. display: flex;
  123. justify-content: center;
  124. }
  125. .selectCar-box {
  126. height: 100%;
  127. padding: 30rpx;
  128. .item {
  129. padding: 20rpx;
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. // height: 130rpx;
  134. background: #FFFFFF;
  135. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  136. border-radius: 20rpx;
  137. margin-bottom: 30rpx;
  138. .iten-left {
  139. display: flex;
  140. align-items: center;
  141. image {
  142. width: 150rpx;
  143. height: 90rpx;
  144. }
  145. text {
  146. margin-left: 20rpx;
  147. font-size: 32rpx;
  148. font-family: Noto Sans S Chinese;
  149. font-weight: 400;
  150. color: #333333;
  151. }
  152. }
  153. .choose-item {
  154. width: 44rpx;
  155. height: 44rpx;
  156. background: #FFFFFF;
  157. border: 2rpx solid #00B38B;
  158. border-radius: 50%;
  159. margin-right: 20rpx;
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. box-sizing: content-box;
  164. }
  165. .active {
  166. width: 34rpx;
  167. height: 34rpx;
  168. background: #00B38B;
  169. border-radius: 50%;
  170. }
  171. }
  172. }
  173. .message{
  174. font-size: 26rpx;
  175. margin-left: 6rpx;
  176. }
  177. </style>