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

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