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.

flowingWater-selectCar.vue 2.9KB

2 vuotta sitten
2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list&&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>
  14. <empty title='暂无找到相关车辆信息' />
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="ts" setup>
  19. import empty from "@/components/empty/empty.vue";
  20. import {
  21. reactive,
  22. ref
  23. } from "vue"
  24. import {
  25. navTo
  26. } from "@/utils/utils"
  27. import {
  28. onLoad,
  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. } from "@/utils/storage";
  40. import {
  41. stringToJson
  42. } from "@/utils/network/encryption";
  43. const state = reactive({
  44. list: [] //车辆list
  45. });
  46. const flag = ref('0') //默认选择0
  47. onLoad(() => {
  48. quanCheckActionTrue().then((item: any) => {
  49. state.list = item.data
  50. })
  51. });
  52. const quanCheckActionTrue = () => {
  53. var data = {
  54. opId: getItem(StorageKeys.OpenId),
  55. source: 'WECHAT', //渠道为小程序
  56. tabIndex: '0', //0全部
  57. orderStep: '11', //11 为已完成”
  58. };
  59. const options = {
  60. type: 2,
  61. data: data,
  62. method: "POST",
  63. showLoading: true,
  64. };
  65. return new Promise(async (resolve, reject) => {
  66. const res = await request(orderList, options);
  67. const data = stringToJson(res.bizContent);
  68. resolve(data);
  69. }).catch((error) => {
  70. reject(error);
  71. });
  72. }
  73. const choose = (i, item) => {
  74. flag.value = i
  75. navTo(`/subpackage/orders/flowingWater?vehicleId=${item.vehicleId}`)
  76. }
  77. </script>
  78. <style>
  79. page {
  80. width: 100%;
  81. height: 100%;
  82. background-color: #EEF7F7;
  83. }
  84. </style>
  85. <style lang="scss" scoped>
  86. .flex {
  87. display: flex;
  88. justify-content: center;
  89. }
  90. .selectCar-box {
  91. // width: 100%;
  92. height: 100%;
  93. padding: 30rpx;
  94. .item {
  95. padding: 20rpx;
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. height: 130rpx;
  100. background: #FFFFFF;
  101. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  102. border-radius: 20rpx;
  103. margin-bottom: 30rpx;
  104. .iten-left {
  105. display: flex;
  106. align-items: center;
  107. image {
  108. width: 150rpx;
  109. height: 90rpx;
  110. }
  111. text {
  112. margin-left: 20rpx;
  113. font-size: 32rpx;
  114. font-family: Noto Sans S Chinese;
  115. font-weight: 400;
  116. color: #333333;
  117. }
  118. }
  119. .choose-item {
  120. width: 44rpx;
  121. height: 44rpx;
  122. background: #FFFFFF;
  123. border: 2rpx solid #00B38B;
  124. border-radius: 50%;
  125. margin-right: 20rpx;
  126. display: flex;
  127. justify-content: center;
  128. align-items: center;
  129. box-sizing: content-box;
  130. }
  131. .active {
  132. width: 34rpx;
  133. height: 34rpx;
  134. background: #00B38B;
  135. border-radius: 50%;
  136. }
  137. }
  138. }
  139. </style>