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.

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