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

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