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-a477a3e7.js

2 lines
5.3 KiB

import{_ as G}from"./post-skeleton-47a1ebec.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-0888b762.js";import{d as K,H as c,b as J,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ne,$ as ae,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{X as _e,Y as re,Z as ue,$ as pe,E as de,_ as me}from"./index-5faa66a7.js";import{X as ge}from"./@vicons-7a4ef312.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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";const B=m=>(ae("data-v-870bd246"),m=m(),se(),m),Re={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Ee={key:0,class:"empty-wrap"},Fe={class:"bill-line"},Oe={key:0,class:"amount-options"},Pe={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},We=B(()=>n("canvas",{id:"qrcode-container"},null,-1)),De={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=K({__name:"Wallet",setup(m){const i=le(),E=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+E.query.p||1),C=c(20),I=c(0),F=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{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})},O=s=>{x.value=s,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).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(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},W=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=H,d=fe,D=ye,f=we,$=ke,L=be,U=G,V=xe,M=Ae,Y=ve,j=Ce,Q=Ie,X=Se,Z=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(Y,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":O,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[n("div",Re,[n("div",$e,[e(D,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),n("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:P},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:W},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(a(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(a(),_("div",Be,[b.value.length===0?(a(),_("div",Ee,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Fe,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),