Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

refundPage-selectCar.vue 3.3KB

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