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.

refundPage-selectCar.vue 3.3KB

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