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.
paopao-ce/web/dist/assets/Wallet-5214dc90.js

2 lines
5.3 KiB

import{_ as G}from"./post-skeleton-a5bf805a.js";import{_ as J}from"./main-nav.vue_vue_type_style_index_0_lang-d6d2ed7f.js";import{d as Q,r as c,j as X,c as _,L as e,Y as o,o as n,U as y,O as w,a,e as k,F as $,$ as N,z as ee,v as te,M as r,K as q,a1 as oe,Z as ae,a4 as ne,a5 as se}from"./@vue-f70ab1bd.js";import{u as le}from"./vuex-cc1858c6.js";import{b as ce}from"./vue-router-29025daf.js";import{b as ie}from"./qrcode-23069ad7.js";import{H as _e,I as re,J as ue,K as pe,_ as me}from"./index-ce5b62d8.js";import{a as de}from"./formatTime-936c40eb.js";import{r as ge}from"./@vicons-fc06a0bb.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as Ie,j as xe,l as Ce,h as Se,H as Re}from"./naive-ui-ddb574dd.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-59d11638.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const B=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Be={key:1},Fe={key:0,class:"empty-wrap"},Le={class:"bill-line"},Oe={key:0,class:"amount-options"},Pe={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),We={class:"pay-tips"},Ee={class:"pay-sub-tips"},Me=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Q({__name:"Wallet",setup(d){const i=le(),F=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),I=c(+F.query.p||1),x=c(20),C=c(0),L=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:I.value,page_size:x.value}).then(s=>{h.value=!1,b.value=s.list,C.value=Math.ceil(s.pager.total_rows/x.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},O=s=>{I.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},P=()=>{g.value=!0},T=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=J,m=fe,W=ye,f=we,z=ke,E=be,M=G,V=Ie,D=Re,K=ve,j=xe,H=Ce,Y=Se,Z=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(K,{class:"main-content-wrap",bordered:""},{footer:o(()=>[C.value>1?(n(),_("div",Ne,[e(E,{page:I.value,"onUpdate:page":O,"page-slot":y(i).state.collapsedRight?5:8,"page-count":C.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(W,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:P},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(M,{num:x.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Fe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Le,[a("div",null,"