您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

recharge-pay.vue 4.8KB

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