app.e1eeaf6f28c01c764e87.js 17 KB
webpackJsonp([23],{CCn6:function(t,e,n){"use strict";var a=n("7+uW"),o=n("//Fk"),i=n.n(o),r=n("mvHQ"),c=n.n(r),u=n("mtWM"),l=n.n(u),s=n("NC6I"),p=n.n(s),h=(n("IcnI"),n("Au9i")),f=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(c()(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]=p()(n[a].toString());n.sing="singsingenglish21000",t.params.param_token=p()(c()(n))}else if("/api/admin/login"!==t.url){t.data=t.data||{};var o=JSON.parse(c()(t.data));for(var i in o)null===o[i]&&(o[i]=""),"string"==typeof o[i]&&(t.data[i]=t.data[i].replace(/(^\s*)|(\s*$)/g,""),o[i]=o[i].replace(/(^\s*)|(\s*$)/g,"")),o[i]=p()(o[i].toString());o.sing="singsingenglish21000",t.data.param_token=p()(c()(o))}return t},function(t){return i.a.reject(t)}),l.a.interceptors.response.use(function(t){return 501===t.data.code&&f.a.push({name:"author",query:{retUrl:window.location.href.split("#")[1]||"",is_new_user_url:1}}),t},function(t){return i.a.reject(t)}),n.d(e,"d",function(){return d}),n.d(e,"C",function(){return m}),n.d(e,"g",function(){return g}),n.d(e,"x",function(){return y}),n.d(e,"D",function(){return w}),n.d(e,"E",function(){return v}),n.d(e,"A",function(){return b}),n.d(e,"n",function(){return _}),n.d(e,"f",function(){return $}),n.d(e,"m",function(){return k}),n.d(e,"z",function(){return S}),n.d(e,"G",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,"B",function(){return T}),n.d(e,"w",function(){return U}),n.d(e,"o",function(){return M}),n.d(e,"v",function(){return N}),n.d(e,"e",function(){return A}),n.d(e,"h",function(){return L}),n.d(e,"l",function(){return j}),n.d(e,"k",function(){return E}),n.d(e,"F",function(){return R}),n.d(e,"b",function(){return q}),n.d(e,"j",function(){return C}),n.d(e,"s",function(){return W}),n.d(e,"y",function(){return G}),n.d(e,"a",function(){return z}),n.d(e,"c",function(){return F}),n.d(e,"r",function(){return Y}),n.d(e,"t",function(){return D}),n.d(e,"u",function(){return H});a.default.prototype.$post=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new i.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),f.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(h.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 i.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),f.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(h.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 i.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),f.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(h.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 i.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),f.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(h.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 i.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),f.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(h.Toast)(t.data.msg))},function(t){a(t)})})},a.default.prototype.$upload=function(t,e){return new i.a(function(n,a){var o=parseInt(Number(e.file.size)/Number(10485760)+1),i=0;!function r(){var c=new FormData,u=e.file.slice(1024*i*1024*10,1024*(i+1)*1024*10);c.append("chunk",i),c.append("file_name",e.file.name),c.append("count",o),c.append("type",e.type),c.append("file",u),l.a.post(t,c,{headers:{"Content-Type":"multipart/form-data"},timeout:1e7,onUploadProgress:function(t){}}).then(function(t){200===t.data.code?i+1<o?(i++,r()):(i=0,n(t.data.data)):Object(h.Toast)(t.data.msg)}).catch(function(t){h.Indicator.close(),a(t)})}()})},a.default.prototype.$ret2=function(t){return new i.a(function(e,n){l.a.get(t).then(function(t){e(t.data)}).catch(function(t){n(t)})})};var d=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/banner/list")},m=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/jssdk",t)},g=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/goods/info/"+t)},y=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/address/info")},w=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/bill/wechat/pay",t)},v=function(t){return a.default.prototype.$post("https://wechat.changchangenglish.com/api/client/address/save",t)},b=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/course/list")},_=function(t,e){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/course/category/list/"+t,e)},$=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/course/relation/list/"+t)},k=function(t,e,n){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/element/info/"+t+"/"+e+"/"+n)},S=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/me")},P=function(t,e,n,o){return a.default.prototype.$post("https://wechat.changchangenglish.com/api/client/user/watch/log/"+t+"/"+e+"/"+n,o)},I=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/group/info/"+t)},O=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/order/info/"+t)},x=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/order/list",t)},T=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/watch/report")},U=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/me/teacher")},M=function(){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/new/user/direct")},N=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/bill/wechat/status",t)},A=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/coupon/list",{goods_id:t})},L=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/goods/list",t)},j=function(t,e){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/invite/earnings/"+e,t)},E=function(t,e){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/invite/list/"+e,t)},R=function(t){return a.default.prototype.$post("https://wechat.changchangenglish.com/api/client/mobile/code",t)},q=function(t){return a.default.prototype.$put("https://wechat.changchangenglish.com/api/client/user/mobile/bind",t)},C=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/bootPage",t)},W=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/redirect",t)},G=function(t){return a.default.prototype.$fetch("https://wechat.changchangenglish.com/api/client/user/collect",t)},z=function(t){return a.default.prototype.$post("https://wechat.changchangenglish.com/api/client/user/collect",t)},F=function(t){return a.default.prototype.$put("https://wechat.changchangenglish.com/api/client/user/collect/"+t)},Y=function(t){return a.default.prototype.$fetch("/api/client/user/watch/report/"+t)},D=function(){return a.default.prototype.$fetch("/api/client/share/goods")},H=function(t){return a.default.prototype.$fetch("/api/public/short/url",t)}},IcnI:function(t,e,n){"use strict";var a=n("7+uW"),o=n("NYxO"),i=(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:i,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 i=n("VU/8")({name:"App",mounted:function(){}},o,!1,function(t){n("RyfC")},null,null).exports,r=n("YaEn"),c=n("IcnI"),u=n("Au9i"),l=n.n(u),s=n("KPKd"),p=n.n(s),h=n("fk8Z"),f=n.n(h);n("d8/S");a.default.config.productionTip=!1,a.default.prototype.$sa=f.a,a.default.prototype.$sa.init({server_url:"default",heatmap:{clickmap:"default",show_log:!0,scroll_notice_map:"default"}}),a.default.use(l.a),a.default.use(p.a),new a.default({el:"#app",router:r.a,store:c.a,components:{App:i},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],i=0;i<a;i++)if(e=n[i],t.call(o,e,i,n))return e})},RyfC:function(t,e){},YaEn:function(t,e,n){"use strict";var a=n("7+uW"),o=n("IcnI"),i=n("sf/l"),r=n("/ocq"),c=n("fk8Z"),u=n.n(c),l=n("CCn6");a.default.use(r.a);var s={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()},p=window.navigator.userAgent.toLowerCase(),h=new r.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:"/shareGoods",name:"shareGoods",component:function(t){return n.e(8).then(function(){var e=[n("54Ry")];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(21)]).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(20)]).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 Promise.all([n.e(0),n.e(15)]).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(16)]).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:!0,noNew:!0,deep:10}},{path:"/buy",name:"buy",component:function(t){return Promise.all([n.e(0),n.e(6)]).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(7)]).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(17)]).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(3)]).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(4)]).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(5)]).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(9).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){a.default.nextTick(function(){u.a.quick("autoTrackSinglePage")}),"micromessenger"==p.match(/MicroMessenger/i)||"_sq_"==p.match(/_SQ_/i)?"noWechat"==t.name&&n({name:"index"}):"noWechat"!==t.name&&n({name:"noWechat"}),o.a.dispatch("isMobile",s.versions.mobile),document.title="唱唱启蒙英语";var r=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=i.a.getUrlParam().token||t.query.token;o.a.dispatch("setToken",c),Object(l.z)().then(function(t){localStorage.setItem("userId",t.user_id),u.a.login(t.user_id)}),r()}else if(localStorage.getItem("cc_token"))o.a.dispatch("setToken",localStorage.getItem("cc_token")),localStorage.getItem("userId")?u.a.login(localStorage.getItem("userId")):Object(l.z)().then(function(t){localStorage.setItem("userId",t.user_id),u.a.login(t.user_id)}),r();else if(t.meta.skip_login)r();else{var h={retUrl:t.fullPath};t.meta.noNew&&(h.is_new_user_url=1),n({name:"author",query:h})}}),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.e1eeaf6f28c01c764e87.js.map