Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

recharge.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  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 = 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) => {
  309. console.log("圈层申请完后的结果");
  310. console.log(value.commandType,value);
  311. //圈存初始化验证通过 , 进行圈存
  312. if (value.commandType === 2) {
  313. uanConfirmAction(value).then((confirmResult) => {
  314. console.log("充值成功1111")
  315. msg("充值成功");
  316. navTo(`/pages/recharge/result`)
  317. });
  318. } else {
  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) => {
  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).then((
  367. confirmResult) => {
  368. console.log("充值成功222")
  369. msg("充值成功");
  370. navTo(
  371. `/pages/recharge/result`)
  372. });
  373. });
  374. }
  375. });
  376. } else if (fixStatus === 2) {
  377. uanConfirmSucessAction(value).then((confirmResult) => {
  378. console.log("充值成功")
  379. msg("充值成功");
  380. navTo(`/pages/recharge/result`)
  381. });
  382. } else if (fixStatus === 1) {
  383. quanCheckActionTrue().then((val) => {
  384. checkQuanCengEvent(val);
  385. });
  386. }
  387. });
  388. uni.hideLoading();
  389. }
  390. });
  391. }
  392. };
  393. /*透传*/
  394. const transCmd = (cmd) => {
  395. bluetoothUtil.transCmd(cmd, "10", function(res) {
  396. var status = res[1].substring(res[1].length - 4, res[1].length);
  397. if (status === "9000") {
  398. return res.toString();
  399. }
  400. });
  401. };
  402. /*圈层检测 -假数据校验*/
  403. const quanCheckAction = () => {
  404. var data = {
  405. cardId: state.cardId, //卡号
  406. fee: state.fee,
  407. preBalance: state.mockpreBalance, //假余额
  408. tradeType: 14,
  409. };
  410. const options = {
  411. type: 2,
  412. data: data,
  413. method: "POST",
  414. showLoading: true,
  415. };
  416. return new Promise(async (resolve, reject) => {
  417. const res = await request(quanCheck, options);
  418. const data = stringToJson(res.bizContent);
  419. resolve(data);
  420. }).catch((error) => {
  421. reject(error);
  422. });
  423. };
  424. const quanCheckActionTrue = () => {
  425. console.log("进行真实圈层检测");
  426. var data = {
  427. cardId: card.cardId,
  428. fee: state.fee,
  429. preBalance: card.money,
  430. tradeType: 14,
  431. };
  432. const options = {
  433. type: 2,
  434. data: data,
  435. method: "POST",
  436. showLoading: true,
  437. };
  438. return new Promise(async (resolve, reject) => {
  439. const res = await request(quanCheck, options);
  440. const data = stringToJson(res.bizContent);
  441. resolve(data);
  442. }).catch((error) => {
  443. reject(error);
  444. });
  445. };
  446. /*充值消费*/
  447. const cardCzXFCheckAction = () => {
  448. var data = {
  449. cardId: card.cardId, //修复初始化的指令
  450. openId: getItem(StorageKeys.OpenId), //修复初始化结果
  451. orderNum: state.orderNum, //充值流水号
  452. };
  453. const options = {
  454. type: 2,
  455. data: data,
  456. method: "POST",
  457. showLoading: true,
  458. };
  459. return new Promise(async (resolve, reject) => {
  460. const res = await request(cardCzXFCheck, options);
  461. const data = stringToJson(res.bizContent);
  462. resolve(data);
  463. }).catch((error) => {
  464. reject(error);
  465. });
  466. };
  467. /*圈存修复*/
  468. const quanFixAction = (val) => {
  469. var data = {
  470. command: val.command, //修复初始化的指令
  471. cosResponse: val.cosResponse, //修复初始化结果
  472. rechargeId: val.rechargeId, //充值流水号
  473. };
  474. const options = {
  475. type: 2,
  476. data: data,
  477. method: "POST",
  478. showLoading: true,
  479. };
  480. return new Promise(async (resolve, reject) => {
  481. const res = await request(quanXf, options);
  482. const data = stringToJson(res.bizContent);
  483. resolve(data);
  484. }).catch((error) => {
  485. reject(error);
  486. });
  487. };
  488. /*圈层申请*/
  489. const quanApplyAction = (data) => {
  490. var form = {
  491. cardId: card.cardId,
  492. fee: state.fee,
  493. preBalance: card.money,
  494. tradeType: 14,
  495. command: data.command,
  496. cosResponse: data.cosResponse,
  497. orderId: state.orderNum,
  498. rechargeId: data.rechargeId,
  499. };
  500. const options = {
  501. type: 2,
  502. data: form,
  503. method: "POST",
  504. showLoading: true,
  505. };
  506. return new Promise(async (resolve, reject) => {
  507. const res = await request(quanApply, options);
  508. const data = stringToJson(res.bizContent);
  509. resolve(data);
  510. console.log("quanApplyAction",data)
  511. }).catch((error) => {
  512. reject(error);
  513. });
  514. };
  515. /*圈层确认*/
  516. const uanConfirmAction = (data) => {
  517. console.log("圈层确认进入");
  518. let cmdArr = data.command.split(",");
  519. console.log(cmdArr);
  520. bluetoothUtil.transCmd(cmdArr, "10", function(res) {
  521. console.log("圈层透传");
  522. console.log(res);
  523. var arraylenth = res.length;
  524. var status = res[arraylenth - 1].substring(
  525. res[arraylenth - 1].length - 4,
  526. res[arraylenth - 1].length
  527. );
  528. console.log("打印圈层确认指令状态");
  529. if (status === "9000") {
  530. var form = {
  531. command: data.command,
  532. cosResponse: res.toString(),
  533. rechargeId: data.rechargeId,
  534. paidAmount: state.fee,
  535. giftAmount: 0,
  536. };
  537. const options = {
  538. type: 2,
  539. data: form,
  540. method: "POST",
  541. showLoading: true,
  542. };
  543. return new Promise(async (resolve, reject) => {
  544. const res = await request(quanConfirm, options);
  545. const data = stringToJson(res.bizContent);
  546. resolve(data);
  547. console.log("data",data);
  548. }).catch((error) => {
  549. reject(error);
  550. });
  551. }
  552. });
  553. };
  554. const uanConfirmSucessAction = (data) => {
  555. var form = {
  556. command: data.command,
  557. cosResponse: "9000",
  558. rechargeId: data.rechargeId,
  559. paidAmount: state.fee,
  560. giftAmount: 0,
  561. };
  562. const options = {
  563. type: 2,
  564. data: form,
  565. method: "POST",
  566. showLoading: true,
  567. };
  568. return new Promise(async (resolve, reject) => {
  569. const res = await request(quanConfirm, options);
  570. const data = stringToJson(res.bizContent);
  571. resolve(data);
  572. console.log("uanConfirmSucessAction",data)
  573. }).catch((error) => {
  574. reject(error);
  575. });
  576. };
  577. /*充值检测*/
  578. const czCheckAction = () => {
  579. var form = {
  580. cardId: state.cardId,
  581. openId: getItem(StorageKeys.OpenId),
  582. };
  583. const options = {
  584. type: 2,
  585. data: form,
  586. method: "POST",
  587. showLoading: true,
  588. };
  589. return new Promise(async (resolve, reject) => {
  590. const res = await request(cardCzPayResultCheck, options);
  591. const data = stringToJson(res.bizContent);
  592. console.log("充值检测",data)
  593. resolve(data);
  594. }).catch((error) => {
  595. reject(error);
  596. });
  597. };
  598. /*充值申请*/
  599. const cardCzApplyAction = () => {
  600. var data = {
  601. cardId: state.cardId,
  602. openId: getItem(StorageKeys.OpenId),
  603. rechargeMoney: state.fee,
  604. };
  605. const options = {
  606. type: 2,
  607. data: data,
  608. method: "POST",
  609. showLoading: true,
  610. };
  611. return new Promise(async (resolve, reject) => {
  612. const res = await request(cardCzApply, options);
  613. const data = stringToJson(res.bizContent);
  614. resolve(data);
  615. }).catch((error) => {
  616. reject(error);
  617. });
  618. };
  619. //获取微信小程序openid
  620. const getOpenID = () => {
  621. uni.login({
  622. provider: "weixin",
  623. success: function(e) {
  624. wx.request({
  625. url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
  626. success: (res: any) => {
  627. state.openid = res.data.openid;
  628. },
  629. });
  630. },
  631. fail: function() {
  632. msg("获取不到oppenId,请检查AppID和Secret是否争取");
  633. },
  634. });
  635. };
  636. //掉起微信支付
  637. const wxPayment = () => {
  638. // #ifdef MP-WEIXIN
  639. const options = {
  640. type: 2,
  641. data: {
  642. openId: getItem(StorageKeys.OpenId),
  643. wxOpenId: state.openid,
  644. cardId: state.cardId,
  645. orderNum: state.orderNum,
  646. payConfigId: wechatPayConfigId,
  647. body: "储值卡充值",
  648. },
  649. method: "POST",
  650. showLoading: true,
  651. };
  652. request(cardCzPay, options).then((res) => {
  653. const data = stringToJson(res.bizContent);
  654. uni.requestPayment({
  655. provider: "wxpay",
  656. orderInfo: "",
  657. timeStamp: data.timestamp,
  658. nonceStr: data.noncestr,
  659. package: data.wxPackage ?data.wxPackage: "",
  660. signType: data.signType,
  661. paySign: data.sign,
  662. success: function() {
  663. //回调订单状态
  664. console.log("回调订单状态");
  665. checkOrder();
  666. },
  667. fail: function(err) {
  668. confirm(err, () => {}, "支付失败", false);
  669. },
  670. });
  671. });
  672. // #endif
  673. };
  674. //支付成功改变订单状态
  675. const checkOrder = () => {
  676. const options = {
  677. type: 2,
  678. data: {
  679. cardId: state.cardId,
  680. openId: getItem(StorageKeys.OpenId),
  681. orderNum: state.orderNum,
  682. },
  683. method: "POST",
  684. showLoading: true,
  685. };
  686. request(cardCzPayResult, options).then((res) => {
  687. const data = stringToJson(res.bizContent);
  688. if (data.tradeState === "SUCCESS")
  689. uni.redirectTo({
  690. url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}&&fee=${state.fee}`,
  691. });
  692. // state.isShowBlue=true;
  693. console.log(data);
  694. });
  695. };
  696. const goRecord=()=>{
  697. uni.navigateTo({
  698. url:`/subpackage/personal-center/consumption-record?cardId=${state.cardId}`
  699. })
  700. }
  701. </script>
  702. <style>
  703. .account {
  704. height: 224rpx;
  705. width: 690rpx;
  706. margin: 30rpx;
  707. position: relative;
  708. }
  709. .account .account-text {
  710. display: flex;
  711. justify-content: space-between;
  712. padding: 20rpx 50rpx;
  713. height: 100%;
  714. }
  715. .account .balance {
  716. display: flex;
  717. flex-direction: column;
  718. justify-content: center;
  719. align-items: flex-start;
  720. color: #ffffff;
  721. }
  722. .account .balance-tit {
  723. font-size: 26rpx;
  724. margin-bottom: 10rpx;
  725. }
  726. .account .balance-val {
  727. font-size: 56rpx;
  728. }
  729. .account .right-box {
  730. display: flex;
  731. flex-direction: column;
  732. justify-content: flex-start;
  733. align-items: flex-end;
  734. }
  735. .account .right-box .no {
  736. font-size: 26rpx;
  737. color: #ffffff;
  738. }
  739. .account .right-box .btn {
  740. font-size: 26rpx;
  741. padding: 0 20rpx;
  742. box-sizing: border-box;
  743. height: 42rpx;
  744. line-height: 42rpx;
  745. color: #28d20f;
  746. background: #ffffff;
  747. border-radius: 21rpx;
  748. display: inline-block;
  749. margin-top: 18rpx;
  750. }
  751. .account .head-bg {
  752. width: 690rpx;
  753. height: 224rpx;
  754. position: absolute;
  755. left: 0;
  756. top: 0;
  757. z-index: -99;
  758. }
  759. .input-box {
  760. display: flex;
  761. flex-direction: column;
  762. justify-content: center;
  763. align-items: center;
  764. padding: 20rpx 0;
  765. }
  766. .input-box .input {
  767. width: 430rpx;
  768. height: 98rpx;
  769. line-height: 98rpx;
  770. background: #f8f8f8;
  771. border: 1px solid #999999;
  772. border-radius: 6rpx;
  773. font-size: 30rpx;
  774. text-align: center;
  775. }
  776. .input-box .tips {
  777. color: #666666;
  778. font-size: 26rpx;
  779. margin-top: 18rpx;
  780. }
  781. .tabs {}
  782. .tabs .tab-tit {
  783. font-size: 30rpx;
  784. color: #333;
  785. padding: 45rpx 0 22rpx 30rpx;
  786. }
  787. .tabs .tab {
  788. display: flex;
  789. flex-wrap: wrap;
  790. justify-content: space-evenly;
  791. }
  792. .tabs .tab .item {
  793. width: 210rpx;
  794. height: 100rpx;
  795. background: #f6fff7;
  796. border: 1px solid #dcdde1;
  797. box-sizing: border-box;
  798. line-height: 100rpx;
  799. border-radius: 6rpx;
  800. text-align: center;
  801. margin-bottom: 24rpx;
  802. color: #333333;
  803. font-size: 32rpx;
  804. }
  805. .tabs .tab .item.active {
  806. border: 1px solid #24cc49;
  807. color: #24cc49;
  808. }
  809. .btn-primary {
  810. width: 670rpx;
  811. height: 80rpx;
  812. line-height: 80rpx;
  813. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  814. border-radius: 40rpx;
  815. font-size: 32rpx;
  816. color: #ffffff;
  817. margin: 200rpx 40rpx 0;
  818. text-align: center;
  819. }
  820. .uni-list{
  821. padding: 120rpx 10rpx 0 10rpx;
  822. font-size:34rpx;
  823. }
  824. label{
  825. display: flex;
  826. justify-content: space-between;
  827. margin-top:30rpx;
  828. }
  829. </style>