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.

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