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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i">
  4. <view class="iten-left">
  5. <image :src="`${$imgUrl}che.png`" mode=""></image>
  6. <text>{{item.vehiclePlate}}</text>
  7. </view>
  8. <view class="choose-item">
  9. <view class="active" v-if="flag==i">
  10. </view>
  11. </view>
  12. </view>
  13. <view v-else class="flex">
  14. 暂无车辆订单信息
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="ts" setup>
  19. import {
  20. reactive,
  21. ref
  22. } from "vue"
  23. import {
  24. navTo
  25. } from "@/utils/utils"
  26. import {
  27. onLoad,
  28. onShow
  29. } from "@dcloudio/uni-app";
  30. import {
  31. orderList
  32. } from "@/utils/network/api.js";
  33. import {
  34. request
  35. } from "@/utils/network/request.js";
  36. import {
  37. msg
  38. } from "@/utils/utils";
  39. import {
  40. getItem,
  41. StorageKeys,
  42. setItem
  43. } from "@/utils/storage";
  44. import {
  45. stringToJson
  46. } from "@/utils/network/encryption";
  47. const state = reactive({
  48. list: []
  49. });
  50. onLoad(() => {
  51. quanCheckActionTrue().then((item: any) => {
  52. state.list = item.data
  53. console.log(item)
  54. })
  55. });
  56. const quanCheckActionTrue = () => {
  57. var data = {
  58. opId: getItem(StorageKeys.OpenId),
  59. source: 'WECHAT',
  60. tabIndex: '0',
  61. orderStep: '11',
  62. isValueCard: '2'
  63. };
  64. const options = {
  65. type: 2,
  66. data: data,
  67. method: "POST",
  68. showLoading: true,
  69. };
  70. return new Promise(async (resolve, reject) => {
  71. const res = await request(orderList, options);
  72. const data = stringToJson(res.bizContent);
  73. resolve(data);
  74. }).catch((error) => {
  75. reject(error);
  76. });
  77. }
  78. const list = reactive([{
  79. name: "A12345"
  80. },
  81. {
  82. name: "B12345"
  83. },
  84. {
  85. name: "C12345"
  86. },
  87. ])
  88. const flag = ref('0')
  89. const choose = (i, item) => {
  90. console.log(item.cardId)
  91. navTo(`/after-sale/card-loss-reporting/cardloss-confirm?id=${item.id}`)
  92. }
  93. </script>
  94. <style>
  95. page {
  96. width: 100%;
  97. height: 100%;
  98. background-color: #EEF7F7;
  99. }
  100. </style>
  101. <style lang="scss" scoped>
  102. .flex {
  103. display: flex;
  104. justify-content: center;
  105. }
  106. .selectCar-box {
  107. // width: 100%;
  108. height: 100%;
  109. padding: 30rpx;
  110. .item {
  111. padding: 20rpx;
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. height: 130rpx;
  116. background: #FFFFFF;
  117. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  118. border-radius: 20rpx;
  119. margin-bottom: 30rpx;
  120. .iten-left {
  121. display: flex;
  122. align-items: center;
  123. image {
  124. width: 150rpx;
  125. height: 90rpx;
  126. }
  127. text {
  128. margin-left: 20rpx;
  129. font-size: 32rpx;
  130. font-family: Noto Sans S Chinese;
  131. font-weight: 400;
  132. color: #333333;
  133. }
  134. }
  135. .choose-item {
  136. width: 44rpx;
  137. height: 44rpx;
  138. background: #FFFFFF;
  139. border: 2rpx solid #00B38B;
  140. border-radius: 50%;
  141. margin-right: 20rpx;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. box-sizing: content-box;
  146. }
  147. .active {
  148. width: 34rpx;
  149. height: 34rpx;
  150. background: #00B38B;
  151. border-radius: 50%;
  152. }
  153. }
  154. }
  155. </style>