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

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