pages-commission-wallet.97d4dcd9.js 6.6 KB

1
  1. import{s as a,z as s,c as e,o as t,bg as o,A as l,f as n,g as i,w as d,bL as r,_ as c,m as u,k as m,u as p,E as f,v as y,x as _,i as g,l as b,r as w,F as h,H as x,P as M,j as k,J as j,I as S,n as v}from"./index-ba48620e.js";import{_ as C}from"./uni-datetime-picker.b78d7e24.js";import{_ as T}from"./su-tabs.40b9ec30.js";import{_ as z}from"./su-sticky.f4f657b5.js";import{_ as B}from"./s-empty.a75760f9.js";import{a as V,_ as P}from"./phone-international-input.dd3ca29e.js";import{_ as G}from"./uni-load-more.966faf1b.js";import{_ as N}from"./s-layout.04b95866.js";import{f as Y,r as $}from"./useGoods.edb8879f.js";import{_ as U}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.539e0aa6.js";/* empty css */const D=U({__name:"wallet",setup(U){x((a=>({"26db5ee6":_(D)})));const D=a.$url.css("/static/img/shop/user/wallet_card_bg.png"),F=s({showMoney:!1,summary:{},today:"",date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",price:void 0,showModal:!1}),I=[{name:"分佣",value:"1"},{name:"提现",value:"2"}],q=e((()=>F.date[0]===F.date[1]?F.date[0]:F.date.join("~")));async function A(){F.loadStatus="loading";let{code:a,data:s}=await r.getBrokerageRecordPage({pageSize:F.pagination.pageSize,pageNo:F.pagination.pageNo,bizType:I[F.currentTab].value,"createTime[0]":F.date[0]+" 00:00:00","createTime[1]":F.date[1]+" 23:59:59"});0===a&&(F.pagination.list=c.concat(F.pagination.list,s.list),F.pagination.total=s.total,F.loadStatus=F.pagination.list.length<F.pagination.total?"more":"noMore")}function E(a){$(F.pagination),F.currentTab=a.index,A()}function H(a){F.date[0]=a[0],F.date[1]=a[a.length-1],$(F.pagination),A()}async function J(){F.price<=0?a.$helper.toast("请输入正确的金额"):M({title:"提示",content:"确认把您的佣金转入到余额钱包中?",success:async function(a){if(!a.confirm)return;const{code:s}=await r.createBrokerageWithdraw({type:1,price:100*F.price});0===s&&(F.showModal=!1,await L(),E({index:1}))}})}async function L(){const{code:a,data:s}=await r.getBrokerageUserSummary();0===a&&(F.summary=s)}return t((async a=>{F.today=o().format("YYYY-MM-DD"),F.date=[F.today,F.today],2===a.type&&(F.currentTab=1),A(),L()})),l((()=>{"noMore"!==F.loadStatus&&(F.pagination.pageNo++,A())})),(s,e)=>{const t=k,o=j,l=S,r=u(v("uni-datetime-picker"),C),c=u(v("su-tabs"),T),x=u(v("su-sticky"),z),M=u(v("s-empty"),B),$=u(v("uni-easyinput"),V),U=u(v("su-popup"),P),D=u(v("uni-load-more"),G),A=u(v("s-layout"),N);return n(),i(A,{class:"wallet-wrap",title:"佣金"},{default:d((()=>[m(t,{class:"header-box ss-flex ss-row-center ss-col-center"},{default:d((()=>[m(t,{class:"card-box ui-BG-Main ui-Shadow-Main"},{default:d((()=>[m(t,{class:"card-head ss-flex ss-col-center"},{default:d((()=>[m(t,{class:"card-title ss-m-r-10"},{default:d((()=>[p("当前佣金(元)")])),_:1}),m(t,{onClick:e[0]||(e[0]=a=>F.showMoney=!F.showMoney),class:f(["ss-eye-icon",F.showMoney?"cicon-eye":"cicon-eye-off"])},null,8,["class"])])),_:1}),m(t,{class:"ss-flex ss-row-between ss-col-center ss-m-t-30"},{default:d((()=>[m(t,{class:"money-num"},{default:d((()=>[p(y(F.showMoney?_(Y)(F.summary.withdrawPrice||0):"*****"),1)])),_:1}),m(t,{class:"ss-flex"},{default:d((()=>[m(t,{class:"ss-m-r-20"},{default:d((()=>[m(o,{class:"ss-reset-button withdraw-btn",onClick:e[1]||(e[1]=s=>_(a).$router.go("/pages/commission/withdraw"))},{default:d((()=>[p(" 提现 ")])),_:1})])),_:1}),m(o,{class:"ss-reset-button balance-btn ss-m-l-20",onClick:e[2]||(e[2]=a=>F.showModal=!0)},{default:d((()=>[p(" 转余额 ")])),_:1})])),_:1})])),_:1}),m(t,{class:"ss-flex"},{default:d((()=>[m(t,{class:"loading-money"},{default:d((()=>[m(t,{class:"loading-money-title"},{default:d((()=>[p("冻结佣金")])),_:1}),m(t,{class:"loading-money-num"},{default:d((()=>[p(y(F.showMoney?_(Y)(F.summary.frozenPrice||0):"*****"),1)])),_:1})])),_:1}),m(t,{class:"loading-money ss-m-l-100"},{default:d((()=>[m(t,{class:"loading-money-title"},{default:d((()=>[p("可提现佣金")])),_:1}),m(t,{class:"loading-money-num"},{default:d((()=>[p(y(F.showMoney?_(Y)(F.summary.brokeragePrice||0):"*****"),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),m(x,null,{default:d((()=>[m(t,{class:"filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between"},{default:d((()=>[m(r,{modelValue:F.date,"onUpdate:modelValue":e[3]||(e[3]=a=>F.date=a),type:"daterange",onChange:H,end:F.today},{default:d((()=>[m(o,{class:"ss-reset-button date-btn"},{default:d((()=>[m(l,null,{default:d((()=>[p(y(q.value),1)])),_:1}),m(l,{class:"cicon-drop-down ss-seldate-icon"})])),_:1})])),_:1},8,["modelValue","end"]),m(t,{class:"total-box"})])),_:1}),m(c,{list:I,onChange:E,scrollable:!1,current:F.currentTab},null,8,["current"])])),_:1}),0===F.pagination.total?(n(),i(M,{key:0,icon:"/static/data-empty.png",text:"暂无数据"})):g("",!0),m(U,{show:F.showModal,type:"bottom",round:"20",onClose:e[5]||(e[5]=a=>F.showModal=!1),showClose:""},{default:d((()=>[m(t,{class:"ss-p-x-20 ss-p-y-30"},{default:d((()=>[m(t,{class:"model-title ss-m-b-30 ss-m-l-20"},{default:d((()=>[p("转余额")])),_:1}),m(t,{class:"model-subtitle ss-m-b-100 ss-m-l-20"},{default:d((()=>[p("将您的佣金转到余额中继续消费")])),_:1}),m(t,{class:"input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20"},{default:d((()=>[m(t,{class:"unit"},{default:d((()=>[p("¥")])),_:1}),m($,{inputBorder:!1,class:"ss-flex-1 ss-p-l-10",modelValue:F.price,"onUpdate:modelValue":e[4]||(e[4]=a=>F.price=a),type:"number",placeholder:"请输入金额"},null,8,["modelValue"])])),_:1}),m(o,{class:"ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main",onClick:J},{default:d((()=>[p(" 确定 ")])),_:1})])),_:1})])),_:1},8,["show"]),F.pagination.total>0?(n(),i(t,{key:1},{default:d((()=>[(n(!0),b(h,null,w(F.pagination.list,(s=>(n(),i(t,{class:"wallet-list ss-flex border-bottom",key:s.id},{default:d((()=>[m(t,{class:"list-content"},{default:d((()=>[m(t,{class:"title-box ss-flex ss-row-between ss-m-b-20"},{default:d((()=>[m(l,{class:"title ss-line-1"},{default:d((()=>[p(y(s.title),1)])),_:2},1024),m(t,{class:"money"},{default:d((()=>[s.price>=0?(n(),i(l,{key:0,class:"add"},{default:d((()=>[p("+"+y(_(Y)(s.price)),1)])),_:2},1024)):(n(),i(l,{key:1,class:"minus"},{default:d((()=>[p(y(_(Y)(s.price)),1)])),_:2},1024))])),_:2},1024)])),_:2},1024),m(l,{class:"time"},{default:d((()=>[p(y(_(a).$helper.timeFormat(s.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})):g("",!0),F.pagination.total>0?(n(),i(D,{key:2,status:F.loadStatus,"content-text":{contentdown:"上拉加载更多"}},null,8,["status"])):g("",!0)])),_:1})}}},[["__scopeId","data-v-e3f8f56e"]]);export{D as default};