!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(N){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new L(n||[]);return i(a,"_invoke",{value:O(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}r.wrap=f;var h={};function d(){}function y(){}function v(){}var g={};s(g,c,(function(){return this}));var m=Object.getPrototypeOf,_=m&&m(m(P([])));_&&_!==n&&o.call(_,c)&&(g=_);var b=v.prototype=d.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(e,r){function n(i,a,c,u){var l=p(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=S(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;ep{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(r);var O="_paywxresult_1bih4_1",S="_container_1bih4_23",j="_order-loading_1bih4_27",E="_error-text_1bih4_37",L="_error-icon_1bih4_44";t("default",o({name:"pay-result",setup:function(){var t=a(),r=c(),o=u({errorText:"",browserStatus:!1,code:null,pay_channel:r.query.pay_channel,wxAppId:r.query.wxAppId,body:r.query.body,price:r.query.price,orderNo:r.query.orderNo,userId:r.query.userId,payInfo:{}});console.log(o.errorText);var P=function(){var t,r=(t=e().mark((function t(){var r,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(parseFloat(o.price)<=0)){t.next=4;break}return g("支付金额异常"),t.abrupt("return");case 4:return r={merOrderNo:o.orderNo,paymentChannel:o.pay_channel,userId:o.userId},"wx_pub"==o.pay_channel&&(r.code=o.code),t.next=8,m.post("/edu-app/open/userOrder/executePayment",{data:n({},r)});case 8:i=t.sent,a=i.data,k(a.reqParams),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(0),console.log(t.t0),window.location.replace(location.origin+"/classroom-app/#/payment-result?orderNo="+o.orderNo);case 17:case"end":return t.stop()}}),t,null,[[0,13]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(){return r.apply(this,arguments)}}(),k=function(t){if("alipay_qr"==o.pay_channel){var e,r,n="false"===t.prod_mode?(null==t||null===(e=t.expend)||void 0===e?void 0:e.qrcode_url)+"?payment_id="+t.id+"&pay_channel="+t.pay_channel:null==t||null===(r=t.expend)||void 0===r?void 0:r.qrcode_url;window.location.href=n}else if("alipay_wap"==o.pay_channel){var i;window.location.href=null==t||null===(i=t.expend)||void 0===i?void 0:i.pay_info}else if("wx_pub"==o.pay_channel){var a,c=null!=t&&t.expend?JSON.parse(null==t||null===(a=t.expend)||void 0===a?void 0:a.pay_info):t;o.payInfo=c,void 0===window.WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",N,!1):document.attachEvent&&document.attachEvent("WeixinJSBridgeReady",N)(document).attachEvent("onWeixinJSBridgeReady",N):N()}},N=function(){var t=o.payInfo;window.WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:t.appId,timeStamp:t.timeStamp,nonceStr:t.nonceStr,package:t.package||t.packageValue,signType:t.signType,paySign:t.paySign},(function(t){"get_brand_wcpay_request:cancel"==t.err_msg||t.err_msg,window.location.replace(location.origin+"/orchestra-student/#/payment-result?orderNo="+o.orderNo)}))},I=function(){var t=_();t?(o.code=t,P()):b(o.wxAppId)};return l((function(){var e;e=r.query,console.log(e),e.orderNo&&e.pay_channel?v().weixin?(o.browserStatus=!0,I()):v().alipay?(o.browserStatus=!0,P()):(o.errorText="请在微信或支付宝客户端打开",document.title="ERROR"):y({message:"支付订单信息错误请重新支付",showCancelButton:!1}).then((function(){t.back()}))})),function(){return s("div",{class:O},[o.browserStatus&&s(f,null,[s("div",{class:S},[s(w,{border:!1},{default:function(){return[s(x,{title:"订单金额",value:"¥ "+p(o.price)},null),s(x,{title:"订单信息",value:o.body},null)]}})]),s("div",{class:j},[s("p",null,["wx_pub"==o.pay_channel?"微信支付":"支付宝支付"]),s(h,{type:"spinner",color:"#01C1B5"},null)])]),!o.browserStatus&&s("div",{class:E},[o.errorText&&s(d,{class:L,name:"warning-o"},null),o.errorText])])}}}))}}}))}();