1 |
- !function(){var e=document.createElement("style");e.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(e),System.register(["./index-legacy.eb062188.js","./index-legacy.148f784c.js","./index-legacy.918b8c74.js"],(function(e){"use strict";var n,r,a,t,o,i,d,l,p,c,s,y,u,_,f,m,g;return{setters:[function(e){n=e.d,r=e.ah,a=e.r,t=e.$,o=e.c,i=e.q,d=e.ba,l=e.B,p=e.a5,c=e.o,s=e.m,y=e.f,u=e.bh,_=e.bk,f=e.bU},function(e){m=e.C},function(e){g=e.C}],execute:function(){var h={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(){const e=r(),n=a({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=async()=>{try{var e;if(parseFloat(n.price)<=0)return void c("支付金额异常");const r={merOrderNo:n.orderNo,paymentChannel:n.pay_channel,userId:n.userId,code:n.code};console.log(r,"payMap");const{data:a}=await s.post("/api-student/open/userOrder/executePayment",{hideLoading:!1,data:{...r}});n.isYeePay=-1!==(null===(e=a.paymentVender)||void 0===e?void 0:e.indexOf("yeepay")),console.log(a,"payment"),v(a.reqParams)}catch(r){console.log(r)}},v=e=>{if("alipay_qr"==n.pay_channel)if(n.isYeePay)x(e.prePayTn);else{const 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"==n.pay_channel){const r=n.isYeePay?JSON.parse(e.prePayTn):JSON.parse(e.expend.pay_info);n.payInfo=r,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",b,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",b)(document).attachEvent("onWeixinJSBridgeReady",b):b()}},x=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)},b=()=>{const 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},(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 t((()=>{console.log(n),(()=>{var r;const a=-1!==(null===(r=n.paymentType)||void 0===r?void 0:r.indexOf("yeepay"));console.log(a,"isYeePay");const t=n.pay_channel;if(y().weixin)if("wx_pub"===t){const e=u();e?n.code=e:_(n.wxAppId),n.browserStatus=!0,document.title="微信支付"}else"alipay_qr"==t&&(n.errorText="请使用支付宝扫码");else if(y().alipay){if("wx_pub"===t)n.errorText="请使用微信扫码";else if("alipay_qr"==t){if(a){const r=u("auth_code")||e.query.auth_code;r?n.code=r:f(n.alipayAppId)}n.browserStatus=!0,document.title="支付宝支付"}}else n.errorText="请在微信或支付宝客户端打开";n.errorText&&(document.title="ERROR")})()})),()=>o("div",{class:h.paydefine},[n.browserStatus&&o("div",{class:h.container},[o("div",{class:h.amount},[o("span",null,[i("¥ ")]),d(n.price)]),o(m,{inset:!0},{default:()=>[o(g,{title:"订单信息",value:n.body,valueClass:h.values},null),o(g,{title:"支付方式",value:"wx_pub"===n.pay_channel?"微信":"支付宝"},null),o(g,{title:"实付金额",value:`¥ ${d(n.price)}元`},null)]}),o(l,{type:"primary",block:!0,size:"large",onClick:w,round:!0},{default:()=>[i("立即支付")]})]),!n.browserStatus&&o("div",{class:h.container},[o("div",{class:h["error-text"]},[n.errorText&&o(p,{class:h["error-icon"],name:"warning-o"},null),n.errorText])])])}}))}}}))}();
|