mirror of https://github.com/rocboss/paopao-ce
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 lines
5.3 KiB
2 lines
5.3 KiB
import{_ as H}from"./post-skeleton-3282831e.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-a9416c73.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-23069ad7.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-b3062012.js";import{a as de}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-6d35273b.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 xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-2035804c.js";import"./vooks-2c48c2b5.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-973e5707.js";import"./@css-render-480a363d.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 O=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"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.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"))},L=()=>{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=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{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:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default};
|