index.fe4d9990.js 1.9 KB

1
  1. import{n as h,W as p,d as i,F as a,O as f}from"./index.4fdc1c7a.js";const _={name:"other",components:{Waterfall:p},data(){return{loading:!1,products:[],limit:10,page:1,totalPage:1}},mounted(){this.getProducts()},methods:{loadData(s){this.getProducts({page:s,newload:!1})},getProducts({page:s=this.page,columnSize:t=this.columnSize,newload:e=!0}={}){this.loading=!0,this.page=s;const l=this.$t("common.failure");this.$axios.get("/api/index/product_list",{params:{type:this.types,limit:this.limit,page:s,go:t}}).then(o=>{const{code:n,msg:d=l,data:c={}}=o.data,{items:r=[],totalPage:u}=c;n==0?(this.products=e?r:refillData(this.products,r),this.totalPage=u):this.$message.error(d)}).finally(()=>{this.loading=!1})}},watch:{columnSize(s,t){this.getProducts({page:this.page,columnSize:s})},filterType(){this.getProducts({newload:!0})}},computed:{columnSize(){return this.$store.state.columnSize},types(){return this.filterType?i[a.index][this.filterType]?[a.mode,i[a.mode][this.filterType]].join(","):[a.mode].join(","):this.$store.getters.strTypes},filterType(){return this.$route.query.filter},filterText(){return this.filterType?f.filterTexts[this.filterType]:""}}};var m=function(){var t=this,e=t._self._c;return e("div",{staticClass:"other"},[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.nav3")))]),t._v(" "+t._s(t.$t(`${t.filterText}`))+" ")]),e("div",{staticClass:"right"},[e("router-link",{attrs:{to:{path:"/other",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)])},g=[],v=h(_,m,g,!1,null,"b2815fb5",null,null);const T=v.exports;export{T as default};