選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

select-car.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. var data = {
  36. opId: getItem(StorageKeys.OpenId),
  37. source: "WECHAT",
  38. tabIndex: "0",
  39. orderStep: "11",
  40. isValueCard: "",
  41. orderStatus: "1",
  42. };
  43. const options = {
  44. type: 2,
  45. data: data,
  46. method: "POST",
  47. showLoading: true,
  48. };
  49. return new Promise(async (resolve, reject) => {
  50. const res = await request(orderList, options);
  51. const data = stringToJson(res.bizContent);
  52. resolve(data);
  53. }).catch((error) => {
  54. reject(error);
  55. });
  56. };
  57. const list = reactive([
  58. {
  59. name: "A12345",
  60. },
  61. {
  62. name: "B12345",
  63. },
  64. {
  65. name: "C12345",
  66. },
  67. ]);
  68. const flag = ref("0");
  69. const choose = (i, item) => {
  70. console.log(item.cardId);
  71. navTo(
  72. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  73. );
  74. };
  75. </script>
  76. <style>
  77. page {
  78. width: 100%;
  79. height: 100%;
  80. background-color: #eef7f7;
  81. }
  82. </style>
  83. <style lang="scss" scoped>
  84. .flex {
  85. display: flex;
  86. justify-content: center;
  87. }
  88. .selectCar-box {
  89. // width: 100%;
  90. height: 100%;
  91. padding: 30rpx;
  92. .item {
  93. padding: 20rpx;
  94. display: flex;
  95. justify-content: space-between;
  96. align-items: center;
  97. height: 130rpx;
  98. background: #ffffff;
  99. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  100. border-radius: 20rpx;
  101. margin-bottom: 30rpx;
  102. .iten-left {
  103. display: flex;
  104. align-items: center;
  105. image {
  106. width: 150rpx;
  107. height: 90rpx;
  108. }
  109. text {
  110. margin-left: 20rpx;
  111. font-size: 32rpx;
  112. font-family: Noto Sans S Chinese;
  113. font-weight: 400;
  114. color: #333333;
  115. }
  116. }
  117. .choose-item {
  118. width: 44rpx;
  119. height: 44rpx;
  120. background: #ffffff;
  121. border: 2rpx solid #00b38b;
  122. border-radius: 50%;
  123. margin-right: 20rpx;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. box-sizing: content-box;
  128. }
  129. .active {
  130. width: 34rpx;
  131. height: 34rpx;
  132. background: #00b38b;
  133. border-radius: 50%;
  134. }
  135. }
  136. }
  137. </style>