This commit is contained in:
weipengfei 2024-04-06 16:06:06 +08:00
parent b67f95c677
commit 0781436aea
33 changed files with 568 additions and 56 deletions

View File

@ -1,2 +1,4 @@
VITE_BASE_URL = 'http://192.168.1.22:8324'
# VITE_BASE_URL = 'https://crmeb-test.shop.lihaink.cn'
VITE_NOW_TYPE = 'dist'
# VITE_BASE_URL = 'http://192.168.1.22:8324'
VITE_BASE_URL = 'https://crmeb-test.shop.lihaink.cn'

View File

@ -1 +1,3 @@
VITE_BASE_URL = ''
VITE_NOW_TYPE = 'prod'
VITE_BASE_URL = 'https://shop.lihaink.cn'

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{s as L,u as S}from"./shop-YOMWLVgN.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-8CB-e1T6.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-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};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{e as V}from"./store-CYL2ip_b.js";import{_ as k,u as w,r as e,a as r,o as l,f as c,b as t,d as s,w as u,e as I,F as L,g as B,t as h,p as D,l as E}from"./index-8CB-e1T6.js";const N=o=>(D("data-v-22435ac1"),o=o(),E(),o),C={class:"my-order"},F={class:"header-nav"},G=N(()=>t("div",{class:"nav-item"}," 订单列表 ",-1)),O={class:"nav-item-clear"},U={class:"header-input"},$={class:"order-list"},A={class:"top"},R={class:"sn"},T={class:"create-time"},j={__name:"order",setup(o){const a=w();e([]);const d=e(""),p=e(1);e(null);const i=e({page:1,limit:20}),v=e(!1),y=e(0),m=e([]);return(()=>{v.value=!0,p.value==1&&(i.value.paid=null),p.value==2&&(i.value.paid=0),V(a.userInfo.service.mer_id,i.value).then(_=>{m.value=_.data.list,y.value=_.data.count,v.value=!1})})(),(_,f)=>{const g=r("Delete"),x=r("el-icon"),P=r("el-button"),b=r("el-input");return l(),c("div",C,[t("div",F,[G,t("div",O,[s(x,null,{default:u(()=>[s(g)]),_:1})])]),t("div",U,[s(b,{modelValue:d.value,"onUpdate:modelValue":f[0]||(f[0]=n=>d.value=n),placeholder:"请输入订单编号"},{append:u(()=>[s(P,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"}},{default:u(()=>[I("搜索")]),_:1})]),_:1},8,["modelValue"])]),t("div",$,[(l(!0),c(L,null,B(m.value,(n,S)=>(l(),c("div",{class:"item",key:S},[t("div",A,[t("div",R,"单号: "+h(n.order_sn),1),t("div",T,h(n.create_time),1)])]))),128))])])}}},q=k(j,[["__scopeId","data-v-22435ac1"]]),z={class:"my-card"},M={__name:"index",setup(o){return(a,d)=>(l(),c("div",z,[s(q,{ref:"orderRef",onGoPay:a.goPay,onEditPupop:a.editPupop},null,8,["onGoPay","onEditPupop"])]))}};export{M as default};

1
dist/assets/index-D9csEJCL.css vendored Normal file
View File

@ -0,0 +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}

View File

@ -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-8CB-e1T6.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-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};

View File

@ -1 +0,0 @@
@charset "UTF-8";.my-order[data-v-22435ac1]{border-radius:1.2rem;height:100%;background-color:#fff;width:30rem;position:relative;overflow:hidden}.my-order .header-nav[data-v-22435ac1]{display:flex;justify-content:space-between;padding:1rem;height:1.5rem}.my-order .header-nav span[data-v-22435ac1]{color:#ff4a00}.my-order .header-nav .nav-item-clear[data-v-22435ac1]{display:flex;align-items:center;font-size:.8rem;cursor:pointer}.my-order .header-input[data-v-22435ac1]{padding:1rem;padding-top:0;height:2.5rem;border-bottom:1px solid #eee}.my-order .order-list[data-v-22435ac1]{height:calc(100vh - 100px - 8.2rem);overflow-y:auto}.my-order .order-list .item[data-v-22435ac1]{padding:1rem}.my-order .order-list .item .top[data-v-22435ac1]{display:flex;justify-content:space-between;align-items:flex-end}.my-order .order-list .item .top .sn[data-v-22435ac1]{font-weight:700;font-size:.9rem}.my-order .order-list .item .top .create-time[data-v-22435ac1]{font-size:.8rem}.my-card{display:flex}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background-color:#f1f1f1;margin:20px 0}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-thumb:hover{background-color:#999}

1
dist/assets/index-Z_K2cVrU.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/assets/index-iV8fzPz2.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -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-8CB-e1T6.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-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};

