pages-pay-result.54997c31.js 3.5 KB

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