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.

deviceInfo.vue 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <template>
  2. <view class="wrapper">
  3. <view class="info-card">
  4. <view class="title">卡信息</view>
  5. <view class="cell">
  6. <view class="cell-left">卡号</view>
  7. <view class="cell-right">{{ card.cardNo }}</view>
  8. </view>
  9. <view class="cell">
  10. <view class="cell-left">用户姓名</view>
  11. <view class="cell-right"><textFilter :loading="card.loading" :text="card.userNameStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  12. </view>
  13. <view class="cell">
  14. <view class="cell-left">身份证号</view>
  15. <view class="cell-right"><textFilter :loading="card.loading" :text="card.idNumStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  16. </view>
  17. <view class="cell">
  18. <view class="cell-left">车辆类型</view>
  19. <view class="cell-right"><textFilter :loading="card.loading" :text="card.typeStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  20. </view>
  21. <view class="cell">
  22. <view class="cell-left">车牌号</view>
  23. <view class="cell-right"><textFilter :loading="card.loading" :text="card.vehiclePlate" :typeStr="card.typeStr" type="1"></textFilter></view>
  24. </view>
  25. <view class="cell">
  26. <view class="cell-left">车牌颜色</view>
  27. <view class="cell-right"><textFilter :loading="card.loading" :text="card.colorStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  28. </view>
  29. <view class="cell">
  30. <view class="cell-left">启用时间</view>
  31. <view class="cell-right"><textFilter :loading="card.loading" :text="card.startTime" :typeStr="card.typeStr" type="1"></textFilter></view>
  32. </view>
  33. <view class="cell">
  34. <view class="cell-left">结束时间</view>
  35. <view class="cell-right"><textFilter :loading="card.loading" :text="card.endTime" :typeStr="card.typeStr" type="1"></textFilter></view>
  36. </view>
  37. <view class="cell">
  38. <view class="cell-left">卡签绑定</view>
  39. <view class="cell-right"><textFilter :loading="card.loading" :text="card.favourableStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  40. </view>
  41. <view class="cell">
  42. <view class="cell-left">校验值</view>
  43. <view class="cell-right"><textFilter :loading="card.loading" :text="card.money" :typeStr="card.typeStr" type="1"></textFilter></view>
  44. </view>
  45. <view class="cell">
  46. <view class="cell-left">版本号</view>
  47. <view class="cell-right">{{ card.version || '未知版本'}}</view>
  48. </view>
  49. <view class="cell" v-if="state.cardStatus">
  50. <view class="cell-left">卡状态</view>
  51. <view class="cell-right"><textFilter :loading="card.loading" :text="getCodeName('CARD_STATUS',state.cardStatus)" :typeStr="card.typeStr" type="1"></textFilter></view>
  52. </view>
  53. <view class="cell" v-if="state.cardTypeNameStr">
  54. <view class="cell-left">卡类型</view>
  55. <view class="cell-right"><textFilter :loading="card.loading" :text="card.cardTypeNameStr" :typeStr="card.typeStr" type="1"></textFilter></view>
  56. </view>
  57. <view class="cell" v-if="card.cardTypeName === 'STORED_VALUE_CARD'">
  58. <view class="cell-left">卡余额</view>
  59. <view class="cell-right"><textFilter :loading="card.loading" :text="card.cardBalance" :typeStr="card.typeStr" type="1"></textFilter></view>
  60. </view>
  61. </view>
  62. <view class="info-card">
  63. <view class="title">OBU信息</view>
  64. <view class="cell">
  65. <view class="cell-left">obu号</view>
  66. <view class="cell-right">{{ obu.num }}</view>
  67. </view>
  68. <view class="cell">
  69. <view class="cell-left">车辆类型</view>
  70. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.typeStr" :typeStr="obu.typeStr" type="2"></textFilter></view>
  71. </view>
  72. <view class="cell">
  73. <view class="cell-left">车辆用户类型</view>
  74. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.userTypeStr" :typeStr="obu.typeStr" type="2"></textFilter></view>
  75. </view>
  76. <view class="cell">
  77. <view class="cell-left">车牌号</view>
  78. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.vehiclePlate" :typeStr="obu.typeStr" type="2"></textFilter></view>
  79. </view>
  80. <view class="cell">
  81. <view class="cell-left">车牌颜色</view>
  82. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.vehiclePlateColorStr" :typeStr="obu.typeStr" type="2"></textFilter></view>
  83. </view>
  84. <view class="cell">
  85. <view class="cell-left">核定载人数</view>
  86. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.approvedCount" :typeStr="obu.typeStr" type="2"></textFilter></view>
  87. </view>
  88. <view class="cell">
  89. <view class="cell-left">车辆识别代号</view>
  90. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.vin" :typeStr="obu.typeStr" type="2"></textFilter></view>
  91. </view>
  92. <view class="cell">
  93. <view class="cell-left">车牌发动机号</view>
  94. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.engineNum" :typeStr="obu.typeStr" type="2"></textFilter></view>
  95. </view>
  96. <view class="cell">
  97. <view class="cell-left">车轴数</view>
  98. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.axleCount" :typeStr="obu.typeStr" type="2"></textFilter></view>
  99. </view>
  100. <view class="cell">
  101. <view class="cell-left">车轮数</view>
  102. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.wheelCount" :typeStr="obu.typeStr" type="2"></textFilter></view>
  103. </view>
  104. <view class="cell">
  105. <view class="cell-left">轴距</view>
  106. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.axleDistance" :typeStr="obu.typeStr" type="2"></textFilter></view>
  107. </view>
  108. <view class="cell">
  109. <view class="cell-left">外廓尺寸</view>
  110. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.outsideDimensions ? obu.outsideDimensions + 'mm' : ''" :typeStr="obu.typeStr" type="2"></textFilter></view>
  111. </view>
  112. <view class="cell">
  113. <view class="cell-left">启用时间</view>
  114. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.startTime" :typeStr="obu.typeStr" type="2"></textFilter></view>
  115. </view>
  116. <view class="cell">
  117. <view class="cell-left">结束时间</view>
  118. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.endTime" :typeStr="obu.typeStr" type="2"></textFilter></view>
  119. </view>
  120. <view class="cell">
  121. <view class="cell-left">是否激活</view>
  122. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.isJHStr" :typeStr="obu.typeStr" type="2"></textFilter></view>
  123. </view>
  124. <view class="cell">
  125. <view class="cell-left">拆卸状态</view>
  126. <view class="cell-right"><textFilter :loading="obu.loading" :text="obu.loadStatus" :typeStr="obu.typeStr" type="2"></textFilter></view>
  127. </view>
  128. <view class="cell">
  129. <view class="cell-left">版本号</view>
  130. <view class="cell-right">{{ obu.version || '未知版本' }}</view>
  131. </view>
  132. <template v-if="obu.obuVehicleType">
  133. <view class="cell" v-if="state.obuStatus">
  134. <view class="cell-left">签状态</view>
  135. <view class="cell-right"><textFilter :loading="obu.loading" :text="getCodeName('OBU_STATUS',state.obuStatus)" :typeStr="obu.typeStr" type="2"></textFilter></view>
  136. </view>
  137. </template>
  138. </view>
  139. <view class="btn" @click="back">返回</view>
  140. </view>
  141. </template>
  142. <script setup>
  143. import {
  144. getCodeName
  145. } from "@/datas/queryKey.js";
  146. import {
  147. reactive
  148. } from "vue";
  149. import {
  150. onLoad,
  151. onUnload
  152. } from "@dcloudio/uni-app";
  153. import {
  154. requestNew
  155. } from "@/utils/network/request";
  156. import {cardObuQuery,obuFileDataDecrypt,cardObuQueryinLog, saveRecord} from "@/utils/network/api";
  157. import {
  158. getVehicleType
  159. } from "@/subpackage/after-sale/js/vehicleType.js"
  160. import {
  161. getVehiclePlateColor
  162. } from "@/datas/vehiclePlateColor.js"
  163. import {
  164. decryptCardVehicleInformation
  165. } from "@/datas/publicRequest";
  166. import textFilter from './components/textFilter.vue'
  167. const cmd = require("../../../static/etcUtil/cmdConfig.js");
  168. const tools = require("../../../static/etcUtil/tools.js");
  169. const datas = require("../../../static/etcUtil/datas.js");
  170. const bluetoothUtil = require("../../../static/etcUtil/index.js");
  171. const card = reactive({
  172. cardNo: "",
  173. startTime: "",
  174. endTime: "",
  175. userName: "",
  176. userNameStr:"",
  177. idNum: "",
  178. idNumStr:"",
  179. vehiclePlate: "",
  180. vehiclePlateColor: "",
  181. color: "",
  182. colorStr:"",
  183. version: "",
  184. type: "",
  185. typeStr:"",
  186. favourable: "",
  187. favourableStr:"",
  188. money: "",
  189. v_userType: "",
  190. loading: true,
  191. cardTypeName: '',
  192. cardTypeNameStr: '',
  193. cardBalance: ''
  194. })
  195. const obu = reactive({
  196. num: "",
  197. startTime: "",
  198. endTime: "",
  199. version: "",
  200. approvedCount: "",
  201. axleCount: "",
  202. axleDistance: "",
  203. engineNum: "",
  204. type: "",
  205. typeStr:"",
  206. userType: "",
  207. userTypeStr:"",
  208. vehiclePlate: "",
  209. vehiclePlateColor: "",
  210. vehiclePlateColorStr:"",
  211. vin: "",
  212. wheelCount: "",
  213. isJH: "",
  214. isJHStr: "",
  215. outsideDimensions: "",
  216. loadStatus:"",
  217. loading: true
  218. })
  219. const state = reactive({
  220. vehicleId: "",
  221. obuStatus: "",
  222. cardStatus: "",
  223. cardTypeName: "",
  224. backIndex:""
  225. })
  226. onLoad((option) => {
  227. state.backIndex=option.backIndex
  228. getCardId()
  229. })
  230. /**
  231. * 获取卡号
  232. */
  233. const getCardId = () => {
  234. //执行0015文件
  235. tools.showLoadingAlert("执行指令");
  236. let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, cmd.CMD_READBINARY, cmd.CMD_GETBALANCE];
  237. console.log(cmdArr);
  238. bluetoothUtil.transCmd(cmdArr, '10', function(res) { //10:写卡 20:写OBU
  239. console.log("5201",res)
  240. let str = res[2].substring(res[2].length - 4, res[2].length); //判断是否为9000
  241. let str3 = res[3].substring(res[3].length - 4, res[3].length); //判断是否为9000
  242. if (str == "9000" || str3 == "9000") {
  243. if (res[2].length > 86 || res[3] >= 12) {
  244. console.log("res[2]", res[2].substring(84, 86), getVehiclePlateColor(parseInt(res[2]
  245. .substring(82, 84), 16)), res[2].substring(18, 19))
  246. card.cardNo = res[2].substring(20, 40);
  247. card.startTime = res[2].substring(40, 48);
  248. card.endTime = res[2].substring(48, 56);
  249. card.version = res[2].substring(18, 20);
  250. card.money = res[3].substring(0, 8);
  251. card.v_userType = parseInt(res[2].substring(80, 82), 16);
  252. console.log("card.v_userType", card.v_userType)
  253. decryptCardVehicleInformation(res[2].substring(56, 80), function (res) {
  254. card.vehiclePlate =res;
  255. });
  256. console.log("res[2].substring(18, 19)",res[2].substring(18, 20))
  257. if (res[2].substring(18, 19) >= 4) {
  258. //4x卡
  259. card.type = parseInt(res[2].substring(84, 86), 16);
  260. card.typeStr = getVehicleType(parseInt(res[2].substring(84, 86), 16));
  261. card.color = parseInt(res[2].substring(82, 84), 16)
  262. card.colorStr = getVehiclePlateColor(parseInt(res[2].substring(82, 84), 16))
  263. } else {
  264. //2x卡--获取车牌颜色
  265. card.type = "--";
  266. card.color =parseInt(res[2].substring(82, 84), 16)
  267. card.colorStr = getVehiclePlateColor(parseInt(res[2].substring(82, 84), 16))
  268. card.typeStr = getVehicleType(parseInt(res[2].substring(84, 86), 16));
  269. }
  270. state.vehicleId = card.vehiclePlate + "_" + parseInt(res[2].substring(82, 84), 16)
  271. // 读卡信息
  272. // getCardList()
  273. //执行0016文件
  274. let arr = [cmd.HOME_DIRECTORY, cmd.PERSONAL_INFORMATION]
  275. bluetoothUtil.transCmd(arr, '10', function(res) {
  276. let str2 = res[1].substring(res[1].length - 4, res[1].length);
  277. if (str2 == "9000") {
  278. if (res[1].length > 108) {
  279. console.log("res====",res)
  280. decryptCardVehicleInformation(res[1].substring(4, 44), function (res) {
  281. card.userName = res; //姓名
  282. card.userNameStr = card.userName[0] + '*'.repeat(card.userName.length - 1)
  283. });
  284. decryptCardVehicleInformation(res[1].substring(44, 108), function (res) {
  285. card.idNum = res; //身份证号码
  286. card.idNumStr=res.replace(/^\d{14}/,'**************')
  287. });
  288. //获取是否有优惠
  289. let cmdArr3 = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, cmd
  290. .CMD_00B08E0000
  291. ];
  292. bluetoothUtil.transCmd(cmdArr3, '10', function(res) {
  293. let str3 = res[2].substring(res[2].length - 4, res[2]
  294. .length);
  295. card.loading = false
  296. if (str3 == "9000") {
  297. if (res[2].length > 131) {
  298. let _str = parseInt(res[2].substring(129, 130),
  299. 16);
  300. card.favourable=_str
  301. switch (_str) {
  302. case 0:
  303. card.favourableStr = "否";
  304. break;
  305. case 1:
  306. card.favourableStr = "是";
  307. break;
  308. default:
  309. card.favourableStr = '未知' + "_" + _str;
  310. break;
  311. }
  312. //回调读取OBU指令
  313. getObuId()
  314. tools.hideLoadingAlert();
  315. } else {
  316. alertF("CMD_00B08E0000指令长度不符" + res[2]);
  317. }
  318. return;
  319. }
  320. obu.loading = false
  321. alertF(cmd.PERSONAL_INFORMATION + "_" + str);
  322. })
  323. } else {
  324. card.loading = false
  325. alertF("PERSONAL_INFORMATION指令长度不符" + res[1]);
  326. }
  327. return;
  328. }
  329. card.loading = false
  330. alertF("PERSONAL_INFORMATION指令长度不符" + res[1]);
  331. }, () => {
  332. card.loading = false
  333. })
  334. } else {
  335. card.loading = false
  336. alertF("CMD_READBINARY指令长度不符" + res[2]);
  337. }
  338. return;
  339. }
  340. card.loading = false
  341. alertF("CMD_READBINARY指令长度不符" + res[2]);
  342. }, () => {
  343. card.loading = false
  344. })
  345. };
  346. /**
  347. * 获取OBU号
  348. */
  349. const getObuId = () => {
  350. tools.showLoadingAlert("执行指令");
  351. let cmdArr = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE];
  352. bluetoothUtil.transCmd(cmdArr, '20', function(res) {
  353. let str = res[1].substring(res[1].length - 4, res[1].length);
  354. if (str == "9000") {
  355. if (res[1].length > 52) {
  356. obu.num = res[1].substring(20, 36);
  357. obu.startTime = res[1].substring(36, 44);
  358. obu.endTime = res[1].substring(44, 52);
  359. obu.version = res[1].substring(18, 20);
  360. obu.isJH = res[1].substring(53, 54)
  361. obu.isJHStr = res[1].substring(53, 54) == "1" ? "是" : res[1].substring(53, 54) == "0" ?
  362. "否" : "其他:" + res[1].substring(53, 54);
  363. console.log("我的loadStatus:",res[1].substring(52, 54))
  364. obu.loadStatus=res[1].substring(52, 54)=='01'?'正常':'已拆卸',
  365. console.log("开始执行车辆信息识读");
  366. let rand = res[1].substring(18, 20) >= 50?'40':'00';
  367. var arr = [cmd.OBU_DF01, '00B400000A000000000000000045'+ rand];
  368. bluetoothUtil.transCmd(arr, '20', function(res) {
  369. console.log(res);
  370. console.log("开始执行车辆信息识读成功");
  371. obu.loading = false
  372. let str2 = res[1].substring(res[1].length - 4, res[1].length);
  373. let obuVersion = res[1].substring(18, 20);
  374. let keyIndex = obuVersion > 50 ? '40' : '00';
  375. let reqType = '00';
  376. let proviceCode = '5201';
  377. if (str2 == "9000") {
  378. console.log("===========", obu.num, res[1].substring(0, res[1].length - 4))
  379. decryptObuVehicleInfo(obu.num, res[1].substring(0, res[1].length - 4),
  380. obuVersion, rand, reqType, proviceCode,
  381. function(res) {
  382. obu.approvedCount = res.approvedCount;
  383. obu.axleCount = res.axleCount;
  384. obu.axleDistance = res.axleDistance;
  385. obu.engineNum = res.engineNumber.replace(/\u0000/g, '');
  386. obu.type = res.collectionType;
  387. obu.typeStr = getVehicleType(res.collectionType);
  388. obu.userType = res.userType;
  389. if(res.userType == 0){
  390. obu.userTypeStr = "普通车" ;
  391. }else if(res.userType == 6){
  392. obu.userTypeStr = "公务车" ;
  393. }
  394. obu.vehiclePlate = res.vehiclePlate.replace(/\u0000/g, '');
  395. //获取车牌颜色
  396. obu.vehiclePlateColor = res.vehiclePlateColor;
  397. obu.vehiclePlateColorStr = getVehiclePlateColor(res.vehiclePlateColor);
  398. obu.vin = res.vin.replace(/\u0000/g, '');
  399. obu.wheelCount = res.wheelsCount;
  400. obu.outsideDimensions = res.carLong + "x" + res.carWidth + "x" + res.carHeight
  401. saveRecordApi();
  402. tools.hideLoadingAlert();
  403. });
  404. //断开蓝牙
  405. bluetoothUtil.disconnectDevice();
  406. // tools.showToastAlert("蓝牙已断开");
  407. console.log('蓝牙已断开=========')
  408. return;
  409. }
  410. obu.loading = false
  411. alertF("OBU_00B400000A+rand+OBU_4F00指令长度不符" + res[1]);
  412. }, () => {
  413. obu.loading = false
  414. })
  415. } else {
  416. obu.loading = false
  417. alertF("OBU_SYSTEM_FILE指令长度不符" + res[1]);
  418. }
  419. return;
  420. }
  421. obu.loading = false
  422. alertF("OBU_SYSTEM_FILE指令长度不符" + res[1]);
  423. }, () => {
  424. obu.loading = false
  425. })
  426. };
  427. const saveRecordApi = () => {
  428. let params = {
  429. cardId: card.cardNo || '',
  430. cardVersion: card.version || '',
  431. obuId: obu.num || '',
  432. obuVersion: obu.version || '',
  433. approvedCount: "",
  434. axleCount: "", // 车轴数
  435. axleDistance: "", // 轴距
  436. bindingFinishStatus: "", // 卡签绑定完成状态
  437. cardEnableTime: "", // 卡启用时间
  438. cardExpireTime: "", // 卡过期时间
  439. cardVehiclePlate: "", // 车牌号码
  440. cardVehiclePlateColor: "", // 车牌颜色
  441. cardVehicleType: "", // 行驶证车辆类型
  442. checksums: "", // 校验值
  443. customerIdNum: "", // 身份证号
  444. customerName: "", // 用户姓名
  445. isActive: "", // 是否激活
  446. loadStatus: "", // 拆卸状态
  447. obuEnableTime: "", // 启用时间
  448. obuExpireTime: "", // 到期时间
  449. obuVehicleCustomerType: "", // 车辆用户类型
  450. obuVehiclePlate: "", // 车牌号码
  451. obuVehiclePlateColor: "", // 车牌颜色
  452. obuVehicleType: "", // 行驶证车辆类型
  453. vehicleDimensions: "", // 外廓尺寸
  454. vehicleEngineNum: "", // 发动机号码
  455. vin: "", // 车辆识别代码
  456. wheelCount: "", // 车轮数
  457. }
  458. if (card.typeStr) {
  459. params.cardVehicleType = card.typeStr
  460. params.bindingFinishStatus = card.favourableStr
  461. params.cardEnableTime = card.startTime
  462. params.cardExpireTime = card.endTime
  463. params.cardVehiclePlate = card.vehiclePlate
  464. params.cardVehiclePlateColor = card.colorStr
  465. params.checksums = card.money
  466. params.customerIdNum = card.idNum
  467. params.customerName = card.userName
  468. params.cardBalance = card.cardBalance
  469. }
  470. if (obu.typeStr) {
  471. params.obuVehicleType = obu.typeStr
  472. params.approvedCount = obu.approvedCount
  473. params.axleCount = obu.axleCount
  474. params.axleDistance = obu.axleDistance
  475. params.isActive = obu.isJHStr
  476. params.loadStatus = obu.loadStatus
  477. params.obuEnableTime = obu.startTime
  478. params.obuExpireTime = obu.endTime
  479. params.obuVehicleCustomerType = obu.userTypeStr
  480. params.obuVehiclePlate = obu.vehiclePlate
  481. params.obuVehiclePlateColor = obu.vehiclePlateColorStr
  482. params.vehicleDimensions = obu.outsideDimensions
  483. params.vehicleEngineNum = obu.engineNum
  484. params.vin = obu.vin
  485. params.wheelCount = obu.wheelCoun
  486. }
  487. const options = {
  488. type: 2,
  489. data: params,
  490. method: "POST",
  491. showLoading: false,
  492. };
  493. requestNew(saveRecord, options).then((res) => {
  494. console.log("saveRecord", card, obu, state)
  495. getObuList()
  496. });
  497. }
  498. /**
  499. * 解密OBU车辆信息
  500. */
  501. const decryptObuVehicleInfo = (num, data,obuVersion, keyIndex, reqType, proviceCode, func) => {
  502. const options = {
  503. type: 2,
  504. data: {
  505. contractSN: num,
  506. cipherData: data,
  507. reqType: reqType,
  508. keyIndex: keyIndex,
  509. proviceCode: proviceCode
  510. },
  511. method: "POST",
  512. showLoading: true,
  513. };
  514. requestNew(obuFileDataDecrypt, options).then((res) => {
  515. console.log("obuFileDataDecrypt",res)
  516. const data =res
  517. func(data)
  518. });
  519. };
  520. //返回按钮
  521. const back = () => {
  522. uni.$emit("refreshOrder");
  523. if(state.backIndex=="1"){
  524. uni.switchTab({
  525. url: "/pages/index/index"
  526. })
  527. }else{
  528. uni.redirectTo({
  529. url: "/pages/order/order"
  530. })
  531. }
  532. }
  533. //提示对话框
  534. const alertF = (msg) => {
  535. //隐藏加载框
  536. tools.hideLoadingAlert();
  537. //提示对话框
  538. tools.showModalAlert(msg);
  539. }
  540. const getObuList = () => {
  541. var data = {
  542. obuId: obu.num,
  543. cardId:card.cardNo,
  544. };
  545. const options = {
  546. type: 2,
  547. data: data,
  548. method: "POST",
  549. showLoading: true,
  550. };
  551. requestNew(cardObuQuery, options).then((res) => {
  552. tools.hideLoadingAlert();
  553. let result = res;
  554. state.obuStatus = result.obuStatus?result.obuStatus:""
  555. state.cardStatus = result.cardStatus
  556. if (result.cardType == 'PRE_CHARGE_CARD') {
  557. state.cardTypeName = "预存卡"
  558. card['cardTypeName']=3
  559. card['cardTypeNameStr']="预存卡"
  560. } else if (result.cardType == 'STORED_VALUE_CARD') {
  561. state.cardTypeName = "储值卡"
  562. card['cardTypeName']=2
  563. card['cardTypeNameStr']= "储值卡"
  564. } else if (result.cardType == 'CHARGE_CARD'){
  565. state.cardTypeName = "记账卡"
  566. card['cardTypeName']=1
  567. card['cardTypeNameStr'] = "记账卡"
  568. }
  569. // 卡签提交得信息
  570. card['cardStatus']=result.cardStatus
  571. obu['obuStatus']=result.obuStatus?result.obuStatus:""
  572. })
  573. }
  574. // 空字段处理
  575. const displayValue = (value, type) => {
  576. if (type === 1) {
  577. return card.typeStr ? value : '--'
  578. } else if (type === 2) {
  579. return obu.typeStr ? value : '--'
  580. }
  581. }
  582. </script>
  583. <style scoped>
  584. .wrapper {
  585. padding-bottom: 50rpx;
  586. background: #E9EDF0;
  587. overflow: hidden;
  588. }
  589. .info-card {
  590. margin: 30rpx;
  591. border-radius: 16rpx;
  592. padding-bottom: 40rpx;
  593. background-color: white;
  594. padding: 0 30rpx;
  595. box-sizing: border-box;
  596. }
  597. .info-card .title {
  598. padding: 30rpx 0;
  599. font-size: 36rpx;
  600. text-align: center;
  601. color: #01243A;
  602. }
  603. .info-card .cell {
  604. display: flex;
  605. flex-direction: row;
  606. padding: 18rpx 0rpx;
  607. font-size: 30rpx;
  608. border-bottom: 1rpx solid #E6E9EB;
  609. }
  610. .cell-left {
  611. flex: 1;
  612. text-align: left;
  613. color: #6C6C6C;
  614. }
  615. .cell-right {
  616. margin-left: 30rpx;
  617. text-align: right;
  618. color: #111111;
  619. overflow: hidden;
  620. }
  621. .btn {
  622. background: linear-gradient(to right,#01243A,#004576);
  623. opacity: 1;
  624. border-radius: 100rpx;
  625. color: #fff;
  626. font-size: 30rpx;
  627. height: 80rpx;
  628. line-height: 80rpx;
  629. box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5);
  630. width: 670rpx;
  631. margin: 40rpx;
  632. text-align: center;
  633. }
  634. </style>