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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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="aspectFill"></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 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) => {
  52. state.list = item.data
  53. console.log(item)
  54. })
  55. });
  56. const quanCheckActionTrue = () => {
  57. let source = ""
  58. // #ifdef MP-ALIPAY
  59. source ="ALI"
  60. // #endif
  61. // #ifdef MP-WEIXIN
  62. source ="WECHAT"
  63. // #endif
  64. var data = {
  65. opId: getItem(StorageKeys.OpenId),
  66. source: source,
  67. tabIndex: '0',
  68. orderStep: '11',
  69. isValueCard: '',
  70. orderStatus: "1"
  71. };
  72. const options = {
  73. type: 2,
  74. data: data,
  75. method: "POST",
  76. showLoading: true,
  77. };
  78. return new Promise(async (resolve, reject) => {
  79. const res = await request(orderList, options);
  80. const data = stringToJson(res.bizContent);
  81. resolve(data);
  82. }).catch((error) => {
  83. reject(error);
  84. });
  85. }
  86. const flag = ref('0')
  87. const choose = (i, item) => {
  88. navTo(`/subpackage/personal-center/search/select-card?vehicleId=${item.vehicleId}`)
  89. }
  90. </script>
  91. <style>
  92. page {
  93. width: 100%;
  94. height: 100%;
  95. background-color: #EEF7F7;
  96. }
  97. </style>
  98. <style lang="scss" scoped>
  99. .flex {
  100. display: flex;
  101. justify-content: center;
  102. }
  103. .selectCar-box {
  104. // width: 100%;
  105. height: 100%;
  106. padding: 30rpx;
  107. .item {
  108. padding: 20rpx;
  109. display: flex;
  110. justify-content: space-between;
  111. align-items: center;
  112. height: 130rpx;
  113. background: #FFFFFF;
  114. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  115. border-radius: 20rpx;
  116. margin-bottom: 30rpx;
  117. .iten-left {
  118. display: flex;
  119. align-items: center;
  120. image {
  121. width: 150rpx;
  122. height: 90rpx;
  123. }
  124. text {
  125. margin-left: 20rpx;
  126. font-size: 32rpx;
  127. font-family: Noto Sans S Chinese;
  128. font-weight: 400;
  129. color: #333333;
  130. }
  131. }
  132. .choose-item {
  133. width: 44rpx;
  134. height: 44rpx;
  135. background: #FFFFFF;
  136. border: 2rpx solid #00B38B;
  137. border-radius: 50%;
  138. margin-right: 20rpx;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. box-sizing: content-box;
  143. }
  144. .active {
  145. width: 34rpx;
  146. height: 34rpx;
  147. background: #00B38B;
  148. border-radius: 50%;
  149. }
  150. }
  151. }
  152. </style>