View File

@ -1 +0,0 @@
import{e as F,a as G,f as J,g as K}from"./store-CYL2ip_b.js";import{_ as Q,u as W,r as s,q as X,a as d,h as Y,j as Z,f as m,d as t,w as o,o as c,e as r,t as ee,b as I,c as V,E as h,p as te,l as ae}from"./index-8CB-e1T6.js";import{p as oe}from"./pay-6WPj-hA4.js";const le=v=>(te("data-v-f71c3ce9"),v=v(),ae(),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=W(),k=s([]),C=X(),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=>{J({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,K({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=Y("loading");return Z((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,ee(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(oe,{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]])}}},fe=Q(pe,[["__scopeId","data-v-f71c3ce9"]]);export{fe as default};

1
dist/assets/indexList-D9DvhVcr.js vendored Normal file
View File

@ -0,0 +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};

1
dist/assets/padding-D1D9f_t3.js vendored Normal file
View File

@ -0,0 +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};

File diff suppressed because one or more lines are too long

1
dist/assets/pay-CgGUliwa.css vendored Normal file
View File

@ -0,0 +1 @@
.dra-body[data-v-517a591d]{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}.dra-body .header[data-v-517a591d]{width:25rem;display:flex}.dra-body .header>div[data-v-517a591d]{flex:1;border:1px solid #ccc;text-align:center;padding:.6rem 0;cursor:pointer}.dra-body .header .left[data-v-517a591d]{border-right:none;border-radius:5rem 0 0 5rem}.dra-body .header .right[data-v-517a591d]{border-left:none;border-radius:0 5rem 5rem 0}.dra-body .header .active[data-v-517a591d]{background-color:#1890ff;color:#fff;transition:.3s;border-color:#1890ff}.dra-body .card1 .code-input[data-v-517a591d]{width:100%;height:3rem}.dra-body .card1 .tips[data-v-517a591d]{width:38rem;height:16rem;background:url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/a4971202404051443356430.png);background-size:100% 100%;background-repeat:no-repeat}.cancel-btn[data-v-517a591d]{width:60%;border-color:#1890ff;color:#1890ff;border-radius:5rem;height:3rem;font-size:1.2rem}.drawer-body[data-v-517a591d]{width:100%;overflow-x:hidden}.counter[data-v-517a591d]{padding:20px;border-radius:20px;background-color:#f3f9ff}.counter .received[data-v-517a591d]{height:58px;padding:0 20px;border:1px solid #eeeeee;border-radius:8px;background-color:#fff;font-size:26px;line-height:58px;color:#303133}.counter .balance[data-v-517a591d]{width:100%;box-sizing:border-box;padding:18px 0 18px 10px;text-align:start;font-size:15px;color:#303133}.counter .balance .money[data-v-517a591d]{color:#ff4a00}.counter .keypad[data-v-517a591d]{display:grid;grid-template-columns:auto auto auto auto;grid-gap:10px}.counter .keypad .left[data-v-517a591d]{grid-column-end:span 3;display:grid;grid-template-columns:auto auto auto;grid-gap:10px}.counter .keypad .right[data-v-517a591d]{display:grid;grid-template-columns:auto;grid-gap:10px}.counter .keypad .el-button[data-v-517a591d]{height:62px;width:130px;margin:0!important;border:0;border-radius:8px;font-weight:500;font-size:28px!important;line-height:62px;color:#1890ff}.counter .keypad .el-button[data-v-517a591d]:focus{box-shadow:none}.counter .keypad .enter[data-v-517a591d]{grid-row-end:span 4;height:134px;background-color:#1890ff;font-weight:500;font-size:22px!important;line-height:134px;color:#fff}

1
dist/assets/pay-DGm-hSsT.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.dra-body[data-v-045ac783]{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}.dra-body .header[data-v-045ac783]{width:25rem;display:flex}.dra-body .header>div[data-v-045ac783]{flex:1;border:1px solid #ccc;text-align:center;padding:.6rem 0;cursor:pointer}.dra-body .header .left[data-v-045ac783]{border-right:none;border-radius:5rem 0 0 5rem}.dra-body .header .right[data-v-045ac783]{border-left:none;border-radius:0 5rem 5rem 0}.dra-body .header .active[data-v-045ac783]{background-color:#1890ff;color:#fff;transition:.3s;border-color:#1890ff}.dra-body .card1 .code-input[data-v-045ac783]{width:100%;height:3rem}.dra-body .card1 .tips[data-v-045ac783]{width:38rem;height:16rem;background:url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/a4971202404051443356430.png);background-size:100% 100%;background-repeat:no-repeat}.cancel-btn[data-v-045ac783]{width:60%;border-color:#1890ff;color:#1890ff;border-radius:5rem;height:3rem;font-size:1.2rem}.drawer-body[data-v-045ac783]{width:100%;overflow-x:hidden}.counter[data-v-045ac783]{padding:20px;border-radius:20px;background-color:#f3f9ff}.counter .received[data-v-045ac783]{height:58px;padding:0 20px;border:1px solid #eeeeee;border-radius:8px;background-color:#fff;font-size:26px;line-height:58px;color:#303133}.counter .balance[data-v-045ac783]{width:100%;box-sizing:border-box;padding:18px 0 18px 10px;text-align:start;font-size:15px;color:#303133}.counter .balance .money[data-v-045ac783]{color:#ff4a00}.counter .keypad[data-v-045ac783]{display:grid;grid-template-columns:auto auto auto auto;grid-gap:10px}.counter .keypad .left[data-v-045ac783]{grid-column-end:span 3;display:grid;grid-template-columns:auto auto auto;grid-gap:10px}.counter .keypad .right[data-v-045ac783]{display:grid;grid-template-columns:auto;grid-gap:10px}.counter .keypad .el-button[data-v-045ac783]{height:62px;width:130px;margin:0!important;border:0;border-radius:8px;font-weight:500;font-size:28px!important;line-height:62px;color:#1890ff}.counter .keypad .el-button[data-v-045ac783]:focus{box-shadow:none}.counter .keypad .enter[data-v-045ac783]{grid-row-end:span 4;height:134px;background-color:#1890ff;font-weight:500;font-size:22px!important;line-height:134px;color:#fff}

View File

@ -1 +1 @@
import{x as e}from"./index-8CB-e1T6.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-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};

View File

@ -1 +0,0 @@
import{x as t}from"./index-8CB-e1T6.js";function n(r){return t.post("user/cart/create",r)}function o(r){return t.get("user/cart/lst",{params:r})}function s(r,e){return t.post(`user/cart/change/${r}`,e)}function i(r){return t.post("v2/order/check",r)}function u(r){return t.post("user/cart/delete",r)}function c(r){return t.post("v2/order/create",r)}function p(r,e){return t.post(`order/pay/${r}`,e)}function d(r){return t.get("micropay_query",{params:r})}function f(r,e){return t.get(`admin/${r}/order_list`,{params:e})}function A(r){return t.get("order_lading",{params:r})}export{o as a,s as b,u as c,n as d,f as e,d as f,A as g,c as h,p as i,i as o};

4
dist/index.html vendored
View File

@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>里海收银系统</title>
<script type="module" crossorigin src="./assets/index-8CB-e1T6.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-CxBxKwDp.css">
<script type="module" crossorigin src="./assets/index-B3GfFMCJ.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Cr7rCGUo.css">
</head>
<body>
<div id="app"></div>

View File

@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"build": "vue-tsc && vite build --mode development",
"build:prod": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {

View File

@ -19,7 +19,8 @@ const open = () => {
loading.value = false;
input.value = "";
reLoad.value = true;
codeRef.value.focus();
codeRef.value?.focus();
changeActive(active.value)
}, 300);
});
};
@ -40,7 +41,7 @@ const setForm = (e) => {
};
const setRePay = (e) => {
form.value.total_price = e.price;
form.value.order_price = e.price;
order_id.value = e.order_id;
};
@ -114,10 +115,16 @@ const handleEnter = () => {
};
const orderPay = (id) => {
orderPayApi(id, {
let query;
if(active.value == 1){
query = {
type: "micropay",
auth_code: input.value,
})
}
} else query = {
type: "cash_payment"
}
orderPayApi(id, query)
.then((res) => {
if (res.status == 200 && res.message == "支付成功") {
drawer.value = false;
@ -145,6 +152,7 @@ const orderPay = (id) => {
const count = ref(0); // 3, 3,
const getOrderStatus = (id) => {
if(!id) return;
count.value++;
timecount += 5000;
orderStatusApi({
@ -195,6 +203,7 @@ const beforeClose = () => {
collection.value = "";
collectionArray.value = [];
codeRef.value?.blur();
document.removeEventListener("keydown", keyboard);
emit("paySuccess");
drawer.value = false;
};
@ -250,7 +259,9 @@ const numTap = (item) => {
};
//
const cashBnt = () => {
if(changePrice.value!=''&&changePrice.value>=0) orderCreateApi({
if(changePrice.value===''||changePrice.value===null||changePrice.value===undefined) return ;
if (order_id.value) orderPay(order_id.value);
else orderCreateApi({
address_id: "",
key: form.value.key,
cart_id: cart_id.value,

View File

@ -17,7 +17,7 @@ const navTo = (name) => {
<el-icon size="30"><Sell /></el-icon>
<div>收银</div>
</div>
<div class="list-item" :class="{'active': route.name=='orderList'}" @click="navTo('orderList')">
<div class="list-item" :class="{'active': route.name=='order'}" @click="navTo('order')">
<el-icon size="30"><DataLine /></el-icon>
<div>订单</div>
</div>

3
src/utils/mitt.js Normal file
View File

@ -0,0 +1,3 @@
import miit from "mitt"
export default miit()

View File

@ -1,7 +1,7 @@
<script setup>
import order from "./component/order.vue";
import shop from "./component/shop.vue";
import padding from "./component/padding.vue";
import padding from "@/components/padding.vue";
import pupop from "./component/pupop.vue";
import pay from "@/components/pay.vue";
import { ref, nextTick } from "vue";

View File

@ -0,0 +1,354 @@
<script setup>
import { ref } from "vue";
import {
orderListApi,
orderStatusApi,
orderLadingApi,
cartListApi,
} from "@/api/store.js";
import { useUserStore } from "@/store/user.js";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import mitt from "@/utils/mitt.js";
import pay from "@/components/pay.vue";
const userStore = useUserStore();
const router = useRouter();
const formData = ref({});
mitt.on("set-order-detail", (res) => {
formData.value = res;
});
const list = ref([]);
const payRef = ref(null);
const loading = ref(false);
const total = ref(0);
const activeStore = ref(0);
const activeStoreList = ref(["商品信息", "订单详情"]);
const orderLadingSn = ref("");
const dialogVisible = ref(false);
const orderLadingComfirm = (order_sn) => {
orderLadingSn.value = order_sn;
dialogVisible.value = true;
};
const orderLading = () => {
dialogVisible.value = false;
orderLadingApi({
order_sn: orderLadingSn.value,
}).then((res) => {
ElMessage({
message: res.message,
type: "success",
});
router.push({
name: "home",
});
});
};
const rePay = (row) => {
payRef.value.setRePay({
price: row.pay_price,
order_id: row.group_order_id,
});
payRef.value.drawer = true;
};
const getOrderStatus = (id) => {
orderStatusApi({
order_sn: id,
})
.then((res) => {
if (res.data.paid == 1 || res.message == "支付成功") {
ElMessage({
message: res.message,
type: "success",
});
} else {
ElMessage({
message: res.message,
type: "error",
});
}
})
.catch((err) => {});
};
</script>
<template>
<div class="my-order">
<div class="header-nav">
<div
v-for="(item, index) in activeStoreList"
:key="index"
class="nav-item"
:class="{
'nav-item-active': activeStore == index,
'nav-item-radius1': activeStore == index + 1,
'nav-item-radius2': activeStore == index - 1,
}"
@click="activeStore = index"
>
{{ item }}
</div>
<div
class="nav-item"
:class="{
'nav-item-radius2': activeStore == activeStoreList.length - 1,
}"
style="flex: 1"
></div>
</div>
<div class="detail" v-loading="loading">
<div class="table" v-if="formData.orderProduct && activeStore == 0">
<div style="font-size: 0.9rem">
共计
<span style="color: #ff4a00">{{ formData.total_num }}</span> 件商品
</div>
<el-table style="height: calc(100vh - 100px - 14rem);" :data="formData.orderProduct">
<el-table-column prop="cart_info.product.store_name" label="商品信息">
<template #default="{ row }">
<div style="display: flex; align-items: center">
<el-image
style="height: 3rem; width: 3rem"
:src="
row.cart_info.productAttr.image ||
row.cart_info.product.image
"
></el-image>
<span style="margin-left: 0.5rem">{{
row.cart_info.product.store_name
}}</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="cart_info.productAttr.price"
label="单价"
width="150"
/>
<el-table-column prop="product_num" label="数量" width="150" />
<el-table-column prop="total_price" label="总价" width="150" />
</el-table>
</div>
<div class="table" v-if="formData.orderProduct && activeStore == 1">
<div class="table-title">订单信息</div>
<div class="table-info">
<div class="info-item">
<div class="info-item-title">创建时间:</div>
<div class="info-item-info">{{formData.create_time}}</div>
</div>
<div class="info-item">
<div class="info-item-title">商品总数:</div>
<div class="info-item-info">{{formData.total_num}}</div>
</div>
<div class="info-item">
<div class="info-item-title">商品总价:</div>
<div class="info-item-info">{{formData.total_price}}</div>
</div>
<div class="info-item">
<div class="info-item-title">支付时间:</div>
<div class="info-item-info">{{formData.pay_time}}</div>
</div>
<div class="info-item">
<div class="info-item-title">优惠抵扣:</div>
<div class="info-item-info">{{formData.deduction_price}}</div>
</div>
<div class="info-item">
<div class="info-item-title">实际支付:</div>
<div class="info-item-info">{{formData.pay_price}}</div>
</div>
<div class="info-item">
<div class="info-item-title">支付方式:</div>
<div class="info-item-info">
<span v-if="formData.pay_type==11">微信收款</span>
<span v-if="formData.pay_type==12">现金支付</span>
</div>
</div>
</div>
<div class="table-title">收银员信息</div>
<div class="table-info" style="flex-direction: column;">
<div class="info-item">
<div class="info-item-title">头像:</div>
<div class="info-item-info">
<el-image style="height: 4rem;width: 4rem;border-radius: 50%;" :src="formData.service_info.avatar"></el-image>
</div>
</div>
<div class="info-item">
<div class="info-item-title">昵称:</div>
<div class="info-item-info">{{formData.service_info.nickname}}</div>
</div>
<div class="info-item">
<div class="info-item-title">账号:</div>
<div class="info-item-info">{{formData.service_info.account}}</div>
</div>
</div>
</div>
<div class="footer" v-if="formData.service_info">
<div class="info">
<div class="ser">收银员: {{ formData.service_info.nickname }}</div>
<div class="price">
实付: <span>¥{{ formData.pay_price }}</span>
</div>
</div>
<div class="handle" v-if="!formData.pay_time">
<el-button class="btn" type="primary" @click="rePay(formData)"
>重新支付</el-button
>
<el-button
class="btn"
type="primary"
@click="getOrderStatus(formData.order_sn)"
>检测状态</el-button
>
<el-button
class="btn"
type="success"
@click="orderLadingComfirm(formData.order_sn)"
>提单</el-button
>
</div>
<div class="handle" v-else>已支付</div>
</div>
</div>
<pay ref="payRef" />
<el-dialog v-model="dialogVisible" title="提示" width="500">
<span
>提单前请清空购物车, 避免提单的商品与购物车商品混合,
请确保购物车内无数据后再进行提单</span
>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button v-if="cartCount > 0" @click="goHome">
前去清空购物车
</el-button>
<el-button v-else type="primary" @click="orderLading">
确认提单
</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.my-order {
border-radius: 1.2rem;
height: 100%;
flex: 1;
background-color: #fff;
position: relative;
overflow: hidden;
.header-nav {
display: flex;
background: linear-gradient(
to bottom,
#f5f5f5 50%,
#fff 50%
); /* 创建渐变背景 */
.nav-item {
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;
}
.nav-item-active {
background-color: #fff;
position: relative;
transition: 300ms;
}
.nav-item-radius1 {
border-radius: 0 0 1rem 0;
}
.nav-item-radius2 {
border-radius: 0 0 0 1rem;
}
}
.detail {
height: calc(100vh - 100px - 4rem);
box-sizing: border-box;
position: relative;
.table {
padding: 1rem;
padding-bottom: 6rem;
overflow-y: scroll;
.table-title{
font-weight: bold;
padding-top: 1rem;
}
.table-info{
display: flex;
flex-wrap: wrap;
color: #777;
font-size: 0.9rem;
padding-bottom: 2rem;
border-bottom: 1px solid #eee;
&:last-child{
border-bottom: none;
}
.info-item{
width: 33%;
display: flex;
padding-top: 1rem;
.info-item-title{
flex-shrink: 0;
padding-right: 1rem;
}
}
}
}
.footer {
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;
.info {
display: flex;
align-items: flex-end;
.ser {
font-weight: bold;
margin-right: 1rem;
}
.price {
margin-right: 1rem;
span {
color: #ff4a00;
font-size: 1.2rem;
font-weight: bold;
}
}
}
.handle {
.btn {
border-radius: 4rem;
padding: 1.2rem;
}
}
}
}
}
</style>

View File

@ -4,68 +4,136 @@ import {
orderListApi,
orderStatusApi,
orderLadingApi,
cartListApi
cartListApi,
} from "@/api/store.js";
import { useUserStore } from "@/store/user.js";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import mitt from "@/utils/mitt.js";
const userStore = useUserStore();
const list = ref([]);
const keyword = ref('');
const tabPosition = ref(1); // 1-, 2-
const changeTabPosition = (e) => {
where.value.page = 1;
loadEnd.value = false;
loading.value = false;
orderList.value = [];
getOrderList(true);
};
const payRef = ref(null);
const where = ref({
page: 1,
limit: 20,
search_info: ''
});
const loading = ref(false);
const total = ref(0);
const activeStore = ref(0);
const loadEnd = ref(false);
const orderList = ref([]);
const getOrderList = () => {
const getOrderList = (reload=false) => {
if(loadEnd.value || loading.value) return;
if(reload) where.value.page = 1;
loading.value = true;
if (tabPosition.value == 1) where.value.paid = null;
if (tabPosition.value == 2) where.value.paid = 0;
orderListApi(userStore.userInfo.service.mer_id, where.value).then((res) => {
orderList.value = res.data.list;
if(reload) orderList.value = res.data.list;
else orderList.value = [...orderList.value, ...res.data.list];
if(res.data.list.length < where.value.limit) loadEnd.value = true;
else where.value.page++;
activeStore.value = 0;
mitt.emit("set-order-detail", orderList.value[0]);
total.value = res.data.count;
loading.value = false;
}).catch(err=>{
loading.value = false;
});
};
getOrderList();
const setForm = (item, index) => {
activeStore.value = index;
mitt.emit("set-order-detail", item);
}
</script>
<template>
<div class="my-order">
<div class="header-nav">
<div class="nav-item">
订单列表
</div>
<div class="nav-item">订单列表</div>
<div class="nav-item-clear">
<el-icon><Delete /></el-icon>
<el-radio-group
v-model="tabPosition"
@change="changeTabPosition"
size="small"
>
<el-radio-button :value="1">全部</el-radio-button>
<el-radio-button :value="2">未支付</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="header-input">
<el-input v-model="keyword" placeholder="请输入订单编号">
<el-input v-model="where.search_info" placeholder="请输入订单编号" clearable>
<template #append>
<el-button type="primary" style="background-color: #1890ff;color: #fff;border-radius: 0 5px 5px 0;">搜索</el-button>
<el-button
type="primary"
style="
background-color: #1890ff;
color: #fff;
border-radius: 0 5px 5px 0;
"
@click="getOrderList(true)"
>搜索</el-button
>
</template>
</el-input>
</div>
<div class="order-list">
<div class="item" v-for="(item, index) in orderList" :key="index">
<div class="order-list" v-loading="loading" v-infinite-scroll="getOrderList"
infinite-scroll-distance="300"
infinite-scroll-delay="500"
style="overflow: auto">
<div class="item" :class="{'item-active': activeStore == index}" v-for="(item, index) in orderList" :key="index" @click="setForm(item, index)">
<div class="top">
<div class="sn">单号: {{ item.order_sn }}</div>
<div class="create-time"> {{ item.create_time }}</div>
<div class="sn" :class="{'cahier': item.pay_type==11 || item.pay_type==12}">单号: {{ item.order_sn }}</div>
<div class="create-time">{{ item.create_time }}</div>
</div>
<div class="shop">
<div class="left" v-if="item.orderProduct">
<el-image
v-for="(shop, imgkey) in item.orderProduct.slice(0, 5)"
:key="imgkey"
:src="
shop.cart_info.productAttr.image || shop.cart_info.product.image
"
class="shop-img"
></el-image>
<div v-if="item.orderProduct.length == 1" class="shop-name">
{{ item.orderProduct[0].cart_info.product.store_name }}
</div>
</div>
<div class="right">
<div class="money">¥{{ item.pay_price }}</div>
<div class="count">{{ item.total_num }}件商品</div>
</div>
</div>
<div class="bottom">
<div class="pay">
<span v-if="item.paid">已支付</span>
<span v-else style="color: #ff4a00;">未支付</span>
</div>
<div class="cashier" v-if="item.service_info">收银员: {{ item.service_info.nickname }}</div>
</div>
</div>
<div v-if="loadEnd" class="load-end">没有更多了</div>
<div v-if="loading" class="load-end">加载中...</div>
</div>
</div>
</template>
@ -95,7 +163,7 @@ getOrderList();
cursor: pointer;
}
}
.header-input{
.header-input {
padding: 1rem;
padding-top: 0;
height: 2.5rem;
@ -104,24 +172,88 @@ getOrderList();
.order-list {
height: calc(100vh - 100px - 8.2rem);
overflow-y: auto;
.item{
.item {
padding: 1rem;
.top{
border-bottom: 1px solid #eee;
.top {
display: flex;
justify-content: space-between;
align-items: flex-end;
.sn{
.sn {
font-weight: bold;
font-size: 0.9rem;
&::before{
}
.cahier{
&::before {
content: "收银";
font-weight: 400;
font-size: 0.7rem;
padding: 0.1rem 0.1rem;
margin-right: 0.2rem;
border: 1px solid #2ec479;
color: #2ec479;
border-radius: 3px;
}
}
.create-time{
.create-time {
font-size: 0.8rem;
}
}
.shop {
display: flex;
justify-content: space-between;
.right {
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: center;
.money {
font-size: 1rem;
color: #ff4a00;
font-weight: bold;
}
.count {
font-size: 0.7rem;
color: #999;
}
}
.left {
height: 4.5rem;
display: flex;
align-items: center;
.shop-img {
width: 3.5rem;
height: 3.5rem;
border-radius: 0.3rem;
margin-right: 0.4rem;
}
.shop-name {
font-size: 0.9rem;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
/* 将文本限制为三行 */
-webkit-line-clamp: 3;
}
}
}
.bottom{
display: flex;
justify-content: space-between;
font-size: 0.9rem;
color: #777;
}
}
.item-active{
background-color: #efefef;
}
}
.load-end{
text-align: center;
padding: 1rem;
color: #333;
font-size: 0.8rem;
}
}
</style>

View File

@ -1,5 +1,7 @@
<script setup>
import order from "./component/order.vue";
import detail from "./component/detail.vue";
import padding from "@/components/padding.vue";
import { ref, nextTick } from "vue";
@ -7,7 +9,9 @@ import { ref, nextTick } from "vue";
<template>
<div class="my-card">
<order ref="orderRef" @goPay="goPay" @editPupop="editPupop"/>
<order style="flex-shrink: 0;" ref="orderRef"/>
<padding />
<detail ref="detailRef"/>
</div>
</template>
@ -23,7 +27,7 @@ import { ref, nextTick } from "vue";
/* 设置滚动条的轨道样式 */
::-webkit-scrollbar-track {
background-color: #f1f1f1; /* 设置轨道的背景色 */
margin: 20px 0;
/* margin: 20px 0; */
}
/* 设置滚动条的滑块样式 */

View File

@ -1,10 +1,13 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
export default ({ mode }) => defineConfig({
plugins: [vue()],
base: './',
build: {
outDir: loadEnv(mode, process.cwd()).VITE_NOW_TYPE
},
server: {
port: '5175',
host: '0.0.0.0',