2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
|
import{d as t,r as a,o as e,f as s,Y as l,h as o,E as u,i as r,w as n,j as i,H as c,J as p,K as m,m as d,l as f,F as x,$ as y,bc as _,M as v,t as j,p as h,q as b,aj as g}from"./index-849cf30e.js";import{_ as w}from"./u-button.9fa3f2a0.js";import{_ as T}from"./u-loading-icon.d012ecbf.js";import{_ as S}from"./u-modal.081e9589.js";import{g as C}from"./pay.46c830b5.js";import"./u-icon.e3aa4770.js";import"./_plugin-vue_export-helper.1b428a4d.js";import"./u-line.19eb5c40.js";import"./u-popup.e01742d2.js";import"./u-transition.75065529.js";import"./u-safe-bottom.2f6af56c.js";const F=t({__name:"result",setup(t){const F=a(null),k=a(!1);let z="",E=0,P=0;e((t=>{z=t.trade_type,E=t.trade_id,R()}));const R=()=>{C(z,E).then((t=>{if(!uni.$u.test.isEmpty(t.data)){if(1==t.data.status&&P<5)return k.value=!0,P++,void setTimeout((()=>{R()}),1e3);F.value=t.data,k.value=!1,s({title:2==F.value.status?l("pay.paySuccess"):l("pay.payFail")})}})).catch((()=>{}))},Y=()=>{var t;const a=decodeURIComponent(uni.getStorageSync("payReturn"));y(a?{url:a,mode:"redirectTo"}:{url:_(),param:{code:null==(t=F.value)?void 0:t.out_trade_no},mode:"redirectTo"})};return(t,a)=>{const e=v,s=j,y=h(b("u-button"),w),_=h(b("u-loading-icon"),T),C=h(b("u-modal"),S);return o(),u(x,null,[F.value?(o(),r(s,{key:0,class:"w-screen h-screen flex flex-col items-center"},{default:n((()=>[i(s,{class:"flex-1 flex flex-col items-center w-full pt-[100rpx]"},{default:n((()=>[i(e,{class:c(["iconfont text-2xl",2==F.value.status?"text-primary iconduigou":"iconzhifushibai text-red"])},null,8,["class"]),i(s,{class:"text-sm"},{default:n((()=>[p(m(2==F.value.status?d(l)("pay.paySuccess"):d(l)("pay.payFail")),1)])),_:1}),i(s,{class:"text-xl font-bold pt-[30rpx]"},{default:n((()=>[i(e,{class:"text-base"},{default:n((()=>[p(m(d(l)("currency")),1)])),_:1}),i(e,null,{default:n((()=>[p(m(d(g)(F.value.money)),1)])),_:1})])),_:1})])),_:1}),i(s,{class:"pb-[200rpx] w-[240rpx]"},{default:n((()=>[i(y,{type:"primary",text:2==F.value.status?d(l)("complete"):d(l)("close"),plain:!0,onClick:Y},null,8,["text"])])),_:1})])),_:1})):f("v-if",!0),i(C,{show:k.value,showCancelButton:!0,confirmText:d(l)("pay.completePay"),cancelText:d(l)("pay.incompletePay"),onCancel:Y},{default:n((()=>[i(s,{class:"py-[20rpx]"},{default:n((()=>[i(_,{text:d(l)("pay.getting"),textSize:"16",mode:"circle",vertical:!0},null,8,["text"])])),_:1})])),_:1},8,["show","confirmText","cancelText"])],64)}}});export{F as default};
|