1 |
- import{z as e,c as s,am as r,o as t,p as a,a6 as o,c3 as l,f as u,g as c,w as d,x as i,c0 as n,m as p,k as f,i as y,s as _,u as m,v as g,Q as k,a as v,j as b,y as x,J as w,n as I}from"./index-dbd18a2c.js";import{_ as h}from"./s-layout.cc30b4d6.js";import{f as j}from"./useGoods.12bde50a.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./phone-international-input.18d32780.js";const $=T({__name:"resultYuan",setup(T){const $=e({id:0,orderType:"goods",result:"unpaid",orderInfo:{},tradeOrder:{},counter:0}),S=s((()=>"unpaid"===$.result?"waiting":"paid"===$.result?"success":"failed"===$.result?"failed":"closed"===$.result?"closed":void 0));async function C(e){$.counter++;const{data:s,code:r}=await n.getByStatus2(e);if(0===r){if($.orderInfo=s,!$.orderInfo||30===$.orderInfo.status)return void($.result="closed");if(0!==$.orderInfo.status)return void($.result="paid")}$.counter<3&&"unpaid"===$.result&&setTimeout((()=>{C(e)}),1500),$.counter>=3&&($.result="failed")}function F(){"recharge"===$.orderType?_.$router.redirect("/pages/pay/recharge-log"):_.$router.redirect("/pages/order/list",{type:2})}r((()=>{"success"==S.value&&v({points:$.orderInfo.jf,socialStatus:$.orderInfo.sj})}));const O=s((()=>$.orderInfo.no.includes("top-up")));return t((async e=>{e.id&&($.id=e.id),e.orderType&&($.orderType=e.orderType),e.payRes?($.payState="success",$.orderInfo=JSON.parse(e.payRes),$.result="paid"):await C($.id)})),a((()=>{o.isEmpty($.orderInfo)||"success"===$.payState||C($.id)})),l((()=>{$.result="unpaid",$.counter=0})),(e,s)=>{const r=b,t=x,a=w,o=p(I("s-layout"),h);return u(),c(o,{title:i(k)("order.payment_result"),bgStyle:{color:"#FFF"}},{default:d((()=>[f(r,{class:"pay-result-box ss-flex-col ss-row-center ss-col-center"},{default:d((()=>["waiting"===S.value?(u(),c(r,{key:0,class:"pay-waiting ss-m-b-30"})):y("",!0),"success"===S.value?(u(),c(t,{key:1,class:"pay-img ss-m-b-30",src:i(_).$url.static("/static/images/order_pay_success.gif")},null,8,["src"])):y("",!0),["failed","closed"].includes(S.value)?(u(),c(t,{key:2,class:"pay-img ss-m-b-30",src:i(_).$url.static("/static/images/order_paty_fail.gif")},null,8,["src"])):y("",!0),"success"===S.value?(u(),c(r,{key:3,class:"tip-text ss-m-b-30"},{default:d((()=>[m(g(i(k)("order.payment_successful")),1)])),_:1})):y("",!0),"failed"===S.value?(u(),c(r,{key:4,class:"tip-text ss-m-b-30"},{default:d((()=>[m(g(i(k)("order.payment_failed")),1)])),_:1})):y("",!0),"closed"===S.value?(u(),c(r,{key:5,class:"tip-text ss-m-b-30"},{default:d((()=>[m(g(i(k)("order.order_closed")),1)])),_:1})):y("",!0),"waiting"===S.value?(u(),c(r,{key:6,class:"tip-text ss-m-b-30"},{default:d((()=>[m(g(i(k)("order.checking_payment_result"))+"...",1)])),_:1})):y("",!0),"success"===S.value?(u(),c(r,{key:7,class:"pay-total-num ss-flex"},{default:d((()=>[f(r,null,{default:d((()=>[m("¥"+g(i(j)($.orderInfo.price)),1)])),_:1})])),_:1})):y("",!0),f(r,{class:"btn-box ss-flex ss-row-center ss-m-t-50"},{default:d((()=>[f(a,{class:"back-btn ss-reset-button",onClick:s[0]||(s[0]=e=>i(_).$router.go("/pages/index/index"))},{default:d((()=>[m(g(i(k)("order.return_home")),1)])),_:1}),"failed"===S.value?(u(),c(a,{key:0,class:"check-btn ss-reset-button",onClick:s[1]||(s[1]=e=>i(_).$router.redirect("/pages/pay/index",{id:$.id,orderType:$.orderType}))},{default:d((()=>[m(g(i(k)("order.retry_payment")),1)])),_:1})):y("",!0),"success"!==S.value||O.value?y("",!0):(u(),c(a,{key:1,class:"check-btn ss-reset-button",onClick:F},{default:d((()=>[m(g(i(k)("order.view_order")),1)])),_:1})),"success"===S.value&&O.value?(u(),c(a,{key:2,class:"check-btn ss-reset-button",onClick:s[2]||(s[2]=e=>i(_).$router.redirect("/pages/user/wallet/score"))},{default:d((()=>[m(g(i(k)("order.view_wallet")),1)])),_:1})):y("",!0),"success"===S.value&&3===$.tradeOrder.type?(u(),c(a,{key:3,class:"check-btn ss-reset-button",onClick:s[3]||(s[3]=e=>i(_).$router.redirect("/pages/activity/groupon/order"))},{default:d((()=>[m(g(i(k)("order.my_group_buying")),1)])),_:1})):y("",!0)])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-26efda7e"]]);export{$ as default};
|