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-5cac3f95.js

2 lines
5.3 KiB

import{_ as X}from"./post-skeleton-9ec4e09d.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-c3d95faf.js";import{d as Z,r as c,j as J,c as _,V as e,a1 as o,o as n,_ as y,O as w,a,e as k,F as N,a4 as W,z as ee,v as te,M as r,Q as $,L as oe,a2 as ae,W as ne,X as se}from"./@vue-e0e89260.js";import{u as le}from"./vuex-473b3783.js";import{b as ce}from"./vue-router-b8e3382f.js";import{b as ie}from"./qrcode-9719fc56.js";import{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-9fb31432.js";import{a as me}from"./formatTime-4210fcd1.js";import{U as ge}from"./@vicons-0524c43e.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,H as xe,j as Ce,l as Se,h as Ie,G as Re}from"./naive-ui-e703c4e6.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.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-2ab8298d.js";const q=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},We={key:0,class:"pagination-wrap"},$e={key:0,class:"skeleton-wrap"},qe={key:1},Te={key:0,class:"empty-wrap"},Ue={class:"bill-line"},Ve={key:0,class:"amount-options"},Be={key:1,style:{"margin-top":"10px"}},Fe={class:"qrcode-wrap"},Le=q(()=>a("canvas",{id:"qrcode-container"},null,-1)),Oe={class:"pay-tips"},Pe={class:"pay-sub-tips"},Ee=q(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=Z({__name:"Wallet",setup(m){const i=le(),T=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+T.query.p||1),C=c(20),S=c(0),U=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,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},V=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"))},B=()=>{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(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},L=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{A()}),(s,l)=>{const I=Y,d=fe,O=ye,f=we,z=ke,P=be,E=X,M=xe,D=Re,Q=ve,j=Ce,G=Se,H=Ie,K=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(Q,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",We,[e(P,{page:x.value,"onUpdate:page":V,"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(d,{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:B},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:L},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",$e,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",qe,[b.value.length===0?(n(),_("div",Te,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,W(b.value,t=>(n(),$(D,{key:t.id},{default:o(()=>[a("div",Ue,[a("div",null,"NO."+r(