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

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