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.

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