index-legacy-bf964508.js 4.7 KB

1
  1. System.register(["./index-legacy-bfebbbb9.js","./index-legacy-9b45a071.js","./index-legacy-236532da.js"],(function(e,a){"use strict";var r,n,o,i,t,l,d,p,c,s,_,u,y,m,g,b,h,w,f;return{setters:[e=>{r=e.d,n=e.q,o=e.U,i=e.x,t=e.y,l=e.a,d=e.F,p=e.P,c=e.L,s=e.I,_=e.Q,u=e.R,y=e.bA,m=e.bC,g=e.E,b=e.D,h=e.bB},e=>{w=e.C},e=>{f=e.C}],execute:function(){var a=document.createElement("style");a.textContent="._paywxresult_1bih4_1{overflow:hidden;min-height:100vh}._paywxresult_1bih4_1 :gloabl ._van-cell_1bih4_5{padding:.32rem .42667rem}._paywxresult_1bih4_1 :gloabl ._van-cell__title_1bih4_8,._paywxresult_1bih4_1 :gloabl ._van-cell__value_1bih4_9{flex:auto;font-size:.42667rem;color:#4f4f4f}._paywxresult_1bih4_1 :gloabl ._van-button_1bih4_14{font-size:.42667rem;width:86%;margin:.53333rem auto}._paywxresult_1bih4_1 :gloabl ._van-loading__spinner_1bih4_19{width:1.33333rem;height:1.33333rem}._container_1bih4_23{background:#fff;padding:.4rem 0}._order-loading_1bih4_27{padding:.4rem 0;margin-top:.4rem;background-color:#fff;text-align:center;font-size:.4rem}._order-loading_1bih4_27>p{margin-bottom:.4rem}._error-text_1bih4_37{font-size:.4rem;width:100%;text-align:center;color:#3f3f3f;margin-top:2.66667rem}._error-icon_1bih4_44{display:block;color:#ffb07b;font-size:.58667rem;margin-bottom:.53333rem}\n",document.head.appendChild(a);const v="_paywxresult_1bih4_1",x="_container_1bih4_23",S="_order-loading_1bih4_27",q="_error-text_1bih4_37",I="_error-icon_1bih4_44";e("default",r({name:"pay-result",setup(){const e=n(),a=o(),r=i({errorText:"",browserStatus:!1,code:null,pay_channel:a.query.pay_channel,wxAppId:a.query.wxAppId,paymentType:a.query.paymentType,alipayAppId:a.query.alipayAppId,body:a.query.body,price:a.query.price,orderNo:a.query.orderNo,userId:a.query.userId,payInfo:{},isYeePay:!1}),N=async()=>{try{var e;if(parseFloat(r.price)<=0)return void g("支付金额异常");const a={merOrderNo:r.orderNo,paymentChannel:r.pay_channel,userId:r.userId,code:r.code},{data:n}=await b.post("/edu-app/open/userOrder/executePayment",{data:{...a}});r.isYeePay=-1!==(null===(e=n.paymentVender)||void 0===e?void 0:e.indexOf("yeepay")),console.log(n,"data"),A(n.reqParams)}catch(a){console.log(a),window.location.replace(location.origin+"/classroom-app/#/payment-result?orderNo="+r.orderNo)}},B=e=>{var a;a=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+"/classroom-app/#/payment-result?orderNo="+r.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?a&&a():document.addEventListener("AlipayJSBridgeReady",a,!1)},A=e=>{if("alipay_qr"==r.pay_channel)if(r.isYeePay)B(e.tradeNO);else{var a,n;const r="false"===e.prod_mode?(null==e||null===(a=e.expend)||void 0===a?void 0:a.qrcode_url)+"?payment_id="+e.id+"&pay_channel="+e.pay_channel:null==e||null===(n=e.expend)||void 0===n?void 0:n.qrcode_url;window.location.href=r}else if("alipay_wap"==r.pay_channel){var o;window.location.href=null==e||null===(o=e.expend)||void 0===o?void 0:o.pay_info}else if("wx_pub"==r.pay_channel){var i;const a=r.isYeePay?JSON.parse(e.prePayTn):null!=e&&e.expend?JSON.parse(null==e||null===(i=e.expend)||void 0===i?void 0:i.pay_info):e;r.payInfo=a,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",J,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",J)(document).attachEvent("onWeixinJSBridgeReady",J):J()}},J=()=>{const e=r.payInfo;window.WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:e.appId,timeStamp:e.timeStamp,nonceStr:e.nonceStr,package:e.package||e.packageValue,signType:e.signType,paySign:e.paySign},(e=>{"get_brand_wcpay_request:cancel"==e.err_msg||e.err_msg,window.location.replace(location.origin+"/classroom-app/#/payment-result?orderNo="+r.orderNo)}))},C=()=>{const e=y();e?(r.code=e,N()):h(r.wxAppId)};return t((()=>{(()=>{const n=a.query,o=-1!==r.paymentType.indexOf("yeepay");if(n.orderNo&&n.pay_channel)if(u().weixin)r.browserStatus=!0,C();else if(u().alipay)if(o){let e=y("auth_code");e?(r.code=e,r.browserStatus=!0,N()):m(r.alipayAppId)}else r.browserStatus=!0,N();else r.errorText="请在微信或支付宝客户端打开",document.title="ERROR";else _({message:"支付订单信息错误请重新支付",showCancelButton:!1}).then((()=>{e.back()}))})()})),()=>l("div",{class:v},[r.browserStatus&&l(d,null,[l("div",{class:x},[l(w,{border:!1},{default:()=>[l(f,{title:"订单金额",value:"¥ "+p(r.price)},null),l(f,{title:"订单信息",value:r.body},null)]})]),l("div",{class:S},[l("p",null,["wx_pub"==r.pay_channel?"微信支付":"支付宝支付"]),l(c,{type:"spinner",color:"#01C1B5"},null)])]),!r.browserStatus&&l("div",{class:q},[r.errorText&&l(s,{class:I,name:"warning-o"},null),r.errorText])])}}))}}}));