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.

pin-code-confirm.vue 11KB

hace 2 años
hace 10 meses
hace 2 años
hace 2 años
hace 2 años
hace 1 año
hace 2 años
hace 1 año
hace 2 años
hace 11 meses
hace 2 años
hace 2 años
hace 11 meses
hace 2 años
hace 11 meses
hace 2 años
hace 11 meses
hace 2 años
hace 2 años
hace 2 años
hace 10 meses
hace 2 años
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 10 meses
hace 2 años
hace 11 meses
hace 2 años
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 1 año
hace 1 año
hace 1 año
hace 2 años
hace 2 años
hace 1 año
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 1 año
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <template>
  2. <view class="selectCar-box">
  3. <view class="details">
  4. <view class="title"> 基础信息 </view>
  5. <view class="details-item">
  6. <view> 订单编号: </view>
  7. <text>{{ orderInfos.orderId }}</text>
  8. </view>
  9. <view class="details-item">
  10. <view> 用户名称: </view>
  11. <text>{{ orderInfos.customerName }}</text>
  12. </view>
  13. <view class="details-item">
  14. <view> 用户证件类型: </view>
  15. <text>{{ getCodeName('CERTIFICATE_TYPE',orderInfos.ownerIdtype) }}</text>
  16. </view>
  17. <view class="details-item">
  18. <view> 用户证件号: </view>
  19. <text>{{ orderInfos.ownerIdnum }}</text>
  20. </view>
  21. <view class="details-item">
  22. <view> 订单车牌号: </view>
  23. <text style="color: #00b38b">{{ orderInfos.vehiclePlate }}</text>
  24. </view>
  25. <view class="details-item">
  26. <view> 车牌颜色: </view>
  27. <text style="color: #00b38b">{{
  28. orderInfos.vehiclePlateColorStr
  29. }}</text>
  30. </view>
  31. <view class="details-item">
  32. <view> 收费车型: </view>
  33. <text>{{ orderInfos.vehicleType }}</text>
  34. </view>
  35. </view>
  36. <view class="title"> 卡信息 </view>
  37. <view class="card">
  38. <view class="card-left">
  39. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  40. <view class="card-center">
  41. <view class="card-center-head"> {{orderInfos.cardId}} </view>
  42. <view class="tips">
  43. <!-- <text>储蓄卡</text> -->
  44. <text>卡状态</text>
  45. <text class="tips-card">{{getCodeName('CARD_STATE_TYPE',orderInfos.cardStatus)}}</text>
  46. </view>
  47. <view class="choose-item"> 有效期:{{orderInfos.cardExpireTime}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <button class="submit" @click="toPage" v-if="!state.flag" :disabled="state.disabled">卡PIN码解锁</button>
  52. <button class="submit" @click="toBack" v-else>返回服务中心</button>
  53. <view class="mask" v-show="state.showPopup">
  54. <view class="main">
  55. <view class="top">
  56. <image class="icon-close" :src="`${$imgUrl}common/icon-close.png`" @click="cancel"></image>
  57. </view>
  58. <block v-if="state.status">
  59. <image class="icon-success" :src="`${$imgUrl}common/success.png`"></image>
  60. <view class="title">PIN解码成功!</view>
  61. </block>
  62. <block v-else>
  63. <image class="icon-success" :src="`${$imgUrl}common/error.png`"></image>
  64. <view class="title">PIN解码失败!</view>
  65. </block>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script setup>
  71. import {
  72. reactive
  73. } from "vue";
  74. import {
  75. navTo,
  76. getFormatDate,
  77. desensitization
  78. } from "@/utils/utils";
  79. import {
  80. onLoad,
  81. onUnload,
  82. onShow
  83. } from "@dcloudio/uni-app";
  84. import {
  85. request
  86. } from "@/utils/network/request.js";
  87. import {
  88. orderDetail,
  89. pinCodeUnlock
  90. } from "@/utils/network/api.js";
  91. import {
  92. getCredentialType
  93. } from "@/subpackage/after-sale/js/credentialType.js";
  94. import {
  95. getEtcCardStatus
  96. } from "@/subpackage/after-sale/js/etcCardStatus.js";
  97. import {
  98. getObuStatus
  99. } from "@/subpackage/after-sale/js/obuStatus.js";
  100. import {
  101. getCodeName
  102. } from "@/datas/queryKey.js";
  103. import {
  104. stringToJson
  105. } from "@/utils/network/encryption";
  106. const tools = require("../../../static/etcUtil/tools.js");
  107. const bluetoothUtil = require("../../../static/etcUtil/index.js");
  108. const state = reactive({
  109. showPopup: false,
  110. flag: false,
  111. disabled: false,
  112. status: true, //解密成功状态 true 成功| false 失败
  113. })
  114. const orderInfos = reactive({
  115. orderId: "",
  116. customerName: "",
  117. ownerIdtype: "",
  118. ownerIdnum: "",
  119. vehiclePlate: "",
  120. vehiclePlateColorStr: "",
  121. vehiclePlateColor: "",
  122. vehicleType: "",
  123. cardId: "",
  124. cardStatus: "",
  125. obuId: "",
  126. obuStatus: "",
  127. cardEnableTime: "",
  128. obuEnableTime: "",
  129. cardExpireTime: ""
  130. });
  131. let ordId = '';
  132. onLoad((option) => {
  133. //请求订单详情
  134. queryOrderDetail(option.id);
  135. ordId = option.id;
  136. if (option.state) {
  137. tools.showLoadingAlert("正在执行指令");
  138. state.disabled = true;
  139. getPinCodeUnlock()
  140. }
  141. });
  142. onUnload(() => {
  143. //移除监听
  144. uni.$off('bluetoothLink')
  145. })
  146. //获取订单详情
  147. const queryOrderDetail = (id) => {
  148. const options = {
  149. type: 2,
  150. data: {
  151. id: id,
  152. },
  153. method: "POST",
  154. showLoading: true,
  155. };
  156. request(orderDetail, options).then((res) => {
  157. let orderInfo = JSON.parse(res.bizContent);
  158. console.log("orderInfo", orderInfo);
  159. orderInfos.orderId = orderInfo.orderId;
  160. orderInfos.customerName = orderInfo.customerName;
  161. orderInfos.ownerIdtype = orderInfo.ownerIdtype;
  162. orderInfos.ownerIdnum = desensitization(orderInfo.ownerIdnum);
  163. orderInfos.vehiclePlate = orderInfo.vehiclePlate;
  164. orderInfos.vehiclePlateColorStr = orderInfo.vehiclePlateColorStr;
  165. orderInfos.vehiclePlateColor = orderInfo.vehiclePlateColor;
  166. orderInfos.vehicleType = orderInfo.vehicleType;
  167. orderInfos.cardId = orderInfo.cardId;
  168. orderInfos.cardStatus = orderInfo.cardStatus;
  169. orderInfos.obuId = orderInfo.obuId;
  170. orderInfos.obuStatus = orderInfo.obuStatus;
  171. orderInfos.cardEnableTime = orderInfo.cardEnableTime.substring(0, 10);
  172. orderInfos.cardExpireTime = orderInfo.cardExpireTime;
  173. orderInfos.obuEnableTime = orderInfo.obuEnableTime.substring(0, 10);
  174. });
  175. };
  176. //PIN解锁 请求
  177. const getPinCodeUnlock = (command = null, cosResponse = null, pinType = null) => {
  178. const options = {
  179. type: 2,
  180. data: {
  181. cardId: orderInfos.cardId,
  182. pinType: "2",
  183. },
  184. method: "POST",
  185. showLoading: true,
  186. };
  187. request(pinCodeUnlock, options).then((res) => {
  188. tools.hideLoadingAlert();
  189. //第一次调用
  190. let result = stringToJson(res.bizContent);
  191. let cmdArray = result.command ? result.command.split(",") : "";
  192. if (cmdArray.length > 0) {
  193. tools.showLoadingAlert("正在执行指令");
  194. bluetoothUtil.transCmd(cmdArray, "10", function(res) {
  195. let cosResponse = res.join(",");
  196. if (cosResponse == "6985") {
  197. tools.showModalAlert("此卡未锁定", function successFunc() {});
  198. } else if (cosResponse == "9303") {
  199. tools.showModalAlert("此卡pin已永久锁定!请联系客服进行换卡处理!", function successFunc() {});
  200. } else {
  201. console.log("卡执行指令结果", res)
  202. let cosResponse = ""
  203. for (let i = 0; i < res.length; i++) {
  204. if (i < res.length - 1) {
  205. cosResponse += res[i] + ","
  206. } else {
  207. cosResponse += res[i]
  208. }
  209. }
  210. getCommandBack(result.command, cosResponse, result.pinType);
  211. }
  212. })
  213. }
  214. })
  215. };
  216. const getCommandBack = (command = null, cosResponse = null, pinType = null) => {
  217. const options = {
  218. type: 2,
  219. data: {
  220. cardId: orderInfos.cardId,
  221. command: command,
  222. cosResponse: cosResponse,
  223. pinType: "2",
  224. },
  225. method: "POST",
  226. showLoading: true,
  227. };
  228. request(pinCodeUnlock, options).then((res) => {
  229. tools.hideLoadingAlert();
  230. let result = stringToJson(res.bizContent);
  231. console.log("result===", result)
  232. if (result.cardUnblockStatus == "1") {
  233. tools.showModalAlert("解锁成功", function successFunc() {});
  234. } else if (result.cardUnblockStatus == "2") {
  235. tools.showModalAlert("解锁失败", function successFunc() {});
  236. } else if (result.cardUnblockStatus == "3") {
  237. let cmdArray = result.command ? result.command.split(",") : "";
  238. if (cmdArray.length > 0) {
  239. tools.showLoadingAlert("正在执行指令");
  240. bluetoothUtil.transCmd(cmdArray, "10", function(res) {
  241. tools.hideLoadingAlert();
  242. let cosResponse = res.join(",");
  243. if (cosResponse == "6985") {
  244. tools.alertF("此卡未锁定");
  245. } else if (cosResponse == "9303") {
  246. tools.alertF("此卡pin已永久锁定!请联系客服进行换卡处理!");
  247. } else {
  248. console.log("res=====", res)
  249. getCommandBack(result.command, cosResponse, result.pinType);
  250. }
  251. })
  252. }
  253. }
  254. })
  255. };
  256. //去连接蓝牙
  257. const toPage = () => {
  258. navTo("/pages/bluetooth/bluetooth?routeType=3&id=" + ordId); //去连接蓝牙
  259. };
  260. //返回列表
  261. const toBack = () => {
  262. uni.navigateBack({
  263. delta: 2
  264. })
  265. }
  266. //关闭弹窗
  267. const cancel = () => {
  268. state.flag = true;
  269. state.showPopup = false;
  270. }
  271. </script>
  272. <style>
  273. page {
  274. width: 100%;
  275. height: 100%;
  276. background-color: #fff;
  277. }
  278. </style>
  279. <style lang="scss" scoped>
  280. .mask {
  281. background: rgba(0, 0, 0, .35);
  282. position: fixed;
  283. left: 0;
  284. top: 0;
  285. bottom: 0;
  286. right: 0;
  287. }
  288. .main {
  289. width: 560rpx;
  290. padding: 25rpx 20rpx 55rpx;
  291. text-align: center;
  292. background: #fff;
  293. position: absolute;
  294. left: 50%;
  295. top: 50%;
  296. transform: translate(-50%, -50%);
  297. border-radius: 20rpx;
  298. .top {
  299. text-align: right;
  300. .icon-close {
  301. width: 48rpx;
  302. height: 48rpx;
  303. }
  304. }
  305. .icon-success {
  306. width: 500rpx;
  307. height: 320rpx;
  308. margin-top: 22rpx;
  309. }
  310. .title {
  311. color: #333333;
  312. font-size: 40rpx;
  313. font-weight: 600;
  314. text-align: center;
  315. margin-top: 55rpx;
  316. }
  317. }
  318. .selectCar-box {
  319. padding: 30rpx;
  320. .title {
  321. font-size: 30rpx;
  322. font-family: Microsoft YaHei UI;
  323. font-weight: 400;
  324. color: #333333;
  325. margin-bottom: 30rpx;
  326. }
  327. .details {
  328. .title {
  329. font-size: 30rpx;
  330. font-family: Microsoft YaHei UI;
  331. font-weight: 400;
  332. color: #333333;
  333. margin-bottom: 30rpx;
  334. }
  335. .details-item {
  336. display: flex;
  337. font-size: 26rpx;
  338. font-family: Noto Sans S Chinese;
  339. font-weight: 400;
  340. color: #999999;
  341. margin-bottom: 30rpx;
  342. text {
  343. font-size: 26rpx;
  344. font-family: Noto Sans S Chinese;
  345. font-weight: 400;
  346. color: #333333;
  347. }
  348. }
  349. }
  350. .card {
  351. height: 150rpx;
  352. background: #ffffff;
  353. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  354. border-radius: 20rpx;
  355. padding: 30rpx;
  356. display: flex;
  357. justify-content: space-between;
  358. align-items: center;
  359. margin-bottom: 60rpx;
  360. .card-left {
  361. display: flex;
  362. align-items: center;
  363. image {
  364. width: 100rpx;
  365. height: 90rpx;
  366. }
  367. .card-center {
  368. margin-left: 30rpx;
  369. .card-center-head {
  370. font-size: 32rpx;
  371. font-family: Noto Sans S Chinese;
  372. font-weight: 400;
  373. color: #333333;
  374. }
  375. .tips {
  376. font-size: 26rpx;
  377. font-family: Noto Sans S Chinese;
  378. font-weight: 400;
  379. color: #666666;
  380. .tips-card {
  381. width: 70rpx;
  382. height: 40rpx;
  383. background: #d3f2ef;
  384. border-radius: 6rpx;
  385. font-size: 20rpx;
  386. font-family: Noto Sans S Chinese;
  387. font-weight: 400;
  388. color: #0a8f8a;
  389. padding: 5rpx 10rpx;
  390. margin-left: 20rpx;
  391. }
  392. }
  393. }
  394. }
  395. .choose-item {
  396. margin-right: 20rpx;
  397. height: 50rpx;
  398. border-radius: 50%;
  399. display: flex;
  400. justify-content: flex-start;
  401. align-items: center;
  402. font-size: 25rpx;
  403. align-self: end;
  404. .active {
  405. width: 38rpx;
  406. height: 38rpx;
  407. background: #00b38b;
  408. border-radius: 50%;
  409. }
  410. }
  411. }
  412. .remark {
  413. font-size: 26rpx;
  414. font-family: Microsoft YaHei UI;
  415. font-weight: 400;
  416. color: #666666;
  417. text-indent: 30rpx;
  418. margin-bottom: 30rpx;
  419. }
  420. .submit {
  421. margin-top: 100rpx;
  422. width: 670rpx;
  423. height: 80rpx;
  424. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  425. border-radius: 40rpx;
  426. font-size: 32rpx;
  427. font-family: Noto Sans S Chinese;
  428. font-weight: 400;
  429. color: #ffffff;
  430. line-height: 80rpx;
  431. }
  432. .submit::after {
  433. border: 0;
  434. }
  435. .submit[disabled] {
  436. background: #f0f0f0;
  437. color: #333;
  438. }
  439. }
  440. </style>