index-legacy.2eabc381.js 5.9 KB

1
  1. !function(){function e(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function r(r){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?e(Object(a),!0).forEach((function(e){n(r,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}))}return r}function n(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function t(e,r,n,t,a,o,i){try{var c=e[o](i),p=c.value}catch(d){return void n(d)}c.done?r(p):Promise.resolve(p).then(t,a)}var a=document.createElement("style");a.innerHTML="._paydefine_gyhp9_1{overflow:hidden;background:#fff;min-height:100vh}._paydefine_gyhp9_1 .van-cell__title,._paydefine_gyhp9_1 .van-cell__value{font-size:.4rem;color:#4f4f4f}._paydefine_gyhp9_1 .van-button{font-size:.42667rem;width:86%;margin:.53333rem auto}._amount_gyhp9_16{padding:.93333rem 0 1.46667rem;font-size:1.09333rem;font-weight:700;color:#333;line-height:.96rem;text-align:center}._amount_gyhp9_16 span{font-size:.82667rem}._error-text_gyhp9_27{font-size:.4rem;width:100%;text-align:center;color:#3f3f3f;margin-top:2.66667rem}._error-icon_gyhp9_34{display:block;color:#ffb07b;font-size:.42667rem;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 n,a,o,i,c,p,d,u,l,s,y,f,_,m,g,v,h;return{setters:[function(e){n=e.d,a=e.ah,o=e.r,i=e.$,c=e.c,p=e.q,d=e.b6,u=e.B,l=e.a5,s=e.o,y=e.m,f=e.f,_=e.bd,m=e.bg,g=e.dp},function(e){v=e.C},function(e){h=e.C}],execute:function(){var b={paydefine:"_paydefine_gyhp9_1",amount:"_amount_gyhp9_16","error-text":"_error-text_gyhp9_27","error-icon":"_error-icon_gyhp9_34"};e("default",n({name:"pay-define",setup:function(){var e=a(),n=o({browserStatus:!1,errorText:"",code:null,pay_channel:e.query.pay_channel,wxAppId:e.query.wxAppId,paymentType:e.query.paymentType,alipayAppId:e.query.alipayAppId,body:e.query.body,price:e.query.price,orderNo:e.query.orderNo,userId:e.query.userId,payInfo:{},isYeePay:!1}),w=function(){var e,a=(e=regeneratorRuntime.mark((function e(){var t,a,o,i;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 s("支付金额异常"),e.abrupt("return");case 4:return a={merOrderNo:n.orderNo,paymentChannel:n.pay_channel,userId:n.userId,code:n.code},console.log(a,"payMap"),e.next=8,y.post("/api-student/open/userOrder/executePayment",{hideLoading:!1,data:r({},a)});case 8:o=e.sent,i=o.data,n.isYeePay=-1!==(null===(t=i.paymentVender)||void 0===t?void 0:t.indexOf("yeepay")),console.log(i,"payment"),x(i.reqParams),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])})),function(){var r=this,n=arguments;return new Promise((function(a,o){var i=e.apply(r,n);function c(e){t(i,a,o,c,p,"next",e)}function p(e){t(i,a,o,c,p,"throw",e)}c(void 0)}))});return function(){return a.apply(this,arguments)}}(),x=function(e){if("alipay_qr"==n.pay_channel)if(n.isYeePay)O(e.prePayTn);else{var r="false"===e.prod_mode?e.expend.qrcode_url+"?payment_id="+e.id+"&pay_channel="+e.pay_channel:e.expend.qrcode_url;window.location.href=r}else if("wx_pub"==n.pay_channel){var t=n.isYeePay?JSON.parse(e.prePayTn):JSON.parse(e.expend.pay_info);n.payInfo=t,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",S,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",S)(document).attachEvent("onWeixinJSBridgeReady",S):S()}},O=function(e){var r;r=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+n.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?r&&r():document.addEventListener("AlipayJSBridgeReady",r,!1)},S=function(){var e=n.payInfo;window.WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:e.appId,timeStamp:e.timeStamp,nonceStr:e.nonceStr,package:e.package,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="+n.orderNo)}))};return i((function(){console.log(n),function(){var r,t=-1!==(null===(r=n.paymentType)||void 0===r?void 0:r.indexOf("yeepay"));console.log(t,"isYeePay");var a=n.pay_channel;if(f().weixin)if("wx_pub"===a){var o=_();o?n.code=o:m(n.wxAppId),n.browserStatus=!0,document.title="微信支付"}else"alipay_qr"==a&&(n.errorText="请使用支付宝扫码");else if(f().alipay){if("wx_pub"===a)n.errorText="请使用微信扫码";else if("alipay_qr"==a){if(t){var i=_("auth_code")||e.query.auth_code;i?n.code=i:g(n.alipayAppId)}n.browserStatus=!0,document.title="支付宝支付"}}else n.errorText="请在微信或支付宝客户端打开";n.errorText&&(document.title="ERROR")}()})),function(){return c("div",{class:b.paydefine},[n.browserStatus&&c("div",{class:b.container},[c("div",{class:b.amount},[c("span",null,[p("¥ ")]),d(n.price)]),c(v,{inset:!0},{default:function(){return[c(h,{title:"订单信息",value:n.body,valueClass:b.values},null),c(h,{title:"支付方式",value:"wx_pub"===n.pay_channel?"微信":"支付宝"},null),c(h,{title:"实付金额",value:"¥ ".concat(d(n.price),"元")},null)]}}),c(u,{type:"primary",block:!0,size:"large",onClick:w,round:!0},{default:function(){return[p("立即支付")]}})]),!n.browserStatus&&c("div",{class:b.container},[c("div",{class:b["error-text"]},[n.errorText&&c(l,{class:b["error-icon"],name:"warning-o"},null),n.errorText])])])}}}))}}}))}();