12 |
- (function(e){function t(t){for(var a,i,c=t[0],o=t[1],l=t[2],p=0,g=[];p<c.length;p++)i=c[p],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&g.push(r[i][0]),r[i]=0;for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a]);u&&u(t);while(g.length)g.shift()();return s.push.apply(s,l||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],a=!0,c=1;c<n.length;c++){var o=n[c];0!==r[o]&&(a=!1)}a&&(s.splice(t--,1),e=i(i.s=n[0]))}return e}var a={},r={app:0},s=[];function i(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="http://oyweb.ouj.com/other/shop-popularize/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],o=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=o;s.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"034f":function(e,t,n){"use strict";var a=n("85ec"),r=n.n(a);r.a},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var a=n("2b0e"),r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[a("header",[a("ul",{staticClass:"nav"},e._l(e.navList,(function(t,n){return a("li",{key:t.id,class:["nav-item",{"nav-item-last":n==e.navList.length-1},{active:e.tabIndex==t.type_id}],on:{click:function(n){return e.handleChangeTab(t.type_id)}}},[e._v(" "+e._s(t.name)+" ")])})),0)]),a("div",{staticClass:"content"},[a("ul",{staticClass:"content-list clearfix"},e._l(e.productList,(function(t,r){return a("li",{key:t.list_id,class:["content-item",{"item-no-margin":(r+1)%3==0}],on:{click:e.handleClickStat}},[a("a",{attrs:{href:t.url,target:"_blank"}},[a("img",{staticClass:"content-img",attrs:{src:n("cf1c"),"data-img":t.icon}})])])})),0)]),a("div",{staticClass:"page"},[e.pages.length>1?a("ul",{staticClass:"page-content clearfix"},[a("li",{class:["page-item","page-item-oprea",{"page-oprea-no-allowed":1==e.pages.currentPage}],on:{click:function(t){return e.handleChangePage("desc")}}},[e._v(" 上一页 ")]),e._l(e.pages.allPage,(function(t,n){return a("li",{key:n,class:["page-item",{active:e.pages.currentPage==t}],on:{click:function(t){return e.handleGoPage(n+1)}}},[e._v(" "+e._s(n+1)+" ")])})),a("li",{class:["page-item","page-item-oprea",{"page-oprea-no-allowed":e.pages.currentPage==e.pages.allPage.length}],on:{click:function(t){return e.handleChangePage("asc")}}},[e._v(" 下一页 ")])],2):a("ul",{staticClass:"page-content clearfix"},[a("li",{staticClass:"page-item active"},[e._v("1")])])]),e._m(0)])},s=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tips"},[a("img",{attrs:{src:n("75e1")}})])}],i=(n("d81d"),n("fb6a"),n("96cf"),n("1da1")),c=(n("4160"),n("baa5"),n("b64b"),n("d3b7"),n("159b"),"http://pgame.ouj.com/hdCenter");function o(e,t){e=c+e;var n="";return Object.keys(t).forEach((function(e){n+=e+"="+t[e]+"&"})),""!==n&&(n=n.substr(0,n.lastIndexOf("&")),e=e+"?"+n),new Promise((function(t,n){var a=new XMLHttpRequest;a.open("GET",e,!0),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status)t(JSON.parse(this.responseText),this);else{var e={code:this.status,response:this.response};n(e,this)}},a.send()}))}var l=n("5e2c"),u=n.n(l),p={name:"App",data:function(){return{name:"APP",navList:[],tabIndex:1,pages:{length:0,allPage:[],currentPage:1},type:"",productList:[]}},mounted:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.handleGetData(e.type,e.pages.currentPage),(new Image).src="http://clickstats.ouj.com/?r=stats/index&event=hiydshop_recom_list_load";case 2:case"end":return t.stop()}}),t)})))()},methods:{handleGetData:function(e,t){var n=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){var r,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,o("/index",{type:e,p:t});case 2:r=a.sent,r.data.pages?(n.pages.length=r.data.pages.total_count,n.pages.allPage=r.data.pages.all_pages):n.pages={length:0,allPage:[],currentPage:1},n.productList=r.data.item_list,n.navList=r.data.type_list,s=n,n.$nextTick((function(){var e=document.getElementsByClassName("content-img");[].slice.call(e).map((function(e){s.initImage(e)}))}));case 8:case"end":return a.stop()}}),a)})))()},initImage:function(e){var t=new Image;t.src=e.dataset.img,t.onload=function(){e.src=e.dataset.img,e.className+=" img"},t.onerror=function(){e.src=u.a,e.className+=" img"}},handleChangeTab:function(e){this.tabIndex=e,this.type=e,this.pages.currentPage=1,this.handleGetData(this.type,this.pages.currentPage),this.handleClickStat()},handleChangePage:function(e){if("asc"===e){if(this.pages.currentPage==this.pages.allPage.length)return;this.pages.currentPage=this.pages.currentPage+1,this.handleGetData(this.type,this.pages.currentPage)}else if("desc"===e){if(1==this.pages.currentPage)return;this.pages.currentPage=this.pages.currentPage-1,this.handleGetData(this.type,this.pages.currentPage)}else console.log(this.pages.currentPage)},handleGoPage:function(e){this.pages.currentPage=e,this.handleGetData(this.type,e)},handleClickStat:function(){(new Image).src="http://clickstats.ouj.com/?r=stats/index&event=hiydshop_recom_list_click"}}},g=p,h=(n("034f"),n("2877")),d=Object(h["a"])(g,r,s,!1,null,null,null),f=d.exports;a["a"].config.productionTip=!1,new a["a"]({render:function(e){return e(f)}}).$mount("#app")},"5e2c":function(e,t,n){e.exports=n.p+"img/no-img.08b9ea21.png"},"75e1":function(e,t,n){e.exports=n.p+"img/share.9ed13c71.png"},"85ec":function(e,t,n){},cf1c:function(e,t,n){e.exports=n.p+"img/loading.6cec7c5c.gif"}});
- //# sourceMappingURL=app.f47666f1.js.map
|