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-pay.vue 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="content">
  3. <view @click="rechargeAction">
  4. <view style="display: flex;align-items: center;">
  5. <image class="photo" :src="fileURL + 'image/index/goRecharge.png'"></image>去充值
  6. </view>
  7. <image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image>
  8. </view>
  9. <view>
  10. <view>选择充值方式:</view>
  11. <view style="width: 67%;display: flex;align-items: center;">
  12. <radio-group @change="radioChange" style="display: flex;align-items: center;">
  13. <label style="align-items: center;margin-right: 40rpx;margin-top: 0;"
  14. class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in state.transWayTypeList"
  15. :key="item.value">
  16. <view>
  17. <radio :value="item.value" :checked="index === state.current" />
  18. </view>
  19. <view>{{item.name}}</view>
  20. </label>
  21. </radio-group>
  22. </view>
  23. </view>
  24. <view>
  25. <view style="display: flex;align-items: center;">
  26. <image class="photo" :src="fileURL + 'image/index/consumptionDetails.png'"></image>消费明细
  27. </view>
  28. <image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image>
  29. </view>
  30. </view>
  31. <view class="tips">温馨提示: <text class="red">NFC充值</text>仅支持在<text class="red">安卓手机</text>进行ETC储值卡充值!</view>
  32. <!-- <view>
  33. <view class="tabs">
  34. <view class="tab-tit as-gravity-center-start">充值方式
  35. <u-input @click="state.transWayTypeShow = true" inputAlign="center" v-model="state.transWayName"
  36. type="select" />
  37. </view>
  38. </view>
  39. <view class="btn btn-primary" @click="rechargeAction">立即充值</view>
  40. </view>
  41. <u-select v-model="state.transWayTypeShow" :list="state.transWayTypeList" @confirm="selectConfirm"></u-select> -->
  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. request
  53. } from "@/utils/network/request.js";
  54. import {
  55. reactive
  56. } from "vue";
  57. import {
  58. navTo
  59. } from "@/utils/utils"
  60. import {
  61. msg
  62. } from "@/utils/utils";
  63. import {
  64. fileURL
  65. } from "@/datas/fileURL.js";
  66. const datas = require("../../static/etcUtil/datas.js");
  67. const bluetoothUtil = require("../../static/etcUtil/index.js");
  68. const cmd = require("../../static/etcUtil/cmdConfig.js");
  69. const tools = require("../../static/etcUtil/tools.js");
  70. const NFCAPI = require('../../static/nfc/NFCAPI.js');
  71. const state = reactive({
  72. transWayTypeShow: false,
  73. transWayTypeList: [{
  74. name: "蓝牙",
  75. value: "blu",
  76. }, {
  77. name: "NFC",
  78. value: "nfc",
  79. }
  80. ],
  81. tableIndex: 0,
  82. transWayName: "蓝牙",
  83. transWay: "blu", //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
  84. cardId: "", //卡号 需要传参
  85. current: 0
  86. });
  87. const selectConfirm = (item : any) => {
  88. state.transWayName = item[0].label
  89. state.transWay = item[0].value
  90. };
  91. onLoad((option) => {
  92. });
  93. function radioChange(evt) {
  94. console.log('输出内容', evt)
  95. state.transWay = evt.detail.value; //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
  96. for (var k = 0; k < state.transWayTypeList.length; k++) {
  97. if (state.transWayTypeList[k]['value'] == evt.detail.value) {
  98. state.transWayName = state.transWayTypeList[k]['name']
  99. return;
  100. }
  101. }
  102. }
  103. /*点击充值按钮*/
  104. const rechargeAction = () => {
  105. if (state.transWay == 'blu') {
  106. uni.redirectTo({
  107. url: `/pages/bluetooth/bluetooth?routeType=2`,
  108. });
  109. } else {
  110. uni.redirectTo({
  111. url: `/pages/nfc/nfc?routeType=2`,
  112. });
  113. }
  114. };
  115. const goRecord = () => {
  116. uni.navigateTo({
  117. url: `/subpackage/personal-center/consumption-record?cardId=${state.cardId}`
  118. })
  119. }
  120. </script>
  121. <style>
  122. .record {
  123. width: 90%;
  124. display: flex;
  125. justify-content: space-between;
  126. margin: 0 auto;
  127. align-items: center;
  128. }
  129. .arrow {
  130. width: 14rpx;
  131. height: 26rpx;
  132. }
  133. .tabs .tab-tit {
  134. font-size: 30rpx;
  135. color: #333;
  136. padding: 45rpx 0 22rpx 30rpx;
  137. }
  138. .tabs .tab {
  139. display: flex;
  140. flex-wrap: wrap;
  141. justify-content: space-evenly;
  142. }
  143. .tabs .tab .item {
  144. width: 210rpx;
  145. height: 100rpx;
  146. background: #f6fff7;
  147. border: 1px solid #dcdde1;
  148. box-sizing: border-box;
  149. line-height: 100rpx;
  150. border-radius: 6rpx;
  151. text-align: center;
  152. margin-bottom: 24rpx;
  153. color: #333333;
  154. font-size: 32rpx;
  155. }
  156. .tabs .tab .item.active {
  157. border: 1px solid #24cc49;
  158. color: #24cc49;
  159. }
  160. .btn-primary {
  161. width: 670rpx;
  162. height: 80rpx;
  163. line-height: 80rpx;
  164. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  165. border-radius: 40rpx;
  166. font-size: 32rpx;
  167. color: #ffffff;
  168. margin: 200rpx 40rpx 0;
  169. text-align: center;
  170. }
  171. label {
  172. display: flex;
  173. justify-content: space-between;
  174. margin-top: 30rpx;
  175. }
  176. .photo {
  177. width: 40rpx;
  178. height: 40rpx;
  179. margin-right: 40rpx;
  180. }
  181. .photo1 {
  182. width: 40rpx;
  183. transform: rotateY(180deg);
  184. }
  185. .content {
  186. font-size: 32rpx;
  187. }
  188. .content>view {
  189. border-bottom: 1rpx solid #c1c1c1;
  190. display: flex;
  191. padding: 16rpx 20rpx;
  192. align-items: center;
  193. justify-content: space-between;
  194. height: 60rpx;
  195. }
  196. .red {
  197. color: red;
  198. }
  199. .tips {
  200. font-size: 32rpx;
  201. padding: 20rpx;
  202. }
  203. </style>