index-BBcNV3Ms.js 7.0 KB

1
  1. /* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as G,I as F,r as w,m as E,c as d,b as l,a as o,x as m,a5 as b,u as g,w as r,f as L,ai as W,W as $,F as _,h as y,o as n,E as j,s as M,X as Q,t as i,e as C,i as X,ag as Z,Z as H,a9 as J,a0 as P,_ as K}from"./index-hZHbf6Qq.js";import{P as Y}from"./index-C__Mp2q5.js";/* empty css *//* empty css */import{T as ee}from"./index-BqhCx7JE.js";/* empty css */const ae={class:"page-container"},te={class:"search-bar"},le={class:"price-range"},oe={class:"filter-bar"},se={class:"sort-bar"},re={class:"order-list"},ne={class:"order-header"},de={class:"order-info"},ie={class:"order-date"},pe={class:"order-no"},ce={class:"product-list"},ue={class:"product-image"},me={class:"image-placeholder"},ge={class:"product-info"},_e={class:"product-name"},ye={class:"product-spec"},ve={class:"product-spec"},Ve={class:"product-price"},be={class:"price"},fe={class:"quantity"},he={key:0,class:"product-total"},ke={class:"total-price"},xe={class:"product-action"},we=G({__name:"index",setup(Ee){const t=F({pageNum:1,pageSize:10,keyword:"",minPrice:"",maxPrice:"",dateRange:null,category1:"",category2:"",category3:"",brand:"",sortType:"default",priceSort:""}),U=w(100),f={电脑:{台式机:["商用台式机","家用台式机","一体机"],笔记本:["商务本","游戏本","轻薄本"],平板电脑:["安卓平板","iPad","Windows平板"]},办公设备:{打印机:["激光打印机","喷墨打印机","针式打印机"],复印机:["黑白复印机","彩色复印机"],投影仪:["商务投影","家用投影"]},家用电器:{空调:["挂机","柜机","中央空调"],冰箱:["双门冰箱","多门冰箱","对开门冰箱"],洗衣机:["滚筒洗衣机","波轮洗衣机"]}},N=E(()=>t.category1?Object.keys(f[t.category1]||{}):[]),T=E(()=>{var u;return!t.category1||!t.category2?[]:((u=f[t.category1])==null?void 0:u[t.category2])||[]}),S=()=>{t.category2="",t.category3=""},z=()=>{t.category3=""},v=w([{date:"2025/12/05",orderNo:"489283929283298392",totalAmount:"181",products:[{id:1,name:"清华同方超越E500台式机电脑(i3-6100/4G/1T/19.5寸)",spec1:"规格02",spec2:"规格01",price:"181",quantity:1,image:""},{id:2,name:"清华同方超越E500台式机电脑(i3-6100/4G/1T/19.5寸)",spec1:"规格02",spec2:"规格01",price:"181",quantity:1,image:""}]},{date:"2025/12/05",orderNo:"489283929283298393",totalAmount:"181",products:[{id:3,name:"清华同方超越E500台式机电脑(i3-6100/4G/1T/19.5寸)",spec1:"规格02",spec2:"规格01",price:"181",quantity:1,image:""}]}]),q=()=>{},B=u=>{P.success("已将订单商品加入购物车")},A=u=>{P.success("已加入购物车")};return(u,e)=>{const h=j,V=L,I=W,s=Q,c=$,k=X,O=H,R=J;return n(),d("div",ae,[l(g(Y),{title:"历史购买"}),o("div",te,[l(V,{modelValue:t.keyword,"onUpdate:modelValue":e[0]||(e[0]=a=>t.keyword=a),placeholder:"搜索",style:{width:"180px"},clearable:""},{prefix:r(()=>[l(h,null,{default:r(()=>[l(g(M))]),_:1})]),_:1},8,["modelValue"]),o("div",le,[l(V,{modelValue:t.minPrice,"onUpdate:modelValue":e[1]||(e[1]=a=>t.minPrice=a),placeholder:"¥ 最高价",style:{width:"100px"}},null,8,["modelValue"]),e[12]||(e[12]=o("span",{class:"range-separator"},"—",-1)),l(V,{modelValue:t.maxPrice,"onUpdate:modelValue":e[2]||(e[2]=a=>t.maxPrice=a),placeholder:"¥ 最低价",style:{width:"100px"}},null,8,["modelValue"])]),l(I,{modelValue:t.dateRange,"onUpdate:modelValue":e[3]||(e[3]=a=>t.dateRange=a),type:"daterange","range-separator":"—","start-placeholder":"请选择购买时间","end-placeholder":"",style:{width:"240px"}},null,8,["modelValue"])]),o("div",oe,[e[13]||(e[13]=o("span",{class:"filter-label"},"商品类别",-1)),l(c,{modelValue:t.category1,"onUpdate:modelValue":e[4]||(e[4]=a=>t.category1=a),placeholder:"请选择",style:{width:"100px"},clearable:"",onChange:S},{default:r(()=>[l(s,{label:"电脑",value:"电脑"}),l(s,{label:"办公设备",value:"办公设备"}),l(s,{label:"家用电器",value:"家用电器"})]),_:1},8,["modelValue"]),l(c,{modelValue:t.category2,"onUpdate:modelValue":e[5]||(e[5]=a=>t.category2=a),placeholder:"请选择",style:{width:"100px"},clearable:"",onChange:z},{default:r(()=>[(n(!0),d(_,null,y(N.value,a=>(n(),m(s,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l(c,{modelValue:t.category3,"onUpdate:modelValue":e[6]||(e[6]=a=>t.category3=a),placeholder:"请选择",style:{width:"100px"},clearable:""},{default:r(()=>[(n(!0),d(_,null,y(T.value,a=>(n(),m(s,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e[14]||(e[14]=o("span",{class:"filter-label"},"商品品牌",-1)),l(c,{modelValue:t.brand,"onUpdate:modelValue":e[7]||(e[7]=a=>t.brand=a),placeholder:"请选择",style:{width:"100px"},clearable:""},{default:r(()=>[l(s,{label:"清华同方",value:"清华同方"}),l(s,{label:"联想",value:"联想"}),l(s,{label:"戴尔",value:"戴尔"})]),_:1},8,["modelValue"])]),o("div",se,[l(c,{modelValue:t.sortType,"onUpdate:modelValue":e[8]||(e[8]=a=>t.sortType=a),placeholder:"默认排序",style:{width:"110px"}},{default:r(()=>[l(s,{label:"默认排序",value:"default"}),l(s,{label:"购买时间",value:"time"})]),_:1},8,["modelValue"]),l(c,{modelValue:t.priceSort,"onUpdate:modelValue":e[9]||(e[9]=a=>t.priceSort=a),placeholder:"价格排序",style:{width:"110px"}},{default:r(()=>[l(s,{label:"价格排序",value:""}),l(s,{label:"价格从低到高",value:"asc"}),l(s,{label:"价格从高到低",value:"desc"})]),_:1},8,["modelValue"])]),o("div",re,[(n(!0),d(_,null,y(v.value,(a,D)=>(n(),d("div",{key:D,class:"order-card"},[o("div",ne,[o("div",de,[o("span",ie,i(a.date),1),o("span",pe,"订单号:"+i(a.orderNo),1)]),l(k,{type:"danger",link:"",onClick:p=>B()},{default:r(()=>[...e[15]||(e[15]=[C("一键复购",-1)])]),_:1},8,["onClick"])]),o("div",ce,[(n(!0),d(_,null,y(a.products,(p,x)=>(n(),d("div",{key:x,class:"product-item"},[o("div",ue,[l(O,{src:p.image,fit:"contain"},{error:r(()=>[o("div",me,[l(h,{size:30,color:"#ccc"},{default:r(()=>[l(g(Z))]),_:1})])]),_:1},8,["src"])]),o("div",ge,[o("div",_e,i(p.name),1),o("div",ye,i(p.spec1),1),o("div",ve,i(p.spec2),1)]),o("div",Ve,[o("span",be,"¥"+i(p.price),1),o("span",fe,"x"+i(p.quantity),1)]),x===0?(n(),d("div",he,[e[16]||(e[16]=o("span",{class:"total-label"},"支付款",-1)),o("span",ke,"¥"+i(a.totalAmount),1)])):b("",!0),o("div",xe,[l(k,{type:"danger",link:"",onClick:Ce=>A()},{default:r(()=>[...e[17]||(e[17]=[C("再次购买",-1)])]),_:1},8,["onClick"])])]))),128))])]))),128))]),v.value.length===0?(n(),m(R,{key:0,description:"暂无购买记录"})):b("",!0),v.value.length>0?(n(),m(g(ee),{key:1,page:t.pageNum,"onUpdate:page":e[10]||(e[10]=a=>t.pageNum=a),"page-size":t.pageSize,"onUpdate:pageSize":e[11]||(e[11]=a=>t.pageSize=a),total:U.value,onChange:q},null,8,["page","page-size","total"])):b("",!0)])}}}),Fe=K(we,[["__scopeId","data-v-06933acc"]]);export{Fe as default};