您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

select-car.vue 3.1KB

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