pages-pay-resultYuan.044007d2.js 3.8 KB

1
  1. import{z as e,c as s,al as t,o as a,p as r,a6 as o,c2 as l,f as u,g as c,w as i,b$ as d,m as n,k as p,i as f,x as y,s as g,u as m,v as _,a as k,j as b,y as v,J as x,n as I}from"./index-a116b7fa.js";import{_ as w}from"./s-layout.4ae51839.js";import{f as j}from"./useGoods.6b315a78.js";import{_ as $}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.b9f6c8e6.js";const h=$({__name:"resultYuan",setup($){const h=e({id:0,orderType:"goods",result:"unpaid",orderInfo:{},tradeOrder:{},counter:0}),T=s((()=>"unpaid"===h.result?"waiting":"paid"===h.result?"success":"failed"===h.result?"failed":"closed"===h.result?"closed":void 0));async function S(e){h.counter++;const{data:s,code:t}=await d.getByStatus2(e);if(0===t){if(h.orderInfo=s,!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((()=>{S(e)}),1500),h.counter>=3&&(h.result="failed")}function C(){"recharge"===h.orderType?g.$router.redirect("/pages/pay/recharge-log"):g.$router.redirect("/pages/order/list",{type:2})}t((()=>{"success"==T.value&&k({points:h.orderInfo.jf,socialStatus:h.orderInfo.sj})}));const F=s((()=>h.orderInfo.no.includes("top-up")));return a((async e=>{e.id&&(h.id=e.id),e.orderType&&(h.orderType=e.orderType),e.payRes?(h.payState="success",h.orderInfo=JSON.parse(e.payRes),h.result="paid"):await S(h.id)})),r((()=>{o.isEmpty(h.orderInfo)||"success"===h.payState||S(h.id)})),l((()=>{h.result="unpaid",h.counter=0})),(e,s)=>{const t=b,a=v,r=x,o=n(I("s-layout"),w);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"===T.value?(u(),c(t,{key:0,class:"pay-waiting ss-m-b-30"})):f("",!0),"success"===T.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(T.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"===T.value?(u(),c(t,{key:3,class:"tip-text ss-m-b-30"},{default:i((()=>[m("支付成功")])),_:1})):f("",!0),"failed"===T.value?(u(),c(t,{key:4,class:"tip-text ss-m-b-30"},{default:i((()=>[m("支付失败")])),_:1})):f("",!0),"closed"===T.value?(u(),c(t,{key:5,class:"tip-text ss-m-b-30"},{default:i((()=>[m("该订单已关闭")])),_:1})):f("",!0),"waiting"===T.value?(u(),c(t,{key:6,class:"tip-text ss-m-b-30"},{default:i((()=>[m("检测支付结果...")])),_:1})):f("",!0),"success"===T.value?(u(),c(t,{key:7,class:"pay-total-num ss-flex"},{default:i((()=>[p(t,null,{default:i((()=>[m("¥"+_(y(j)(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:s[0]||(s[0]=e=>y(g).$router.go("/pages/index/index"))},{default:i((()=>[m(" 返回首页 ")])),_:1}),"failed"===T.value?(u(),c(r,{key:0,class:"check-btn ss-reset-button",onClick:s[1]||(s[1]=e=>y(g).$router.redirect("/pages/pay/index",{id:h.id,orderType:h.orderType}))},{default:i((()=>[m(" 重新支付 ")])),_:1})):f("",!0),"success"!==T.value||F.value?f("",!0):(u(),c(r,{key:1,class:"check-btn ss-reset-button",onClick:C},{default:i((()=>[m(" 查看订单 ")])),_:1})),"success"===T.value&&F.value?(u(),c(r,{key:2,class:"check-btn ss-reset-button",onClick:s[2]||(s[2]=e=>y(g).$router.redirect("/pages/user/wallet/score"))},{default:i((()=>[m(" 查看钱包 ")])),_:1})):f("",!0),"success"===T.value&&3===h.tradeOrder.type?(u(),c(r,{key:3,class:"check-btn ss-reset-button",onClick:s[3]||(s[3]=e=>y(g).$router.redirect("/pages/activity/groupon/order"))},{default:i((()=>[m(" 我的拼团 ")])),_:1})):f("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-da5a5652"]]);export{h as default};