index-legacy.0e20cfd7.js 6.2 KB

1
  1. !function(){function e(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function n(n){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?e(Object(a),!0).forEach((function(e){r(n,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}))}return n}function r(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function t(e,n,r,t,a,o,i){try{var l=e[o](i),c=l.value}catch(d){return void r(d)}l.done?n(c):Promise.resolve(c).then(t,a)}var a=document.createElement("style");a.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(a),System.register(["./index-legacy.47bc1690.js","./index-legacy.bab9fe30.js","./index-legacy.92a01198.js"],(function(e){"use strict";var r,a,o,i,l,c,d,u,p,s,y,_,f,b,h,m,g,v,w;return{setters:[function(e){r=e.d,a=e.ag,o=e.ah,i=e.r,l=e.$,c=e.c,d=e.F,u=e.b6,p=e.L,s=e.a5,y=e.b9,_=e.f,f=e.bd,b=e.dp,h=e.o,m=e.m,g=e.bg},function(e){v=e.C},function(e){w=e.C}],execute:function(){var x="_paywxresult_1bih4_1",O="_container_1bih4_23",S="_order-loading_1bih4_27",P="_error-text_1bih4_37",q="_error-icon_1bih4_44";e("default",r({name:"pay-result",setup:function(){var e=a(),r=o(),j=i({errorText:"",browserStatus:!1,code:null,paymentType:r.query.paymentType,pay_channel:r.query.pay_channel,wxAppId:r.query.wxAppId,alipayAppId:r.query.alipayAppId,body:r.query.body,price:r.query.price,orderNo:r.query.orderNo,userId:r.query.userId,payInfo:{},isYeePay:!1}),I=function(){var e,r=(e=regeneratorRuntime.mark((function e(){var r,t,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(parseFloat(j.price)<=0)){e.next=4;break}return h("支付金额异常"),e.abrupt("return");case 4:return t={merOrderNo:j.orderNo,paymentChannel:j.pay_channel,userId:j.userId},"wx_pub"==j.pay_channel&&(t.code=j.code),e.next=8,m.post("/api-student/open/userOrder/executePayment",{data:n({},t)});case 8:a=e.sent,o=a.data,j.isYeePay=-1!==(null===(r=o.paymentVender)||void 0===r?void 0:r.indexOf("yeepay")),console.log(o,"payment",j.pay_channel),k(o.reqParams),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.log(e.t0),window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+j.orderNo);case 19:case"end":return e.stop()}}),e,null,[[0,15]])})),function(){var n=this,r=arguments;return new Promise((function(a,o){var i=e.apply(n,r);function l(e){t(i,a,o,l,c,"next",e)}function c(e){t(i,a,o,l,c,"throw",e)}l(void 0)}))});return function(){return r.apply(this,arguments)}}(),N=function(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="+j.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)},k=function(e){if("alipay_qr"==j.pay_channel)if(j.isYeePay)N(e.tradeNO);else{var n,r,t="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===(r=e.expend)||void 0===r?void 0:r.qrcode_url;window.location.href=t}else if("alipay_wap"==j.pay_channel){var a;window.location.href=null==e||null===(a=e.expend)||void 0===a?void 0:a.pay_info}else if("wx_pub"==j.pay_channel){var o,i=j.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;j.payInfo=i,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",B,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",B)(document).attachEvent("onWeixinJSBridgeReady",B):B()}},B=function(){var e=j.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},(function(e){"get_brand_wcpay_request:cancel"==e.err_msg||e.err_msg,window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+j.orderNo)}))},J=function(){var e=f();e?(j.code=e,I()):g(j.wxAppId)};return l((function(){!function(){var n,t=r.query;console.log(t);var a=-1!==(null===(n=j.paymentType)||void 0===n?void 0:n.indexOf("yeepay"));if(t.orderNo&&t.pay_channel)if(_().weixin)j.browserStatus=!0,J();else if(_().alipay)if(a){var o=f("auth_code")||r.query.auth_code;o?(j.code=o,j.browserStatus=!0,I()):b(j.alipayAppId)}else j.browserStatus=!0,I();else j.errorText="请在微信或支付宝客户端打开",document.title="ERROR";else y({message:"支付订单信息错误请重新支付",showCancelButton:!1}).then((function(){e.back()}))}()})),function(){return c("div",{class:x},[j.browserStatus&&c(d,null,[c("div",{class:O},[c(v,{border:!1},{default:function(){return[c(w,{title:"订单金额",value:"¥ "+u(j.price)},null),c(w,{title:"订单信息",value:j.body},null)]}})]),c("div",{class:S},[c("p",null,["wx_pub"==j.pay_channel?"微信支付":"支付宝支付"]),c(p,{type:"spinner",color:"#01C1B5"},null)])]),!j.browserStatus&&c("div",{class:P},[j.errorText&&c(s,{class:q,name:"warning-o"},null),j.errorText])])}}}))}}}))}();