Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

select-car.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. import { deviceType } from "@/utils/network/difference";
  38. import { jump } from "@/datas/9901Jump.js";
  39. const state = reactive({
  40. list: [],
  41. starts: false,
  42. pageSize: 10,
  43. pageNo: 1,
  44. flags: false,
  45. });
  46. onLoad(() => {
  47. quanCheckActionTrue()
  48. });
  49. const quanCheckActionTrue = () => {
  50. let source = ""
  51. // #ifdef MP-ALIPAY
  52. source = "ALI"
  53. // #endif
  54. // #ifdef MP-WEIXIN
  55. source = "WECHAT"
  56. // #endif
  57. var data = {
  58. opId: getItem(StorageKeys.OpenId),
  59. source: source,
  60. tabIndex: "0",
  61. isValueCard: "",
  62. pageNo: state.pageNo,
  63. pageSize: state.pageSize,
  64. };
  65. const options = {
  66. type: 2,
  67. data: data,
  68. method: "POST",
  69. showLoading: true,
  70. };
  71. request(orderList, options).then((res) => {
  72. let dataAll = [...state.list, ...stringToJson(res.bizContent).data]
  73. state.list =dataAll;
  74. console.log("state.list",state.list)
  75. })
  76. };
  77. const flag = ref("0");
  78. const choose = (i,item) => {
  79. console.log("item", item);
  80. if (item.deviceType == deviceType) {
  81. const params = encodeURIComponent(JSON.stringify(item))
  82. jump('19', params)
  83. }else{
  84. // #ifdef MP-ALIPAY
  85. uni.navigateTo({
  86. url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  87. });
  88. // #endif
  89. // #ifdef MP-WEIXIN
  90. uni.navigateTo({
  91. url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  92. });
  93. // #endif
  94. }
  95. };
  96. onReachBottom(() => {
  97. if (state.list.length < state.pageNo * 10) return state.flags = true
  98. console.log("触底了")
  99. state.pageNo++
  100. quanCheckActionTrue();
  101. });
  102. </script>
  103. <style>
  104. page {
  105. width: 100%;
  106. height: 100%;
  107. background-color: #eef7f7;
  108. }
  109. </style>
  110. <style lang="scss" scoped>
  111. .flex {
  112. display: flex;
  113. justify-content: center;
  114. }
  115. .selectCar-box {
  116. height: 100%;
  117. padding: 30rpx;
  118. .item {
  119. padding: 20rpx;
  120. display: flex;
  121. justify-content: space-between;
  122. align-items: center;
  123. // height: 130rpx;
  124. background: #ffffff;
  125. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  126. border-radius: 20rpx;
  127. margin-bottom: 30rpx;
  128. .iten-left {
  129. display: flex;
  130. align-items: center;
  131. image {
  132. width: 150rpx;
  133. height: 90rpx;
  134. }
  135. text {
  136. margin-left: 20rpx;
  137. font-size: 32rpx;
  138. font-family: Noto Sans S Chinese;
  139. font-weight: 400;
  140. color: #333333;
  141. }
  142. }
  143. .choose-item {
  144. width: 44rpx;
  145. height: 44rpx;
  146. background: #ffffff;
  147. border: 2rpx solid #00b38b;
  148. border-radius: 50%;
  149. margin-right: 20rpx;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. box-sizing: content-box;
  154. }
  155. .active {
  156. width: 34rpx;
  157. height: 34rpx;
  158. background: #00b38b;
  159. border-radius: 50%;
  160. }
  161. }
  162. }
  163. .message{
  164. font-size: 26rpx;
  165. margin-left: 6rpx;
  166. }
  167. </style>