orderDetail.js
3.3 KB
"use strict";const e=require("../../common/vendor.js"),u=require("../../api/index.js");require("../../utils/request.js");Array||e.resolveComponent("u-navbar")();const P=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";Math||(P+R+S+j+$)();const R=()=>"../../componets/address.js",S=()=>"../../componets/orderShop.js",$=()=>"../../componets/tipPop.js",j=()=>"../../componets/checkPayMode.js",M={__name:"orderDetail",setup(_){e.onLoad(t=>{console.log(t.id),c.value=t.id,b(t.id)});let i=e.ref(!1),n=e.ref({}),a=e.ref(!1),c=e.ref(""),o=e.ref(1),h=e.ref(0),d=e.ref(1),p=e.ref(0),l=e.ref([{id:1,name:"订单编号",text:""},{id:2,name:"支付方式",text:""},{id:3,name:"下单时间",text:""},{id:4,name:"快递编号",text:""}]);e.onShow(()=>{x()});const x=async()=>{try{const t=await u.getyue();p.value=t.money}catch(t){e.index.showToast({title:t,icon:"none"}),console.log("getyue",t)}},m=()=>{e.index.navigateBack({delta:1})},y=()=>{e.index.setClipboardData({data:n.value.express_no,success:()=>{e.index.showToast({title:"复制成功",icon:"none"})}})},g=t=>{t==0?(d.value=o.value==1?1:2,i.value=!0):o.value==1?a.value=!0:C()},w=t=>{console.log(t),i.value=!1,t==1&&(d.value==1?T():O())},{proxy:f}=e.getCurrentInstance(),b=async t=>{try{const r=await u.getOrderdetail(t);n.value=r,o.value=r.order_status,l.value[0].text=r.order_no,l.value[1].text=r.zhifu==1?"微信":"余额",l.value[2].text=r.createtime,l.value[3].text=r.express_no,console.log("getOrderdetail",r)}catch(r){e.index.showToast({title:r,icon:"none"}),console.log("getOrderdetail",r)}},T=async()=>{try{const t=await u.getCancleOrder(c.value);f.$methods.showTN("订单已取消~"),console.log("getCancleOrder",t)}catch(t){e.index.showToast({title:t,icon:"none"}),console.log("getCancleOrder",t)}},O=async()=>{try{const t=await u.getRefund(c.value);f.$methods.showTN("已申请,等待客服审核"),console.log("getRefund",t)}catch(t){e.index.showToast({title:t,icon:"none"}),console.log("getRefund",t)}},C=async()=>{try{const t=await u.getReceipt(c.value);f.$methods.showTN("已收货,期待下次下单~"),console.log("getReceipt",t)}catch(t){e.index.showToast({title:t,icon:"none"}),console.log("getReceipt",t)}};return e.ref({}),(t,r)=>e.e({a:e.o(m),b:e.p({bgColor:"transparent",placeholder:!0}),c:e.p({isOrder:!0,adress:e.unref(n)}),d:e.p({shop:e.unref(n)}),e:e.unref(n).goodstatus_text!==3},e.unref(n).goodstatus_text!==3?{f:e.t(e.unref(n).total_price)}:{},{g:e.unref(n).goodstatus_text===3},e.unref(n).goodstatus_text===3?{h:e.t(e.unref(n).express_price),i:e.t(e.unref(n).score),j:e.t(e.unref(n).express_price)}:{},{k:e.f(e.unref(l),(s,v,q)=>e.e({a:e.t(s.name),b:e.t(s.text.length?s.text:`暂无${s.name}`),c:v==0},v==0?{d:e.o(y,s.id)}:{},{e:s.id})),l:e.unref(o)==3},e.unref(o)==3?{}:{},{m:e.unref(o)<=2},e.unref(o)<=2?{n:e.t(e.unref(o)==1?"取消付款":e.unref(o)==2?"申请退款":"联系客服"),o:e.o(s=>g(0))}:{},{p:e.unref(o)==1||e.unref(o)==3},e.unref(o)==1||e.unref(o)==3?{q:e.t(e.unref(o)==1?"立即支付":"确认收货"),r:e.o(s=>g(1))}:{},{s:e.o(s=>e.isRef(a)?a.value=!1:a=!1),t:e.p({balance:e.unref(p),orderId:e.unref(c),isOrderPay:!0,totalPrice:e.unref(n).total_price,modeShow:e.unref(a)}),v:e.o(w),w:e.p({integral:e.unref(h),tipType:e.unref(d),tipShow:e.unref(i)})})}},k=e._export_sfc(M,[["__file","D:/vue/大健康商城/healthMall/pages/mine/orderDetail.vue"]]);wx.createPage(k);