acdr-ui/dist/build/mp-weixin/modules/mall/commission/wallet.js

2 lines
4.5 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";var e=(e,t,o)=>new Promise(((n,a)=>{var i=e=>{try{r(o.next(e))}catch(t){a(t)}},s=e=>{try{r(o.throw(e))}catch(t){a(t)}},r=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,s);r((o=o.apply(e,t)).next())}));const t=require("../../../common/vendor.js"),o=require("../../../sheep/index.js"),n=require("../../../sheep/api/trade/brokerage.js"),a=require("../../../sheep/hooks/useGoods.js"),i=require("../../../sheep/util/index.js");if(!Array){(t.resolveComponent("uni-datetime-picker")+t.resolveComponent("su-tabs")+t.resolveComponent("su-sticky")+t.resolveComponent("s-empty")+t.resolveComponent("uni-easyinput")+t.resolveComponent("su-popup")+t.resolveComponent("uni-load-more")+t.resolveComponent("s-layout")+t.resolveComponent("layout-default-uni"))()}Math||((()=>"../../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js")+(()=>"../../../sheep/ui/su-tabs/su-tabs.js")+(()=>"../../../sheep/ui/su-sticky/su-sticky.js")+(()=>"../../../sheep/components/s-empty/s-empty.js")+(()=>"../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../../sheep/ui/su-popup/su-popup.js")+(()=>"../../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../../sheep/components/s-layout/s-layout.js"))();const s={__name:"wallet",setup(s){t.useCssVars((e=>({"6f923358":t.unref(r)})));const r=o.sheep.$url.css("/static/img/shop/user/wallet_card_bg.png"),u=t.reactive({showMoney:!1,summary:{},today:"",date:[],currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",price:void 0,showModal:!1}),p=[{name:"分佣",value:"1"},{name:"提现",value:"2"}],l=t.computed((()=>u.date[0]===u.date[1]?u.date[0]:u.date.join("~")));function c(){return e(this,null,(function*(){u.loadStatus="loading";const{code:e,data:o}=yield n.BrokerageApi.getBrokerageRecordPage({pageSize:u.pagination.pageSize,pageNo:u.pagination.pageNo,bizType:p[u.currentTab].value,"createTime[0]":u.date[0]+" 00:00:00","createTime[1]":u.date[1]+" 23:59:59"});0===e&&(u.pagination.list=t.lodash.concat(u.pagination.list,o.list),u.pagination.total=o.total,u.loadStatus=u.pagination.list.length<u.pagination.total?"more":"noMore")}))}function d(e){i.resetPagination(u.pagination),u.currentTab=e.index,c()}function m(e){u.date[0]=e[0],u.date[1]=e[e.length-1],i.resetPagination(u.pagination),c()}function y(){return e(this,null,(function*(){u.price<=0?o.sheep.$helper.toast("请输入正确的金额"):t.index.showModal({title:"提示",content:"确认把您的佣金转入到余额钱包中?",success:function(t){return e(this,null,(function*(){if(!t.confirm)return;const{code:e}=yield n.BrokerageApi.createBrokerageWithdraw({type:1,price:100*u.price});0===e&&(u.showModal=!1,yield h(),d({index:1}))}))}})}))}function h(){return e(this,null,(function*(){const{code:e,data:t}=yield n.BrokerageApi.getBrokerageUserSummary();0===e&&(u.summary=t)}))}return t.onLoad((o=>e(this,null,(function*(){u.today=t.dayjs().format("YYYY-MM-DD"),u.date=[u.today,u.today],2===o.type&&(u.currentTab=1),c(),h()})))),t.onReachBottom((()=>{"noMore"!==u.loadStatus&&(u.pagination.pageNo++,c())})),(e,n)=>t.e({a:t.o((e=>u.showMoney=!u.showMoney)),b:t.n(u.showMoney?"cicon-eye":"cicon-eye-off"),c:t.t(u.showMoney?t.unref(a.fen2yuan)(u.summary.withdrawPrice||0):"*****"),d:t.o((e=>t.unref(o.sheep).$router.go("/modules/mall/commission/withdraw"))),e:t.o((e=>u.showModal=!0)),f:t.t(u.showMoney?t.unref(a.fen2yuan)(u.summary.frozenPrice||0):"*****"),g:t.t(u.showMoney?t.unref(a.fen2yuan)(u.summary.brokeragePrice||0):"*****"),h:t.t(l.value),i:t.o(m),j:t.o((e=>u.date=e)),k:t.p({type:"daterange",end:u.today,modelValue:u.date}),l:t.o(d),m:t.p({list:p,scrollable:!1,current:u.currentTab}),n:0===u.pagination.total},0===u.pagination.total?{o:t.p({icon:"/static/data-empty.png",text:"暂无数据"})}:{},{p:t.o((e=>u.price=e)),q:t.p({inputBorder:!1,type:"number",placeholder:"请输入金额",modelValue:u.price}),r:t.o(y),s:t.o((e=>u.showModal=!1)),t:t.p({show:u.showModal,type:"bottom",round:"20",showClose:!0}),v:u.pagination.total>0},u.pagination.total>0?