cashier-mer/build/assets/index-BL1i9waN.js

2 lines
10 KiB
JavaScript
Raw Normal View History

2024-04-06 16:09:17 +08:00
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",st