pages-commission-wallet.84573aff.js 6.6 KB

1
  1. import{s as a,y as e,c as s,o as t,az as o,z as l,e as n,f as i,w as r,_ as d,l as c,j as u,t as m,B as p,u as f,v as y,g as _,k as g,r as b,F as w,D as h,M as x,i as M,G as k,E as j,m as S}from"./index-b48a414d.js";import{_ as v}from"./uni-datetime-picker.c2317e65.js";import{_ as T}from"./su-tabs.a383f815.js";import{_ as z}from"./su-sticky.aabc6a00.js";import{_ as B}from"./s-empty.6d3471cc.js";import{a as C,_ as V}from"./phone-international-input.feef99c7.js";import{_ as G}from"./uni-load-more.647920f4.js";import{f as N,r as P,_ as Y}from"./s-layout.d6dcdc81.js";import{B as $}from"./brokerage.e67d9a73.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.78cdef34.js";/* empty css */const U=D({__name:"wallet",setup(D){h((a=>({"26db5ee6":y(U)})));const U=a.$url.css("/static/img/shop/user/wallet_card_bg.png"),F=e({showMoney:!1,summary:{},today:"",date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",price:void 0,showModal:!1}),A=[{name:"分佣",value:"1"},{name:"提现",value:"2"}],E=s((()=>F.date[0]===F.date[1]?F.date[0]:F.date.join("~")));async function I(){F.loadStatus="loading";let{code:a,data:e}=await $.getBrokerageRecordPage({pageSize:F.pagination.pageSize,pageNo:F.pagination.pageNo,bizType:A[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,e.list),F.pagination.total=e.total,F.loadStatus=F.pagination.list.length<F.pagination.total?"more":"noMore")}function J(a){P(F.pagination),F.currentTab=a.index,I()}function R(a){F.date[0]=a[0],F.date[1]=a[a.length-1],P(F.pagination),I()}async function W(){F.price<=0?a.$helper.toast("请输入正确的金额"):x({title:"提示",content:"确认把您的佣金转入到余额钱包中?",success:async function(a){if(!a.confirm)return;const{code:e}=await $.createBrokerageWithdraw({type:1,price:100*F.price});0===e&&(F.showModal=!1,await q(),J({index:1}))}})}async function q(){const{code:a,data:e}=await $.getBrokerageUserSummary();0===a&&(F.summary=e)}return t((async a=>{F.today=o().format("YYYY-MM-DD"),F.date=[F.today,F.today],2===a.type&&(F.currentTab=1),I(),q()})),l((()=>{"noMore"!==F.loadStatus&&(F.pagination.pageNo++,I())})),(e,s)=>{const t=M,o=k,l=j,d=c(S("uni-datetime-picker"),v),h=c(S("su-tabs"),T),x=c(S("su-sticky"),z),P=c(S("s-empty"),B),$=c(S("uni-easyinput"),C),D=c(S("su-popup"),V),U=c(S("uni-load-more"),G),I=c(S("s-layout"),Y);return n(),i(I,{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:s[0]||(s[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(N)(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:s[1]||(s[1]=e=>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:s[2]||(s[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(N)(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(N)(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":s[3]||(s[3]=a=>F.date=a),type:"daterange",onChange:R,end:F.today},{default:r((()=>[u(o,{class:"ss-reset-button date-btn"},{default:r((()=>[u(l,null,{default:r((()=>[m(f(E.value),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:A,onChange:J,scrollable:!1,current:F.currentTab},null,8,["current"])])),_:1}),0===F.pagination.total?(n(),i(P,{key:0,icon:"/static/data-empty.png",text:"暂无数据"})):_("",!0),u(D,{show:F.showModal,type:"bottom",round:"20",onClose:s[5]||(s[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":s[4]||(s[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:W},{default:r((()=>[m(" 确定 ")])),_:1})])),_:1})])),_:1},8,["show"]),F.pagination.total>0?(n(),i(t,{key:1},{default:r((()=>[(n(!0),g(w,null,b(F.pagination.list,(e=>(n(),i(t,{class:"wallet-list ss-flex border-bottom",key:e.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(e.title),1)])),_:2},1024),u(t,{class:"money"},{default:r((()=>[e.price>=0?(n(),i(l,{key:0,class:"add"},{default:r((()=>[m("+"+f(y(N)(e.price)),1)])),_:2},1024)):(n(),i(l,{key:1,class:"minus"},{default:r((()=>[m(f(y(N)(e.price)),1)])),_:2},1024))])),_:2},1024)])),_:2},1024),u(l,{class:"time"},{default:r((()=>[m(f(y(a).$helper.timeFormat(e.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-e3f8f56e"]]);export{U as default};