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