1 |
- !function(){var e=document.createElement("style");e.innerHTML="._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(e),System.register(["./index-legacy.eb062188.js","./index-legacy.148f784c.js","./index-legacy.918b8c74.js"],(function(e){"use strict";var n,a,r,o,i,t,l,d,c,p,s,u,_,y,h,m,b,g,f;return{setters:[function(e){n=e.d,a=e.ag,r=e.ah,o=e.r,i=e.$,t=e.c,l=e.F,d=e.ba,c=e.L,p=e.a5,s=e.bd,u=e.f,_=e.bh,y=e.bU,h=e.o,m=e.m,b=e.bk},function(e){g=e.C},function(e){f=e.C}],execute:function(){var w="_paywxresult_1bih4_1",v="_container_1bih4_23",x="_order-loading_1bih4_27",S="_error-text_1bih4_37",q="_error-icon_1bih4_44";e("default",n({name:"pay-result",setup(){const e=a(),n=r(),I=o({errorText:"",browserStatus:!1,code:null,paymentType:n.query.paymentType,pay_channel:n.query.pay_channel,wxAppId:n.query.wxAppId,alipayAppId:n.query.alipayAppId,body:n.query.body,price:n.query.price,orderNo:n.query.orderNo,userId:n.query.userId,payInfo:{},isYeePay:!1}),N=async()=>{try{var e;if(parseFloat(I.price)<=0)return void h("支付金额异常");const n={merOrderNo:I.orderNo,paymentChannel:I.pay_channel,userId:I.userId};"wx_pub"==I.pay_channel&&(n.code=I.code);const{data:a}=await m.post("/api-student/open/userOrder/executePayment",{data:{...n}});I.isYeePay=-1!==(null===(e=a.paymentVender)||void 0===e?void 0:e.indexOf("yeepay")),console.log(a,"payment",I.pay_channel),J(a.reqParams)}catch(n){console.log(n),window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+I.orderNo)}},B=e=>{var n;n=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+I.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)},J=e=>{if("alipay_qr"==I.pay_channel)if(I.isYeePay)B(e.tradeNO);else{var n,a;const r="false"===e.prod_mode?(null==e||null===(n=e.expend)||void 0===n?void 0:n.qrcode_url)+"?payment_id="+e.id+"&pay_channel="+e.pay_channel:null==e||null===(a=e.expend)||void 0===a?void 0:a.qrcode_url;window.location.href=r}else if("alipay_wap"==I.pay_channel){var r;window.location.href=null==e||null===(r=e.expend)||void 0===r?void 0:r.pay_info}else if("wx_pub"==I.pay_channel){var o;const n=I.isYeePay?JSON.parse(e.prePayTn):null!=e&&e.expend?JSON.parse(null==e||null===(o=e.expend)||void 0===o?void 0:o.pay_info):e;I.payInfo=n,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",T,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",T)(document).attachEvent("onWeixinJSBridgeReady",T):T()}},T=()=>{const e=I.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+"/orchestra-student/#/payment-result?orderNo="+I.orderNo)}))},A=()=>{const e=_();e?(I.code=e,N()):b(I.wxAppId)};return i((()=>{(()=>{var a;const r=n.query;console.log(r);const o=-1!==(null===(a=I.paymentType)||void 0===a?void 0:a.indexOf("yeepay"));if(r.orderNo&&r.pay_channel)if(u().weixin)I.browserStatus=!0,A();else if(u().alipay)if(o){const e=_("auth_code")||n.query.auth_code;e?(I.code=e,I.browserStatus=!0,N()):y(I.alipayAppId)}else I.browserStatus=!0,N();else I.errorText="请在微信或支付宝客户端打开",document.title="ERROR";else s({message:"支付订单信息错误请重新支付",showCancelButton:!1}).then((()=>{e.back()}))})()})),()=>t("div",{class:w},[I.browserStatus&&t(l,null,[t("div",{class:v},[t(g,{border:!1},{default:()=>[t(f,{title:"订单金额",value:"¥ "+d(I.price)},null),t(f,{title:"订单信息",value:I.body},null)]})]),t("div",{class:x},[t("p",null,["wx_pub"==I.pay_channel?"微信支付":"支付宝支付"]),t(c,{type:"spinner",color:"#01C1B5"},null)])]),!I.browserStatus&&t("div",{class:S},[I.errorText&&t(p,{class:q,name:"warning-o"},null),I.errorText])])}}))}}}))}();
|