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(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.610f0a70.js","./index-legacy.fd89cccf.js"],(function(e){"use strict";var n,a,o,i,c,p,d,l,u,y,s,f,_,g,m,v,h,b;return{setters:[function(e){n=e.d,a=e.P,o=e.S,i=e.V,c=e.j,p=e.A,d=e.bC,l=e.B,u=e.N,y=e.T,s=e.y,f=e.g,_=e.f,g=e.bS,m=e.bT,v=e.bU},function(e){h=e.C},function(e){b=e.C}],execute:function(){var w={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}),x=function(){var e,a=(e=regeneratorRuntime.mark((function e(){var 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 y("支付金额异常"),e.abrupt("return");case 4:return t={merOrderNo:n.orderNo,paymentChannel:n.pay_channel,userId:n.userId,code:n.code},e.next=7,s.post("/api-student/open/userOrder/executePayment/v2",{hideLoading:!1,data:r({},t)});case 7:a=e.sent,o=a.data,console.log(o,"paymentVender"),S(o.reqParams),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),console.log(e.t0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})),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)}}(),S=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){console.log(n.isYeePay,null==e?void 0:e.expend,"payInfo");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",P,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",P)(document).attachEvent("onWeixinJSBridgeReady",P):P()}},O=function(e){var r;r=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+ +f.payBackPath+"#/tradeDetail?orderNo="+n.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?r&&r():document.addEventListener("AlipayJSBridgeReady",r,!1)},P=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+f.payBackPath+"#/tradeDetail?orderNo="+n.orderNo)}))};return i((function(){console.log(n),function(){var e,r=n.pay_channel,t=!!n.paymentType&&-1!==(null===(e=n.paymentType)||void 0===e?void 0:e.indexOf("yeepay"));if(n.isYeePay=t,_().weixin)if("wx_pub"===r){var a=g();a?n.code=a:m(n.wxAppId),n.browserStatus=!0,document.title="微信支付"}else"alipay_qr"==r&&(n.errorText="请使用支付宝扫码");else if(_().alipay){if("wx_pub"===r)n.errorText="请使用微信扫码";else if("alipay_qr"==r){if(t){var o=g("auth_code");o?n.code=o:v(n.alipayAppId)}n.browserStatus=!0,document.title="支付宝支付"}}else n.errorText="请在微信或支付宝客户端打开";n.errorText&&(document.title="ERROR")}()})),function(){return c("div",{class:w.paydefine},[n.browserStatus&&c("div",{class:w.container},[c("div",{class:w.amount},[c("span",null,[p("¥ ")]),d(n.price)]),c(b,{inset:!0},{default:function(){return[c(h,{title:"订单信息",value:n.body,valueClass:w.values},null),c(h,{title:"支付方式",value:"wx_pub"===n.pay_channel?"微信":"支付宝"},null),c(h,{title:"实付金额",value:"¥ ".concat(d(n.price),"元")},null)]}}),c(l,{type:"primary",block:!0,size:"large",onClick:x,round:!0},{default:function(){return[p("立即支付")]}})]),!n.browserStatus&&c("div",{class:w.container},[c("div",{class:w["error-text"]},[n.errorText&&c(u,{class:w["error-icon"],name:"warning-o"},null),n.errorText])])])}}}))}}}))}();
|