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 2.8KB

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