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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. <view class="message">
  8. <view>车牌号:{{ item.vehiclePlate }}</view>
  9. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  10. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  11. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatus)}}</view>
  12. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  13. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatus) }}</view>
  14. </view>
  15. </view>
  16. <view class="choose-item">
  17. <view class="active" v-if="flag == i"> </view>
  18. </view>
  19. </view>
  20. <view v-else class="flex"> 暂无车辆订单信息 </view>
  21. <view style="text-align: center;margin: 20rpx;font-size: 30rpx;" v-if="state.flags">我是有底线的~</view>
  22. </view>
  23. </template>
  24. <script lang="ts" setup>
  25. import { reactive, ref } from "vue";
  26. import { onLoad,onReachBottom } from "@dcloudio/uni-app";
  27. import { orderList } from "@/utils/network/api.js";
  28. import { request } from "@/utils/network/request.js";
  29. import { getItem, StorageKeys } from "@/utils/storage";
  30. import { stringToJson } from "@/utils/network/encryption";
  31. import {
  32. getCodeName
  33. } from "@/datas/queryKey.js";
  34. import {
  35. getVehiclePlateColor
  36. } from "@/datas/vehiclePlateColor";
  37. const state = reactive({
  38. list: [],
  39. starts: false,
  40. pageSize: 10,
  41. pageNo: 1,
  42. flags: false,
  43. });
  44. onLoad(() => {
  45. quanCheckActionTrue()
  46. });
  47. const quanCheckActionTrue = () => {
  48. let source = ""
  49. // #ifdef MP-ALIPAY
  50. source = "ALI"
  51. // #endif
  52. // #ifdef MP-WEIXIN
  53. source = "WECHAT"
  54. // #endif
  55. var data = {
  56. opId: getItem(StorageKeys.OpenId),
  57. source: source,
  58. tabIndex: "0",
  59. isValueCard: "",
  60. pageNo: state.pageNo,
  61. pageSize: state.pageSize,
  62. };
  63. const options = {
  64. type: 2,
  65. data: data,
  66. method: "POST",
  67. showLoading: true,
  68. };
  69. request(orderList, options).then((res) => {
  70. let dataAll = [...state.list, ...stringToJson(res.bizContent).data]
  71. state.list =dataAll;
  72. })
  73. };
  74. const flag = ref("0");
  75. const choose = (i,item) => {
  76. console.log("item", item);
  77. // #ifdef MP-ALIPAY
  78. uni.navigateTo({
  79. url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  80. });
  81. // #endif
  82. // #ifdef MP-WEIXIN
  83. uni.navigateTo({
  84. url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  85. });
  86. // #endif
  87. };
  88. onReachBottom(() => {
  89. if (state.list.length < state.pageNo * 10) return state.flags = true
  90. console.log("触底了")
  91. state.pageNo++
  92. quanCheckActionTrue();
  93. });
  94. </script>
  95. <style>
  96. page {
  97. width: 100%;
  98. height: 100%;
  99. background-color: #eef7f7;
  100. }
  101. </style>
  102. <style lang="scss" scoped>
  103. .flex {
  104. display: flex;
  105. justify-content: center;
  106. }
  107. .selectCar-box {
  108. height: 100%;
  109. padding: 30rpx;
  110. .item {
  111. padding: 20rpx;
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. // height: 130rpx;
  116. background: #ffffff;
  117. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  118. border-radius: 20rpx;
  119. margin-bottom: 30rpx;
  120. .iten-left {
  121. display: flex;
  122. align-items: center;
  123. image {
  124. width: 150rpx;
  125. height: 90rpx;
  126. }
  127. text {
  128. margin-left: 20rpx;
  129. font-size: 32rpx;
  130. font-family: Noto Sans S Chinese;
  131. font-weight: 400;
  132. color: #333333;
  133. }
  134. }
  135. .choose-item {
  136. width: 44rpx;
  137. height: 44rpx;
  138. background: #ffffff;
  139. border: 2rpx solid #00b38b;
  140. border-radius: 50%;
  141. margin-right: 20rpx;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. box-sizing: content-box;
  146. }
  147. .active {
  148. width: 34rpx;
  149. height: 34rpx;
  150. background: #00b38b;
  151. border-radius: 50%;
  152. }
  153. }
  154. }
  155. .message{
  156. font-size: 26rpx;
  157. margin-left: 6rpx;
  158. }
  159. </style>