From 8f95b9733e31fcfb654103a1a3f6ec8d9db08e24 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 4 Jul 2024 17:59:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/assets/index-BXLLkjvT.js | 2 +- dist/assets/index-BwYPA3MM.js | 2 +- src/components/payUser.vue | 6 + src/layout/myHeader.vue | 3 +- src/views/convert/index.vue | 2 +- src/views/order/component/order.vue | 7 +- src/views/saleHome/component/order.vue | 7 +- src/views/saleHome/component/shop.vue | 15 +- src/views/saleHome/index.vue | 10 +- src/views/saleOrder/component/order.vue | 560 ++++++++++++------------ src/views/user/component/detail.vue | 31 +- src/views/user/component/order.vue | 7 +- 12 files changed, 341 insertions(+), 311 deletions(-) diff --git a/build/assets/index-BXLLkjvT.js b/build/assets/index-BXLLkjvT.js index cb4959a..a3d71a4 100644 --- a/build/assets/index-BXLLkjvT.js +++ b/build/assets/index-BXLLkjvT.js @@ -24,4 +24,4 @@ __p += '`),Z&&(g+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+g+`return __p -}`;var F=ko(function(){return J(s,I+"return "+g).apply(o,l)});if(F.source=g,Qi(F))throw F;return F}function Vd(n){return nn(n).toLowerCase()}function Zd(n){return nn(n).toUpperCase()}function Yd(n,e,t){if(n=nn(n),n&&(t||e===o))return ju(n);if(!n||!(e=zn(e)))return n;var r=se(n),i=se(e),s=ns(r,i),l=es(r,i)+1;return Be(r,s,l).join("")}function Xd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.slice(0,rs(n)+1);if(!n||!(e=zn(e)))return n;var r=se(n),i=es(r,se(e))+1;return Be(r,0,i).join("")}function Jd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.replace(Qr,"");if(!n||!(e=zn(e)))return n;var r=se(n),i=ns(r,se(e));return Be(r,i).join("")}function Qd(n,e){var t=gn,r=Pn;if(wn(e)){var i="separator"in e?e.separator:i;t="length"in e?W(e.length):t,r="omission"in e?zn(e.omission):r}n=nn(n);var s=n.length;if(Qe(n)){var l=se(n);s=l.length}if(t>=s)return n;var f=t-je(r);if(f<1)return r;var c=l?Be(l,0,f).join(""):n.slice(0,f);if(i===o)return c+r;if(l&&(f+=c.length-f),ji(i)){if(n.slice(f).search(i)){var d,p=c;for(i.global||(i=pi(i.source,nn(xu.exec(i))+"g")),i.lastIndex=0;d=i.exec(p);)var g=d.index;c=c.slice(0,g===o?f:g)}}else if(n.indexOf(zn(i),f)!=f){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function jd(n){return n=nn(n),n&&fl.test(n)?n.replace(mu,Ef):n}var np=st(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),tu=ks("toUpperCase");function zo(n,e,t){return n=nn(n),e=t?o:e,e===o?If(n)?Of(n):df(n):n.match(e)||[]}var ko=M(function(n,e){try{return Gn(n,o,e)}catch(t){return Qi(t)?t:new T(t)}}),ep=Ae(function(n,e){return Xn(e,function(t){t=de(t),ye(n,t,Xi(n[t],n))}),n});function tp(n){var e=n==null?0:n.length,t=L();return n=e?mn(n,function(r){if(typeof r[1]!="function")throw new Jn(x);return[t(r[0]),r[1]]}):[],M(function(r){for(var i=-1;++ice)return[];var t=Zn,r=Tn(n,Zn);e=L(e),n-=Zn;for(var i=hi(r,e);++t0||e<0)?new z(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==o&&(e=W(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(Zn)},he(z.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);i&&(u.prototype[e]=function(){var l=this.__wrapped__,f=r?[1]:arguments,c=l instanceof z,d=f[0],p=c||O(l),g=function(G){var Z=i.apply(u,Ee([G],f));return r&&m?Z[0]:Z};p&&t&&typeof d=="function"&&d.length!=1&&(c=p=!1);var m=this.__chain__,I=!!this.__actions__.length,S=s&&!m,F=c&&!I;if(!s&&p){l=F?l:new z(this);var R=n.apply(l,f);return R.__actions__.push({func:Lr,args:[g],thisArg:o}),new Qn(R,m)}return S&&F?n.apply(this,f):(R=this.thru(g),S?r?R.value()[0]:R.value():R)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Jt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return e.apply(O(s)?s:[],i)}return this[t](function(l){return e.apply(O(l)?l:[],i)})}}),he(z.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";un.call(rt,r)||(rt[r]=[]),rt[r].push({name:e,func:t})}}),rt[mr(o,K).name]=[{name:"wrapper",func:o}],z.prototype.clone=jf,z.prototype.reverse=na,z.prototype.value=ea,u.prototype.at=Th,u.prototype.chain=Oh,u.prototype.commit=Ph,u.prototype.next=$h,u.prototype.plant=Wh,u.prototype.reverse=Fh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Mh,u.prototype.first=u.prototype.head,xt&&(u.prototype[xt]=Bh),u},nt=Pf();Me?((Me.exports=nt)._=nt,ii._=nt):En._=nt}).call(Wt)})(Fr,Fr.exports);var uv=Fr.exports;const sv=qp(uv),Dr=P=>(du("data-v-585a7a23"),P=P(),pu(),P),ov={class:"my-order"},lv=Dr(()=>v("div",{class:"nav-item-label"},"搜索 (Shift)",-1)),fv={class:"nav-item-input"},av={class:"shop-list","infinite-scroll-distance":1e3,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},cv=["onClick"],hv={class:"shop-name"},_v={key:0,class:"shop-price"},dv=Dr(()=>v("span",{class:"unit-name"},"活动价:",-1)),pv={key:0,class:"unit-name"},gv={key:1,class:"shop-price"},vv=Dr(()=>v("span",{class:"unit-name"},"原价: ",-1)),mv={class:"unit-name del"},wv={key:2,class:"shop-price"},yv={class:"unit-name"},xv={key:3,class:"no-stock-re"},Av=Dr(()=>v("div",null,[v("span",null,"次日提")],-1)),Iv=[Av],Cv={key:1,class:"no-data"},Lv={__name:"shop",props:{storeList:{type:Array,default:()=>[]},priceKey:{type:Object,default:()=>({})},loading:{type:Boolean,default:()=>!1}},emits:["getStoreList","changeItem","loadMore"],setup(P,{expose:y,emit:o}){const b=E(null),k=o,tn=E(""),x=()=>{k("loadMore",{store_name_code:tn.value})},Y=A=>{k("changeItem",A)},an=sv.throttle(()=>{let A={store_name:tn.value};k("getStoreList",A,!0)},300);y({name:tn,inputBlur:()=>{var A;(A=b.value)==null||A.blur()}});const j=E(!1),X=()=>{j.value=!0},yn=()=>{j.value=!1},q=()=>{var A;(A=b.value)==null||A.focus()};return Dt(()=>{hu(()=>{var A;(A=b.value)==null||A.focus(),X()}),re.on("shift",q)}),Nt(()=>{re.off("shift",q)}),(A,ln)=>{const B=sn("el-input"),K=sn("Search"),rn=sn("el-icon"),H=sn("el-button"),on=sn("el-image"),hn=sn("el-space"),V=sn("el-empty"),$=Ft("loading"),pn=Ft("infinite-scroll");return D(),Q("div",ov,[v("div",{class:Wr(["header-nav",{"input-focus":j.value}])},[lv,v("div",fv,[U(B,{modelValue:tn.value,"onUpdate:modelValue":ln[0]||(ln[0]=C=>tn.value=C),placeholder:" 搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索",clearable:"",ref_key:"codeRef",ref:b,onFocus:X,onBlur:yn,onKeyup:Xo($r(an),["enter"]),onClear:$r(an)},null,8,["modelValue","onKeyup","onClear"])]),v("div",{class:"nav-item-btn",onClick:ln[1]||(ln[1]=(...C)=>$r(an)&&$r(an)(...C))},[U(H,{class:"btn",type:"primary"},{default:dn(()=>[U(rn,null,{default:dn(()=>[U(K)]),_:1})]),_:1})])],2),_u((D(),Q("div",av,[P.storeList.length?(D(),Fe(hn,{key:0,wrap:"",size:14},{default:dn(()=>[(D(!0),Q(Mt,null,Ut(P.storeList,(C,gn)=>(D(),Q("div",{class:"shop-item",key:gn,onClick:Pn=>Y(C)},[U(on,{loading:"lazy",src:C.image},null,8,["src"]),v("div",hv,N(C.store_name),1),P.priceKey.off_activity==1?(D(),Q("div",_v,[dv,en(" ¥"),v("span",null,N(C[P.priceKey.price]),1),C.unit_name?(D(),Q("span",pv,"/"+N(C.unit_name),1)):pe("",!0)])):pe("",!0),P.priceKey.off_activity==1?(D(),Q("div",gv,[vv,en(),v("span",mv,"¥"+N(C[P.priceKey.op_price])+" /"+N(C.unit_name),1)])):(D(),Q("div",wv,[en(" ¥"),v("span",null,N(C[P.priceKey.op_price]),1),v("span",yv,"/"+N(C.unit_name),1)])),C.stock<=0?(D(),Q("div",xv,Iv)):pe("",!0)],8,cv))),128))]),_:1})):pe("",!0),P.storeList.length?pe("",!0):(D(),Q("div",Cv,[U(V,{"image-size":200,description:"没有找到对应商品"})]))])),[[$,P.loading],[pn,x]])])}}},Sv=ct(Lv,[["__scopeId","data-v-585a7a23"]]),Jo=P=>(du("data-v-6c040b11"),P=P(),pu(),P),Rv={class:"shop"},Ev={class:"shop-info"},bv={class:"shop-info-left"},Tv={class:"shop-info-right"},Ov={class:"shop-info-right-top"},Pv={key:0,class:"shop-info-right-price"},$v=Jo(()=>v("span",{class:"unit-name"},"活动价:",-1)),Bv={key:0,class:"unit-name"},Wv={key:1,class:"shop-info-right-price"},Fv=Jo(()=>v("span",{class:"unit-name"},"原价: ",-1)),Mv={class:"unit-name del"},Uv={key:2,class:"shop-info-right-price"},Dv={class:"unit-name"},Nv={class:"shop-sku"},Kv={class:"title"},Gv={class:"sku"},Hv={class:"dialog-footer"},zv={__name:"pupop",props:{priceKey:{type:Object,default:()=>({})}},emits:["changeItem"],setup(P,{expose:y,emit:o}){const b=E(!1),k=E(null),tn=q=>{b.value=q},x=E({}),Y=E(!1),an=E("add"),cn=(q,A="add")=>{an.value=A,x.value=JSON.parse(JSON.stringify(q))},j=o,X=()=>{x.value.cart_num||(x.value.cart_num=x.value.batch>0?x.value.batch:1),j("changeItem",x.value),b.value=!1};y({show:tn,setForm:cn});const yn=()=>{b.value&&X()};return Dt(()=>{re.on("enter",yn)}),Nt(()=>{re.off("enter",yn)}),(q,A)=>{const ln=sn("el-image"),B=sn("el-input-number"),K=sn("el-button"),rn=sn("el-dialog"),H=Ft("loading");return D(),Fe(rn,{modelValue:b.value,"onUpdate:modelValue":A[1]||(A[1]=on=>b.value=on),title:"购买数量",width:"650",onOpened:A[2]||(A[2]=on=>k.value.focus())},Vp({default:dn(()=>[_u((D(),Q("div",Rv,[v("div",Ev,[v("div",bv,[U(ln,{loading:"lazy",src:x.value.image},null,8,["src"])]),v("div",Tv,[v("div",Ov,N(x.value.store_name),1),v("div",null,[P.priceKey.off_activity==1?(D(),Q("div",Pv,[$v,en(" ¥"),v("span",null,N(x.value[P.priceKey.price]),1),x.value.unit_name?(D(),Q("span",Bv,"/"+N(x.value.unit_name),1)):pe("",!0)])):pe("",!0),P.priceKey.off_activity==1?(D(),Q("div",Wv,[Fv,en(),v("span",Mv,"¥"+N(x.value[P.priceKey.op_price])+" /"+N(x.value.unit_name),1)])):(D(),Q("div",Uv,[en(" ¥"),v("span",null,N(x.value[P.priceKey.op_price]),1),v("span",Dv,"/"+N(x.value.unit_name),1)]))])])]),v("div",Nv,[v("div",Kv,"购买数量 ( "+N(x.value.unit_name)+" )",1),v("div",Gv,[U(B,{ref_key:"inputRef",ref:k,modelValue:x.value.cart_num,"onUpdate:modelValue":A[0]||(A[0]=on=>x.value.cart_num=on),placeholder:`请输入数量(默认为${+x.value.batch>0?x.value.batch:"1"})`,min:+x.value.batch>0?+x.value.batch:1,"step-strictly":"",step:1,style:{width:"20rem"},size:"large"},null,8,["modelValue","placeholder","min"])])])])),[[H,Y.value]])]),_:2},[an.value!="add"&&x.value.attr&&x.value.attr.length==1?void 0:{name:"footer",fn:dn(()=>[v("div",Hv,[U(K,{class:"ok-btn",type:"primary",onClick:X},{default:dn(()=>[en(" 确定 (Enter) ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},kv=ct(zv,[["__scopeId","data-v-6c040b11"]]),qv=["onClick","onMousemove"],Vv=["onMousemove"],Zv={class:"title"},Yv={class:"list"},Xv=["onClick"],Jv={__name:"classify",emits:["getStoreList"],setup(P,{emit:y}){const o=y,b=E([]),k=E([]),tn=E([]),x=E(-1),Y=E(-1),an=E(-1),cn=E(-1),j=E(!1),X=Ur();(()=>{au({pid:0,page_no:1,page_size:30,level:1,store_id:X.userInfo.store_id}).then(B=>{b.value=B.data.lists,x.value=-1})})();const q=B=>{au({pid:B,page_no:1,page_size:30,level:2,store_id:X.userInfo.store_id}).then(K=>{k.value=K.data.lists})},A=B=>{au({pid:B,page_no:1,page_size:30,level:3,store_id:X.userInfo.store_id}).then(K=>{tn.value=K.data.lists})},ln=(B=-1,K=1)=>{cn.value=B,j.value=!0;let rn="";console.log(B,K),K==1?(x.value=B,Y.value=-1,an.value=-1,B!=-1&&(rn=b.value[B].id),q(rn),o("getStoreList",{top_cate_id:rn,two_cate_id:null},!0)):K==2&&(Y.value=B,an.value=-1,B!=-1&&(rn=k.value[B].id),A(rn),o("getStoreList",{two_cate_id:rn},!0))};return(B,K)=>{const rn=sn("el-popover");return D(),Q("div",{class:"classify",onMouseout:K[2]||(K[2]=H=>j.value?j.value=!1:j.value=!0)},[v("div",{class:Wr(["itemP",{"itemP-active":x.value==-1}]),onClick:K[0]||(K[0]=H=>ln(-1))},N("全部"),2),(D(!0),Q(Mt,null,Ut(b.value,(H,on)=>(D(),Fe(rn,{placement:"left",width:"20rem",trigger:"click",key:on,visible:on==x.value&&cn.value==on},{reference:dn(()=>[v("div",{class:Wr(["itemP",{"itemP-active":on==x.value}]),onClick:hn=>ln(on),onMousemove:hn=>cn.value=on},N(H.name),43,qv)]),default:dn(()=>[v("div",{class:"active-card",onMouseout:K[1]||(K[1]=hn=>cn.value=-1),onMousemove:hn=>cn.value=on},[v("div",Zv,N(H.name),1),v("div",Yv,[(D(!0),Q(Mt,null,Ut(k.value,(hn,V)=>(D(),Q("div",{class:Wr({"list-active":V==Y.value}),link:"",type:"primary",key:hn.id,onClick:$=>ln(V,2)},N(hn.name),11,Xv))),128))])],40,Vv)]),_:2},1032,["visible"]))),128))],32)}}},Qv=ct(Jv,[["__scopeId","data-v-4d5623b0"]]),Mr=class Mr{constructor(){fu(this,"loadingInstance",null)}static getInstance(){return this.instance??(this.instance=new Mr)}msg(y){qe.info(y)}msgError(y){y!=="Network Error"&&qe.error(y)}msgSuccess(y){qe.success(y)}msgWarning(y){qe.warning(y)}alert(y){at.alert(y,"系统提示")}alertError(y){at.alert(y,"系统提示",{type:"error"})}alertSuccess(y){at.alert(y,"系统提示",{type:"success"})}alertWarning(y){at.alert(y,"系统提示",{type:"warning"})}notify(y){Br.info(y)}notifyError(y){Br.error(y)}notifySuccess(y){Br.success(y)}notifyWarning(y){Br.warning(y)}confirm(y){return at.confirm(y,"温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})}prompt(y,o,b){return at.prompt(y,o,{confirmButtonText:"确定",cancelButtonText:"取消",...b})}loading(y){this.loadingInstance=Zp.service({lock:!0,text:y})}closeLoading(){var y;(y=this.loadingInstance)==null||y.close()}};fu(Mr,"instance",null);let cu=Mr;const jv=cu.getInstance(),n1={class:"my-card"},h1={__name:"index",setup(P){const y=E(null),o=E(null),b=E(null),k=E(null),tn=E([]),x=Yp({off_activity:"",op_price:"",price:""}),Y=Ur(),an=Xp(),cn=E({page_no:1,page_size:30}),j=E(!1),X=($={},pn=!1)=>{var C;cn.value={...cn.value,...$},pn&&(tn.value=[],cn.value.page_no=1,yn.value=!1),j.value=!0,Qp({...cn.value,store_id:(C=Y.userInfo)==null?void 0:C.store_id}).then(gn=>{var Pn,$n;j.value=!1;for(let Bn in gn.data.extend)x[Bn]=gn.data.extend[Bn];(($n=(Pn=gn.data)==null?void 0:Pn.lists)==null?void 0:$n.length){yn.value||X($)};function A($){return/^\d+$/.test($)}const ln=($,pn="")=>{console.log($,pn);let C={product_id:$.product_id,cart_num:$.cart_num};Yo(C).then(gn=>{o.value.getList()})},B=($,pn)=>{y.value.setForm($,"add"),y.value.show(!0)},K=$=>{y.value.setForm($,"edit"),y.value.show(!0)},rn=E({}),H=async()=>{var gn,Pn;let $=o.value.list.map($n=>$n.id),pn={cart_id:$,uid:((Pn=(gn=o.value)==null?void 0:gn.userInfo)==null?void 0:Pn.uid)||""},{data:C}=await zp(pn);C.reservation>0&&await jv.confirm("部分商品暂无现货, 需要次日提货, 是否确认购买?"),o.value.discounts>0&&(pn.deduction_price=o.value.discounts.toFixed(2),pn.pay_type="micropay"),kp(pn).then($n=>{var Bn,ae,Ve;rn.value=$n.data.order,k.value.setForm({data:$n.data.order,reservation:C.reservation,cart_id:$,uid:((ae=(Bn=o.value)==null?void 0:Bn.userInfo)==null?void 0:ae.uid)||"",is_storage:(Ve=o.value)!=null&&Ve.is_storage?1:0})}),k.value.drawer=!0},on=()=>{var $,pn,C;if(($=o.value)!=null&&$.is_storage&&!((C=(pn=o.value)==null?void 0:pn.userInfo)!=null&&C.uid))return qe.error("选择用户才可以存货");H()},hn=($=null)=>{setTimeout(()=>{o.value.resetView()})},V=()=>{an.name=="saleHome"&&(!k.value.drawer&&o.value.list.length>0?on():k.value.beforeClose())};return Dt(()=>{X(),re.on("F9",V)}),Nt(()=>{re.off("F9",V)}),($,pn)=>(D(),Q("div",n1,[U(iv,{ref_key:"orderRef",ref:o,onGoPay:on,onEditPupop:K},null,512),U(Zo),U(Sv,{ref_key:"shopRef",ref:b,style:{flex:"1"},storeList:tn.value,priceKey:x,loading:j.value,onGetStoreList:X,onChangeItem:B,onLoadMore:q},null,8,["storeList","priceKey","loading"]),U(kv,{ref_key:"pupopRef",ref:y,priceKey:x,onChangeItem:ln},null,8,["priceKey"]),U(Zo),U(Qv,{ref:"classifyRef",onGetStoreList:X},null,512),U(jp,{ref_key:"payRef",ref:k,onPaySuccess:hn},null,512)]))}};export{h1 as default}; +}`;var F=ko(function(){return J(s,I+"return "+g).apply(o,l)});if(F.source=g,Qi(F))throw F;return F}function Vd(n){return nn(n).toLowerCase()}function Zd(n){return nn(n).toUpperCase()}function Yd(n,e,t){if(n=nn(n),n&&(t||e===o))return ju(n);if(!n||!(e=zn(e)))return n;var r=se(n),i=se(e),s=ns(r,i),l=es(r,i)+1;return Be(r,s,l).join("")}function Xd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.slice(0,rs(n)+1);if(!n||!(e=zn(e)))return n;var r=se(n),i=es(r,se(e))+1;return Be(r,0,i).join("")}function Jd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.replace(Qr,"");if(!n||!(e=zn(e)))return n;var r=se(n),i=ns(r,se(e));return Be(r,i).join("")}function Qd(n,e){var t=gn,r=Pn;if(wn(e)){var i="separator"in e?e.separator:i;t="length"in e?W(e.length):t,r="omission"in e?zn(e.omission):r}n=nn(n);var s=n.length;if(Qe(n)){var l=se(n);s=l.length}if(t>=s)return n;var f=t-je(r);if(f<1)return r;var c=l?Be(l,0,f).join(""):n.slice(0,f);if(i===o)return c+r;if(l&&(f+=c.length-f),ji(i)){if(n.slice(f).search(i)){var d,p=c;for(i.global||(i=pi(i.source,nn(xu.exec(i))+"g")),i.lastIndex=0;d=i.exec(p);)var g=d.index;c=c.slice(0,g===o?f:g)}}else if(n.indexOf(zn(i),f)!=f){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function jd(n){return n=nn(n),n&&fl.test(n)?n.replace(mu,Ef):n}var np=st(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),tu=ks("toUpperCase");function zo(n,e,t){return n=nn(n),e=t?o:e,e===o?If(n)?Of(n):df(n):n.match(e)||[]}var ko=M(function(n,e){try{return Gn(n,o,e)}catch(t){return Qi(t)?t:new T(t)}}),ep=Ae(function(n,e){return Xn(e,function(t){t=de(t),ye(n,t,Xi(n[t],n))}),n});function tp(n){var e=n==null?0:n.length,t=L();return n=e?mn(n,function(r){if(typeof r[1]!="function")throw new Jn(x);return[t(r[0]),r[1]]}):[],M(function(r){for(var i=-1;++ice)return[];var t=Zn,r=Tn(n,Zn);e=L(e),n-=Zn;for(var i=hi(r,e);++t0||e<0)?new z(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==o&&(e=W(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(Zn)},he(z.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);i&&(u.prototype[e]=function(){var l=this.__wrapped__,f=r?[1]:arguments,c=l instanceof z,d=f[0],p=c||O(l),g=function(G){var Z=i.apply(u,Ee([G],f));return r&&m?Z[0]:Z};p&&t&&typeof d=="function"&&d.length!=1&&(c=p=!1);var m=this.__chain__,I=!!this.__actions__.length,S=s&&!m,F=c&&!I;if(!s&&p){l=F?l:new z(this);var R=n.apply(l,f);return R.__actions__.push({func:Lr,args:[g],thisArg:o}),new Qn(R,m)}return S&&F?n.apply(this,f):(R=this.thru(g),S?r?R.value()[0]:R.value():R)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Jt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return e.apply(O(s)?s:[],i)}return this[t](function(l){return e.apply(O(l)?l:[],i)})}}),he(z.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";un.call(rt,r)||(rt[r]=[]),rt[r].push({name:e,func:t})}}),rt[mr(o,K).name]=[{name:"wrapper",func:o}],z.prototype.clone=jf,z.prototype.reverse=na,z.prototype.value=ea,u.prototype.at=Th,u.prototype.chain=Oh,u.prototype.commit=Ph,u.prototype.next=$h,u.prototype.plant=Wh,u.prototype.reverse=Fh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Mh,u.prototype.first=u.prototype.head,xt&&(u.prototype[xt]=Bh),u},nt=Pf();Me?((Me.exports=nt)._=nt,ii._=nt):En._=nt}).call(Wt)})(Fr,Fr.exports);var uv=Fr.exports;const sv=qp(uv),Dr=P=>(du("data-v-585a7a23"),P=P(),pu(),P),ov={class:"my-order"},lv=Dr(()=>v("div",{class:"nav-item-label"},"搜索 (Shift)",-1)),fv={class:"nav-item-input"},av={class:"shop-list","infinite-scroll-distance":1e3,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},cv=["onClick"],hv={class:"shop-name"},_v={key:0,class:"shop-price"},dv=Dr(()=>v("span",{class:"unit-name"},"活动价:",-1)),pv={key:0,class:"unit-name"},gv={key:1,class:"shop-price"},vv=Dr(()=>v("span",{class:"unit-name"},"原价: ",-1)),mv={class:"unit-name del"},wv={key:2,class:"shop-price"},yv={class:"unit-name"},xv={key:3,class:"no-stock-re"},Av=Dr(()=>v("div",null,[v("span",null,"次日提")],-1)),Iv=[Av],Cv={key:1,class:"no-data"},Lv={__name:"shop",props:{storeList:{type:Array,default:()=>[]},priceKey:{type:Object,default:()=>({})},loading:{type:Boolean,default:()=>!1}},emits:["getStoreList","changeItem","loadMore"],setup(P,{expose:y,emit:o}){const b=E(null),k=o,tn=E(""),x=()=>{k("loadMore",{store_name:tn.value})},Y=A=>{k("changeItem",A)},an=sv.throttle(()=>{let A={store_name:tn.value};k("getStoreList",A,!0)},300);y({name:tn,inputBlur:()=>{var A;(A=b.value)==null||A.blur()}});const j=E(!1),X=()=>{j.value=!0},yn=()=>{j.value=!1},q=()=>{var A;(A=b.value)==null||A.focus()};return Dt(()=>{hu(()=>{var A;(A=b.value)==null||A.focus(),X()}),re.on("shift",q)}),Nt(()=>{re.off("shift",q)}),(A,ln)=>{const B=sn("el-input"),K=sn("Search"),rn=sn("el-icon"),H=sn("el-button"),on=sn("el-image"),hn=sn("el-space"),V=sn("el-empty"),$=Ft("loading"),pn=Ft("infinite-scroll");return D(),Q("div",ov,[v("div",{class:Wr(["header-nav",{"input-focus":j.value}])},[lv,v("div",fv,[U(B,{modelValue:tn.value,"onUpdate:modelValue":ln[0]||(ln[0]=C=>tn.value=C),placeholder:" 搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索",clearable:"",ref_key:"codeRef",ref:b,onFocus:X,onBlur:yn,onKeyup:Xo($r(an),["enter"]),onClear:$r(an)},null,8,["modelValue","onKeyup","onClear"])]),v("div",{class:"nav-item-btn",onClick:ln[1]||(ln[1]=(...C)=>$r(an)&&$r(an)(...C))},[U(H,{class:"btn",type:"primary"},{default:dn(()=>[U(rn,null,{default:dn(()=>[U(K)]),_:1})]),_:1})])],2),_u((D(),Q("div",av,[P.storeList.length?(D(),Fe(hn,{key:0,wrap:"",size:14},{default:dn(()=>[(D(!0),Q(Mt,null,Ut(P.storeList,(C,gn)=>(D(),Q("div",{class:"shop-item",key:gn,onClick:Pn=>Y(C)},[U(on,{loading:"lazy",src:C.image},null,8,["src"]),v("div",hv,N(C.store_name),1),P.priceKey.off_activity==1?(D(),Q("div",_v,[dv,en(" ¥"),v("span",null,N(C[P.priceKey.price]),1),C.unit_name?(D(),Q("span",pv,"/"+N(C.unit_name),1)):pe("",!0)])):pe("",!0),P.priceKey.off_activity==1?(D(),Q("div",gv,[vv,en(),v("span",mv,"¥"+N(C[P.priceKey.op_price])+" /"+N(C.unit_name),1)])):(D(),Q("div",wv,[en(" ¥"),v("span",null,N(C[P.priceKey.op_price]),1),v("span",yv,"/"+N(C.unit_name),1)])),C.stock<=0?(D(),Q("div",xv,Iv)):pe("",!0)],8,cv))),128))]),_:1})):pe("",!0),P.storeList.length?pe("",!0):(D(),Q("div",Cv,[U(V,{"image-size":200,description:"没有找到对应商品"})]))])),[[$,P.loading],[pn,x]])])}}},Sv=ct(Lv,[["__scopeId","data-v-585a7a23"]]),Jo=P=>(du("data-v-6c040b11"),P=P(),pu(),P),Rv={class:"shop"},Ev={class:"shop-info"},bv={class:"shop-info-left"},Tv={class:"shop-info-right"},Ov={class:"shop-info-right-top"},Pv={key:0,class:"shop-info-right-price"},$v=Jo(()=>v("span",{class:"unit-name"},"活动价:",-1)),Bv={key:0,class:"unit-name"},Wv={key:1,class:"shop-info-right-price"},Fv=Jo(()=>v("span",{class:"unit-name"},"原价: ",-1)),Mv={class:"unit-name del"},Uv={key:2,class:"shop-info-right-price"},Dv={class:"unit-name"},Nv={class:"shop-sku"},Kv={class:"title"},Gv={class:"sku"},Hv={class:"dialog-footer"},zv={__name:"pupop",props:{priceKey:{type:Object,default:()=>({})}},emits:["changeItem"],setup(P,{expose:y,emit:o}){const b=E(!1),k=E(null),tn=q=>{b.value=q},x=E({}),Y=E(!1),an=E("add"),cn=(q,A="add")=>{an.value=A,x.value=JSON.parse(JSON.stringify(q))},j=o,X=()=>{x.value.cart_num||(x.value.cart_num=x.value.batch>0?x.value.batch:1),j("changeItem",x.value),b.value=!1};y({show:tn,setForm:cn});const yn=()=>{b.value&&X()};return Dt(()=>{re.on("enter",yn)}),Nt(()=>{re.off("enter",yn)}),(q,A)=>{const ln=sn("el-image"),B=sn("el-input-number"),K=sn("el-button"),rn=sn("el-dialog"),H=Ft("loading");return D(),Fe(rn,{modelValue:b.value,"onUpdate:modelValue":A[1]||(A[1]=on=>b.value=on),title:"购买数量",width:"650",onOpened:A[2]||(A[2]=on=>k.value.focus())},Vp({default:dn(()=>[_u((D(),Q("div",Rv,[v("div",Ev,[v("div",bv,[U(ln,{loading:"lazy",src:x.value.image},null,8,["src"])]),v("div",Tv,[v("div",Ov,N(x.value.store_name),1),v("div",null,[P.priceKey.off_activity==1?(D(),Q("div",Pv,[$v,en(" ¥"),v("span",null,N(x.value[P.priceKey.price]),1),x.value.unit_name?(D(),Q("span",Bv,"/"+N(x.value.unit_name),1)):pe("",!0)])):pe("",!0),P.priceKey.off_activity==1?(D(),Q("div",Wv,[Fv,en(),v("span",Mv,"¥"+N(x.value[P.priceKey.op_price])+" /"+N(x.value.unit_name),1)])):(D(),Q("div",Uv,[en(" ¥"),v("span",null,N(x.value[P.priceKey.op_price]),1),v("span",Dv,"/"+N(x.value.unit_name),1)]))])])]),v("div",Nv,[v("div",Kv,"购买数量 ( "+N(x.value.unit_name)+" )",1),v("div",Gv,[U(B,{ref_key:"inputRef",ref:k,modelValue:x.value.cart_num,"onUpdate:modelValue":A[0]||(A[0]=on=>x.value.cart_num=on),placeholder:`请输入数量(默认为${+x.value.batch>0?x.value.batch:"1"})`,min:+x.value.batch>0?+x.value.batch:1,"step-strictly":"",step:1,style:{width:"20rem"},size:"large"},null,8,["modelValue","placeholder","min"])])])])),[[H,Y.value]])]),_:2},[an.value!="add"&&x.value.attr&&x.value.attr.length==1?void 0:{name:"footer",fn:dn(()=>[v("div",Hv,[U(K,{class:"ok-btn",type:"primary",onClick:X},{default:dn(()=>[en(" 确定 (Enter) ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},kv=ct(zv,[["__scopeId","data-v-6c040b11"]]),qv=["onClick","onMousemove"],Vv=["onMousemove"],Zv={class:"title"},Yv={class:"list"},Xv=["onClick"],Jv={__name:"classify",emits:["getStoreList"],setup(P,{emit:y}){const o=y,b=E([]),k=E([]),tn=E([]),x=E(-1),Y=E(-1),an=E(-1),cn=E(-1),j=E(!1),X=Ur();(()=>{au({pid:0,page_no:1,page_size:30,level:1,store_id:X.userInfo.store_id}).then(B=>{b.value=B.data.lists,x.value=-1})})();const q=B=>{au({pid:B,page_no:1,page_size:30,level:2,store_id:X.userInfo.store_id}).then(K=>{k.value=K.data.lists})},A=B=>{au({pid:B,page_no:1,page_size:30,level:3,store_id:X.userInfo.store_id}).then(K=>{tn.value=K.data.lists})},ln=(B=-1,K=1)=>{cn.value=B,j.value=!0;let rn="";console.log(B,K),K==1?(x.value=B,Y.value=-1,an.value=-1,B!=-1&&(rn=b.value[B].id),q(rn),o("getStoreList",{top_cate_id:rn,two_cate_id:null},!0)):K==2&&(Y.value=B,an.value=-1,B!=-1&&(rn=k.value[B].id),A(rn),o("getStoreList",{two_cate_id:rn},!0))};return(B,K)=>{const rn=sn("el-popover");return D(),Q("div",{class:"classify",onMouseout:K[2]||(K[2]=H=>j.value?j.value=!1:j.value=!0)},[v("div",{class:Wr(["itemP",{"itemP-active":x.value==-1}]),onClick:K[0]||(K[0]=H=>ln(-1))},N("全部"),2),(D(!0),Q(Mt,null,Ut(b.value,(H,on)=>(D(),Fe(rn,{placement:"left",width:"20rem",trigger:"click",key:on,visible:on==x.value&&cn.value==on},{reference:dn(()=>[v("div",{class:Wr(["itemP",{"itemP-active":on==x.value}]),onClick:hn=>ln(on),onMousemove:hn=>cn.value=on},N(H.name),43,qv)]),default:dn(()=>[v("div",{class:"active-card",onMouseout:K[1]||(K[1]=hn=>cn.value=-1),onMousemove:hn=>cn.value=on},[v("div",Zv,N(H.name),1),v("div",Yv,[(D(!0),Q(Mt,null,Ut(k.value,(hn,V)=>(D(),Q("div",{class:Wr({"list-active":V==Y.value}),link:"",type:"primary",key:hn.id,onClick:$=>ln(V,2)},N(hn.name),11,Xv))),128))])],40,Vv)]),_:2},1032,["visible"]))),128))],32)}}},Qv=ct(Jv,[["__scopeId","data-v-4d5623b0"]]),Mr=class Mr{constructor(){fu(this,"loadingInstance",null)}static getInstance(){return this.instance??(this.instance=new Mr)}msg(y){qe.info(y)}msgError(y){y!=="Network Error"&&qe.error(y)}msgSuccess(y){qe.success(y)}msgWarning(y){qe.warning(y)}alert(y){at.alert(y,"系统提示")}alertError(y){at.alert(y,"系统提示",{type:"error"})}alertSuccess(y){at.alert(y,"系统提示",{type:"success"})}alertWarning(y){at.alert(y,"系统提示",{type:"warning"})}notify(y){Br.info(y)}notifyError(y){Br.error(y)}notifySuccess(y){Br.success(y)}notifyWarning(y){Br.warning(y)}confirm(y){return at.confirm(y,"温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})}prompt(y,o,b){return at.prompt(y,o,{confirmButtonText:"确定",cancelButtonText:"取消",...b})}loading(y){this.loadingInstance=Zp.service({lock:!0,text:y})}closeLoading(){var y;(y=this.loadingInstance)==null||y.close()}};fu(Mr,"instance",null);let cu=Mr;const jv=cu.getInstance(),n1={class:"my-card"},h1={__name:"index",setup(P){const y=E(null),o=E(null),b=E(null),k=E(null),tn=E([]),x=Yp({off_activity:"",op_price:"",price:""}),Y=Ur(),an=Xp(),cn=E({page_no:1,page_size:30}),j=E(!1),X=($={},pn=!1)=>{var C;cn.value={...cn.value,...$},pn&&(tn.value=[],cn.value.page_no=1,yn.value=!1),j.value=!0,Qp({...cn.value,store_id:(C=Y.userInfo)==null?void 0:C.store_id}).then(gn=>{var Pn,$n;j.value=!1;for(let Bn in gn.data.extend)x[Bn]=gn.data.extend[Bn];(($n=(Pn=gn.data)==null?void 0:Pn.lists)==null?void 0:$n.length){yn.value||X($)};function A($){return/^\d+$/.test($)}const ln=($,pn="")=>{console.log($,pn);let C={product_id:$.product_id,cart_num:$.cart_num};Yo(C).then(gn=>{o.value.getList()})},B=($,pn)=>{y.value.setForm($,"add"),y.value.show(!0)},K=$=>{y.value.setForm($,"edit"),y.value.show(!0)},rn=E({}),H=async()=>{var gn,Pn;let $=o.value.list.map($n=>$n.id),pn={cart_id:$,uid:((Pn=(gn=o.value)==null?void 0:gn.userInfo)==null?void 0:Pn.uid)||""},{data:C}=await zp(pn);C.reservation>0&&await jv.confirm("部分商品暂无现货, 需要次日提货, 是否确认购买?"),o.value.discounts>0&&(pn.deduction_price=o.value.discounts.toFixed(2),pn.pay_type="micropay"),kp(pn).then($n=>{var Bn,ae,Ve;rn.value=$n.data.order,k.value.setForm({data:$n.data.order,reservation:C.reservation,cart_id:$,uid:((ae=(Bn=o.value)==null?void 0:Bn.userInfo)==null?void 0:ae.uid)||"",is_storage:(Ve=o.value)!=null&&Ve.is_storage?1:0})}),k.value.drawer=!0},on=()=>{var $,pn,C;if(($=o.value)!=null&&$.is_storage&&!((C=(pn=o.value)==null?void 0:pn.userInfo)!=null&&C.uid))return qe.error("选择用户才可以存货");H()},hn=($=null)=>{setTimeout(()=>{o.value.resetView()})},V=()=>{an.name=="saleHome"&&(!k.value.drawer&&o.value.list.length>0?on():k.value.beforeClose())};return Dt(()=>{X(),re.on("F9",V)}),Nt(()=>{re.off("F9",V)}),($,pn)=>(D(),Q("div",n1,[U(iv,{ref_key:"orderRef",ref:o,onGoPay:on,onEditPupop:K},null,512),U(Zo),U(Sv,{ref_key:"shopRef",ref:b,style:{flex:"1"},storeList:tn.value,priceKey:x,loading:j.value,onGetStoreList:X,onChangeItem:B,onLoadMore:q},null,8,["storeList","priceKey","loading"]),U(kv,{ref_key:"pupopRef",ref:y,priceKey:x,onChangeItem:ln},null,8,["priceKey"]),U(Zo),U(Qv,{ref:"classifyRef",onGetStoreList:X},null,512),U(jp,{ref_key:"payRef",ref:k,onPaySuccess:hn},null,512)]))}};export{h1 as default}; diff --git a/dist/assets/index-BwYPA3MM.js b/dist/assets/index-BwYPA3MM.js index 205ed8b..486eb86 100644 --- a/dist/assets/index-BwYPA3MM.js +++ b/dist/assets/index-BwYPA3MM.js @@ -24,4 +24,4 @@ __p += '`),q&&(v+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+v+`return __p -}`;var F=Ko(function(){return J(s,A+"return "+v).apply(o,l)});if(F.source=v,Xi(F))throw F;return F}function Gd(n){return nn(n).toLowerCase()}function zd(n){return nn(n).toUpperCase()}function Hd(n,e,t){if(n=nn(n),n&&(t||e===o))return Yu(n);if(!n||!(e=Hn(e)))return n;var r=ue(n),i=ue(e),s=Xu(r,i),l=Ju(r,i)+1;return $e(r,s,l).join("")}function kd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.slice(0,ju(n)+1);if(!n||!(e=Hn(e)))return n;var r=ue(n),i=Ju(r,ue(e))+1;return $e(r,0,i).join("")}function qd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.replace(Xr,"");if(!n||!(e=Hn(e)))return n;var r=ue(n),i=Xu(r,ue(e));return $e(r,i).join("")}function Vd(n,e){var t=j,r=bn;if(wn(e)){var i="separator"in e?e.separator:i;t="length"in e?$(e.length):t,r="omission"in e?Hn(e.omission):r}n=nn(n);var s=n.length;if(Xe(n)){var l=ue(n);s=l.length}if(t>=s)return n;var f=t-Je(r);if(f<1)return r;var c=l?$e(l,0,f).join(""):n.slice(0,f);if(i===o)return c+r;if(l&&(f+=c.length-f),Ji(i)){if(n.slice(f).search(i)){var d,p=c;for(i.global||(i=_i(i.source,nn(gu.exec(i))+"g")),i.lastIndex=0;d=i.exec(p);)var v=d.index;c=c.slice(0,v===o?f:v)}}else if(n.indexOf(Hn(i),f)!=f){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Zd(n){return n=nn(n),n&&il.test(n)?n.replace(du,If):n}var Yd=it(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),nu=Ks("toUpperCase");function No(n,e,t){return n=nn(n),e=t?o:e,e===o?mf(n)?Rf(n):ff(n):n.match(e)||[]}var Ko=U(function(n,e){try{return Gn(n,o,e)}catch(t){return Xi(t)?t:new b(t)}}),Xd=xe(function(n,e){return Yn(e,function(t){t=de(t),we(n,t,Zi(n[t],n))}),n});function Jd(n){var e=n==null?0:n.length,t=C();return n=e?mn(n,function(r){if(typeof r[1]!="function")throw new Xn(x);return[t(r[0]),r[1]]}):[],U(function(r){for(var i=-1;++ice)return[];var t=_n,r=On(n,_n);e=C(e),n-=_n;for(var i=ai(r,e);++t0||e<0)?new z(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==o&&(e=$(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(_n)},he(z.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);i&&(u.prototype[e]=function(){var l=this.__wrapped__,f=r?[1]:arguments,c=l instanceof z,d=f[0],p=c||E(l),v=function(D){var q=i.apply(u,Se([D],f));return r&&m?q[0]:q};p&&t&&typeof d=="function"&&d.length!=1&&(c=p=!1);var m=this.__chain__,A=!!this.__actions__.length,L=s&&!m,F=c&&!A;if(!s&&p){l=F?l:new z(this);var R=n.apply(l,f);return R.__actions__.push({func:Cr,args:[v],thisArg:o}),new Jn(R,m)}return L&&F?n.apply(this,f):(R=this.thru(v),L?r?R.value()[0]:R.value():R)})}),Yn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Xt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return e.apply(E(s)?s:[],i)}return this[t](function(l){return e.apply(E(l)?l:[],i)})}}),he(z.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";un.call(et,r)||(et[r]=[]),et[r].push({name:e,func:t})}}),et[gr(o,M).name]=[{name:"wrapper",func:o}],z.prototype.clone=Zf,z.prototype.reverse=Yf,z.prototype.value=Xf,u.prototype.at=Lh,u.prototype.chain=Rh,u.prototype.commit=Sh,u.prototype.next=bh,u.prototype.plant=Th,u.prototype.reverse=Oh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ph,u.prototype.first=u.prototype.head,mt&&(u.prototype[mt]=Eh),u},Qe=Sf();Be?((Be.exports=Qe)._=Qe,ti._=Qe):En._=Qe}).call(Pt)})(Fr,Fr.exports);var Zv=Fr.exports;const Yv=Mp(Zv),Dt=K=>(au("data-v-7d75d07a"),K=K(),cu(),K),Xv={class:"my-order"},Jv=Dt(()=>g("div",{class:"nav-item-label"},"搜索 (Shift)",-1)),Qv={class:"nav-item-input"},jv={class:"shop-list","infinite-scroll-distance":1e3,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},ng=["onClick"],eg={class:"shop-name"},tg={key:0,class:"shop-price"},rg=Dt(()=>g("span",{class:"unit-name"},"活动价:",-1)),ig={key:0,class:"unit-name"},ug={key:1,class:"shop-price"},sg=Dt(()=>g("span",{class:"unit-name"},"原价: ",-1)),og={class:"unit-name del"},lg={key:2,class:"shop-price"},fg={class:"unit-name"},ag={key:3,class:"no-stock"},cg=Dt(()=>g("div",null,[g("span",null,"暂无"),g("span",null,"库存")],-1)),hg=[cg],_g={key:4,class:"no-stock"},dg=Dt(()=>g("div",null,[g("span",null,"平台"),g("span",null,"关闭")],-1)),pg=[dg],vg={key:1,class:"no-data"},gg={__name:"shop",props:{storeList:{type:Array,default:()=>[]},priceKey:{type:Object,default:()=>({})},loading:{type:Boolean,default:()=>!1}},emits:["getStoreList","changeItem","loadMore"],setup(K,{expose:An,emit:o}){const T=S(null),H=o,tn=S(""),x=()=>{H("loadMore",{store_name_code:tn.value})},V=y=>{if(y.is_used==0)return $t.error("该商品已被平台关闭");if(y.stock==0)return $t.warning("该商品无库存");H("changeItem",y)},cn=Yv.throttle(()=>{let y={store_name:tn.value};H("getStoreList",y,!0)},300);An({name:tn,inputBlur:()=>{var y;(y=T.value)==null||y.blur()}});const Q=S(!1),Z=()=>{Q.value=!0},yn=()=>{Q.value=!1},k=()=>{var y;(y=T.value)==null||y.focus()};return Ut(()=>{lu(()=>{var y;(y=T.value)==null||y.focus(),Z()}),te.on("shift",k)}),Mt(()=>{te.off("shift",k)}),(y,fn)=>{const P=en("el-input"),M=en("Search"),rn=en("el-icon"),G=en("el-button"),sn=en("el-image"),on=en("el-space"),Y=en("el-empty"),O=Ft("loading"),gn=Ft("infinite-scroll");return B(),X("div",Xv,[g("div",{class:$r(["header-nav",{"input-focus":Q.value}])},[Jv,g("div",Qv,[W(P,{modelValue:tn.value,"onUpdate:modelValue":fn[0]||(fn[0]=I=>tn.value=I),placeholder:" 搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索",clearable:"",ref_key:"codeRef",ref:T,onFocus:Z,onBlur:yn,onKeyup:qo(Pr(cn),["enter"]),onClear:Pr(cn)},null,8,["modelValue","onKeyup","onClear"])]),g("div",{class:"nav-item-btn",onClick:fn[1]||(fn[1]=(...I)=>Pr(cn)&&Pr(cn)(...I))},[W(G,{class:"btn",type:"primary"},{default:pn(()=>[W(rn,null,{default:pn(()=>[W(M)]),_:1})]),_:1})])],2),fu((B(),X("div",jv,[K.storeList.length?(B(),We(on,{key:0,wrap:"",size:14},{default:pn(()=>[(B(!0),X(Wt,null,Bt(K.storeList,(I,j)=>(B(),X("div",{class:"shop-item",key:j,onClick:bn=>V(I)},[W(sn,{loading:"lazy",src:I.image},null,8,["src"]),g("div",eg,N(I.store_name),1),K.priceKey.off_activity==1?(B(),X("div",tg,[rg,ln(" ¥"),g("span",null,N(I[K.priceKey.price]),1),I.unit_name?(B(),X("span",ig,"/"+N(I.unit_name),1)):fe("",!0)])):fe("",!0),K.priceKey.off_activity==1?(B(),X("div",ug,[sg,ln(),g("span",og,"¥"+N(I[K.priceKey.op_price])+" /"+N(I.unit_name),1)])):(B(),X("div",lg,[ln(" ¥"),g("span",null,N(I[K.priceKey.op_price]),1),g("span",fg,"/"+N(I.unit_name),1)])),I.stock==0?(B(),X("div",ag,hg)):fe("",!0),I.is_used==0?(B(),X("div",_g,pg)):fe("",!0)],8,ng))),128))]),_:1})):fe("",!0),K.storeList.length?fe("",!0):(B(),X("div",vg,[W(Y,{"image-size":200,description:"没有找到对应商品"})]))])),[[O,K.loading],[gn,x]])])}}},mg=lt(gg,[["__scopeId","data-v-7d75d07a"]]),Vo=K=>(au("data-v-6c040b11"),K=K(),cu(),K),wg={class:"shop"},yg={class:"shop-info"},xg={class:"shop-info-left"},Ag={class:"shop-info-right"},Ig={class:"shop-info-right-top"},Cg={key:0,class:"shop-info-right-price"},Lg=Vo(()=>g("span",{class:"unit-name"},"活动价:",-1)),Rg={key:0,class:"unit-name"},Sg={key:1,class:"shop-info-right-price"},bg=Vo(()=>g("span",{class:"unit-name"},"原价: ",-1)),Eg={class:"unit-name del"},Tg={key:2,class:"shop-info-right-price"},Og={class:"unit-name"},Pg={class:"shop-sku"},$g={class:"title"},Fg={class:"sku"},Wg={class:"dialog-footer"},Bg={__name:"pupop",props:{priceKey:{type:Object,default:()=>({})}},emits:["changeItem"],setup(K,{expose:An,emit:o}){const T=S(!1),H=S(null),tn=k=>{T.value=k},x=S({}),V=S(!1),cn=S("add"),hn=(k,y="add")=>{cn.value=y,x.value=JSON.parse(JSON.stringify(k))},Q=o,Z=()=>{x.value.cart_num||(x.value.cart_num=x.value.batch>0?x.value.batch:1),Q("changeItem",x.value),T.value=!1};An({show:tn,setForm:hn});const yn=()=>{T.value&&Z()};return Ut(()=>{te.on("enter",yn)}),Mt(()=>{te.off("enter",yn)}),(k,y)=>{const fn=en("el-image"),P=en("el-input-number"),M=en("el-button"),rn=en("el-dialog"),G=Ft("loading");return B(),We(rn,{modelValue:T.value,"onUpdate:modelValue":y[1]||(y[1]=sn=>T.value=sn),title:"购买数量",width:"650",onOpened:y[2]||(y[2]=sn=>H.value.focus())},Dp({default:pn(()=>[fu((B(),X("div",wg,[g("div",yg,[g("div",xg,[W(fn,{loading:"lazy",src:x.value.image},null,8,["src"])]),g("div",Ag,[g("div",Ig,N(x.value.store_name),1),g("div",null,[K.priceKey.off_activity==1?(B(),X("div",Cg,[Lg,ln(" ¥"),g("span",null,N(x.value[K.priceKey.price]),1),x.value.unit_name?(B(),X("span",Rg,"/"+N(x.value.unit_name),1)):fe("",!0)])):fe("",!0),K.priceKey.off_activity==1?(B(),X("div",Sg,[bg,ln(),g("span",Eg,"¥"+N(x.value[K.priceKey.op_price])+" /"+N(x.value.unit_name),1)])):(B(),X("div",Tg,[ln(" ¥"),g("span",null,N(x.value[K.priceKey.op_price]),1),g("span",Og,"/"+N(x.value.unit_name),1)]))])])]),g("div",Pg,[g("div",$g,"购买数量 ( "+N(x.value.unit_name)+" )",1),g("div",Fg,[W(P,{ref_key:"inputRef",ref:H,modelValue:x.value.cart_num,"onUpdate:modelValue":y[0]||(y[0]=sn=>x.value.cart_num=sn),placeholder:`请输入数量(默认为${+x.value.batch>0?x.value.batch:"1"})`,min:+x.value.batch>0?+x.value.batch:1,"step-strictly":"",step:1,style:{width:"20rem"},size:"large"},null,8,["modelValue","placeholder","min"])])])])),[[G,V.value]])]),_:2},[cn.value!="add"&&x.value.attr&&x.value.attr.length==1?void 0:{name:"footer",fn:pn(()=>[g("div",Wg,[W(M,{class:"ok-btn",type:"primary",onClick:Z},{default:pn(()=>[ln(" 确定 (Enter) ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},Ug=lt(Bg,[["__scopeId","data-v-6c040b11"]]),Mg=["onClick","onMousemove"],Dg=["onMousemove"],Ng={class:"title"},Kg={class:"list"},Gg=["onClick"],zg={__name:"classify",emits:["getStoreList"],setup(K,{emit:An}){const o=An,T=S([]),H=S([]),tn=S([]),x=S(-1),V=S(-1),cn=S(-1),hn=S(-1),Q=S(!1),Z=Wr();(()=>{ou({pid:0,page_no:1,page_size:30,level:1,store_id:Z.userInfo.store_id}).then(P=>{T.value=P.data.lists,x.value=-1})})();const k=P=>{ou({pid:P,page_no:1,page_size:30,level:2,store_id:Z.userInfo.store_id}).then(M=>{H.value=M.data.lists})},y=P=>{ou({pid:P,page_no:1,page_size:30,level:3,store_id:Z.userInfo.store_id}).then(M=>{tn.value=M.data.lists})},fn=(P=-1,M=1)=>{hn.value=P,Q.value=!0;let rn="";console.log(P,M),M==1?(x.value=P,V.value=-1,cn.value=-1,P!=-1&&(rn=T.value[P].id),k(rn),o("getStoreList",{top_cate_id:rn,two_cate_id:null},!0)):M==2&&(V.value=P,cn.value=-1,P!=-1&&(rn=H.value[P].id),y(rn),o("getStoreList",{two_cate_id:rn},!0))};return(P,M)=>{const rn=en("el-popover");return B(),X("div",{class:"classify",onMouseout:M[2]||(M[2]=G=>Q.value?Q.value=!1:Q.value=!0)},[g("div",{class:$r(["itemP",{"itemP-active":x.value==-1}]),onClick:M[0]||(M[0]=G=>fn(-1))},N("全部"),2),(B(!0),X(Wt,null,Bt(T.value,(G,sn)=>(B(),We(rn,{placement:"left",width:"20rem",trigger:"click",key:sn,visible:sn==x.value&&hn.value==sn},{reference:pn(()=>[g("div",{class:$r(["itemP",{"itemP-active":sn==x.value}]),onClick:on=>fn(sn),onMousemove:on=>hn.value=sn},N(G.name),43,Mg)]),default:pn(()=>[g("div",{class:"active-card",onMouseout:M[1]||(M[1]=on=>hn.value=-1),onMousemove:on=>hn.value=sn},[g("div",Ng,N(G.name),1),g("div",Kg,[(B(!0),X(Wt,null,Bt(H.value,(on,Y)=>(B(),X("div",{class:$r({"list-active":Y==V.value}),link:"",type:"primary",key:on.id,onClick:O=>fn(Y,2)},N(on.name),11,Gg))),128))])],40,Dg)]),_:2},1032,["visible"]))),128))],32)}}},Hg=lt(zg,[["__scopeId","data-v-4d5623b0"]]),kg={class:"my-card"},t1={__name:"index",setup(K){const An=S(null),o=S(null),T=S(null),H=S(null),tn=S([]),x=Np({off_activity:"",op_price:"",price:""}),V=Wr(),cn=Kp(),hn=S({page_no:1,page_size:30}),Q=S(!1),Z=(O={},gn=!1)=>{var I;hn.value={...hn.value,...O},gn&&(tn.value=[],hn.value.page_no=1,yn.value=!1),Q.value=!0,zp({...hn.value,store_id:(I=V.userInfo)==null?void 0:I.store_id}).then(j=>{var bn,Kn;Q.value=!1;for(let $n in j.data.extend)x[$n]=j.data.extend[$n];((Kn=(bn=j.data)==null?void 0:bn.lists)==null?void 0:Kn.length){yn.value||Z(O)};function y(O){return/^\d+$/.test(O)}const fn=(O,gn="")=>{console.log(O,gn);let I={product_id:O.product_id,cart_num:O.cart_num};ko(I).then(j=>{o.value.getList()})},P=(O,gn)=>{An.value.setForm(O,"add"),An.value.show(!0)},M=O=>{An.value.setForm(O,"edit"),An.value.show(!0)},rn=S({}),G=()=>{var I,j;let O=o.value.list.map(bn=>bn.id),gn={cart_id:O,uid:((j=(I=o.value)==null?void 0:I.userInfo)==null?void 0:j.uid)||""};o.value.discounts>0&&(gn.deduction_price=o.value.discounts.toFixed(2),gn.pay_type="micropay"),Up(gn).then(bn=>{var Kn,$n,ae;rn.value=bn.data.order,H.value.setForm({data:bn.data.order,cart_id:O,uid:(($n=(Kn=o.value)==null?void 0:Kn.userInfo)==null?void 0:$n.uid)||"",is_storage:(ae=o.value)!=null&&ae.is_storage?1:0})})},sn=()=>{var O,gn,I;if((O=o.value)!=null&&O.is_storage&&!((I=(gn=o.value)==null?void 0:gn.userInfo)!=null&&I.uid))return $t.error("选择用户才可以存货");G(),H.value.drawer=!0},on=(O=null)=>{setTimeout(()=>{o.value.resetView()})},Y=()=>{cn.name=="saleHome"&&(!H.value.drawer&&o.value.list.length>0?sn():H.value.beforeClose())};return Ut(()=>{Z(),te.on("F9",Y)}),Mt(()=>{te.off("F9",Y)}),(O,gn)=>(B(),X("div",kg,[W(Vv,{ref_key:"orderRef",ref:o,onGoPay:sn,onEditPupop:M},null,512),W(Ho),W(mg,{ref_key:"shopRef",ref:T,style:{flex:"1"},storeList:tn.value,priceKey:x,loading:Q.value,onGetStoreList:Z,onChangeItem:P,onLoadMore:k},null,8,["storeList","priceKey","loading"]),W(Ug,{ref_key:"pupopRef",ref:An,priceKey:x,onChangeItem:fn},null,8,["priceKey"]),W(Ho),W(Hg,{ref:"classifyRef",onGetStoreList:Z},null,512),W(Hp,{ref_key:"payRef",ref:H,onPaySuccess:on},null,512)]))}};export{t1 as default}; +}`;var F=Ko(function(){return J(s,A+"return "+v).apply(o,l)});if(F.source=v,Xi(F))throw F;return F}function Gd(n){return nn(n).toLowerCase()}function zd(n){return nn(n).toUpperCase()}function Hd(n,e,t){if(n=nn(n),n&&(t||e===o))return Yu(n);if(!n||!(e=Hn(e)))return n;var r=ue(n),i=ue(e),s=Xu(r,i),l=Ju(r,i)+1;return $e(r,s,l).join("")}function kd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.slice(0,ju(n)+1);if(!n||!(e=Hn(e)))return n;var r=ue(n),i=Ju(r,ue(e))+1;return $e(r,0,i).join("")}function qd(n,e,t){if(n=nn(n),n&&(t||e===o))return n.replace(Xr,"");if(!n||!(e=Hn(e)))return n;var r=ue(n),i=Xu(r,ue(e));return $e(r,i).join("")}function Vd(n,e){var t=j,r=bn;if(wn(e)){var i="separator"in e?e.separator:i;t="length"in e?$(e.length):t,r="omission"in e?Hn(e.omission):r}n=nn(n);var s=n.length;if(Xe(n)){var l=ue(n);s=l.length}if(t>=s)return n;var f=t-Je(r);if(f<1)return r;var c=l?$e(l,0,f).join(""):n.slice(0,f);if(i===o)return c+r;if(l&&(f+=c.length-f),Ji(i)){if(n.slice(f).search(i)){var d,p=c;for(i.global||(i=_i(i.source,nn(gu.exec(i))+"g")),i.lastIndex=0;d=i.exec(p);)var v=d.index;c=c.slice(0,v===o?f:v)}}else if(n.indexOf(Hn(i),f)!=f){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Zd(n){return n=nn(n),n&&il.test(n)?n.replace(du,If):n}var Yd=it(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),nu=Ks("toUpperCase");function No(n,e,t){return n=nn(n),e=t?o:e,e===o?mf(n)?Rf(n):ff(n):n.match(e)||[]}var Ko=U(function(n,e){try{return Gn(n,o,e)}catch(t){return Xi(t)?t:new b(t)}}),Xd=xe(function(n,e){return Yn(e,function(t){t=de(t),we(n,t,Zi(n[t],n))}),n});function Jd(n){var e=n==null?0:n.length,t=C();return n=e?mn(n,function(r){if(typeof r[1]!="function")throw new Xn(x);return[t(r[0]),r[1]]}):[],U(function(r){for(var i=-1;++ice)return[];var t=_n,r=On(n,_n);e=C(e),n-=_n;for(var i=ai(r,e);++t0||e<0)?new z(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==o&&(e=$(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(_n)},he(z.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);i&&(u.prototype[e]=function(){var l=this.__wrapped__,f=r?[1]:arguments,c=l instanceof z,d=f[0],p=c||E(l),v=function(D){var q=i.apply(u,Se([D],f));return r&&m?q[0]:q};p&&t&&typeof d=="function"&&d.length!=1&&(c=p=!1);var m=this.__chain__,A=!!this.__actions__.length,L=s&&!m,F=c&&!A;if(!s&&p){l=F?l:new z(this);var R=n.apply(l,f);return R.__actions__.push({func:Cr,args:[v],thisArg:o}),new Jn(R,m)}return L&&F?n.apply(this,f):(R=this.thru(v),L?r?R.value()[0]:R.value():R)})}),Yn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Xt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return e.apply(E(s)?s:[],i)}return this[t](function(l){return e.apply(E(l)?l:[],i)})}}),he(z.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";un.call(et,r)||(et[r]=[]),et[r].push({name:e,func:t})}}),et[gr(o,M).name]=[{name:"wrapper",func:o}],z.prototype.clone=Zf,z.prototype.reverse=Yf,z.prototype.value=Xf,u.prototype.at=Lh,u.prototype.chain=Rh,u.prototype.commit=Sh,u.prototype.next=bh,u.prototype.plant=Th,u.prototype.reverse=Oh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ph,u.prototype.first=u.prototype.head,mt&&(u.prototype[mt]=Eh),u},Qe=Sf();Be?((Be.exports=Qe)._=Qe,ti._=Qe):En._=Qe}).call(Pt)})(Fr,Fr.exports);var Zv=Fr.exports;const Yv=Mp(Zv),Dt=K=>(au("data-v-7d75d07a"),K=K(),cu(),K),Xv={class:"my-order"},Jv=Dt(()=>g("div",{class:"nav-item-label"},"搜索 (Shift)",-1)),Qv={class:"nav-item-input"},jv={class:"shop-list","infinite-scroll-distance":1e3,"infinite-scroll-delay":500,"infinite-scroll-immediate":!1,style:{overflow:"auto"}},ng=["onClick"],eg={class:"shop-name"},tg={key:0,class:"shop-price"},rg=Dt(()=>g("span",{class:"unit-name"},"活动价:",-1)),ig={key:0,class:"unit-name"},ug={key:1,class:"shop-price"},sg=Dt(()=>g("span",{class:"unit-name"},"原价: ",-1)),og={class:"unit-name del"},lg={key:2,class:"shop-price"},fg={class:"unit-name"},ag={key:3,class:"no-stock"},cg=Dt(()=>g("div",null,[g("span",null,"暂无"),g("span",null,"库存")],-1)),hg=[cg],_g={key:4,class:"no-stock"},dg=Dt(()=>g("div",null,[g("span",null,"平台"),g("span",null,"关闭")],-1)),pg=[dg],vg={key:1,class:"no-data"},gg={__name:"shop",props:{storeList:{type:Array,default:()=>[]},priceKey:{type:Object,default:()=>({})},loading:{type:Boolean,default:()=>!1}},emits:["getStoreList","changeItem","loadMore"],setup(K,{expose:An,emit:o}){const T=S(null),H=o,tn=S(""),x=()=>{H("loadMore",{store_name:tn.value})},V=y=>{if(y.is_used==0)return $t.error("该商品已被平台关闭");if(y.stock==0)return $t.warning("该商品无库存");H("changeItem",y)},cn=Yv.throttle(()=>{let y={store_name:tn.value};H("getStoreList",y,!0)},300);An({name:tn,inputBlur:()=>{var y;(y=T.value)==null||y.blur()}});const Q=S(!1),Z=()=>{Q.value=!0},yn=()=>{Q.value=!1},k=()=>{var y;(y=T.value)==null||y.focus()};return Ut(()=>{lu(()=>{var y;(y=T.value)==null||y.focus(),Z()}),te.on("shift",k)}),Mt(()=>{te.off("shift",k)}),(y,fn)=>{const P=en("el-input"),M=en("Search"),rn=en("el-icon"),G=en("el-button"),sn=en("el-image"),on=en("el-space"),Y=en("el-empty"),O=Ft("loading"),gn=Ft("infinite-scroll");return B(),X("div",Xv,[g("div",{class:$r(["header-nav",{"input-focus":Q.value}])},[Jv,g("div",Qv,[W(P,{modelValue:tn.value,"onUpdate:modelValue":fn[0]||(fn[0]=I=>tn.value=I),placeholder:" 搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索",clearable:"",ref_key:"codeRef",ref:T,onFocus:Z,onBlur:yn,onKeyup:qo(Pr(cn),["enter"]),onClear:Pr(cn)},null,8,["modelValue","onKeyup","onClear"])]),g("div",{class:"nav-item-btn",onClick:fn[1]||(fn[1]=(...I)=>Pr(cn)&&Pr(cn)(...I))},[W(G,{class:"btn",type:"primary"},{default:pn(()=>[W(rn,null,{default:pn(()=>[W(M)]),_:1})]),_:1})])],2),fu((B(),X("div",jv,[K.storeList.length?(B(),We(on,{key:0,wrap:"",size:14},{default:pn(()=>[(B(!0),X(Wt,null,Bt(K.storeList,(I,j)=>(B(),X("div",{class:"shop-item",key:j,onClick:bn=>V(I)},[W(sn,{loading:"lazy",src:I.image},null,8,["src"]),g("div",eg,N(I.store_name),1),K.priceKey.off_activity==1?(B(),X("div",tg,[rg,ln(" ¥"),g("span",null,N(I[K.priceKey.price]),1),I.unit_name?(B(),X("span",ig,"/"+N(I.unit_name),1)):fe("",!0)])):fe("",!0),K.priceKey.off_activity==1?(B(),X("div",ug,[sg,ln(),g("span",og,"¥"+N(I[K.priceKey.op_price])+" /"+N(I.unit_name),1)])):(B(),X("div",lg,[ln(" ¥"),g("span",null,N(I[K.priceKey.op_price]),1),g("span",fg,"/"+N(I.unit_name),1)])),I.stock==0?(B(),X("div",ag,hg)):fe("",!0),I.is_used==0?(B(),X("div",_g,pg)):fe("",!0)],8,ng))),128))]),_:1})):fe("",!0),K.storeList.length?fe("",!0):(B(),X("div",vg,[W(Y,{"image-size":200,description:"没有找到对应商品"})]))])),[[O,K.loading],[gn,x]])])}}},mg=lt(gg,[["__scopeId","data-v-7d75d07a"]]),Vo=K=>(au("data-v-6c040b11"),K=K(),cu(),K),wg={class:"shop"},yg={class:"shop-info"},xg={class:"shop-info-left"},Ag={class:"shop-info-right"},Ig={class:"shop-info-right-top"},Cg={key:0,class:"shop-info-right-price"},Lg=Vo(()=>g("span",{class:"unit-name"},"活动价:",-1)),Rg={key:0,class:"unit-name"},Sg={key:1,class:"shop-info-right-price"},bg=Vo(()=>g("span",{class:"unit-name"},"原价: ",-1)),Eg={class:"unit-name del"},Tg={key:2,class:"shop-info-right-price"},Og={class:"unit-name"},Pg={class:"shop-sku"},$g={class:"title"},Fg={class:"sku"},Wg={class:"dialog-footer"},Bg={__name:"pupop",props:{priceKey:{type:Object,default:()=>({})}},emits:["changeItem"],setup(K,{expose:An,emit:o}){const T=S(!1),H=S(null),tn=k=>{T.value=k},x=S({}),V=S(!1),cn=S("add"),hn=(k,y="add")=>{cn.value=y,x.value=JSON.parse(JSON.stringify(k))},Q=o,Z=()=>{x.value.cart_num||(x.value.cart_num=x.value.batch>0?x.value.batch:1),Q("changeItem",x.value),T.value=!1};An({show:tn,setForm:hn});const yn=()=>{T.value&&Z()};return Ut(()=>{te.on("enter",yn)}),Mt(()=>{te.off("enter",yn)}),(k,y)=>{const fn=en("el-image"),P=en("el-input-number"),M=en("el-button"),rn=en("el-dialog"),G=Ft("loading");return B(),We(rn,{modelValue:T.value,"onUpdate:modelValue":y[1]||(y[1]=sn=>T.value=sn),title:"购买数量",width:"650",onOpened:y[2]||(y[2]=sn=>H.value.focus())},Dp({default:pn(()=>[fu((B(),X("div",wg,[g("div",yg,[g("div",xg,[W(fn,{loading:"lazy",src:x.value.image},null,8,["src"])]),g("div",Ag,[g("div",Ig,N(x.value.store_name),1),g("div",null,[K.priceKey.off_activity==1?(B(),X("div",Cg,[Lg,ln(" ¥"),g("span",null,N(x.value[K.priceKey.price]),1),x.value.unit_name?(B(),X("span",Rg,"/"+N(x.value.unit_name),1)):fe("",!0)])):fe("",!0),K.priceKey.off_activity==1?(B(),X("div",Sg,[bg,ln(),g("span",Eg,"¥"+N(x.value[K.priceKey.op_price])+" /"+N(x.value.unit_name),1)])):(B(),X("div",Tg,[ln(" ¥"),g("span",null,N(x.value[K.priceKey.op_price]),1),g("span",Og,"/"+N(x.value.unit_name),1)]))])])]),g("div",Pg,[g("div",$g,"购买数量 ( "+N(x.value.unit_name)+" )",1),g("div",Fg,[W(P,{ref_key:"inputRef",ref:H,modelValue:x.value.cart_num,"onUpdate:modelValue":y[0]||(y[0]=sn=>x.value.cart_num=sn),placeholder:`请输入数量(默认为${+x.value.batch>0?x.value.batch:"1"})`,min:+x.value.batch>0?+x.value.batch:1,"step-strictly":"",step:1,style:{width:"20rem"},size:"large"},null,8,["modelValue","placeholder","min"])])])])),[[G,V.value]])]),_:2},[cn.value!="add"&&x.value.attr&&x.value.attr.length==1?void 0:{name:"footer",fn:pn(()=>[g("div",Wg,[W(M,{class:"ok-btn",type:"primary",onClick:Z},{default:pn(()=>[ln(" 确定 (Enter) ")]),_:1})])]),key:"0"}]),1032,["modelValue"])}}},Ug=lt(Bg,[["__scopeId","data-v-6c040b11"]]),Mg=["onClick","onMousemove"],Dg=["onMousemove"],Ng={class:"title"},Kg={class:"list"},Gg=["onClick"],zg={__name:"classify",emits:["getStoreList"],setup(K,{emit:An}){const o=An,T=S([]),H=S([]),tn=S([]),x=S(-1),V=S(-1),cn=S(-1),hn=S(-1),Q=S(!1),Z=Wr();(()=>{ou({pid:0,page_no:1,page_size:30,level:1,store_id:Z.userInfo.store_id}).then(P=>{T.value=P.data.lists,x.value=-1})})();const k=P=>{ou({pid:P,page_no:1,page_size:30,level:2,store_id:Z.userInfo.store_id}).then(M=>{H.value=M.data.lists})},y=P=>{ou({pid:P,page_no:1,page_size:30,level:3,store_id:Z.userInfo.store_id}).then(M=>{tn.value=M.data.lists})},fn=(P=-1,M=1)=>{hn.value=P,Q.value=!0;let rn="";console.log(P,M),M==1?(x.value=P,V.value=-1,cn.value=-1,P!=-1&&(rn=T.value[P].id),k(rn),o("getStoreList",{top_cate_id:rn,two_cate_id:null},!0)):M==2&&(V.value=P,cn.value=-1,P!=-1&&(rn=H.value[P].id),y(rn),o("getStoreList",{two_cate_id:rn},!0))};return(P,M)=>{const rn=en("el-popover");return B(),X("div",{class:"classify",onMouseout:M[2]||(M[2]=G=>Q.value?Q.value=!1:Q.value=!0)},[g("div",{class:$r(["itemP",{"itemP-active":x.value==-1}]),onClick:M[0]||(M[0]=G=>fn(-1))},N("全部"),2),(B(!0),X(Wt,null,Bt(T.value,(G,sn)=>(B(),We(rn,{placement:"left",width:"20rem",trigger:"click",key:sn,visible:sn==x.value&&hn.value==sn},{reference:pn(()=>[g("div",{class:$r(["itemP",{"itemP-active":sn==x.value}]),onClick:on=>fn(sn),onMousemove:on=>hn.value=sn},N(G.name),43,Mg)]),default:pn(()=>[g("div",{class:"active-card",onMouseout:M[1]||(M[1]=on=>hn.value=-1),onMousemove:on=>hn.value=sn},[g("div",Ng,N(G.name),1),g("div",Kg,[(B(!0),X(Wt,null,Bt(H.value,(on,Y)=>(B(),X("div",{class:$r({"list-active":Y==V.value}),link:"",type:"primary",key:on.id,onClick:O=>fn(Y,2)},N(on.name),11,Gg))),128))])],40,Dg)]),_:2},1032,["visible"]))),128))],32)}}},Hg=lt(zg,[["__scopeId","data-v-4d5623b0"]]),kg={class:"my-card"},t1={__name:"index",setup(K){const An=S(null),o=S(null),T=S(null),H=S(null),tn=S([]),x=Np({off_activity:"",op_price:"",price:""}),V=Wr(),cn=Kp(),hn=S({page_no:1,page_size:30}),Q=S(!1),Z=(O={},gn=!1)=>{var I;hn.value={...hn.value,...O},gn&&(tn.value=[],hn.value.page_no=1,yn.value=!1),Q.value=!0,zp({...hn.value,store_id:(I=V.userInfo)==null?void 0:I.store_id}).then(j=>{var bn,Kn;Q.value=!1;for(let $n in j.data.extend)x[$n]=j.data.extend[$n];((Kn=(bn=j.data)==null?void 0:bn.lists)==null?void 0:Kn.length){yn.value||Z(O)};function y(O){return/^\d+$/.test(O)}const fn=(O,gn="")=>{console.log(O,gn);let I={product_id:O.product_id,cart_num:O.cart_num};ko(I).then(j=>{o.value.getList()})},P=(O,gn)=>{An.value.setForm(O,"add"),An.value.show(!0)},M=O=>{An.value.setForm(O,"edit"),An.value.show(!0)},rn=S({}),G=()=>{var I,j;let O=o.value.list.map(bn=>bn.id),gn={cart_id:O,uid:((j=(I=o.value)==null?void 0:I.userInfo)==null?void 0:j.uid)||""};o.value.discounts>0&&(gn.deduction_price=o.value.discounts.toFixed(2),gn.pay_type="micropay"),Up(gn).then(bn=>{var Kn,$n,ae;rn.value=bn.data.order,H.value.setForm({data:bn.data.order,cart_id:O,uid:(($n=(Kn=o.value)==null?void 0:Kn.userInfo)==null?void 0:$n.uid)||"",is_storage:(ae=o.value)!=null&&ae.is_storage?1:0})})},sn=()=>{var O,gn,I;if((O=o.value)!=null&&O.is_storage&&!((I=(gn=o.value)==null?void 0:gn.userInfo)!=null&&I.uid))return $t.error("选择用户才可以存货");G(),H.value.drawer=!0},on=(O=null)=>{setTimeout(()=>{o.value.resetView()})},Y=()=>{cn.name=="saleHome"&&(!H.value.drawer&&o.value.list.length>0?sn():H.value.beforeClose())};return Ut(()=>{Z(),te.on("F9",Y)}),Mt(()=>{te.off("F9",Y)}),(O,gn)=>(B(),X("div",kg,[W(Vv,{ref_key:"orderRef",ref:o,onGoPay:sn,onEditPupop:M},null,512),W(Ho),W(mg,{ref_key:"shopRef",ref:T,style:{flex:"1"},storeList:tn.value,priceKey:x,loading:Q.value,onGetStoreList:Z,onChangeItem:P,onLoadMore:k},null,8,["storeList","priceKey","loading"]),W(Ug,{ref_key:"pupopRef",ref:An,priceKey:x,onChangeItem:fn},null,8,["priceKey"]),W(Ho),W(Hg,{ref:"classifyRef",onGetStoreList:Z},null,512),W(Hp,{ref_key:"payRef",ref:H,onPaySuccess:on},null,512)]))}};export{t1 as default}; diff --git a/src/components/payUser.vue b/src/components/payUser.vue index c4e86d1..29b990c 100644 --- a/src/components/payUser.vue +++ b/src/components/payUser.vue @@ -50,6 +50,8 @@ const form = ref({ price: 0, uid: '', user_ship: '', + village: null, + brigade: null, }); const cart_id = ref([]); const isRePay = ref(false); @@ -109,6 +111,8 @@ const handleEnter = () => { userRechangeAmountApi({ uid: form.value.uid, user_ship: form.value.user_ship, + village: form.value.village, + brigade: form.value.brigade, price: form.value.price, pay_type: pay_type, auth_code: input.value, @@ -326,6 +330,8 @@ const cashBnt = () => { userRechangeAmountApi({ uid: form.value.uid, user_ship: form.value.user_ship, + village: form.value.village, + brigade: form.value.brigade, price: form.value.price, pay_type: 17, }) diff --git a/src/layout/myHeader.vue b/src/layout/myHeader.vue index 59a6b43..0154509 100644 --- a/src/layout/myHeader.vue +++ b/src/layout/myHeader.vue @@ -67,6 +67,7 @@ const printReceipt = (content = "") => { // 小程序订单-预打印 const letPrintReceipt = (content = "") => { + console.log("预打印"); let str = printTicket(content, true) console.log(str); @@ -142,7 +143,7 @@ onUnmounted(() => { justify-content: center; cursor: pointer; "> - + diff --git a/src/views/convert/index.vue b/src/views/convert/index.vue index 30b6935..f950d73 100644 --- a/src/views/convert/index.vue +++ b/src/views/convert/index.vue @@ -41,7 +41,7 @@ onMounted(() => {

订单核销

- +
查询
diff --git a/src/views/order/component/order.vue b/src/views/order/component/order.vue index a81baaf..3bfc835 100644 --- a/src/views/order/component/order.vue +++ b/src/views/order/component/order.vue @@ -129,7 +129,12 @@ onUnmounted(() => {
+ @clear="getOrderList(true)" > +