You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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