Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

select-car.vue 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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,interceptND} from "@/utils/utils";
  26. import { onLoad} from "@dcloudio/uni-app";
  27. import { afterSaleCommQuery } 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增补设备
  41. // 30 储值卡转记账卡 31卡pin码解锁 32ETC车牌过户 33 卡签停用/卡签启用
  42. // 34月结单查询 35ETC通行流水记录 36 黑名单查询
  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 == "30") {
  68. uni.setNavigationBarTitle({
  69. title: '储值卡转记账卡-选择车辆'
  70. });
  71. }else if (options.type == "31") {
  72. uni.setNavigationBarTitle({
  73. title: '卡pin码解锁-选择车辆'
  74. });
  75. }else if (options.type == "32") {
  76. uni.setNavigationBarTitle({
  77. title: 'ETC车牌过户-选择车辆'
  78. });
  79. }else if (options.type == "33") {
  80. uni.setNavigationBarTitle({
  81. title: '卡签停用/卡签启用-选择车辆'
  82. });
  83. }else if (options.type == "34") {
  84. uni.setNavigationBarTitle({
  85. title: '月结单查询-选择车辆'
  86. });
  87. }else if (options.type == "35") {
  88. uni.setNavigationBarTitle({
  89. title: 'ETC通行流水-选择车辆'
  90. });
  91. }else if (options.type == "36") {
  92. uni.setNavigationBarTitle({
  93. title: '黑名单查询-选择车辆'
  94. });
  95. }
  96. quanCheckActionTrue().then((item : any) => {
  97. if (options.type == "32") {
  98. let data = item.result
  99. for (var k = 0; k < data.length; k++) {
  100. if (data[k]['orderStatus'] != "99999") {
  101. state.list.push(data[k])
  102. }
  103. }
  104. }else{
  105. state.list = item.result;
  106. }
  107. console.log(item);
  108. });
  109. });
  110. const quanCheckActionTrue = () => {
  111. let source = ""
  112. // #ifdef MP-ALIPAY
  113. source = "ALI"
  114. // #endif
  115. // #ifdef MP-WEIXIN
  116. source = "WECHAT"
  117. // #endif
  118. var data = {
  119. opId: getItem(StorageKeys.OpenId),
  120. loginSource:getItem("loginSource")
  121. };
  122. const options = {
  123. type: 2,
  124. data: data,
  125. method: "POST",
  126. showLoading: true,
  127. };
  128. return new Promise(async (resolve, reject) => {
  129. const res = await requestNew(afterSaleCommQuery, options);
  130. const data = res;
  131. resolve(data);
  132. }).catch((error) => {
  133. reject(error);
  134. });
  135. };
  136. const flag = ref("0");
  137. const choose = (i, item) => {
  138. console.log(item.cardId);
  139. interceptND(item.vehicleId).then(()=>{
  140. flag.value = i
  141. // 判断9901
  142. // 月结单查询 etc通行流水记录 黑名单查询 目前不用跳转到插件
  143. if (state.type == "34") {
  144. navTo(`/subpackage/after-sale/month-statement/month-statement-query-list?vehicleId=${item.vehicleId}`)
  145. }else if (state.type == "35") {
  146. navTo(`/subpackage/personal-center/search/etcFlowingWater?vehicleId=${item.vehicleId}`)
  147. }else if (state.type == "36") {
  148. uni.navigateTo({
  149. url: `/subpackage/after-sale/blacklist-query/list?vehiclePlate=${item.vehiclePlate}&vehiclePlateColor=${item.vehiclePlateColor}&cardId=${item.cardId}`
  150. })
  151. }else{
  152. if (item.deviceType == deviceType) {
  153. // OBU重新激活跳转
  154. const params = encodeURIComponent(JSON.stringify(item))
  155. jump(state.type, params)
  156. } else {
  157. if (state.type == "1") {
  158. // #ifdef MP-WEIXIN
  159. navTo(
  160. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  161. );
  162. // #endif
  163. // #ifdef MP-ALIPAY
  164. navTo(
  165. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.id}`
  166. );
  167. // #endif
  168. } else if (state.type == "2") {
  169. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?vehicleId=${item.vehicleId}`)
  170. } else if (state.type == "3") {
  171. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?vehicleId=${item.vehicleId}`)
  172. } else if (state.type == "4") {
  173. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?id=${item.id}&orderId=${item.orderId}`)
  174. } else if (state.type == "5") {
  175. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?vehicleId=${item.vehicleId}`)
  176. }else if (state.type == "6") {
  177. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  178. }else if (state.type == "30") {
  179. navTo(`/subpackage/after-sale/to-bookkeeping-card/confirm?id=${item.id}`)
  180. }else if (state.type == "31") {
  181. navTo(`/subpackage/after-sale/pin-code-deblocking/pin-code-confirm?id=${item.id}`);
  182. }else if (state.type == "32") {
  183. navTo(`/subpackage/after-sale/transfer-ownership/transfer-confirm?id=${item.id}`)
  184. }else if (state.type == "33") {
  185. navTo(`/subpackage/after-sale/card-deactivation-activation/deactivation-activation-confirm?id=${item.id}`)
  186. }
  187. }
  188. }
  189. })
  190. }
  191. </script>
  192. <style>
  193. page {
  194. width: 100%;
  195. height: 100%;
  196. background-color: #eef7f7;
  197. }
  198. </style>
  199. <style lang="scss" scoped>
  200. .flex {
  201. display: flex;
  202. justify-content: center;
  203. }
  204. .selectCar-box {
  205. height: 100%;
  206. padding: 30rpx;
  207. .item {
  208. padding: 20rpx;
  209. display: flex;
  210. justify-content: space-between;
  211. align-items: center;
  212. // height: 130rpx;
  213. background: #ffffff;
  214. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  215. border-radius: 20rpx;
  216. margin-bottom: 30rpx;
  217. .iten-left {
  218. display: flex;
  219. align-items: center;
  220. image {
  221. width: 150rpx;
  222. height: 90rpx;
  223. }
  224. text {
  225. margin-left: 20rpx;
  226. font-size: 32rpx;
  227. font-family: Noto Sans S Chinese;
  228. font-weight: 400;
  229. color: #333333;
  230. }
  231. }
  232. .choose-item {
  233. width: 44rpx;
  234. height: 44rpx;
  235. background: #ffffff;
  236. border: 2rpx solid #00b38b;
  237. border-radius: 50%;
  238. margin-right: 20rpx;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. box-sizing: content-box;
  243. }
  244. .active {
  245. width: 34rpx;
  246. height: 34rpx;
  247. background: #00b38b;
  248. border-radius: 50%;
  249. }
  250. }
  251. }
  252. .message{
  253. font-size: 26rpx;
  254. margin-left: 6rpx;
  255. }
  256. </style>