index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. <template>
  2. <div class="mianBox" v-if="order">
  3. <van-row class="headerBox" >
  4. <van-icon name="arrow-left" @click="fanhuiBtn" v-if="erp"/>
  5. {{title}}
  6. </van-row>
  7. <template v-if="erp">
  8. <!-- 充值 -->
  9. <div class="recharge" v-if="erp">
  10. <div class="cardId" v-loading="cardLoading">
  11. <van-col span="12">卡号:<span style="color:#000">{{cardId}}</span></van-col>
  12. </div>
  13. <div class="balance" v-loading="balanceLoading">
  14. <van-col span="12">余额:<span style="color:rgba(242, 46, 60, 1)">{{cardBalance ? cardBalance : '0.00'}}</span>元</van-col>
  15. </div>
  16. <van-row class="rechargeInput" style="padding-top: 10px">
  17. <div class="jg">
  18. <span class="jgLabel">¥</span>
  19. <van-field
  20. readonly
  21. label=" "
  22. placeholder="请输入充值金额( 元 )"
  23. label-width="10px"
  24. clickable
  25. :value="money"
  26. @touchstart.native.stop="show = true"
  27. />
  28. <van-number-keyboard
  29. theme="custom"
  30. :show="show"
  31. :title="'¥' + money"
  32. :hide-on-click-outside="false"
  33. :maxlength="8"
  34. extra-key="."
  35. @input="handleInput"
  36. @delete="handleDelete"
  37. @close="handleClose"
  38. close-button-text="确定"
  39. @blur="show = false"
  40. ></van-number-keyboard>
  41. </div>
  42. </van-row>
  43. <van-overlay :show="overlayShow" @click="overlayShow = false" />
  44. <van-row class="rechargeSelect" gutter="26px">
  45. <van-col span="8" @click="btn50" :style="state1" data="50">50</van-col>
  46. <van-col span="8" @click="btn100" :style="state2" data="100">100</van-col>
  47. <van-col span="8" @click="btn150" :style="state3" data="150">150</van-col>
  48. <van-col span="8" @click="btn200" :style="state4" data="200">200</van-col>
  49. <van-col span="8" @click="btn250" :style="state5" data="250">250</van-col>
  50. <van-col span="8" @click="btn300" :style="state6" data="300">300</van-col>
  51. </van-row>
  52. <van-row class="arrival" type="flex" justify="space-around">
  53. <van-col span="12" class="left">到账金额</van-col>
  54. <van-col span="12" class="right">¥{{ (Number((100 - (100 - proportion * 100)) * money) / 100 ).toFixed(2) }}元</van-col>
  55. </van-row>
  56. <van-row class="tip">
  57. 服务费 ¥{{ (Number((100 - proportion * 100) * money) / 100 ).toFixed(2) || 0.00}}元 <br>
  58. 费率 {{ Number(100 - proportion * 100).toFixed(2) || 0.00}}%
  59. </van-row>
  60. <van-button type="danger" @click="recharge"
  61. >立即充值</van-button
  62. >
  63. </div>
  64. </template>
  65. <div class="recharge2" v-if="noerp">
  66. <van-row class="rechargeInput" style="padding-top: 10px">
  67. <div class="jg">
  68. <span class="jgLabel">¥</span>
  69. <van-field
  70. readonly
  71. label=" "
  72. placeholder="请输入充值金额( 元 )"
  73. label-width="10px"
  74. clickable
  75. :value="money"
  76. @touchstart.native.stop="show = true"
  77. />
  78. <van-number-keyboard
  79. theme="custom"
  80. :show="show"
  81. :title="'¥' + money"
  82. :hide-on-click-outside="false"
  83. :maxlength="8"
  84. extra-key="."
  85. @input="handleInput"
  86. @delete="handleDelete"
  87. @close="handleClose"
  88. close-button-text="确定"
  89. @blur="show = false"
  90. ></van-number-keyboard>
  91. </div>
  92. </van-row>
  93. <van-overlay :show="overlayShow" @click="overlayShow = false" />
  94. <van-row class="rechargeSelect" gutter="26px">
  95. <van-col span="8" @click="btn50" :style="state1" data="50">50</van-col>
  96. <van-col span="8" @click="btn100" :style="state2" data="100">100</van-col>
  97. <van-col span="8" @click="btn150" :style="state3" data="150">150</van-col>
  98. <van-col span="8" @click="btn200" :style="state4" data="200">200</van-col>
  99. <van-col span="8" @click="btn250" :style="state5" data="250">250</van-col>
  100. <van-col span="8" @click="btn300" :style="state6" data="300">300</van-col>
  101. </van-row>
  102. <van-row class="arrival" type="flex" justify="space-around">
  103. <van-col span="12" class="left">到账金额</van-col>
  104. <van-col span="12" class="right">¥{{ (Number((100 - (100 - proportion * 100)) * money) / 100 ).toFixed(2) }}元</van-col>
  105. </van-row>
  106. <van-row class="tip">
  107. 服务费 ¥{{ (Number((100 - proportion * 100) * money) / 100 ).toFixed(2) || 0.00}}元 <br>
  108. 费率 {{ (100 - proportion * 100) .toFixed(2) || 0.00}}%
  109. </van-row>
  110. <van-button type="danger" @click="recharge"
  111. >立即充值</van-button
  112. >
  113. </div>
  114. <template v-if="erp">
  115. <!-- 交易记录 -->
  116. <div class="record" v-if="erp">
  117. <van-row class="recordTitle">
  118. <van-col span="16" class="left">交易记录</van-col>
  119. <van-icon name="arrow" class="right" @click="record"/>
  120. </van-row>
  121. <van-row class="list" v-loading="listLoading">
  122. <van-list
  123. class="listData"
  124. :immediate-check="false"
  125. >
  126. <van-row class="listBoxCell" v-for="(item, index) in recordList" :key="index">
  127. <van-col span="14">
  128. <van-row class="jlName">{{ item.shopName }}</van-row>
  129. <van-row class="jlTime">时间:{{ item.createTime }}</van-row>
  130. </van-col>
  131. <van-col span="10" class="jlMoney negative">
  132. <van-row class="jlBalance2" v-if="item.type==1">- {{ item.amt }}元</van-row>
  133. <van-row class="jlMoney just" v-if="item.type==3">+ {{ item.amt }}元</van-row>
  134. <van-row class="jlBalance2" v-if="item.type==1001">+ {{ Math.abs(item.amt) }}元</van-row>
  135. <van-row class="jlBalance" style="color:#000">余额:{{ item.balance }} 元</van-row></van-col>
  136. </van-row>
  137. </van-list>
  138. <p class="loading" v-if="more" @click="record">点击查看更多</p>
  139. <p class="loading" v-if="noMore">没有更多了</p>
  140. </van-row>
  141. </div>
  142. </template>
  143. <van-loading
  144. size="24px"
  145. v-if="loadingErp"
  146. color="#fff"
  147. vertical
  148. style="z-index: 999999; position: fixed; top: 40%; left: 0; right: 0;color:rgba(242, 46, 60, 1) !important"
  149. >加载中...</van-loading
  150. >
  151. <van-overlay :show="loadingErp" style="z-index: 100; position: fixed" />
  152. </div>
  153. </template>
  154. <script>
  155. import axios from "axios";
  156. import { Field, NumberKeyboard, Dialog, Toast } from "vant";
  157. import { returnFloat } from '@/assets/js/common.js'
  158. export default {
  159. data() {
  160. return {
  161. loadingErp:false,
  162. erp:false,
  163. noerp:false,
  164. cardBalance:undefined,//余额
  165. show: false,
  166. loading: false,
  167. overlayShow: false,
  168. money: 0,
  169. env: null, //识别是否为扫描用户进入,以便直接进入支付跳转
  170. state1: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  171. state2: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  172. state3: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  173. state4: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  174. state5: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  175. state6: "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);",
  176. channelId: undefined,
  177. fanhui: false,
  178. proportion:0,//到账比例
  179. order:true,//管理员充值
  180. title:undefined,
  181. // 交易记录
  182. more: false,
  183. noMore: false,
  184. finished: false,
  185. recordList:[],
  186. cardId:undefined,
  187. cardLoading:true,
  188. balanceLoading:true,
  189. listLoading:true,
  190. };
  191. },
  192. watch: {
  193. money(val) {
  194. if (/^0[1-9]/.test(val)) {
  195. this.money = val.substring(1);
  196. }
  197. },
  198. },
  199. components: {
  200. [Field.name]: Field,
  201. [NumberKeyboard.name]: NumberKeyboard,
  202. [Dialog.name]: Dialog,
  203. [Toast.name]: Toast,
  204. },
  205. created() {
  206. var url = window.location.href;
  207. localStorage.setItem("amount57",url)
  208. if(url.indexOf("token") > 1){
  209. //("app进入")
  210. if(this.getQueryVariable("token")){
  211. localStorage.removeItem('type');
  212. this.erp = true
  213. this.noerp = false
  214. this.loadingErp = true
  215. this.userQuery()
  216. }else{
  217. //console.log("app进入")
  218. Toast(this.getQueryVariable("无token传入!"))
  219. }
  220. }else if(this.getQueryVariable("type")){
  221. //console.log("扫码游客进入")
  222. localStorage.removeItem('type');
  223. localStorage.removeItem('user_wt');
  224. localStorage.setItem("type",this.type)
  225. }else{
  226. localStorage.removeItem('user_wt');
  227. localStorage.removeItem('type');
  228. //console.log("无user、type、classify进入")
  229. }
  230. if (this.$route.query.type) {
  231. this.erp = false
  232. this.noerp = true
  233. this.channelId = this.$route.query.type;
  234. localStorage.setItem("type",this.channelId)
  235. //console.log("channelId游客充值=",this.channelId);
  236. this.title = this.$route.query.channelName + "消费支付"
  237. // this.proportionData()
  238. } else if(this.$route.query.backOrder) {
  239. this.title = "消费支付"
  240. this.order = false
  241. const data = JSON.parse(this.$route.query.backOrder)
  242. var money = data.money
  243. if(money.toString().indexOf(".")<1){
  244. money = money + ".00"
  245. }
  246. axios.post('/dxtop/order/topScanPayApi', {
  247. "money": money,
  248. "payType": data.payType,
  249. "scene": data.scene,
  250. "userId":data.userId
  251. }).then(res => {
  252. if(res.data.status == "ERROR"){
  253. Toast(res.data.msg)
  254. }else{
  255. window.location.href = res.data.data
  256. }
  257. }).catch(() => {
  258. })
  259. this.proportionData()
  260. } else if(localStorage.getItem("user_wt")) {
  261. this.title = "充值"
  262. this.fanhui = true
  263. this.proportionData()
  264. }else{
  265. this.title = "充值"
  266. this.fanhui = true;
  267. }
  268. },
  269. mouted(){
  270. var url = window.location.href;
  271. if(url.indexOf("token") > 1){
  272. }else if(this.getQueryVariable("type")){
  273. document.title = '中国东信智慧园区'
  274. }else{
  275. document.title = '中国东信智慧园区'
  276. }
  277. if (this.$route.query.type) {
  278. document.title = '中国东信智慧园区'
  279. } else if(this.$route.query.backOrder) {
  280. document.title = '中国东信智慧园区'
  281. }
  282. },
  283. methods: {
  284. //用户查询(卡号)
  285. userQuery(){
  286. axios({//查询信息
  287. method: 'get',
  288. url: 'https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/getZkUserByCipher?cipher=' + this.getQueryVariable("token"),
  289. timeout: 10000,
  290. }).then(res =>{
  291. if(res.data?.data?.id){
  292. //axios.get(`/dxtop/staff/one?id=0001T110000000002HBL`).then(res2 => { //测试
  293. axios.get(`/dxtop/staff/one?id=${res.data.data.id}`).then(res2 => { //验证充值信息是否同步
  294. if(res2.data.data.proportion){
  295. this.proportion = res2.data.data.proportion
  296. }else{
  297. this.proportion = 1
  298. }
  299. if(res2.data.data){
  300. localStorage.setItem("user_wt", res.data.data.id)
  301. // localStorage.setItem("user_wt", "0001T110000000002HBL") //测试id
  302. localStorage.setItem("cardId57", res2.data.data.cardId)
  303. this.cardId = res2.data.data.cardId
  304. this.cardLoading = false
  305. this.Balance()
  306. this.recharge2()
  307. }else{
  308. this.userNoAlert()
  309. }
  310. this.loadingErp = false
  311. })
  312. }else if(res.data?.data?.cardId){
  313. this.loadingErp = false
  314. Toast("用户卡号未绑定")
  315. }else{
  316. this.loadingErp = false
  317. this.userNoAlert()
  318. }
  319. }).catch(err =>{
  320. this.loadingErp = false
  321. this.userNoAlert()
  322. });
  323. },
  324. userNoAlert(){
  325. Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
  326. },
  327. getQueryVariable(variable){//参数获取 设定微信进入参数
  328. //window.location.search.substring(1);
  329. console.log(variable)
  330. var query = window.location.hash.substring(3);
  331. var vars = query.split("&");
  332. if(vars[2]){ //判定微信端进入
  333. localStorage.setItem("passageway","weixin")
  334. }else{
  335. localStorage.removeItem("passageway")
  336. }
  337. for (var i=0;i<vars.length;i++) {
  338. var pair = vars[i].split("=");
  339. if(pair[0] == variable || pair[0] =="mount?token"){
  340. if(vars[1] != "classify"){
  341. // localStorage.removeItem("classify")
  342. }
  343. if(variable =="token"){
  344. this.user = pair[1]
  345. }else if(variable =="type"){
  346. this.type = pair[1]
  347. }
  348. return pair[1];
  349. }
  350. }
  351. return(false);
  352. },
  353. //余额
  354. Balance(){
  355. this.erp = true
  356. if(localStorage.getItem("cardId57")){
  357. //axios.get(`/dxtop/staff/cardBalance?card=3186100745`).then(res => { //测试
  358. axios.get(`/dxtop/staff/cardBalance?card=${localStorage.getItem("cardId57")}`).then(res => { //验证充值信息是否同步
  359. if(res.data.data){
  360. this.cardBalance = returnFloat(res.data.data)
  361. }else{
  362. this.cardBalance = "0.00"
  363. }
  364. this.balanceLoading = false
  365. })
  366. }else{
  367. this.cardBalance = "0.00"
  368. this.balanceLoading = false
  369. }
  370. },
  371. //交易记录
  372. recharge2(){
  373. this.erp = true
  374. axios.post(`/dxtop/charge/cordPage`,{
  375. "startTime":undefined,
  376. "endTime":undefined,
  377. "size":10,
  378. "current":1,
  379. "userId":localStorage.getItem("user_wt")
  380. }).then(res => {
  381. if (res?.data?.data?.records.length > 0) {
  382. let data = res.data.data.records
  383. for(let i =0;i<data.length;i++){
  384. this.recordList.push(data[i])
  385. this.recordList[i].balance = returnFloat(data[i].balance)
  386. }
  387. if(res.data.data.total>5){
  388. this.more = true
  389. }
  390. this.listLoading = false
  391. } else {
  392. this.noMore = true
  393. }
  394. })
  395. },
  396. //跳转
  397. record(){
  398. this.$router.push({ path: "/record"})
  399. },
  400. //充值比例
  401. proportionData(){
  402. if(localStorage.getItem("user_wt")){
  403. axios.get(`/dxtop/staff/one`,{params:{"id":localStorage.getItem("user_wt")}}).then(res => {//res.msg
  404. if(res.data.data.proportion){
  405. this.proportion = Number(1 - res.data.data.proportion).toFixed(2)
  406. }
  407. }).catch(err=>{
  408. //console.log(err)
  409. })
  410. }
  411. },
  412. handleInput(key) {
  413. (this.state1 = "color:#000;background: #fff;"),
  414. (this.state2 = "color:#000;background: #fff;"),
  415. (this.state3 = "color:#000;background: #fff;"),
  416. (this.state4 = "color:#000;background: #fff;"),
  417. (this.state5 = "color:#000;background: #fff;"),
  418. (this.state6 = "color:#000;background: #fff;"),
  419. (this.money = this.money + "");
  420. if (this.money === "" && key === ".") {
  421. this.money = "0";
  422. } else if (this.money.indexOf(".") !== -1 && key === ".") {
  423. return;
  424. } else if (
  425. this.money.indexOf("0") !== -1 &&
  426. this.money.length === 1 &&
  427. key === 0
  428. ) {
  429. return;
  430. } else if (/\.\d{2}$/.test(this.money)) {
  431. return;
  432. }
  433. this.money += key;
  434. },
  435. handleDelete() {
  436. this.money = this.money + "";
  437. if (!this.money) {
  438. return;
  439. }
  440. this.money = this.money.substring(0, this.money.length - 1) || 0;
  441. },
  442. handleClose() {
  443. this.money = Number(this.money);
  444. this.overlayShow = false;
  445. },
  446. isWeixinOrAlipay() {
  447. let ua = window.navigator.userAgent;
  448. //判断是不是微信
  449. if (ua.indexOf("MicroMessenger") > 0) {
  450. this.env = "WeiXin";
  451. }
  452. //判断是不是支付宝
  453. if (ua.indexOf("Alipay") > 0) {
  454. this.env = "Alipay";
  455. }
  456. },
  457. async pay(money, topPayType, payType, channelId) {
  458. if(money.toString().indexOf(".")<1){
  459. money = money + ".00"
  460. }
  461. if(localStorage.getItem("type")){ //充值系统后台扫码充值
  462. axios.post('/dxtop/order/topScanPayApi', {
  463. "money": Number(money).toFixed(2),
  464. "topPayType": topPayType,
  465. "payType": payType,
  466. "channelId": channelId,
  467. "scene": 2,
  468. }).then(res => {
  469. this.loading = false;
  470. if(res.data.status == "ERROR"){
  471. Toast(res.data.msg)
  472. }else{
  473. window.location.href = res.data.data
  474. }
  475. })
  476. }else{ //公众号充值(ERP或外包人员)
  477. axios.get("dxtop/staff/one",{
  478. params:{
  479. id:localStorage.getItem("user_wt")
  480. }
  481. }).then(res =>{
  482. if(res.data?.data?.sid){
  483. if(localStorage.getItem("classify")){
  484. let type = localStorage.getItem("classify")
  485. let channelName =undefined
  486. if(type == "1"){
  487. channelName = "外包人员充值"
  488. }
  489. if(type == "2"){
  490. channelName = "ERP人员充值"
  491. }
  492. axios.post('/dxtop/order/topScanPayApi', {
  493. "money": Number(money).toFixed(2),
  494. "topPayType": topPayType,
  495. "payType": payType,
  496. "channelName":channelName,
  497. "scene": 6,
  498. "userId": res.data.data.sid
  499. }).then(res => {
  500. this.loading = false;
  501. if(res.data.status == "ERROR"){
  502. Toast(res.data.msg)
  503. }else{
  504. window.location.href = res.data.data
  505. }
  506. })
  507. }else{
  508. axios.post('/dxtop/order/topScanPayApi', {
  509. "money": Number(money).toFixed(2),
  510. "topPayType": topPayType,
  511. "payType": payType,
  512. "channelId": channelId,
  513. "scene": 2,
  514. }).then(res => {
  515. this.loading = false;
  516. if(res.data.status == "ERROR"){
  517. Toast(res.data.msg)
  518. }else{
  519. window.location.href = res.data.data
  520. }
  521. })
  522. }
  523. }
  524. })
  525. }
  526. },
  527. jumpMode() {
  528. console.log(localStorage.getItem("classify"))
  529. if (this.money) {
  530. if(this.money == '0' || this.money == '0.0' || this.money == '0.'){
  531. Dialog.confirm({
  532. title: "提示",
  533. message: "充值金额不能为0元!",
  534. });
  535. }else if(this.channelId){//游客
  536. if (this.env == "WeiXin") {
  537. //console.log("微信环境充值--游客");
  538. //微信
  539. this.loading = true;
  540. this.pay(this.money, "W06" ,"2", this.channelId);
  541. }else if (this.env == "Alipay") {
  542. //console.log("支付宝环境充值--游客");
  543. //支付宝
  544. this.loading = true;
  545. this.pay(this.money, "A01", "2", this.channelId);
  546. } else {
  547. //console.log("有channelId的其他扫描--游客");
  548. this.$router.push({
  549. path: "/recharge",
  550. query: { money: this.money,channelId: undefined},
  551. });
  552. }
  553. }else if(localStorage.getItem("classify")){
  554. if (this.env == "WeiXin") {
  555. //console.log("微信环境充值--公众号");
  556. //微信
  557. this.loading = true;
  558. this.pay(this.money, "W06" ,"6", this.channelId);
  559. }
  560. if (this.env == "Alipay") {
  561. //console.log("支付宝环境充值--公众号");
  562. //微信
  563. this.loading = true;
  564. this.pay(this.money, "A01" ,"6", this.channelId);
  565. }
  566. }else{
  567. if(localStorage.getItem("user_wt")){
  568. //console.log("userid 进入")
  569. }else{
  570. //console.log("无channelId 进入")
  571. }
  572. let money = this.money.toString()
  573. if(money.indexOf(".")<1){
  574. money = money + ".00"
  575. }
  576. this.$router.push({
  577. path: "/recharge",
  578. query: { money: money, channelId: undefined },
  579. });
  580. }
  581. } else {
  582. Dialog.confirm({
  583. title: "提示",
  584. message: "充值金额不能为0元!",
  585. });
  586. }
  587. },
  588. recharge() {
  589. if(this.env == "WeiXin" || this.env == "Alipay"){
  590. if(this.money == '0' || this.money == '0.0' || this.money == '0.'){
  591. Dialog.confirm({
  592. title: "提示",
  593. message: "充值金额不能为0元!",
  594. });
  595. }
  596. }else{
  597. if(this.money == '0' || this.money == '0.0' || this.money == '0.'){
  598. Dialog.confirm({
  599. title: "提示",
  600. message: "充值金额不能为0元!",
  601. });
  602. }else{
  603. this.isWeixinOrAlipay();
  604. this.jumpMode();
  605. // this.$router.push({
  606. // path: "/recharge",
  607. // query: { money: this.money, channelId: this.channelId },
  608. // });
  609. }
  610. }
  611. },
  612. btn50() {
  613. (this.state1 = "color:#fff;background:rgba(242, 46, 60, 1);"),
  614. (this.state2 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  615. (this.state3 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  616. (this.state4 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  617. (this.state5 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  618. (this.state6 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  619. (this.money = 50);
  620. },
  621. btn100() {
  622. (this.state1 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  623. (this.state2 = "color:#fff;background: #F22E3C;"),
  624. (this.state3 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  625. (this.state4 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  626. (this.state5 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  627. (this.state6 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  628. (this.money = 100);
  629. },
  630. btn150() {
  631. (this.state1 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  632. (this.state2 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  633. (this.state3 = "color:#fff;background: #F22E3C;"),
  634. (this.state4 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  635. (this.state5 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  636. (this.state6 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  637. (this.money = 150);
  638. },
  639. btn200() {
  640. (this.state1 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  641. (this.state2 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  642. (this.state3 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  643. (this.state4 = "color:#fff;background: #F22E3C;"),
  644. (this.state5 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  645. (this.state6 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  646. (this.money = 200);
  647. },
  648. btn250() {
  649. (this.state1 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  650. (this.state2 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  651. (this.state3 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  652. (this.state4 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  653. (this.state5 = "color:#fff;background: #F22E3C;"),
  654. (this.state6 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  655. (this.money = 250);
  656. },
  657. btn300() {
  658. (this.state1 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  659. (this.state2 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  660. (this.state3 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  661. (this.state4 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  662. (this.state5 = "color:#000;background: #fff;border:1px solid rgba(242, 46, 60, 1);"),
  663. (this.state6 = "color:#fff;background: #F22E3C;"),
  664. (this.money = 300);
  665. },
  666. //返回上级或app目录页
  667. fanhuiBtn(){
  668. this.$router.go(-1)
  669. // if(localStorage.getItem("passageway")){
  670. // this.$router.go(-1)
  671. // }else{
  672. // setTimeout(()=>{
  673. // this.$router.go(-2)
  674. // },10)
  675. //window.location.href = "https://smartpark.caih.com/h5/#/home/feature?isApp=true"
  676. //}
  677. }
  678. },
  679. };
  680. </script>
  681. <style lang="scss" scoped>
  682. // .ss {
  683. // background-color: red;
  684. // color: #fff;
  685. // }
  686. .mianBox {
  687. width: 100vw;
  688. height: 100vh;
  689. color: #000;
  690. box-sizing: border-box;
  691. background-color: #F5F5F5;
  692. font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
  693. letter-spacing: 1px;
  694. overflow: hidden;
  695. //充值
  696. .recharge{
  697. padding: 44px 10px 20px 10px;
  698. background-color: #fff;
  699. .balance {
  700. font-size: 16px;
  701. margin: 12px 0 2px;
  702. display: inline-block;
  703. width:50%;
  704. text-align: right;
  705. .van-col{
  706. width:100%;
  707. }
  708. }
  709. .cardId {
  710. font-size: 16px;
  711. margin: 12px 0 2px;
  712. display: inline-block;
  713. width:50%;
  714. .van-col{
  715. width:100%;
  716. }
  717. }
  718. .rechargeInput {
  719. width: 100%;
  720. // height: 100%;
  721. overflow-y: auto;
  722. box-sizing: border-box;
  723. .jg{
  724. position: relative;
  725. .jgLabel{
  726. color: rgba(242, 46, 60, 1) ;
  727. font-size: 16px;
  728. position: absolute;
  729. top:11px;
  730. left:8px;
  731. z-index: 1;
  732. }
  733. }
  734. .van-cell {
  735. font-size: 16px;
  736. padding: 10px 6px;
  737. border: 1px solid rgba(110, 109, 109, 0.2);
  738. }
  739. .an-field {
  740. background-color: #EBEBEB;
  741. }
  742. }
  743. .rechargeSelect{
  744. margin-top: 0px;
  745. & > .van-col {
  746. padding: 10px 0;
  747. background-color: #fff;
  748. color: #000;
  749. text-align: center;
  750. font-size: 16px;
  751. border-radius: 2px;
  752. margin-top: 20px;
  753. float: left;
  754. width: 28%;
  755. box-sizing: border-box;
  756. border:1px solid rgba(242, 46, 60, 1) !important;
  757. overflow: hidden;
  758. }
  759. & > .van-col.active {
  760. background: #F22E3C;
  761. color: #fff;
  762. }
  763. & > .van-col:nth-child(3n-1),
  764. & > .van-col:nth-child(3n) {
  765. margin-left: 8%;
  766. }
  767. }
  768. .arrival {
  769. font-size: 16px;
  770. margin: 16px 0;
  771. .left {
  772. text-align: left;
  773. }
  774. .right {
  775. text-align: right;
  776. color: rgba(242, 46, 60, 1);
  777. }
  778. }
  779. .tip {
  780. font-size: 13px;
  781. color: #ccc;
  782. line-height: 20px;
  783. }
  784. .van-button {
  785. margin-top:20px;
  786. width: 350px;
  787. height: 40px;
  788. border-radius: 10px;
  789. font-size: 16px;
  790. }
  791. }
  792. .recharge2{
  793. padding: 44px 10px 0px 10px;
  794. background-color: #fff;
  795. height:100%;
  796. overflow: hidden;
  797. .balance {
  798. font-size: 16px;
  799. margin: 10px 0;
  800. display: inline-block;
  801. width:50%;
  802. }
  803. .rechargeInput {
  804. width: 100%;
  805. // height: 100%;
  806. overflow-y: auto;
  807. box-sizing: border-box;
  808. .jg{
  809. position: relative;
  810. .jgLabel{
  811. color: rgba(242, 46, 60, 1) ;
  812. font-size: 16px;
  813. position: absolute;
  814. top:11px;
  815. left:8px;
  816. z-index: 100;
  817. }
  818. }
  819. .van-cell {
  820. font-size: 16px;
  821. padding: 10px 6px;
  822. border: 1px solid rgba(110, 109, 109, 0.2);
  823. }
  824. .an-field {
  825. background-color: #EBEBEB;
  826. }
  827. }
  828. .rechargeSelect{
  829. margin-top: 0px;
  830. & > .van-col {
  831. padding: 10px 0;
  832. background-color: #EBEBEB;
  833. color: #000;
  834. text-align: center;
  835. font-size: 16px;
  836. border-radius: 6px;
  837. margin-top: 20px;
  838. float: left;
  839. width: 28%;
  840. border:1px solid rgba(242, 46, 60, 1) !important;
  841. }
  842. & > .van-col.active {
  843. background: #F22E3C;
  844. color: #fff;
  845. }
  846. & > .van-col:nth-child(3n-1),
  847. & > .van-col:nth-child(3n) {
  848. margin-left: 8%;
  849. }
  850. }
  851. .arrival {
  852. font-size: 16px;
  853. margin: 16px 0;
  854. .left {
  855. text-align: left;
  856. }
  857. .right {
  858. text-align: right;
  859. color: rgba(242, 46, 60, 1);
  860. }
  861. }
  862. .tip {
  863. font-size: 14px;
  864. color: #ccc;
  865. }
  866. .van-button {
  867. width: 90%;
  868. height: 50px;
  869. border-radius: 10px;
  870. font-size: 18px;
  871. position: fixed;
  872. bottom:30px;
  873. left:5%
  874. }
  875. }
  876. //交易记录
  877. .record{
  878. margin-top:10px;
  879. padding: 20px 10px 120px 10px;
  880. background-color: #fff;
  881. height:100%;
  882. .recordTitle{
  883. font-size: 18px;
  884. position: relative;
  885. .left{
  886. padding-left:8px;
  887. border-left:4px solid rgba(242, 46, 60, 1);
  888. line-height:20px;
  889. }
  890. .right{
  891. position: absolute;
  892. right:0;
  893. text-align: right;
  894. font-size: 20px;
  895. color:#808080;
  896. }
  897. }
  898. .list{
  899. margin-top:10px;
  900. -webkit-overflow-scrolling: touch;
  901. .listData{
  902. height:100%;
  903. overflow-y: scroll;
  904. }
  905. .loading{
  906. text-align: center;
  907. margin:20px auto 10px;
  908. color:#ccc
  909. }
  910. .listBoxCell {
  911. height: 75px;
  912. width: 100%;
  913. padding: 10px 10px 10px;
  914. box-sizing: border-box;
  915. display: flex;
  916. align-items: center;
  917. border-bottom: 1px solid rgba(237, 237, 237, 1);
  918. .jlName {
  919. font-size: 16px;
  920. color: #000;
  921. }
  922. .jlTime {
  923. margin-top: 10px;
  924. font-size: 13px;
  925. color: #ccc;
  926. }
  927. .jlBalance {
  928. margin-top: 5px;
  929. font-size: 13px;
  930. color: rgba(242, 46, 60, 1);
  931. }
  932. .jlBalance2 {
  933. margin-top: 5px;
  934. font-size: 16px;
  935. color: rgba(242, 46, 60, 1);
  936. }
  937. .jlMoney {
  938. text-align: right;
  939. font-size: 16px;
  940. }
  941. .jlMoney.just {
  942. color: rgba(56, 129, 253, 1);
  943. }
  944. .jlMoney.negative {
  945. color: rgba(242, 46, 60, 1);
  946. }
  947. }
  948. }
  949. }
  950. }
  951. /*特殊处理 */
  952. /deep/ .van-field__control{
  953. color: rgba(242, 46, 60, 1) !important
  954. }
  955. @media screen and (min-height:550px) and (max-height:570px){
  956. .list{
  957. height:120px;
  958. }
  959. }
  960. @media screen and (min-height:600px) and (max-height:650px){
  961. .list{
  962. height:166px;
  963. }
  964. }
  965. @media screen and (min-height:651px) and (max-height:670px){
  966. .list{
  967. height:155px;
  968. }
  969. }
  970. @media screen and (min-height:680px) and (max-height:740px){
  971. .list{
  972. height:175px;
  973. }
  974. }
  975. @media screen and (min-height:741px){
  976. .list{
  977. height:175px;
  978. }
  979. }
  980. </style>
  981. <style>
  982. .el-loading-mask{
  983. background-color: transparent;
  984. }
  985. .el-loading-spinner .path{
  986. stroke:rgb(255, 255, 255)!important
  987. }
  988. </style>