cashier-mer/dist/assets/index-D2shyUWD.js

2 lines
10 KiB
JavaScript
Raw Normal View History

2024-04-06 10:25:19 +08:00
import{c as W,a as X,b as B,d as Y,o as Z}from"./store-CYL2ip_b.js";import{_ as z,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 C,f as I,F as O,g as M,h as j,i as ee,j as G,k as J,p as K,l as T,m as te,n as oe,u as se}from"./index-8CB-e1T6.js";import{g as ae,s as le}from"./shop-YOMWLVgN.js";import{p as ne}from"./pay-6WPj-hA4.js";const ce={class:"price"},ie={class:"flex"},re={style:{margin:"10px","padding-bottom":"40px"}},ue={style:{color:"#f5222d","font-weight":"bold","margin-left":"1rem"}},de={class:"dialog-footer"},_e={__name:"price",emits:["submit"],setup($,{expose:w,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)},x=b=>{c.value.nowPrice=(r.value*b/100).toFixed(2)},k=m,S=()=>{k("submit",c.value.nowPrice),s.value=!1};return w({show:o}),(b,p)=>{const A=_("el-input"),f=_("el-button"),V=_("el-dialog");return g(),q(V,{modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=a=>s.value=a),title:"订单改价",width:"650"},{footer:y(()=>[e("div",de,[n(f,{class:"ok-btn",type:"primary",onClick:S},{default:y(()=>[v(" 确定 ")]),_:1})])]),default:y(()=>[e("div",ce,[e("div",ie,[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:x},{suffix:y(()=>[v("%")]),_:1},8,["modelValue"])]),e("div",re,[v("改价后金额: "),e("span",ue,"¥"+C(c.value.nowPrice||r.value||" - - "),1)])])]),_:1},8,["modelValue"])}}},pe=z(_e,[["__scopeId","data-v-518d9bc5"]]),ve={class:"my-order"},me={class:"header-nav"},he={class:"nav-item"},fe={class:"order-list"},ge={class:"order-item-info"},ye={class:"order-item-title"},ke={class:"title"},be=["onClick"],$e={class:"order-item-sku"},we=["onClick"],xe={class:"order-item-price"},Ie={class:"order-footer"},Ve={class:"order-total"},Ce={class:"price"},Ae={class:"total-item"},Pe={style:{"font-size":"1.4rem"}},Se={class:"total-item"},Le={class:"update-price"},Fe={class:"order-btn"},De={__name:"order",emits:["goPay","editAttr"],setup($,{expose:w,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&&x(l)},h=l=>{s.value=s.value.filter(t=>t.cart_id!=l),x([l])},x=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()})},V=l=>{o.value=r.value-l,r.value=+l};u(0);const a=u(null),D=()=>{a.value.show(!0,r.value)};return w({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(),I("div",ve,[e("div",me,[e("div",he,[v(" 已选购 "),e("span",null,C(s.value.length),1),v(" 件 ")]),e("div",{class:"nav-item-clear",onClick:c},[n(d,null,{default:y(()=>[n(i)]),_:1}),v("清空 ")])]),e("div",fe,[s.value.length==0?(g(),q(F,{key:0,description:"请点击右侧添加商品"})):(g(!0),I(O,{key:1},M(s.value,(P,Q)=>(g(),I("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",ge,[e("div",ye,[e("div",ke,C(P.spu.store_name),1),e("div",{class:"delete",onClick:U=>h(P.cart_id)},"删除",8,be)]),e("div",$e,[e("span",{style:{display:"flex","align-items":"center"},onClick:U=>A(P)},[v("商品规格: "+C(P.productAttr.sku||"默认规格"),1),n(d,{size:"16",style:{"marg