pages-pay-resultYuan.83d2aa7f.js 3.5 KB

1
  1. import{z as s,c as e,ak as t,o as a,p as r,a7 as o,bW as l,f as u,g as c,w as i,bT as d,m as n,k as p,i as f,x as y,s as g,u as m,v as _,a as b,j as k,y as v,J as x,n as I}from"./index-ba48620e.js";import{_ as j}from"./s-layout.04b95866.js";import{f as w}from"./useGoods.edb8879f.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.dd3ca29e.js";const h=T({__name:"resultYuan",setup(T){const h=s({id:0,orderType:"goods",result:"unpaid",orderInfo:{},tradeOrder:{},counter:0}),$=e((()=>"unpaid"===h.result?"waiting":"paid"===h.result?"success":"failed"===h.result?"failed":"closed"===h.result?"closed":void 0));async function C(s){h.counter++;const{data:e,code:t}=await d.getByStatus2(s);if(0===t){if(h.orderInfo=e,!h.orderInfo||30===h.orderInfo.status)return void(h.result="closed");if(0!==h.orderInfo.status)return void(h.result="paid")}h.counter<3&&"unpaid"===h.result&&setTimeout((()=>{C(s)}),1500),h.counter>=3&&(h.result="failed")}function F(){"recharge"===h.orderType?g.$router.redirect("/pages/pay/recharge-log"):g.$router.redirect("/pages/order/list")}return t((()=>{"success"==$.value&&b({points:h.orderInfo.jf,socialStatus:h.orderInfo.sj})})),a((async s=>{console.log(s.id),s.id&&(h.id=s.id),s.orderType&&(h.orderType=s.orderType),await C(h.id)})),r((()=>{o.isEmpty(h.orderInfo)||C(h.id)})),l((()=>{h.result="unpaid",h.counter=0})),(s,e)=>{const t=k,a=v,r=x,o=n(I("s-layout"),j);return u(),c(o,{title:"支付结果",bgStyle:{color:"#FFF"}},{default:i((()=>[p(t,{class:"pay-result-box ss-flex-col ss-row-center ss-col-center"},{default:i((()=>["waiting"===$.value?(u(),c(t,{key:0,class:"pay-waiting ss-m-b-30"})):f("",!0),"success"===$.value?(u(),c(a,{key:1,class:"pay-img ss-m-b-30",src:y(g).$url.static("/static/images/order_pay_success.gif")},null,8,["src"])):f("",!0),["failed","closed"].includes($.value)?(u(),c(a,{key:2,class:"pay-img ss-m-b-30",src:y(g).$url.static("/static/images/order_paty_fail.gif")},null,8,["src"])):f("",!0),"success"===$.value?(u(),c(t,{key:3,class:"tip-text ss-m-b-30"},{default:i((()=>[m("支付成功")])),_:1})):f("",!0),"failed"===$.value?(u(),c(t,{key:4,class:"tip-text ss-m-b-30"},{default:i((()=>[m("支付失败")])),_:1})):f("",!0),"closed"===$.value?(u(),c(t,{key:5,class:"tip-text ss-m-b-30"},{default:i((()=>[m("该订单已关闭")])),_:1})):f("",!0),"waiting"===$.value?(u(),c(t,{key:6,class:"tip-text ss-m-b-30"},{default:i((()=>[m("检测支付结果...")])),_:1})):f("",!0),"success"===$.value?(u(),c(t,{key:7,class:"pay-total-num ss-flex"},{default:i((()=>[p(t,null,{default:i((()=>[m("¥"+_(y(w)(h.orderInfo.price)),1)])),_:1})])),_:1})):f("",!0),p(t,{class:"btn-box ss-flex ss-row-center ss-m-t-50"},{default:i((()=>[p(r,{class:"back-btn ss-reset-button",onClick:e[0]||(e[0]=s=>y(g).$router.go("/pages/index/index"))},{default:i((()=>[m(" 返回首页 ")])),_:1}),"failed"===$.value?(u(),c(r,{key:0,class:"check-btn ss-reset-button",onClick:e[1]||(e[1]=s=>y(g).$router.redirect("/pages/pay/index",{id:h.id,orderType:h.orderType}))},{default:i((()=>[m(" 重新支付 ")])),_:1})):f("",!0),"success"===$.value?(u(),c(r,{key:1,class:"check-btn ss-reset-button",onClick:F},{default:i((()=>[m(" 查看订单 ")])),_:1})):f("",!0),"success"===$.value&&3===h.tradeOrder.type?(u(),c(r,{key:2,class:"check-btn ss-reset-button",onClick:e[2]||(e[2]=s=>y(g).$router.redirect("/pages/activity/groupon/order"))},{default:i((()=>[m(" 我的拼团 ")])),_:1})):f("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-3ddbdee5"]]);export{h as default};