Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

select-car.vue 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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=="5"){
  165. data = {
  166. opId: getItem(StorageKeys.OpenId),
  167. loginSource:getItem("loginSource"),
  168. deviceStatus:[1,6],//挂失解挂设备状态
  169. };
  170. }else if(state.type=="8"){
  171. data = {
  172. opId: getItem(StorageKeys.OpenId),
  173. loginSource:getItem("loginSource"),
  174. deviceStatus:[2],//解除挂起
  175. };
  176. }else{
  177. data = {
  178. opId: getItem(StorageKeys.OpenId),
  179. loginSource:getItem("loginSource"),
  180. };
  181. }
  182. const options = {
  183. type: 2,
  184. data: data,
  185. method: "POST",
  186. showLoading: true,
  187. };
  188. return new Promise(async (resolve, reject) => {
  189. const res = await requestNew(afterSaleCommQuery, options);
  190. const data = res;
  191. resolve(data);
  192. }).catch((error) => {
  193. reject(error);
  194. });
  195. };
  196. const flag = ref("0");
  197. const choose = (i, item) => {
  198. console.log(item.cardId);
  199. flag.value = i
  200. // 判断9901
  201. // 月结单查询 etc通行流水记录 黑名单查询 目前不用跳转到插件
  202. if (state.type == "34") {
  203. navTo(`/subpackage/after-sale/month-statement/month-statement-query-list?vehicleId=${item.vehicleId}`)
  204. }else if (state.type == "35") {
  205. navTo(`/subpackage/personal-center/search/etcFlowingWater?vehicleId=${item.vehicleId}`)
  206. }else if (state.type == "36") {
  207. uni.navigateTo({
  208. url: `/subpackage/after-sale/blacklist-query/list?vehiclePlate=${item.vehiclePlate}&vehiclePlateColor=${item.vehiclePlateColor}&cardId=${item.cardId}`
  209. })
  210. }else{
  211. if (item.deviceType == deviceType) {
  212. // OBU重新激活跳转
  213. const params = encodeURIComponent(JSON.stringify(item))
  214. jump(state.type, params)
  215. } else {
  216. if (state.type == "1") {
  217. // #ifdef MP-WEIXIN
  218. navTo(
  219. `/subpackage/after-sale/activation-once-again/activation-once-again?vehicleId=${item.vehicleId}`
  220. );
  221. // #endif
  222. // #ifdef MP-ALIPAY
  223. navTo(
  224. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?vehicleId=${item.vehicleId}`
  225. );
  226. // #endif
  227. } else if (state.type == "2") {
  228. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?vehicleId=${item.vehicleId}`)
  229. } else if (state.type == "3") {
  230. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?vehicleId=${item.vehicleId}`)
  231. } else if (state.type == "4") {
  232. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?vehicleId=${item.vehicleId}`)
  233. } else if (state.type == "5") {
  234. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?vehicleId=${item.vehicleId}`)
  235. }else if (state.type == "6") {
  236. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  237. }else if (state.type == "7") {
  238. navTo(`/subpackage/after-sale/replace-cardObu/replace-equipment-confirm?vehicleId=${item.vehicleId}`)
  239. }else if (state.type == "8") {
  240. navTo(`/subpackage/after-sale/releaseSuspension/cardloss-confirm?vehicleId=${item.vehicleId}`)
  241. }else if (state.type == "30") {
  242. navTo(`/subpackage/after-sale/to-bookkeeping-card/confirm?id=${item.id}`)
  243. }else if (state.type == "31") {
  244. navTo(`/subpackage/after-sale/pin-code-deblocking/pin-code-confirm?id=${item.id}`);
  245. }else if (state.type == "32") {
  246. navTo(`/subpackage/after-sale/transfer-ownership/transfer-confirm?id=${item.id}`)
  247. }else if (state.type == "33") {
  248. navTo(`/subpackage/after-sale/card-deactivation-activation/deactivation-activation-confirm?id=${item.id}`)
  249. }else if (state.type == "37") {
  250. // #ifdef MP-ALIPAY
  251. uni.navigateTo({
  252. url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  253. });
  254. // #endif
  255. // #ifdef MP-WEIXIN
  256. uni.navigateTo({
  257. url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  258. });
  259. // #endif
  260. }
  261. }
  262. }
  263. }
  264. </script>
  265. <style>
  266. page {
  267. width: 100%;
  268. height: 100%;
  269. background-color: #eef7f7;
  270. }
  271. </style>
  272. <style lang="scss" scoped>
  273. .flex {
  274. display: flex;
  275. justify-content: center;
  276. }
  277. .selectCar-box {
  278. height: 100%;
  279. padding: 30rpx;
  280. .item {
  281. padding: 20rpx;
  282. display: flex;
  283. justify-content: space-between;
  284. align-items: center;
  285. // height: 130rpx;
  286. background: #ffffff;
  287. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  288. border-radius: 20rpx;
  289. margin-bottom: 30rpx;
  290. .iten-left {
  291. display: flex;
  292. align-items: center;
  293. image {
  294. width: 150rpx;
  295. height: 90rpx;
  296. }
  297. text {
  298. margin-left: 20rpx;
  299. font-size: 32rpx;
  300. font-family: Noto Sans S Chinese;
  301. font-weight: 400;
  302. color: #333333;
  303. }
  304. }
  305. .choose-item {
  306. width: 44rpx;
  307. height: 44rpx;
  308. background: #ffffff;
  309. border: 2rpx solid #00b38b;
  310. border-radius: 50%;
  311. margin-right: 20rpx;
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. box-sizing: content-box;
  316. }
  317. .active {
  318. width: 34rpx;
  319. height: 34rpx;
  320. background: #00b38b;
  321. border-radius: 50%;
  322. }
  323. }
  324. }
  325. .message{
  326. font-size: 26rpx;
  327. margin-left: 6rpx;
  328. }
  329. </style>