index-legacy.ca960aa4.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.b903c881.js","./index-legacy.b7f666cc.js","./index-legacy.5907f1a9.js"],(function(e){"use strict";var r,a,o,i,l,c,d,u,p,s,y,_,f,b,v,g,h,m,w,x;return{setters:[function(e){r=e.d,a=e.P,o=e.O,i=e.Q,l=e.U,c=e.j,d=e.F,u=e.bz,p=e.aS,s=e.M,y=e.D,_=e.f,f=e.bL,b=e.bN,v=e.T,g=e.w,h=e.g,m=e.bM},function(e){w=e.C},function(e){x=e.C}],execute:function(){var O="_paywxresult_1bih4_1",S="_container_1bih4_23",P="_order-loading_1bih4_27",j="_error-text_1bih4_37",I="_error-icon_1bih4_44";e("default",r({name:"pay-result",setup:function(){var e=a(),r=o(),N=i({errorText:"",browserStatus:!1,code:null,pay_channel:r.query.pay_channel,wxAppId:r.query.wxAppId,paymentType:r.query.paymentType,alipayAppId:r.query.alipayAppId,body:r.query.body,price:r.query.price,orderNo:r.query.orderNo,userId:r.query.userId,payInfo:{},isYeePay:!1}),k=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(N.price)<=0)){e.next=4;break}return v("支付金额异常"),e.abrupt("return");case 4:return t={merOrderNo:N.orderNo,paymentChannel:N.pay_channel,userId:N.userId,code:N.code},e.next=7,g.post("/api-student/open/userOrder/executePayment/v2",{data:n({},t)});case 7:a=e.sent,o=a.data,N.isYeePay=-1!==(null===(r=o.paymentVender)||void 0===r?void 0:r.indexOf("yeepay")),console.log(o,"data"),B(o.reqParams),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),console.log(e.t0),window.location.replace(location.origin+h.payBackPath+"#/tradeDetail?orderNo="+N.orderNo);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})),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)}}(),q=function(e){var n;n=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+h.payBackPath+"#/tradeDetail?orderNo="+N.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)},B=function(e){if("alipay_qr"==N.pay_channel)if(N.isYeePay)q(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"==N.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"==N.pay_channel){var o;console.log(N.isYeePay,null==e?void 0:e.expend,"payInfo");var i=N.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;N.payInfo=i,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",T,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",T)(document).attachEvent("onWeixinJSBridgeReady",T):T()}},T=function(){var e=N.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+h.payBackPath+"#/tradeDetail?orderNo="+N.orderNo)}))},J=function(){var e=f();e?(N.code=e,k()):m(N.wxAppId)};return l((function(){!function(){var n,t=r.query,a=-1!==(null===(n=N.paymentType)||void 0===n?void 0:n.indexOf("yeepay"));if(t.orderNo&&t.pay_channel)if(_().weixin)N.browserStatus=!0,J();else if(_().alipay)if(a){var o=f("auth_code");o?(N.code=o,N.browserStatus=!0,k()):b(N.alipayAppId)}else N.browserStatus=!0,k();else N.errorText="请在微信或支付宝客户端打开",document.title="ERROR";else y.confirm({message:"支付订单信息错误请重新支付",showCancelButton:!1}).then((function(){e.back()}))}()})),function(){return c("div",{class:O},[N.browserStatus&&c(d,null,[c("div",{class:S},[c(x,{border:!1},{default:function(){return[c(w,{title:"订单金额",value:"¥ "+u(N.price)},null),c(w,{title:"订单信息",value:N.body},null)]}})]),c("div",{class:P},[c("p",null,["wx_pub"==N.pay_channel?"微信支付":"支付宝支付"]),c(p,{type:"spinner",color:"#01C1B5"},null)])]),!N.browserStatus&&c("div",{class:j},[N.errorText&&c(s,{class:I,name:"warning-o"},null),N.errorText])])}}}))}}}))}();