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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length > 0" @click="choose(i, item)" class="item" v-for="(item, i) in state.list"
  4. :key="i">
  5. <view class="iten-left">
  6. <image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
  7. <view class="message">
  8. <view>车牌号:{{ item.vehiclePlate }}</view>
  9. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  10. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  11. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatus)}}</view>
  12. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  13. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatus) }}</view>
  14. </view>
  15. </view>
  16. <view class="choose-item">
  17. <view class="active" v-if="flag == i"> </view>
  18. </view>
  19. </view>
  20. <view v-else class="flex"> 暂无车辆订单信息 </view>
  21. </view>
  22. </template>
  23. <script lang="ts" setup>
  24. import { reactive, ref } from "vue";
  25. import { navTo} from "@/utils/utils";
  26. import { onLoad,onShow} from "@dcloudio/uni-app";
  27. import { afterSaleCommQuery,queryPage } from "@/utils/network/api.js";
  28. import { requestNew } from "@/utils/network/request.js";
  29. import { getItem, StorageKeys} from "@/utils/storage";
  30. import { jump } from "@/datas/9901Jump.js";
  31. import { deviceType } from "@/utils/network/difference";
  32. import {
  33. getCodeName
  34. } from "@/datas/queryKey.js";
  35. import {
  36. getVehiclePlateColor
  37. } from "@/datas/vehiclePlateColor";
  38. const state = reactive({
  39. list: [],
  40. type: "",//1 OBU重新激活 2 卡签注销 3 更换设备 4卡签续期 5挂失解挂 6增补设备(单卡单签补) 7补卡签(设备丢了补卡签) 8解除挂起
  41. // 30 储值卡转记账卡 31卡pin码解锁 32ETC车牌过户 33 卡签停用/卡签启用
  42. // 34月结单查询 35ETC通行流水记录 36 黑名单查询 37恢复签约
  43. });
  44. onLoad((options) => {
  45. console.log("options", options)
  46. state.type = options.type
  47. if (options.type == "2") {
  48. uni.setNavigationBarTitle({
  49. title: 'ETC注销-选择车辆'
  50. });
  51. } else if (options.type == "3") {
  52. uni.setNavigationBarTitle({
  53. title: '更换ETC设备-选择车辆'
  54. });
  55. } else if (options.type == "4") {
  56. uni.setNavigationBarTitle({
  57. title: '卡签续期-选择车辆'
  58. });
  59. }else if (options.type == "5") {
  60. uni.setNavigationBarTitle({
  61. title: '卡签挂失/解除挂失-选择车辆'
  62. });
  63. }else if (options.type == "6") {
  64. uni.setNavigationBarTitle({
  65. title: '增补设备-选择车辆'
  66. });
  67. }else if (options.type == "7") {
  68. uni.setNavigationBarTitle({
  69. title: '补卡补签-选择车辆'
  70. });
  71. }else if (options.type == "8") {
  72. uni.setNavigationBarTitle({
  73. title: '解除挂起-选择车辆'
  74. });
  75. }else if (options.type == "30") {
  76. uni.setNavigationBarTitle({
  77. title: '储值卡转记账卡-选择车辆'
  78. });
  79. }else if (options.type == "31") {
  80. uni.setNavigationBarTitle({
  81. title: '卡pin码解锁-选择车辆'
  82. });
  83. }else if (options.type == "32") {
  84. uni.setNavigationBarTitle({
  85. title: 'ETC车牌过户-选择车辆'
  86. });
  87. }else if (options.type == "33") {
  88. uni.setNavigationBarTitle({
  89. title: '卡签停用/卡签启用-选择车辆'
  90. });
  91. }else if (options.type == "34") {
  92. uni.setNavigationBarTitle({
  93. title: '月结单查询-选择车辆'
  94. });
  95. }else if (options.type == "35") {
  96. uni.setNavigationBarTitle({
  97. title: 'ETC通行流水-选择车辆'
  98. });
  99. }else if (options.type == "36") {
  100. uni.setNavigationBarTitle({
  101. title: '黑名单查询-选择车辆'
  102. });
  103. }else if (options.type == "37") {
  104. uni.setNavigationBarTitle({
  105. title: '恢复签约-选择车辆'
  106. });
  107. }
  108. });
  109. onShow(()=>{
  110. if(state.type=='37'){
  111. // 恢复签约查询订单接口
  112. list().then((item : any) => {
  113. console.log("item",item)
  114. state.list = item.data;
  115. })
  116. }else{
  117. quanCheckActionTrue().then((item : any) => {
  118. if (state.type == "32") {
  119. let data = item.result
  120. for (var k = 0; k < data.length; k++) {
  121. if (data[k]['orderStatus'] != "99999") {
  122. state.list.push(data[k])
  123. }
  124. }
  125. }else{
  126. state.list = item.result;
  127. }
  128. console.log(item);
  129. });
  130. }
  131. })
  132. const list=()=>{
  133. let newsource = "WECHAT"
  134. // #ifdef MP-ALIPAY
  135. newsource = "ALI"
  136. // #endif
  137. const options = {
  138. type: 2,
  139. data: {
  140. "source": newsource,
  141. "orderStatus": "ACTIVE",
  142. "tabIndex":"-1"
  143. },
  144. method: "POST",
  145. showLoading: true,
  146. };
  147. return new Promise(async (resolve, reject) => {
  148. const res = await requestNew(queryPage, options);
  149. const data = res;
  150. resolve(data);
  151. }).catch((error) => {
  152. reject(error);
  153. });
  154. }
  155. const quanCheckActionTrue = () => {
  156. let source = ""
  157. // #ifdef MP-ALIPAY
  158. source = "ALI"
  159. // #endif
  160. // #ifdef MP-WEIXIN
  161. source = "WECHAT"
  162. // #endif
  163. var data={}
  164. if(state.type=="36"){
  165. data = {
  166. deviceStatus:[1,2,3,4,5,6,7],//挂失解挂设备状态
  167. };
  168. }else if(state.type=="5"){
  169. data = {
  170. deviceStatus:[1,6],//挂失解挂设备状态
  171. };
  172. }else if(state.type=="8"){
  173. data = {
  174. deviceStatus:[2],//解除挂起
  175. };
  176. }else{
  177. data = {
  178. };
  179. }
  180. const options = {
  181. type: 2,
  182. data: data,
  183. method: "POST",
  184. showLoading: true,
  185. };
  186. return new Promise(async (resolve, reject) => {
  187. const res = await requestNew(afterSaleCommQuery, options);
  188. const data = res;
  189. resolve(data);
  190. }).catch((error) => {
  191. reject(error);
  192. });
  193. };
  194. const flag = ref("0");
  195. const choose = (i, item) => {
  196. console.log(item.cardId);
  197. flag.value = i
  198. // 判断9901
  199. // 月结单查询 etc通行流水记录 黑名单查询 目前不用跳转到插件
  200. if (state.type == "34") {
  201. navTo(`/subpackage/after-sale/month-statement/month-statement-query-list?vehicleId=${item.vehicleId}`)
  202. }else if (state.type == "35") {
  203. navTo(`/subpackage/personal-center/search/etcFlowingWater?vehicleId=${item.vehicleId}`)
  204. }else if (state.type == "36") {
  205. uni.navigateTo({
  206. url: `/subpackage/after-sale/blacklist-query/list?vehiclePlate=${item.vehiclePlate}&vehiclePlateColor=${item.vehiclePlateColor}&cardId=${item.cardId}`
  207. })
  208. }else{
  209. if (item.deviceType == deviceType) {
  210. // OBU重新激活跳转
  211. const params = encodeURIComponent(JSON.stringify(item))
  212. jump(state.type, params)
  213. } else {
  214. if (state.type == "1") {
  215. // #ifdef MP-WEIXIN
  216. navTo(
  217. `/subpackage/after-sale/activation-once-again/activation-once-again?vehicleId=${item.vehicleId}`
  218. );
  219. // #endif
  220. // #ifdef MP-ALIPAY
  221. navTo(
  222. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?vehicleId=${item.vehicleId}`
  223. );
  224. // #endif
  225. } else if (state.type == "2") {
  226. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?vehicleId=${item.vehicleId}`)
  227. } else if (state.type == "3") {
  228. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?vehicleId=${item.vehicleId}`)
  229. } else if (state.type == "4") {
  230. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?vehicleId=${item.vehicleId}`)
  231. } else if (state.type == "5") {
  232. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?vehicleId=${item.vehicleId}`)
  233. }else if (state.type == "6") {
  234. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  235. }else if (state.type == "7") {
  236. navTo(`/subpackage/after-sale/replace-cardObu/replace-equipment-confirm?vehicleId=${item.vehicleId}`)
  237. }else if (state.type == "8") {
  238. navTo(`/subpackage/after-sale/releaseSuspension/cardloss-confirm?vehicleId=${item.vehicleId}`)
  239. }else if (state.type == "30") {
  240. navTo(`/subpackage/after-sale/to-bookkeeping-card/confirm?id=${item.id}`)
  241. }else if (state.type == "31") {
  242. navTo(`/subpackage/after-sale/pin-code-deblocking/pin-code-confirm?vehicleId=${item.vehicleId}`);
  243. }else if (state.type == "32") {
  244. navTo(`/subpackage/after-sale/transfer-ownership/transfer-confirm?id=${item.id}`)
  245. }else if (state.type == "33") {
  246. navTo(`/subpackage/after-sale/card-deactivation-activation/deactivation-activation-confirm?id=${item.id}`)
  247. }else if (state.type == "37") {
  248. // #ifdef MP-ALIPAY
  249. uni.navigateTo({
  250. url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  251. });
  252. // #endif
  253. // #ifdef MP-WEIXIN
  254. uni.navigateTo({
  255. url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  256. });
  257. // #endif
  258. }
  259. }
  260. }
  261. }
  262. </script>
  263. <style>
  264. page {
  265. width: 100%;
  266. height: 100%;
  267. background-color: #eef7f7;
  268. }
  269. </style>
  270. <style lang="scss" scoped>
  271. .flex {
  272. display: flex;
  273. justify-content: center;
  274. }
  275. .selectCar-box {
  276. height: 100%;
  277. padding: 30rpx;
  278. .item {
  279. padding: 20rpx;
  280. display: flex;
  281. justify-content: space-between;
  282. align-items: center;
  283. // height: 130rpx;
  284. background: #ffffff;
  285. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  286. border-radius: 20rpx;
  287. margin-bottom: 30rpx;
  288. .iten-left {
  289. display: flex;
  290. align-items: center;
  291. image {
  292. width: 150rpx;
  293. height: 90rpx;
  294. }
  295. text {
  296. margin-left: 20rpx;
  297. font-size: 32rpx;
  298. font-family: Noto Sans S Chinese;
  299. font-weight: 400;
  300. color: #333333;
  301. }
  302. }
  303. .choose-item {
  304. width: 44rpx;
  305. height: 44rpx;
  306. background: #ffffff;
  307. border: 2rpx solid #00b38b;
  308. border-radius: 50%;
  309. margin-right: 20rpx;
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. box-sizing: content-box;
  314. }
  315. .active {
  316. width: 34rpx;
  317. height: 34rpx;
  318. background: #00b38b;
  319. border-radius: 50%;
  320. }
  321. }
  322. }
  323. .message{
  324. font-size: 26rpx;
  325. margin-left: 6rpx;
  326. }
  327. </style>