index-legacy.b6e42cbc.js 5.8 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 c=e[o](i),p=c.value}catch(d){return void r(d)}c.done?n(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.b903c881.js","./index-legacy.b7f666cc.js","./index-legacy.5907f1a9.js"],(function(e){"use strict";var r,a,o,i,c,p,d,l,u,y,s,f,_,g,m,v,h,b;return{setters:[function(e){r=e.d,a=e.O,o=e.Q,i=e.U,c=e.j,p=e.z,d=e.bz,l=e.B,u=e.M,y=e.T,s=e.w,f=e.g,_=e.f,g=e.bL,m=e.bM,v=e.bN},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",r({name:"pay-define",setup:function(){var e=a(),r=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(r.price)<=0)){e.next=4;break}return y("支付金额异常"),e.abrupt("return");case 4:return t={merOrderNo:r.orderNo,paymentChannel:r.pay_channel,userId:r.userId,code:r.code},e.next=7,s.post("/api-student/open/userOrder/executePayment/v2",{hideLoading:!1,data:n({},t)});case 7:a=e.sent,o=a.data,console.log(o,"paymentVender"),O(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 n=this,r=arguments;return new Promise((function(a,o){var i=e.apply(n,r);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)}}(),O=function(e){if("alipay_qr"==r.pay_channel)if(r.isYeePay)S(e.prePayTn);else{var n="false"===e.prod_mode?e.expend.qrcode_url+"?payment_id="+e.id+"&pay_channel="+e.pay_channel:e.expend.qrcode_url;window.location.href=n}else if("wx_pub"==r.pay_channel){console.log(r.isYeePay,null==e?void 0:e.expend,"payInfo");var t=r.isYeePay?JSON.parse(e.prePayTn):JSON.parse(e.expend.pay_info);r.payInfo=t,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",P,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",P)(document).attachEvent("onWeixinJSBridgeReady",P):P()}},S=function(e){var n;n=function(){window.AlipayJSBridge.call("tradePay",{tradeNO:e},(function(e){e.resultCode,window.location.replace(location.origin+ +f.payBackPath+"#/tradeDetail?orderNo="+r.orderNo),window.AlipayJSBridge.call("closeWebview")}))},window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)},P=function(){var e=r.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="+r.orderNo)}))};return i((function(){console.log(r),function(){var e,n=r.pay_channel,t=!!r.paymentType&&-1!==(null===(e=r.paymentType)||void 0===e?void 0:e.indexOf("yeepay"));if(r.isYeePay=t,_().weixin)if("wx_pub"===n){var a=g();a?r.code=a:m(r.wxAppId),r.browserStatus=!0,document.title="微信支付"}else"alipay_qr"==n&&(r.errorText="请使用支付宝扫码");else if(_().alipay){if("wx_pub"===n)r.errorText="请使用微信扫码";else if("alipay_qr"==n){if(t){var o=g("auth_code");o?r.code=o:v(r.alipayAppId)}r.browserStatus=!0,document.title="支付宝支付"}}else r.errorText="请在微信或支付宝客户端打开";r.errorText&&(document.title="ERROR")}()})),function(){return c("div",{class:w.paydefine},[r.browserStatus&&c("div",{class:w.container},[c("div",{class:w.amount},[c("span",null,[p("¥ ")]),d(r.price)]),c(b,{inset:!0},{default:function(){return[c(h,{title:"订单信息",value:r.body,valueClass:w.values},null),c(h,{title:"支付方式",value:"wx_pub"===r.pay_channel?"微信":"支付宝"},null),c(h,{title:"实付金额",value:"¥ ".concat(d(r.price),"元")},null)]}}),c(l,{type:"primary",block:!0,size:"large",onClick:x,round:!0},{default:function(){return[p("立即支付")]}})]),!r.browserStatus&&c("div",{class:w.container},[c("div",{class:w["error-text"]},[r.errorText&&c(u,{class:w["error-icon"],name:"warning-o"},null),r.errorText])])])}}}))}}}))}();