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