1 |
- import{c as t,z as s,o as e,A as a,b as o,d as n,f as r,g as l,w as i,s as c,_ as d,m as u,k as p,i as _,l as f,r as g,F as m,n as y,j as b,u as k,v as x,E as C,x as v,G as $,a7 as j,P as w,J as h,y as S}from"./index-ba48620e.js";import{_ as T}from"./su-tabs.40b9ec30.js";import{_ as I}from"./su-sticky.f4f657b5.js";import{_ as N}from"./s-empty.a75760f9.js";import{_ as G}from"./s-goods-item.32271aab.js";import{_ as M}from"./uni-load-more.966faf1b.js";import{_ as J}from"./s-layout.04b95866.js";import{j as O}from"./useGoods.edb8879f.js";import{_ as E}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.539e0aa6.js";/* empty css */import"./points.c381a8e1.js";/* empty css */import"./phone-international-input.dd3ca29e.js";const P=E({__name:"otherlist",setup(E){const P=t((()=>c.$store("app").has_wechat_trade_managed)),q={data:[],current_page:1,total:1,last_page:1},z=s({currentTab:0,pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",deleteOrderId:0,error:0}),A=[{name:"全部",value:"all"},{name:"待付款",value:"unpaid"},{name:"待发货",value:"nosend"},{name:"待收货",value:"noget"},{name:"待评价",value:"nocomment"}];function B(t){z.currentTab!==t.index&&(z.pagination=q,z.currentTab=t.index,W())}function F(t){c.$router.go("/pages/order/detail",{orderSN:t})}async function R(t){w({title:"提示",content:"确定要申请退款吗?",success:async function(s){if(s.confirm){const{error:s,data:e}=await c.$api.order.applyRefund(t);if(0===s){let s=z.pagination.data.findIndex((s=>s.id===t));z.pagination.data[s]=e}}}})}async function W(t=1,s=5){z.loadStatus="loading";let e=await c.$api.order.list({type:A[z.currentTab].value,list_rows:s,page:t});if(z.error=e.error,0===e.error){let t=d.concat(z.pagination.data,e.data.data);z.pagination={...e.data,data:t},z.pagination.current_page<z.pagination.last_page?z.loadStatus="more":z.loadStatus="noMore"}}function D(){"noMore"!==z.loadStatus&&W(z.pagination.current_page+1)}return e((async t=>{t.type&&(z.currentTab=t.type),W()})),a((()=>{D()})),o((()=>{z.pagination=q,W(),setTimeout((function(){n()}),800)})),(t,s)=>{const e=u(y("su-tabs"),T),a=u(y("su-sticky"),I),o=u(y("s-empty"),N),n=b,d=h,E=u(y("s-goods-item"),G),H=S,K=u(y("uni-load-more"),M),L=u(y("s-layout"),J);return r(),l(L,{title:"我的订单"},{default:i((()=>[p(a,{bgColor:"#fff"},{default:i((()=>[p(e,{list:A,scrollable:!1,onChange:B,current:z.currentTab},null,8,["current"])])),_:1}),0===z.pagination.total?(r(),l(o,{key:0,icon:"/static/order-empty.png",text:"暂无订单"})):_("",!0),z.pagination.total>0?(r(),l(n,{key:1},{default:i((()=>[(r(!0),f(m,null,g(z.pagination.data,(t=>(r(),l(n,{class:"bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20",key:t.id,onClick:s=>F(t.order_sn)},{default:i((()=>[p(n,{class:"order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20"},{default:i((()=>[p(n,{class:"order-no"},{default:i((()=>[k("订单号:"+x(t.order_sn),1)])),_:2},1024),p(n,{class:C(["order-state ss-font-26",v(O)(t.status_code)])},{default:i((()=>[k(x(t.status_text),1)])),_:2},1032,["class"])])),_:2},1024),(r(!0),f(m,null,g(t.items,(s=>(r(),l(n,{class:"border-bottom",key:s.id},{default:i((()=>[p(E,{img:s.goods_image,title:s.goods_title,skuText:s.goods_sku_text,price:s.goods_price,score:t.score_amount,num:s.goods_num},{tool:i((()=>[p(n,{class:"ss-flex"},{default:i((()=>[s.btns.includes("aftersale")?(r(),l(d,{key:0,class:"ss-reset-button apply-btn",onClick:$((t=>v(c).$router.go("/pages/order/aftersale/apply",{item:JSON.stringify(s)})),["stop"])},{default:i((()=>[k(" 申请售后 ")])),_:2},1032,["onClick"])):_("",!0),s.btns.includes("re_aftersale")?(r(),l(d,{key:1,class:"ss-reset-button apply-btn",onClick:$((t=>v(c).$router.go("/pages/order/aftersale/apply",{item:JSON.stringify(s)})),["stop"])},{default:i((()=>[k(" 重新售后 ")])),_:2},1032,["onClick"])):_("",!0),s.btns.includes("aftersale_info")?(r(),l(d,{key:2,class:"ss-reset-button apply-btn",onClick:$((t=>v(c).$router.go("/pages/order/aftersale/detail",{id:s.ext.aftersale_id})),["stop"])},{default:i((()=>[k(" 售后详情 ")])),_:2},1032,["onClick"])):_("",!0),s.btns.includes("buy_again")?(r(),l(d,{key:3,class:"ss-reset-button apply-btn",onClick:$((t=>v(c).$router.go("/pages/goods/index",{id:s.goods_id})),["stop"])},{default:i((()=>[k(" 再次购买 ")])),_:2},1032,["onClick"])):_("",!0)])),_:2},1024)])),_:2},1032,["img","title","skuText","price","score","num"])])),_:2},1024)))),128)),p(n,{class:"pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20"},{default:i((()=>[t.total_discount_fee>0?(r(),l(n,{key:0,class:"ss-flex ss-col-center ss-m-r-8"},{default:i((()=>[p(n,{class:"discounts-title"},{default:i((()=>[k("优惠:¥")])),_:1}),p(n,{class:"discounts-money"},{default:i((()=>[k(x(t.total_discount_fee),1)])),_:2},1024)])),_:2},1024)):_("",!0),p(n,{class:"ss-flex ss-col-center ss-m-r-8"},{default:i((()=>[p(n,{class:"discounts-title"},{default:i((()=>[k("运费:¥")])),_:1}),p(n,{class:"discounts-money"},{default:i((()=>[k(x(t.dispatch_amount),1)])),_:2},1024)])),_:2},1024),p(n,{class:"ss-flex ss-col-center"},{default:i((()=>[p(n,{class:"discounts-title pay-color"},{default:i((()=>[k("总金额:")])),_:1}),p(n,{class:"discounts-money pay-color"},{default:i((()=>[k("¥"+x(t.order_amount),1)])),_:2},1024),t.score_amount?(r(),l(n,{key:0},{default:i((()=>[k("+")])),_:1})):_("",!0),t.score_amount?(r(),l(n,{key:1,class:"discounts-money pay-color ss-flex ss-col-center"},{default:i((()=>[p(H,{src:v(c).$url.static("/static/images/score1.svg"),class:"score-img"},null,8,["src"]),p(n,null,{default:i((()=>[k(x(t.score_amount),1)])),_:2},1024)])),_:2},1024)):_("",!0)])),_:2},1024)])),_:2},1024),p(n,{class:C(["order-card-footer ss-flex ss-col-center ss-p-x-20",t.btns.length>3?"ss-row-between":"ss-row-right"])},{default:i((()=>[p(n,{class:"ss-flex ss-col-center"},{default:i((()=>[t.btns.includes("groupon")?(r(),l(d,{key:0,class:"tool-btn ss-reset-button",onClick:$((s=>function(t){c.$router.go("/pages/activity/groupon/detail",{id:t.ext.groupon_id})}(t)),["stop"])},{default:i((()=>[k(x("groupon_ing"===t.status_code?"邀请拼团":"拼团详情"),1)])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("invoice")?(r(),l(d,{key:1,class:"tool-btn ss-reset-button",onClick:$((s=>{var e,a;return a=null==(e=t.invoice)?void 0:e.id,void c.$router.go("/pages/order/invoice",{invoiceId:a})}),["stop"])},{default:i((()=>[k(" 查看发票 ")])),_:2},1032,["onClick"])):_("",!0),0===t.btns.length?(r(),l(d,{key:2,class:"tool-btn ss-reset-button",onClick:$((s=>F(t.order_sn)),["stop"])},{default:i((()=>[k(" 查看详情 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("confirm")?(r(),l(d,{key:3,class:"tool-btn ss-reset-button",onClick:$((s=>async function(t,s=!1){if("WechatMiniProgram"===c.$platform.name&&!j.isEmpty(t.wechat_extra_data)&&1===P.value&&!s)return void mpConfirm(t);const{error:e}=await c.$api.order.confirm(t.id);0===e&&(z.pagination=q,W())}(t)),["stop"])},{default:i((()=>[k(" 确认收货 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("express")?(r(),l(d,{key:4,class:"tool-btn ss-reset-button",onClick:$((s=>async function(t){c.$router.go("/pages/order/express/list",{orderId:t})}(t.id)),["stop"])},{default:i((()=>[k(" 查看物流 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("apply_refund")?(r(),l(d,{key:5,class:"tool-btn ss-reset-button",onClick:$((s=>R(t.id)),["stop"])},{default:i((()=>[k(" 申请退款 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("re_apply_refund")?(r(),l(d,{key:6,class:"tool-btn ss-reset-button",onClick:$((s=>R(t.id)),["stop"])},{default:i((()=>[k(" 重新退款 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("cancel")?(r(),l(d,{key:7,class:"tool-btn ss-reset-button",onClick:$((s=>async function(t){w({title:"提示",content:"确定要取消订单吗?",success:async function(s){if(s.confirm){const{error:s,data:e}=await c.$api.order.cancel(t);if(0===s){let s=z.pagination.data.findIndex((s=>s.id===t));z.pagination.data[s]=e}}}})}(t.id)),["stop"])},{default:i((()=>[k(" 取消订单 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("comment")?(r(),l(d,{key:8,class:"tool-btn ss-reset-button",onClick:$((s=>{return e=t.order_sn,void c.$router.go("/pages/goods/comment/add",{orderSN:e});var e}),["stop"])},{default:i((()=>[k(" 评价晒单 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("delete")?(r(),l(d,{key:9,class:"delete-btn ss-reset-button",onClick:$((s=>{return e=t.id,void w({title:"提示",content:"确定要删除订单吗?",success:async function(t){if(t.confirm){const{error:t,data:s}=await c.$api.order.delete(e);if(0===t){let t=z.pagination.data.findIndex((t=>t.id===e));z.pagination.data.splice(t,1)}}}});var e}),["stop"])},{default:i((()=>[k(" 删除订单 ")])),_:2},1032,["onClick"])):_("",!0),t.btns.includes("pay")?(r(),l(d,{key:10,class:"tool-btn ss-reset-button ui-BG-Main-Gradient",onClick:$((s=>{return e=t.order_sn,void c.$router.go("/pages/pay/index",{orderSN:e});var e}),["stop"])},{default:i((()=>[k(" 继续支付 ")])),_:2},1032,["onClick"])):_("",!0)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1032,["onClick"])))),128))])),_:1})):_("",!0),z.pagination.total>0?(r(),l(K,{key:2,status:z.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:D},null,8,["status"])):_("",!0)])),_:1})}}},[["__scopeId","data-v-651cfe42"]]);export{P as default};
|