1 |
- import{_ as d,a as h,b as _,c as u}from"./soft.b2666f5d.js";import{_ as m,a as g,b as f,c as v,d as y}from"./triangle.f2c12499.js";import{H as C}from"./header.e39c6eb1.js";import{n as I,b,c as r,d as k,F as $,C as S,e as E,i as T,f as A,h as c}from"./index.4fdc1c7a.js";const F={name:"makeup-filter-gloss",components:{Header:C},data(){return{containers:[],shapes:[],capacities:[],containerIds:[],shapeIds:[],curCapacityId:"",level1Count:0,level2Count:0}},mounted(){const e=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:this.id}}).then(s=>{const{code:t,msg:i=e,data:a=[]}=s.data;if(t==0){const n=a.find(o=>o.id===this.containerId),l=a.find(o=>o.id===this.shapeId),p=a.find(o=>o.id===this.capacityId);this.getContainers(n),this.getShapes(l),this.getCapacities(p)}else this.$message.error(i||e)}),this.getFilterTypes()},methods:{toggleContainers(){this.containerAll?this.containerIds=[]:this.containerIds=this.containers.filter(e=>e.type!=="empty").map(e=>e.id)},toggleShapes(){this.shapeAll?this.shapeIds=[]:this.shapeIds=this.shapes.filter(e=>e.type!=="empty").map(e=>e.id)},getFilterTypes(){const e=this.$t("common.failure");this.$axios.get("/api/filter_type_list").then(s=>{const{code:t,msg:i=e,data:a=[]}=s.data;if(t==0){const[n,l]=b(c.makeup,A[c.makeup].gloss,a);this.level1Count=n,this.level2Count=l}else this.$message.error(i||e)})},toBase(){sessionStorage.setItem("conf_filters",JSON.stringify([this.containers,this.shapes])),this.$router.push({path:"/makeup",query:{filter:`${this.containerIds},${this.shapeIds}`}})},changeContainer({id:e,type:s}){s!=="empty"&&(this.containerIds=[],this.containerIds.push(e))},changeShape({id:e,type:s}){s!=="empty"&&(this.shapeIds=[],this.shapeIds.push(e))},changeCapacity(e){this.curCapacityId=e},fillEmpty(e){for(let s=5;s>=0;s--)if(!e[s]){e[s]={type:"empty"};continue}return e},rebuildContainers(e){let s=r[this.id];s=s[this.containerId];const t=e.map(i=>{const a=s[i.id];return{...i,type:a,image:new URL(Object.assign({"../../../../assets/images/makeup/filter/containers/gloss/double.png":d,"../../../../assets/images/makeup/filter/containers/gloss/general.png":h,"../../../../assets/images/makeup/filter/containers/gloss/ring.png":_,"../../../../assets/images/makeup/filter/containers/gloss/soft.png":u})[`../../../../assets/images/makeup/filter/containers/gloss/${a}.png`],self.location).href}});return this.fillEmpty(t)},rebuildShapes(e){let s=r[parseInt(this.id)];s=s[this.shapeId];const t=e.map(i=>{const a=s[i.id];return{...i,type:a,image:new URL(Object.assign({"../../../../assets/images/makeup/filter/shapes/lipstick/oval.png":m,"../../../../assets/images/makeup/filter/shapes/lipstick/polygon.png":g,"../../../../assets/images/makeup/filter/shapes/lipstick/quadrangle.png":f,"../../../../assets/images/makeup/filter/shapes/lipstick/round.png":v,"../../../../assets/images/makeup/filter/shapes/lipstick/triangle.png":y})[`../../../../assets/images/makeup/filter/shapes/lipstick/${a}.png`],self.location).href}});return this.fillEmpty(t)},rebuildCapacities(e){return this.fillEmpty(e)},getContainers({id:e}){const s=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:e}}).then(t=>{const{code:i,msg:a=s,data:n=[]}=t.data;i==0?this.containers=this.rebuildContainers(n):this.$message.error(a||s)})},getShapes({id:e}){const s=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:e}}).then(t=>{const{code:i,msg:a=s,data:n=[]}=t.data;i==0?this.shapes=this.rebuildShapes(n):this.$message.error(a||s)})},getCapacities({id:e}){const s=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:e}}).then(t=>{const{code:i,msg:a=s,data:n=[]}=t.data;i==0?this.capacities=this.rebuildCapacities(n):this.$message.error(a||s)})}},computed:{id(){return k[$.mode].gloss},containerAll(){return this.containerIds.length===this.containers.filter(e=>e.type!=="empty").length},shapeAll(){return this.shapeIds.length===this.shapes.filter(e=>e.type!=="empty").length},containerId(){return S[this.id]},shapeId(){return E[this.id]},capacityId(){return T[this.id]},disabled(){return!(this.containerIds.length&&this.shapeIds.length)},nameKey(){return this.$store.state.nameKey}}};var R=function(){var s=this,t=s._self._c;return t("div",{staticClass:"makeup-filter-gloss"},[t("div",{staticClass:"filter-content"},[t("Header",{attrs:{type:"gloss"}}),t("div",{staticClass:"filter-container"},[t("div",{staticClass:"row"},[t("div",{class:["column-item",s.containerAll?"selected":""],on:{click:s.toggleContainers}},[s._m(0),t("div",{staticClass:"content"},[t("div",{staticClass:"top"},[t("b",[s._v(s._s(s.$t("common.filter.all")))])]),t("div",{staticClass:"bottom"},[s._v(" "+s._s(s.$t("common.filter.container"))+" ")])])]),s._l(s.containers,function(i){return t("div",{key:i.id,class:["column-item",i.type,i.type==="other"?"vh-center":"",i.type==="empty"?"filter":"",s.containerIds.includes(i.id)?"selected":""],on:{click:function(a){return s.changeContainer(i)}}},[i.type==="empty"?void 0:[s._m(1,!0),t("div",{staticClass:"content"},[t("div",{staticClass:"top"},[i.type==="other"?t("span",[s._v(s._s(i[s.nameKey]))]):t("img",{attrs:{src:i.image,alt:"plastic"}})]),i.type==="other"?t("div",{staticClass:"bottom"}):t("div",{staticClass:"bottom"},[s._v(" "+s._s(i[s.nameKey])+" ")])])]],2)})],2),t("div",{staticClass:"row"},[t("div",{class:["column-item",s.shapeAll?"selected":""],on:{click:s.toggleShapes}},[s._m(2),t("div",{staticClass:"content"},[t("div",{staticClass:"top"},[t("b",[s._v(s._s(s.$t("common.filter.all")))])]),t("div",{staticClass:"bottom"},[s._v(" "+s._s(s.$t("common.filter.shape"))+" ")])])]),s._l(s.shapes,function(i){return t("div",{key:i.id,class:["column-item",i.type,i.type==="other"?"vh-center":"",i.type==="empty"?"filter":"",s.shapeIds.includes(i.id)?"selected":""],on:{click:function(a){return s.changeShape(i)}}},[i.type==="empty"?void 0:[s._m(3,!0),t("div",{staticClass:"content"},[t("div",{staticClass:"top"},[i.type==="other"?t("span",[s._v(s._s(i[s.nameKey]))]):t("img",{attrs:{src:i.image,alt:"plastic"}})]),i.type==="other"?t("div",{staticClass:"bottom"}):t("div",{staticClass:"bottom"},[s._v(" "+s._s(i[s.nameKey])+" ")])])]],2)})],2)]),t("div",{staticClass:"upload-makeup-footer"},[t("div",{staticClass:"footer-count"},[t("ul",[t("li",[s._v(" "+s._s(s.$t("header.navs.nav2"))+" "+s._s(s.level1Count)+" ")]),s._v(" \xA0\xA0 > \xA0\xA0 "),t("li",[s._v(" "+s._s(s.$t("makeup.nav.gloss"))+" "+s._s(s.level2Count)+" ")])])]),t("el-button",{attrs:{type:"primary",disabled:s.disabled,round:""},on:{click:s.toBase}},[s._v(s._s(s.$t("common.resume")))])],1)],1)])},x=[function(){var e=this,s=e._self._c;return s("div",{staticClass:"selection"},[s("i",{staticClass:"el-icon-success"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"selection"},[s("i",{staticClass:"el-icon-success"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"selection"},[s("i",{staticClass:"el-icon-success"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"selection"},[s("i",{staticClass:"el-icon-success"})])}],D=I(F,R,x,!1,null,"4f61dea2",null,null);const B=D.exports;export{B as default};
|