app.4547f952b3e0d0ebf08f.js 15.5 KB
webpackJsonp([22],{CCn6:function(t,e,n){"use strict";var a=n("7+uW"),o=n("//Fk"),r=n.n(o),i=n("mvHQ"),u=n.n(i),c=n("mtWM"),l=n.n(c),p=n("NC6I"),s=n.n(p),f=(n("IcnI"),n("Au9i")),d=n("YaEn");n("zSLJ");l.a.defaults.timeout=5e4,l.a.defaults.baseURL="",l.a.interceptors.request.use(function(t){var e=localStorage.getItem("cc_token");if(t.headers["Content-Type"]||(t.headers={"Content-Type":"application/json"}),e&&(t.headers.token=e),"get"===t.method&&"/api/admin/login"!==t.url){t.params=t.params||{};var n=JSON.parse(u()(t.params));for(var a in n)null===n[a]&&(n[a]=""),"string"==typeof n[a]&&(t.params[a]=t.params[a].replace(/(^\s*)|(\s*$)/g,""),n[a]=n[a].replace(/(^\s*)|(\s*$)/g,"")),n[a]=s()(n[a].toString());n.sing="singsingenglish21000",t.params.param_token=s()(u()(n))}else if("/api/admin/login"!==t.url){t.data=t.data||{};var o=JSON.parse(u()(t.data));for(var r in o)null===o[r]&&(o[r]=""),"string"==typeof o[r]&&(t.data[r]=t.data[r].replace(/(^\s*)|(\s*$)/g,""),o[r]=o[r].replace(/(^\s*)|(\s*$)/g,"")),o[r]=s()(o[r].toString());o.sing="singsingenglish21000",t.data.param_token=s()(u()(o))}return t},function(t){return r.a.reject(t)}),l.a.interceptors.response.use(function(t){return 501===t.data.code&&d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}}),t},function(t){return r.a.reject(t)}),n.d(e,"d",function(){return h}),n.d(e,"y",function(){return m}),n.d(e,"g",function(){return g}),n.d(e,"u",function(){return y}),n.d(e,"z",function(){return v}),n.d(e,"A",function(){return b}),n.d(e,"x",function(){return w}),n.d(e,"n",function(){return _}),n.d(e,"f",function(){return $}),n.d(e,"m",function(){return S}),n.d(e,"w",function(){return k}),n.d(e,"C",function(){return P}),n.d(e,"i",function(){return I}),n.d(e,"p",function(){return O}),n.d(e,"q",function(){return x}),n.d(e,"t",function(){return T}),n.d(e,"o",function(){return U}),n.d(e,"s",function(){return M}),n.d(e,"e",function(){return N}),n.d(e,"h",function(){return j}),n.d(e,"l",function(){return A}),n.d(e,"k",function(){return L}),n.d(e,"B",function(){return E}),n.d(e,"b",function(){return q}),n.d(e,"j",function(){return C}),n.d(e,"r",function(){return R}),n.d(e,"v",function(){return W}),n.d(e,"a",function(){return D}),n.d(e,"c",function(){return H});a.default.prototype.$post=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new r.a(function(n,a){l.a.post(t,e).then(function(t){200===t.data.code?n(t.data.data):501===t.data.code?(a(t.data),d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}})):503===t.data.code?a(t.data):(a(t.data),Object(f.Toast)(t.data.msg))},function(t){a(t)})})},a.default.prototype.$fetch=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new r.a(function(n,a){l.a.get(t,{params:e}).then(function(t){200===t.data.code?n(t.data.data):501===t.data.code?(a(t.data),d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}})):503===t.data.code?a(t.data):(a(t.data),Object(f.Toast)(t.data.msg))}).catch(function(t){a(t)})})},a.default.prototype.$patch=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new r.a(function(n,a){l.a.patch(t,e).then(function(t){200===t.data.code?n(t.data.data):501===t.data.code?(a(t.data),d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}})):503===t.data.code?a(t.data):(a(t.data),Object(f.Toast)(t.data.msg))},function(t){a(t)})})},a.default.prototype.$put=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new r.a(function(n,a){l.a.put(t,e).then(function(t){200===t.data.code?n(t.data.data):501===t.data.code?(a(t.data),d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}})):503===t.data.code?a(t.data):(a(t.data),Object(f.Toast)(t.data.msg))},function(t){a(t)})})},a.default.prototype.$del=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new r.a(function(n,a){l.a.delete(t,e).then(function(t){200===t.data.code?n(t.data.data):501===t.data.code?(a(t.data),d.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}})):503===t.data.code?a(t.data):(a(t.data),Object(f.Toast)(t.data.msg))},function(t){a(t)})})},a.default.prototype.$upload=function(t,e){return new r.a(function(n,a){var o=parseInt(Number(e.file.size)/Number(10485760)+1),r=0;!function i(){var u=new FormData,c=e.file.slice(1024*r*1024*10,1024*(r+1)*1024*10);u.append("chunk",r),u.append("file_name",e.file.name),u.append("count",o),u.append("type",e.type),u.append("file",c),l.a.post(t,u,{headers:{"Content-Type":"multipart/form-data"},timeout:1e7,onUploadProgress:function(t){}}).then(function(t){200===t.data.code?r+1<o?(r++,i()):(r=0,n(t.data.data)):Object(f.Toast)(t.data.msg)}).catch(function(t){f.Indicator.close(),a(t)})}()})},a.default.prototype.$ret2=function(t){return new r.a(function(e,n){l.a.get(t).then(function(t){e(t.data)}).catch(function(t){n(t)})})};var h=function(){return a.default.prototype.$fetch("/api/client/banner/list")},m=function(t){return a.default.prototype.$fetch("/api/client/jssdk",t)},g=function(t){return a.default.prototype.$fetch("/api/client/goods/info/"+t)},y=function(){return a.default.prototype.$fetch("/api/client/address/info")},v=function(t){return a.default.prototype.$fetch("/api/client/bill/wechat/pay",t)},b=function(t){return a.default.prototype.$post("/api/client/address/save",t)},w=function(){return a.default.prototype.$fetch("/api/client/user/course/list")},_=function(t,e){return a.default.prototype.$fetch("/api/client/course/category/list/"+t,e)},$=function(t){return a.default.prototype.$fetch("/api/client/course/relation/list/"+t)},S=function(t,e,n){return a.default.prototype.$fetch("/api/client/element/info/"+t+"/"+e+"/"+n)},k=function(){return a.default.prototype.$fetch("/api/client/me")},P=function(t,e,n,o){return a.default.prototype.$post("/api/client/user/watch/log/"+t+"/"+e+"/"+n,o)},I=function(t){return a.default.prototype.$fetch("/api/client/group/info/"+t)},O=function(t){return a.default.prototype.$fetch("/api/client/order/info/"+t)},x=function(t){return a.default.prototype.$fetch("/api/client/order/list",t)},T=function(){return a.default.prototype.$fetch("/api/client/me/teacher")},U=function(){return a.default.prototype.$fetch("/api/client/new/user/direct")},M=function(t){return a.default.prototype.$fetch("/api/client/bill/wechat/status",t)},N=function(t){return a.default.prototype.$fetch("/api/client/user/coupon/list",{goods_id:t})},j=function(t){return a.default.prototype.$fetch("/api/client/goods/list",t)},A=function(t,e){return a.default.prototype.$fetch("/api/client/user/invite/earnings/"+e,t)},L=function(t,e){return a.default.prototype.$fetch("/api/client/user/invite/list/"+e,t)},E=function(t){return a.default.prototype.$post("/api/client/mobile/code",t)},q=function(t){return a.default.prototype.$put("/api/client/user/mobile/bind",t)},C=function(t){return a.default.prototype.$fetch("/api/client/user/bootPage",t)},R=function(t){return a.default.prototype.$fetch("/api/client/redirect",t)},W=function(t){return a.default.prototype.$fetch("/api/client/user/collect",t)},D=function(t){return a.default.prototype.$post("/api/client/user/collect",t)},H=function(t){return a.default.prototype.$put("/api/client/user/collect/"+t)}},IcnI:function(t,e,n){"use strict";var a=n("7+uW"),o=n("NYxO"),r=(n("zSLJ"),{setToken:function(t,e){t.token=e,localStorage.setItem("cc_token",e)},transitionGo:function(t){t.transitionName="slide-left"},transitionBack:function(t){t.transitionName="slide-right"},isMobile:function(t,e){t.isMobile=e}});a.default.use(o.a);e.a=new o.a.Store({state:{token:"",transitionName:"slide-left",isMobile:!1},mutations:r,actions:{setToken:function(t,e){(0,t.commit)("setToken",e)},isMobile:function(t,e){(0,t.commit)("isMobile",e)}}})},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("7+uW"),o={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("transition",{attrs:{name:"fade"}},[e("router-view",{staticClass:"child-view"})],1)],1)},staticRenderFns:[]};var r=n("VU/8")({name:"App",mounted:function(){}},o,!1,function(t){n("RyfC")},null,null).exports,i=n("YaEn"),u=n("IcnI"),c=n("Au9i"),l=n.n(c),p=n("KPKd"),s=n.n(p),f=n("fk8Z"),d=n.n(f);n("d8/S");a.default.config.productionTip=!1,a.default.prototype.$sa=d.a,a.default.prototype.$sa.init({server_url:"http://47.107.250.38:8106/sa?project=production",heatmap:{clickmap:"default",show_log:!0,scroll_notice_map:"default"}}),a.default.use(l.a),a.default.use(s.a),new a.default({el:"#app",router:i.a,store:u.a,components:{App:r},template:"<App/>"}),Array.prototype.find||(Array.prototype.find=function(t){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),a=n.length>>>0,o=arguments[1],r=0;r<a;r++)if(e=n[r],t.call(o,e,r,n))return e})},RyfC:function(t,e){},YaEn:function(t,e,n){"use strict";var a=n("mvHQ"),o=n.n(a),r=n("7+uW"),i=n("IcnI"),u=n("sf/l"),c=n("/ocq"),l=n("fk8Z"),p=n.n(l),s=n("CCn6");r.default.use(c.a);var f={versions:function(){var t=navigator.userAgent;navigator.appVersion;return{trident:t.indexOf("Trident")>-1,presto:t.indexOf("Presto")>-1,webKit:t.indexOf("AppleWebKit")>-1,gecko:t.indexOf("Gecko")>-1&&-1===t.indexOf("KHTML"),mobile:!!t.match(/AppleWebKit.*Mobile.*/),ios:!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:t.indexOf("Android")>-1||t.indexOf("Linux")>-1,iPhone:t.indexOf("iPhone")>-1,iPad:t.indexOf("iPad")>-1,webApp:-1==t.indexOf("Safari")}}(),language:(navigator.browserLanguage||navigator.language).toLowerCase()},d=window.navigator.userAgent.toLowerCase(),h=new c.a({routes:[{path:"/",name:"index",component:function(t){return Promise.all([n.e(0),n.e(12)]).then(function(){var e=[n("dAjm")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:0}},{path:"/newLesson",name:"newLesson",component:function(t){return Promise.all([n.e(0),n.e(1)]).then(function(){var e=[n("4t0V")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:0}},{path:"/myGoodsList",name:"myGoodsList",component:function(t){return Promise.all([n.e(0),n.e(20)]).then(function(){var e=[n("P3Wy")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:1}},{path:"/mine",name:"mine",component:function(t){return Promise.all([n.e(0),n.e(17)]).then(function(){var e=[n("U/b5")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:1}},{path:"/order",name:"order",component:function(t){return n.e(9).then(function(){var e=[n("R7Pr")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:2}},{path:"/share",name:"share",component:function(t){return Promise.all([n.e(0),n.e(15)]).then(function(){var e=[n("Eg0l")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:2}},{path:"/author",name:"author",component:function(t){return n.e(14).then(function(){var e=[n("sA+T")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:100,noNew:!0}},{path:"/buyDetail",name:"buyDetail",component:function(t){return Promise.all([n.e(0),n.e(10)]).then(function(){var e=[n("bNYG")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!1,noNew:!0,deep:10}},{path:"/buy",name:"buy",component:function(t){return Promise.all([n.e(0),n.e(7)]).then(function(){var e=[n("Y1ei")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{noNew:!0,deep:11}},{path:"/success",name:"success",component:function(t){return Promise.all([n.e(0),n.e(6)]).then(function(){var e=[n("IF8E")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{noNew:!0,deep:12}},{path:"/buySuccess",name:"buySuccess",component:function(t){return Promise.all([n.e(0),n.e(16)]).then(function(){var e=[n("w9eS")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{noNew:!0,deep:12}},{path:"/map",name:"map",component:function(t){return Promise.all([n.e(0),n.e(5)]).then(function(){var e=[n("3QU7")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:3}},{path:"/saleSuccess",name:"saleSuccess",component:function(t){return n.e(13).then(function(){var e=[n("wSE2")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:4}},{path:"/bindMobile",name:"bindMobile",component:function(t){return n.e(11).then(function(){var e=[n("/Vxk")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{deep:0}},{path:"/activity",name:"activity",component:function(t){return Promise.all([n.e(0),n.e(3)]).then(function(){var e=[n("yYpN")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!0}},{path:"/activityInvite",name:"activityInvite",component:function(t){return Promise.all([n.e(0),n.e(4)]).then(function(){var e=[n("aRHX")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!0}},{path:"/inviteList",name:"inviteList",component:function(t){return n.e(8).then(function(){var e=[n("eZU3")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!0}},{path:"/collection",name:"collection",component:function(t){return Promise.all([n.e(0),n.e(2)]).then(function(){var e=[n("PTpu")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!0}},{path:"/noWechat",name:"noWechat",component:function(t){return n.e(19).then(function(){var e=[n("nmbt")];t.apply(null,e)}.bind(this)).catch(n.oe)},meta:{skip_login:!1}},{path:"*",component:function(t){return Promise.all([n.e(0),n.e(18)]).then(function(){var e=[n("Zazt")];t.apply(null,e)}.bind(this)).catch(n.oe)}}]});h.beforeEach(function(t,e,n){r.default.nextTick(function(){p.a.quick("autoTrackSinglePage")}),"micromessenger"==d.match(/MicroMessenger/i)||"_sq_"==d.match(/_SQ_/i)?"noWechat"==t.name&&n({name:"index"}):"noWechat"!==t.name&&n({name:"noWechat"}),i.a.dispatch("isMobile",f.versions.mobile),document.title="唱唱启蒙英语";var a=function(){if(localStorage.getItem("retUrl")&&null!==localStorage.getItem("retUrl")&&""!==localStorage.getItem("retUrl")){var t=localStorage.getItem("retUrl").toString();localStorage.removeItem("retUrl"),n(t)}else n()};if("author"===t.name||"bindMobile"===t.name||"noWechat"===t.name)n();else if(window.location.href.indexOf("token")>-1){var c=u.a.getUrlParam().token||t.query.token;i.a.dispatch("setToken",c),Object(s.w)().then(function(t){localStorage.setItem("userDesc",o()(t)),p.a.login(t.user_id),a()}).catch(function(){localStorage.getItem("userDesc")&&a()})}else if(localStorage.getItem("cc_token"))i.a.dispatch("setToken",localStorage.getItem("cc_token")),localStorage.getItem("userDesc")?(p.a.login(JSON.parse(localStorage.getItem("userDesc")).user_id),a()):Object(s.w)().then(function(t){localStorage.setItem("userDesc",o()(t)),p.a.login(t.user_id),a()}).catch(function(){localStorage.getItem("userDesc")&&a()});else{var l={retUrl:t.fullPath};t.meta.noNew&&(l.is_new_user_url=1),n({name:"author",query:l})}}),e.a=h},"d8/S":function(t,e){},"sf/l":function(t,e,n){"use strict";e.a={dateFmt:function(t,e){var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var a in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+a+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[a]:("00"+n[a]).substr((""+n[a]).length)));return e},getUrlParam:function(){var t=location.search,e=new Object;if(-1!=t.indexOf("?"))for(var n=t.substr(1).split("&"),a=0;a<n.length;a++)e[n[a].split("=")[0]]=unescape(n[a].split("=")[1]);return e},toDataURL:function(t,e){var n=new XMLHttpRequest;n.onload=function(){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n.response)},n.responseType="blob",n.open("GET",t,!0),n.send()}}},zSLJ:function(t,e,n){"use strict"}},["NHnr"]);
//# sourceMappingURL=app.4547f952b3e0d0ebf08f.js.map