(window.webpackJsonp=window.webpackJsonp||[]).push([[5,75],{1069:function(e,t,r){"use strict";r.d(t,"g",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"e",(function(){return c})),r.d(t,"j",(function(){return d})),r.d(t,"a",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return y})),r.d(t,"k",(function(){return m})),r.d(t,"b",(function(){return _})),r.d(t,"h",(function(){return x}));var n=10,o=20,c=30,d=90,f=91,h="https://activity.xueersi.com/k8s/texun-payment/h5/sku-address",l="https://activity.vipx.com/k8s/texun-payment/h5/sku-address",y="https://activity.xiwang.com/k8s/texun-payment/h5/sku-address",m="https://activity.xeskid.com/k8s/texun-payment/h5/sku-address",_="https://activity.classa-z.com/k8s/texun-payment/h5/sku-address",x="https://activity.xueersi.com/k8s/texun-payment/h5/add-wx-fail"},1122:function(e,t,r){"use strict";r.r(t),r.d(t,"version",(function(){return n})),r.d(t,"VERSION",(function(){return o})),r.d(t,"atob",(function(){return N})),r.d(t,"atobPolyfill",(function(){return F})),r.d(t,"btoa",(function(){return O})),r.d(t,"btoaPolyfill",(function(){return k})),r.d(t,"fromBase64",(function(){return z})),r.d(t,"toBase64",(function(){return j})),r.d(t,"utob",(function(){return S})),r.d(t,"encode",(function(){return j})),r.d(t,"encodeURI",(function(){return E})),r.d(t,"encodeURL",(function(){return E})),r.d(t,"btou",(function(){return B})),r.d(t,"decode",(function(){return z})),r.d(t,"isValid",(function(){return Z})),r.d(t,"fromUint8Array",(function(){return P})),r.d(t,"toUint8Array",(function(){return R})),r.d(t,"extendString",(function(){return J})),r.d(t,"extendUint8Array",(function(){return L})),r.d(t,"extendBuiltins",(function(){return Q})),r.d(t,"Base64",(function(){return W}));const n="3.7.7",o=n,c="function"==typeof Buffer,d="function"==typeof TextDecoder?new TextDecoder:void 0,f="function"==typeof TextEncoder?new TextEncoder:void 0,h=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),l=(a=>{let e={};return a.forEach(((t,i)=>e[t]=i)),e})(h),y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,m=String.fromCharCode.bind(String),_="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),x=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),v=s=>s.replace(/[^A-Za-z0-9\+\/]/g,""),k=e=>{let t,r,n,o,c="";const d=e.length%3;for(let i=0;i255||(n=e.charCodeAt(i++))>255||(o=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,c+=h[t>>18&63]+h[t>>12&63]+h[t>>6&63]+h[63&t]}return d?c.slice(0,d-3)+"===".substring(d):c},O="function"==typeof btoa?e=>btoa(e):c?e=>Buffer.from(e,"binary").toString("base64"):k,w=c?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,r=e.length;it?x(w(e)):w(e),I=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?m(192|t>>>6)+m(128|63&t):m(224|t>>>12&15)+m(128|t>>>6&63)+m(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return m(240|t>>>18&7)+m(128|t>>>12&63)+m(128|t>>>6&63)+m(128|63&t)},C=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,S=u=>u.replace(C,I),A=c?s=>Buffer.from(s,"utf8").toString("base64"):f?s=>w(f.encode(s)):s=>O(S(s)),j=(e,t=!1)=>t?x(A(e)):A(e),E=e=>j(e,!0),U=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return m(55296+(t>>>10))+m(56320+(1023&t));case 3:return m((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return m((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},B=b=>b.replace(U,T),F=e=>{if(e=e.replace(/\s+/g,""),!y.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,o="";for(let i=0;i>16&255):64===n?m(t>>16&255,t>>8&255):m(t>>16&255,t>>8&255,255&t);return o},N="function"==typeof atob?e=>atob(v(e)):c?e=>Buffer.from(e,"base64").toString("binary"):F,D=c?a=>_(Buffer.from(a,"base64")):a=>_(N(a).split("").map((e=>e.charCodeAt(0)))),R=a=>D(K(a)),$=c?a=>Buffer.from(a,"base64").toString("utf8"):d?a=>d.decode(D(a)):a=>B(N(a)),K=a=>v(a.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),z=e=>$(K(e)),Z=e=>{if("string"!=typeof e)return!1;const s=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(s)||!/[^\s0-9a-zA-Z\-_]/.test(s)},G=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),J=function(){const e=(e,body)=>Object.defineProperty(String.prototype,e,G(body));e("fromBase64",(function(){return z(this)})),e("toBase64",(function(e){return j(this,e)})),e("toBase64URI",(function(){return j(this,!0)})),e("toBase64URL",(function(){return j(this,!0)})),e("toUint8Array",(function(){return R(this)}))},L=function(){const e=(e,body)=>Object.defineProperty(Uint8Array.prototype,e,G(body));e("toBase64",(function(e){return P(this,e)})),e("toBase64URI",(function(){return P(this,!0)})),e("toBase64URL",(function(){return P(this,!0)}))},Q=()=>{J(),L()},W={version:n,VERSION:o,atob:N,atobPolyfill:F,btoa:O,btoaPolyfill:k,fromBase64:z,toBase64:j,encode:j,encodeURI:E,encodeURL:E,utob:S,btou:B,decode:z,isValid:Z,fromUint8Array:P,toUint8Array:R,extendString:J,extendUint8Array:L,extendBuiltins:Q}},1256:function(e,t,r){"use strict";var n=r(40),o=r(239),c=r(6),d=r(192),f=r(193),h=(r(43),r(68),r(109),r(66),r(313),r(127),r(492),r(107),r(108),r(67),r(19),r(60),r(238),r(0)),l=r(78),y=r(1069),m=r(12);function _(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 x(e){for(var t=1;t0)throw new Error("选择课程非0元课");var t=this.clacGetOrderParam();return this.$axios.post(m.h,t,{notQs:!0,param:t}).then((function(t){if(0===t.code||1===t.stat){var r=t.data.order_num;return e.hooks.orderSuccess(t.data),void setTimeout((function(){e.linkToCompletePage(r)}),200)}70112===t.code&&e.hooks.payNoQualification(),e.hooks.orderFail(t)})).catch((function(){e.hooks.orderFail({code:"err"})}))}},{key:"payInApp",value:function(){var e=this,t=this.courseInfos.map((function(e){return e.course_id})).join(","),r=this.courseInfosToProductInfos();return this.$axios.get(m.I,{params:{course_ids:t}}).then((function(t){if(0===t.code){e.hooks.getRecommendClassSuccess();var n=(t.data||[]).map((function(e){return"".concat(e.course_id,"-").concat(e.class_id)})).join(","),o=e.getExtraData({pageSource:"4",courses:r});e.afterExtendOrderNum&&(o.main_order_num=e.afterExtendOrderNum);var c=JSON.stringify({p:{courseIds:n,productType:100,extradata:JSON.stringify([{bxtra_type:1,bxtra_info:o}])}});e.hooks.getOrderPayUrlSuccess(),setTimeout((function(){O.$toast.clear(),window.location.href="xeswangxiao://xrsApp?m=xesmallOrderConfirm&en=0&d=".concat(c)}),200)}else e.hooks.getRecommendClassFail()}))}},{key:"payInH5",value:(r=Object(c.a)(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.generateOrderNumWithPrice();case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return r={orderNum:t,payCode:this.payCode},e.prev=6,e.next=9,this.$axios.post(m.E,r,{payParam:r});case 9:n=e.sent,this.hooks.getOrderPayUrlSuccess(n),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),this.hooks.getOrderPayUrlFail();case 16:if(1===n.stat){e.next=19;break}return this.getOrderPayUrlFail(),e.abrupt("return");case 19:801e3===this.payCode?this.wechatPay(JSON.parse(n.data)):this.commonPay({url:n.data,orderNum:t});case 20:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"payInH5Order",value:(t=Object(c.a)(regeneratorRuntime.mark((function e(){var t,r,n,o,c,code,d,data,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]?h[0]:"class",console.log(222,this.businesslineId),O.$toast.loading({message:"加载中...",duration:0}),r={},n="",o="","class"!==t){e.next=20;break}r=this.clacGetOrderParam(),n=m.n,e.t0=Number(this.businesslineId),e.next=90===e.t0?12:91===e.t0?14:16;break;case 12:return o="http://app.xeskid.com/trade/touchPay/?app_blid=90#/payPage?idEncode=",e.abrupt("break",18);case 14:return o="https://app.classa-z.com/trade/touchPay/?app_blid=84#/payPage?idEncode=",e.abrupt("break",18);case 16:return o="https://trade.xueersi.com/Order/Confirm?idEncode=",e.abrupt("break",18);case 18:e.next=23;break;case 20:n=m.s,o="https://trade.xueersi.com/goodspay/#/order-confirm?id_encode=",r=this.clacGetObjectOrderParam();case 23:return e.prev=23,e.next=26,this.$axios.post(n,r,{notQs:!0});case 26:c=e.sent,code=c.code,d=c.data,data=void 0===d?{}:d,f=c.msg,O.$toast.clear(),0===code?(this.hooks.getOrderPayUrlSuccess(),setTimeout((function(){window.location.href="".concat(o).concat(data.id_encode,"&loginUrl=").concat(window.encodeURIComponent(window.location.href))}),200)):(this.hooks.getOrderPayUrlFail({code:code,data:data,msg:f}),O.$toast(f)),e.next=39;break;case 35:e.prev=35,e.t1=e.catch(23),O.$toast.clear(),O.$toast("网络错误");case 39:case"end":return e.stop()}}),e,this,[[23,35]])}))),function(){return t.apply(this,arguments)})},{key:"generateOrderNumWithPrice",value:(e=Object(c.a)(regeneratorRuntime.mark((function e(){var param,t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return param=this.clacGetOrderParam(),e.prev=1,e.next=4,this.$axios.post(m.D,param,{notQs:!0,param:param});case 4:t=e.sent,e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",!1);case 10:if(0===t.code){e.next=16;break}return 70112===t.code&&this.hooks.payNoQualification(),this.hooks.generateOrderFail(),e.abrupt("return",!1);case 16:return n=null===(r=t)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.order_num,this.hooks.generateOrderSuccess(n),e.abrupt("return",n);case 19:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(){return e.apply(this,arguments)})},{key:"courseInfosToProductInfos",value:function(){return this.courseInfos.map((function(e){return{course_id:Number(e.course_id),pkg_grade_id:e.package_grade_id,pkg_course_id:e.package_course_id,group_id:""===e.group_id?0:Number(e.group_id),need_class:1}}))}},{key:"productInfosToProductInfos",value:function(){var e=this,t=Object(l.i)(),r=[];if("matrComb"===this.pageType){r=(this.productInfo[0].group_id?[{id:this.productInfo[0].sw_item.product_id,type:"sw"}].concat(Object(o.a)(this.productInfo[0].course_ids.map((function(e){return{id:e,type:"course"}})))):[].concat(Object(o.a)(this.productInfo[0].mix_sw_info.map((function(e){return{id:e.product_id,type:"sw",mix_product_id:e.mix_product_id}}))),Object(o.a)(this.productInfo[0].mix_course_info.map((function(e){return{id:e.product_id,type:"course",mix_product_id:e.mix_product_id}}))))).map((function(r,n){return{id:r.id,quantity:1,parent_product_id:r.product_id,source_id:t,type:"sw"===r.type?105:100,group_id:e.productInfo[0].group_id?e.productInfo[0].group_id+"":void 0,mix_product_id:r.mix_product_id}}))}else r=this.productInfo.map((function(e){return{id:e.product_id,quantity:1,price:e.price+"",parent_product_id:e.parent_product_id,source_id:t}}));return r}},{key:"getSaleType",value:function(){var e={1:"EXTEND",2:"BOUNDLE",3:"MAIN"},t={EXTEND:3,BOUNDLE:2,MAIN:1};return this.courseInfos.map((function(r){var n=e[r.course_level];return t[n]})).join(",")}},{key:"clacGetOrderParam",value:function(){var e=Object(l.i)(),t=Object(l.b)("xesId"),r=this.getExtraData(),n=[];for(var o in r)n.push({key:o,val:r[o]});return x({order_device:3,source:this.source,order_type:this.orderType,source_id:e,xes_id:t,product_infos:this.courseInfosToProductInfos(),shadow_process:1,page_key:this.pageKey,purchase_type:"page_order_confirm",relation_activity_id:Object(l.h)(),extras:[{type:1,extra:n}]},this.extendOrderParam)}},{key:"clacGetObjectOrderParam",value:function(){var e=this.getObjectExtraData();return x({"X-Businessline-Id":this.businesslineId,source:this.source,order_device:3,order_type:this.orderType,products:this.productInfosToProductInfos(),add_id:this.addId,relation_activity_id:Object(l.h)(),extras:{b_extras:JSON.stringify({1:e})}},this.extendOrderParam)}},{key:"getExtraData",value:function(e){e=Object(l.s)(e)?e:{};var t=Object(l.i)(),r=Object(l.b)("xesId"),n=Object(l.e)(),o=Object(l.l)(),c=Object(l.c)();return x(x({course_type:this.courseType,order_source:this.orderSource,channel:this.channel,xes_id:r,pageSource:"1",platform_id:n,ztuid:o,source_id:t,grade_key:this.gradeKey,page_key:this.pageKey,pay_success_uri:w.encode(this.paySuccessUrl,!0),sale_type:this.getSaleType(),envid:c,type_1_id:this.type1Id,x_businessline_id:this.businesslineId},this.extendExtraOrderParam),e)}},{key:"getObjectExtraData",value:function(e){e=Object(l.s)(e)?e:{};var t=[];return t="matrComb"===this.pageType?this.productInfo.map((function(e){var t,r,n;return{group_id:e.group_id,mix_id:e.item_id,course_ids:e.course_ids,item_id:null===(t=e.sw_item)||void 0===t?void 0:t.item_id,sku_id:null===(r=e.sw_item)||void 0===r?void 0:r.sku_id,product_id:null===(n=e.sw_item)||void 0===n?void 0:n.product_id}})):this.productInfo.map((function(e){return{pkg_id:e.pkg_id,sku_id:e.sku_id,product_id:e.product_id}})),x(x({channel_id:this.channel,page_key:this.pageKey,pay_success_uri:w.encode(this.paySuccessUrl,!0),products:t},this.extendExtraOrderParam),e)}},{key:"getSelectedCourseTotalPrice",value:function(){return this.courseInfos.reduce((function(e,t){return e+(null==t?void 0:t.price)}),0)}},{key:"linkToCompletePage",value:function(e){window.location.href="".concat(this.paySuccessUrl,"?orderNum=").concat(e)}},{key:"wechatPay",value:function(e){var t=this;window.wx&&window.wx.ready((function(){window.wx.chooseWXPay({timestamp:e.timeStamp,nonceStr:e.nonceStr,package:e.package,signType:e.signType,paySign:e.paySign,success:function(){t.linkToComplatePage()},cancel:function(){t.hooks.cancelWxPay()},fail:function(){t.hooks.wxPayFail()}})}))}},{key:"testCurrentOrderStatus",value:function(e){var t=this,r={orderNum:e};return new Promise((function(e,n){t.$axios.post(m.d,r,{apiParams:r}).then((function(t){1===t.stat?e():n(t.data)})).catch((function(e){n(e)}))}))}},{key:"commonPay",value:function(e){var t=this,r=e.url,n=e.orderNum;this.timer=setInterval((function(){t.testCurrentOrderStatus(n).then((function(){clearInterval(t.timer),t.timer=null,t.linkToCompletePage()}))}),3e3),window.top!==window?window.top.location.href=r:window.location.href=r}},{key:"receiveCoupon",value:function(e,t){var r=this;return this.hooks.getCouponAct(),this.$axios.get(m.H,{params:{page_key:e}}).then((function(e){var code=e.code,data=e.data;return 0===code&&data?1===data.res_stat?(r.hooks.getCouponSuccess(data),t&&O.$toast(t),!0):2===data.res_stat||(r.hooks.getCouponFail(),O.$toast("领券失败"),1!==e.data.is_must):(r.hooks.getCouponError(),O.$toast("领券失败"),!0)})).catch((function(e){return O.$toast("领券失败"),!0}))}}]);var e,t,r}();t.a=C}}]);