2 lines
9.7 KiB
JavaScript
2 lines
9.7 KiB
JavaScript
import{_ as M,u as T,r,a as g,h as U,o as i,f as a,b as e,d as l,w as f,e as h,i as J,j,F as z,g as F,n as A,t as d,c as O,k as b,p as q,l as H,q as Q,E as N}from"./index-VTp4Jfxm.js";import{e as W,p as X,f as Y,g as Z}from"./pay-wwG0X046.js";import{p as ee}from"./padding-DEByEsBs.js";function te(n){return{all:n=n||new Map,on:function(p,t){var _=n.get(p);_?_.push(t):n.set(p,[t])},off:function(p,t){var _=n.get(p);_&&(t?_.splice(_.indexOf(t)>>>0,1):n.set(p,[]))},emit:function(p,t){var _=n.get(p);_&&_.slice().map(function(u){u(t)}),(_=n.get("*"))&&_.slice().map(function(u){u(p,t)})}}}const K=te(),se=n=>(q("data-v-b34b92e4"),n=n(),H(),n),oe={class:"my-order"},ie={class:"header-nav"},ae=se(()=>e("div",{class:"nav-item"},"订单列表",-1)),le={class:"nav-item-clear"},ne={class:"header-input"},ce={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},de=["onClick"],re={class:"top"},_e={class:"create-time"},ue={class:"shop"},ve={key:0,class:"left"},fe={key:0,class:"shop-name"},pe={class:"right"},me={class:"money"},he={class:"count"},ye={class:"bottom"},ge={class:"pay"},ke={key:0},be={key:1,style:{color:"#ff4a00"}},$e={key:0,class:"cashier"},Ce={key:1,class:"cashier"},we={key:0,class:"load-end"},Ve={key:1,class:"load-end"},Se={__name:"order",setup(n){const p=T();r([]);const t=r(1),_=C=>{u.value.page=1,y.value=!1,v.value=!1,$.value=[],V(!0)};r(null);const u=r({page:1,limit:20,search_info:""}),v=r(!1),L=r(0),S=r(0),y=r(!1),$=r([]),V=(C=!1)=>{if(C)u.value.page=1;else if(y.value||v.value)return;v.value=!0,t.value==1&&(u.value.paid=null),t.value==2&&(u.value.paid=0),W(p.userInfo.service.mer_id,u.value).then(o=>{C?$.value=o.data.list:$.value=[...$.value,...o.data.list],o.data.list.length<u.value.limit?y.value=!0:u.value.page++,S.value=0,K.emit("set-order-detail",$.value[0]),L.value=o.data.count,v.value=!1}).catch(o=>{v.value=!1})},R=(C,o)=>{S.value=o,K.emit("set-order-detail",C)};return(C,o)=>{const c=g("el-radio-button"),x=g("el-radio-group"),P=g("el-button"),B=g("el-input"),w=g("el-image"),D=U("loading"),E=U("infinite-scroll");return i(),a("div",oe,[e("div",ie,[ae,e("div",le,[l(x,{modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=s=>t.value=s),onChange:_,size:"small"},{default:f(()=>[l(c,{value:1},{default:f(()=>[h("全部")]),_:1}),l(c,{value:2},{default:f(()=>[h("未支付")]),_:1})]),_:1},8,["modelValue"])])]),e("div",ne,[l(B,{modelValue:u.value.search_info,"onUpdate:modelValue":o[2]||(o[2]=s=>u.value.search_info=s),placeholder:"请输入订单编号",onKeydown:o[3]||(o[3]=J(s=>V(!0),["enter"])),onClear:o[4]||(o[4]=s=>V(!0)),clearable:""},{append:f(()=>[l(P,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:o[1]||(o[1]=s=>V(!0))},{default:f(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),j((i(),a("div",ce,[(i(!0),a(z,null,F($.value,(s,k)=>(i(),a("div",{class:A(["item",{"item-active":S.value==k}]),key:k,onClick:I=>R(s,k)},[e("div",re,[e("div",{class:A(["sn",{cahier:s.pay_type==11||s.pay_type==12}])},"单号: "+d(s.order_sn),3),e("div",_e,d(s.create_time),1)]),e("div",ue,[s.orderProduct?(i(),a("div",ve,[(i(!0),a(z,null,F(s.orderProduct.slice(0,5),(I,G)=>(i(),O(w,{key:G,src:I.cart_info.productAttr.image||I.cart_info.product.image,class:"shop-img"},null,8,["src"]))),128)),s.orderProduct.length==1?(i(),a("div",fe,d(s.orderProduct[0].cart_info.product.store_name),1)):b("",!0)])):b("",!0),e("div",pe,[e("div",me,"¥"+d(s.pay_price),1),e("div",he,"共"+d(s.total_num)+"件商品",1)])]),e("div",ye,[e("div",ge,[s.paid?(i(),a("span",ke,"已支付")):(i(),a("span",be,"未支付"))]),s.service_info?(i(),a("div",$e,"收银员: "+d(s.service_info.nickname),1)):(i(),a("div",Ce,"平台订单"))])],10,de))),128)),y.value?(i(),a("div",we,"没有更多了")):b("",!0),v.value?(i(),a("div",Ve,"加载中...")):b("",!0)])),[[D,v.value],[E,V]])])}}},Pe=M(Se,[["__scopeId","data-v-b34b92e4"]]),m=n=>(q("data-v-e393670f"),n=n(),H(),n),Le={class:"my-order"},xe={class:"header-nav"},Ie=["onClick"],Ae={class:"detail"},Re={key:0,class:"table"},Be={style:{"font-size":"0.9rem"}},De={style:{color:"#ff4a00"}},Ee={style:{display:"flex","align-items":"center"}},Ne={style:{"margin-left":"0.5rem"}},Ue={key:1,class:"table"},ze=m(()=>e("div",{class:"table-title"},"订单信息",-1)),Fe={class:"table-info"},Oe={class:"info-item"},Ke=m(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Me={class:"info-item-info"},Te={class:"info-item"},je=m(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),qe={class:"info-item-info"},He={class:"info-item"},Ge=m(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Je={class:"info-item-info"},Qe={class:"info-item"},We=m(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Xe={class:"info-item-info"},Ye={class:"info-item"},Ze=m(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=m(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),ot={class:"info-item-info"},it={class:"info-item"},at=m(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),lt={class:"info-item-info"},nt={key:0},ct={key:1},dt=m(()=>e("div",{class:"table-title"},"收银员信息",-1)),rt={class:"table-info",style:{"flex-direction":"column"}},_t={class:"info-item"},ut=m(()=>e("div",{class:"info-item-title"},"头像:",-1)),vt={class:"info-item-info"},ft={class:"info-item"},pt=m(()=>e("div",{class:"info-item-title"},"昵称:",-1)),mt={class:"info-item-info"},ht={class:"info-item"},yt=m(()=>e("div",{class:"info-item-title"},"账号:",-1)),gt={class:"info-item-info"},kt={key:2,class:"footer"},bt={class:"info"},$t={class:"ser"},Ct={class:"price"},wt={key:0,class:"handle"},Vt={key:1,class:"handle"},St=m(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Pt={class:"dialog-footer"},Lt={__name:"detail",setup(n){T();const p=Q(),t=r({});K.on("set-order-detail",o=>{t.value=o}),r([]);const _=r(null),u=r(!1);r(0);const v=r(0),L=r(["商品信息","订单详情"]),S=r(""),y=r(!1),$=o=>{S.value=o,y.value=!0},V=()=>{y.value=!1,Y({order_sn:S.value}).then(o=>{N({message:o.message,type:"success"}),p.push({name:"home"})})},R=o=>{_.value.setRePay({price:o.pay_price,order_id:o.group_order_id}),_.value.drawer=!0},C=o=>{Z({order_sn:o}).then(c=>{c.data.paid==1||c.message=="支付成功"?N({message:c.message,type:"success"}):N({message:c.message,type:"error"})}).catch(c=>{})};return(o,c)=>{const x=g("el-image"),P=g("el-table-column"),B=g("el-table"),w=g("el-button"),D=g("el-dialog"),E=U("loading");return i(),a("div",Le,[e("div",xe,[(i(!0),a(z,null,F(L.value,(s,k)=>(i(),a("div",{key:k,class:A(["nav-item",{"nav-item-active":v.value==k,"nav-item-radius1":v.value==k+1,"nav-item-radius2":v.value==k-1}]),onClick:I=>v.value=k},d(s),11,Ie))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":v.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),j((i(),a("div",Ae,[t.value.orderProduct&&v.value==0?(i(),a("div",Re,[e("div",Be,[h(" 共计 "),e("span",De,d(t.value.total_num),1),h(" 件商品 ")]),l(B,{style:{height:"calc(100vh - 100px - 14rem)"},data:t.value.orderProduct},{default:f(()=>[l(P,{prop:"cart_info.product.store_name",label:"商品信息"},{default:f(({row:s})=>[e("div",Ee,[l(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",Ne,d(s.cart_info.product.store_name),1)])]),_:1}),l(P,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),l(P,{prop:"product_num",label:"数量",width:"150"}),l(P,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):b("",!0),t.value.orderProduct&&v.value==1?(i(),a("div",Ue,[ze,e("div",Fe,[e("div",Oe,[Ke,e("div",Me,d(t.value.create_time),1)]),e("div",Te,[je,e("div",qe,d(t.value.total_num),1)]),e("div",He,[Ge,e("div",Je,"¥"+d(t.value.total_price),1)]),e("div",Qe,[We,e("div",Xe,d(t.value.pay_time),1)]),e("div",Ye,[Ze,e("div",et,"¥"+d(t.value.deduction_price),1)]),e("div",tt,[st,e("div",ot,"¥"+d(t.value.pay_price),1)]),e("div",it,[at,e("div",lt,[t.value.pay_type==11?(i(),a("span",nt,"微信收款")):b("",!0),t.value.pay_type==12?(i(),a("span",ct,"现金支付")):b("",!0)])])]),dt,e("div",rt,[e("div",_t,[ut,e("div",vt,[l(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:t.value.service_info.avatar},null,8,["src"])])]),e("div",ft,[pt,e("div",mt,d(t.value.service_info.nickname),1)]),e("div",ht,[yt,e("div",gt,d(t.value.service_info.account),1)])])])):b("",!0),t.value.service_info?(i(),a("div",kt,[e("div",bt,[e("div",$t,"收银员: "+d(t.value.service_info.nickname),1),e("div",Ct,[h(" 实付: "),e("span",null,"¥"+d(t.value.pay_price),1)])]),t.value.pay_time?(i(),a("div",Vt,"已支付")):(i(),a("div",wt,[l(w,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(t.value))},{default:f(()=>[h("重新支付")]),_:1}),l(w,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>C(t.value.order_sn))},{default:f(()=>[h("检测状态")]),_:1}),l(w,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>$(t.value.order_sn))},{default:f(()=>[h("提单")]),_:1})]))])):b("",!0)])),[[E,u.value]]),l(X,{ref_key:"payRef",ref:_},null,512),l(D,{modelValue:y.value,"onUpdate:modelValue":c[4]||(c[4]=s=>y.value=s),title:"提示",width:"500"},{footer:f(()=>[e("div",Pt,[l(w,{onClick:c[3]||(c[3]=s=>y.value=!1)},{default:f(()=>[h("取消")]),_:1}),o.cartCount>0?(i(),O(w,{key:0,onClick:o.goHome},{default:f(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(i(),O(w,{key:1,type:"primary",onClick:V},{default:f(()=>[h(" 确认提单 ")]),_:1}))])]),default:f(()=>[St]),_:1},8,["modelValue"])])}}},xt=M(Lt,[["__scopeId","data-v-e393670f"]]),It={class:"my-card"},Dt={__name:"index",setup(n){return(p,t)=>(i(),a("div",It,[l(Pe,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(ee),l(xt,{ref:"detailRef"},null,512)]))}};export{Dt as default};
|