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-2l1r5HHK.js

2 lines
5.3 KiB

import{_ as J}from"./post-skeleton-Ci-jNNIC.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-NlSSnAqR.js";import{d as Y,H as c,b as X,f as r,k as e,w as o,e as n,bk as y,Z as w,j as a,A as k,F as N,x as $,P as ee,D as te,t as _,l as oe,v as q,y as ae,a0 as ne,a1 as se}from"./@vue-M2CzPUka.js";import{u as le}from"./vuex-k9agayot.js";import{b as ce}from"./vue-router-iNEl8q3a.js";import{b as ie}from"./qrcode-NFgyJgOr.js";import{a1 as re,a2 as _e,a3 as ue,a4 as pe,K as me,_ as de}from"./index-Ngk4ShPB.js";import{a1 as ge}from"./@vicons-t7bPon9z.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-CFtxauK_.js";import"./vooks-RlHpQsWY.js";import"./evtd-9ZCiDXyn.js";import"./encode-utf8-YzUDWyGG.js";import"./dijkstrajs-mfgL5WWt.js";import"./axios-zw96FDk0.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-5-iSHcg-.js";import"./@css-render-nQ5vzMKz.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const P=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},$e={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Pe={key:1},Be={key:0,class:"empty-wrap"},Te={class:"bill-line"},De={key:0,class:"amount-options"},Ee={key:1,style:{"margin-top":"10px"}},Fe={class:"qrcode-wrap"},Le=P(()=>a("canvas",{id:"qrcode-container"},null,-1)),Oe={class:"pay-tips"},Ue={class:"pay-sub-tips"},Ve=P(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),We=Y({__name:"Wallet",setup(d){const i=le(),B=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+B.query.p||1),C=c(20),S=c(0),T=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,_e({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},D=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?re(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"))},E=()=>{g.value=!0},F=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 I=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},L=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,m=fe,O=ye,f=we,z=ke,U=be,V=J,W=xe,M=Re,j=ve,H=Ce,K=Se,Z=Ie,G=he;return n(),r("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),r("div",$e,[e(U,{page:x.value,"onUpdate:page":D,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(O,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:E},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:L},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),r("div",qe,[e(V,{num:C.value},null,8,["num"])])):(n(),r("div",Pe,[b.value.length===0?(n(),r("div",Be,[e(W,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),r(N,null,$(b.value,t=>(n(),q(M,{key:t.id},{default:o(()=>[a("div",Te,[a("div",null,"NO."+_(t.id),1),a("div",null,_(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,_(y(me)(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(Z,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),r("div",De,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),r(N,null,$(T.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(_(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),r("div",Ee,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:F},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Fe,[Le,a("div",Oe," 请使用支付宝扫码支付"+_((u.value/100).toFixed(2))+"元 ",1),a("div",Ue,[e(K,{value:100,type:"info",dot:"",processing:""}),Ve])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}}),ft=de(We,[["__scopeId","data-v-870bd246"]]);export{ft as default};