1 |
- import{v as t,o as s,x as e,a,b as o,e as n,f as i,w as l,aj as r,_ as c,l as u,j as d,g as p,k as f,r as m,F as g,m as _,i as b,p as y,t as k,z as x,u as v,A as C,s as j,a8 as w,M as h,D as S}from"./index-9880b451.js";import{_ as T}from"./su-tabs.1ce39404.js";import{_ as N}from"./su-sticky.84aef901.js";import{_ as $}from"./s-empty.74111684.js";import{_ as z}from"./s-goods-item.f5d79fd7.js";import{_ as M}from"./uni-load-more.aac4524a.js";import{_ as O}from"./s-layout.dfc5b0b5.js";import{h as I,j as G,g as P,f as E}from"./useGoods.bdd1c2ea.js";import{_ as A}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css *//* empty css */import"./index.df38848e.js";const B=A({__name:"list",setup(A){const B={list:[],total:0,pageNo:1,pageSize:5},D=t({currentTab:0,pagination:{list:[],total:0,pageNo:1,pageSize:5},loadStatus:""}),F=[{name:"全部"},{name:"待付款",value:0},{name:"待发货",value:10},{name:"待收货",value:20},{name:"待评价",value:30}];function U(t){D.currentTab!==t.index&&(D.pagination=B,D.currentTab=t.index,Y())}function W(t){j.$router.go("/pages/order/detail",{id:t})}async function Y(){D.loadStatus="loading";let{code:t,data:s}=await r.getOrderPage({pageNo:D.pagination.pageNo,pageSize:D.pagination.pageSize,status:F[D.currentTab].value,commentStatus:30!==F[D.currentTab].value&&null});0===t&&(s.list.forEach((t=>I(t))),D.pagination.list=c.concat(D.pagination.list,s.list),D.pagination.total=s.total,D.loadStatus=D.pagination.list.length<D.pagination.total?"more":"noMore")}function Z(){"noMore"!==D.loadStatus&&(D.pagination.pageNo++,Y())}return s((async t=>{t.type&&(D.currentTab=t.type),await Y()})),e((()=>{Z()})),a((()=>{D.pagination=B,Y(),setTimeout((function(){o()}),800)})),(t,s)=>{const e=u(_("su-tabs"),T),a=u(_("su-sticky"),N),o=u(_("s-empty"),$),c=b,A=u(_("s-goods-item"),z),q=S,H=u(_("uni-load-more"),M),J=u(_("s-layout"),O);return n(),i(J,{title:"我的订单"},{default:l((()=>[d(a,{bgColor:"#fff"},{default:l((()=>[d(e,{list:F,scrollable:!1,onChange:U,current:D.currentTab},null,8,["current"])])),_:1}),0===D.pagination.total?(n(),i(o,{key:0,icon:"/static/order-empty.png",text:"暂无订单"})):p("",!0),D.pagination.total>0?(n(),i(c,{key:1},{default:l((()=>[(n(!0),f(g,null,m(D.pagination.list,(t=>(n(),i(c,{class:"bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20",key:t.id,onClick:s=>W(t.id)},{default:l((()=>[d(c,{class:"order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20"},{default:l((()=>[d(c,{class:"order-no"},{default:l((()=>[y("订单号:"+k(t.no),1)])),_:2},1024),d(c,{class:x(["order-state ss-font-26",v(G)(t)])},{default:l((()=>[y(k(v(P)(t)),1)])),_:2},1032,["class"])])),_:2},1024),(n(!0),f(g,null,m(t.items,(t=>(n(),i(c,{class:"border-bottom",key:t.id},{default:l((()=>[d(A,{img:t.picUrl,title:t.spuName,skuText:t.properties.map((t=>t.valueName)).join(" "),price:t.price,num:t.count},null,8,["img","title","skuText","price","num"])])),_:2},1024)))),128)),d(c,{class:"pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20"},{default:l((()=>[d(c,{class:"ss-flex ss-col-center"},{default:l((()=>[d(c,{class:"discounts-title pay-color"},{default:l((()=>[y("共 "+k(t.productCount)+" 件商品,总金额:",1)])),_:2},1024),d(c,{class:"discounts-money pay-color"},{default:l((()=>[y(" ¥"+k(v(E)(t.payPrice)),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),d(c,{class:x(["order-card-footer ss-flex ss-col-center ss-p-x-20",t.buttons.length>3?"ss-row-between":"ss-row-right"])},{default:l((()=>[d(c,{class:"ss-flex ss-col-center"},{default:l((()=>[t.buttons.includes("combination")?(n(),i(q,{key:0,class:"tool-btn ss-reset-button",onClick:C((s=>function(t){j.$router.go("/pages/activity/groupon/detail",{id:t.ext.groupon_id})}(t)),["stop"])},{default:l((()=>[y(" 拼团详情 ")])),_:2},1032,["onClick"])):p("",!0),0===t.buttons.length?(n(),i(q,{key:1,class:"tool-btn ss-reset-button",onClick:C((s=>W(t.id)),["stop"])},{default:l((()=>[y(" 查看详情 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("confirm")?(n(),i(q,{key:2,class:"tool-btn ss-reset-button",onClick:C((s=>async function(t,s=!1){if("WechatMiniProgram"===j.$platform.name&&!w.isEmpty(t.wechat_extra_data)&&!s)return void mpConfirm(t);const{code:e}=await r.receiveOrder(t.id);0===e&&(D.pagination=B,await Y())}(t)),["stop"])},{default:l((()=>[y(" 确认收货 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("express")?(n(),i(q,{key:3,class:"tool-btn ss-reset-button",onClick:C((s=>async function(t){j.$router.go("/pages/order/express/log",{id:t})}(t.id)),["stop"])},{default:l((()=>[y(" 查看物流 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("cancel")?(n(),i(q,{key:4,class:"tool-btn ss-reset-button",onClick:C((s=>async function(t){h({title:"提示",content:"确定要取消订单吗?",success:async function(s){if(!s.confirm)return;const{code:e}=await r.cancelOrder(t);if(0===e){let s=D.pagination.list.findIndex((s=>s.id===t));const e=D.pagination.list[s];e.status=40,I(e)}}})}(t.id)),["stop"])},{default:l((()=>[y(" 取消订单 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("comment")?(n(),i(q,{key:5,class:"tool-btn ss-reset-button",onClick:C((s=>{return e=t.id,void j.$router.go("/pages/goods/comment/add",{id:e});var e}),["stop"])},{default:l((()=>[y(" 评价 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("delete")?(n(),i(q,{key:6,class:"delete-btn ss-reset-button",onClick:C((s=>{return e=t.id,void h({title:"提示",content:"确定要删除订单吗?",success:async function(t){if(t.confirm){const{code:t}=await r.deleteOrder(e);if(0===t){let t=D.pagination.list.findIndex((t=>t.id===e));D.pagination.list.splice(t,1)}}}});var e}),["stop"])},{default:l((()=>[y(" 删除订单 ")])),_:2},1032,["onClick"])):p("",!0),t.buttons.includes("pay")?(n(),i(q,{key:7,class:"tool-btn ss-reset-button ui-BG-Main-Gradient",onClick:C((s=>{return e=t.payOrderId,void j.$router.go("/pages/pay/index",{id:e});var e}),["stop"])},{default:l((()=>[y(" 继续支付 ")])),_:2},1032,["onClick"])):p("",!0)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1032,["onClick"])))),128))])),_:1})):p("",!0),D.pagination.total>0?(n(),i(H,{key:2,status:D.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:Z},null,8,["status"])):p("",!0)])),_:1})}}},[["__scopeId","data-v-33428601"]]);export{B as default};
|