Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

select-car.vue 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="container">
  3. <!-- 搜索框 -->
  4. <view class="as-layout-horizontal as-gravity-center-start search-layout">
  5. <view class="search-box">
  6. <image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill" @click="search()"></image>
  7. <input class="search" placeholder="请输入车牌号" v-model="state.vehiclePlate" />
  8. </view>
  9. </view>
  10. <view class="title">车辆列表</view>
  11. <scroll-view class="selectCar-box" scroll-y="true" style="height: 60vh;" @scrolltolower="list">
  12. <template v-if="state.list.length > 0">
  13. <view class="list" @click="choose(i, item)" v-for="(item, i) in state.list" :key="i">
  14. <view style="height: 134rpx;">
  15. <image class="car" :src='`${$imgUrl}issuance/car.png`' mode=""></image>
  16. <text class="yanse" :style="{ background: item.showColor}">{{getVehiclePlateColor(item.vehiclePlateColor)}}</text>
  17. </view>
  18. <view class="content">
  19. <view class="content-top">
  20. <text class="vehiclePlate">{{item.vehiclePlate}}</text>
  21. </view>
  22. </view>
  23. <image class="arrow" :src='`${$imgUrl}issuance/arrow.png`' mode=""></image>
  24. </view>
  25. </template>
  26. <view v-else class="flex"> 暂无车辆订单信息 </view>
  27. <view v-if="state.loading" class="flex">加载中...</view>
  28. <view v-if="state.finished && state.list.length > 0" class="flex">没有更多了</view>
  29. </scroll-view>
  30. <<!-- view class="action">
  31. <button type="default" class="ui-btn" @click="add()">
  32. 新增车辆
  33. </button>
  34. </view> -->
  35. </view>
  36. </template>
  37. <script lang="ts" setup>
  38. import { reactive, ref } from "vue";
  39. import { navTo} from "@/utils/utils";
  40. import { onLoad,onShow} from "@dcloudio/uni-app";
  41. import { queryVehicleBind,rePage } from "@/utils/network/api.js";
  42. import { requestNew } from "@/utils/network/request.js";
  43. import { getItem, StorageKeys} from "@/utils/storage";
  44. import { jump } from "@/datas/9901Jump.js";
  45. import { deviceType } from "@/utils/network/difference";
  46. import {getVehiclePlateColor,vehiclePlateColorPai} from "@/datas/vehiclePlateColor";
  47. import {
  48. getCodeName
  49. } from "@/datas/queryKey.js";
  50. import useOrderListItem from "@/composables/order/useOrderListItem";
  51. const props = defineProps({
  52. index: {
  53. type: Number,
  54. default() {
  55. return 0
  56. }
  57. },
  58. refresh: { //是否刷新列表
  59. type: Boolean,
  60. default: true
  61. }
  62. })
  63. const state = reactive({
  64. vehiclePlate: "",
  65. list: [],
  66. type: "",
  67. pageNo: 1,
  68. pageSize: 10,
  69. total: 0,
  70. loading: false,
  71. finished: false,
  72. });
  73. onLoad((options) => {
  74. console.log("options", options)
  75. state.type = options.type
  76. if (options.type == "2") {
  77. uni.setNavigationBarTitle({
  78. title: 'ETC注销-选择车辆'
  79. });
  80. } else if (options.type == "3") {
  81. uni.setNavigationBarTitle({
  82. title: '更换ETC设备-选择车辆'
  83. });
  84. } else if (options.type == "4") {
  85. uni.setNavigationBarTitle({
  86. title: '卡签续期-选择车辆'
  87. });
  88. }else if (options.type == "5") {
  89. uni.setNavigationBarTitle({
  90. title: '卡签挂失/解除挂失-选择车辆'
  91. });
  92. }else if (options.type == "6") {
  93. uni.setNavigationBarTitle({
  94. title: '增补设备-选择车辆'
  95. });
  96. }else if (options.type == "7") {
  97. uni.setNavigationBarTitle({
  98. title: '补卡补签-选择车辆'
  99. });
  100. }else if (options.type == "8") {
  101. uni.setNavigationBarTitle({
  102. title: '解除挂起-选择车辆'
  103. });
  104. }else if (options.type == "30") {
  105. uni.setNavigationBarTitle({
  106. title: '储值卡转记账卡-选择车辆'
  107. });
  108. }else if (options.type == "31") {
  109. uni.setNavigationBarTitle({
  110. title: '卡pin码解锁-选择车辆'
  111. });
  112. }else if (options.type == "32") {
  113. uni.setNavigationBarTitle({
  114. title: 'ETC车牌过户-选择车辆'
  115. });
  116. }else if (options.type == "33") {
  117. uni.setNavigationBarTitle({
  118. title: '卡签停用/卡签启用-选择车辆'
  119. });
  120. }else if (options.type == "34") {
  121. uni.setNavigationBarTitle({
  122. title: '月结单查询-选择车辆'
  123. });
  124. }else if (options.type == "35") {
  125. uni.setNavigationBarTitle({
  126. title: 'ETC通行流水-选择车辆'
  127. });
  128. }else if (options.type == "36") {
  129. uni.setNavigationBarTitle({
  130. title: '黑名单查询'
  131. });
  132. }else if (options.type == "37") {
  133. uni.setNavigationBarTitle({
  134. title: '恢复签约-选择车辆'
  135. });
  136. }else if (options.type == "38") {
  137. uni.setNavigationBarTitle({
  138. title: '车辆信息变更-选择车辆'
  139. });
  140. }
  141. });
  142. onShow(() => {
  143. if (state.type == '37') {
  144. list(true);
  145. } else {
  146. quanCheckActionTrue(state.vehiclePlate);
  147. }
  148. });
  149. const list = (reset = false) => {
  150. if (state.loading || state.finished) return;
  151. state.loading = true;
  152. if (reset) {
  153. state.pageNo = 1;
  154. state.list = [];
  155. state.finished = false;
  156. }
  157. // const customerId = getItem('customerObj');
  158. const options = {
  159. type: 2,
  160. data: {
  161. pageNo: state.pageNo,
  162. pageSize: state.pageSize,
  163. // customerId,
  164. // vehiclePlate: state.vehiclePlate,
  165. },
  166. method: "POST",
  167. showLoading: true,
  168. };
  169. return requestNew(rePage, options).then((res) => {
  170. const data = res?.result || res?.data || [];
  171. state.total = res.total || 0;
  172. if (reset) {
  173. state.list = data;
  174. } else {
  175. state.list = state.list.concat(data);
  176. }
  177. if (state.list.length >= state.total || data.length < state.pageSize) {
  178. state.finished = true;
  179. } else {
  180. state.pageNo += 1;
  181. }
  182. state.loading = false;
  183. }).catch(() => {
  184. state.loading = false;
  185. });
  186. };
  187. const quanCheckActionTrue = (vehiclePlate) => {
  188. const options = {
  189. type: 2,
  190. data: {
  191. vehiclePlate
  192. },
  193. method: "POST",
  194. showLoading: true,
  195. };
  196. requestNew(queryVehicleBind, options).then((res) => {
  197. const data = res.result;
  198. for(var i=0;i<data.length;i++){
  199. for (var j = 0; j < vehiclePlateColorPai.length; j++) {
  200. if (data[i].vehiclePlateColor == vehiclePlateColorPai[j]['id']) {
  201. data[i].color = vehiclePlateColorPai[j]['color']
  202. data[i].showColor = vehiclePlateColorPai[j]['showColor']
  203. }
  204. }
  205. }
  206. console.log("车辆列表",data)
  207. if (state.type == "32") {
  208. for (var k = 0; k < data.length; k++) {
  209. if (data[k]['orderStatus'] != "99999") {
  210. state.list.push(data[k])
  211. }
  212. }
  213. }else{
  214. state.list = data;
  215. }
  216. })
  217. .catch((err) => {
  218. console.log(err);
  219. });
  220. };
  221. const flag = ref("0");
  222. const choose = (i, item) => {
  223. console.log(item.id);
  224. // 跳转到车辆详情页面,携带item.id参数
  225. uni.navigateTo({
  226. url: `/subpackage/after-sale/activation-once-again/vehicle-details?id=${item.id}`
  227. });
  228. }
  229. const add=()=>{
  230. navTo(`/subpackage/after-sale/blacklist-query/addCar`)
  231. }
  232. const search = () => {
  233. list(true);
  234. };
  235. </script>
  236. <style lang="scss" scoped>
  237. .flex {
  238. display: flex;
  239. justify-content: center;
  240. }
  241. .selectCar-box {
  242. height: 100%;
  243. padding: 30rpx;
  244. padding-top: 0;
  245. padding-bottom: 200rpx;
  246. }
  247. .message{
  248. font-size: 26rpx;
  249. margin-left: 6rpx;
  250. }
  251. .search-layout {
  252. .search-box {
  253. margin: 30rpx 30rpx 0rpx 30rpx;
  254. height: 80rpx;
  255. background: #FFFFFF;
  256. border-radius: 40rpx;
  257. display: flex;
  258. justify-content: center;
  259. align-items: center;
  260. box-sizing: border-box;
  261. flex: 1;
  262. }
  263. .search-box .icon {
  264. width: 48rpx;
  265. height: 48rpx;
  266. margin: 0 20rpx;
  267. }
  268. .search-box .search {
  269. flex: 1;
  270. margin-right: 20rpx;
  271. height: 100%;
  272. padding: 0 10rpx;
  273. font-size: 28rpx;
  274. }
  275. .search-btn {
  276. color: white;
  277. background-color: #00B38B;
  278. width: 140rpx;
  279. height: 75rpx;
  280. line-height: 75rpx;
  281. font-size: 32rpx;
  282. border-radius: 40rpx;
  283. text-align: center;
  284. margin-right: 30rpx;
  285. margin-top: 30rpx;
  286. }
  287. }
  288. .title{
  289. font-weight: 400;
  290. font-size: 34rpx;
  291. color: #01243A;
  292. margin: 30rpx 30rpx 0rpx 30rpx;
  293. }
  294. .list{
  295. background: #FFFFFF;
  296. border-radius: 12rpx;
  297. border: 1px solid #FFFFFF;
  298. width: 98%;
  299. margin: 30rpx auto;
  300. padding: 20rpx;
  301. box-sizing: border-box;
  302. display: flex;
  303. align-items: center;
  304. .content{
  305. font-weight: 400;
  306. width: 76%;
  307. margin-left: 20rpx;
  308. .content-top{
  309. margin-bottom: 20rpx;
  310. .vehiclePlate{
  311. font-size: 30rpx;
  312. color: #01243A;
  313. }
  314. }
  315. .content-time{
  316. font-size: 26rpx;
  317. color: #999999;
  318. }
  319. }
  320. .yanse{
  321. display: inline-block;
  322. position: relative;
  323. width: 64rpx;
  324. height: 30rpx;
  325. background: red;
  326. color: white;
  327. border-radius: 15rpx 0 15rpx 0;
  328. text-align: center;
  329. line-height: 30rpx;
  330. font-size: 24rpx;
  331. top: -147rpx;
  332. }
  333. .car{
  334. width: 134rpx;
  335. height: 134rpx;
  336. }
  337. .arrow{
  338. width: 18rpx;
  339. height: 34rpx;
  340. }
  341. }
  342. .action {
  343. position: fixed;
  344. bottom: 0rpx;
  345. left: 0;
  346. height: 188rpx;
  347. background-color: #fff;
  348. border-radius: 30rpx 30rpx 0 0;
  349. width: 100vw;
  350. display: flex;
  351. align-items: center;
  352. justify-content: center;
  353. flex-direction: column;
  354. }
  355. </style>