diff --git a/build/assets/index-BL1i9waN.js b/build/assets/index-B61z2XJk.js similarity index 96% rename from build/assets/index-BL1i9waN.js rename to build/assets/index-B61z2XJk.js index 7727f7c..d580cdd 100644 --- a/build/assets/index-BL1i9waN.js +++ b/build/assets/index-B61z2XJk.js @@ -1 +1 @@ -import{c as W,a as X,b as B,d as Y,p as Z,o as ee}from"./pay-lz1-aziY.js";import{_ as U,r as u,a as _,o as g,c as q,w as y,b as e,d as n,e as v,t as V,f as C,F as O,g as M,h as j,i as te,j as G,k as J,p as K,l as T,m as oe,n as se,u as ae}from"./index-Cpj04_tS.js";import{p as le}from"./padding-CUL9ZbA7.js";import{g as ne,s as ce}from"./shop-CWcaSfoY.js";const ie={class:"price"},re={class:"flex"},ue={style:{margin:"10px","padding-bottom":"40px"}},de={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},_e={class:"dialog-footer"},pe={__name:"price",emits:["submit"],setup(w,{expose:x,emit:m}){const s=u(!1),r=u(0),o=(b,p=0)=>{s.value=b,r.value=p},c=u({nowPrice:"",percentage:""}),h=b=>{c.value.percentage=(b/r.value*100).toFixed(2)},$=b=>{c.value.nowPrice=(r.value*b/100).toFixed(2)},k=m,S=()=>{k("submit",c.value.nowPrice),s.value=!1};return x({show:o}),(b,p)=>{const A=_("el-input"),f=_("el-button"),I=_("el-dialog");return g(),q(I,{modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=a=>s.value=a),title:"订单改价",width:"650"},{footer:y(()=>[e("div",_e,[n(f,{class:"ok-btn",type:"primary",onClick:S},{default:y(()=>[v(" 确定 ")]),_:1})])]),default:y(()=>[e("div",ie,[e("div",re,[n(A,{style:{flex:"3",margin:"10px",height:"2.5rem"},modelValue:c.value.nowPrice,"onUpdate:modelValue":p[0]||(p[0]=a=>c.value.nowPrice=a),placeholder:"请输入改价后的价格",onInput:h},{suffix:y(()=>[v("元")]),_:1},8,["modelValue"]),n(A,{style:{flex:"2",margin:"10px",height:"2.5rem"},modelValue:c.value.percentage,"onUpdate:modelValue":p[1]||(p[1]=a=>c.value.percentage=a),placeholder:"请输入比例",onInput:$},{suffix:y(()=>[v("%")]),_:1},8,["modelValue"])]),e("div",ue,[v("改价后金额: "),e("span",de,"¥"+V(c.value.nowPrice||r.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},ve=U(pe,[["__scopeId","data-v-518d9bc5"]]),me={class:"my-order"},he={class:"header-nav"},fe={class:"nav-item"},ge={class:"order-list"},ye={class:"order-item-info"},ke={class:"order-item-title"},be={class:"title"},$e=["onClick"],we={class:"order-item-sku"},xe=["onClick"],Ie={class:"order-item-price"},Ve={class:"order-footer"},Ce={class:"order-total"},Ae={class:"price"},Pe={class:"total-item"},Se={style:{"font-size":"1.4rem"}},Le={class:"total-item"},Fe={class:"update-price"},De={class:"order-btn"},Re={__name:"order",emits:["goPay","editAttr"],setup(w,{expose:x,emit:m}){const s=u([]),r=u(0),o=u(0),c=()=>{let l=[];s.value.map(t=>{l.push(t.cart_id)}),l.length!=0&&$(l)},h=l=>{s.value=s.value.filter(t=>t.cart_id!=l),$([l])},$=l=>{W({cart_id:l}).then(t=>{console.log(t),k()})},k=()=>{r.value=0,o.value=0,X({source:300}).then(l=>{var t,i;((i=(t=l.data)==null?void 0:t.list)==null?void 0:i.length)>0?(s.value=l.data.list[0].list,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})):s.value=[]})};k();const S=m,b=()=>{S("goPay")},p=(l,t)=>{B(l.cart_id,{cart_num:l.cart_num}).then(i=>{r.value=0,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})})},A=l=>{S("editPupop",l)},f=(l,t)=>{B(l,t).then(i=>{k()})},I=l=>{o.value=r.value-l,r.value=+l};u(0);const a=u(null),D=()=>{a.value.show(!0,r.value)};return x({getList:k,list:s,editItem:f,discounts:o,allPrice:r}),(l,t)=>{const i=_("Delete"),d=_("el-icon"),F=_("el-empty"),R=_("el-image"),L=_("ArrowDown"),E=_("el-input-number"),N=_("el-button");return g(),C("div",me,[e("div",he,[e("div",fe,[v(" 已选购 "),e("span",null,V(s.value.length),1),v(" 件 ")]),e("div",{class:"nav-item-clear",onClick:c},[n(d,null,{default:y(()=>[n(i)]),_:1}),v("清空 ")])]),e("div",ge,[s.value.length==0?(g(),q(F,{key:0,description:"请点击右侧添加商品"})):(g(!0),C(O,{key:1},M(s.value,(P,Q)=>(g(),C("div",{class:"order-item",key:Q},[n(R,{loading:"lazy",class:"order-item-img",src:P.productAttr&&P.productAttr.image||P.product.image},null,8,["src"]),e("div",ye,[e("div",ke,[e("div",be,V(P.spu.store_name),1),e("div",{class:"delete",onClick:z=>h(P.cart_id)},"删除",8,$e)]),e("div",we,[e("span",{style:{display:"flex","align-items":"center"},onClick:z=>A(P)},[v("商品规格: "+V(P.productAttr.sku||"默认规格"),1),n(d,{size:"16",style:{"margin-left":"0.2rem"}},{default:y(()=>[n(L)]),_:1})],8,xe)]),e("div",Ie,[e("div",null,[v(" ¥"),e("span",null,V(P.productAttr.price),1)]),e("div",null,[n(E,{modelValue:P.cart_num,"onUpdate:modelValue":z=>P.cart_num=z,"step-strictly":"",min:1,step:1,onChange:z=>p(P)},null,8,["modelValue","onUpdate:modelValue","onChange"])])])])]))),128))]),e("div",Ve,[e("div",Ce,[e("div",Ae,[e("div",Pe,[v(" 实付: "),e("span",null,[v("¥"),e("span",Se,V(r.value.toFixed(2)),1)])]),e("div",Le,[v(" 优惠: "),e("span",null,[v("¥"),e("span",null,V(o.value.toFixed(2)),1)])])]),e("div",Fe,[n(N,{class:"btn",type:"primary",onClick:D},{default:y(()=>[v("改价")]),_:1})])]),e("div",De,[n(N,{class:"btn",type:"primary",onClick:b,disabled:s.value.length==0},{default:y(()=>[v("立即结账")]),_:1},8,["disabled"])])]),n(ve,{ref_key:"priceRef",ref:a,onSubmit:I},null,512)])}}},ze=U(Re,[["__scopeId","data-v-19078e04"]]),H=w=>(K("data-v-f3cb5c55"),w=w(),T(),w),Ue={class:"my-order"},Ee={class:"header-nav"},Ne=H(()=>e("div",{class:"nav-item-label"},"搜索",-1)),qe={class:"nav-item-input"},Oe={class:"shop-list","infinite-scroll-distance":"100","infinite-scroll-delay":"500",style:{overflow:"auto"}},Me=["onClick"],Be={class:"shop-name"},je={class:"shop-price"},Ge={key:0,class:"no-stock"},Je=H(()=>e("div",null,[e("span",null,"暂无"),e("span",null,"库存")],-1)),Ke=[Je],Te={__name:"shop",props:{storeList:{type:Array,default:()=>[]}},emits:["getStoreList","changeItem","loadMore"],setup(w,{emit:x}){const m=x,s=u(""),r=()=>{m("loadMore",{bar_code:s.value})},o=h=>{m("changeItem",h)},c=()=>{m("getStoreList",{bar_code:s.value})};return(h,$)=>{const k=_("el-input"),S=_("Search"),b=_("el-icon"),p=_("el-button"),A=_("el-image"),f=_("el-space"),I=j("infinite-scroll");return g(),C("div",Ue,[e("div",Ee,[Ne,e("div",qe,[n(k,{modelValue:s.value,"onUpdate:modelValue":$[0]||($[0]=a=>s.value=a),placeholder:"搜索商品名称/ID/唯一码或点击聚焦扫码",clearable:"",onKeyup:te(c,["enter"])},null,8,["modelValue"])]),e("div",{class:"nav-item-btn",onClick:c},[n(p,{class:"btn",type:"primary"},{default:y(()=>[n(b,null,{default:y(()=>[n(S)]),_:1})]),_:1})])]),G((g(),C("div",Oe,[n(f,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(w.storeList,(a,D)=>(g(),C("div",{class:"shop-item",key:D,onClick:l=>o(a)},[n(A,{loading:"lazy",src:a.image},null,8,["src"]),e("div",Be,V(a.store_name),1),e("div",je,[v(" ¥"),e("span",null,V(a.price),1)]),a.stock==0?(g(),C("div",Ge,Ke)):J("",!0)],8,Me))),128))]),_:1})])),[[I,r]])])}}},He=U(Te,[["__scopeId","data-v-f3cb5c55"]]),Qe=w=>(K("data-v-9ba07525"),w=w(),T(),w),We={class:"shop"},Xe={key:0,class:"shop-info"},Ye={class:"shop-info-left"},Ze={class:"shop-info-right"},et={class:"shop-info-right-top"},tt={class:"shop-info-right-center"},ot={class:"shop-info-right-price"},st={class:"shop-sku"},at=Qe(()=>e("div",{class:"title"},"产品",-1)),lt={class:"sku"},nt=["onClick"],ct={class:"dialog-footer"},it={__name:"pupop",emits:["changeItem"],setup(w,{expose:x,emit:m}){const s=u(!1),r=f=>{s.value=f},o=u({}),c=u(null),h=u(!1),$=u("add"),k=u({}),S=(f,I="add")=>{$.value=I,I=="add"?(o.value=f,c.value=f.attr[0]):(h.value=!0,k.value=f,ne(f.product_id).then(a=>{a.data.attrValue=JSON.parse(JSON.stringify(a.data.attr)),a.data.attr=Object.keys(a.data.sku),o.value=a.data,c.value=a.data.attr[0],h.value=!1}).catch(a=>{h.value=!1}))},b=m,p=()=>{$.value=="add"?b("changeItem",o.value,c.value):b("editItem",k.value.cart_id,{cart_num:k.value.cart_num,product_attr_unique:o.value.sku[c.value].unique}),s.value=!1},A=f=>{c.value=f};return x({show:r,setForm:S}),(f,I)=>{const a=_("el-image"),D=_("el-space"),l=_("el-button"),t=_("el-dialog"),i=j("loading");return g(),q(t,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=d=>s.value=d),title:"商品规格",width:"650"},oe({default:y(()=>{var d,F,R;return[G((g(),C("div",We,[o.value.sku?(g(),C("div",Xe,[e("div",Ye,[n(a,{loading:"lazy",src:((d=o.value.sku[c.value])==null?void 0:d.image)||o.value.image},null,8,["src"])]),e("div",Ze,[e("div",et,V(o.value.store_name),1),e("div",tt,"库存"+V(((F=o.value.sku[c.value])==null?void 0:F.stock)||0),1),e("div",ot,[v("¥"),e("span",null,V(((R=o.value.sku[c.value])==null?void 0:R.price)||o.value.price),1)])])])):J("",!0),e("div",st,[at,e("div",lt,[n(D,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(o.value.attr,(L,E)=>(g(),C("div",{class:se(["sku-item",{"sku-item_active":c.value==L}]),onClick:N=>A(L),key:E},V(L||"默认规格"),11,nt))),128))]),_:1})])])])),[[i,h.value]])]}),_:2},[$.value!="add"&&o.value.attr&&o.value.attr.length==1?void 0:{name:"footer",fn:y(()=>[e("div",ct,[n(l,{class:"ok-btn",type:"primary",onClick:p},{default:y(()=>[v(" 确定 ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},rt=U(it,[["__scopeId","data-v-9ba07525"]]),ut={class:"my-card"},mt={__name:"index",setup(w){const x=u(null),m=u(null),s=u(null),r=u(null),o=u([]),c=ae(),h=u({page:0,limit:30}),$=t=>{h.value={source:300,...h.value,...t},ce(c.userInfo.service.mer_id,h.value).then(i=>{var F,R;((R=(F=i.data)==null?void 0:F.list)==null?void 0:R.length)(L.attr=Object.keys(L.sku),L));o.value=o.value.concat(d),t.bar_code&&o.value.length==1&&b(t.bar_code)&&p(o.value[0],o.value[0].attr[0])})},k=u(!1),S=t=>{k.value||(h.value.page++,$(t))};function b(t){return/^\d+$/.test(t)}const p=(t,i="")=>{let d={is_new:0,product_id:t.product_id,cart_num:1,product_attr_unique:t.sku[i]!==void 0?t.sku[i].unique:"",source:300,product_type:0};Y(d).then(F=>{m.value.getList()})},A=(t,i)=>{if(!t.attr||t.attr.length==0||t.attr.length==1)return p(t,t.attr[0]?t.attr[0]:"");if(i)return p(t,i);x.value.setForm(t,"add"),x.value.show(!0)},f=(t,i)=>{m.value.editItem(t,i)},I=t=>{x.value.setForm(t,"edit"),x.value.show(!0)},a=()=>{let t=m.value.list.map(d=>d.cart_id),i={takes:[],use_coupon:{},use_integral:!1,cart_id:t};m.value.discounts>0&&(i.deduction_price=m.value.discounts.toFixed(2),i.pay_type="micropay"),ee(i).then(d=>{r.value.setForm({data:d.data,cart_id:t})})},D=()=>{a(),r.value.drawer=!0},l=()=>{m.value.getList()};return(t,i)=>(g(),C("div",ut,[n(ze,{ref_key:"orderRef",ref:m,onGoPay:D,onEditPupop:I},null,512),n(le),n(He,{ref_key:"shopRef",ref:s,style:{flex:"1"},storeList:o.value,onGetStoreList:$,onChangeItem:A,onLoadMore:S},null,8,["storeList"]),n(rt,{ref_key:"pupopRef",ref:x,onChangeItem:A,onEditItem:f},null,512),n(Z,{ref_key:"payRef",ref:r,onPaySuccess:l},null,512)]))}};export{mt as default}; +import{c as W,a as X,b as B,d as Y,p as Z,o as ee}from"./pay-6EAQtcAa.js";import{_ as U,r as u,a as _,o as g,c as q,w as y,b as e,d as n,e as v,t as V,f as C,F as O,g as M,h as j,i as te,j as G,k as J,p as K,l as T,m as oe,n as se,u as ae}from"./index-XP2RAAdj.js";import{p as le}from"./padding-PEDJpdPM.js";import{g as ne,s as ce}from"./shop-CkbXiufP.js";const ie={class:"price"},re={class:"flex"},ue={style:{margin:"10px","padding-bottom":"40px"}},de={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},_e={class:"dialog-footer"},pe={__name:"price",emits:["submit"],setup(w,{expose:x,emit:m}){const s=u(!1),r=u(0),o=(b,p=0)=>{s.value=b,r.value=p},c=u({nowPrice:"",percentage:""}),h=b=>{c.value.percentage=(b/r.value*100).toFixed(2)},$=b=>{c.value.nowPrice=(r.value*b/100).toFixed(2)},k=m,S=()=>{k("submit",c.value.nowPrice),s.value=!1};return x({show:o}),(b,p)=>{const A=_("el-input"),f=_("el-button"),I=_("el-dialog");return g(),q(I,{modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=a=>s.value=a),title:"订单改价",width:"650"},{footer:y(()=>[e("div",_e,[n(f,{class:"ok-btn",type:"primary",onClick:S},{default:y(()=>[v(" 确定 ")]),_:1})])]),default:y(()=>[e("div",ie,[e("div",re,[n(A,{style:{flex:"3",margin:"10px",height:"2.5rem"},modelValue:c.value.nowPrice,"onUpdate:modelValue":p[0]||(p[0]=a=>c.value.nowPrice=a),placeholder:"请输入改价后的价格",onInput:h},{suffix:y(()=>[v("元")]),_:1},8,["modelValue"]),n(A,{style:{flex:"2",margin:"10px",height:"2.5rem"},modelValue:c.value.percentage,"onUpdate:modelValue":p[1]||(p[1]=a=>c.value.percentage=a),placeholder:"请输入比例",onInput:$},{suffix:y(()=>[v("%")]),_:1},8,["modelValue"])]),e("div",ue,[v("改价后金额: "),e("span",de,"¥"+V(c.value.nowPrice||r.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},ve=U(pe,[["__scopeId","data-v-518d9bc5"]]),me={class:"my-order"},he={class:"header-nav"},fe={class:"nav-item"},ge={class:"order-list"},ye={class:"order-item-info"},ke={class:"order-item-title"},be={class:"title"},$e=["onClick"],we={class:"order-item-sku"},xe=["onClick"],Ie={class:"order-item-price"},Ve={class:"order-footer"},Ce={class:"order-total"},Ae={class:"price"},Pe={class:"total-item"},Se={style:{"font-size":"1.4rem"}},Le={class:"total-item"},Fe={class:"update-price"},De={class:"order-btn"},Re={__name:"order",emits:["goPay","editAttr"],setup(w,{expose:x,emit:m}){const s=u([]),r=u(0),o=u(0),c=()=>{let l=[];s.value.map(t=>{l.push(t.cart_id)}),l.length!=0&&$(l)},h=l=>{s.value=s.value.filter(t=>t.cart_id!=l),$([l])},$=l=>{W({cart_id:l}).then(t=>{console.log(t),k()})},k=()=>{r.value=0,o.value=0,X({source:300}).then(l=>{var t,i;((i=(t=l.data)==null?void 0:t.list)==null?void 0:i.length)>0?(s.value=l.data.list[0].list,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})):s.value=[]})};k();const S=m,b=()=>{S("goPay")},p=(l,t)=>{B(l.cart_id,{cart_num:l.cart_num}).then(i=>{r.value=0,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})})},A=l=>{S("editPupop",l)},f=(l,t)=>{B(l,t).then(i=>{k()})},I=l=>{o.value=r.value-l,r.value=+l};u(0);const a=u(null),D=()=>{a.value.show(!0,r.value)};return x({getList:k,list:s,editItem:f,discounts:o,allPrice:r}),(l,t)=>{const i=_("Delete"),d=_("el-icon"),F=_("el-empty"),R=_("el-image"),L=_("ArrowDown"),E=_("el-input-number"),N=_("el-button");return g(),C("div",me,[e("div",he,[e("div",fe,[v(" 已选购 "),e("span",null,V(s.value.length),1),v(" 件 ")]),e("div",{class:"nav-item-clear",onClick:c},[n(d,null,{default:y(()=>[n(i)]),_:1}),v("清空 ")])]),e("div",ge,[s.value.length==0?(g(),q(F,{key:0,description:"请点击右侧添加商品"})):(g(!0),C(O,{key:1},M(s.value,(P,Q)=>(g(),C("div",{class:"order-item",key:Q},[n(R,{loading:"lazy",class:"order-item-img",src:P.productAttr&&P.productAttr.image||P.product.image},null,8,["src"]),e("div",ye,[e("div",ke,[e("div",be,V(P.spu.store_name),1),e("div",{class:"delete",onClick:z=>h(P.cart_id)},"删除",8,$e)]),e("div",we,[e("span",{style:{display:"flex","align-items":"center"},onClick:z=>A(P)},[v("商品规格: "+V(P.productAttr.sku||"默认规格"),1),n(d,{size:"16",style:{"margin-left":"0.2rem"}},{default:y(()=>[n(L)]),_:1})],8,xe)]),e("div",Ie,[e("div",null,[v(" ¥"),e("span",null,V(P.productAttr.price),1)]),e("div",null,[n(E,{modelValue:P.cart_num,"onUpdate:modelValue":z=>P.cart_num=z,"step-strictly":"",min:1,step:1,onChange:z=>p(P)},null,8,["modelValue","onUpdate:modelValue","onChange"])])])])]))),128))]),e("div",Ve,[e("div",Ce,[e("div",Ae,[e("div",Pe,[v(" 实付: "),e("span",null,[v("¥"),e("span",Se,V(r.value.toFixed(2)),1)])]),e("div",Le,[v(" 优惠: "),e("span",null,[v("¥"),e("span",null,V(o.value.toFixed(2)),1)])])]),e("div",Fe,[n(N,{class:"btn",type:"primary",onClick:D},{default:y(()=>[v("改价")]),_:1})])]),e("div",De,[n(N,{class:"btn",type:"primary",onClick:b,disabled:s.value.length==0},{default:y(()=>[v("立即结账")]),_:1},8,["disabled"])])]),n(ve,{ref_key:"priceRef",ref:a,onSubmit:I},null,512)])}}},ze=U(Re,[["__scopeId","data-v-19078e04"]]),H=w=>(K("data-v-f3cb5c55"),w=w(),T(),w),Ue={class:"my-order"},Ee={class:"header-nav"},Ne=H(()=>e("div",{class:"nav-item-label"},"搜索",-1)),qe={class:"nav-item-input"},Oe={class:"shop-list","infinite-scroll-distance":"100","infinite-scroll-delay":"500",style:{overflow:"auto"}},Me=["onClick"],Be={class:"shop-name"},je={class:"shop-price"},Ge={key:0,class:"no-stock"},Je=H(()=>e("div",null,[e("span",null,"暂无"),e("span",null,"库存")],-1)),Ke=[Je],Te={__name:"shop",props:{storeList:{type:Array,default:()=>[]}},emits:["getStoreList","changeItem","loadMore"],setup(w,{emit:x}){const m=x,s=u(""),r=()=>{m("loadMore",{bar_code:s.value})},o=h=>{m("changeItem",h)},c=()=>{m("getStoreList",{bar_code:s.value})};return(h,$)=>{const k=_("el-input"),S=_("Search"),b=_("el-icon"),p=_("el-button"),A=_("el-image"),f=_("el-space"),I=j("infinite-scroll");return g(),C("div",Ue,[e("div",Ee,[Ne,e("div",qe,[n(k,{modelValue:s.value,"onUpdate:modelValue":$[0]||($[0]=a=>s.value=a),placeholder:"搜索商品名称/ID/唯一码或点击聚焦扫码",clearable:"",onKeyup:te(c,["enter"])},null,8,["modelValue"])]),e("div",{class:"nav-item-btn",onClick:c},[n(p,{class:"btn",type:"primary"},{default:y(()=>[n(b,null,{default:y(()=>[n(S)]),_:1})]),_:1})])]),G((g(),C("div",Oe,[n(f,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(w.storeList,(a,D)=>(g(),C("div",{class:"shop-item",key:D,onClick:l=>o(a)},[n(A,{loading:"lazy",src:a.image},null,8,["src"]),e("div",Be,V(a.store_name),1),e("div",je,[v(" ¥"),e("span",null,V(a.price),1)]),a.stock==0?(g(),C("div",Ge,Ke)):J("",!0)],8,Me))),128))]),_:1})])),[[I,r]])])}}},He=U(Te,[["__scopeId","data-v-f3cb5c55"]]),Qe=w=>(K("data-v-9ba07525"),w=w(),T(),w),We={class:"shop"},Xe={key:0,class:"shop-info"},Ye={class:"shop-info-left"},Ze={class:"shop-info-right"},et={class:"shop-info-right-top"},tt={class:"shop-info-right-center"},ot={class:"shop-info-right-price"},st={class:"shop-sku"},at=Qe(()=>e("div",{class:"title"},"产品",-1)),lt={class:"sku"},nt=["onClick"],ct={class:"dialog-footer"},it={__name:"pupop",emits:["changeItem"],setup(w,{expose:x,emit:m}){const s=u(!1),r=f=>{s.value=f},o=u({}),c=u(null),h=u(!1),$=u("add"),k=u({}),S=(f,I="add")=>{$.value=I,I=="add"?(o.value=f,c.value=f.attr[0]):(h.value=!0,k.value=f,ne(f.product_id).then(a=>{a.data.attrValue=JSON.parse(JSON.stringify(a.data.attr)),a.data.attr=Object.keys(a.data.sku),o.value=a.data,c.value=a.data.attr[0],h.value=!1}).catch(a=>{h.value=!1}))},b=m,p=()=>{$.value=="add"?b("changeItem",o.value,c.value):b("editItem",k.value.cart_id,{cart_num:k.value.cart_num,product_attr_unique:o.value.sku[c.value].unique}),s.value=!1},A=f=>{c.value=f};return x({show:r,setForm:S}),(f,I)=>{const a=_("el-image"),D=_("el-space"),l=_("el-button"),t=_("el-dialog"),i=j("loading");return g(),q(t,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=d=>s.value=d),title:"商品规格",width:"650"},oe({default:y(()=>{var d,F,R;return[G((g(),C("div",We,[o.value.sku?(g(),C("div",Xe,[e("div",Ye,[n(a,{loading:"lazy",src:((d=o.value.sku[c.value])==null?void 0:d.image)||o.value.image},null,8,["src"])]),e("div",Ze,[e("div",et,V(o.value.store_name),1),e("div",tt,"库存"+V(((F=o.value.sku[c.value])==null?void 0:F.stock)||0),1),e("div",ot,[v("¥"),e("span",null,V(((R=o.value.sku[c.value])==null?void 0:R.price)||o.value.price),1)])])])):J("",!0),e("div",st,[at,e("div",lt,[n(D,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(o.value.attr,(L,E)=>(g(),C("div",{class:se(["sku-item",{"sku-item_active":c.value==L}]),onClick:N=>A(L),key:E},V(L||"默认规格"),11,nt))),128))]),_:1})])])])),[[i,h.value]])]}),_:2},[$.value!="add"&&o.value.attr&&o.value.attr.length==1?void 0:{name:"footer",fn:y(()=>[e("div",ct,[n(l,{class:"ok-btn",type:"primary",onClick:p},{default:y(()=>[v(" 确定 ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},rt=U(it,[["__scopeId","data-v-9ba07525"]]),ut={class:"my-card"},mt={__name:"index",setup(w){const x=u(null),m=u(null),s=u(null),r=u(null),o=u([]),c=ae(),h=u({page:0,limit:30}),$=t=>{h.value={source:300,...h.value,...t},ce(c.userInfo.service.mer_id,h.value).then(i=>{var F,R;((R=(F=i.data)==null?void 0:F.list)==null?void 0:R.length)(L.attr=Object.keys(L.sku),L));o.value=o.value.concat(d),t.bar_code&&o.value.length==1&&b(t.bar_code)&&p(o.value[0],o.value[0].attr[0])})},k=u(!1),S=t=>{k.value||(h.value.page++,$(t))};function b(t){return/^\d+$/.test(t)}const p=(t,i="")=>{let d={is_new:0,product_id:t.product_id,cart_num:1,product_attr_unique:t.sku[i]!==void 0?t.sku[i].unique:"",source:300,product_type:0};Y(d).then(F=>{m.value.getList()})},A=(t,i)=>{if(!t.attr||t.attr.length==0||t.attr.length==1)return p(t,t.attr[0]?t.attr[0]:"");if(i)return p(t,i);x.value.setForm(t,"add"),x.value.show(!0)},f=(t,i)=>{m.value.editItem(t,i)},I=t=>{x.value.setForm(t,"edit"),x.value.show(!0)},a=()=>{let t=m.value.list.map(d=>d.cart_id),i={takes:[],use_coupon:{},use_integral:!1,cart_id:t};m.value.discounts>0&&(i.deduction_price=m.value.discounts.toFixed(2),i.pay_type="micropay"),ee(i).then(d=>{r.value.setForm({data:d.data,cart_id:t})})},D=()=>{a(),r.value.drawer=!0},l=()=>{m.value.getList()};return(t,i)=>(g(),C("div",ut,[n(ze,{ref_key:"orderRef",ref:m,onGoPay:D,onEditPupop:I},null,512),n(le),n(He,{ref_key:"shopRef",ref:s,style:{flex:"1"},storeList:o.value,onGetStoreList:$,onChangeItem:A,onLoadMore:S},null,8,["storeList"]),n(rt,{ref_key:"pupopRef",ref:x,onChangeItem:A,onEditItem:f},null,512),n(Z,{ref_key:"payRef",ref:r,onPaySuccess:l},null,512)]))}};export{mt as default}; diff --git a/build/assets/index-DqcskVAD.js b/build/assets/index-BD5A0gEe.js similarity index 96% rename from build/assets/index-DqcskVAD.js rename to build/assets/index-BD5A0gEe.js index b98b809..7500435 100644 --- a/build/assets/index-DqcskVAD.js +++ b/build/assets/index-BD5A0gEe.js @@ -1 +1 @@ -import{_ as V,u as g,q as x,r as k,y as U,a,f as I,b as i,d as e,w as o,o as S,e as b,p as L,l as B,E as u,z as C,A as E}from"./index-Cpj04_tS.js";const N=l=>(L("data-v-00c0f4e8"),l=l(),B(),l),M={class:"body"},T={class:"login"},q=N(()=>i("div",{class:"title"},"里海收银系统 - 登录",-1)),z={__name:"index",setup(l){const d=g(),m=x(),t=k({account:"",password:"",key:"",captchaVerification:"",code:""}),f=()=>{if(!t.value.account)return u({message:"请填写账号",type:"error"});if(!t.value.password)return u({message:"请填写密码",type:"error"});C(t.value).then(n=>{console.log(n),n.data&&(d.setToken(n.data.token),E().then(({data:s})=>{if(!s.service)return u({message:"请联系管理员开通服务",type:"error"});d.setUserInfo(s),m.push("/")}))}).catch(n=>{})};return U(()=>{}),(n,s)=>{const v=a("User"),p=a("el-icon"),_=a("el-input"),r=a("el-form-item"),h=a("Lock"),w=a("el-button"),y=a("el-form");return S(),I("div",M,[i("div",T,[q,e(y,null,{default:o(()=>[e(r,null,{default:o(()=>[e(_,{modelValue:t.value.account,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value.account=c),placeholder:"请输入账号"},{prefix:o(()=>[e(p,null,{default:o(()=>[e(v)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(_,{modelValue:t.value.password,"onUpdate:modelValue":s[1]||(s[1]=c=>t.value.password=c),type:"password",placeholder:"请输入密码","show-password":""},{prefix:o(()=>[e(p,null,{default:o(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(w,{style:{width:"100%"},type:"primary",onClick:f},{default:o(()=>[b("登录")]),_:1})]),_:1})]),_:1})])])}}},R=V(z,[["__scopeId","data-v-00c0f4e8"]]);export{R as default}; +import{_ as V,u as g,q as x,r as k,y as U,a,f as I,b as i,d as e,w as o,o as S,e as b,p as L,l as B,E as u,z as C,A as E}from"./index-XP2RAAdj.js";const N=l=>(L("data-v-00c0f4e8"),l=l(),B(),l),M={class:"body"},T={class:"login"},q=N(()=>i("div",{class:"title"},"里海收银系统 - 登录",-1)),z={__name:"index",setup(l){const d=g(),m=x(),t=k({account:"",password:"",key:"",captchaVerification:"",code:""}),f=()=>{if(!t.value.account)return u({message:"请填写账号",type:"error"});if(!t.value.password)return u({message:"请填写密码",type:"error"});C(t.value).then(n=>{console.log(n),n.data&&(d.setToken(n.data.token),E().then(({data:s})=>{if(!s.service)return u({message:"请联系管理员开通服务",type:"error"});d.setUserInfo(s),m.push("/")}))}).catch(n=>{})};return U(()=>{}),(n,s)=>{const v=a("User"),p=a("el-icon"),_=a("el-input"),r=a("el-form-item"),h=a("Lock"),w=a("el-button"),y=a("el-form");return S(),I("div",M,[i("div",T,[q,e(y,null,{default:o(()=>[e(r,null,{default:o(()=>[e(_,{modelValue:t.value.account,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value.account=c),placeholder:"请输入账号"},{prefix:o(()=>[e(p,null,{default:o(()=>[e(v)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(_,{modelValue:t.value.password,"onUpdate:modelValue":s[1]||(s[1]=c=>t.value.password=c),type:"password",placeholder:"请输入密码","show-password":""},{prefix:o(()=>[e(p,null,{default:o(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(w,{style:{width:"100%"},type:"primary",onClick:f},{default:o(()=>[b("登录")]),_:1})]),_:1})]),_:1})])])}}},R=V(z,[["__scopeId","data-v-00c0f4e8"]]);export{R as default}; diff --git a/build/assets/index-DHSQqZ4v.js b/build/assets/index-BGCFCzH0.js similarity index 95% rename from build/assets/index-DHSQqZ4v.js rename to build/assets/index-BGCFCzH0.js index 63187ee..073e66b 100644 --- a/build/assets/index-DHSQqZ4v.js +++ b/build/assets/index-BGCFCzH0.js @@ -1 +1 @@ -import{s as L,u as S}from"./shop-CWcaSfoY.js";import{_ as j,r as i,u as A,a as r,h as F,j as T,f as $,d as e,w as l,o as k,e as m,b as w,c as M,t as O,k as P,E as y}from"./index-Cpj04_tS.js";const q={"element-loading-text":"加载中",class:"my-shop"},G={class:"dialog-footer"},H={__name:"index",setup(J){const v=i([]),V=A(),u=i({page:1,limit:15}),d=i(!1),g=i(0),c=()=>{d.value=!0,L(V.userInfo.service.mer_id,u.value).then(t=>{v.value=t.data.list,g.value=t.data.count,d.value=!1})};c();const C=t=>{u.value.page=t,c()},x=t=>{u.value.page=t,c()},N=t=>{u.value.page=t,c()},p=i(!1),o=i({}),U=t=>{o.value=t,p.value=!0},z=()=>{let t={attr:o.value.attr||[],attrValue:o.value.attrValue,mer_cate_id:o.value.merCateId||[],spec_type:o.value.spec_type,is_stock:1};S(o.value.product_id,t).then(n=>{y({message:n.message,type:"success"}),p.value=!1,c()}).catch(n=>{y({message:n,type:"error"})})};return(t,n)=>{const s=r("el-table-column"),f=r("el-image"),_=r("el-button"),h=r("el-table"),B=r("el-pagination"),D=r("el-input-number"),I=r("el-dialog"),E=F("loading");return T((k(),$("div",q,[e(h,{data:v.value,style:{width:"100%"}},{default:l(()=>[e(s,{prop:"product_id",label:"ID",width:"100"}),e(s,{prop:"image",label:"图片",width:"120"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"60px",height:"60px"},src:a.row.image},null,8,["src"])]),_:1}),e(s,{prop:"store_name",label:"商品名称",width:"500"}),e(s,{prop:"price",label:"售价"}),e(s,{prop:"stock",label:"库存"}),e(s,{label:"操作",width:"120"},{default:l(a=>[e(_,{type:"primary",link:"",onClick:b=>U(a.row)},{default:l(()=>[m("编辑")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),e(B,{"page-size":u.value.limit,layout:"prev, pager, next",total:g.value,onPrevClick:C,onNextClick:x,onCurrentChange:N},null,8,["page-size","total"]),e(I,{modelValue:p.value,"onUpdate:modelValue":n[1]||(n[1]=a=>p.value=a),title:"编辑商品库存",width:"800"},{footer:l(()=>[w("div",G,[e(_,{onClick:n[0]||(n[0]=a=>p.value=!1)},{default:l(()=>[m("取消")]),_:1}),e(_,{type:"primary",onClick:z},{default:l(()=>[m(" 确定 ")]),_:1})])]),default:l(()=>[o.value.attrValue?(k(),M(h,{key:0,data:o.value.attrValue,stripe:"",style:{width:"100%"}},{default:l(()=>[e(s,{prop:"image",label:"图片",width:"180"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:a.row.image||o.value.image},null,8,["src"])]),_:1}),e(s,{prop:"sku",label:"名称",width:"180"},{default:l(a=>[w("span",null,O(a.row.sku||o.value.store_name),1)]),_:1}),e(s,{prop:"price",label:"价格"}),e(s,{prop:"stock",label:"库存"},{default:l(a=>[e(D,{modelValue:a.row.stock,"onUpdate:modelValue":b=>a.row.stock=b,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):P("",!0)]),_:1},8,["modelValue"])])),[[E,d.value]])}}},R=j(H,[["__scopeId","data-v-33636025"]]);export{R as default}; +import{s as L,u as S}from"./shop-CkbXiufP.js";import{_ as j,r as i,u as A,a as r,h as F,j as T,f as $,d as e,w as l,o as k,e as m,b as w,c as M,t as O,k as P,E as y}from"./index-XP2RAAdj.js";const q={"element-loading-text":"加载中",class:"my-shop"},G={class:"dialog-footer"},H={__name:"index",setup(J){const v=i([]),V=A(),u=i({page:1,limit:15}),d=i(!1),g=i(0),c=()=>{d.value=!0,L(V.userInfo.service.mer_id,u.value).then(t=>{v.value=t.data.list,g.value=t.data.count,d.value=!1})};c();const C=t=>{u.value.page=t,c()},x=t=>{u.value.page=t,c()},N=t=>{u.value.page=t,c()},p=i(!1),o=i({}),U=t=>{o.value=t,p.value=!0},z=()=>{let t={attr:o.value.attr||[],attrValue:o.value.attrValue,mer_cate_id:o.value.merCateId||[],spec_type:o.value.spec_type,is_stock:1};S(o.value.product_id,t).then(n=>{y({message:n.message,type:"success"}),p.value=!1,c()}).catch(n=>{y({message:n,type:"error"})})};return(t,n)=>{const s=r("el-table-column"),f=r("el-image"),_=r("el-button"),h=r("el-table"),B=r("el-pagination"),D=r("el-input-number"),I=r("el-dialog"),E=F("loading");return T((k(),$("div",q,[e(h,{data:v.value,style:{width:"100%"}},{default:l(()=>[e(s,{prop:"product_id",label:"ID",width:"100"}),e(s,{prop:"image",label:"图片",width:"120"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"60px",height:"60px"},src:a.row.image},null,8,["src"])]),_:1}),e(s,{prop:"store_name",label:"商品名称",width:"500"}),e(s,{prop:"price",label:"售价"}),e(s,{prop:"stock",label:"库存"}),e(s,{label:"操作",width:"120"},{default:l(a=>[e(_,{type:"primary",link:"",onClick:b=>U(a.row)},{default:l(()=>[m("编辑")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),e(B,{"page-size":u.value.limit,layout:"prev, pager, next",total:g.value,onPrevClick:C,onNextClick:x,onCurrentChange:N},null,8,["page-size","total"]),e(I,{modelValue:p.value,"onUpdate:modelValue":n[1]||(n[1]=a=>p.value=a),title:"编辑商品库存",width:"800"},{footer:l(()=>[w("div",G,[e(_,{onClick:n[0]||(n[0]=a=>p.value=!1)},{default:l(()=>[m("取消")]),_:1}),e(_,{type:"primary",onClick:z},{default:l(()=>[m(" 确定 ")]),_:1})])]),default:l(()=>[o.value.attrValue?(k(),M(h,{key:0,data:o.value.attrValue,stripe:"",style:{width:"100%"}},{default:l(()=>[e(s,{prop:"image",label:"图片",width:"180"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:a.row.image||o.value.image},null,8,["src"])]),_:1}),e(s,{prop:"sku",label:"名称",width:"180"},{default:l(a=>[w("span",null,O(a.row.sku||o.value.store_name),1)]),_:1}),e(s,{prop:"price",label:"价格"}),e(s,{prop:"stock",label:"库存"},{default:l(a=>[e(D,{modelValue:a.row.stock,"onUpdate:modelValue":b=>a.row.stock=b,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):P("",!0)]),_:1},8,["modelValue"])])),[[E,d.value]])}}},R=j(H,[["__scopeId","data-v-33636025"]]);export{R as default}; diff --git a/dist/assets/index-D9csEJCL.css b/build/assets/index-CP2ykvWi.css similarity index 54% rename from dist/assets/index-D9csEJCL.css rename to build/assets/index-CP2ykvWi.css index 57b8868..102a51e 100644 --- a/dist/assets/index-D9csEJCL.css +++ b/build/assets/index-CP2ykvWi.css @@ -1 +1 @@ -@charset "UTF-8";.my-order[data-v-7ca37f24]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-7ca37f24]{display:flex;justify-content:space-between;padding:1rem;height:1.5rem}.my-order .header-nav span[data-v-7ca37f24]{color:#ff4a00}.my-order .header-nav .nav-item-clear[data-v-7ca37f24]{display:flex;align-items:center;font-size:.8rem;cursor:pointer}.my-order .header-input[data-v-7ca37f24]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:1px solid #eee}.my-order .order-list[data-v-7ca37f24]{height:calc(100vh - 100px - 8.2rem);overflow-y:auto}.my-order .order-list .item[data-v-7ca37f24]{padding:1rem;border-bottom:1px solid #eee}.my-order .order-list .item .top[data-v-7ca37f24]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-list .item .top .sn[data-v-7ca37f24]{font-weight:700;font-size:.9rem}.my-order .order-list .item .top .cahier[data-v-7ca37f24]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:1px solid #2ec479;color:#2ec479;border-radius:3px}.my-order .order-list .item .top .create-time[data-v-7ca37f24]{font-size:.8rem}.my-order .order-list .item .shop[data-v-7ca37f24]{display:flex;justify-content:space-between}.my-order .order-list .item .shop .right[data-v-7ca37f24]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-list .item .shop .right .money[data-v-7ca37f24]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-list .item .shop .right .count[data-v-7ca37f24]{font-size:.7rem;color:#999}.my-order .order-list .item .shop .left[data-v-7ca37f24]{height:4.5rem;display:flex;align-items:center}.my-order .order-list .item .shop .left .shop-img[data-v-7ca37f24]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-list .item .shop .left .shop-name[data-v-7ca37f24]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-list .item .bottom[data-v-7ca37f24]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-list .item-active[data-v-7ca37f24]{background-color:#efefef}.my-order .load-end[data-v-7ca37f24]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-87395473]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .header-nav[data-v-87395473]{display:flex;background:linear-gradient(to bottom,#f5f5f5 50%,#fff 50%)}.my-order .header-nav .nav-item[data-v-87395473]{height:4rem;width:8rem;cursor:pointer;display:flex;justify-content:center;align-items:center;font-size:1.2rem;background-color:#f5f5f5;border-radius:1rem 1rem 0 0}.my-order .header-nav .nav-item-active[data-v-87395473]{background-color:#fff;position:relative;transition:.3s}.my-order .header-nav .nav-item-radius1[data-v-87395473]{border-radius:0 0 1rem}.my-order .header-nav .nav-item-radius2[data-v-87395473]{border-radius:0 0 0 1rem}.my-order .detail[data-v-87395473]{height:calc(100vh - 100px - 4rem);box-sizing:border-box;position:relative}.my-order .detail .table[data-v-87395473]{padding:1rem 1rem 6rem;overflow-y:scroll}.my-order .detail .table .table-title[data-v-87395473]{font-weight:700;padding-top:1rem}.my-order .detail .table .table-info[data-v-87395473]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:2rem;border-bottom:1px solid #eee}.my-order .detail .table .table-info[data-v-87395473]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-87395473]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-87395473]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-87395473]{height:6rem;box-sizing:border-box;padding:0 1.5rem;position:absolute;bottom:0;left:0;width:100%;box-shadow:0 -1px 10px #eee;display:flex;justify-content:space-between;align-items:center;background-color:#fff}.my-order .detail .footer .info[data-v-87395473]{display:flex;align-items:flex-end}.my-order .detail .footer .info .ser[data-v-87395473]{font-weight:700;margin-right:1rem}.my-order .detail .footer .info .price[data-v-87395473]{margin-right:1rem}.my-order .detail .footer .info .price span[data-v-87395473]{color:#ff4a00;font-size:1.2rem;font-weight:700}.my-order .detail .footer .handle .btn[data-v-87395473]{border-radius:4rem;padding:1.2rem}.my-card{display:flex}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-thumb:hover{background-color:#999} +@charset "UTF-8";.my-order[data-v-7ca37f24]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-7ca37f24]{display:flex;justify-content:space-between;padding:1rem;height:1.5rem}.my-order .header-nav span[data-v-7ca37f24]{color:#ff4a00}.my-order .header-nav .nav-item-clear[data-v-7ca37f24]{display:flex;align-items:center;font-size:.8rem;cursor:pointer}.my-order .header-input[data-v-7ca37f24]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:1px solid #eee}.my-order .order-list[data-v-7ca37f24]{height:calc(100vh - 100px - 8.2rem);overflow-y:auto}.my-order .order-list .item[data-v-7ca37f24]{padding:1rem;border-bottom:1px solid #eee}.my-order .order-list .item .top[data-v-7ca37f24]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-list .item .top .sn[data-v-7ca37f24]{font-weight:700;font-size:.9rem}.my-order .order-list .item .top .cahier[data-v-7ca37f24]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:1px solid #2ec479;color:#2ec479;border-radius:3px}.my-order .order-list .item .top .create-time[data-v-7ca37f24]{font-size:.8rem}.my-order .order-list .item .shop[data-v-7ca37f24]{display:flex;justify-content:space-between}.my-order .order-list .item .shop .right[data-v-7ca37f24]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-list .item .shop .right .money[data-v-7ca37f24]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-list .item .shop .right .count[data-v-7ca37f24]{font-size:.7rem;color:#999}.my-order .order-list .item .shop .left[data-v-7ca37f24]{height:4.5rem;display:flex;align-items:center}.my-order .order-list .item .shop .left .shop-img[data-v-7ca37f24]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-list .item .shop .left .shop-name[data-v-7ca37f24]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-list .item .bottom[data-v-7ca37f24]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-list .item-active[data-v-7ca37f24]{background-color:#efefef}.my-order .load-end[data-v-7ca37f24]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-e393670f]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .header-nav[data-v-e393670f]{display:flex;background:linear-gradient(to bottom,#f5f5f5 50%,#fff 50%)}.my-order .header-nav .nav-item[data-v-e393670f]{height:4rem;width:8rem;cursor:pointer;display:flex;justify-content:center;align-items:center;font-size:1.2rem;background-color:#f5f5f5;border-radius:1rem 1rem 0 0}.my-order .header-nav .nav-item-active[data-v-e393670f]{background-color:#fff;position:relative;transition:.3s}.my-order .header-nav .nav-item-radius1[data-v-e393670f]{border-radius:0 0 1rem}.my-order .header-nav .nav-item-radius2[data-v-e393670f]{border-radius:0 0 0 1rem}.my-order .detail[data-v-e393670f]{height:calc(100vh - 100px - 4rem);box-sizing:border-box;position:relative}.my-order .detail .table[data-v-e393670f]{padding:1rem 1rem 6rem}.my-order .detail .table .table-title[data-v-e393670f]{font-weight:700;padding-top:1rem}.my-order .detail .table .table-info[data-v-e393670f]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:2rem;border-bottom:1px solid #eee}.my-order .detail .table .table-info[data-v-e393670f]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-e393670f]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-e393670f]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-e393670f]{height:6rem;box-sizing:border-box;padding:0 1.5rem;position:absolute;bottom:0;left:0;width:100%;box-shadow:0 -1px 10px #eee;display:flex;justify-content:space-between;align-items:center;background-color:#fff}.my-order .detail .footer .info[data-v-e393670f]{display:flex;align-items:flex-end}.my-order .detail .footer .info .ser[data-v-e393670f]{font-weight:700;margin-right:1rem}.my-order .detail .footer .info .price[data-v-e393670f]{margin-right:1rem}.my-order .detail .footer .info .price span[data-v-e393670f]{color:#ff4a00;font-size:1.2rem;font-weight:700}.my-order .detail .footer .handle .btn[data-v-e393670f]{border-radius:4rem;padding:1.2rem}.my-card{display:flex}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-thumb:hover{background-color:#999} diff --git a/build/assets/index-kidO7EKl.js b/build/assets/index-EdQAP_1d.js similarity index 76% rename from build/assets/index-kidO7EKl.js rename to build/assets/index-EdQAP_1d.js index cca8704..b69ef33 100644 --- a/build/assets/index-kidO7EKl.js +++ b/build/assets/index-EdQAP_1d.js @@ -1 +1 @@ -import{e as K,p as Q,f as W,g as X}from"./pay-lz1-aziY.js";import{_ as T,u as j,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,j as q,F as z,g as F,n as A,t as d,c as O,k,p as H,l as G,q as Y,E as N}from"./index-Cpj04_tS.js";import{p as Z}from"./padding-CUL9ZbA7.js";function ee(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 M=ee(),te=n=>(H("data-v-7ca37f24"),n=n(),G(),n),se={class:"my-order"},oe={class:"header-nav"},ie=te(()=>e("div",{class:"nav-item"},"订单列表",-1)),ae={class:"nav-item-clear"},le={class:"header-input"},ne={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},ce=["onClick"],de={class:"top"},re={class:"create-time"},_e={class:"shop"},ue={key:0,class:"left"},ve={key:0,class:"shop-name"},fe={class:"right"},pe={class:"money"},me={class:"count"},he={class:"bottom"},ye={class:"pay"},ge={key:0},ke={key:1,style:{color:"#ff4a00"}},$e={key:0,class:"cashier"},be={key:0,class:"load-end"},Ce={key:1,class:"load-end"},Ve={__name:"order",setup(n){const p=j();r([]);const t=r(1),_=C=>{u.value.page=1,y.value=!1,v.value=!1,b.value=[],P(!0)};r(null);const u=r({page:1,limit:20,search_info:""}),v=r(!1),L=r(0),S=r(0),y=r(!1),b=r([]),P=(C=!1)=>{y.value||v.value||(C&&(u.value.page=1),v.value=!0,t.value==1&&(u.value.paid=null),t.value==2&&(u.value.paid=0),K(p.userInfo.service.mer_id,u.value).then(o=>{C?b.value=o.data.list:b.value=[...b.value,...o.data.list],o.data.list.length{v.value=!1}))},R=(C,o)=>{S.value=o,M.emit("set-order-detail",C)};return(C,o)=>{const c=g("el-radio-button"),x=g("el-radio-group"),w=g("el-button"),B=g("el-input"),V=g("el-image"),D=U("loading"),E=U("infinite-scroll");return i(),a("div",se,[e("div",oe,[ie,e("div",ae,[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",le,[l(B,{modelValue:u.value.search_info,"onUpdate:modelValue":o[2]||(o[2]=s=>u.value.search_info=s),placeholder:"请输入订单编号",clearable:""},{append:f(()=>[l(w,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:o[1]||(o[1]=s=>P(!0))},{default:f(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((i(),a("div",ne,[(i(!0),a(z,null,F(b.value,(s,$)=>(i(),a("div",{class:A(["item",{"item-active":S.value==$}]),key:$,onClick:I=>R(s,$)},[e("div",de,[e("div",{class:A(["sn",{cahier:s.pay_type==11||s.pay_type==12}])},"单号: "+d(s.order_sn),3),e("div",re,d(s.create_time),1)]),e("div",_e,[s.orderProduct?(i(),a("div",ue,[(i(!0),a(z,null,F(s.orderProduct.slice(0,5),(I,J)=>(i(),O(V,{key:J,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",ve,d(s.orderProduct[0].cart_info.product.store_name),1)):k("",!0)])):k("",!0),e("div",fe,[e("div",pe,"¥"+d(s.pay_price),1),e("div",me,"共"+d(s.total_num)+"件商品",1)])]),e("div",he,[e("div",ye,[s.paid?(i(),a("span",ge,"已支付")):(i(),a("span",ke,"未支付"))]),s.service_info?(i(),a("div",$e,"收银员: "+d(s.service_info.nickname),1)):k("",!0)])],10,ce))),128)),y.value?(i(),a("div",be,"没有更多了")):k("",!0),v.value?(i(),a("div",Ce,"加载中...")):k("",!0)])),[[D,v.value],[E,P]])])}}},Se=T(Ve,[["__scopeId","data-v-7ca37f24"]]),m=n=>(H("data-v-87395473"),n=n(),G(),n),we={class:"my-order"},Pe={class:"header-nav"},Le=["onClick"],xe={class:"detail"},Ie={key:0,class:"table"},Ae={style:{"font-size":"0.9rem"}},Re={style:{color:"#ff4a00"}},Be={style:{display:"flex","align-items":"center"}},De={style:{"margin-left":"0.5rem"}},Ee={key:1,class:"table"},Ne=m(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},ze={class:"info-item"},Fe=m(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Oe={class:"info-item-info"},Me={class:"info-item"},Te=m(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),je={class:"info-item-info"},qe={class:"info-item"},He=m(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ge={class:"info-item-info"},Je={class:"info-item"},Ke=m(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=m(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),Ye={class:"info-item-info"},Ze={class:"info-item"},et=m(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),tt={class:"info-item-info"},st={class:"info-item"},ot=m(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),it={class:"info-item-info"},at={key:0},lt={key:1},nt=m(()=>e("div",{class:"table-title"},"收银员信息",-1)),ct={class:"table-info",style:{"flex-direction":"column"}},dt={class:"info-item"},rt=m(()=>e("div",{class:"info-item-title"},"头像:",-1)),_t={class:"info-item-info"},ut={class:"info-item"},vt=m(()=>e("div",{class:"info-item-title"},"昵称:",-1)),ft={class:"info-item-info"},pt={class:"info-item"},mt=m(()=>e("div",{class:"info-item-title"},"账号:",-1)),ht={class:"info-item-info"},yt={key:2,class:"footer"},gt={class:"info"},kt={class:"ser"},$t={class:"price"},bt={key:0,class:"handle"},Ct={key:1,class:"handle"},Vt=m(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),St={class:"dialog-footer"},wt={__name:"detail",setup(n){j();const p=Y(),t=r({});M.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),b=o=>{S.value=o,y.value=!0},P=()=>{y.value=!1,W({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=>{X({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"),w=g("el-table-column"),B=g("el-table"),V=g("el-button"),D=g("el-dialog"),E=U("loading");return i(),a("div",we,[e("div",Pe,[(i(!0),a(z,null,F(L.value,(s,$)=>(i(),a("div",{key:$,class:A(["nav-item",{"nav-item-active":v.value==$,"nav-item-radius1":v.value==$+1,"nav-item-radius2":v.value==$-1}]),onClick:I=>v.value=$},d(s),11,Le))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":v.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),q((i(),a("div",xe,[t.value.orderProduct&&v.value==0?(i(),a("div",Ie,[e("div",Ae,[h(" 共计 "),e("span",Re,d(t.value.total_num),1),h(" 件商品 ")]),l(B,{style:{height:"calc(100vh - 100px - 14rem)"},data:t.value.orderProduct},{default:f(()=>[l(w,{prop:"cart_info.product.store_name",label:"商品信息"},{default:f(({row:s})=>[e("div",Be,[l(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",De,d(s.cart_info.product.store_name),1)])]),_:1}),l(w,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),l(w,{prop:"product_num",label:"数量",width:"150"}),l(w,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):k("",!0),t.value.orderProduct&&v.value==1?(i(),a("div",Ee,[Ne,e("div",Ue,[e("div",ze,[Fe,e("div",Oe,d(t.value.create_time),1)]),e("div",Me,[Te,e("div",je,d(t.value.total_num),1)]),e("div",qe,[He,e("div",Ge,d(t.value.total_price),1)]),e("div",Je,[Ke,e("div",Qe,d(t.value.pay_time),1)]),e("div",We,[Xe,e("div",Ye,d(t.value.deduction_price),1)]),e("div",Ze,[et,e("div",tt,d(t.value.pay_price),1)]),e("div",st,[ot,e("div",it,[t.value.pay_type==11?(i(),a("span",at,"微信收款")):k("",!0),t.value.pay_type==12?(i(),a("span",lt,"现金支付")):k("",!0)])])]),nt,e("div",ct,[e("div",dt,[rt,e("div",_t,[l(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:t.value.service_info.avatar},null,8,["src"])])]),e("div",ut,[vt,e("div",ft,d(t.value.service_info.nickname),1)]),e("div",pt,[mt,e("div",ht,d(t.value.service_info.account),1)])])])):k("",!0),t.value.service_info?(i(),a("div",yt,[e("div",gt,[e("div",kt,"收银员: "+d(t.value.service_info.nickname),1),e("div",$t,[h(" 实付: "),e("span",null,"¥"+d(t.value.pay_price),1)])]),t.value.pay_time?(i(),a("div",Ct,"已支付")):(i(),a("div",bt,[l(V,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(t.value))},{default:f(()=>[h("重新支付")]),_:1}),l(V,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>C(t.value.order_sn))},{default:f(()=>[h("检测状态")]),_:1}),l(V,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>b(t.value.order_sn))},{default:f(()=>[h("提单")]),_:1})]))])):k("",!0)])),[[E,u.value]]),l(Q,{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",St,[l(V,{onClick:c[3]||(c[3]=s=>y.value=!1)},{default:f(()=>[h("取消")]),_:1}),o.cartCount>0?(i(),O(V,{key:0,onClick:o.goHome},{default:f(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(i(),O(V,{key:1,type:"primary",onClick:P},{default:f(()=>[h(" 确认提单 ")]),_:1}))])]),default:f(()=>[Vt]),_:1},8,["modelValue"])])}}},Pt=T(wt,[["__scopeId","data-v-87395473"]]),Lt={class:"my-card"},Rt={__name:"index",setup(n){return(p,t)=>(i(),a("div",Lt,[l(Se,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(Z),l(Pt,{ref:"detailRef"},null,512)]))}};export{Rt as default}; +import{e as K,p as Q,f as W,g as X}from"./pay-6EAQtcAa.js";import{_ as T,u as j,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,j as q,F as z,g as F,n as A,t as d,c as O,k,p as H,l as G,q as Y,E as N}from"./index-XP2RAAdj.js";import{p as Z}from"./padding-PEDJpdPM.js";function ee(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 M=ee(),te=n=>(H("data-v-7ca37f24"),n=n(),G(),n),se={class:"my-order"},oe={class:"header-nav"},ie=te(()=>e("div",{class:"nav-item"},"订单列表",-1)),ae={class:"nav-item-clear"},le={class:"header-input"},ne={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},ce=["onClick"],de={class:"top"},re={class:"create-time"},_e={class:"shop"},ue={key:0,class:"left"},ve={key:0,class:"shop-name"},fe={class:"right"},pe={class:"money"},me={class:"count"},he={class:"bottom"},ye={class:"pay"},ge={key:0},ke={key:1,style:{color:"#ff4a00"}},$e={key:0,class:"cashier"},be={key:0,class:"load-end"},Ce={key:1,class:"load-end"},Ve={__name:"order",setup(n){const p=j();r([]);const t=r(1),_=C=>{u.value.page=1,y.value=!1,v.value=!1,b.value=[],P(!0)};r(null);const u=r({page:1,limit:20,search_info:""}),v=r(!1),L=r(0),S=r(0),y=r(!1),b=r([]),P=(C=!1)=>{y.value||v.value||(C&&(u.value.page=1),v.value=!0,t.value==1&&(u.value.paid=null),t.value==2&&(u.value.paid=0),K(p.userInfo.service.mer_id,u.value).then(o=>{C?b.value=o.data.list:b.value=[...b.value,...o.data.list],o.data.list.length{v.value=!1}))},R=(C,o)=>{S.value=o,M.emit("set-order-detail",C)};return(C,o)=>{const c=g("el-radio-button"),x=g("el-radio-group"),w=g("el-button"),B=g("el-input"),V=g("el-image"),D=U("loading"),E=U("infinite-scroll");return i(),a("div",se,[e("div",oe,[ie,e("div",ae,[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",le,[l(B,{modelValue:u.value.search_info,"onUpdate:modelValue":o[2]||(o[2]=s=>u.value.search_info=s),placeholder:"请输入订单编号",clearable:""},{append:f(()=>[l(w,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:o[1]||(o[1]=s=>P(!0))},{default:f(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((i(),a("div",ne,[(i(!0),a(z,null,F(b.value,(s,$)=>(i(),a("div",{class:A(["item",{"item-active":S.value==$}]),key:$,onClick:I=>R(s,$)},[e("div",de,[e("div",{class:A(["sn",{cahier:s.pay_type==11||s.pay_type==12}])},"单号: "+d(s.order_sn),3),e("div",re,d(s.create_time),1)]),e("div",_e,[s.orderProduct?(i(),a("div",ue,[(i(!0),a(z,null,F(s.orderProduct.slice(0,5),(I,J)=>(i(),O(V,{key:J,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",ve,d(s.orderProduct[0].cart_info.product.store_name),1)):k("",!0)])):k("",!0),e("div",fe,[e("div",pe,"¥"+d(s.pay_price),1),e("div",me,"共"+d(s.total_num)+"件商品",1)])]),e("div",he,[e("div",ye,[s.paid?(i(),a("span",ge,"已支付")):(i(),a("span",ke,"未支付"))]),s.service_info?(i(),a("div",$e,"收银员: "+d(s.service_info.nickname),1)):k("",!0)])],10,ce))),128)),y.value?(i(),a("div",be,"没有更多了")):k("",!0),v.value?(i(),a("div",Ce,"加载中...")):k("",!0)])),[[D,v.value],[E,P]])])}}},Se=T(Ve,[["__scopeId","data-v-7ca37f24"]]),m=n=>(H("data-v-e393670f"),n=n(),G(),n),we={class:"my-order"},Pe={class:"header-nav"},Le=["onClick"],xe={class:"detail"},Ie={key:0,class:"table"},Ae={style:{"font-size":"0.9rem"}},Re={style:{color:"#ff4a00"}},Be={style:{display:"flex","align-items":"center"}},De={style:{"margin-left":"0.5rem"}},Ee={key:1,class:"table"},Ne=m(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},ze={class:"info-item"},Fe=m(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Oe={class:"info-item-info"},Me={class:"info-item"},Te=m(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),je={class:"info-item-info"},qe={class:"info-item"},He=m(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ge={class:"info-item-info"},Je={class:"info-item"},Ke=m(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=m(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),Ye={class:"info-item-info"},Ze={class:"info-item"},et=m(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),tt={class:"info-item-info"},st={class:"info-item"},ot=m(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),it={class:"info-item-info"},at={key:0},lt={key:1},nt=m(()=>e("div",{class:"table-title"},"收银员信息",-1)),ct={class:"table-info",style:{"flex-direction":"column"}},dt={class:"info-item"},rt=m(()=>e("div",{class:"info-item-title"},"头像:",-1)),_t={class:"info-item-info"},ut={class:"info-item"},vt=m(()=>e("div",{class:"info-item-title"},"昵称:",-1)),ft={class:"info-item-info"},pt={class:"info-item"},mt=m(()=>e("div",{class:"info-item-title"},"账号:",-1)),ht={class:"info-item-info"},yt={key:2,class:"footer"},gt={class:"info"},kt={class:"ser"},$t={class:"price"},bt={key:0,class:"handle"},Ct={key:1,class:"handle"},Vt=m(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),St={class:"dialog-footer"},wt={__name:"detail",setup(n){j();const p=Y(),t=r({});M.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),b=o=>{S.value=o,y.value=!0},P=()=>{y.value=!1,W({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=>{X({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"),w=g("el-table-column"),B=g("el-table"),V=g("el-button"),D=g("el-dialog"),E=U("loading");return i(),a("div",we,[e("div",Pe,[(i(!0),a(z,null,F(L.value,(s,$)=>(i(),a("div",{key:$,class:A(["nav-item",{"nav-item-active":v.value==$,"nav-item-radius1":v.value==$+1,"nav-item-radius2":v.value==$-1}]),onClick:I=>v.value=$},d(s),11,Le))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":v.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),q((i(),a("div",xe,[t.value.orderProduct&&v.value==0?(i(),a("div",Ie,[e("div",Ae,[h(" 共计 "),e("span",Re,d(t.value.total_num),1),h(" 件商品 ")]),l(B,{style:{height:"calc(100vh - 100px - 14rem)"},data:t.value.orderProduct},{default:f(()=>[l(w,{prop:"cart_info.product.store_name",label:"商品信息"},{default:f(({row:s})=>[e("div",Be,[l(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",De,d(s.cart_info.product.store_name),1)])]),_:1}),l(w,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),l(w,{prop:"product_num",label:"数量",width:"150"}),l(w,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):k("",!0),t.value.orderProduct&&v.value==1?(i(),a("div",Ee,[Ne,e("div",Ue,[e("div",ze,[Fe,e("div",Oe,d(t.value.create_time),1)]),e("div",Me,[Te,e("div",je,d(t.value.total_num),1)]),e("div",qe,[He,e("div",Ge,"¥"+d(t.value.total_price),1)]),e("div",Je,[Ke,e("div",Qe,d(t.value.pay_time),1)]),e("div",We,[Xe,e("div",Ye,"¥"+d(t.value.deduction_price),1)]),e("div",Ze,[et,e("div",tt,"¥"+d(t.value.pay_price),1)]),e("div",st,[ot,e("div",it,[t.value.pay_type==11?(i(),a("span",at,"微信收款")):k("",!0),t.value.pay_type==12?(i(),a("span",lt,"现金支付")):k("",!0)])])]),nt,e("div",ct,[e("div",dt,[rt,e("div",_t,[l(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:t.value.service_info.avatar},null,8,["src"])])]),e("div",ut,[vt,e("div",ft,d(t.value.service_info.nickname),1)]),e("div",pt,[mt,e("div",ht,d(t.value.service_info.account),1)])])])):k("",!0),t.value.service_info?(i(),a("div",yt,[e("div",gt,[e("div",kt,"收银员: "+d(t.value.service_info.nickname),1),e("div",$t,[h(" 实付: "),e("span",null,"¥"+d(t.value.pay_price),1)])]),t.value.pay_time?(i(),a("div",Ct,"已支付")):(i(),a("div",bt,[l(V,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(t.value))},{default:f(()=>[h("重新支付")]),_:1}),l(V,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>C(t.value.order_sn))},{default:f(()=>[h("检测状态")]),_:1}),l(V,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>b(t.value.order_sn))},{default:f(()=>[h("提单")]),_:1})]))])):k("",!0)])),[[E,u.value]]),l(Q,{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",St,[l(V,{onClick:c[3]||(c[3]=s=>y.value=!1)},{default:f(()=>[h("取消")]),_:1}),o.cartCount>0?(i(),O(V,{key:0,onClick:o.goHome},{default:f(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(i(),O(V,{key:1,type:"primary",onClick:P},{default:f(()=>[h(" 确认提单 ")]),_:1}))])]),default:f(()=>[Vt]),_:1},8,["modelValue"])])}}},Pt=T(wt,[["__scopeId","data-v-e393670f"]]),Lt={class:"my-card"},Rt={__name:"index",setup(n){return(p,t)=>(i(),a("div",Lt,[l(Se,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(Z),l(Pt,{ref:"detailRef"},null,512)]))}};export{Rt as default}; diff --git a/dist/assets/index-DNUHgsQd.js b/build/assets/index-RSZhHvKo.js similarity index 92% rename from dist/assets/index-DNUHgsQd.js rename to build/assets/index-RSZhHvKo.js index 24d6326..b7a49b1 100644 --- a/dist/assets/index-DNUHgsQd.js +++ b/build/assets/index-RSZhHvKo.js @@ -1 +1 @@ -import{a as t,f as c,b as e,d as o,w as a,o as d,e as l}from"./index-B3GfFMCJ.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return d(),c("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:a(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; +import{a as t,f as c,b as e,d as o,w as a,o as d,e as l}from"./index-XP2RAAdj.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return d(),c("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:a(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; diff --git a/build/assets/index-Cpj04_tS.js b/build/assets/index-XP2RAAdj.js similarity index 99% rename from build/assets/index-Cpj04_tS.js rename to build/assets/index-XP2RAAdj.js index 1b520da..2ff4d8a 100644 --- a/build/assets/index-Cpj04_tS.js +++ b/build/assets/index-XP2RAAdj.js @@ -1,6 +1,6 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-BL1i9waN.js","./pay-lz1-aziY.js","./pay-CgGUliwa.css","./padding-CUL9ZbA7.js","./shop-CWcaSfoY.js","./index-B0FE6ezs.css","./index-kidO7EKl.js","./index-D9csEJCL.css","./indexList-vZxSdCop.js","./indexList-BWS4uCkU.css","./index-DHSQqZ4v.js","./index-Bmp4AY5x.css","./index-DqcskVAD.js","./index-Cq3x8gKD.css"] + __vite__mapDeps.viteFileDeps = ["./index-B61z2XJk.js","./pay-6EAQtcAa.js","./pay-CgGUliwa.css","./padding-PEDJpdPM.js","./shop-CkbXiufP.js","./index-B0FE6ezs.css","./index-EdQAP_1d.js","./index-CP2ykvWi.css","./indexList-BexwcyxX.js","./indexList-BWS4uCkU.css","./index-BGCFCzH0.js","./index-Bmp4AY5x.css","./index-BD5A0gEe.js","./index-Cq3x8gKD.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } @@ -76,4 +76,4 @@ function __vite__mapDeps(indexes) { `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[u4]=this[u4]={accessors:{}}).accessors,r=this.prototype;function a(l){const s=is(l);o[s]||(uce(r,l),o[s]=!0)}return Ve.isArray(t)?t.forEach(a):a(t),this}}vd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ve.reduceDescriptors(vd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});Ve.freezeMethods(vd);const or=vd;function df(e,t){const n=this||lv,o=t||n,r=or.from(o.headers);let a=o.data;return Ve.forEach(e,function(s){a=s.call(n,a,r.normalize(),t?t.status:void 0)}),r.normalize(),a}function Sb(e){return!!(e&&e.__CANCEL__)}function $i(e,t,n){Rt.call(this,e??"canceled",Rt.ERR_CANCELED,t,n),this.name="CanceledError"}Ve.inherits($i,Rt,{__CANCEL__:!0});function cce(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Rt("Request failed with status code "+n.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const dce=No.hasStandardBrowserEnv?{write(e,t,n,o,r,a){const l=[e+"="+encodeURIComponent(t)];Ve.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),Ve.isString(o)&&l.push("path="+o),Ve.isString(r)&&l.push("domain="+r),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fce(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pce(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function kb(e,t){return e&&!fce(t)?pce(e,t):t}const vce=No.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let o;function r(a){let l=a;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return o=r(window.location.href),function(l){const s=Ve.isString(l)?r(l):l;return s.protocol===o.protocol&&s.host===o.host}}():function(){return function(){return!0}}();function hce(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mce(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,a=0,l;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=o[a];l||(l=c),n[r]=u,o[r]=c;let d=a,p=0;for(;d!==r;)p+=n[d++],d=d%e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-l{const a=r.loaded,l=r.lengthComputable?r.total:void 0,s=a-n,u=o(s),c=a<=l;n=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:s,rate:u||void 0,estimated:u&&l&&c?(l-a)/u:void 0,event:r};f[t?"download":"upload"]=!0,e(f)}}const gce=typeof XMLHttpRequest<"u",yce=gce&&function(e){return new Promise(function(n,o){let r=e.data;const a=or.from(e.headers).normalize();let{responseType:l,withXSRFToken:s}=e,u;function c(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let f;if(Ve.isFormData(r)){if(No.hasStandardBrowserEnv||No.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((f=a.getContentType())!==!1){const[v,...y]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([v||"multipart/form-data",...y].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const v=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(v+":"+y))}const p=kb(e.baseURL,e.url);d.open(e.method.toUpperCase(),_b(p,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function h(){if(!d)return;const v=or.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),g={data:!l||l==="text"||l==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:v,config:e,request:d};cce(function(b){n(b),c()},function(b){o(b),c()},g),d=null}if("onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(h)},d.onabort=function(){d&&(o(new Rt("Request aborted",Rt.ECONNABORTED,e,d)),d=null)},d.onerror=function(){o(new Rt("Network Error",Rt.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let y=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const g=e.transitional||bb;e.timeoutErrorMessage&&(y=e.timeoutErrorMessage),o(new Rt(y,g.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,d)),d=null},No.hasStandardBrowserEnv&&(s&&Ve.isFunction(s)&&(s=s(e)),s||s!==!1&&vce(p))){const v=e.xsrfHeaderName&&e.xsrfCookieName&&dce.read(e.xsrfCookieName);v&&a.set(e.xsrfHeaderName,v)}r===void 0&&a.setContentType(null),"setRequestHeader"in d&&Ve.forEach(a.toJSON(),function(y,g){d.setRequestHeader(g,y)}),Ve.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),l&&l!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",c4(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",c4(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=v=>{d&&(o(!v||v.type?new $i(null,e,d):v),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const m=hce(p);if(m&&No.protocols.indexOf(m)===-1){o(new Rt("Unsupported protocol "+m+":",Rt.ERR_BAD_REQUEST,e));return}d.send(r||null)})},F0={http:Kue,xhr:yce};Ve.forEach(F0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const d4=e=>`- ${e}`,_ce=e=>Ve.isFunction(e)||e===null||e===!1,Eb={getAdapter:e=>{e=Ve.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let a=0;a`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=t?a.length>1?`since : `+a.map(d4).join(` `):" "+d4(a[0]):"as no adapter specified";throw new Rt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:F0};function ff(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $i(null,e)}function f4(e){return ff(e),e.headers=or.from(e.headers),e.data=df.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Eb.getAdapter(e.adapter||lv.adapter)(e).then(function(o){return ff(e),o.data=df.call(e,e.transformResponse,o),o.headers=or.from(o.headers),o},function(o){return Sb(o)||(ff(e),o&&o.response&&(o.response.data=df.call(e,e.transformResponse,o.response),o.response.headers=or.from(o.response.headers))),Promise.reject(o)})}const p4=e=>e instanceof or?{...e}:e;function Hl(e,t){t=t||{};const n={};function o(c,f,d){return Ve.isPlainObject(c)&&Ve.isPlainObject(f)?Ve.merge.call({caseless:d},c,f):Ve.isPlainObject(f)?Ve.merge({},f):Ve.isArray(f)?f.slice():f}function r(c,f,d){if(Ve.isUndefined(f)){if(!Ve.isUndefined(c))return o(void 0,c,d)}else return o(c,f,d)}function a(c,f){if(!Ve.isUndefined(f))return o(void 0,f)}function l(c,f){if(Ve.isUndefined(f)){if(!Ve.isUndefined(c))return o(void 0,c)}else return o(void 0,f)}function s(c,f,d){if(d in t)return o(c,f);if(d in e)return o(void 0,c)}const u={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s,headers:(c,f)=>r(p4(c),p4(f),!0)};return Ve.forEach(Object.keys(Object.assign({},e,t)),function(f){const d=u[f]||r,p=d(e[f],t[f],f);Ve.isUndefined(p)&&d!==s||(n[f]=p)}),n}const xb="1.6.8",sv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sv[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const v4={};sv.transitional=function(t,n,o){function r(a,l){return"[Axios v"+xb+"] Transitional option '"+a+"'"+l+(o?". "+o:"")}return(a,l,s)=>{if(t===!1)throw new Rt(r(l," has been removed"+(n?" in "+n:"")),Rt.ERR_DEPRECATED);return n&&!v4[l]&&(v4[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,l,s):!0}};function bce(e,t,n){if(typeof e!="object")throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const a=o[r],l=t[a];if(l){const s=e[a],u=s===void 0||l(s,a,e);if(u!==!0)throw new Rt("option "+a+" must be "+u,Rt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Rt("Unknown option "+a,Rt.ERR_BAD_OPTION)}}const K0={assertOptions:bce,validators:sv},kr=K0.validators;class mc{constructor(t){this.defaults=t,this.interceptors={request:new i4,response:new i4}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const a=r.stack?r.stack.replace(/^.+\n/,""):"";o.stack?a&&!String(o.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(o.stack+=` -`+a):o.stack=a}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Hl(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:a}=n;o!==void 0&&K0.assertOptions(o,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1),r!=null&&(Ve.isFunction(r)?n.paramsSerializer={serialize:r}:K0.assertOptions(r,{encode:kr.function,serialize:kr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&Ve.merge(a.common,a[n.method]);a&&Ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=or.concat(l,a);const s=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let f,d=0,p;if(!u){const m=[f4.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),p=m.length,f=Promise.resolve(n);d{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](r);o._listeners=null}),this.promise.then=r=>{let a;const l=new Promise(s=>{o.subscribe(s),a=s}).then(r);return l.cancel=function(){o.unsubscribe(a)},l},t(function(a,l,s){o.reason||(o.reason=new $i(a,l,s),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new iv(function(r){t=r}),cancel:t}}}const wce=iv;function Cce(e){return function(n){return e.apply(null,n)}}function Sce(e){return Ve.isObject(e)&&e.isAxiosError===!0}const W0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(W0).forEach(([e,t])=>{W0[t]=e});const kce=W0;function Mb(e){const t=new Bu(e),n=sb(Bu.prototype.request,t);return Ve.extend(n,Bu.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mb(Hl(e,r))},n}const sn=Mb(lv);sn.Axios=Bu;sn.CanceledError=$i;sn.CancelToken=wce;sn.isCancel=Sb;sn.VERSION=xb;sn.toFormData=pd;sn.AxiosError=Rt;sn.Cancel=sn.CanceledError;sn.all=function(t){return Promise.all(t)};sn.spread=Cce;sn.isAxiosError=Sce;sn.mergeConfig=Hl;sn.AxiosHeaders=or;sn.formToJSON=e=>Cb(Ve.isHTMLForm(e)?new FormData(e):e);sn.getAdapter=Eb.getAdapter;sn.HttpStatusCode=kce;sn.default=sn;const Ti=sn.create({baseURL:"https://shop.lihaink.cn/api",timeout:1e4});Ti.interceptors.request.use(e=>{const t=localStorage.getItem("Token");return t&&(e.headers["X-Token"]="Bearer "+t),e},e=>(console.error(e),Promise.reject(e)));Ti.interceptors.response.use(e=>{if((e.data.status===401||e.data.status===4e4)&&(Ms({message:e.data.message,type:"error"}),setTimeout(()=>{const t=nv();t.setUserInfo({}),t.setToken(""),Tb.push("/login")},700)),e.data.status===400)throw Ms({message:e.data.message,type:"error"}),new Error(e.data.message);return e.data},e=>{var t,n;return console.error(e),Ms({message:((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.message)||e,type:"error"}),Promise.reject(e)});function Xce(e){return Ti.post("auth/login",e)}function Jce(e){return Ti.get("user",e)}function Ece(){return Ti.post("logout")}const uv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xce=e=>(W4("data-v-28f3f43a"),e=e(),j4(),e),Mce={class:"my-card"},$ce={class:"card-header"},Tce=xce(()=>k("div",{class:"card-title"},"里海收银系统",-1)),Oce={class:"card-body"},Ace={class:"el-dropdown-link"},Nce={class:"info"},Rce={style:{"margin-left":"0.3rem"}},Ice={__name:"myHeader",setup(e){const t=nv(),n=P({});n.value=t.userInfo.mer_info;const o=P({});o.value=t.userInfo.service;const r=nb(),a=()=>{Ece().then(()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")}).catch(()=>{Ms({message:"退出失败",type:"error"})})};return(l,s)=>{const u=Ze("el-image"),c=Ze("el-avatar"),f=Ze("arrow-down"),d=Ze("el-icon"),p=Ze("el-dropdown-item"),h=Ze("el-dropdown-menu"),m=Ze("el-dropdown");return _(),M("div",Mce,[k("div",$ce,[W(u,{style:{height:"3rem",width:"3rem"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56a52202404051428413664.png"}),Tce]),k("div",Oce,[W(m,{trigger:"hover"},{dropdown:J(()=>[W(h,null,{default:J(()=>[W(p,{onClick:a},{default:J(()=>[gt("退出登录")]),_:1})]),_:1})]),default:J(()=>[k("div",Ace,[W(c,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",Nce,[k("div",null,[gt(Te(o.value.nickname)+" ",1),k("span",Rce,"("+Te(n.value.company_name||n.value.mer_name)+")",1)]),k("div",null,Te(i(t).userInfo.account),1)]),W(d,{class:"el-icon--right"},{default:J(()=>[W(f)]),_:1})])]),_:1})])])}}},Pce=uv(Ice,[["__scopeId","data-v-28f3f43a"]]),cv=e=>(W4("data-v-60ad4a9d"),e=e(),j4(),e),Lce={class:"my-card"},Vce=cv(()=>k("div",null,"收银",-1)),Bce=cv(()=>k("div",null,"订单",-1)),zce=cv(()=>k("div",null,"商品",-1)),Hce={__name:"myAside",setup(e){const t=nb(),n=eue(),o=r=>{t.push({name:r})};return(r,a)=>{const l=Ze("Sell"),s=Ze("el-icon"),u=Ze("DataLine"),c=Ze("ShoppingBag");return _(),M("div",Lce,[k("div",{class:T(["list-item",{active:i(n).name=="home"}]),onClick:a[0]||(a[0]=f=>o("home"))},[W(s,{size:"30"},{default:J(()=>[W(l)]),_:1}),Vce],2),k("div",{class:T(["list-item",{active:i(n).name=="order"}]),onClick:a[1]||(a[1]=f=>o("order"))},[W(s,{size:"30"},{default:J(()=>[W(u)]),_:1}),Bce],2),k("div",{class:T(["list-item",{active:i(n).name=="shop"}]),onClick:a[2]||(a[2]=f=>o("shop"))},[W(s,{size:"30"},{default:J(()=>[W(c)]),_:1}),zce],2)])}}},Dce=uv(Hce,[["__scopeId","data-v-60ad4a9d"]]),Fce={class:"common-layout"},Kce={__name:"index",setup(e){return(t,n)=>{const o=Ze("el-header"),r=Ze("el-aside"),a=Ze("router-view"),l=Ze("el-main"),s=Ze("el-container");return _(),M("div",Fce,[W(s,null,{default:J(()=>[W(o,null,{default:J(()=>[W(Pce)]),_:1}),W(s,null,{default:J(()=>[W(r,{width:"100px"},{default:J(()=>[W(Dce)]),_:1}),W(l,null,{default:J(()=>[W(tn,{name:"el-zoom-in-top"},{default:J(()=>[W(a,{class:"my-main"})]),_:1})]),_:1})]),_:1})]),_:1})])}}},Wce=uv(Kce,[["__scopeId","data-v-e3e48466"]]),jce=[{path:"/",name:"layout",component:Wce,redirect:"/home",children:[{path:"/home",name:"home",component:()=>Qa(()=>import("./index-BL1i9waN.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)},{path:"/order",name:"order",component:()=>Qa(()=>import("./index-kidO7EKl.js"),__vite__mapDeps([6,1,2,3,7]),import.meta.url)},{path:"/orderList",name:"orderList",component:()=>Qa(()=>import("./indexList-vZxSdCop.js"),__vite__mapDeps([8,1,2,9]),import.meta.url)},{path:"/shop",name:"shop",component:()=>Qa(()=>import("./index-DHSQqZ4v.js"),__vite__mapDeps([10,4,11]),import.meta.url)}]},{path:"/login",name:"login",component:()=>Qa(()=>import("./index-DqcskVAD.js"),__vite__mapDeps([12,13]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>Qa(()=>import("./index-D1KIV7mN.js"),__vite__mapDeps([]),import.meta.url)}],$b=Zie({history:Mie(),routes:jce});$b.beforeEach((e,t,n)=>{const o=nv();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Tb=$b,Oi=Tg(J5);for(const[e,t]of Object.entries(xL))Oi.component(e,t);const qce=nue();Oi.use(Tb);Oi.use(qce);Oi.use(qse,{locale:Use});Oi.mount("#app");export{Jce as A,Ms as E,Ke as F,uv as _,Ze as a,k as b,le as c,W as d,gt as e,M as f,ht as g,kc as h,Mt as i,et as j,ne as k,j4 as l,rr as m,T as n,_ as o,W4 as p,nb as q,P as r,Ti as s,Te as t,nv as u,S as v,J as w,We as x,tt as y,Xce as z}; +`+a):o.stack=a}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Hl(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:a}=n;o!==void 0&&K0.assertOptions(o,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1),r!=null&&(Ve.isFunction(r)?n.paramsSerializer={serialize:r}:K0.assertOptions(r,{encode:kr.function,serialize:kr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&Ve.merge(a.common,a[n.method]);a&&Ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=or.concat(l,a);const s=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let f,d=0,p;if(!u){const m=[f4.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),p=m.length,f=Promise.resolve(n);d{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](r);o._listeners=null}),this.promise.then=r=>{let a;const l=new Promise(s=>{o.subscribe(s),a=s}).then(r);return l.cancel=function(){o.unsubscribe(a)},l},t(function(a,l,s){o.reason||(o.reason=new $i(a,l,s),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new iv(function(r){t=r}),cancel:t}}}const wce=iv;function Cce(e){return function(n){return e.apply(null,n)}}function Sce(e){return Ve.isObject(e)&&e.isAxiosError===!0}const W0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(W0).forEach(([e,t])=>{W0[t]=e});const kce=W0;function Mb(e){const t=new Bu(e),n=sb(Bu.prototype.request,t);return Ve.extend(n,Bu.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mb(Hl(e,r))},n}const sn=Mb(lv);sn.Axios=Bu;sn.CanceledError=$i;sn.CancelToken=wce;sn.isCancel=Sb;sn.VERSION=xb;sn.toFormData=pd;sn.AxiosError=Rt;sn.Cancel=sn.CanceledError;sn.all=function(t){return Promise.all(t)};sn.spread=Cce;sn.isAxiosError=Sce;sn.mergeConfig=Hl;sn.AxiosHeaders=or;sn.formToJSON=e=>Cb(Ve.isHTMLForm(e)?new FormData(e):e);sn.getAdapter=Eb.getAdapter;sn.HttpStatusCode=kce;sn.default=sn;const Ti=sn.create({baseURL:"https://shop.lihaink.cn/api",timeout:1e4});Ti.interceptors.request.use(e=>{const t=localStorage.getItem("Token");return t&&(e.headers["X-Token"]="Bearer "+t),e},e=>(console.error(e),Promise.reject(e)));Ti.interceptors.response.use(e=>{if((e.data.status===401||e.data.status===4e4)&&(Ms({message:e.data.message,type:"error"}),setTimeout(()=>{const t=nv();t.setUserInfo({}),t.setToken(""),Tb.push("/login")},700)),e.data.status===400)throw Ms({message:e.data.message,type:"error"}),new Error(e.data.message);return e.data},e=>{var t,n;return console.error(e),Ms({message:((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.message)||e,type:"error"}),Promise.reject(e)});function Xce(e){return Ti.post("auth/login",e)}function Jce(e){return Ti.get("user",e)}function Ece(){return Ti.post("logout")}const uv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xce=e=>(W4("data-v-28f3f43a"),e=e(),j4(),e),Mce={class:"my-card"},$ce={class:"card-header"},Tce=xce(()=>k("div",{class:"card-title"},"里海收银系统",-1)),Oce={class:"card-body"},Ace={class:"el-dropdown-link"},Nce={class:"info"},Rce={style:{"margin-left":"0.3rem"}},Ice={__name:"myHeader",setup(e){const t=nv(),n=P({});n.value=t.userInfo.mer_info;const o=P({});o.value=t.userInfo.service;const r=nb(),a=()=>{Ece().then(()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")}).catch(()=>{Ms({message:"退出失败",type:"error"})})};return(l,s)=>{const u=Ze("el-image"),c=Ze("el-avatar"),f=Ze("arrow-down"),d=Ze("el-icon"),p=Ze("el-dropdown-item"),h=Ze("el-dropdown-menu"),m=Ze("el-dropdown");return _(),M("div",Mce,[k("div",$ce,[W(u,{style:{height:"3rem",width:"3rem"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56a52202404051428413664.png"}),Tce]),k("div",Oce,[W(m,{trigger:"hover"},{dropdown:J(()=>[W(h,null,{default:J(()=>[W(p,{onClick:a},{default:J(()=>[gt("退出登录")]),_:1})]),_:1})]),default:J(()=>[k("div",Ace,[W(c,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",Nce,[k("div",null,[gt(Te(o.value.nickname)+" ",1),k("span",Rce,"("+Te(n.value.company_name||n.value.mer_name)+")",1)]),k("div",null,Te(i(t).userInfo.account),1)]),W(d,{class:"el-icon--right"},{default:J(()=>[W(f)]),_:1})])]),_:1})])])}}},Pce=uv(Ice,[["__scopeId","data-v-28f3f43a"]]),cv=e=>(W4("data-v-60ad4a9d"),e=e(),j4(),e),Lce={class:"my-card"},Vce=cv(()=>k("div",null,"收银",-1)),Bce=cv(()=>k("div",null,"订单",-1)),zce=cv(()=>k("div",null,"商品",-1)),Hce={__name:"myAside",setup(e){const t=nb(),n=eue(),o=r=>{t.push({name:r})};return(r,a)=>{const l=Ze("Sell"),s=Ze("el-icon"),u=Ze("DataLine"),c=Ze("ShoppingBag");return _(),M("div",Lce,[k("div",{class:T(["list-item",{active:i(n).name=="home"}]),onClick:a[0]||(a[0]=f=>o("home"))},[W(s,{size:"30"},{default:J(()=>[W(l)]),_:1}),Vce],2),k("div",{class:T(["list-item",{active:i(n).name=="order"}]),onClick:a[1]||(a[1]=f=>o("order"))},[W(s,{size:"30"},{default:J(()=>[W(u)]),_:1}),Bce],2),k("div",{class:T(["list-item",{active:i(n).name=="shop"}]),onClick:a[2]||(a[2]=f=>o("shop"))},[W(s,{size:"30"},{default:J(()=>[W(c)]),_:1}),zce],2)])}}},Dce=uv(Hce,[["__scopeId","data-v-60ad4a9d"]]),Fce={class:"common-layout"},Kce={__name:"index",setup(e){return(t,n)=>{const o=Ze("el-header"),r=Ze("el-aside"),a=Ze("router-view"),l=Ze("el-main"),s=Ze("el-container");return _(),M("div",Fce,[W(s,null,{default:J(()=>[W(o,null,{default:J(()=>[W(Pce)]),_:1}),W(s,null,{default:J(()=>[W(r,{width:"100px"},{default:J(()=>[W(Dce)]),_:1}),W(l,null,{default:J(()=>[W(tn,{name:"el-zoom-in-top"},{default:J(()=>[W(a,{class:"my-main"})]),_:1})]),_:1})]),_:1})]),_:1})])}}},Wce=uv(Kce,[["__scopeId","data-v-e3e48466"]]),jce=[{path:"/",name:"layout",component:Wce,redirect:"/home",children:[{path:"/home",name:"home",component:()=>Qa(()=>import("./index-B61z2XJk.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)},{path:"/order",name:"order",component:()=>Qa(()=>import("./index-EdQAP_1d.js"),__vite__mapDeps([6,1,2,3,7]),import.meta.url)},{path:"/orderList",name:"orderList",component:()=>Qa(()=>import("./indexList-BexwcyxX.js"),__vite__mapDeps([8,1,2,9]),import.meta.url)},{path:"/shop",name:"shop",component:()=>Qa(()=>import("./index-BGCFCzH0.js"),__vite__mapDeps([10,4,11]),import.meta.url)}]},{path:"/login",name:"login",component:()=>Qa(()=>import("./index-BD5A0gEe.js"),__vite__mapDeps([12,13]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>Qa(()=>import("./index-RSZhHvKo.js"),__vite__mapDeps([]),import.meta.url)}],$b=Zie({history:Mie(),routes:jce});$b.beforeEach((e,t,n)=>{const o=nv();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Tb=$b,Oi=Tg(J5);for(const[e,t]of Object.entries(xL))Oi.component(e,t);const qce=nue();Oi.use(Tb);Oi.use(qce);Oi.use(qse,{locale:Use});Oi.mount("#app");export{Jce as A,Ms as E,Ke as F,uv as _,Ze as a,k as b,le as c,W as d,gt as e,M as f,ht as g,kc as h,Mt as i,et as j,ne as k,j4 as l,rr as m,T as n,_ as o,W4 as p,nb as q,P as r,Ti as s,Te as t,nv as u,S as v,J as w,We as x,tt as y,Xce as z}; diff --git a/build/assets/indexList-vZxSdCop.js b/build/assets/indexList-BexwcyxX.js similarity index 96% rename from build/assets/indexList-vZxSdCop.js rename to build/assets/indexList-BexwcyxX.js index 8820c55..63d4368 100644 --- a/build/assets/indexList-vZxSdCop.js +++ b/build/assets/indexList-BexwcyxX.js @@ -1 +1 @@ -import{e as F,a as G,p as J,g as K,f as Q}from"./pay-lz1-aziY.js";import{_ as W,u as X,r as s,q as Y,a as d,h as Z,j as ee,f as m,d as t,w as o,o as c,e as r,t as te,b as I,c as V,E as h,p as ae,l as oe}from"./index-Cpj04_tS.js";const le=v=>(ae("data-v-f71c3ce9"),v=v(),oe(),v),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ce=le(()=>I("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ue={class:"dialog-footer"},pe={__name:"indexList",setup(v){const P=X(),k=s([]),C=Y(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),b=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(P.userInfo.service.mer_id,n.value).then(e=>{k.value=e.data.list,b.value=e.data.count,y.value=!1})};i();const w=s(0);(()=>{G({source:300}).then(e=>{var a;w.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},E=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},x=s(""),U=()=>{_.value=!1,Q({order_sn:x.value}).then(e=>{h({message:e.message,type:"success"}),C.push({name:"home"})})},_=s(!1),z=e=>{x.value=e,_.value=!0},O=()=>{C.push({name:"home"})};return(e,a)=>{const L=d("el-radio-button"),T=d("el-radio-group"),u=d("el-table-column"),p=d("el-button"),j=d("el-table"),q=d("el-pagination"),H=d("el-dialog"),M=Z("loading");return ee((c(),m("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(L,{value:1},{default:o(()=>[r("全部")]),_:1}),t(L,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(j,{data:k.value,style:{width:"100%"}},{default:o(()=>[t(u,{prop:"group_order_id",label:"ID",width:"100"}),t(u,{prop:"order_sn",label:"订单号",width:"260"}),t(u,{prop:"total_price",label:"订单金额"}),t(u,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(c(),m("span",ne,"已支付")):(c(),m("span",re,"未支付"))]),_:1}),t(u,{prop:"create_time",label:"订单创建时间"}),t(u,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(c(),m("span",ie,te(l.row.pay_time),1)):(c(),m("div",de,[t(p,{type:"primary",link:"",onClick:S=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>E(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>z(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(q,{"page-size":n.value.limit,layout:"prev, pager, next",total:b.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(H,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[I("div",ue,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),w.value>0?(c(),V(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(c(),V(p,{key:1,type:"primary",onClick:U},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ce]),_:1},8,["modelValue"])])),[[M,y.value]])}}},ge=W(pe,[["__scopeId","data-v-f71c3ce9"]]);export{ge as default}; +import{e as F,a as G,p as J,g as K,f as Q}from"./pay-6EAQtcAa.js";import{_ as W,u as X,r as s,q as Y,a as d,h as Z,j as ee,f as m,d as t,w as o,o as c,e as r,t as te,b as I,c as V,E as h,p as ae,l as oe}from"./index-XP2RAAdj.js";const le=v=>(ae("data-v-f71c3ce9"),v=v(),oe(),v),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ce=le(()=>I("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ue={class:"dialog-footer"},pe={__name:"indexList",setup(v){const P=X(),k=s([]),C=Y(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),b=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(P.userInfo.service.mer_id,n.value).then(e=>{k.value=e.data.list,b.value=e.data.count,y.value=!1})};i();const w=s(0);(()=>{G({source:300}).then(e=>{var a;w.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},E=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},x=s(""),U=()=>{_.value=!1,Q({order_sn:x.value}).then(e=>{h({message:e.message,type:"success"}),C.push({name:"home"})})},_=s(!1),z=e=>{x.value=e,_.value=!0},O=()=>{C.push({name:"home"})};return(e,a)=>{const L=d("el-radio-button"),T=d("el-radio-group"),u=d("el-table-column"),p=d("el-button"),j=d("el-table"),q=d("el-pagination"),H=d("el-dialog"),M=Z("loading");return ee((c(),m("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(L,{value:1},{default:o(()=>[r("全部")]),_:1}),t(L,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(j,{data:k.value,style:{width:"100%"}},{default:o(()=>[t(u,{prop:"group_order_id",label:"ID",width:"100"}),t(u,{prop:"order_sn",label:"订单号",width:"260"}),t(u,{prop:"total_price",label:"订单金额"}),t(u,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(c(),m("span",ne,"已支付")):(c(),m("span",re,"未支付"))]),_:1}),t(u,{prop:"create_time",label:"订单创建时间"}),t(u,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(c(),m("span",ie,te(l.row.pay_time),1)):(c(),m("div",de,[t(p,{type:"primary",link:"",onClick:S=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>E(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>z(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(q,{"page-size":n.value.limit,layout:"prev, pager, next",total:b.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(H,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[I("div",ue,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),w.value>0?(c(),V(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(c(),V(p,{key:1,type:"primary",onClick:U},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ce]),_:1},8,["modelValue"])])),[[M,y.value]])}}},ge=W(pe,[["__scopeId","data-v-f71c3ce9"]]);export{ge as default}; diff --git a/build/assets/padding-CUL9ZbA7.js b/build/assets/padding-PEDJpdPM.js similarity index 65% rename from build/assets/padding-CUL9ZbA7.js rename to build/assets/padding-PEDJpdPM.js index d88e116..ef7fff9 100644 --- a/build/assets/padding-CUL9ZbA7.js +++ b/build/assets/padding-PEDJpdPM.js @@ -1 +1 @@ -import{_ as e,o as t,f as c}from"./index-Cpj04_tS.js";const o={},n={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",n)}const i=e(o,[["render",s]]);export{i as p}; +import{_ as e,o as t,f as c}from"./index-XP2RAAdj.js";const o={},n={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",n)}const i=e(o,[["render",s]]);export{i as p}; diff --git a/build/assets/pay-lz1-aziY.js b/build/assets/pay-6EAQtcAa.js similarity index 98% rename from build/assets/pay-lz1-aziY.js rename to build/assets/pay-6EAQtcAa.js index c2304eb..aa71814 100644 --- a/build/assets/pay-lz1-aziY.js +++ b/build/assets/pay-6EAQtcAa.js @@ -1 +1 @@ -import{s as v,_ as le,r as l,v as ne,a as E,h as ce,o as f,c as K,w as m,b as o,n as M,e as L,t as B,j as re,f as b,d as w,i as ue,F as de,g as ie,x as $,E as C,p as ve,l as pe}from"./index-Cpj04_tS.js";function qe(s){return v.post("user/cart/create",s)}function Oe(s){return v.get("user/cart/lst",{params:s})}function Re(s,p){return v.post(`user/cart/change/${s}`,p)}function Ue(s){return v.post("v2/order/check",s)}function Ke(s){return v.post("user/cart/delete",s)}function G(s){return v.post("v2/order/create",s)}function _e(s,p){return v.post(`order/pay/${s}`,p)}function fe(s){return v.get("micropay_query",{params:s})}function Me(s,p){return v.get(`admin/${s}/order_list`,{params:p})}function Ge(s){return v.get("order_lading",{params:s})}const P=s=>{let p=new window.SpeechSynthesisUtterance(s);window.speechSynthesis.speak(p)},q=s=>(ve("data-v-517a591d"),s=s(),pe(),s),me=q(()=>o("h4",null,"选择支付方式",-1)),ye={class:"dra-body"},ge={class:"header"},he=q(()=>o("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),ke={style:{color:"#f5222d","padding-bottom":"2rem"}},be={style:{"font-size":"1.6rem"}},we={key:0,"element-loading-text":"支付中",class:"card1"},Ce=q(()=>o("div",{class:"tips"},null,-1)),xe={key:1,class:"card2"},Se={class:"drawer-body"},Ae={class:"counter"},Le={class:"received"},Ve={key:0},De={key:1,style:{"font-size":"1rem",color:"#999"}},Ee={key:0,class:"balance"},$e={class:"money"},je={key:1,class:"balance"},Be={class:"keypad"},Pe={class:"left"},Te={class:"right"},ze={style:{width:"100%",display:"flex","justify-content":"center"}},Fe={__name:"pay",emits:["paySuccess"],setup(s,{expose:p,emit:H}){const h=l(!1),k=l(1),_=l(""),y=l(""),J=()=>{A()},Q=()=>{$(()=>{setTimeout(()=>{var e;c.value=!1,_.value="",F.value=!0,(e=y.value)==null||e.focus(),T(k.value)},300)})},T=e=>{k.value=e,k.value==2?document.addEventListener("keydown",N):document.removeEventListener("keydown",N)},x=l({}),z=l([]),W=e=>{x.value=e.data,z.value=e.cart_id},X=e=>{x.value.order_price=e.price,u.value=e.order_id},Y=H,F=l(!1),Z=l(["1","2","3","4","5","6","7","8","9","0","00","."]);let S=0;const u=l(""),ee=()=>{c.value=!0,y.value.blur(),u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"micropay",auth_code:_.value,source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1,$(()=>{var a;(a=y.value)==null||a.focus()})})},O=e=>{let a;k.value==1?a={type:"micropay",auth_code:_.value}:a={type:"cash_payment"},_e(e,a).then(t=>{t.status==200&&t.message=="支付成功"?(h.value=!1,C({message:t.message,type:"success"}),P(t.data.message),A()):(u.value=t.data.group_order_id,V.value=0,S=0,j(t.data.group_order_sn))}).catch(t=>{_.value="",c.value=!1,$(()=>{var g;(g=y.value)==null||g.focus()})})},V=l(0),j=e=>{e&&(V.value++,S+=5e3,fe({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(C({message:a.message,type:"success"}),P(a.data.message),A()):(C({message:a.message,type:"error"}),_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}).catch(a=>{F.value&&V.value<3?setTimeout(()=>{j(e)},15e3-S>0?15e3-S:0):(_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}))},A=()=>{var e;F.value=!1,c.value=!1,_.value="",r.value="",d.value=[],(e=y.value)==null||e.blur(),document.removeEventListener("keydown",N),Y("paySuccess"),h.value=!1},c=l(!1);p({drawer:h,setForm:W,setRePay:X});const d=l([]),r=l(""),D=ne(()=>+r.value>0?(r.value-x.value.order_price).toFixed(2):-1),R=l(!1),I=e=>{e===-1?d.value=[]:d.value.pop(),r.value=d.value.length?d.value.join(""):0},n=e=>{R.value===!1&&(r.value="",R.value=!0);let a=String(r.value).indexOf(".")+1,t=String(r.value).length-a;console.log(a,t),(a===0||t<2)&&(d.value.join("")<=9999999&&d.value.push(e),r.value=d.value.join("")>99999999?99999999:d.value.join(""))},U=()=>{D.value===""||D.value===null||D.value===void 0||(u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"cash_payment",source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,r.value="",d.value=[],c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1}))},N=e=>{let t=(e||window.event).keyCode;switch(e.stopPropagation(),e.preventDefault(),t){case 96:case 48:n(0);break;case 97:case 49:n(1);break;case 98:case 50:n(2);break;case 99:case 51:n(3);break;case 100:case 52:n(4);break;case 101:case 53:n(5);break;case 102:case 54:n(6);break;case 103:case 55:n(7);break;case 104:case 56:n(8);break;case 105:case 57:n(9);break;case 110:n(".");break;case 190:n(".");break;case 8:I();break;case 13:U();break}};return(e,a)=>{const t=E("el-input"),g=E("el-button"),ae=E("Delete"),se=E("el-icon"),te=E("el-drawer"),oe=ce("loading");return f(),K(te,{size:800,modelValue:h.value,"onUpdate:modelValue":a[4]||(a[4]=i=>h.value=i),direction:"rtl",onOpen:Q,"before-close":A},{header:m(()=>[me]),default:m(()=>[o("div",ye,[o("div",ge,[o("div",{class:M(["left",{active:k.value==1}]),onClick:a[0]||(a[0]=i=>T(1))}," 微信 ",2),o("div",{class:M(["right",{active:k.value==2}]),onClick:a[1]||(a[1]=i=>T(2))}," 现金收款 ",2)]),he,o("div",ke,[L(" ¥"),o("span",be,B(x.value.order_price),1)]),k.value==1?re((f(),b("div",we,[w(t,{ref_key:"codeRef",ref:y,modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=i=>_.value=i),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ue(ee,["enter"])},null,8,["modelValue"]),Ce])),[[oe,c.value]]):(f(),b("div",xe,[o("div",Se,[o("div",Ae,[o("div",Le,[r.value?(f(),b("span",Ve,B(r.value),1)):(f(),b("span",De,"按下键盘输入客户支付金额"))]),D.value>=0?(f(),b("div",Ee,[L(" 需找零(元):"),o("span",$e,"¥"+B(D.value),1)])):(f(),b("div",je,"不够找零, 请支付更多金额")),o("div",Be,[o("div",Pe,[(f(!0),b(de,null,ie(Z.value,i=>(f(),K(g,{key:i,onClick:Ie=>n(i)},{default:m(()=>[L(B(i),1)]),_:2},1032,["onClick"]))),128))]),o("div",Te,[w(g,{onClick:I},{default:m(()=>[w(se,null,{default:m(()=>[w(ae)]),_:1})]),_:1}),w(g,{onClick:a[3]||(a[3]=i=>I(-1))},{default:m(()=>[L("C")]),_:1}),w(g,{class:"enter",onClick:U},{default:m(()=>[L("确认")]),_:1})])])])])]))])]),footer:m(()=>[o("div",ze,[w(g,{class:"cancel-btn",onClick:J},{default:m(()=>[L("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},He=le(Fe,[["__scopeId","data-v-517a591d"]]);export{Oe as a,Re as b,Ke as c,qe as d,Me as e,Ge as f,fe as g,Ue as o,He as p}; +import{s as v,_ as le,r as l,v as ne,a as E,h as ce,o as f,c as K,w as m,b as o,n as M,e as L,t as B,j as re,f as b,d as w,i as ue,F as de,g as ie,x as $,E as C,p as ve,l as pe}from"./index-XP2RAAdj.js";function qe(s){return v.post("user/cart/create",s)}function Oe(s){return v.get("user/cart/lst",{params:s})}function Re(s,p){return v.post(`user/cart/change/${s}`,p)}function Ue(s){return v.post("v2/order/check",s)}function Ke(s){return v.post("user/cart/delete",s)}function G(s){return v.post("v2/order/create",s)}function _e(s,p){return v.post(`order/pay/${s}`,p)}function fe(s){return v.get("micropay_query",{params:s})}function Me(s,p){return v.get(`admin/${s}/order_list`,{params:p})}function Ge(s){return v.get("order_lading",{params:s})}const P=s=>{let p=new window.SpeechSynthesisUtterance(s);window.speechSynthesis.speak(p)},q=s=>(ve("data-v-517a591d"),s=s(),pe(),s),me=q(()=>o("h4",null,"选择支付方式",-1)),ye={class:"dra-body"},ge={class:"header"},he=q(()=>o("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),ke={style:{color:"#f5222d","padding-bottom":"2rem"}},be={style:{"font-size":"1.6rem"}},we={key:0,"element-loading-text":"支付中",class:"card1"},Ce=q(()=>o("div",{class:"tips"},null,-1)),xe={key:1,class:"card2"},Se={class:"drawer-body"},Ae={class:"counter"},Le={class:"received"},Ve={key:0},De={key:1,style:{"font-size":"1rem",color:"#999"}},Ee={key:0,class:"balance"},$e={class:"money"},je={key:1,class:"balance"},Be={class:"keypad"},Pe={class:"left"},Te={class:"right"},ze={style:{width:"100%",display:"flex","justify-content":"center"}},Fe={__name:"pay",emits:["paySuccess"],setup(s,{expose:p,emit:H}){const h=l(!1),k=l(1),_=l(""),y=l(""),J=()=>{A()},Q=()=>{$(()=>{setTimeout(()=>{var e;c.value=!1,_.value="",F.value=!0,(e=y.value)==null||e.focus(),T(k.value)},300)})},T=e=>{k.value=e,k.value==2?document.addEventListener("keydown",N):document.removeEventListener("keydown",N)},x=l({}),z=l([]),W=e=>{x.value=e.data,z.value=e.cart_id},X=e=>{x.value.order_price=e.price,u.value=e.order_id},Y=H,F=l(!1),Z=l(["1","2","3","4","5","6","7","8","9","0","00","."]);let S=0;const u=l(""),ee=()=>{c.value=!0,y.value.blur(),u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"micropay",auth_code:_.value,source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1,$(()=>{var a;(a=y.value)==null||a.focus()})})},O=e=>{let a;k.value==1?a={type:"micropay",auth_code:_.value}:a={type:"cash_payment"},_e(e,a).then(t=>{t.status==200&&t.message=="支付成功"?(h.value=!1,C({message:t.message,type:"success"}),P(t.data.message),A()):(u.value=t.data.group_order_id,V.value=0,S=0,j(t.data.group_order_sn))}).catch(t=>{_.value="",c.value=!1,$(()=>{var g;(g=y.value)==null||g.focus()})})},V=l(0),j=e=>{e&&(V.value++,S+=5e3,fe({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(C({message:a.message,type:"success"}),P(a.data.message),A()):(C({message:a.message,type:"error"}),_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}).catch(a=>{F.value&&V.value<3?setTimeout(()=>{j(e)},15e3-S>0?15e3-S:0):(_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}))},A=()=>{var e;F.value=!1,c.value=!1,_.value="",r.value="",d.value=[],(e=y.value)==null||e.blur(),document.removeEventListener("keydown",N),Y("paySuccess"),h.value=!1},c=l(!1);p({drawer:h,setForm:W,setRePay:X});const d=l([]),r=l(""),D=ne(()=>+r.value>0?(r.value-x.value.order_price).toFixed(2):-1),R=l(!1),I=e=>{e===-1?d.value=[]:d.value.pop(),r.value=d.value.length?d.value.join(""):0},n=e=>{R.value===!1&&(r.value="",R.value=!0);let a=String(r.value).indexOf(".")+1,t=String(r.value).length-a;console.log(a,t),(a===0||t<2)&&(d.value.join("")<=9999999&&d.value.push(e),r.value=d.value.join("")>99999999?99999999:d.value.join(""))},U=()=>{D.value===""||D.value===null||D.value===void 0||(u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"cash_payment",source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,r.value="",d.value=[],c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1}))},N=e=>{let t=(e||window.event).keyCode;switch(e.stopPropagation(),e.preventDefault(),t){case 96:case 48:n(0);break;case 97:case 49:n(1);break;case 98:case 50:n(2);break;case 99:case 51:n(3);break;case 100:case 52:n(4);break;case 101:case 53:n(5);break;case 102:case 54:n(6);break;case 103:case 55:n(7);break;case 104:case 56:n(8);break;case 105:case 57:n(9);break;case 110:n(".");break;case 190:n(".");break;case 8:I();break;case 13:U();break}};return(e,a)=>{const t=E("el-input"),g=E("el-button"),ae=E("Delete"),se=E("el-icon"),te=E("el-drawer"),oe=ce("loading");return f(),K(te,{size:800,modelValue:h.value,"onUpdate:modelValue":a[4]||(a[4]=i=>h.value=i),direction:"rtl",onOpen:Q,"before-close":A},{header:m(()=>[me]),default:m(()=>[o("div",ye,[o("div",ge,[o("div",{class:M(["left",{active:k.value==1}]),onClick:a[0]||(a[0]=i=>T(1))}," 微信 ",2),o("div",{class:M(["right",{active:k.value==2}]),onClick:a[1]||(a[1]=i=>T(2))}," 现金收款 ",2)]),he,o("div",ke,[L(" ¥"),o("span",be,B(x.value.order_price),1)]),k.value==1?re((f(),b("div",we,[w(t,{ref_key:"codeRef",ref:y,modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=i=>_.value=i),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ue(ee,["enter"])},null,8,["modelValue"]),Ce])),[[oe,c.value]]):(f(),b("div",xe,[o("div",Se,[o("div",Ae,[o("div",Le,[r.value?(f(),b("span",Ve,B(r.value),1)):(f(),b("span",De,"按下键盘输入客户支付金额"))]),D.value>=0?(f(),b("div",Ee,[L(" 需找零(元):"),o("span",$e,"¥"+B(D.value),1)])):(f(),b("div",je,"不够找零, 请支付更多金额")),o("div",Be,[o("div",Pe,[(f(!0),b(de,null,ie(Z.value,i=>(f(),K(g,{key:i,onClick:Ie=>n(i)},{default:m(()=>[L(B(i),1)]),_:2},1032,["onClick"]))),128))]),o("div",Te,[w(g,{onClick:I},{default:m(()=>[w(se,null,{default:m(()=>[w(ae)]),_:1})]),_:1}),w(g,{onClick:a[3]||(a[3]=i=>I(-1))},{default:m(()=>[L("C")]),_:1}),w(g,{class:"enter",onClick:U},{default:m(()=>[L("确认")]),_:1})])])])])]))])]),footer:m(()=>[o("div",ze,[w(g,{class:"cancel-btn",onClick:J},{default:m(()=>[L("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},He=le(Fe,[["__scopeId","data-v-517a591d"]]);export{Oe as a,Re as b,Ke as c,qe as d,Me as e,Ge as f,fe as g,Ue as o,He as p}; diff --git a/build/assets/shop-CWcaSfoY.js b/build/assets/shop-CkbXiufP.js similarity index 75% rename from build/assets/shop-CWcaSfoY.js rename to build/assets/shop-CkbXiufP.js index 4d42094..d81c241 100644 --- a/build/assets/shop-CWcaSfoY.js +++ b/build/assets/shop-CkbXiufP.js @@ -1 +1 @@ -import{s as e}from"./index-Cpj04_tS.js";function u(r,t){return e.get(`server/${r}/product/lst`,{params:t})}function a(r,t){return e.get(`store/product/detail/${r}`,{params:t})}function o(r,t){return e.post(`user_free_trial/${r}`,t)}export{a as g,u as s,o as u}; +import{s as e}from"./index-XP2RAAdj.js";function u(r,t){return e.get(`server/${r}/product/lst`,{params:t})}function a(r,t){return e.get(`store/product/detail/${r}`,{params:t})}function o(r,t){return e.post(`user_free_trial/${r}`,t)}export{a as g,u as s,o as u}; diff --git a/build/index.html b/build/index.html index ec22744..cffc11b 100644 --- a/build/index.html +++ b/build/index.html @@ -5,7 +5,7 @@ 里海收银系统 - + diff --git a/build/assets/index-D9csEJCL.css b/dist/assets/index-CP2ykvWi.css similarity index 54% rename from build/assets/index-D9csEJCL.css rename to dist/assets/index-CP2ykvWi.css index 57b8868..102a51e 100644 --- a/build/assets/index-D9csEJCL.css +++ b/dist/assets/index-CP2ykvWi.css @@ -1 +1 @@ -@charset "UTF-8";.my-order[data-v-7ca37f24]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-7ca37f24]{display:flex;justify-content:space-between;padding:1rem;height:1.5rem}.my-order .header-nav span[data-v-7ca37f24]{color:#ff4a00}.my-order .header-nav .nav-item-clear[data-v-7ca37f24]{display:flex;align-items:center;font-size:.8rem;cursor:pointer}.my-order .header-input[data-v-7ca37f24]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:1px solid #eee}.my-order .order-list[data-v-7ca37f24]{height:calc(100vh - 100px - 8.2rem);overflow-y:auto}.my-order .order-list .item[data-v-7ca37f24]{padding:1rem;border-bottom:1px solid #eee}.my-order .order-list .item .top[data-v-7ca37f24]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-list .item .top .sn[data-v-7ca37f24]{font-weight:700;font-size:.9rem}.my-order .order-list .item .top .cahier[data-v-7ca37f24]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:1px solid #2ec479;color:#2ec479;border-radius:3px}.my-order .order-list .item .top .create-time[data-v-7ca37f24]{font-size:.8rem}.my-order .order-list .item .shop[data-v-7ca37f24]{display:flex;justify-content:space-between}.my-order .order-list .item .shop .right[data-v-7ca37f24]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-list .item .shop .right .money[data-v-7ca37f24]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-list .item .shop .right .count[data-v-7ca37f24]{font-size:.7rem;color:#999}.my-order .order-list .item .shop .left[data-v-7ca37f24]{height:4.5rem;display:flex;align-items:center}.my-order .order-list .item .shop .left .shop-img[data-v-7ca37f24]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-list .item .shop .left .shop-name[data-v-7ca37f24]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-list .item .bottom[data-v-7ca37f24]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-list .item-active[data-v-7ca37f24]{background-color:#efefef}.my-order .load-end[data-v-7ca37f24]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-87395473]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .header-nav[data-v-87395473]{display:flex;background:linear-gradient(to bottom,#f5f5f5 50%,#fff 50%)}.my-order .header-nav .nav-item[data-v-87395473]{height:4rem;width:8rem;cursor:pointer;display:flex;justify-content:center;align-items:center;font-size:1.2rem;background-color:#f5f5f5;border-radius:1rem 1rem 0 0}.my-order .header-nav .nav-item-active[data-v-87395473]{background-color:#fff;position:relative;transition:.3s}.my-order .header-nav .nav-item-radius1[data-v-87395473]{border-radius:0 0 1rem}.my-order .header-nav .nav-item-radius2[data-v-87395473]{border-radius:0 0 0 1rem}.my-order .detail[data-v-87395473]{height:calc(100vh - 100px - 4rem);box-sizing:border-box;position:relative}.my-order .detail .table[data-v-87395473]{padding:1rem 1rem 6rem;overflow-y:scroll}.my-order .detail .table .table-title[data-v-87395473]{font-weight:700;padding-top:1rem}.my-order .detail .table .table-info[data-v-87395473]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:2rem;border-bottom:1px solid #eee}.my-order .detail .table .table-info[data-v-87395473]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-87395473]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-87395473]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-87395473]{height:6rem;box-sizing:border-box;padding:0 1.5rem;position:absolute;bottom:0;left:0;width:100%;box-shadow:0 -1px 10px #eee;display:flex;justify-content:space-between;align-items:center;background-color:#fff}.my-order .detail .footer .info[data-v-87395473]{display:flex;align-items:flex-end}.my-order .detail .footer .info .ser[data-v-87395473]{font-weight:700;margin-right:1rem}.my-order .detail .footer .info .price[data-v-87395473]{margin-right:1rem}.my-order .detail .footer .info .price span[data-v-87395473]{color:#ff4a00;font-size:1.2rem;font-weight:700}.my-order .detail .footer .handle .btn[data-v-87395473]{border-radius:4rem;padding:1.2rem}.my-card{display:flex}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-thumb:hover{background-color:#999} +@charset "UTF-8";.my-order[data-v-7ca37f24]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-7ca37f24]{display:flex;justify-content:space-between;padding:1rem;height:1.5rem}.my-order .header-nav span[data-v-7ca37f24]{color:#ff4a00}.my-order .header-nav .nav-item-clear[data-v-7ca37f24]{display:flex;align-items:center;font-size:.8rem;cursor:pointer}.my-order .header-input[data-v-7ca37f24]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:1px solid #eee}.my-order .order-list[data-v-7ca37f24]{height:calc(100vh - 100px - 8.2rem);overflow-y:auto}.my-order .order-list .item[data-v-7ca37f24]{padding:1rem;border-bottom:1px solid #eee}.my-order .order-list .item .top[data-v-7ca37f24]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-list .item .top .sn[data-v-7ca37f24]{font-weight:700;font-size:.9rem}.my-order .order-list .item .top .cahier[data-v-7ca37f24]:before{content:"收银";font-weight:400;font-size:.7rem;padding:.1rem;margin-right:.2rem;border:1px solid #2ec479;color:#2ec479;border-radius:3px}.my-order .order-list .item .top .create-time[data-v-7ca37f24]{font-size:.8rem}.my-order .order-list .item .shop[data-v-7ca37f24]{display:flex;justify-content:space-between}.my-order .order-list .item .shop .right[data-v-7ca37f24]{flex-shrink:0;display:flex;flex-direction:column;justify-content:center}.my-order .order-list .item .shop .right .money[data-v-7ca37f24]{font-size:1rem;color:#ff4a00;font-weight:700}.my-order .order-list .item .shop .right .count[data-v-7ca37f24]{font-size:.7rem;color:#999}.my-order .order-list .item .shop .left[data-v-7ca37f24]{height:4.5rem;display:flex;align-items:center}.my-order .order-list .item .shop .left .shop-img[data-v-7ca37f24]{width:3.5rem;height:3.5rem;border-radius:.3rem;margin-right:.4rem}.my-order .order-list .item .shop .left .shop-name[data-v-7ca37f24]{font-size:.9rem;color:#333;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;-webkit-line-clamp:3}.my-order .order-list .item .bottom[data-v-7ca37f24]{display:flex;justify-content:space-between;font-size:.9rem;color:#777}.my-order .order-list .item-active[data-v-7ca37f24]{background-color:#efefef}.my-order .load-end[data-v-7ca37f24]{text-align:center;padding:1rem;color:#333;font-size:.8rem}.my-order[data-v-e393670f]{border-radius:1.2rem;height:100%;flex:1;background-color:#fff;position:relative;overflow:hidden}.my-order .header-nav[data-v-e393670f]{display:flex;background:linear-gradient(to bottom,#f5f5f5 50%,#fff 50%)}.my-order .header-nav .nav-item[data-v-e393670f]{height:4rem;width:8rem;cursor:pointer;display:flex;justify-content:center;align-items:center;font-size:1.2rem;background-color:#f5f5f5;border-radius:1rem 1rem 0 0}.my-order .header-nav .nav-item-active[data-v-e393670f]{background-color:#fff;position:relative;transition:.3s}.my-order .header-nav .nav-item-radius1[data-v-e393670f]{border-radius:0 0 1rem}.my-order .header-nav .nav-item-radius2[data-v-e393670f]{border-radius:0 0 0 1rem}.my-order .detail[data-v-e393670f]{height:calc(100vh - 100px - 4rem);box-sizing:border-box;position:relative}.my-order .detail .table[data-v-e393670f]{padding:1rem 1rem 6rem}.my-order .detail .table .table-title[data-v-e393670f]{font-weight:700;padding-top:1rem}.my-order .detail .table .table-info[data-v-e393670f]{display:flex;flex-wrap:wrap;color:#777;font-size:.9rem;padding-bottom:2rem;border-bottom:1px solid #eee}.my-order .detail .table .table-info[data-v-e393670f]:last-child{border-bottom:none}.my-order .detail .table .table-info .info-item[data-v-e393670f]{width:33%;display:flex;padding-top:1rem}.my-order .detail .table .table-info .info-item .info-item-title[data-v-e393670f]{flex-shrink:0;padding-right:1rem}.my-order .detail .footer[data-v-e393670f]{height:6rem;box-sizing:border-box;padding:0 1.5rem;position:absolute;bottom:0;left:0;width:100%;box-shadow:0 -1px 10px #eee;display:flex;justify-content:space-between;align-items:center;background-color:#fff}.my-order .detail .footer .info[data-v-e393670f]{display:flex;align-items:flex-end}.my-order .detail .footer .info .ser[data-v-e393670f]{font-weight:700;margin-right:1rem}.my-order .detail .footer .info .price[data-v-e393670f]{margin-right:1rem}.my-order .detail .footer .info .price span[data-v-e393670f]{color:#ff4a00;font-size:1.2rem;font-weight:700}.my-order .detail .footer .handle .btn[data-v-e393670f]{border-radius:4rem;padding:1.2rem}.my-card{display:flex}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background-color:#f1f1f1}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-thumb:hover{background-color:#999} diff --git a/dist/assets/index-Cca88OL5.js b/dist/assets/index-CngFHFdP.js similarity index 95% rename from dist/assets/index-Cca88OL5.js rename to dist/assets/index-CngFHFdP.js index 4147b0b..94b93d6 100644 --- a/dist/assets/index-Cca88OL5.js +++ b/dist/assets/index-CngFHFdP.js @@ -1 +1 @@ -import{s as L,u as S}from"./shop-Dt7yZjfV.js";import{_ as j,r as i,u as A,a as r,h as F,j as T,f as $,d as e,w as l,o as k,e as m,b as w,c as M,t as O,k as P,E as y}from"./index-B3GfFMCJ.js";const q={"element-loading-text":"加载中",class:"my-shop"},G={class:"dialog-footer"},H={__name:"index",setup(J){const v=i([]),V=A(),u=i({page:1,limit:15}),d=i(!1),g=i(0),c=()=>{d.value=!0,L(V.userInfo.service.mer_id,u.value).then(t=>{v.value=t.data.list,g.value=t.data.count,d.value=!1})};c();const C=t=>{u.value.page=t,c()},x=t=>{u.value.page=t,c()},N=t=>{u.value.page=t,c()},p=i(!1),o=i({}),U=t=>{o.value=t,p.value=!0},z=()=>{let t={attr:o.value.attr||[],attrValue:o.value.attrValue,mer_cate_id:o.value.merCateId||[],spec_type:o.value.spec_type,is_stock:1};S(o.value.product_id,t).then(n=>{y({message:n.message,type:"success"}),p.value=!1,c()}).catch(n=>{y({message:n,type:"error"})})};return(t,n)=>{const s=r("el-table-column"),f=r("el-image"),_=r("el-button"),h=r("el-table"),B=r("el-pagination"),D=r("el-input-number"),I=r("el-dialog"),E=F("loading");return T((k(),$("div",q,[e(h,{data:v.value,style:{width:"100%"}},{default:l(()=>[e(s,{prop:"product_id",label:"ID",width:"100"}),e(s,{prop:"image",label:"图片",width:"120"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"60px",height:"60px"},src:a.row.image},null,8,["src"])]),_:1}),e(s,{prop:"store_name",label:"商品名称",width:"500"}),e(s,{prop:"price",label:"售价"}),e(s,{prop:"stock",label:"库存"}),e(s,{label:"操作",width:"120"},{default:l(a=>[e(_,{type:"primary",link:"",onClick:b=>U(a.row)},{default:l(()=>[m("编辑")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),e(B,{"page-size":u.value.limit,layout:"prev, pager, next",total:g.value,onPrevClick:C,onNextClick:x,onCurrentChange:N},null,8,["page-size","total"]),e(I,{modelValue:p.value,"onUpdate:modelValue":n[1]||(n[1]=a=>p.value=a),title:"编辑商品库存",width:"800"},{footer:l(()=>[w("div",G,[e(_,{onClick:n[0]||(n[0]=a=>p.value=!1)},{default:l(()=>[m("取消")]),_:1}),e(_,{type:"primary",onClick:z},{default:l(()=>[m(" 确定 ")]),_:1})])]),default:l(()=>[o.value.attrValue?(k(),M(h,{key:0,data:o.value.attrValue,stripe:"",style:{width:"100%"}},{default:l(()=>[e(s,{prop:"image",label:"图片",width:"180"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:a.row.image||o.value.image},null,8,["src"])]),_:1}),e(s,{prop:"sku",label:"名称",width:"180"},{default:l(a=>[w("span",null,O(a.row.sku||o.value.store_name),1)]),_:1}),e(s,{prop:"price",label:"价格"}),e(s,{prop:"stock",label:"库存"},{default:l(a=>[e(D,{modelValue:a.row.stock,"onUpdate:modelValue":b=>a.row.stock=b,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):P("",!0)]),_:1},8,["modelValue"])])),[[E,d.value]])}}},R=j(H,[["__scopeId","data-v-33636025"]]);export{R as default}; +import{s as L,u as S}from"./shop-CVNajSlv.js";import{_ as j,r as i,u as A,a as r,h as F,j as T,f as $,d as e,w as l,o as k,e as m,b as w,c as M,t as O,k as P,E as y}from"./index-Dqrpap1c.js";const q={"element-loading-text":"加载中",class:"my-shop"},G={class:"dialog-footer"},H={__name:"index",setup(J){const v=i([]),V=A(),u=i({page:1,limit:15}),d=i(!1),g=i(0),c=()=>{d.value=!0,L(V.userInfo.service.mer_id,u.value).then(t=>{v.value=t.data.list,g.value=t.data.count,d.value=!1})};c();const C=t=>{u.value.page=t,c()},x=t=>{u.value.page=t,c()},N=t=>{u.value.page=t,c()},p=i(!1),o=i({}),U=t=>{o.value=t,p.value=!0},z=()=>{let t={attr:o.value.attr||[],attrValue:o.value.attrValue,mer_cate_id:o.value.merCateId||[],spec_type:o.value.spec_type,is_stock:1};S(o.value.product_id,t).then(n=>{y({message:n.message,type:"success"}),p.value=!1,c()}).catch(n=>{y({message:n,type:"error"})})};return(t,n)=>{const s=r("el-table-column"),f=r("el-image"),_=r("el-button"),h=r("el-table"),B=r("el-pagination"),D=r("el-input-number"),I=r("el-dialog"),E=F("loading");return T((k(),$("div",q,[e(h,{data:v.value,style:{width:"100%"}},{default:l(()=>[e(s,{prop:"product_id",label:"ID",width:"100"}),e(s,{prop:"image",label:"图片",width:"120"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"60px",height:"60px"},src:a.row.image},null,8,["src"])]),_:1}),e(s,{prop:"store_name",label:"商品名称",width:"500"}),e(s,{prop:"price",label:"售价"}),e(s,{prop:"stock",label:"库存"}),e(s,{label:"操作",width:"120"},{default:l(a=>[e(_,{type:"primary",link:"",onClick:b=>U(a.row)},{default:l(()=>[m("编辑")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),e(B,{"page-size":u.value.limit,layout:"prev, pager, next",total:g.value,onPrevClick:C,onNextClick:x,onCurrentChange:N},null,8,["page-size","total"]),e(I,{modelValue:p.value,"onUpdate:modelValue":n[1]||(n[1]=a=>p.value=a),title:"编辑商品库存",width:"800"},{footer:l(()=>[w("div",G,[e(_,{onClick:n[0]||(n[0]=a=>p.value=!1)},{default:l(()=>[m("取消")]),_:1}),e(_,{type:"primary",onClick:z},{default:l(()=>[m(" 确定 ")]),_:1})])]),default:l(()=>[o.value.attrValue?(k(),M(h,{key:0,data:o.value.attrValue,stripe:"",style:{width:"100%"}},{default:l(()=>[e(s,{prop:"image",label:"图片",width:"180"},{default:l(a=>[e(f,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:a.row.image||o.value.image},null,8,["src"])]),_:1}),e(s,{prop:"sku",label:"名称",width:"180"},{default:l(a=>[w("span",null,O(a.row.sku||o.value.store_name),1)]),_:1}),e(s,{prop:"price",label:"价格"}),e(s,{prop:"stock",label:"库存"},{default:l(a=>[e(D,{modelValue:a.row.stock,"onUpdate:modelValue":b=>a.row.stock=b,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):P("",!0)]),_:1},8,["modelValue"])])),[[E,d.value]])}}},R=j(H,[["__scopeId","data-v-33636025"]]);export{R as default}; diff --git a/dist/assets/index-iV8fzPz2.js b/dist/assets/index-CxjVX3eh.js similarity index 76% rename from dist/assets/index-iV8fzPz2.js rename to dist/assets/index-CxjVX3eh.js index e99c577..14acef8 100644 --- a/dist/assets/index-iV8fzPz2.js +++ b/dist/assets/index-CxjVX3eh.js @@ -1 +1 @@ -import{e as K,p as Q,f as W,g as X}from"./pay-DGm-hSsT.js";import{_ as T,u as j,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,j as q,F as z,g as F,n as A,t as d,c as O,k,p as H,l as G,q as Y,E as N}from"./index-B3GfFMCJ.js";import{p as Z}from"./padding-D1D9f_t3.js";function ee(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 M=ee(),te=n=>(H("data-v-7ca37f24"),n=n(),G(),n),se={class:"my-order"},oe={class:"header-nav"},ie=te(()=>e("div",{class:"nav-item"},"订单列表",-1)),ae={class:"nav-item-clear"},le={class:"header-input"},ne={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},ce=["onClick"],de={class:"top"},re={class:"create-time"},_e={class:"shop"},ue={key:0,class:"left"},ve={key:0,class:"shop-name"},fe={class:"right"},pe={class:"money"},me={class:"count"},he={class:"bottom"},ye={class:"pay"},ge={key:0},ke={key:1,style:{color:"#ff4a00"}},$e={key:0,class:"cashier"},be={key:0,class:"load-end"},Ce={key:1,class:"load-end"},Ve={__name:"order",setup(n){const p=j();r([]);const t=r(1),_=C=>{u.value.page=1,y.value=!1,v.value=!1,b.value=[],P(!0)};r(null);const u=r({page:1,limit:20,search_info:""}),v=r(!1),L=r(0),S=r(0),y=r(!1),b=r([]),P=(C=!1)=>{y.value||v.value||(C&&(u.value.page=1),v.value=!0,t.value==1&&(u.value.paid=null),t.value==2&&(u.value.paid=0),K(p.userInfo.service.mer_id,u.value).then(o=>{C?b.value=o.data.list:b.value=[...b.value,...o.data.list],o.data.list.length{v.value=!1}))},R=(C,o)=>{S.value=o,M.emit("set-order-detail",C)};return(C,o)=>{const c=g("el-radio-button"),x=g("el-radio-group"),w=g("el-button"),B=g("el-input"),V=g("el-image"),D=U("loading"),E=U("infinite-scroll");return i(),a("div",se,[e("div",oe,[ie,e("div",ae,[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",le,[l(B,{modelValue:u.value.search_info,"onUpdate:modelValue":o[2]||(o[2]=s=>u.value.search_info=s),placeholder:"请输入订单编号",clearable:""},{append:f(()=>[l(w,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:o[1]||(o[1]=s=>P(!0))},{default:f(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((i(),a("div",ne,[(i(!0),a(z,null,F(b.value,(s,$)=>(i(),a("div",{class:A(["item",{"item-active":S.value==$}]),key:$,onClick:I=>R(s,$)},[e("div",de,[e("div",{class:A(["sn",{cahier:s.pay_type==11||s.pay_type==12}])},"单号: "+d(s.order_sn),3),e("div",re,d(s.create_time),1)]),e("div",_e,[s.orderProduct?(i(),a("div",ue,[(i(!0),a(z,null,F(s.orderProduct.slice(0,5),(I,J)=>(i(),O(V,{key:J,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",ve,d(s.orderProduct[0].cart_info.product.store_name),1)):k("",!0)])):k("",!0),e("div",fe,[e("div",pe,"¥"+d(s.pay_price),1),e("div",me,"共"+d(s.total_num)+"件商品",1)])]),e("div",he,[e("div",ye,[s.paid?(i(),a("span",ge,"已支付")):(i(),a("span",ke,"未支付"))]),s.service_info?(i(),a("div",$e,"收银员: "+d(s.service_info.nickname),1)):k("",!0)])],10,ce))),128)),y.value?(i(),a("div",be,"没有更多了")):k("",!0),v.value?(i(),a("div",Ce,"加载中...")):k("",!0)])),[[D,v.value],[E,P]])])}}},Se=T(Ve,[["__scopeId","data-v-7ca37f24"]]),m=n=>(H("data-v-87395473"),n=n(),G(),n),we={class:"my-order"},Pe={class:"header-nav"},Le=["onClick"],xe={class:"detail"},Ie={key:0,class:"table"},Ae={style:{"font-size":"0.9rem"}},Re={style:{color:"#ff4a00"}},Be={style:{display:"flex","align-items":"center"}},De={style:{"margin-left":"0.5rem"}},Ee={key:1,class:"table"},Ne=m(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},ze={class:"info-item"},Fe=m(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Oe={class:"info-item-info"},Me={class:"info-item"},Te=m(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),je={class:"info-item-info"},qe={class:"info-item"},He=m(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ge={class:"info-item-info"},Je={class:"info-item"},Ke=m(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=m(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),Ye={class:"info-item-info"},Ze={class:"info-item"},et=m(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),tt={class:"info-item-info"},st={class:"info-item"},ot=m(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),it={class:"info-item-info"},at={key:0},lt={key:1},nt=m(()=>e("div",{class:"table-title"},"收银员信息",-1)),ct={class:"table-info",style:{"flex-direction":"column"}},dt={class:"info-item"},rt=m(()=>e("div",{class:"info-item-title"},"头像:",-1)),_t={class:"info-item-info"},ut={class:"info-item"},vt=m(()=>e("div",{class:"info-item-title"},"昵称:",-1)),ft={class:"info-item-info"},pt={class:"info-item"},mt=m(()=>e("div",{class:"info-item-title"},"账号:",-1)),ht={class:"info-item-info"},yt={key:2,class:"footer"},gt={class:"info"},kt={class:"ser"},$t={class:"price"},bt={key:0,class:"handle"},Ct={key:1,class:"handle"},Vt=m(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),St={class:"dialog-footer"},wt={__name:"detail",setup(n){j();const p=Y(),t=r({});M.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),b=o=>{S.value=o,y.value=!0},P=()=>{y.value=!1,W({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=>{X({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"),w=g("el-table-column"),B=g("el-table"),V=g("el-button"),D=g("el-dialog"),E=U("loading");return i(),a("div",we,[e("div",Pe,[(i(!0),a(z,null,F(L.value,(s,$)=>(i(),a("div",{key:$,class:A(["nav-item",{"nav-item-active":v.value==$,"nav-item-radius1":v.value==$+1,"nav-item-radius2":v.value==$-1}]),onClick:I=>v.value=$},d(s),11,Le))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":v.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),q((i(),a("div",xe,[t.value.orderProduct&&v.value==0?(i(),a("div",Ie,[e("div",Ae,[h(" 共计 "),e("span",Re,d(t.value.total_num),1),h(" 件商品 ")]),l(B,{style:{height:"calc(100vh - 100px - 14rem)"},data:t.value.orderProduct},{default:f(()=>[l(w,{prop:"cart_info.product.store_name",label:"商品信息"},{default:f(({row:s})=>[e("div",Be,[l(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",De,d(s.cart_info.product.store_name),1)])]),_:1}),l(w,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),l(w,{prop:"product_num",label:"数量",width:"150"}),l(w,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):k("",!0),t.value.orderProduct&&v.value==1?(i(),a("div",Ee,[Ne,e("div",Ue,[e("div",ze,[Fe,e("div",Oe,d(t.value.create_time),1)]),e("div",Me,[Te,e("div",je,d(t.value.total_num),1)]),e("div",qe,[He,e("div",Ge,d(t.value.total_price),1)]),e("div",Je,[Ke,e("div",Qe,d(t.value.pay_time),1)]),e("div",We,[Xe,e("div",Ye,d(t.value.deduction_price),1)]),e("div",Ze,[et,e("div",tt,d(t.value.pay_price),1)]),e("div",st,[ot,e("div",it,[t.value.pay_type==11?(i(),a("span",at,"微信收款")):k("",!0),t.value.pay_type==12?(i(),a("span",lt,"现金支付")):k("",!0)])])]),nt,e("div",ct,[e("div",dt,[rt,e("div",_t,[l(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:t.value.service_info.avatar},null,8,["src"])])]),e("div",ut,[vt,e("div",ft,d(t.value.service_info.nickname),1)]),e("div",pt,[mt,e("div",ht,d(t.value.service_info.account),1)])])])):k("",!0),t.value.service_info?(i(),a("div",yt,[e("div",gt,[e("div",kt,"收银员: "+d(t.value.service_info.nickname),1),e("div",$t,[h(" 实付: "),e("span",null,"¥"+d(t.value.pay_price),1)])]),t.value.pay_time?(i(),a("div",Ct,"已支付")):(i(),a("div",bt,[l(V,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(t.value))},{default:f(()=>[h("重新支付")]),_:1}),l(V,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>C(t.value.order_sn))},{default:f(()=>[h("检测状态")]),_:1}),l(V,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>b(t.value.order_sn))},{default:f(()=>[h("提单")]),_:1})]))])):k("",!0)])),[[E,u.value]]),l(Q,{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",St,[l(V,{onClick:c[3]||(c[3]=s=>y.value=!1)},{default:f(()=>[h("取消")]),_:1}),o.cartCount>0?(i(),O(V,{key:0,onClick:o.goHome},{default:f(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(i(),O(V,{key:1,type:"primary",onClick:P},{default:f(()=>[h(" 确认提单 ")]),_:1}))])]),default:f(()=>[Vt]),_:1},8,["modelValue"])])}}},Pt=T(wt,[["__scopeId","data-v-87395473"]]),Lt={class:"my-card"},Rt={__name:"index",setup(n){return(p,t)=>(i(),a("div",Lt,[l(Se,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(Z),l(Pt,{ref:"detailRef"},null,512)]))}};export{Rt as default}; +import{e as K,p as Q,f as W,g as X}from"./pay-Bkl34wIu.js";import{_ as T,u as j,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,j as q,F as z,g as F,n as A,t as d,c as O,k,p as H,l as G,q as Y,E as N}from"./index-Dqrpap1c.js";import{p as Z}from"./padding-DBM1TjbB.js";function ee(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 M=ee(),te=n=>(H("data-v-7ca37f24"),n=n(),G(),n),se={class:"my-order"},oe={class:"header-nav"},ie=te(()=>e("div",{class:"nav-item"},"订单列表",-1)),ae={class:"nav-item-clear"},le={class:"header-input"},ne={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},ce=["onClick"],de={class:"top"},re={class:"create-time"},_e={class:"shop"},ue={key:0,class:"left"},ve={key:0,class:"shop-name"},fe={class:"right"},pe={class:"money"},me={class:"count"},he={class:"bottom"},ye={class:"pay"},ge={key:0},ke={key:1,style:{color:"#ff4a00"}},$e={key:0,class:"cashier"},be={key:0,class:"load-end"},Ce={key:1,class:"load-end"},Ve={__name:"order",setup(n){const p=j();r([]);const t=r(1),_=C=>{u.value.page=1,y.value=!1,v.value=!1,b.value=[],P(!0)};r(null);const u=r({page:1,limit:20,search_info:""}),v=r(!1),L=r(0),S=r(0),y=r(!1),b=r([]),P=(C=!1)=>{y.value||v.value||(C&&(u.value.page=1),v.value=!0,t.value==1&&(u.value.paid=null),t.value==2&&(u.value.paid=0),K(p.userInfo.service.mer_id,u.value).then(o=>{C?b.value=o.data.list:b.value=[...b.value,...o.data.list],o.data.list.length{v.value=!1}))},R=(C,o)=>{S.value=o,M.emit("set-order-detail",C)};return(C,o)=>{const c=g("el-radio-button"),x=g("el-radio-group"),w=g("el-button"),B=g("el-input"),V=g("el-image"),D=U("loading"),E=U("infinite-scroll");return i(),a("div",se,[e("div",oe,[ie,e("div",ae,[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",le,[l(B,{modelValue:u.value.search_info,"onUpdate:modelValue":o[2]||(o[2]=s=>u.value.search_info=s),placeholder:"请输入订单编号",clearable:""},{append:f(()=>[l(w,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:o[1]||(o[1]=s=>P(!0))},{default:f(()=>[h("搜索")]),_:1})]),_:1},8,["modelValue"])]),q((i(),a("div",ne,[(i(!0),a(z,null,F(b.value,(s,$)=>(i(),a("div",{class:A(["item",{"item-active":S.value==$}]),key:$,onClick:I=>R(s,$)},[e("div",de,[e("div",{class:A(["sn",{cahier:s.pay_type==11||s.pay_type==12}])},"单号: "+d(s.order_sn),3),e("div",re,d(s.create_time),1)]),e("div",_e,[s.orderProduct?(i(),a("div",ue,[(i(!0),a(z,null,F(s.orderProduct.slice(0,5),(I,J)=>(i(),O(V,{key:J,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",ve,d(s.orderProduct[0].cart_info.product.store_name),1)):k("",!0)])):k("",!0),e("div",fe,[e("div",pe,"¥"+d(s.pay_price),1),e("div",me,"共"+d(s.total_num)+"件商品",1)])]),e("div",he,[e("div",ye,[s.paid?(i(),a("span",ge,"已支付")):(i(),a("span",ke,"未支付"))]),s.service_info?(i(),a("div",$e,"收银员: "+d(s.service_info.nickname),1)):k("",!0)])],10,ce))),128)),y.value?(i(),a("div",be,"没有更多了")):k("",!0),v.value?(i(),a("div",Ce,"加载中...")):k("",!0)])),[[D,v.value],[E,P]])])}}},Se=T(Ve,[["__scopeId","data-v-7ca37f24"]]),m=n=>(H("data-v-e393670f"),n=n(),G(),n),we={class:"my-order"},Pe={class:"header-nav"},Le=["onClick"],xe={class:"detail"},Ie={key:0,class:"table"},Ae={style:{"font-size":"0.9rem"}},Re={style:{color:"#ff4a00"}},Be={style:{display:"flex","align-items":"center"}},De={style:{"margin-left":"0.5rem"}},Ee={key:1,class:"table"},Ne=m(()=>e("div",{class:"table-title"},"订单信息",-1)),Ue={class:"table-info"},ze={class:"info-item"},Fe=m(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Oe={class:"info-item-info"},Me={class:"info-item"},Te=m(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),je={class:"info-item-info"},qe={class:"info-item"},He=m(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),Ge={class:"info-item-info"},Je={class:"info-item"},Ke=m(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),Qe={class:"info-item-info"},We={class:"info-item"},Xe=m(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),Ye={class:"info-item-info"},Ze={class:"info-item"},et=m(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),tt={class:"info-item-info"},st={class:"info-item"},ot=m(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),it={class:"info-item-info"},at={key:0},lt={key:1},nt=m(()=>e("div",{class:"table-title"},"收银员信息",-1)),ct={class:"table-info",style:{"flex-direction":"column"}},dt={class:"info-item"},rt=m(()=>e("div",{class:"info-item-title"},"头像:",-1)),_t={class:"info-item-info"},ut={class:"info-item"},vt=m(()=>e("div",{class:"info-item-title"},"昵称:",-1)),ft={class:"info-item-info"},pt={class:"info-item"},mt=m(()=>e("div",{class:"info-item-title"},"账号:",-1)),ht={class:"info-item-info"},yt={key:2,class:"footer"},gt={class:"info"},kt={class:"ser"},$t={class:"price"},bt={key:0,class:"handle"},Ct={key:1,class:"handle"},Vt=m(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),St={class:"dialog-footer"},wt={__name:"detail",setup(n){j();const p=Y(),t=r({});M.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),b=o=>{S.value=o,y.value=!0},P=()=>{y.value=!1,W({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=>{X({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"),w=g("el-table-column"),B=g("el-table"),V=g("el-button"),D=g("el-dialog"),E=U("loading");return i(),a("div",we,[e("div",Pe,[(i(!0),a(z,null,F(L.value,(s,$)=>(i(),a("div",{key:$,class:A(["nav-item",{"nav-item-active":v.value==$,"nav-item-radius1":v.value==$+1,"nav-item-radius2":v.value==$-1}]),onClick:I=>v.value=$},d(s),11,Le))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":v.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),q((i(),a("div",xe,[t.value.orderProduct&&v.value==0?(i(),a("div",Ie,[e("div",Ae,[h(" 共计 "),e("span",Re,d(t.value.total_num),1),h(" 件商品 ")]),l(B,{style:{height:"calc(100vh - 100px - 14rem)"},data:t.value.orderProduct},{default:f(()=>[l(w,{prop:"cart_info.product.store_name",label:"商品信息"},{default:f(({row:s})=>[e("div",Be,[l(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",De,d(s.cart_info.product.store_name),1)])]),_:1}),l(w,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),l(w,{prop:"product_num",label:"数量",width:"150"}),l(w,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):k("",!0),t.value.orderProduct&&v.value==1?(i(),a("div",Ee,[Ne,e("div",Ue,[e("div",ze,[Fe,e("div",Oe,d(t.value.create_time),1)]),e("div",Me,[Te,e("div",je,d(t.value.total_num),1)]),e("div",qe,[He,e("div",Ge,"¥"+d(t.value.total_price),1)]),e("div",Je,[Ke,e("div",Qe,d(t.value.pay_time),1)]),e("div",We,[Xe,e("div",Ye,"¥"+d(t.value.deduction_price),1)]),e("div",Ze,[et,e("div",tt,"¥"+d(t.value.pay_price),1)]),e("div",st,[ot,e("div",it,[t.value.pay_type==11?(i(),a("span",at,"微信收款")):k("",!0),t.value.pay_type==12?(i(),a("span",lt,"现金支付")):k("",!0)])])]),nt,e("div",ct,[e("div",dt,[rt,e("div",_t,[l(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:t.value.service_info.avatar},null,8,["src"])])]),e("div",ut,[vt,e("div",ft,d(t.value.service_info.nickname),1)]),e("div",pt,[mt,e("div",ht,d(t.value.service_info.account),1)])])])):k("",!0),t.value.service_info?(i(),a("div",yt,[e("div",gt,[e("div",kt,"收银员: "+d(t.value.service_info.nickname),1),e("div",$t,[h(" 实付: "),e("span",null,"¥"+d(t.value.pay_price),1)])]),t.value.pay_time?(i(),a("div",Ct,"已支付")):(i(),a("div",bt,[l(V,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(t.value))},{default:f(()=>[h("重新支付")]),_:1}),l(V,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>C(t.value.order_sn))},{default:f(()=>[h("检测状态")]),_:1}),l(V,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>b(t.value.order_sn))},{default:f(()=>[h("提单")]),_:1})]))])):k("",!0)])),[[E,u.value]]),l(Q,{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",St,[l(V,{onClick:c[3]||(c[3]=s=>y.value=!1)},{default:f(()=>[h("取消")]),_:1}),o.cartCount>0?(i(),O(V,{key:0,onClick:o.goHome},{default:f(()=>[h(" 前去清空购物车 ")]),_:1},8,["onClick"])):(i(),O(V,{key:1,type:"primary",onClick:P},{default:f(()=>[h(" 确认提单 ")]),_:1}))])]),default:f(()=>[Vt]),_:1},8,["modelValue"])])}}},Pt=T(wt,[["__scopeId","data-v-e393670f"]]),Lt={class:"my-card"},Rt={__name:"index",setup(n){return(p,t)=>(i(),a("div",Lt,[l(Se,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(Z),l(Pt,{ref:"detailRef"},null,512)]))}};export{Rt as default}; diff --git a/dist/assets/index-jT1k3vKv.js b/dist/assets/index-D5zoeOLt.js similarity index 96% rename from dist/assets/index-jT1k3vKv.js rename to dist/assets/index-D5zoeOLt.js index 75a1bc7..2293bc6 100644 --- a/dist/assets/index-jT1k3vKv.js +++ b/dist/assets/index-D5zoeOLt.js @@ -1 +1 @@ -import{_ as V,u as g,q as x,r as k,y as U,a,f as I,b as i,d as e,w as o,o as S,e as b,p as L,l as B,E as u,z as C,A as E}from"./index-B3GfFMCJ.js";const N=l=>(L("data-v-00c0f4e8"),l=l(),B(),l),M={class:"body"},T={class:"login"},q=N(()=>i("div",{class:"title"},"里海收银系统 - 登录",-1)),z={__name:"index",setup(l){const d=g(),m=x(),t=k({account:"",password:"",key:"",captchaVerification:"",code:""}),f=()=>{if(!t.value.account)return u({message:"请填写账号",type:"error"});if(!t.value.password)return u({message:"请填写密码",type:"error"});C(t.value).then(n=>{console.log(n),n.data&&(d.setToken(n.data.token),E().then(({data:s})=>{if(!s.service)return u({message:"请联系管理员开通服务",type:"error"});d.setUserInfo(s),m.push("/")}))}).catch(n=>{})};return U(()=>{}),(n,s)=>{const v=a("User"),p=a("el-icon"),_=a("el-input"),r=a("el-form-item"),h=a("Lock"),w=a("el-button"),y=a("el-form");return S(),I("div",M,[i("div",T,[q,e(y,null,{default:o(()=>[e(r,null,{default:o(()=>[e(_,{modelValue:t.value.account,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value.account=c),placeholder:"请输入账号"},{prefix:o(()=>[e(p,null,{default:o(()=>[e(v)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(_,{modelValue:t.value.password,"onUpdate:modelValue":s[1]||(s[1]=c=>t.value.password=c),type:"password",placeholder:"请输入密码","show-password":""},{prefix:o(()=>[e(p,null,{default:o(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(w,{style:{width:"100%"},type:"primary",onClick:f},{default:o(()=>[b("登录")]),_:1})]),_:1})]),_:1})])])}}},R=V(z,[["__scopeId","data-v-00c0f4e8"]]);export{R as default}; +import{_ as V,u as g,q as x,r as k,y as U,a,f as I,b as i,d as e,w as o,o as S,e as b,p as L,l as B,E as u,z as C,A as E}from"./index-Dqrpap1c.js";const N=l=>(L("data-v-00c0f4e8"),l=l(),B(),l),M={class:"body"},T={class:"login"},q=N(()=>i("div",{class:"title"},"里海收银系统 - 登录",-1)),z={__name:"index",setup(l){const d=g(),m=x(),t=k({account:"",password:"",key:"",captchaVerification:"",code:""}),f=()=>{if(!t.value.account)return u({message:"请填写账号",type:"error"});if(!t.value.password)return u({message:"请填写密码",type:"error"});C(t.value).then(n=>{console.log(n),n.data&&(d.setToken(n.data.token),E().then(({data:s})=>{if(!s.service)return u({message:"请联系管理员开通服务",type:"error"});d.setUserInfo(s),m.push("/")}))}).catch(n=>{})};return U(()=>{}),(n,s)=>{const v=a("User"),p=a("el-icon"),_=a("el-input"),r=a("el-form-item"),h=a("Lock"),w=a("el-button"),y=a("el-form");return S(),I("div",M,[i("div",T,[q,e(y,null,{default:o(()=>[e(r,null,{default:o(()=>[e(_,{modelValue:t.value.account,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value.account=c),placeholder:"请输入账号"},{prefix:o(()=>[e(p,null,{default:o(()=>[e(v)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(_,{modelValue:t.value.password,"onUpdate:modelValue":s[1]||(s[1]=c=>t.value.password=c),type:"password",placeholder:"请输入密码","show-password":""},{prefix:o(()=>[e(p,null,{default:o(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:o(()=>[e(w,{style:{width:"100%"},type:"primary",onClick:f},{default:o(()=>[b("登录")]),_:1})]),_:1})]),_:1})])])}}},R=V(z,[["__scopeId","data-v-00c0f4e8"]]);export{R as default}; diff --git a/build/assets/index-D1KIV7mN.js b/dist/assets/index-DSzheXJO.js similarity index 92% rename from build/assets/index-D1KIV7mN.js rename to dist/assets/index-DSzheXJO.js index dbfb42e..7bcdd11 100644 --- a/build/assets/index-D1KIV7mN.js +++ b/dist/assets/index-DSzheXJO.js @@ -1 +1 @@ -import{a as t,f as c,b as e,d as o,w as a,o as d,e as l}from"./index-Cpj04_tS.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return d(),c("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:a(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; +import{a as t,f as c,b as e,d as o,w as a,o as d,e as l}from"./index-Dqrpap1c.js";const r={style:{width:"100vw",height:"100vh"}},_={style:{display:"flex","justify-content":"center","padding-top":"20vh"}},m={style:{display:"flex","flex-direction":"column","justify-content":"center","padding-left":"3rem"}},p=e("div",{style:{"font-size":"5rem","font-weight":"bold"}},"404",-1),h=e("div",{style:{"padding-bottom":"1rem"}},"您的页面没有找到",-1),v={__name:"index",setup(f){const s=()=>{window.location="/"};return(y,g)=>{const n=t("el-image"),i=t("el-button");return d(),c("div",r,[e("div",_,[o(n,{loading:"lazy",style:{width:"30rem",height:"20rem"},src:"/src/assets/icon-404-color.svg"}),e("div",m,[p,h,o(i,{type:"primary",onClick:s},{default:a(()=>[l("返回首页")]),_:1})])])])}}};export{v as default}; diff --git a/dist/assets/index-B3GfFMCJ.js b/dist/assets/index-Dqrpap1c.js similarity index 99% rename from dist/assets/index-B3GfFMCJ.js rename to dist/assets/index-Dqrpap1c.js index b143018..bd676a4 100644 --- a/dist/assets/index-B3GfFMCJ.js +++ b/dist/assets/index-Dqrpap1c.js @@ -1,6 +1,6 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-Z_K2cVrU.js","./pay-DGm-hSsT.js","./pay-CgGUliwa.css","./padding-D1D9f_t3.js","./shop-Dt7yZjfV.js","./index-B0FE6ezs.css","./index-iV8fzPz2.js","./index-D9csEJCL.css","./indexList-D9DvhVcr.js","./indexList-BWS4uCkU.css","./index-Cca88OL5.js","./index-Bmp4AY5x.css","./index-jT1k3vKv.js","./index-Cq3x8gKD.css"] + __vite__mapDeps.viteFileDeps = ["./index-pfZ9bSaD.js","./pay-Bkl34wIu.js","./pay-CgGUliwa.css","./padding-DBM1TjbB.js","./shop-CVNajSlv.js","./index-B0FE6ezs.css","./index-CxjVX3eh.js","./index-CP2ykvWi.css","./indexList-Df9NBcZl.js","./indexList-BWS4uCkU.css","./index-CngFHFdP.js","./index-Bmp4AY5x.css","./index-D5zoeOLt.js","./index-Cq3x8gKD.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } @@ -76,4 +76,4 @@ function __vite__mapDeps(indexes) { `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[u4]=this[u4]={accessors:{}}).accessors,r=this.prototype;function a(l){const s=is(l);o[s]||(uce(r,l),o[s]=!0)}return Ve.isArray(t)?t.forEach(a):a(t),this}}vd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ve.reduceDescriptors(vd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});Ve.freezeMethods(vd);const or=vd;function df(e,t){const n=this||lv,o=t||n,r=or.from(o.headers);let a=o.data;return Ve.forEach(e,function(s){a=s.call(n,a,r.normalize(),t?t.status:void 0)}),r.normalize(),a}function Sb(e){return!!(e&&e.__CANCEL__)}function $i(e,t,n){Rt.call(this,e??"canceled",Rt.ERR_CANCELED,t,n),this.name="CanceledError"}Ve.inherits($i,Rt,{__CANCEL__:!0});function cce(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Rt("Request failed with status code "+n.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const dce=No.hasStandardBrowserEnv?{write(e,t,n,o,r,a){const l=[e+"="+encodeURIComponent(t)];Ve.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),Ve.isString(o)&&l.push("path="+o),Ve.isString(r)&&l.push("domain="+r),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fce(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pce(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function kb(e,t){return e&&!fce(t)?pce(e,t):t}const vce=No.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let o;function r(a){let l=a;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return o=r(window.location.href),function(l){const s=Ve.isString(l)?r(l):l;return s.protocol===o.protocol&&s.host===o.host}}():function(){return function(){return!0}}();function hce(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mce(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,a=0,l;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=o[a];l||(l=c),n[r]=u,o[r]=c;let d=a,p=0;for(;d!==r;)p+=n[d++],d=d%e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-l{const a=r.loaded,l=r.lengthComputable?r.total:void 0,s=a-n,u=o(s),c=a<=l;n=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:s,rate:u||void 0,estimated:u&&l&&c?(l-a)/u:void 0,event:r};f[t?"download":"upload"]=!0,e(f)}}const gce=typeof XMLHttpRequest<"u",yce=gce&&function(e){return new Promise(function(n,o){let r=e.data;const a=or.from(e.headers).normalize();let{responseType:l,withXSRFToken:s}=e,u;function c(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let f;if(Ve.isFormData(r)){if(No.hasStandardBrowserEnv||No.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((f=a.getContentType())!==!1){const[v,...y]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([v||"multipart/form-data",...y].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const v=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(v+":"+y))}const p=kb(e.baseURL,e.url);d.open(e.method.toUpperCase(),_b(p,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function h(){if(!d)return;const v=or.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),g={data:!l||l==="text"||l==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:v,config:e,request:d};cce(function(b){n(b),c()},function(b){o(b),c()},g),d=null}if("onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(h)},d.onabort=function(){d&&(o(new Rt("Request aborted",Rt.ECONNABORTED,e,d)),d=null)},d.onerror=function(){o(new Rt("Network Error",Rt.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let y=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const g=e.transitional||bb;e.timeoutErrorMessage&&(y=e.timeoutErrorMessage),o(new Rt(y,g.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,d)),d=null},No.hasStandardBrowserEnv&&(s&&Ve.isFunction(s)&&(s=s(e)),s||s!==!1&&vce(p))){const v=e.xsrfHeaderName&&e.xsrfCookieName&&dce.read(e.xsrfCookieName);v&&a.set(e.xsrfHeaderName,v)}r===void 0&&a.setContentType(null),"setRequestHeader"in d&&Ve.forEach(a.toJSON(),function(y,g){d.setRequestHeader(g,y)}),Ve.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),l&&l!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",c4(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",c4(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=v=>{d&&(o(!v||v.type?new $i(null,e,d):v),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const m=hce(p);if(m&&No.protocols.indexOf(m)===-1){o(new Rt("Unsupported protocol "+m+":",Rt.ERR_BAD_REQUEST,e));return}d.send(r||null)})},F0={http:Kue,xhr:yce};Ve.forEach(F0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const d4=e=>`- ${e}`,_ce=e=>Ve.isFunction(e)||e===null||e===!1,Eb={getAdapter:e=>{e=Ve.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let a=0;a`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=t?a.length>1?`since : `+a.map(d4).join(` `):" "+d4(a[0]):"as no adapter specified";throw new Rt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:F0};function ff(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $i(null,e)}function f4(e){return ff(e),e.headers=or.from(e.headers),e.data=df.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Eb.getAdapter(e.adapter||lv.adapter)(e).then(function(o){return ff(e),o.data=df.call(e,e.transformResponse,o),o.headers=or.from(o.headers),o},function(o){return Sb(o)||(ff(e),o&&o.response&&(o.response.data=df.call(e,e.transformResponse,o.response),o.response.headers=or.from(o.response.headers))),Promise.reject(o)})}const p4=e=>e instanceof or?{...e}:e;function Hl(e,t){t=t||{};const n={};function o(c,f,d){return Ve.isPlainObject(c)&&Ve.isPlainObject(f)?Ve.merge.call({caseless:d},c,f):Ve.isPlainObject(f)?Ve.merge({},f):Ve.isArray(f)?f.slice():f}function r(c,f,d){if(Ve.isUndefined(f)){if(!Ve.isUndefined(c))return o(void 0,c,d)}else return o(c,f,d)}function a(c,f){if(!Ve.isUndefined(f))return o(void 0,f)}function l(c,f){if(Ve.isUndefined(f)){if(!Ve.isUndefined(c))return o(void 0,c)}else return o(void 0,f)}function s(c,f,d){if(d in t)return o(c,f);if(d in e)return o(void 0,c)}const u={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s,headers:(c,f)=>r(p4(c),p4(f),!0)};return Ve.forEach(Object.keys(Object.assign({},e,t)),function(f){const d=u[f]||r,p=d(e[f],t[f],f);Ve.isUndefined(p)&&d!==s||(n[f]=p)}),n}const xb="1.6.8",sv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sv[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const v4={};sv.transitional=function(t,n,o){function r(a,l){return"[Axios v"+xb+"] Transitional option '"+a+"'"+l+(o?". "+o:"")}return(a,l,s)=>{if(t===!1)throw new Rt(r(l," has been removed"+(n?" in "+n:"")),Rt.ERR_DEPRECATED);return n&&!v4[l]&&(v4[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,l,s):!0}};function bce(e,t,n){if(typeof e!="object")throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const a=o[r],l=t[a];if(l){const s=e[a],u=s===void 0||l(s,a,e);if(u!==!0)throw new Rt("option "+a+" must be "+u,Rt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Rt("Unknown option "+a,Rt.ERR_BAD_OPTION)}}const K0={assertOptions:bce,validators:sv},kr=K0.validators;class mc{constructor(t){this.defaults=t,this.interceptors={request:new i4,response:new i4}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const a=r.stack?r.stack.replace(/^.+\n/,""):"";o.stack?a&&!String(o.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(o.stack+=` -`+a):o.stack=a}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Hl(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:a}=n;o!==void 0&&K0.assertOptions(o,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1),r!=null&&(Ve.isFunction(r)?n.paramsSerializer={serialize:r}:K0.assertOptions(r,{encode:kr.function,serialize:kr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&Ve.merge(a.common,a[n.method]);a&&Ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=or.concat(l,a);const s=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let f,d=0,p;if(!u){const m=[f4.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),p=m.length,f=Promise.resolve(n);d{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](r);o._listeners=null}),this.promise.then=r=>{let a;const l=new Promise(s=>{o.subscribe(s),a=s}).then(r);return l.cancel=function(){o.unsubscribe(a)},l},t(function(a,l,s){o.reason||(o.reason=new $i(a,l,s),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new iv(function(r){t=r}),cancel:t}}}const wce=iv;function Cce(e){return function(n){return e.apply(null,n)}}function Sce(e){return Ve.isObject(e)&&e.isAxiosError===!0}const W0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(W0).forEach(([e,t])=>{W0[t]=e});const kce=W0;function Mb(e){const t=new Bu(e),n=sb(Bu.prototype.request,t);return Ve.extend(n,Bu.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mb(Hl(e,r))},n}const sn=Mb(lv);sn.Axios=Bu;sn.CanceledError=$i;sn.CancelToken=wce;sn.isCancel=Sb;sn.VERSION=xb;sn.toFormData=pd;sn.AxiosError=Rt;sn.Cancel=sn.CanceledError;sn.all=function(t){return Promise.all(t)};sn.spread=Cce;sn.isAxiosError=Sce;sn.mergeConfig=Hl;sn.AxiosHeaders=or;sn.formToJSON=e=>Cb(Ve.isHTMLForm(e)?new FormData(e):e);sn.getAdapter=Eb.getAdapter;sn.HttpStatusCode=kce;sn.default=sn;const Ti=sn.create({baseURL:"https://crmeb-test.shop.lihaink.cn/api",timeout:1e4});Ti.interceptors.request.use(e=>{const t=localStorage.getItem("Token");return t&&(e.headers["X-Token"]="Bearer "+t),e},e=>(console.error(e),Promise.reject(e)));Ti.interceptors.response.use(e=>{if((e.data.status===401||e.data.status===4e4)&&(Ms({message:e.data.message,type:"error"}),setTimeout(()=>{const t=nv();t.setUserInfo({}),t.setToken(""),Tb.push("/login")},700)),e.data.status===400)throw Ms({message:e.data.message,type:"error"}),new Error(e.data.message);return e.data},e=>{var t,n;return console.error(e),Ms({message:((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.message)||e,type:"error"}),Promise.reject(e)});function Xce(e){return Ti.post("auth/login",e)}function Jce(e){return Ti.get("user",e)}function Ece(){return Ti.post("logout")}const uv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xce=e=>(W4("data-v-28f3f43a"),e=e(),j4(),e),Mce={class:"my-card"},$ce={class:"card-header"},Tce=xce(()=>k("div",{class:"card-title"},"里海收银系统",-1)),Oce={class:"card-body"},Ace={class:"el-dropdown-link"},Nce={class:"info"},Rce={style:{"margin-left":"0.3rem"}},Ice={__name:"myHeader",setup(e){const t=nv(),n=P({});n.value=t.userInfo.mer_info;const o=P({});o.value=t.userInfo.service;const r=nb(),a=()=>{Ece().then(()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")}).catch(()=>{Ms({message:"退出失败",type:"error"})})};return(l,s)=>{const u=Ze("el-image"),c=Ze("el-avatar"),f=Ze("arrow-down"),d=Ze("el-icon"),p=Ze("el-dropdown-item"),h=Ze("el-dropdown-menu"),m=Ze("el-dropdown");return _(),M("div",Mce,[k("div",$ce,[W(u,{style:{height:"3rem",width:"3rem"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56a52202404051428413664.png"}),Tce]),k("div",Oce,[W(m,{trigger:"hover"},{dropdown:J(()=>[W(h,null,{default:J(()=>[W(p,{onClick:a},{default:J(()=>[gt("退出登录")]),_:1})]),_:1})]),default:J(()=>[k("div",Ace,[W(c,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",Nce,[k("div",null,[gt(Te(o.value.nickname)+" ",1),k("span",Rce,"("+Te(n.value.company_name||n.value.mer_name)+")",1)]),k("div",null,Te(i(t).userInfo.account),1)]),W(d,{class:"el-icon--right"},{default:J(()=>[W(f)]),_:1})])]),_:1})])])}}},Pce=uv(Ice,[["__scopeId","data-v-28f3f43a"]]),cv=e=>(W4("data-v-60ad4a9d"),e=e(),j4(),e),Lce={class:"my-card"},Vce=cv(()=>k("div",null,"收银",-1)),Bce=cv(()=>k("div",null,"订单",-1)),zce=cv(()=>k("div",null,"商品",-1)),Hce={__name:"myAside",setup(e){const t=nb(),n=eue(),o=r=>{t.push({name:r})};return(r,a)=>{const l=Ze("Sell"),s=Ze("el-icon"),u=Ze("DataLine"),c=Ze("ShoppingBag");return _(),M("div",Lce,[k("div",{class:T(["list-item",{active:i(n).name=="home"}]),onClick:a[0]||(a[0]=f=>o("home"))},[W(s,{size:"30"},{default:J(()=>[W(l)]),_:1}),Vce],2),k("div",{class:T(["list-item",{active:i(n).name=="order"}]),onClick:a[1]||(a[1]=f=>o("order"))},[W(s,{size:"30"},{default:J(()=>[W(u)]),_:1}),Bce],2),k("div",{class:T(["list-item",{active:i(n).name=="shop"}]),onClick:a[2]||(a[2]=f=>o("shop"))},[W(s,{size:"30"},{default:J(()=>[W(c)]),_:1}),zce],2)])}}},Dce=uv(Hce,[["__scopeId","data-v-60ad4a9d"]]),Fce={class:"common-layout"},Kce={__name:"index",setup(e){return(t,n)=>{const o=Ze("el-header"),r=Ze("el-aside"),a=Ze("router-view"),l=Ze("el-main"),s=Ze("el-container");return _(),M("div",Fce,[W(s,null,{default:J(()=>[W(o,null,{default:J(()=>[W(Pce)]),_:1}),W(s,null,{default:J(()=>[W(r,{width:"100px"},{default:J(()=>[W(Dce)]),_:1}),W(l,null,{default:J(()=>[W(tn,{name:"el-zoom-in-top"},{default:J(()=>[W(a,{class:"my-main"})]),_:1})]),_:1})]),_:1})]),_:1})])}}},Wce=uv(Kce,[["__scopeId","data-v-e3e48466"]]),jce=[{path:"/",name:"layout",component:Wce,redirect:"/home",children:[{path:"/home",name:"home",component:()=>Qa(()=>import("./index-Z_K2cVrU.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)},{path:"/order",name:"order",component:()=>Qa(()=>import("./index-iV8fzPz2.js"),__vite__mapDeps([6,1,2,3,7]),import.meta.url)},{path:"/orderList",name:"orderList",component:()=>Qa(()=>import("./indexList-D9DvhVcr.js"),__vite__mapDeps([8,1,2,9]),import.meta.url)},{path:"/shop",name:"shop",component:()=>Qa(()=>import("./index-Cca88OL5.js"),__vite__mapDeps([10,4,11]),import.meta.url)}]},{path:"/login",name:"login",component:()=>Qa(()=>import("./index-jT1k3vKv.js"),__vite__mapDeps([12,13]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>Qa(()=>import("./index-DNUHgsQd.js"),__vite__mapDeps([]),import.meta.url)}],$b=Zie({history:Mie(),routes:jce});$b.beforeEach((e,t,n)=>{const o=nv();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Tb=$b,Oi=Tg(J5);for(const[e,t]of Object.entries(xL))Oi.component(e,t);const qce=nue();Oi.use(Tb);Oi.use(qce);Oi.use(qse,{locale:Use});Oi.mount("#app");export{Jce as A,Ms as E,Ke as F,uv as _,Ze as a,k as b,le as c,W as d,gt as e,M as f,ht as g,kc as h,Mt as i,et as j,ne as k,j4 as l,rr as m,T as n,_ as o,W4 as p,nb as q,P as r,Ti as s,Te as t,nv as u,S as v,J as w,We as x,tt as y,Xce as z}; +`+a):o.stack=a}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Hl(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:a}=n;o!==void 0&&K0.assertOptions(o,{silentJSONParsing:kr.transitional(kr.boolean),forcedJSONParsing:kr.transitional(kr.boolean),clarifyTimeoutError:kr.transitional(kr.boolean)},!1),r!=null&&(Ve.isFunction(r)?n.paramsSerializer={serialize:r}:K0.assertOptions(r,{encode:kr.function,serialize:kr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&Ve.merge(a.common,a[n.method]);a&&Ve.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=or.concat(l,a);const s=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let f,d=0,p;if(!u){const m=[f4.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),p=m.length,f=Promise.resolve(n);d{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](r);o._listeners=null}),this.promise.then=r=>{let a;const l=new Promise(s=>{o.subscribe(s),a=s}).then(r);return l.cancel=function(){o.unsubscribe(a)},l},t(function(a,l,s){o.reason||(o.reason=new $i(a,l,s),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new iv(function(r){t=r}),cancel:t}}}const wce=iv;function Cce(e){return function(n){return e.apply(null,n)}}function Sce(e){return Ve.isObject(e)&&e.isAxiosError===!0}const W0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(W0).forEach(([e,t])=>{W0[t]=e});const kce=W0;function Mb(e){const t=new Bu(e),n=sb(Bu.prototype.request,t);return Ve.extend(n,Bu.prototype,t,{allOwnKeys:!0}),Ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mb(Hl(e,r))},n}const sn=Mb(lv);sn.Axios=Bu;sn.CanceledError=$i;sn.CancelToken=wce;sn.isCancel=Sb;sn.VERSION=xb;sn.toFormData=pd;sn.AxiosError=Rt;sn.Cancel=sn.CanceledError;sn.all=function(t){return Promise.all(t)};sn.spread=Cce;sn.isAxiosError=Sce;sn.mergeConfig=Hl;sn.AxiosHeaders=or;sn.formToJSON=e=>Cb(Ve.isHTMLForm(e)?new FormData(e):e);sn.getAdapter=Eb.getAdapter;sn.HttpStatusCode=kce;sn.default=sn;const Ti=sn.create({baseURL:"https://crmeb-test.shop.lihaink.cn/api",timeout:1e4});Ti.interceptors.request.use(e=>{const t=localStorage.getItem("Token");return t&&(e.headers["X-Token"]="Bearer "+t),e},e=>(console.error(e),Promise.reject(e)));Ti.interceptors.response.use(e=>{if((e.data.status===401||e.data.status===4e4)&&(Ms({message:e.data.message,type:"error"}),setTimeout(()=>{const t=nv();t.setUserInfo({}),t.setToken(""),Tb.push("/login")},700)),e.data.status===400)throw Ms({message:e.data.message,type:"error"}),new Error(e.data.message);return e.data},e=>{var t,n;return console.error(e),Ms({message:((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.message)||e,type:"error"}),Promise.reject(e)});function Xce(e){return Ti.post("auth/login",e)}function Jce(e){return Ti.get("user",e)}function Ece(){return Ti.post("logout")}const uv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xce=e=>(W4("data-v-28f3f43a"),e=e(),j4(),e),Mce={class:"my-card"},$ce={class:"card-header"},Tce=xce(()=>k("div",{class:"card-title"},"里海收银系统",-1)),Oce={class:"card-body"},Ace={class:"el-dropdown-link"},Nce={class:"info"},Rce={style:{"margin-left":"0.3rem"}},Ice={__name:"myHeader",setup(e){const t=nv(),n=P({});n.value=t.userInfo.mer_info;const o=P({});o.value=t.userInfo.service;const r=nb(),a=()=>{Ece().then(()=>{t.setUserInfo({}),t.setToken(""),r.push("/login")}).catch(()=>{Ms({message:"退出失败",type:"error"})})};return(l,s)=>{const u=Ze("el-image"),c=Ze("el-avatar"),f=Ze("arrow-down"),d=Ze("el-icon"),p=Ze("el-dropdown-item"),h=Ze("el-dropdown-menu"),m=Ze("el-dropdown");return _(),M("div",Mce,[k("div",$ce,[W(u,{style:{height:"3rem",width:"3rem"},src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56a52202404051428413664.png"}),Tce]),k("div",Oce,[W(m,{trigger:"hover"},{dropdown:J(()=>[W(h,null,{default:J(()=>[W(p,{onClick:a},{default:J(()=>[gt("退出登录")]),_:1})]),_:1})]),default:J(()=>[k("div",Ace,[W(c,{src:o.value.avatar,icon:"user-filled"},null,8,["src"]),k("div",Nce,[k("div",null,[gt(Te(o.value.nickname)+" ",1),k("span",Rce,"("+Te(n.value.company_name||n.value.mer_name)+")",1)]),k("div",null,Te(i(t).userInfo.account),1)]),W(d,{class:"el-icon--right"},{default:J(()=>[W(f)]),_:1})])]),_:1})])])}}},Pce=uv(Ice,[["__scopeId","data-v-28f3f43a"]]),cv=e=>(W4("data-v-60ad4a9d"),e=e(),j4(),e),Lce={class:"my-card"},Vce=cv(()=>k("div",null,"收银",-1)),Bce=cv(()=>k("div",null,"订单",-1)),zce=cv(()=>k("div",null,"商品",-1)),Hce={__name:"myAside",setup(e){const t=nb(),n=eue(),o=r=>{t.push({name:r})};return(r,a)=>{const l=Ze("Sell"),s=Ze("el-icon"),u=Ze("DataLine"),c=Ze("ShoppingBag");return _(),M("div",Lce,[k("div",{class:T(["list-item",{active:i(n).name=="home"}]),onClick:a[0]||(a[0]=f=>o("home"))},[W(s,{size:"30"},{default:J(()=>[W(l)]),_:1}),Vce],2),k("div",{class:T(["list-item",{active:i(n).name=="order"}]),onClick:a[1]||(a[1]=f=>o("order"))},[W(s,{size:"30"},{default:J(()=>[W(u)]),_:1}),Bce],2),k("div",{class:T(["list-item",{active:i(n).name=="shop"}]),onClick:a[2]||(a[2]=f=>o("shop"))},[W(s,{size:"30"},{default:J(()=>[W(c)]),_:1}),zce],2)])}}},Dce=uv(Hce,[["__scopeId","data-v-60ad4a9d"]]),Fce={class:"common-layout"},Kce={__name:"index",setup(e){return(t,n)=>{const o=Ze("el-header"),r=Ze("el-aside"),a=Ze("router-view"),l=Ze("el-main"),s=Ze("el-container");return _(),M("div",Fce,[W(s,null,{default:J(()=>[W(o,null,{default:J(()=>[W(Pce)]),_:1}),W(s,null,{default:J(()=>[W(r,{width:"100px"},{default:J(()=>[W(Dce)]),_:1}),W(l,null,{default:J(()=>[W(tn,{name:"el-zoom-in-top"},{default:J(()=>[W(a,{class:"my-main"})]),_:1})]),_:1})]),_:1})]),_:1})])}}},Wce=uv(Kce,[["__scopeId","data-v-e3e48466"]]),jce=[{path:"/",name:"layout",component:Wce,redirect:"/home",children:[{path:"/home",name:"home",component:()=>Qa(()=>import("./index-pfZ9bSaD.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)},{path:"/order",name:"order",component:()=>Qa(()=>import("./index-CxjVX3eh.js"),__vite__mapDeps([6,1,2,3,7]),import.meta.url)},{path:"/orderList",name:"orderList",component:()=>Qa(()=>import("./indexList-Df9NBcZl.js"),__vite__mapDeps([8,1,2,9]),import.meta.url)},{path:"/shop",name:"shop",component:()=>Qa(()=>import("./index-CngFHFdP.js"),__vite__mapDeps([10,4,11]),import.meta.url)}]},{path:"/login",name:"login",component:()=>Qa(()=>import("./index-D5zoeOLt.js"),__vite__mapDeps([12,13]),import.meta.url)},{path:"/:catchAll(.*)",name:"notFound",component:()=>Qa(()=>import("./index-DSzheXJO.js"),__vite__mapDeps([]),import.meta.url)}],$b=Zie({history:Mie(),routes:jce});$b.beforeEach((e,t,n)=>{const o=nv();e.name!=="login"&&!o.Token?n({name:"login"}):n()});const Tb=$b,Oi=Tg(J5);for(const[e,t]of Object.entries(xL))Oi.component(e,t);const qce=nue();Oi.use(Tb);Oi.use(qce);Oi.use(qse,{locale:Use});Oi.mount("#app");export{Jce as A,Ms as E,Ke as F,uv as _,Ze as a,k as b,le as c,W as d,gt as e,M as f,ht as g,kc as h,Mt as i,et as j,ne as k,j4 as l,rr as m,T as n,_ as o,W4 as p,nb as q,P as r,Ti as s,Te as t,nv as u,S as v,J as w,We as x,tt as y,Xce as z}; diff --git a/dist/assets/index-Z_K2cVrU.js b/dist/assets/index-pfZ9bSaD.js similarity index 96% rename from dist/assets/index-Z_K2cVrU.js rename to dist/assets/index-pfZ9bSaD.js index f3a7162..d049f95 100644 --- a/dist/assets/index-Z_K2cVrU.js +++ b/dist/assets/index-pfZ9bSaD.js @@ -1 +1 @@ -import{c as W,a as X,b as B,d as Y,p as Z,o as ee}from"./pay-DGm-hSsT.js";import{_ as U,r as u,a as _,o as g,c as q,w as y,b as e,d as n,e as v,t as V,f as C,F as O,g as M,h as j,i as te,j as G,k as J,p as K,l as T,m as oe,n as se,u as ae}from"./index-B3GfFMCJ.js";import{p as le}from"./padding-D1D9f_t3.js";import{g as ne,s as ce}from"./shop-Dt7yZjfV.js";const ie={class:"price"},re={class:"flex"},ue={style:{margin:"10px","padding-bottom":"40px"}},de={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},_e={class:"dialog-footer"},pe={__name:"price",emits:["submit"],setup(w,{expose:x,emit:m}){const s=u(!1),r=u(0),o=(b,p=0)=>{s.value=b,r.value=p},c=u({nowPrice:"",percentage:""}),h=b=>{c.value.percentage=(b/r.value*100).toFixed(2)},$=b=>{c.value.nowPrice=(r.value*b/100).toFixed(2)},k=m,S=()=>{k("submit",c.value.nowPrice),s.value=!1};return x({show:o}),(b,p)=>{const A=_("el-input"),f=_("el-button"),I=_("el-dialog");return g(),q(I,{modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=a=>s.value=a),title:"订单改价",width:"650"},{footer:y(()=>[e("div",_e,[n(f,{class:"ok-btn",type:"primary",onClick:S},{default:y(()=>[v(" 确定 ")]),_:1})])]),default:y(()=>[e("div",ie,[e("div",re,[n(A,{style:{flex:"3",margin:"10px",height:"2.5rem"},modelValue:c.value.nowPrice,"onUpdate:modelValue":p[0]||(p[0]=a=>c.value.nowPrice=a),placeholder:"请输入改价后的价格",onInput:h},{suffix:y(()=>[v("元")]),_:1},8,["modelValue"]),n(A,{style:{flex:"2",margin:"10px",height:"2.5rem"},modelValue:c.value.percentage,"onUpdate:modelValue":p[1]||(p[1]=a=>c.value.percentage=a),placeholder:"请输入比例",onInput:$},{suffix:y(()=>[v("%")]),_:1},8,["modelValue"])]),e("div",ue,[v("改价后金额: "),e("span",de,"¥"+V(c.value.nowPrice||r.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},ve=U(pe,[["__scopeId","data-v-518d9bc5"]]),me={class:"my-order"},he={class:"header-nav"},fe={class:"nav-item"},ge={class:"order-list"},ye={class:"order-item-info"},ke={class:"order-item-title"},be={class:"title"},$e=["onClick"],we={class:"order-item-sku"},xe=["onClick"],Ie={class:"order-item-price"},Ve={class:"order-footer"},Ce={class:"order-total"},Ae={class:"price"},Pe={class:"total-item"},Se={style:{"font-size":"1.4rem"}},Le={class:"total-item"},Fe={class:"update-price"},De={class:"order-btn"},Re={__name:"order",emits:["goPay","editAttr"],setup(w,{expose:x,emit:m}){const s=u([]),r=u(0),o=u(0),c=()=>{let l=[];s.value.map(t=>{l.push(t.cart_id)}),l.length!=0&&$(l)},h=l=>{s.value=s.value.filter(t=>t.cart_id!=l),$([l])},$=l=>{W({cart_id:l}).then(t=>{console.log(t),k()})},k=()=>{r.value=0,o.value=0,X({source:300}).then(l=>{var t,i;((i=(t=l.data)==null?void 0:t.list)==null?void 0:i.length)>0?(s.value=l.data.list[0].list,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})):s.value=[]})};k();const S=m,b=()=>{S("goPay")},p=(l,t)=>{B(l.cart_id,{cart_num:l.cart_num}).then(i=>{r.value=0,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})})},A=l=>{S("editPupop",l)},f=(l,t)=>{B(l,t).then(i=>{k()})},I=l=>{o.value=r.value-l,r.value=+l};u(0);const a=u(null),D=()=>{a.value.show(!0,r.value)};return x({getList:k,list:s,editItem:f,discounts:o,allPrice:r}),(l,t)=>{const i=_("Delete"),d=_("el-icon"),F=_("el-empty"),R=_("el-image"),L=_("ArrowDown"),E=_("el-input-number"),N=_("el-button");return g(),C("div",me,[e("div",he,[e("div",fe,[v(" 已选购 "),e("span",null,V(s.value.length),1),v(" 件 ")]),e("div",{class:"nav-item-clear",onClick:c},[n(d,null,{default:y(()=>[n(i)]),_:1}),v("清空 ")])]),e("div",ge,[s.value.length==0?(g(),q(F,{key:0,description:"请点击右侧添加商品"})):(g(!0),C(O,{key:1},M(s.value,(P,Q)=>(g(),C("div",{class:"order-item",key:Q},[n(R,{loading:"lazy",class:"order-item-img",src:P.productAttr&&P.productAttr.image||P.product.image},null,8,["src"]),e("div",ye,[e("div",ke,[e("div",be,V(P.spu.store_name),1),e("div",{class:"delete",onClick:z=>h(P.cart_id)},"删除",8,$e)]),e("div",we,[e("span",{style:{display:"flex","align-items":"center"},onClick:z=>A(P)},[v("商品规格: "+V(P.productAttr.sku||"默认规格"),1),n(d,{size:"16",style:{"margin-left":"0.2rem"}},{default:y(()=>[n(L)]),_:1})],8,xe)]),e("div",Ie,[e("div",null,[v(" ¥"),e("span",null,V(P.productAttr.price),1)]),e("div",null,[n(E,{modelValue:P.cart_num,"onUpdate:modelValue":z=>P.cart_num=z,"step-strictly":"",min:1,step:1,onChange:z=>p(P)},null,8,["modelValue","onUpdate:modelValue","onChange"])])])])]))),128))]),e("div",Ve,[e("div",Ce,[e("div",Ae,[e("div",Pe,[v(" 实付: "),e("span",null,[v("¥"),e("span",Se,V(r.value.toFixed(2)),1)])]),e("div",Le,[v(" 优惠: "),e("span",null,[v("¥"),e("span",null,V(o.value.toFixed(2)),1)])])]),e("div",Fe,[n(N,{class:"btn",type:"primary",onClick:D},{default:y(()=>[v("改价")]),_:1})])]),e("div",De,[n(N,{class:"btn",type:"primary",onClick:b,disabled:s.value.length==0},{default:y(()=>[v("立即结账")]),_:1},8,["disabled"])])]),n(ve,{ref_key:"priceRef",ref:a,onSubmit:I},null,512)])}}},ze=U(Re,[["__scopeId","data-v-19078e04"]]),H=w=>(K("data-v-f3cb5c55"),w=w(),T(),w),Ue={class:"my-order"},Ee={class:"header-nav"},Ne=H(()=>e("div",{class:"nav-item-label"},"搜索",-1)),qe={class:"nav-item-input"},Oe={class:"shop-list","infinite-scroll-distance":"100","infinite-scroll-delay":"500",style:{overflow:"auto"}},Me=["onClick"],Be={class:"shop-name"},je={class:"shop-price"},Ge={key:0,class:"no-stock"},Je=H(()=>e("div",null,[e("span",null,"暂无"),e("span",null,"库存")],-1)),Ke=[Je],Te={__name:"shop",props:{storeList:{type:Array,default:()=>[]}},emits:["getStoreList","changeItem","loadMore"],setup(w,{emit:x}){const m=x,s=u(""),r=()=>{m("loadMore",{bar_code:s.value})},o=h=>{m("changeItem",h)},c=()=>{m("getStoreList",{bar_code:s.value})};return(h,$)=>{const k=_("el-input"),S=_("Search"),b=_("el-icon"),p=_("el-button"),A=_("el-image"),f=_("el-space"),I=j("infinite-scroll");return g(),C("div",Ue,[e("div",Ee,[Ne,e("div",qe,[n(k,{modelValue:s.value,"onUpdate:modelValue":$[0]||($[0]=a=>s.value=a),placeholder:"搜索商品名称/ID/唯一码或点击聚焦扫码",clearable:"",onKeyup:te(c,["enter"])},null,8,["modelValue"])]),e("div",{class:"nav-item-btn",onClick:c},[n(p,{class:"btn",type:"primary"},{default:y(()=>[n(b,null,{default:y(()=>[n(S)]),_:1})]),_:1})])]),G((g(),C("div",Oe,[n(f,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(w.storeList,(a,D)=>(g(),C("div",{class:"shop-item",key:D,onClick:l=>o(a)},[n(A,{loading:"lazy",src:a.image},null,8,["src"]),e("div",Be,V(a.store_name),1),e("div",je,[v(" ¥"),e("span",null,V(a.price),1)]),a.stock==0?(g(),C("div",Ge,Ke)):J("",!0)],8,Me))),128))]),_:1})])),[[I,r]])])}}},He=U(Te,[["__scopeId","data-v-f3cb5c55"]]),Qe=w=>(K("data-v-9ba07525"),w=w(),T(),w),We={class:"shop"},Xe={key:0,class:"shop-info"},Ye={class:"shop-info-left"},Ze={class:"shop-info-right"},et={class:"shop-info-right-top"},tt={class:"shop-info-right-center"},ot={class:"shop-info-right-price"},st={class:"shop-sku"},at=Qe(()=>e("div",{class:"title"},"产品",-1)),lt={class:"sku"},nt=["onClick"],ct={class:"dialog-footer"},it={__name:"pupop",emits:["changeItem"],setup(w,{expose:x,emit:m}){const s=u(!1),r=f=>{s.value=f},o=u({}),c=u(null),h=u(!1),$=u("add"),k=u({}),S=(f,I="add")=>{$.value=I,I=="add"?(o.value=f,c.value=f.attr[0]):(h.value=!0,k.value=f,ne(f.product_id).then(a=>{a.data.attrValue=JSON.parse(JSON.stringify(a.data.attr)),a.data.attr=Object.keys(a.data.sku),o.value=a.data,c.value=a.data.attr[0],h.value=!1}).catch(a=>{h.value=!1}))},b=m,p=()=>{$.value=="add"?b("changeItem",o.value,c.value):b("editItem",k.value.cart_id,{cart_num:k.value.cart_num,product_attr_unique:o.value.sku[c.value].unique}),s.value=!1},A=f=>{c.value=f};return x({show:r,setForm:S}),(f,I)=>{const a=_("el-image"),D=_("el-space"),l=_("el-button"),t=_("el-dialog"),i=j("loading");return g(),q(t,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=d=>s.value=d),title:"商品规格",width:"650"},oe({default:y(()=>{var d,F,R;return[G((g(),C("div",We,[o.value.sku?(g(),C("div",Xe,[e("div",Ye,[n(a,{loading:"lazy",src:((d=o.value.sku[c.value])==null?void 0:d.image)||o.value.image},null,8,["src"])]),e("div",Ze,[e("div",et,V(o.value.store_name),1),e("div",tt,"库存"+V(((F=o.value.sku[c.value])==null?void 0:F.stock)||0),1),e("div",ot,[v("¥"),e("span",null,V(((R=o.value.sku[c.value])==null?void 0:R.price)||o.value.price),1)])])])):J("",!0),e("div",st,[at,e("div",lt,[n(D,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(o.value.attr,(L,E)=>(g(),C("div",{class:se(["sku-item",{"sku-item_active":c.value==L}]),onClick:N=>A(L),key:E},V(L||"默认规格"),11,nt))),128))]),_:1})])])])),[[i,h.value]])]}),_:2},[$.value!="add"&&o.value.attr&&o.value.attr.length==1?void 0:{name:"footer",fn:y(()=>[e("div",ct,[n(l,{class:"ok-btn",type:"primary",onClick:p},{default:y(()=>[v(" 确定 ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},rt=U(it,[["__scopeId","data-v-9ba07525"]]),ut={class:"my-card"},mt={__name:"index",setup(w){const x=u(null),m=u(null),s=u(null),r=u(null),o=u([]),c=ae(),h=u({page:0,limit:30}),$=t=>{h.value={source:300,...h.value,...t},ce(c.userInfo.service.mer_id,h.value).then(i=>{var F,R;((R=(F=i.data)==null?void 0:F.list)==null?void 0:R.length)(L.attr=Object.keys(L.sku),L));o.value=o.value.concat(d),t.bar_code&&o.value.length==1&&b(t.bar_code)&&p(o.value[0],o.value[0].attr[0])})},k=u(!1),S=t=>{k.value||(h.value.page++,$(t))};function b(t){return/^\d+$/.test(t)}const p=(t,i="")=>{let d={is_new:0,product_id:t.product_id,cart_num:1,product_attr_unique:t.sku[i]!==void 0?t.sku[i].unique:"",source:300,product_type:0};Y(d).then(F=>{m.value.getList()})},A=(t,i)=>{if(!t.attr||t.attr.length==0||t.attr.length==1)return p(t,t.attr[0]?t.attr[0]:"");if(i)return p(t,i);x.value.setForm(t,"add"),x.value.show(!0)},f=(t,i)=>{m.value.editItem(t,i)},I=t=>{x.value.setForm(t,"edit"),x.value.show(!0)},a=()=>{let t=m.value.list.map(d=>d.cart_id),i={takes:[],use_coupon:{},use_integral:!1,cart_id:t};m.value.discounts>0&&(i.deduction_price=m.value.discounts.toFixed(2),i.pay_type="micropay"),ee(i).then(d=>{r.value.setForm({data:d.data,cart_id:t})})},D=()=>{a(),r.value.drawer=!0},l=()=>{m.value.getList()};return(t,i)=>(g(),C("div",ut,[n(ze,{ref_key:"orderRef",ref:m,onGoPay:D,onEditPupop:I},null,512),n(le),n(He,{ref_key:"shopRef",ref:s,style:{flex:"1"},storeList:o.value,onGetStoreList:$,onChangeItem:A,onLoadMore:S},null,8,["storeList"]),n(rt,{ref_key:"pupopRef",ref:x,onChangeItem:A,onEditItem:f},null,512),n(Z,{ref_key:"payRef",ref:r,onPaySuccess:l},null,512)]))}};export{mt as default}; +import{c as W,a as X,b as B,d as Y,p as Z,o as ee}from"./pay-Bkl34wIu.js";import{_ as U,r as u,a as _,o as g,c as q,w as y,b as e,d as n,e as v,t as V,f as C,F as O,g as M,h as j,i as te,j as G,k as J,p as K,l as T,m as oe,n as se,u as ae}from"./index-Dqrpap1c.js";import{p as le}from"./padding-DBM1TjbB.js";import{g as ne,s as ce}from"./shop-CVNajSlv.js";const ie={class:"price"},re={class:"flex"},ue={style:{margin:"10px","padding-bottom":"40px"}},de={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},_e={class:"dialog-footer"},pe={__name:"price",emits:["submit"],setup(w,{expose:x,emit:m}){const s=u(!1),r=u(0),o=(b,p=0)=>{s.value=b,r.value=p},c=u({nowPrice:"",percentage:""}),h=b=>{c.value.percentage=(b/r.value*100).toFixed(2)},$=b=>{c.value.nowPrice=(r.value*b/100).toFixed(2)},k=m,S=()=>{k("submit",c.value.nowPrice),s.value=!1};return x({show:o}),(b,p)=>{const A=_("el-input"),f=_("el-button"),I=_("el-dialog");return g(),q(I,{modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=a=>s.value=a),title:"订单改价",width:"650"},{footer:y(()=>[e("div",_e,[n(f,{class:"ok-btn",type:"primary",onClick:S},{default:y(()=>[v(" 确定 ")]),_:1})])]),default:y(()=>[e("div",ie,[e("div",re,[n(A,{style:{flex:"3",margin:"10px",height:"2.5rem"},modelValue:c.value.nowPrice,"onUpdate:modelValue":p[0]||(p[0]=a=>c.value.nowPrice=a),placeholder:"请输入改价后的价格",onInput:h},{suffix:y(()=>[v("元")]),_:1},8,["modelValue"]),n(A,{style:{flex:"2",margin:"10px",height:"2.5rem"},modelValue:c.value.percentage,"onUpdate:modelValue":p[1]||(p[1]=a=>c.value.percentage=a),placeholder:"请输入比例",onInput:$},{suffix:y(()=>[v("%")]),_:1},8,["modelValue"])]),e("div",ue,[v("改价后金额: "),e("span",de,"¥"+V(c.value.nowPrice||r.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},ve=U(pe,[["__scopeId","data-v-518d9bc5"]]),me={class:"my-order"},he={class:"header-nav"},fe={class:"nav-item"},ge={class:"order-list"},ye={class:"order-item-info"},ke={class:"order-item-title"},be={class:"title"},$e=["onClick"],we={class:"order-item-sku"},xe=["onClick"],Ie={class:"order-item-price"},Ve={class:"order-footer"},Ce={class:"order-total"},Ae={class:"price"},Pe={class:"total-item"},Se={style:{"font-size":"1.4rem"}},Le={class:"total-item"},Fe={class:"update-price"},De={class:"order-btn"},Re={__name:"order",emits:["goPay","editAttr"],setup(w,{expose:x,emit:m}){const s=u([]),r=u(0),o=u(0),c=()=>{let l=[];s.value.map(t=>{l.push(t.cart_id)}),l.length!=0&&$(l)},h=l=>{s.value=s.value.filter(t=>t.cart_id!=l),$([l])},$=l=>{W({cart_id:l}).then(t=>{console.log(t),k()})},k=()=>{r.value=0,o.value=0,X({source:300}).then(l=>{var t,i;((i=(t=l.data)==null?void 0:t.list)==null?void 0:i.length)>0?(s.value=l.data.list[0].list,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})):s.value=[]})};k();const S=m,b=()=>{S("goPay")},p=(l,t)=>{B(l.cart_id,{cart_num:l.cart_num}).then(i=>{r.value=0,s.value.forEach(d=>{r.value+=d.productAttr.price*d.cart_num})})},A=l=>{S("editPupop",l)},f=(l,t)=>{B(l,t).then(i=>{k()})},I=l=>{o.value=r.value-l,r.value=+l};u(0);const a=u(null),D=()=>{a.value.show(!0,r.value)};return x({getList:k,list:s,editItem:f,discounts:o,allPrice:r}),(l,t)=>{const i=_("Delete"),d=_("el-icon"),F=_("el-empty"),R=_("el-image"),L=_("ArrowDown"),E=_("el-input-number"),N=_("el-button");return g(),C("div",me,[e("div",he,[e("div",fe,[v(" 已选购 "),e("span",null,V(s.value.length),1),v(" 件 ")]),e("div",{class:"nav-item-clear",onClick:c},[n(d,null,{default:y(()=>[n(i)]),_:1}),v("清空 ")])]),e("div",ge,[s.value.length==0?(g(),q(F,{key:0,description:"请点击右侧添加商品"})):(g(!0),C(O,{key:1},M(s.value,(P,Q)=>(g(),C("div",{class:"order-item",key:Q},[n(R,{loading:"lazy",class:"order-item-img",src:P.productAttr&&P.productAttr.image||P.product.image},null,8,["src"]),e("div",ye,[e("div",ke,[e("div",be,V(P.spu.store_name),1),e("div",{class:"delete",onClick:z=>h(P.cart_id)},"删除",8,$e)]),e("div",we,[e("span",{style:{display:"flex","align-items":"center"},onClick:z=>A(P)},[v("商品规格: "+V(P.productAttr.sku||"默认规格"),1),n(d,{size:"16",style:{"margin-left":"0.2rem"}},{default:y(()=>[n(L)]),_:1})],8,xe)]),e("div",Ie,[e("div",null,[v(" ¥"),e("span",null,V(P.productAttr.price),1)]),e("div",null,[n(E,{modelValue:P.cart_num,"onUpdate:modelValue":z=>P.cart_num=z,"step-strictly":"",min:1,step:1,onChange:z=>p(P)},null,8,["modelValue","onUpdate:modelValue","onChange"])])])])]))),128))]),e("div",Ve,[e("div",Ce,[e("div",Ae,[e("div",Pe,[v(" 实付: "),e("span",null,[v("¥"),e("span",Se,V(r.value.toFixed(2)),1)])]),e("div",Le,[v(" 优惠: "),e("span",null,[v("¥"),e("span",null,V(o.value.toFixed(2)),1)])])]),e("div",Fe,[n(N,{class:"btn",type:"primary",onClick:D},{default:y(()=>[v("改价")]),_:1})])]),e("div",De,[n(N,{class:"btn",type:"primary",onClick:b,disabled:s.value.length==0},{default:y(()=>[v("立即结账")]),_:1},8,["disabled"])])]),n(ve,{ref_key:"priceRef",ref:a,onSubmit:I},null,512)])}}},ze=U(Re,[["__scopeId","data-v-19078e04"]]),H=w=>(K("data-v-f3cb5c55"),w=w(),T(),w),Ue={class:"my-order"},Ee={class:"header-nav"},Ne=H(()=>e("div",{class:"nav-item-label"},"搜索",-1)),qe={class:"nav-item-input"},Oe={class:"shop-list","infinite-scroll-distance":"100","infinite-scroll-delay":"500",style:{overflow:"auto"}},Me=["onClick"],Be={class:"shop-name"},je={class:"shop-price"},Ge={key:0,class:"no-stock"},Je=H(()=>e("div",null,[e("span",null,"暂无"),e("span",null,"库存")],-1)),Ke=[Je],Te={__name:"shop",props:{storeList:{type:Array,default:()=>[]}},emits:["getStoreList","changeItem","loadMore"],setup(w,{emit:x}){const m=x,s=u(""),r=()=>{m("loadMore",{bar_code:s.value})},o=h=>{m("changeItem",h)},c=()=>{m("getStoreList",{bar_code:s.value})};return(h,$)=>{const k=_("el-input"),S=_("Search"),b=_("el-icon"),p=_("el-button"),A=_("el-image"),f=_("el-space"),I=j("infinite-scroll");return g(),C("div",Ue,[e("div",Ee,[Ne,e("div",qe,[n(k,{modelValue:s.value,"onUpdate:modelValue":$[0]||($[0]=a=>s.value=a),placeholder:"搜索商品名称/ID/唯一码或点击聚焦扫码",clearable:"",onKeyup:te(c,["enter"])},null,8,["modelValue"])]),e("div",{class:"nav-item-btn",onClick:c},[n(p,{class:"btn",type:"primary"},{default:y(()=>[n(b,null,{default:y(()=>[n(S)]),_:1})]),_:1})])]),G((g(),C("div",Oe,[n(f,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(w.storeList,(a,D)=>(g(),C("div",{class:"shop-item",key:D,onClick:l=>o(a)},[n(A,{loading:"lazy",src:a.image},null,8,["src"]),e("div",Be,V(a.store_name),1),e("div",je,[v(" ¥"),e("span",null,V(a.price),1)]),a.stock==0?(g(),C("div",Ge,Ke)):J("",!0)],8,Me))),128))]),_:1})])),[[I,r]])])}}},He=U(Te,[["__scopeId","data-v-f3cb5c55"]]),Qe=w=>(K("data-v-9ba07525"),w=w(),T(),w),We={class:"shop"},Xe={key:0,class:"shop-info"},Ye={class:"shop-info-left"},Ze={class:"shop-info-right"},et={class:"shop-info-right-top"},tt={class:"shop-info-right-center"},ot={class:"shop-info-right-price"},st={class:"shop-sku"},at=Qe(()=>e("div",{class:"title"},"产品",-1)),lt={class:"sku"},nt=["onClick"],ct={class:"dialog-footer"},it={__name:"pupop",emits:["changeItem"],setup(w,{expose:x,emit:m}){const s=u(!1),r=f=>{s.value=f},o=u({}),c=u(null),h=u(!1),$=u("add"),k=u({}),S=(f,I="add")=>{$.value=I,I=="add"?(o.value=f,c.value=f.attr[0]):(h.value=!0,k.value=f,ne(f.product_id).then(a=>{a.data.attrValue=JSON.parse(JSON.stringify(a.data.attr)),a.data.attr=Object.keys(a.data.sku),o.value=a.data,c.value=a.data.attr[0],h.value=!1}).catch(a=>{h.value=!1}))},b=m,p=()=>{$.value=="add"?b("changeItem",o.value,c.value):b("editItem",k.value.cart_id,{cart_num:k.value.cart_num,product_attr_unique:o.value.sku[c.value].unique}),s.value=!1},A=f=>{c.value=f};return x({show:r,setForm:S}),(f,I)=>{const a=_("el-image"),D=_("el-space"),l=_("el-button"),t=_("el-dialog"),i=j("loading");return g(),q(t,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=d=>s.value=d),title:"商品规格",width:"650"},oe({default:y(()=>{var d,F,R;return[G((g(),C("div",We,[o.value.sku?(g(),C("div",Xe,[e("div",Ye,[n(a,{loading:"lazy",src:((d=o.value.sku[c.value])==null?void 0:d.image)||o.value.image},null,8,["src"])]),e("div",Ze,[e("div",et,V(o.value.store_name),1),e("div",tt,"库存"+V(((F=o.value.sku[c.value])==null?void 0:F.stock)||0),1),e("div",ot,[v("¥"),e("span",null,V(((R=o.value.sku[c.value])==null?void 0:R.price)||o.value.price),1)])])])):J("",!0),e("div",st,[at,e("div",lt,[n(D,{wrap:"",size:20},{default:y(()=>[(g(!0),C(O,null,M(o.value.attr,(L,E)=>(g(),C("div",{class:se(["sku-item",{"sku-item_active":c.value==L}]),onClick:N=>A(L),key:E},V(L||"默认规格"),11,nt))),128))]),_:1})])])])),[[i,h.value]])]}),_:2},[$.value!="add"&&o.value.attr&&o.value.attr.length==1?void 0:{name:"footer",fn:y(()=>[e("div",ct,[n(l,{class:"ok-btn",type:"primary",onClick:p},{default:y(()=>[v(" 确定 ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},rt=U(it,[["__scopeId","data-v-9ba07525"]]),ut={class:"my-card"},mt={__name:"index",setup(w){const x=u(null),m=u(null),s=u(null),r=u(null),o=u([]),c=ae(),h=u({page:0,limit:30}),$=t=>{h.value={source:300,...h.value,...t},ce(c.userInfo.service.mer_id,h.value).then(i=>{var F,R;((R=(F=i.data)==null?void 0:F.list)==null?void 0:R.length)(L.attr=Object.keys(L.sku),L));o.value=o.value.concat(d),t.bar_code&&o.value.length==1&&b(t.bar_code)&&p(o.value[0],o.value[0].attr[0])})},k=u(!1),S=t=>{k.value||(h.value.page++,$(t))};function b(t){return/^\d+$/.test(t)}const p=(t,i="")=>{let d={is_new:0,product_id:t.product_id,cart_num:1,product_attr_unique:t.sku[i]!==void 0?t.sku[i].unique:"",source:300,product_type:0};Y(d).then(F=>{m.value.getList()})},A=(t,i)=>{if(!t.attr||t.attr.length==0||t.attr.length==1)return p(t,t.attr[0]?t.attr[0]:"");if(i)return p(t,i);x.value.setForm(t,"add"),x.value.show(!0)},f=(t,i)=>{m.value.editItem(t,i)},I=t=>{x.value.setForm(t,"edit"),x.value.show(!0)},a=()=>{let t=m.value.list.map(d=>d.cart_id),i={takes:[],use_coupon:{},use_integral:!1,cart_id:t};m.value.discounts>0&&(i.deduction_price=m.value.discounts.toFixed(2),i.pay_type="micropay"),ee(i).then(d=>{r.value.setForm({data:d.data,cart_id:t})})},D=()=>{a(),r.value.drawer=!0},l=()=>{m.value.getList()};return(t,i)=>(g(),C("div",ut,[n(ze,{ref_key:"orderRef",ref:m,onGoPay:D,onEditPupop:I},null,512),n(le),n(He,{ref_key:"shopRef",ref:s,style:{flex:"1"},storeList:o.value,onGetStoreList:$,onChangeItem:A,onLoadMore:S},null,8,["storeList"]),n(rt,{ref_key:"pupopRef",ref:x,onChangeItem:A,onEditItem:f},null,512),n(Z,{ref_key:"payRef",ref:r,onPaySuccess:l},null,512)]))}};export{mt as default}; diff --git a/dist/assets/indexList-D9DvhVcr.js b/dist/assets/indexList-Df9NBcZl.js similarity index 96% rename from dist/assets/indexList-D9DvhVcr.js rename to dist/assets/indexList-Df9NBcZl.js index 72e978b..f30f1ff 100644 --- a/dist/assets/indexList-D9DvhVcr.js +++ b/dist/assets/indexList-Df9NBcZl.js @@ -1 +1 @@ -import{e as F,a as G,p as J,g as K,f as Q}from"./pay-DGm-hSsT.js";import{_ as W,u as X,r as s,q as Y,a as d,h as Z,j as ee,f as m,d as t,w as o,o as c,e as r,t as te,b as I,c as V,E as h,p as ae,l as oe}from"./index-B3GfFMCJ.js";const le=v=>(ae("data-v-f71c3ce9"),v=v(),oe(),v),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ce=le(()=>I("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ue={class:"dialog-footer"},pe={__name:"indexList",setup(v){const P=X(),k=s([]),C=Y(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),b=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(P.userInfo.service.mer_id,n.value).then(e=>{k.value=e.data.list,b.value=e.data.count,y.value=!1})};i();const w=s(0);(()=>{G({source:300}).then(e=>{var a;w.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},E=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},x=s(""),U=()=>{_.value=!1,Q({order_sn:x.value}).then(e=>{h({message:e.message,type:"success"}),C.push({name:"home"})})},_=s(!1),z=e=>{x.value=e,_.value=!0},O=()=>{C.push({name:"home"})};return(e,a)=>{const L=d("el-radio-button"),T=d("el-radio-group"),u=d("el-table-column"),p=d("el-button"),j=d("el-table"),q=d("el-pagination"),H=d("el-dialog"),M=Z("loading");return ee((c(),m("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(L,{value:1},{default:o(()=>[r("全部")]),_:1}),t(L,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(j,{data:k.value,style:{width:"100%"}},{default:o(()=>[t(u,{prop:"group_order_id",label:"ID",width:"100"}),t(u,{prop:"order_sn",label:"订单号",width:"260"}),t(u,{prop:"total_price",label:"订单金额"}),t(u,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(c(),m("span",ne,"已支付")):(c(),m("span",re,"未支付"))]),_:1}),t(u,{prop:"create_time",label:"订单创建时间"}),t(u,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(c(),m("span",ie,te(l.row.pay_time),1)):(c(),m("div",de,[t(p,{type:"primary",link:"",onClick:S=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>E(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>z(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(q,{"page-size":n.value.limit,layout:"prev, pager, next",total:b.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(H,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[I("div",ue,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),w.value>0?(c(),V(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(c(),V(p,{key:1,type:"primary",onClick:U},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ce]),_:1},8,["modelValue"])])),[[M,y.value]])}}},ge=W(pe,[["__scopeId","data-v-f71c3ce9"]]);export{ge as default}; +import{e as F,a as G,p as J,g as K,f as Q}from"./pay-Bkl34wIu.js";import{_ as W,u as X,r as s,q as Y,a as d,h as Z,j as ee,f as m,d as t,w as o,o as c,e as r,t as te,b as I,c as V,E as h,p as ae,l as oe}from"./index-Dqrpap1c.js";const le=v=>(ae("data-v-f71c3ce9"),v=v(),oe(),v),se={"element-loading-text":"加载中",class:"my-order"},ne={key:0},re={key:1,style:{color:"#ff4a00"}},ie={key:0},de={key:1,class:"flex"},ce=le(()=>I("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),ue={class:"dialog-footer"},pe={__name:"indexList",setup(v){const P=X(),k=s([]),C=Y(),g=s(1),f=s(null),n=s({page:1,limit:20}),y=s(!1),b=s(0),i=()=>{y.value=!0,g.value==1&&(n.value.paid=null),g.value==2&&(n.value.paid=0),F(P.userInfo.service.mer_id,n.value).then(e=>{k.value=e.data.list,b.value=e.data.count,y.value=!1})};i();const w=s(0);(()=>{G({source:300}).then(e=>{var a;w.value=(a=e.data.list)==null?void 0:a.length})})();const A=e=>{n.value.page=1,i()},B=e=>{n.value.page=e,i()},D=e=>{n.value.page=e,i()},N=e=>{n.value.page=e,i()},R=()=>{i()},$=e=>{f.value.setRePay({price:e.pay_price,order_id:e.group_order_id}),f.value.drawer=!0},E=e=>{K({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(h({message:a.message,type:"success"}),i()):h({message:a.message,type:"error"})}).catch(a=>{})},x=s(""),U=()=>{_.value=!1,Q({order_sn:x.value}).then(e=>{h({message:e.message,type:"success"}),C.push({name:"home"})})},_=s(!1),z=e=>{x.value=e,_.value=!0},O=()=>{C.push({name:"home"})};return(e,a)=>{const L=d("el-radio-button"),T=d("el-radio-group"),u=d("el-table-column"),p=d("el-button"),j=d("el-table"),q=d("el-pagination"),H=d("el-dialog"),M=Z("loading");return ee((c(),m("div",se,[t(T,{modelValue:g.value,"onUpdate:modelValue":a[0]||(a[0]=l=>g.value=l),style:{"margin-bottom":"30px"},onChange:A},{default:o(()=>[t(L,{value:1},{default:o(()=>[r("全部")]),_:1}),t(L,{value:2},{default:o(()=>[r("未支付")]),_:1})]),_:1},8,["modelValue"]),t(j,{data:k.value,style:{width:"100%"}},{default:o(()=>[t(u,{prop:"group_order_id",label:"ID",width:"100"}),t(u,{prop:"order_sn",label:"订单号",width:"260"}),t(u,{prop:"total_price",label:"订单金额"}),t(u,{prop:"paid",label:"支付状态"},{default:o(l=>[l.row.paid==1?(c(),m("span",ne,"已支付")):(c(),m("span",re,"未支付"))]),_:1}),t(u,{prop:"create_time",label:"订单创建时间"}),t(u,{prop:"pay_time",label:"订单支付时间"},{default:o(l=>[l.row.pay_time?(c(),m("span",ie,te(l.row.pay_time),1)):(c(),m("div",de,[t(p,{type:"primary",link:"",onClick:S=>$(l.row)},{default:o(()=>[r("重新支付")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>E(l.row.order_sn)},{default:o(()=>[r("检测状态")]),_:2},1032,["onClick"]),t(p,{type:"primary",link:"",onClick:S=>z(l.row.order_sn)},{default:o(()=>[r("提单")]),_:2},1032,["onClick"])]))]),_:1})]),_:1},8,["data"]),t(q,{"page-size":n.value.limit,layout:"prev, pager, next",total:b.value,onPrevClick:B,onNextClick:D,onCurrentChange:N},null,8,["page-size","total"]),t(J,{ref_key:"payRef",ref:f,onPaySuccess:R},null,512),t(H,{modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=l=>_.value=l),title:"提示",width:"500"},{footer:o(()=>[I("div",ue,[t(p,{onClick:a[1]||(a[1]=l=>_.value=!1)},{default:o(()=>[r("取消")]),_:1}),w.value>0?(c(),V(p,{key:0,onClick:O},{default:o(()=>[r(" 前去清空购物车 ")]),_:1})):(c(),V(p,{key:1,type:"primary",onClick:U},{default:o(()=>[r(" 确认提单 ")]),_:1}))])]),default:o(()=>[ce]),_:1},8,["modelValue"])])),[[M,y.value]])}}},ge=W(pe,[["__scopeId","data-v-f71c3ce9"]]);export{ge as default}; diff --git a/dist/assets/padding-D1D9f_t3.js b/dist/assets/padding-DBM1TjbB.js similarity index 65% rename from dist/assets/padding-D1D9f_t3.js rename to dist/assets/padding-DBM1TjbB.js index ff6ffe0..e89de50 100644 --- a/dist/assets/padding-D1D9f_t3.js +++ b/dist/assets/padding-DBM1TjbB.js @@ -1 +1 @@ -import{_ as e,o as t,f as c}from"./index-B3GfFMCJ.js";const o={},n={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",n)}const i=e(o,[["render",s]]);export{i as p}; +import{_ as e,o as t,f as c}from"./index-Dqrpap1c.js";const o={},n={style:{width:"20px",height:"100%"}};function s(r,_){return t(),c("div",n)}const i=e(o,[["render",s]]);export{i as p}; diff --git a/dist/assets/pay-DGm-hSsT.js b/dist/assets/pay-Bkl34wIu.js similarity index 98% rename from dist/assets/pay-DGm-hSsT.js rename to dist/assets/pay-Bkl34wIu.js index d261027..b41243e 100644 --- a/dist/assets/pay-DGm-hSsT.js +++ b/dist/assets/pay-Bkl34wIu.js @@ -1 +1 @@ -import{s as v,_ as le,r as l,v as ne,a as E,h as ce,o as f,c as K,w as m,b as o,n as M,e as L,t as B,j as re,f as b,d as w,i as ue,F as de,g as ie,x as $,E as C,p as ve,l as pe}from"./index-B3GfFMCJ.js";function qe(s){return v.post("user/cart/create",s)}function Oe(s){return v.get("user/cart/lst",{params:s})}function Re(s,p){return v.post(`user/cart/change/${s}`,p)}function Ue(s){return v.post("v2/order/check",s)}function Ke(s){return v.post("user/cart/delete",s)}function G(s){return v.post("v2/order/create",s)}function _e(s,p){return v.post(`order/pay/${s}`,p)}function fe(s){return v.get("micropay_query",{params:s})}function Me(s,p){return v.get(`admin/${s}/order_list`,{params:p})}function Ge(s){return v.get("order_lading",{params:s})}const P=s=>{let p=new window.SpeechSynthesisUtterance(s);window.speechSynthesis.speak(p)},q=s=>(ve("data-v-517a591d"),s=s(),pe(),s),me=q(()=>o("h4",null,"选择支付方式",-1)),ye={class:"dra-body"},ge={class:"header"},he=q(()=>o("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),ke={style:{color:"#f5222d","padding-bottom":"2rem"}},be={style:{"font-size":"1.6rem"}},we={key:0,"element-loading-text":"支付中",class:"card1"},Ce=q(()=>o("div",{class:"tips"},null,-1)),xe={key:1,class:"card2"},Se={class:"drawer-body"},Ae={class:"counter"},Le={class:"received"},Ve={key:0},De={key:1,style:{"font-size":"1rem",color:"#999"}},Ee={key:0,class:"balance"},$e={class:"money"},je={key:1,class:"balance"},Be={class:"keypad"},Pe={class:"left"},Te={class:"right"},ze={style:{width:"100%",display:"flex","justify-content":"center"}},Fe={__name:"pay",emits:["paySuccess"],setup(s,{expose:p,emit:H}){const h=l(!1),k=l(1),_=l(""),y=l(""),J=()=>{A()},Q=()=>{$(()=>{setTimeout(()=>{var e;c.value=!1,_.value="",F.value=!0,(e=y.value)==null||e.focus(),T(k.value)},300)})},T=e=>{k.value=e,k.value==2?document.addEventListener("keydown",N):document.removeEventListener("keydown",N)},x=l({}),z=l([]),W=e=>{x.value=e.data,z.value=e.cart_id},X=e=>{x.value.order_price=e.price,u.value=e.order_id},Y=H,F=l(!1),Z=l(["1","2","3","4","5","6","7","8","9","0","00","."]);let S=0;const u=l(""),ee=()=>{c.value=!0,y.value.blur(),u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"micropay",auth_code:_.value,source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1,$(()=>{var a;(a=y.value)==null||a.focus()})})},O=e=>{let a;k.value==1?a={type:"micropay",auth_code:_.value}:a={type:"cash_payment"},_e(e,a).then(t=>{t.status==200&&t.message=="支付成功"?(h.value=!1,C({message:t.message,type:"success"}),P(t.data.message),A()):(u.value=t.data.group_order_id,V.value=0,S=0,j(t.data.group_order_sn))}).catch(t=>{_.value="",c.value=!1,$(()=>{var g;(g=y.value)==null||g.focus()})})},V=l(0),j=e=>{e&&(V.value++,S+=5e3,fe({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(C({message:a.message,type:"success"}),P(a.data.message),A()):(C({message:a.message,type:"error"}),_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}).catch(a=>{F.value&&V.value<3?setTimeout(()=>{j(e)},15e3-S>0?15e3-S:0):(_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}))},A=()=>{var e;F.value=!1,c.value=!1,_.value="",r.value="",d.value=[],(e=y.value)==null||e.blur(),document.removeEventListener("keydown",N),Y("paySuccess"),h.value=!1},c=l(!1);p({drawer:h,setForm:W,setRePay:X});const d=l([]),r=l(""),D=ne(()=>+r.value>0?(r.value-x.value.order_price).toFixed(2):-1),R=l(!1),I=e=>{e===-1?d.value=[]:d.value.pop(),r.value=d.value.length?d.value.join(""):0},n=e=>{R.value===!1&&(r.value="",R.value=!0);let a=String(r.value).indexOf(".")+1,t=String(r.value).length-a;console.log(a,t),(a===0||t<2)&&(d.value.join("")<=9999999&&d.value.push(e),r.value=d.value.join("")>99999999?99999999:d.value.join(""))},U=()=>{D.value===""||D.value===null||D.value===void 0||(u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"cash_payment",source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,r.value="",d.value=[],c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1}))},N=e=>{let t=(e||window.event).keyCode;switch(e.stopPropagation(),e.preventDefault(),t){case 96:case 48:n(0);break;case 97:case 49:n(1);break;case 98:case 50:n(2);break;case 99:case 51:n(3);break;case 100:case 52:n(4);break;case 101:case 53:n(5);break;case 102:case 54:n(6);break;case 103:case 55:n(7);break;case 104:case 56:n(8);break;case 105:case 57:n(9);break;case 110:n(".");break;case 190:n(".");break;case 8:I();break;case 13:U();break}};return(e,a)=>{const t=E("el-input"),g=E("el-button"),ae=E("Delete"),se=E("el-icon"),te=E("el-drawer"),oe=ce("loading");return f(),K(te,{size:800,modelValue:h.value,"onUpdate:modelValue":a[4]||(a[4]=i=>h.value=i),direction:"rtl",onOpen:Q,"before-close":A},{header:m(()=>[me]),default:m(()=>[o("div",ye,[o("div",ge,[o("div",{class:M(["left",{active:k.value==1}]),onClick:a[0]||(a[0]=i=>T(1))}," 微信 ",2),o("div",{class:M(["right",{active:k.value==2}]),onClick:a[1]||(a[1]=i=>T(2))}," 现金收款 ",2)]),he,o("div",ke,[L(" ¥"),o("span",be,B(x.value.order_price),1)]),k.value==1?re((f(),b("div",we,[w(t,{ref_key:"codeRef",ref:y,modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=i=>_.value=i),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ue(ee,["enter"])},null,8,["modelValue"]),Ce])),[[oe,c.value]]):(f(),b("div",xe,[o("div",Se,[o("div",Ae,[o("div",Le,[r.value?(f(),b("span",Ve,B(r.value),1)):(f(),b("span",De,"按下键盘输入客户支付金额"))]),D.value>=0?(f(),b("div",Ee,[L(" 需找零(元):"),o("span",$e,"¥"+B(D.value),1)])):(f(),b("div",je,"不够找零, 请支付更多金额")),o("div",Be,[o("div",Pe,[(f(!0),b(de,null,ie(Z.value,i=>(f(),K(g,{key:i,onClick:Ie=>n(i)},{default:m(()=>[L(B(i),1)]),_:2},1032,["onClick"]))),128))]),o("div",Te,[w(g,{onClick:I},{default:m(()=>[w(se,null,{default:m(()=>[w(ae)]),_:1})]),_:1}),w(g,{onClick:a[3]||(a[3]=i=>I(-1))},{default:m(()=>[L("C")]),_:1}),w(g,{class:"enter",onClick:U},{default:m(()=>[L("确认")]),_:1})])])])])]))])]),footer:m(()=>[o("div",ze,[w(g,{class:"cancel-btn",onClick:J},{default:m(()=>[L("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},He=le(Fe,[["__scopeId","data-v-517a591d"]]);export{Oe as a,Re as b,Ke as c,qe as d,Me as e,Ge as f,fe as g,Ue as o,He as p}; +import{s as v,_ as le,r as l,v as ne,a as E,h as ce,o as f,c as K,w as m,b as o,n as M,e as L,t as B,j as re,f as b,d as w,i as ue,F as de,g as ie,x as $,E as C,p as ve,l as pe}from"./index-Dqrpap1c.js";function qe(s){return v.post("user/cart/create",s)}function Oe(s){return v.get("user/cart/lst",{params:s})}function Re(s,p){return v.post(`user/cart/change/${s}`,p)}function Ue(s){return v.post("v2/order/check",s)}function Ke(s){return v.post("user/cart/delete",s)}function G(s){return v.post("v2/order/create",s)}function _e(s,p){return v.post(`order/pay/${s}`,p)}function fe(s){return v.get("micropay_query",{params:s})}function Me(s,p){return v.get(`admin/${s}/order_list`,{params:p})}function Ge(s){return v.get("order_lading",{params:s})}const P=s=>{let p=new window.SpeechSynthesisUtterance(s);window.speechSynthesis.speak(p)},q=s=>(ve("data-v-517a591d"),s=s(),pe(),s),me=q(()=>o("h4",null,"选择支付方式",-1)),ye={class:"dra-body"},ge={class:"header"},he=q(()=>o("div",{style:{color:"#999",padding:"2rem 0 0.3rem 0"}},"应收金额(元):",-1)),ke={style:{color:"#f5222d","padding-bottom":"2rem"}},be={style:{"font-size":"1.6rem"}},we={key:0,"element-loading-text":"支付中",class:"card1"},Ce=q(()=>o("div",{class:"tips"},null,-1)),xe={key:1,class:"card2"},Se={class:"drawer-body"},Ae={class:"counter"},Le={class:"received"},Ve={key:0},De={key:1,style:{"font-size":"1rem",color:"#999"}},Ee={key:0,class:"balance"},$e={class:"money"},je={key:1,class:"balance"},Be={class:"keypad"},Pe={class:"left"},Te={class:"right"},ze={style:{width:"100%",display:"flex","justify-content":"center"}},Fe={__name:"pay",emits:["paySuccess"],setup(s,{expose:p,emit:H}){const h=l(!1),k=l(1),_=l(""),y=l(""),J=()=>{A()},Q=()=>{$(()=>{setTimeout(()=>{var e;c.value=!1,_.value="",F.value=!0,(e=y.value)==null||e.focus(),T(k.value)},300)})},T=e=>{k.value=e,k.value==2?document.addEventListener("keydown",N):document.removeEventListener("keydown",N)},x=l({}),z=l([]),W=e=>{x.value=e.data,z.value=e.cart_id},X=e=>{x.value.order_price=e.price,u.value=e.order_id},Y=H,F=l(!1),Z=l(["1","2","3","4","5","6","7","8","9","0","00","."]);let S=0;const u=l(""),ee=()=>{c.value=!0,y.value.blur(),u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"micropay",auth_code:_.value,source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1,$(()=>{var a;(a=y.value)==null||a.focus()})})},O=e=>{let a;k.value==1?a={type:"micropay",auth_code:_.value}:a={type:"cash_payment"},_e(e,a).then(t=>{t.status==200&&t.message=="支付成功"?(h.value=!1,C({message:t.message,type:"success"}),P(t.data.message),A()):(u.value=t.data.group_order_id,V.value=0,S=0,j(t.data.group_order_sn))}).catch(t=>{_.value="",c.value=!1,$(()=>{var g;(g=y.value)==null||g.focus()})})},V=l(0),j=e=>{e&&(V.value++,S+=5e3,fe({order_sn:e}).then(a=>{a.data.paid==1||a.message=="支付成功"?(C({message:a.message,type:"success"}),P(a.data.message),A()):(C({message:a.message,type:"error"}),_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}).catch(a=>{F.value&&V.value<3?setTimeout(()=>{j(e)},15e3-S>0?15e3-S:0):(_.value="",c.value=!1,$(()=>{var t;(t=y.value)==null||t.focus()}))}))},A=()=>{var e;F.value=!1,c.value=!1,_.value="",r.value="",d.value=[],(e=y.value)==null||e.blur(),document.removeEventListener("keydown",N),Y("paySuccess"),h.value=!1},c=l(!1);p({drawer:h,setForm:W,setRePay:X});const d=l([]),r=l(""),D=ne(()=>+r.value>0?(r.value-x.value.order_price).toFixed(2):-1),R=l(!1),I=e=>{e===-1?d.value=[]:d.value.pop(),r.value=d.value.length?d.value.join(""):0},n=e=>{R.value===!1&&(r.value="",R.value=!0);let a=String(r.value).indexOf(".")+1,t=String(r.value).length-a;console.log(a,t),(a===0||t<2)&&(d.value.join("")<=9999999&&d.value.push(e),r.value=d.value.join("")>99999999?99999999:d.value.join(""))},U=()=>{D.value===""||D.value===null||D.value===void 0||(u.value?O(u.value):G({address_id:"",key:x.value.key,cart_id:z.value,pay_type:"cash_payment",source:300}).then(e=>{if(e.status==200&&e.message=="支付成功")h.value=!1,C({message:e.message,type:"success"}),P(e.data.message),A();else if(e.data.group_order_sn)u.value=e.data.group_order_id,V.value=0,S=0,j(e.data.group_order_sn);else return u.value=e.data.result.order_id,r.value="",d.value=[],c.value=!1,C({message:e.message,type:"error"})}).catch(e=>{c.value=!1}))},N=e=>{let t=(e||window.event).keyCode;switch(e.stopPropagation(),e.preventDefault(),t){case 96:case 48:n(0);break;case 97:case 49:n(1);break;case 98:case 50:n(2);break;case 99:case 51:n(3);break;case 100:case 52:n(4);break;case 101:case 53:n(5);break;case 102:case 54:n(6);break;case 103:case 55:n(7);break;case 104:case 56:n(8);break;case 105:case 57:n(9);break;case 110:n(".");break;case 190:n(".");break;case 8:I();break;case 13:U();break}};return(e,a)=>{const t=E("el-input"),g=E("el-button"),ae=E("Delete"),se=E("el-icon"),te=E("el-drawer"),oe=ce("loading");return f(),K(te,{size:800,modelValue:h.value,"onUpdate:modelValue":a[4]||(a[4]=i=>h.value=i),direction:"rtl",onOpen:Q,"before-close":A},{header:m(()=>[me]),default:m(()=>[o("div",ye,[o("div",ge,[o("div",{class:M(["left",{active:k.value==1}]),onClick:a[0]||(a[0]=i=>T(1))}," 微信 ",2),o("div",{class:M(["right",{active:k.value==2}]),onClick:a[1]||(a[1]=i=>T(2))}," 现金收款 ",2)]),he,o("div",ke,[L(" ¥"),o("span",be,B(x.value.order_price),1)]),k.value==1?re((f(),b("div",we,[w(t,{ref_key:"codeRef",ref:y,modelValue:_.value,"onUpdate:modelValue":a[2]||(a[2]=i=>_.value=i),autofocus:"",class:"code-input",placeholder:"请点击输入框聚焦扫码或输入编码号",onKeyup:ue(ee,["enter"])},null,8,["modelValue"]),Ce])),[[oe,c.value]]):(f(),b("div",xe,[o("div",Se,[o("div",Ae,[o("div",Le,[r.value?(f(),b("span",Ve,B(r.value),1)):(f(),b("span",De,"按下键盘输入客户支付金额"))]),D.value>=0?(f(),b("div",Ee,[L(" 需找零(元):"),o("span",$e,"¥"+B(D.value),1)])):(f(),b("div",je,"不够找零, 请支付更多金额")),o("div",Be,[o("div",Pe,[(f(!0),b(de,null,ie(Z.value,i=>(f(),K(g,{key:i,onClick:Ie=>n(i)},{default:m(()=>[L(B(i),1)]),_:2},1032,["onClick"]))),128))]),o("div",Te,[w(g,{onClick:I},{default:m(()=>[w(se,null,{default:m(()=>[w(ae)]),_:1})]),_:1}),w(g,{onClick:a[3]||(a[3]=i=>I(-1))},{default:m(()=>[L("C")]),_:1}),w(g,{class:"enter",onClick:U},{default:m(()=>[L("确认")]),_:1})])])])])]))])]),footer:m(()=>[o("div",ze,[w(g,{class:"cancel-btn",onClick:J},{default:m(()=>[L("取消收款")]),_:1})])]),_:1},8,["modelValue"])}}},He=le(Fe,[["__scopeId","data-v-517a591d"]]);export{Oe as a,Re as b,Ke as c,qe as d,Me as e,Ge as f,fe as g,Ue as o,He as p}; diff --git a/dist/assets/shop-Dt7yZjfV.js b/dist/assets/shop-CVNajSlv.js similarity index 75% rename from dist/assets/shop-Dt7yZjfV.js rename to dist/assets/shop-CVNajSlv.js index 8c17f67..b1c84c4 100644 --- a/dist/assets/shop-Dt7yZjfV.js +++ b/dist/assets/shop-CVNajSlv.js @@ -1 +1 @@ -import{s as e}from"./index-B3GfFMCJ.js";function u(r,t){return e.get(`server/${r}/product/lst`,{params:t})}function a(r,t){return e.get(`store/product/detail/${r}`,{params:t})}function o(r,t){return e.post(`user_free_trial/${r}`,t)}export{a as g,u as s,o as u}; +import{s as e}from"./index-Dqrpap1c.js";function u(r,t){return e.get(`server/${r}/product/lst`,{params:t})}function a(r,t){return e.get(`store/product/detail/${r}`,{params:t})}function o(r,t){return e.post(`user_free_trial/${r}`,t)}export{a as g,u as s,o as u}; diff --git a/dist/index.html b/dist/index.html index f76b3f2..aea2223 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ 里海收银系统 - +