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 21KB

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