Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

recharge.vue 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. <template>
  2. <view class="wrapper">
  3. <view class="account">
  4. <image :src="`${$imgUrl}common/bg-recharge.png`" class="head-bg" mode="aspectFill"></image>
  5. <view class="account-text">
  6. <view class="balance">
  7. <text class="balance-tit">账户余额</text>
  8. <text class="balance-val">0元</text>
  9. </view>
  10. <view class="right-box">
  11. <view class="no">账户编号:000100</view>
  12. <view class="btn btn-record" @click="goRecord()">账户充值记录</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="input-box">
  17. <input v-model="state.money" placeholder="请输入金额" class="input" />
  18. <view class="tips">最低充值金额不小于10元</view>
  19. </view>
  20. <view class="tabs">
  21. <view class="tab-tit">在线充值</view>
  22. <view class="tab">
  23. <view v-for="(item,index) in state.moneryArray" @click="tableIndexAction(index)" :key="index"
  24. :class="{'item':state.moneryArray,'active':state.tableIndex===index}">{{item.name}}</view>
  25. </view>
  26. </view>
  27. <view class="btn btn-primary" @click="rechargeAction">立即充值</view>
  28. </view>
  29. <!-- <bluetooth :routeType="2" :cardId="state.cardId" v-if="state.isShowBlue" @submit="getParams"></bluetooth> -->
  30. </template>
  31. <script setup lang="ts">
  32. import {
  33. stringToJson
  34. } from "@/utils/network/encryption";
  35. import {
  36. onLoad,
  37. onShow
  38. } from "@dcloudio/uni-app";
  39. import {
  40. quanCheck,
  41. quanApply,
  42. quanXf,
  43. cardCzPayResultCheck,
  44. cardCzApply,
  45. cardCzPay,
  46. cardCzPayResult,
  47. cardCzXFCheck,
  48. quanConfirm,
  49. wechatAppID,
  50. wechatPayConfigId,
  51. wechatSecret,
  52. } from "@/utils/network/api.js";
  53. import {
  54. request
  55. } from "@/utils/network/request.js";
  56. import {
  57. reactive
  58. } from "vue";
  59. import {
  60. navTo
  61. } from "@/utils/utils"
  62. import {
  63. msg
  64. } from "@/utils/utils";
  65. import {
  66. getItem,
  67. StorageKeys,
  68. setItem
  69. } from "@/utils/storage";
  70. // const bluetooth=require("../../components/bluetooth/bluetooth")
  71. const datas = require("../../static/etcUtil/datas.js");
  72. const bluetoothUtil = require("../../static/etcUtil/index.js");
  73. const cmd = require("../../static/etcUtil/cmdConfig.js");
  74. const tools = require("../../static/etcUtil/tools.js");
  75. const state = reactive({
  76. isShowBlue: false,
  77. moneryArray: [{
  78. name: '50元',
  79. value: 50
  80. }, {
  81. name: '100元',
  82. value: 100
  83. }, {
  84. name: '200元',
  85. value: 200
  86. }, {
  87. name: '300元',
  88. value: 300
  89. }, {
  90. name: '500元',
  91. value: 500
  92. }, {
  93. name: '1000元',
  94. value: 1000
  95. }],
  96. tableIndex: 0,
  97. openid: "",
  98. connectSuccess: undefined,
  99. fee: 5000,
  100. money: 50,
  101. orderNum: "",
  102. cardId: "", //卡号 需要传参
  103. mockpreBalance: 2000, //fix:模拟余额 目前没有检测状态接口,第一次会模拟圈层检测来检测状态
  104. show: false,
  105. items: [{
  106. value: '0',
  107. name: '微信',
  108. checked: 'true'
  109. },
  110. {
  111. value: '1',
  112. name: '对公账户'
  113. }
  114. ],
  115. current: 0
  116. });
  117. //读卡信息
  118. const card: any = reactive({
  119. cardId: "",
  120. netId: "",
  121. cardType: "",
  122. startTime: "",
  123. endTime: "",
  124. userName: "",
  125. idNum: "",
  126. vehiclePlate: "",
  127. vehiclePlateColor: "",
  128. color: "",
  129. version: "",
  130. type: "",
  131. favourable: "",
  132. money: undefined,
  133. v_userType: "",
  134. });
  135. const getParams = (val) => {
  136. console.log("val蓝牙完毕传过来的参数", val)
  137. state.cardId = val.cardId;
  138. state.connectSuccess = val.connectSuccess;
  139. }
  140. onLoad((option) => {
  141. /*获取openId 用途:(用户支付)*/
  142. getOpenID();
  143. /*传参*/
  144. state.cardId = option.cardId;
  145. state.connectSuccess = option.connectSuccess;
  146. state.orderNum = getItem("orderNum");
  147. // 金额回填,本来是好的,但是他跳转了,跳转过来就得刷新页面,所以就是默认的5000
  148. if (option.fee) {
  149. state.fee = option.fee
  150. state.money = option.fee / 100
  151. } else {
  152. state.fee = state.money * 100; //元换成分
  153. }
  154. console.log("state.fee", option)
  155. //跳转过来走圈存流程
  156. if (state.connectSuccess === "1") {
  157. /*读卡*/
  158. getCardId();
  159. } else {
  160. quanCheckAction().then((val : any) => {
  161. console.log("圈层检测val", val)
  162. //如果 圈层检测正常
  163. if (val.chargeStatus === 1) {
  164. console.log(`进行充值检测`);
  165. czCheckAction().then((checkResult : any) => {
  166. //判断订单逻辑如果有订单充值 则直接拿到订单去链接蓝牙
  167. if (checkResult.orders && checkResult.orders.length > 0) {
  168. //拿到订单,存起来
  169. state.orderNum = checkResult.orders[0].orderNum;
  170. setItem("orderNum", state.orderNum);
  171. // 检测用户是否存在有半条流水
  172. go()
  173. } else {
  174. console.log('没有可修复的流水')
  175. }
  176. });
  177. } else {
  178. // 检测用户是否存在有半条流水
  179. go()
  180. }
  181. });
  182. }
  183. });
  184. function go() {
  185. uni.showModal({
  186. title: '提示',
  187. content: '检测到你有一笔未充值的订单,请先进行充值!',
  188. success: () => {
  189. //走蓝牙进行修复
  190. uni.redirectTo({
  191. url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}&&fee=${state.fee}`,
  192. });
  193. // state.isShowBlue=true;
  194. console.log("state.isShowBlue", state.isShowBlue)
  195. },
  196. fail: () => { }
  197. })
  198. }
  199. const tableIndexAction = (val : any) => {
  200. state.tableIndex = val
  201. state.money = state.moneryArray[val].value
  202. }
  203. /*点击充值按钮*/
  204. const rechargeAction = () => {
  205. state.fee = state.money * 100; //元换成分
  206. wx.showModal({
  207. title: '圈存确认',
  208. content: '您确定要充值圈存吗',
  209. success: function (res) {
  210. if (res.confirm) {
  211. /*进行圈层检测,此处检测仅为校验圈层状态来决定去哪里*/
  212. console.log("进行圈层检测");
  213. quanCheckAction().then((val : any) => {
  214. //如果 圈层检测正常
  215. if (val.chargeStatus === 1) {
  216. console.log(`进行充值检测`);
  217. czCheckAction().then((checkResult : any) => {
  218. //判断订单逻辑如果有订单充值 则直接拿到订单去链接蓝牙
  219. if (checkResult.orders && checkResult.orders.length > 0) {
  220. //拿到订单,存起来
  221. state.orderNum = checkResult.orders[0].orderNum;
  222. setItem("orderNum", state.orderNum);
  223. //链接蓝牙
  224. go()
  225. } else {
  226. cardCzApplyAction().then((applyResult : any) => {
  227. //拿到订单 存起来
  228. state.orderNum = applyResult.orderNum;
  229. setItem("orderNum", state.orderNum);
  230. //如果订单没有支付 走支付
  231. if (applyResult.orderStatus === "ORDER_NOT_PAY") {
  232. //走支付
  233. console.log("走支付");
  234. wxPayment();
  235. }
  236. });
  237. }
  238. });
  239. } else {
  240. //走蓝牙进行修复
  241. go()
  242. }
  243. });
  244. }
  245. }
  246. });
  247. };
  248. /*读卡*/
  249. const getCardId = () => {
  250. console.log("======获取卡信息======");
  251. let cmdArr = [
  252. cmd.HOME_DIRECTORY,
  253. //选择主目
  254. cmd.APPLICATION_DIRECTORY,
  255. //选择文件1001--DF01联网收费应用目录
  256. cmd.CMD_READBINARY,
  257. //15文件--卡片发行基本数据文件
  258. cmd.CMD_GETBALANCE,
  259. //钱包
  260. ];
  261. tools.showLoadingAlert("正在执行指令");
  262. bluetoothUtil.transCmd(cmdArr, "10", function (res) {
  263. tools.hideLoadingAlert();
  264. //10:写卡 20:写OBU
  265. let str = res[2].substring(res[2].length - 4, res[2].length);
  266. let str3 = res[3].substring(res[3].length - 4, res[3].length);
  267. if (str == "9000" || str3 == "9000") {
  268. if (res[2].length > 86 || res[3] >= 12) {
  269. card.cardId = res[2].substring(20, 40); //卡号
  270. card.startTime = res[2].substring(40, 48);
  271. card.endTime = res[2].substring(48, 56);
  272. card.version = res[2].substring(18, 19) >= 4 ? "4x" : "2x";
  273. card.netId = res[2].substring(20, 24);
  274. card.cardType = res[2].substring(28, 29) == 23 ? 1 : 2;
  275. card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16);
  276. (card.money = parseInt(parseInt(res[3].substring(0, 8), 16), 10)),
  277. console.log("======卡信息======", card);
  278. if (card.cardId !== state.cardId) {
  279. msg("设备卡信息与当前充值卡号不匹配,请核对卡号");
  280. return;
  281. }
  282. quanCheckActionTrue().then((val) => {
  283. checkQuanCengEvent(val);
  284. });
  285. } else {
  286. console.error("CMD_READBINARY指令长度不符" + res[2]);
  287. tools.hideLoadingAlert();
  288. }
  289. }
  290. console.error("CMD_READBINARY指令长度不符" + res[2]);
  291. tools.hideLoadingAlert();
  292. });
  293. };
  294. const checkQuanCengEvent = (val : any) => {
  295. if (val.chargeStatus === 1) {
  296. let cmdArr = val.command.split(",");
  297. uni.showLoading({
  298. title: "写入中",
  299. });
  300. bluetoothUtil.transCmd(cmdArr, "10", function (res) {
  301. let response = res.toString();
  302. var dic = {
  303. command: val.command,
  304. cosResponse: response,
  305. };
  306. uni.hideLoading();
  307. cardCzXFCheckAction().then((xfRes) => {
  308. quanApplyAction(dic).then((value: any) => {
  309. console.log("圈层申请完后的结果");
  310. console.log(value.commandType, value);
  311. //圈存初始化验证通过 , 进行圈存
  312. if (value.commandType === 2) {
  313. uanConfirmAction(value);
  314. } else {
  315. quanApplyAction(value).then((values) => {
  316. console.log("圈层申请完后的结果");
  317. uanConfirmAction(values);
  318. });
  319. // msg("圈存初始化指令验证失败, 重新初始化");
  320. }
  321. });
  322. });
  323. });
  324. } else {
  325. let cmdArr = val.command.split(",");
  326. uni.showLoading({
  327. title: "写入中",
  328. });
  329. bluetoothUtil.transCmd(cmdArr, "10", function (res) {
  330. var status = res[1].substring(res[1].length - 4, res[1].length);
  331. console.log("打印状态");
  332. console.log(status);
  333. if (status === "9000") {
  334. console.log("修复指令入参");
  335. let response = res.toString();
  336. var dic = {
  337. command: val.command,
  338. cosResponse: response,
  339. rechargeId: val.rechargeId,
  340. };
  341. quanFixAction(dic).then((value: any) => {
  342. console.log(value);
  343. console.log("修复结果返回");
  344. var fixStatus = value.fixStatus;
  345. //圈存修复COS指令Response信息不足,重新进行修复初始化
  346. if (fixStatus === 3) {
  347. let xfcmdArr = value.command.split(",");
  348. bluetoothUtil.transCmd(xfcmdArr, "10", function (resValueData) {
  349. var status = resValueData[1].substring(
  350. resValueData[1].length - 4,
  351. resValueData[1].length
  352. );
  353. console.log("打印状态");
  354. console.log(status);
  355. if (status === "9000") {
  356. console.log(resValueData);
  357. var valueResponse = resValueData.toString();
  358. console.log(response);
  359. var applyDic = {
  360. command: value.command,
  361. cosResponse: valueResponse,
  362. rechargeId: value.rechargeId,
  363. };
  364. console.log("消费成功");
  365. quanApplyAction(applyDic).then((applyValue) => {
  366. uanConfirmAction(applyValue);
  367. });
  368. }
  369. });
  370. } else if (fixStatus === 2) {
  371. uanConfirmSucessAction(value).then((confirmResult) => {
  372. console.log("充值成功")
  373. msg("充值成功");
  374. navTo(`/pages/recharge/result`)
  375. });
  376. } else if (fixStatus === 1) {
  377. quanCheckActionTrue().then((val) => {
  378. checkQuanCengEvent(val);
  379. });
  380. }
  381. });
  382. uni.hideLoading();
  383. }
  384. });
  385. }
  386. };
  387. /*透传*/
  388. const transCmd = (cmd) => {
  389. bluetoothUtil.transCmd(cmd, "10", function (res) {
  390. var status = res[1].substring(res[1].length - 4, res[1].length);
  391. if (status === "9000") {
  392. return res.toString();
  393. }
  394. });
  395. };
  396. /*圈层检测 -假数据校验*/
  397. const quanCheckAction = () => {
  398. var data = {
  399. cardId: state.cardId, //卡号
  400. fee: state.fee,
  401. preBalance: state.mockpreBalance, //假余额
  402. tradeType: 14,
  403. };
  404. const options = {
  405. type: 2,
  406. data: data,
  407. method: "POST",
  408. showLoading: true,
  409. };
  410. return new Promise(async (resolve, reject) => {
  411. const res = await request(quanCheck, options);
  412. const data = stringToJson(res.bizContent);
  413. resolve(data);
  414. }).catch((error) => {
  415. reject(error);
  416. });
  417. };
  418. const quanCheckActionTrue = () => {
  419. console.log("进行真实圈层检测");
  420. var data = {
  421. cardId: card.cardId,
  422. fee: state.fee,
  423. preBalance: card.money,
  424. tradeType: 14,
  425. };
  426. const options = {
  427. type: 2,
  428. data: data,
  429. method: "POST",
  430. showLoading: true,
  431. };
  432. return new Promise(async (resolve, reject) => {
  433. const res = await request(quanCheck, options);
  434. const data = stringToJson(res.bizContent);
  435. resolve(data);
  436. }).catch((error) => {
  437. reject(error);
  438. });
  439. };
  440. /*充值消费*/
  441. const cardCzXFCheckAction = () => {
  442. var data = {
  443. cardId: card.cardId, //修复初始化的指令
  444. openId: getItem(StorageKeys.OpenId), //修复初始化结果
  445. orderNum: state.orderNum, //充值流水号
  446. };
  447. const options = {
  448. type: 2,
  449. data: data,
  450. method: "POST",
  451. showLoading: true,
  452. };
  453. return new Promise(async (resolve, reject) => {
  454. const res = await request(cardCzXFCheck, options);
  455. const data = stringToJson(res.bizContent);
  456. resolve(data);
  457. }).catch((error) => {
  458. reject(error);
  459. });
  460. };
  461. /*圈存修复*/
  462. const quanFixAction = (val) => {
  463. var data = {
  464. command: val.command, //修复初始化的指令
  465. cosResponse: val.cosResponse, //修复初始化结果
  466. rechargeId: val.rechargeId, //充值流水号
  467. };
  468. const options = {
  469. type: 2,
  470. data: data,
  471. method: "POST",
  472. showLoading: true,
  473. };
  474. return new Promise(async (resolve, reject) => {
  475. const res = await request(quanXf, options);
  476. const data = stringToJson(res.bizContent);
  477. resolve(data);
  478. }).catch((error) => {
  479. reject(error);
  480. });
  481. };
  482. /*圈层申请*/
  483. const quanApplyAction = (data) => {
  484. var form = {
  485. cardId: card.cardId,
  486. fee: state.fee,
  487. preBalance: card.money,
  488. tradeType: 14,
  489. command: data.command,
  490. cosResponse: data.cosResponse,
  491. orderId: state.orderNum,
  492. rechargeId: data.rechargeId,
  493. };
  494. const options = {
  495. type: 2,
  496. data: form,
  497. method: "POST",
  498. showLoading: true,
  499. };
  500. return new Promise(async (resolve, reject) => {
  501. const res = await request(quanApply, options);
  502. const data = stringToJson(res.bizContent);
  503. resolve(data);
  504. console.log("quanApplyAction", data)
  505. }).catch((error) => {
  506. reject(error);
  507. });
  508. };
  509. /*圈层确认*/
  510. const uanConfirmAction = (data: any) => {
  511. console.log("圈层确认进入");
  512. let cmdArr = data.command.split(",");
  513. console.log(cmdArr);
  514. bluetoothUtil.transCmd(cmdArr, "10", function (res: any) {
  515. console.log("圈层透传");
  516. console.log(res);
  517. var arraylenth = res.length;
  518. var status = res[arraylenth - 1].substring(
  519. res[arraylenth - 1].length - 4,
  520. res[arraylenth - 1].length
  521. );
  522. console.log("打印圈层确认指令状态");
  523. if (status === "9000") {
  524. var form = {
  525. command: data.command,
  526. cosResponse: res.toString(),
  527. rechargeId: data.rechargeId,
  528. paidAmount: state.fee,
  529. giftAmount: 0,
  530. };
  531. const options = {
  532. type: 2,
  533. data: form,
  534. method: "POST",
  535. showLoading: true,
  536. };
  537. return new Promise(async () => {
  538. const res = await request(quanConfirm, options);
  539. const data = stringToJson(res.bizContent);
  540. // resolve(data);
  541. console.log("data", data);
  542. msg("充值成功");
  543. navTo(`/pages/recharge/result`)
  544. }).catch((error) => {
  545. console.log('输出内容',error)
  546. });
  547. }
  548. });
  549. };
  550. const uanConfirmSucessAction = (data) => {
  551. var form = {
  552. command: data.command,
  553. cosResponse: "9000",
  554. rechargeId: data.rechargeId,
  555. paidAmount: state.fee,
  556. giftAmount: 0,
  557. };
  558. const options = {
  559. type: 2,
  560. data: form,
  561. method: "POST",
  562. showLoading: true,
  563. };
  564. return new Promise(async (resolve, reject) => {
  565. const res = await request(quanConfirm, options);
  566. const data = stringToJson(res.bizContent);
  567. resolve(data);
  568. console.log("uanConfirmSucessAction", data)
  569. }).catch((error) => {
  570. reject(error);
  571. });
  572. };
  573. /*充值检测*/
  574. const czCheckAction = () => {
  575. var form = {
  576. cardId: state.cardId,
  577. openId: getItem(StorageKeys.OpenId),
  578. };
  579. const options = {
  580. type: 2,
  581. data: form,
  582. method: "POST",
  583. showLoading: true,
  584. };
  585. return new Promise(async (resolve, reject) => {
  586. const res = await request(cardCzPayResultCheck, options);
  587. const data = stringToJson(res.bizContent);
  588. console.log("充值检测", data)
  589. resolve(data);
  590. }).catch((error) => {
  591. reject(error);
  592. });
  593. };
  594. /*充值申请*/
  595. const cardCzApplyAction = () => {
  596. var data = {
  597. cardId: state.cardId,
  598. openId: getItem(StorageKeys.OpenId),
  599. rechargeMoney: state.fee,
  600. };
  601. const options = {
  602. type: 2,
  603. data: data,
  604. method: "POST",
  605. showLoading: true,
  606. };
  607. return new Promise(async (resolve, reject) => {
  608. const res = await request(cardCzApply, options);
  609. const data = stringToJson(res.bizContent);
  610. resolve(data);
  611. }).catch((error) => {
  612. reject(error);
  613. });
  614. };
  615. //获取微信小程序openid
  616. const getOpenID = () => {
  617. uni.login({
  618. provider: "weixin",
  619. success: function (e) {
  620. wx.request({
  621. url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
  622. success: (res : any) => {
  623. state.openid = res.data.openid;
  624. },
  625. });
  626. },
  627. fail: function () {
  628. msg("获取不到oppenId,请检查AppID和Secret是否争取");
  629. },
  630. });
  631. };
  632. //掉起微信支付
  633. const wxPayment = () => {
  634. // #ifdef MP-WEIXIN
  635. const options = {
  636. type: 2,
  637. data: {
  638. openId: getItem(StorageKeys.OpenId),
  639. wxOpenId: state.openid,
  640. cardId: state.cardId,
  641. orderNum: state.orderNum,
  642. payConfigId: wechatPayConfigId,
  643. body: "储值卡充值",
  644. },
  645. method: "POST",
  646. showLoading: true,
  647. };
  648. request(cardCzPay, options).then((res) => {
  649. const data = stringToJson(res.bizContent);
  650. uni.requestPayment({
  651. provider: "wxpay",
  652. orderInfo: "",
  653. timeStamp: data.timestamp,
  654. nonceStr: data.noncestr,
  655. package: data.wxPackage ? data.wxPackage : "",
  656. signType: data.signType,
  657. paySign: data.sign,
  658. success: function () {
  659. //回调订单状态
  660. console.log("回调订单状态");
  661. checkOrder();
  662. },
  663. fail: function (err) {
  664. confirm(err, () => { }, "支付失败", false);
  665. },
  666. });
  667. });
  668. // #endif
  669. };
  670. //支付成功改变订单状态
  671. const checkOrder = () => {
  672. const options = {
  673. type: 2,
  674. data: {
  675. cardId: state.cardId,
  676. openId: getItem(StorageKeys.OpenId),
  677. orderNum: state.orderNum,
  678. },
  679. method: "POST",
  680. showLoading: true,
  681. };
  682. request(cardCzPayResult, options).then((res) => {
  683. const data = stringToJson(res.bizContent);
  684. if (data.tradeState === "SUCCESS")
  685. uni.redirectTo({
  686. url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}&&fee=${state.fee}`,
  687. });
  688. // state.isShowBlue=true;
  689. console.log(data);
  690. });
  691. };
  692. const goRecord = () => {
  693. uni.navigateTo({
  694. url: `/subpackage/personal-center/consumption-record?cardId=${state.cardId}`
  695. })
  696. }
  697. </script>
  698. <style>
  699. .account {
  700. height: 224rpx;
  701. width: 690rpx;
  702. margin: 30rpx;
  703. position: relative;
  704. }
  705. .account .account-text {
  706. display: flex;
  707. justify-content: space-between;
  708. padding: 20rpx 50rpx;
  709. height: 100%;
  710. }
  711. .account .balance {
  712. display: flex;
  713. flex-direction: column;
  714. justify-content: center;
  715. align-items: flex-start;
  716. color: #ffffff;
  717. }
  718. .account .balance-tit {
  719. font-size: 26rpx;
  720. margin-bottom: 10rpx;
  721. }
  722. .account .balance-val {
  723. font-size: 56rpx;
  724. }
  725. .account .right-box {
  726. display: flex;
  727. flex-direction: column;
  728. justify-content: flex-start;
  729. align-items: flex-end;
  730. }
  731. .account .right-box .no {
  732. font-size: 26rpx;
  733. color: #ffffff;
  734. }
  735. .account .right-box .btn {
  736. font-size: 26rpx;
  737. padding: 0 20rpx;
  738. box-sizing: border-box;
  739. height: 42rpx;
  740. line-height: 42rpx;
  741. color: #28d20f;
  742. background: #ffffff;
  743. border-radius: 21rpx;
  744. display: inline-block;
  745. margin-top: 18rpx;
  746. }
  747. .account .head-bg {
  748. width: 690rpx;
  749. height: 224rpx;
  750. position: absolute;
  751. left: 0;
  752. top: 0;
  753. z-index: -99;
  754. }
  755. .input-box {
  756. display: flex;
  757. flex-direction: column;
  758. justify-content: center;
  759. align-items: center;
  760. padding: 20rpx 0;
  761. }
  762. .input-box .input {
  763. width: 430rpx;
  764. height: 98rpx;
  765. line-height: 98rpx;
  766. background: #f8f8f8;
  767. border: 1px solid #999999;
  768. border-radius: 6rpx;
  769. font-size: 30rpx;
  770. text-align: center;
  771. }
  772. .input-box .tips {
  773. color: #666666;
  774. font-size: 26rpx;
  775. margin-top: 18rpx;
  776. }
  777. .tabs {}
  778. .tabs .tab-tit {
  779. font-size: 30rpx;
  780. color: #333;
  781. padding: 45rpx 0 22rpx 30rpx;
  782. }
  783. .tabs .tab {
  784. display: flex;
  785. flex-wrap: wrap;
  786. justify-content: space-evenly;
  787. }
  788. .tabs .tab .item {
  789. width: 210rpx;
  790. height: 100rpx;
  791. background: #f6fff7;
  792. border: 1px solid #dcdde1;
  793. box-sizing: border-box;
  794. line-height: 100rpx;
  795. border-radius: 6rpx;
  796. text-align: center;
  797. margin-bottom: 24rpx;
  798. color: #333333;
  799. font-size: 32rpx;
  800. }
  801. .tabs .tab .item.active {
  802. border: 1px solid #24cc49;
  803. color: #24cc49;
  804. }
  805. .btn-primary {
  806. width: 670rpx;
  807. height: 80rpx;
  808. line-height: 80rpx;
  809. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  810. border-radius: 40rpx;
  811. font-size: 32rpx;
  812. color: #ffffff;
  813. margin: 200rpx 40rpx 0;
  814. text-align: center;
  815. }
  816. .uni-list {
  817. padding: 120rpx 10rpx 0 10rpx;
  818. font-size: 34rpx;
  819. }
  820. label {
  821. display: flex;
  822. justify-content: space-between;
  823. margin-top: 30rpx;
  824. }
  825. </style>