Files
anmo/server/public/coach/assets/packages-pages-income-income.34031e63.js
2025-08-19 14:16:51 +08:00

2 lines
17 KiB
JavaScript
Executable File

import{_ as e}from"./page-meta.b66710fd.js";import{e as t,r as a,a as s,o as l,q as n,b as r,w as o,j as i,t as u,F as d,s as h,c,k as m,p as _,i as p,aW as f,R as y,d as g,n as x,f as D,$ as b,B as v,g as k,h as $,O as w,m as C}from"./index-af8b4f0a.js";import{_ as A,a as S}from"./tabs.4d70ee0e.js";import{_ as M}from"./z-paging.75493a34.js";import{_ as Y}from"./u-image.b6a3b610.js";import{_ as T}from"./price.1c6614d5.js";import{_ as N}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as j}from"./u-icon.7661429a.js";import{_ as z}from"./u-button.c275553c.js";import{_ as B}from"./u-popup.41ea4525.js";import{g as V}from"./order.fa2bb463.js";import"./u-badge.5f8e269b.js";import"./u-sticky.4cfaefbf.js";const I=N(t({__name:"card",props:{sn:null,order_status_desc:null,order_goods:null,order_amount:null,true_server_finish_time:null,order_status:null,settle_info:null,type:null,total_num:null,is_settle:null},setup:e=>(t,f)=>{const y=_,g=p,x=a(s("u-image"),Y);return l(),n(d,null,[r(g,{class:"bg-white px-[20rpx] pt-[30rpx] pb-[20rpx] rounded-t-lg"},{default:o((()=>[r(g,{class:"text-sm flex justify-between"},{default:o((()=>[r(y,{class:"text-info"},{default:o((()=>[i("订单编号:"+u(e.sn),1)])),_:1}),r(y,{class:"text-[#E86016]"},{default:o((()=>[i(u(e.is_settle?"已结算":"未结算"),1)])),_:1})])),_:1}),(l(!0),n(d,null,h(e.order_goods,(t=>(l(),c(g,{key:t.order_id,class:"mt-2 flex items-center"},{default:o((()=>[r(g,{class:"flex-none"},{default:o((()=>[r(x,{src:t.goods_image,width:"130rpx",height:"130rpx","border-radius":"16rpx"},null,8,["src"])])),_:2},1024),r(g,{class:"flex flex-col justify-between ml-2"},{default:o((()=>[r(g,{class:"line-clamp-1 font-bold text-lg"},{default:o((()=>[i(u(t.goods_name),1)])),_:2},1024),r(g,{class:"text-info text-sm"},{default:o((()=>[i("服务时间:"+u(t.duration)+"分钟",1)])),_:2},1024),r(T,{"font-weight":"700",content:t.goods_price},null,8,["content"])])),_:2},1024),r(g,{class:"ml-auto text-info"},{default:o((()=>[i("x"+u(e.total_num),1)])),_:1})])),_:2},1024)))),128)),r(g,{class:"mt-2 text-info text-xs"},{default:o((()=>[i("服务完成时间:"+u(e.true_server_finish_time),1)])),_:1})])),_:1}),m(" 未结算 "),0==e.settle_info.status?(l(),c(g,{key:0,class:"bg-white px-[20rpx] pb-[30rpx] rounded-b-lg flex items-baseline justify-end"},{default:o((()=>[r(g,{class:"text-xs"},{default:o((()=>[i("总金额:")])),_:1}),r(T,{content:e.order_amount,"font-weight":"700","main-size":"40rpx","sub-size":"24rpx",color:"#333333"},null,8,["content"])])),_:1})):(l(),n(d,{key:1},[m(" 已结算 "),r(g,{class:"settle px-[20rpx] py-[30rpx] rounded-b-lg flex justify-between"},{default:o((()=>[r(g,{class:"ml-[20rpx]"},{default:o((()=>[r(g,{class:"text-xs mb-[4rpx]"},{default:o((()=>[i(" 总金额: ")])),_:1}),r(T,{content:e.settle_info.order_amount,"font-weight":"700","main-size":"40rpx","sub-size":"24rpx",color:"#333333"},null,8,["content"])])),_:1}),r(g,{class:"ml-[20rpx]"},{default:o((()=>[r(g,{class:"text-[#A2704A] text-xs mb-[4rpx]"},{default:o((()=>[i(" 结算佣金: ")])),_:1}),r(T,{content:e.settle_info.coach_settle,"font-weight":"700","main-size":"40rpx","sub-size":"24rpx",color:"#703215"},null,8,["content"])])),_:1}),r(g,{class:"ml-[20rpx]"},{default:o((()=>[r(g,{class:"text-[#A2704A] text-xs mb-[4rpx]"},{default:o((()=>[i(" 结算车费: ")])),_:1}),r(T,{content:e.settle_info.settle_car,"font-weight":"700","main-size":"40rpx","sub-size":"24rpx",color:"#703215"},null,8,["content"])])),_:1})])),_:1})],2112))],64)}}),[["__scopeId","data-v-79d23255"]]);const W=N({name:"u-calendar",emits:["update:modelValue","input","change"],props:{value:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},safeAreaInsetBottom:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:0},changeYear:{type:Boolean,default:!0},changeMonth:{type:Boolean,default:!0},mode:{type:String,default:"date"},maxYear:{type:[Number,String],default:2050},minYear:{type:[Number,String],default:1950},minDate:{type:[Number,String],default:"1950-01-01"},maxDate:{type:[Number,String],default:""},borderRadius:{type:[String,Number],default:20},monthArrowColor:{type:String,default:"#606266"},yearArrowColor:{type:String,default:"#909399"},color:{type:String,default:"#303133"},activeBgColor:{type:String,default:"#2979ff"},activeColor:{type:String,default:"#ffffff"},rangeBgColor:{type:String,default:"rgba(41,121,255,0.13)"},rangeColor:{type:String,default:"#2979ff"},startText:{type:String,default:"开始"},endText:{type:String,default:"结束"},btnType:{type:String,default:"primary"},isActiveCurrent:{type:Boolean,default:!0},isChange:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},toolTip:{type:String,default:"选择日期"},blur:{type:[Number,String],default:0}},data:()=>({popupValue:!1,weekday:1,weekdayArr:[],days:0,daysArr:[],showTitle:"",year:2020,month:0,day:0,startYear:0,startMonth:0,startDay:0,endYear:0,endMonth:0,endDay:0,today:"",activeDate:"",startDate:"",endDate:"",isStart:!0,min:null,max:null,weekDayZh:["日","一","二","三","四","五","六"]}),computed:{valueCom(){return this.modelValue},dataChange(){return`${this.mode}-${this.minDate}-${this.maxDate}`},uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},watch:{dataChange(e){this.init()},valueCom(e,t){this.popupValue=e}},created(){this.init()},methods:{getColor(e,t){let a=1==t?"":this.color,s=e+1,l=`${this.year}-${this.month}-${s}`,n=new Date(l.replace(/\-/g,"/")).getTime(),r=this.startDate.replace(/\-/g,"/"),o=this.endDate.replace(/\-/g,"/");return this.isActiveCurrent&&this.activeDate==l||this.startDate==l||this.endDate==l?a=1==t?this.activeBgColor:this.activeColor:this.endDate&&n>new Date(r).getTime()&&n<new Date(o).getTime()&&(a=1==t?this.rangeBgColor:this.rangeColor),a},init(){let e=new Date;this.year=e.getFullYear(),this.month=e.getMonth()+1,this.day=e.getDate(),this.today=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,this.activeDate=this.today,this.min=this.initDate(this.minDate),this.max=this.initDate(this.maxDate||this.today),this.startDate="",this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.isStart=!0,this.changeData()},initDate(e){let t=e.split("-");return{year:Number(t[0]||1920),month:Number(t[1]||1),day:Number(t[2]||1)}},openDisAbled:function(e,t,a){let s=!0,l=`${e}/${t}/${a}`,n=`${this.min.year}/${this.min.month}/${this.min.day}`,r=`${this.max.year}/${this.max.month}/${this.max.day}`,o=new Date(l).getTime();return o>=new Date(n).getTime()&&o<=new Date(r).getTime()&&(s=!1),s},generateArray:function(e,t){return Array.from(new Array(t+1).keys()).slice(e)},formatNum:function(e){return e<10?"0"+e:e+""},getMonthDay:(e,t)=>new Date(e,t,0).getDate(),getWeekday:(e,t)=>new Date(`${e}/${t}/01 00:00:00`).getDay(),checkRange(e){let t=!1;return(e<this.minYear||e>this.maxYear)&&(f({title:"日期超出范围啦~",icon:"none"}),t=!0),t},changeMonthHandler(e){if(e){let e=this.month+1,t=e>12?this.year+1:this.year;this.checkRange(t)||(this.month=e>12?1:e,this.year=t,this.changeData())}else{let e=this.month-1,t=e<1?this.year-1:this.year;this.checkRange(t)||(this.month=e<1?12:e,this.year=t,this.changeData())}},changeYearHandler(e){let t=e?this.year+1:this.year-1;this.checkRange(t)||(this.year=t,this.changeData())},changeData(){this.days=this.getMonthDay(this.year,this.month),this.daysArr=this.generateArray(1,this.days),this.weekday=this.getWeekday(this.year,this.month),this.weekdayArr=this.generateArray(1,this.weekday),this.showTitle=`${this.year}${this.month}`,this.isChange&&"date"==this.mode&&this.btnFix(!0)},dateClick:function(e){if(e+=1,!this.openDisAbled(this.year,this.month,e)){this.day=e;let t=`${this.year}-${this.month}-${e}`;if("date"==this.mode)this.activeDate=t;else{let e=new Date(t.replace(/\-/g,"/")).getTime()<new Date(this.startDate.replace(/\-/g,"/")).getTime();this.isStart||e?(this.startDate=t,this.startYear=this.year,this.startMonth=this.month,this.startDay=this.day,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.activeDate="",this.isStart=!1):(this.endDate=t,this.endYear=this.year,this.endMonth=this.month,this.endDay=this.day,this.isStart=!0)}}},close(){this.$emit("input",!1),this.$emit("update:modelValue",!1)},getWeekText:e=>"星期"+["日","一","二","三","四","五","六"][(e=new Date(`${e.replace(/\-/g,"/")} 00:00:00`)).getDay()],btnFix(e){if(e||this.close(),"date"==this.mode){let e=this.activeDate.split("-"),t=this.isChange?this.year:Number(e[0]),a=this.isChange?this.month:Number(e[1]),s=this.isChange?this.day:Number(e[2]),l=this.getMonthDay(t,a),n=`${t}-${this.formatNum(a)}-${this.formatNum(s)}`,r=this.getWeekText(n),o=!1;`${t}-${a}-${s}`==this.today&&(o=!0),this.$emit("change",{year:t,month:a,day:s,days:l,result:n,week:r,isToday:o})}else{if(!this.startDate||!this.endDate)return;let e=this.formatNum(this.startMonth),t=this.formatNum(this.startDay),a=`${this.startYear}-${e}-${t}`,s=this.getWeekText(a),l=this.formatNum(this.endMonth),n=this.formatNum(this.endDay),r=`${this.endYear}-${l}-${n}`,o=this.getWeekText(r);this.$emit("change",{startYear:this.startYear,startMonth:this.startMonth,startDay:this.startDay,startDate:a,startWeek:s,endYear:this.endYear,endMonth:this.endMonth,endDay:this.endDay,endDate:r,endWeek:o})}}}},[["render",function(e,t,f,D,b,v){const k=p,$=a(s("u-icon"),j),w=_,C=a(s("u-button"),z),A=a(s("u-popup"),B);return l(),c(A,{blur:f.blur,closeable:"",maskCloseAble:f.maskCloseAble,mode:"bottom",popup:!1,modelValue:b.popupValue,"onUpdate:modelValue":t[5]||(t[5]=e=>b.popupValue=e),length:"auto",safeAreaInsetBottom:f.safeAreaInsetBottom,onClose:v.close,"z-index":v.uZIndex,"border-radius":f.borderRadius},{default:o((()=>[r(k,{class:"u-calendar"},{default:o((()=>[r(k,{class:"u-calendar__header"},{default:o((()=>[e.$slots.tooltip?y(e.$slots,"tooltip",{key:1},void 0,!0):(l(),c(k,{key:0,class:"u-calendar__header__text"},{default:o((()=>[i(u(f.toolTip),1)])),_:1}))])),_:3}),r(k,{class:"u-calendar__action u-flex u-row-center"},{default:o((()=>[r(k,{class:"u-calendar__action__icon"},{default:o((()=>[f.changeYear?(l(),c($,{key:0,name:"arrow-left-double",color:f.yearArrowColor,onClick:t[0]||(t[0]=e=>v.changeYearHandler(0))},null,8,["color"])):m("v-if",!0)])),_:1}),r(k,{class:"u-calendar__action__icon"},{default:o((()=>[f.changeMonth?(l(),c($,{key:0,name:"arrow-left",color:f.monthArrowColor,onClick:t[1]||(t[1]=e=>v.changeMonthHandler(0))},null,8,["color"])):m("v-if",!0)])),_:1}),r(k,{class:"u-calendar__action__text"},{default:o((()=>[i(u(b.showTitle),1)])),_:1}),r(k,{class:"u-calendar__action__icon"},{default:o((()=>[f.changeMonth?(l(),c($,{key:0,name:"arrow-right",color:f.monthArrowColor,onClick:t[2]||(t[2]=e=>v.changeMonthHandler(1))},null,8,["color"])):m("v-if",!0)])),_:1}),r(k,{class:"u-calendar__action__icon"},{default:o((()=>[f.changeYear?(l(),c($,{key:0,name:"arrow-right-double",color:f.yearArrowColor,onClick:t[3]||(t[3]=e=>v.changeYearHandler(1))},null,8,["color"])):m("v-if",!0)])),_:1})])),_:1}),r(k,{class:"u-calendar__week-day"},{default:o((()=>[(l(!0),n(d,null,h(b.weekDayZh,((e,t)=>(l(),c(k,{class:"u-calendar__week-day__text",key:t},{default:o((()=>[i(u(e),1)])),_:2},1024)))),128))])),_:1}),r(k,{class:"u-calendar__content"},{default:o((()=>[m(" 前置空白部分 "),(l(!0),n(d,null,h(b.weekdayArr,((e,t)=>(l(),c(k,{key:t,class:"u-calendar__content__item"})))),128)),(l(!0),n(d,null,h(b.daysArr,((e,t)=>(l(),c(k,{class:g(["u-calendar__content__item",{"u-hover-class":v.openDisAbled(b.year,b.month,t+1),"u-calendar__content--start-date":"range"==f.mode&&b.startDate==`${b.year}-${b.month}-${t+1}`||"date"==f.mode,"u-calendar__content--end-date":"range"==f.mode&&b.endDate==`${b.year}-${b.month}-${t+1}`||"date"==f.mode}]),style:x({backgroundColor:v.getColor(t,1)}),key:t,onClick:e=>v.dateClick(t)},{default:o((()=>[r(k,{class:"u-calendar__content__item__inner",style:x({color:v.getColor(t,2)})},{default:o((()=>[r(k,null,{default:o((()=>[i(u(t+1),1)])),_:2},1024)])),_:2},1032,["style"]),"range"==f.mode&&b.startDate==`${b.year}-${b.month}-${t+1}`&&b.startDate!=b.endDate?(l(),c(k,{key:0,class:"u-calendar__content__item__tips",style:x({color:f.activeColor})},{default:o((()=>[i(u(f.startText),1)])),_:1},8,["style"])):m("v-if",!0),"range"==f.mode&&b.endDate==`${b.year}-${b.month}-${t+1}`?(l(),c(k,{key:1,class:"u-calendar__content__item__tips",style:x({color:f.activeColor})},{default:o((()=>[i(u(f.endText),1)])),_:1},8,["style"])):m("v-if",!0)])),_:2},1032,["class","style","onClick"])))),128)),r(k,{class:"u-calendar__content__bg-month"},{default:o((()=>[i(u(b.month),1)])),_:1})])),_:1}),r(k,{class:"u-calendar__bottom"},{default:o((()=>[r(k,{class:"u-calendar__bottom__choose"},{default:o((()=>[r(w,null,{default:o((()=>[i(u("date"==f.mode?b.activeDate:b.startDate),1)])),_:1}),b.endDate?(l(),c(w,{key:0},{default:o((()=>[i("至"+u(b.endDate),1)])),_:1})):m("v-if",!0)])),_:1}),r(k,{class:"u-calendar__bottom__btn"},{default:o((()=>[r(C,{type:f.btnType,shape:"circle",size:"default",onClick:t[4]||(t[4]=e=>v.btnFix(!1))},{default:o((()=>[i("确定")])),_:1},8,["type"])])),_:1})])),_:1})])),_:3})])),_:3},8,["blur","maskCloseAble","modelValue","safeAreaInsetBottom","onClose","z-index","border-radius","closeable"])}],["__scopeId","data-v-e8f3cc38"]]),F=t({__name:"option",props:{startDate:null,endDate:null,orderAmount:null},emits:["update:startDate","update:endDate","change"],setup(e,{emit:t}){const n=D(!1),d=D(""),h=D(""),m=new Date,f=new Date;f.setMonth(m.getMonth()-1);const y=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,g=()=>{n.value=!0},x=e=>{d.value=e.startDate,h.value=e.endDate,t("update:startDate",e.startDate),t("update:endDate",e.endDate),t("change")};return b((()=>{d.value=y(f),h.value=y(m),t("update:startDate",d.value),t("update:endDate",h.value)})),(t,m)=>{const f=_,y=a(s("u-icon"),j),D=p,b=a(s("u-calendar"),W);return l(),c(D,{class:"px-[30rpx] py-[28rpx]"},{default:o((()=>[r(D,{class:"flex justify-between"},{default:o((()=>[r(D,{class:"flex items-center",onClick:g},{default:o((()=>[r(f,null,{default:o((()=>[i(u(d.value)+" - "+u(h.value),1)])),_:1}),r(y,{class:"ml-2",name:"arrow-down-fill",size:"18"})])),_:1}),r(D,null,{default:o((()=>[r(f,null,{default:o((()=>[i("总结算金额:")])),_:1}),r(f,{class:"font-bold text-lg"},{default:o((()=>[i(u(e.orderAmount),1)])),_:1}),r(f,null,{default:o((()=>[i("元")])),_:1})])),_:1})])),_:1}),r(b,{modelValue:n.value,"onUpdate:modelValue":m[0]||(m[0]=e=>n.value=e),mode:"range","safe-area-inset-bottom":"",onChange:x},null,8,["modelValue"])])),_:1})}}}),R=t({__name:"list",props:{type:{default:0},i:null,index:null},setup(e){const t=e,i=v(null),u=D([]),m=D(!0),_=D(""),f=D(""),y=D(0);k((()=>t.index),(async()=>{var e;await w(),t.i==t.index&&m.value&&(m.value=!1,null==(e=i.value)||e.reload())}),{immediate:!0});const g=async(e,a)=>{try{const{lists:s,extend:l}=await V({type:t.type,start_time:_.value,end_time:f.value,page_no:e,page_size:a});y.value=l.settle_amount,i.value.complete(s)}catch(s){console.log("报错=>",s),i.value.complete(!1)}};return(t,m)=>{const x=p,D=a(s("z-paging"),M);return l(),c(x,{class:"flex flex-col min-h-0 h-full"},{default:o((()=>[r(F,{startDate:_.value,"onUpdate:startDate":m[0]||(m[0]=e=>_.value=e),endDate:f.value,"onUpdate:endDate":m[1]||(m[1]=e=>f.value=e),orderAmount:y.value,onChange:m[2]||(m[2]=e=>{var t;return null==(t=$(i))?void 0:t.reload()})},null,8,["startDate","endDate","orderAmount"]),r(x,{class:"h-full"},{default:o((()=>[r(D,{"auto-show-back-to-top":"",auto:e.i==e.index,ref_key:"paging",ref:i,modelValue:u.value,"onUpdate:modelValue":m[3]||(m[3]=e=>u.value=e),"data-key":e.i,onQuery:g,fixed:!1,height:"100%"},{default:o((()=>[(l(!0),n(d,null,h(u.value,((t,a)=>(l(),c(x,{key:a,class:"px-[30rpx] pb-3",onClick:e=>{return a=t.id,void C({url:`/packages/pages/order_detail/order_detail?id=${a}`});var a}},{default:o((()=>[r(I,{sn:t.sn,order_status_desc:t.order_status_desc,order_goods:t.order_goods,order_amount:t.order_amount,true_server_finish_time:t.true_server_finish_time,order_status:t.order_status,settle_info:t.settle_info,type:e.type,total_num:t.total_num,is_settle:t.is_settle},null,8,["sn","order_status_desc","order_goods","order_amount","true_server_finish_time","order_status","settle_info","type","total_num","is_settle"])])),_:2},1032,["onClick"])))),128))])),_:1},8,["auto","modelValue","data-key"])])),_:1})])),_:1})}}}),H=N(t({__name:"income",setup(t){const i=D([{name:"平台订单",type:1},{name:"店铺订单",type:2}]),u=D(0),m=e=>{u.value=Number(e)};return(t,_)=>{const f=a(s("page-meta"),e),y=p,g=a(s("tab"),A),x=a(s("tabs"),S);return l(),n(d,null,[r(f,{"page-style":t.$theme.pageStyle},null,8,["page-style"]),r(y,{class:"income"},{default:o((()=>[r(x,{isScroll:!1,current:u.value,onChange:m,height:"80","bar-width":"60"},{default:o((()=>[(l(!0),n(d,null,h(i.value,((e,t)=>(l(),c(g,{key:t,name:e.name},{default:o((()=>[r(y,{class:"orderList"},{default:o((()=>[r(R,{type:e.type,i:t,index:u.value},null,8,["type","i","index"])])),_:2},1024)])),_:2},1032,["name"])))),128))])),_:1},8,["current"])])),_:1})],64)}}}),[["__scopeId","data-v-758b44e9"]]);export{H as default};