index.8d3466bf.js 1.9 KB

1
  1. import{n as u,W as p,F as i}from"./index.4fdc1c7a.js";const m={name:"makeup",components:{Waterfall:p},data(){return{loading:!1,products:[],limit:10,page:1,totalPage:1}},mounted(){this.getProducts()},methods:{loadData(a){this.getProducts({page:a,newload:!1})},getProducts({page:a=this.page,columnSize:t=this.columnSize,newload:e=!0}={}){this.loading=!0,this.page=a;const r=this.$t("common.failure");this.$axios.get("/api/index/product_list",{params:{type:this.types,limit:this.limit,page:a,go:t}}).then(l=>{const{code:o,msg:n=r,data:d={}}=l.data,{items:s=[],totalPage:c}=d;o==0?(this.products=e?s:refillData(this.products,s),this.totalPage=c):this.$message.error(n)}).finally(()=>{this.loading=!1})}},watch:{columnSize(a,t){this.getProducts({page:this.page,columnSize:a})},filterType(){this.getProducts({newload:!0})}},computed:{columnSize(){return this.$store.state.columnSize},types(){return this.filterType&&this.filterType!=="all"?[i.mode,...this.filterType.split(",")].join(","):[i.mode].join(",")},nameKey(){return this.$store.state.nameKey},filterType(){return this.$route.query.filter},filterText(){if(this.filterType==="all")return this.$t("common.filter.all")}}};var f=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)])},h=[],_=u(m,f,h,!1,null,"3ec06af5",null,null);const v=_.exports;export{v as default};