index-legacy.44157a29.js 3.7 KB

1
  1. !function(){function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(t,a)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}System.register(["./index-legacy.88892f9c.js"],(function(e,a){"use strict";var i,n,r,o=document.createElement("style");return o.textContent=".makeup[data-v-3ec06af5]{background:var(--color-white);min-height:calc(100vh - 112px)}.makeup .header[data-v-3ec06af5]{position:fixed;left:0;top:50px;width:100%;height:60px;background:var(--color-white);z-index:1}.header .header-content[data-v-3ec06af5]{width:960px;height:100%;display:flex;margin:0 auto;align-items:center;justify-content:space-between}.header .el-button[data-v-3ec06af5]{width:68px;height:25px;font-size:12px}.header .left b[data-v-3ec06af5]{font-size:22px;margin-right:15px}.makeup .bottom[data-v-3ec06af5]{padding-top:50px;padding-bottom:100px}.makeup .bottom.margin[data-v-3ec06af5]{padding-top:100px}\n",document.head.appendChild(o),{setters:[function(t){i=t.n,n=t.W,r=t.F}],execute:function(){var a={name:"makeup",components:{Waterfall:n},data:function(){return{loading:!1,products:[],limit:10,page:1,totalPage:1}},mounted:function(){this.getProducts()},methods:{loadData:function(t){this.getProducts({page:t,newload:!1})},getProducts:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=e.page,i=void 0===a?this.page:a,n=e.columnSize,r=void 0===n?this.columnSize:n,o=e.newload,l=void 0===o||o;this.loading=!0,this.page=i;var s=this.$t("common.failure");this.$axios.get("/api/index/product_list",{params:{type:this.types,limit:this.limit,page:i,go:r}}).then((function(e){var a=e.data,i=a.code,n=a.msg,r=void 0===n?s:n,o=a.data,c=void 0===o?{}:o,u=c.items,d=void 0===u?[]:u,p=c.totalPage;0==i?(t.products=l?d:refillData(t.products,d),t.totalPage=p):t.$message.error(r)})).finally((function(){t.loading=!1}))}},watch:{columnSize:function(t,e){this.getProducts({page:this.page,columnSize:t})},filterType:function(){this.getProducts({newload:!0})}},computed:{columnSize:function(){return this.$store.state.columnSize},types:function(){return this.filterType&&"all"!==this.filterType?[r.mode].concat(t(this.filterType.split(","))).join(","):[r.mode].join(",")},nameKey:function(){return this.$store.state.nameKey},filterType:function(){return this.$route.query.filter},filterText:function(){if("all"===this.filterType)return this.$t("common.filter.all")}}};e("default",i(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"makeup"},[t.filterType?e("div",{staticClass:"header",attrs:{id:"scrollHeader"}},[e("div",{staticClass:"header-content"},[e("div",{staticClass:"left v-center"},[e("b",[t._v(t._s(t.$t("header.navs.nav2")))]),t._v(" "+t._s(t.filterText)+" ")]),e("div",{staticClass:"right"},[e("router-link",{attrs:{to:{path:"/makeup",query:{filter:"all"}}}},[e("el-button",{attrs:{type:"primary",round:""}},[t._v(t._s(t.$t("common.viewAll")))])],1)],1)])]):t._e(),e("div",{class:["bottom",t.filterType?"margin":""]},[t.products.length?e("Waterfall",{attrs:{page:t.page,totalPage:t.totalPage,loading:t.loading,data:t.products},on:{loadData:t.loadData}}):t._e()],1)])}),[],!1,null,"3ec06af5",null,null).exports)}}}))}();