pages-commission-wallet.fde8aa28.js 6.6 KB

1
  1. import{s as a,v as s,c as e,o as t,aw as o,x as l,e as n,f as i,w as r,_ as d,l as c,j as u,p as m,z as p,t as f,u as y,g as _,k as g,r as w,F as b,B as h,M as x,i as M,D as k,C as j,m as S}from"./index-9880b451.js";import{_ as v}from"./uni-datetime-picker.df7514bc.js";import{_ as C}from"./su-tabs.1ce39404.js";import{_ as T}from"./su-sticky.84aef901.js";import{_ as B}from"./s-empty.74111684.js";import{g as z,d as V,_ as Y}from"./s-layout.dfc5b0b5.js";import{_ as G}from"./uni-load-more.aac4524a.js";import{B as N}from"./brokerage.b6c9045b.js";import{f as P}from"./useGoods.bdd1c2ea.js";import{r as $}from"./index.df38848e.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css */const U=D({__name:"wallet",setup(D){h((a=>({"6b8e56ae":y(U)})));const U=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"}],R=e((()=>F.date[0]===F.date[1]?F.date[0]:F.date.join("~")));async function W(){F.loadStatus="loading";let{code:a,data:s}=await N.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=d.concat(F.pagination.list,s.list),F.pagination.total=s.total,F.loadStatus=F.pagination.list.length<F.pagination.total?"more":"noMore")}function Z(a){$(F.pagination),F.currentTab=a.index,W()}function q(a){F.date[0]=a[0],F.date[1]=a[a.length-1],$(F.pagination),W()}async function A(){F.price<=0?a.$helper.toast("请输入正确的金额"):x({title:"提示",content:"确认把您的佣金转入到余额钱包中?",success:async function(a){if(!a.confirm)return;const{code:s}=await N.createBrokerageWithdraw({type:1,price:100*F.price});0===s&&(F.showModal=!1,await E(),Z({index:1}))}})}async function E(){const{code:a,data:s}=await N.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),W(),E()})),l((()=>{"noMore"!==F.loadStatus&&(F.pagination.pageNo++,W())})),(s,e)=>{const t=M,o=k,l=j,d=c(S("uni-datetime-picker"),v),h=c(S("su-tabs"),C),x=c(S("su-sticky"),T),N=c(S("s-empty"),B),$=c(S("uni-easyinput"),z),D=c(S("su-popup"),V),U=c(S("uni-load-more"),G),W=c(S("s-layout"),Y);return n(),i(W,{class:"wallet-wrap",title:"佣金"},{default:r((()=>[u(t,{class:"header-box ss-flex ss-row-center ss-col-center"},{default:r((()=>[u(t,{class:"card-box ui-BG-Main ui-Shadow-Main"},{default:r((()=>[u(t,{class:"card-head ss-flex ss-col-center"},{default:r((()=>[u(t,{class:"card-title ss-m-r-10"},{default:r((()=>[m("当前佣金(元)")])),_:1}),u(t,{onClick:e[0]||(e[0]=a=>F.showMoney=!F.showMoney),class:p(["ss-eye-icon",F.showMoney?"cicon-eye":"cicon-eye-off"])},null,8,["class"])])),_:1}),u(t,{class:"ss-flex ss-row-between ss-col-center ss-m-t-30"},{default:r((()=>[u(t,{class:"money-num"},{default:r((()=>[m(f(F.showMoney?y(P)(F.summary.withdrawPrice||0):"*****"),1)])),_:1}),u(t,{class:"ss-flex"},{default:r((()=>[u(t,{class:"ss-m-r-20"},{default:r((()=>[u(o,{class:"ss-reset-button withdraw-btn",onClick:e[1]||(e[1]=s=>y(a).$router.go("/pages/commission/withdraw"))},{default:r((()=>[m(" 提现 ")])),_:1})])),_:1}),u(o,{class:"ss-reset-button balance-btn ss-m-l-20",onClick:e[2]||(e[2]=a=>F.showModal=!0)},{default:r((()=>[m(" 转余额 ")])),_:1})])),_:1})])),_:1}),u(t,{class:"ss-flex"},{default:r((()=>[u(t,{class:"loading-money"},{default:r((()=>[u(t,{class:"loading-money-title"},{default:r((()=>[m("冻结佣金")])),_:1}),u(t,{class:"loading-money-num"},{default:r((()=>[m(f(F.showMoney?y(P)(F.summary.frozenPrice||0):"*****"),1)])),_:1})])),_:1}),u(t,{class:"loading-money ss-m-l-100"},{default:r((()=>[u(t,{class:"loading-money-title"},{default:r((()=>[m("可提现佣金")])),_:1}),u(t,{class:"loading-money-num"},{default:r((()=>[m(f(F.showMoney?y(P)(F.summary.brokeragePrice||0):"*****"),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),u(x,null,{default:r((()=>[u(t,{class:"filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between"},{default:r((()=>[u(d,{modelValue:F.date,"onUpdate:modelValue":e[3]||(e[3]=a=>F.date=a),type:"daterange",onChange:q,end:F.today},{default:r((()=>[u(o,{class:"ss-reset-button date-btn"},{default:r((()=>[u(l,null,{default:r((()=>[m(f(y(R)),1)])),_:1}),u(l,{class:"cicon-drop-down ss-seldate-icon"})])),_:1})])),_:1},8,["modelValue","end"]),u(t,{class:"total-box"})])),_:1}),u(h,{list:I,onChange:Z,scrollable:!1,current:F.currentTab},null,8,["current"])])),_:1}),0===F.pagination.total?(n(),i(N,{key:0,icon:"/static/data-empty.png",text:"暂无数据"})):_("",!0),u(D,{show:F.showModal,type:"bottom",round:"20",onClose:e[5]||(e[5]=a=>F.showModal=!1),showClose:""},{default:r((()=>[u(t,{class:"ss-p-x-20 ss-p-y-30"},{default:r((()=>[u(t,{class:"model-title ss-m-b-30 ss-m-l-20"},{default:r((()=>[m("转余额")])),_:1}),u(t,{class:"model-subtitle ss-m-b-100 ss-m-l-20"},{default:r((()=>[m("将您的佣金转到余额中继续消费")])),_:1}),u(t,{class:"input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20"},{default:r((()=>[u(t,{class:"unit"},{default:r((()=>[m("¥")])),_:1}),u($,{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}),u(o,{class:"ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main",onClick:A},{default:r((()=>[m(" 确定 ")])),_:1})])),_:1})])),_:1},8,["show"]),F.pagination.total>0?(n(),i(t,{key:1},{default:r((()=>[(n(!0),g(b,null,w(F.pagination.list,(s=>(n(),i(t,{class:"wallet-list ss-flex border-bottom",key:s.id},{default:r((()=>[u(t,{class:"list-content"},{default:r((()=>[u(t,{class:"title-box ss-flex ss-row-between ss-m-b-20"},{default:r((()=>[u(l,{class:"title ss-line-1"},{default:r((()=>[m(f(s.title),1)])),_:2},1024),u(t,{class:"money"},{default:r((()=>[s.price>=0?(n(),i(l,{key:0,class:"add"},{default:r((()=>[m("+"+f(y(P)(s.price)),1)])),_:2},1024)):(n(),i(l,{key:1,class:"minus"},{default:r((()=>[m(f(y(P)(s.price)),1)])),_:2},1024))])),_:2},1024)])),_:2},1024),u(l,{class:"time"},{default:r((()=>[m(f(y(a).$helper.timeFormat(s.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})):_("",!0),F.pagination.total>0?(n(),i(U,{key:2,status:F.loadStatus,"content-text":{contentdown:"上拉加载更多"}},null,8,["status"])):_("",!0)])),_:1})}}},[["__scopeId","data-v-1358e15e"]]);export{U as default};