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 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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
  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. const state = reactive({
  56. customerIdNum: "",
  57. list: [] //车辆list
  58. });
  59. const flag = ref('0') //默认选择0
  60. onLoad(() => {
  61. queryUserMsg()
  62. });
  63. onShow(() => {
  64. })
  65. // 通过opneId查询用户信息
  66. const queryUserMsg = () => {
  67. const options = {
  68. type: 2,
  69. data: {
  70. "openId": getItem('openId')
  71. },
  72. method: "POST",
  73. showLoading: true,
  74. };
  75. request(getUserMsg, options).then((res) => {
  76. const data = stringToJson(res.bizContent);
  77. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  78. state.customerIdNum = data.customerIdNum;
  79. queryRefundAction().then((item : any) => {
  80. state.list = item.data
  81. })
  82. })
  83. }
  84. //储值卡注销退费查询接口
  85. const queryRefundAction = () => {
  86. var data = {
  87. customerIdNum: state.customerIdNum,
  88. type: "2"
  89. };
  90. const options = {
  91. type: 2,
  92. data: data,
  93. method: "POST",
  94. showLoading: true,
  95. };
  96. return new Promise(async (resolve, reject) => {
  97. const res = await request(queryRefund, options);
  98. const data = stringToJson(res.bizContent);
  99. console.log("data", data)
  100. resolve(data);
  101. }).catch((error) => {
  102. reject(error);
  103. });
  104. }
  105. const choose = (i, item) => {
  106. flag.value = i
  107. navTo(`/subpackage/after-sale/refund-order-balance/refund-order-balance?vehicleId=${item.vehicleId}`)
  108. }
  109. </script>
  110. <style>
  111. page {
  112. width: 100%;
  113. height: 100%;
  114. background-color: #EEF7F7;
  115. }
  116. </style>
  117. <style lang="scss" scoped>
  118. .flex {
  119. display: flex;
  120. justify-content: center;
  121. }
  122. .selectCar-box {
  123. height: 100%;
  124. padding: 30rpx;
  125. .item {
  126. padding: 20rpx;
  127. display: flex;
  128. justify-content: space-between;
  129. align-items: center;
  130. // height: 130rpx;
  131. background: #FFFFFF;
  132. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  133. border-radius: 20rpx;
  134. margin-bottom: 30rpx;
  135. .iten-left {
  136. display: flex;
  137. align-items: center;
  138. image {
  139. width: 150rpx;
  140. height: 90rpx;
  141. }
  142. text {
  143. margin-left: 20rpx;
  144. font-size: 32rpx;
  145. font-family: Noto Sans S Chinese;
  146. font-weight: 400;
  147. color: #333333;
  148. }
  149. }
  150. .choose-item {
  151. width: 44rpx;
  152. height: 44rpx;
  153. background: #FFFFFF;
  154. border: 2rpx solid #00B38B;
  155. border-radius: 50%;
  156. margin-right: 20rpx;
  157. display: flex;
  158. justify-content: center;
  159. align-items: center;
  160. box-sizing: content-box;
  161. }
  162. .active {
  163. width: 34rpx;
  164. height: 34rpx;
  165. background: #00B38B;
  166. border-radius: 50%;
  167. }
  168. }
  169. }
  170. .message{
  171. font-size: 26rpx;
  172. margin-left: 6rpx;
  173. }
  174. </style>