1var ecblib = ecblib || {}; 2ecblib.staffstart = ecblib.staffstart || {}; 3ecblib.staffstart.impl = ecblib.staffstart.impl || {}; 4 5(function() { 6 'use strict'; 7 ecblib.staffstart.impl.staffList = function(_el, _mobile, _option, _conditionFunc) { 8 ecblib.staffstart.util.initGloalVariables(_mobile); 9 10 new Vue({ 11 el: _el, 12 data: function () { 13 return { 14 mobile: _mobile, 15 displayType: ecblib.staffstart.displaytype, 16 displayTypeConst: ecblib.staffstart.displaytype_const, 17 isShowMenu: false, 18 breadCrumbList: [ 19 { name: 'ããã', url: ecblib.staffstart.uri.home }, 20 { name: 'ã¹ã¿ãã', url: '#' }, 21 ], 22 sortTypes: [ 23 { id: 'time', name: 'ææ°ã¹ã¿ã¤ãªã³ã°å ¬éé ' }, 24 { id: 'sales', name: '人æ°é ' }, 25 ], 26 27 staffsLlength: 0, 28 searchConditions: {}, 29 30 shop: 0, 31 label: null, 32 gender: null, 33 user: { skin_type: null, skin_color: null, eyelid: null, size: null, feature: null }, 34 stature: { min: null, max: null }, 35 age: { min: null, max: null }, 36 sort_type: 'time', 37 qualification_1: [], 38 qualification_2: [], 39 ss_pageindex: null, 40 user_id_array: [], 41 }; 42 }, 43 created: function () { 44 const _self = this; 45 _self.Search(); 46 window.addEventListener("popstate", function() { 47 _self.Search(); 48 }); 49 50 }, 51 methods: { 52 getStaffs: function () { 53 if(_conditionFunc) { 54 this.searchConditions = _conditionFunc(this); 55 } else { 56 this.searchConditions = { 57 shop_code: this.shop == 0 ? null : this.shop, 58 label_code: this.label, 59 gender: this.gender, 60 "user.skin_type": this.user ? this.user.skin_type : null, 61 "user.skin_color": this.user ? this.user.skin_color : null, 62 "user.eyelid": this.user ? this.user.eyelid : null, 63 from_height: this.stature ? this.stature.min : null, 64 to_height: this.stature ? this.stature.max : null, 65 from_age: this.age ? this.age.min : null, 66 to_age: this.age ? this.age.max : null, 67 sort: this.sort_type, 68 "user.size": this.user ? this.user.size : null, 69 "user.feature": this.user ? this.user.feature : null, 70 qualification_1 : this.qualification_1, 71 qualification_2 : this.qualification_2, 72 ss_pageindex: this.ss_pageindex, 73 74 }; 75 } 76 this.isShowMenu = false; 77 }, 78 initSearchConditions: function () { 79 this.shop = 0; 80 this.label = null; 81 this.gender = null; 82 this.user = { skin_type: null, skin_color: null, eyelid: null, size: null, feature: null }; 83 this.stature = { min: null, max: null }; 84 this.age = { min: null, max: null }; 85 this.qualification_1 = []; 86 this.qualification_2 = []; 87 this.ss_pageindex = null; 88
89 this.getStaffs(); 90 }, 91 pushHistory: function(){ 92 var params = this.searchConditions; 93 94 let queryStringArray = []; 95 Object.keys(params).forEach( 96 function(i) { 97 if(params[i] === false || params[i] === 0 || params[i]) { 98 if(i == ecblib.staffstart.master.user.size.id){ 99 queryStringArray.push(encodeURI('user_attributes[][slug]=' + ecblib.staffstart.master.user.size.id + '&user_attributes[][value]=' + params[i])); 100 }else if(i == ecblib.staffstart.master.user.feature.id){ 101 queryStringArray.push(encodeURI('user_attributes[][slug]=' + ecblib.staffstart.master.user.feature.id + '&user_attributes[][value]=' + params[i])); 102 }else{ 103 queryStringArray.push(i + '=' + encodeURI(params[i])); 104 } 105 } 106 } 107 ); 108 109 history.pushState(null, null, location.pathname + '?' + queryStringArray.join('&')); 110 }, 111 Search: function(){ 112 const _self = this; 113 114 _self.shop = 0; 115 _self.label = null; 116 _self.gender = null; 117 _self.user = { skin_type: null, skin_color: null, eyelid: null, size: null, feature: null }; 118 _self.stature = { min: null, max: null }; 119 _self.age = { min: null, max: null }; 120 _self.qualification_1 = []; 121 _self.qualification_2 = []; 122 _self.ss_pageindex = 1; 123 124 if (_option) { 125 Object.keys(_option).forEach( 126 function(i) { 127 if (i in _self) { 128 _self[i] = _option[i]; 129 } 130 } 131 ); 132 } 133 const queryParams = ecblib.staffstart.util.queryParams(); 134 if(Object.keys(queryParams).length > 0){ 135 Object.keys(queryParams).forEach( 136 function(i) { 137 switch (i){ 138 case "shop_code": 139 _self.shop = queryParams[i]; 140 break; 141 case "label_code": 142 _self.label = queryParams[i]; 143 break; 144 case "gender": 145 _self.gender = queryParams[i]; 146 break; 147 case "from_height": 148 _self.stature.min = Number(queryParams[i]); 149 break; 150 case "to_height": 151 _self.stature.max = Number(queryParams[i]); 152 break; 153 case "qualification_1": 154 _self.qualification_1 = queryParams[i].split(","); 155 break; 156 case "qualification_2": 157 _self.qualification_2 = queryParams[i].split(","); 158 break; 159 case "sort": 160 _self.sort_type = queryParams[i]; 161 break; 162 default: 163 if (i in _self) { 164 _self[i] = queryParams[i]; 165 } 166 } 167 } 168 ); 169 }
170 this.getStaffs(); 171 } 172 }, 173 watch: { 174 'sort_type': function () { 175 this.getStaffs(); 176 this.pushHistory(); 177 }, 178 }, 179 }); 180 }; 181})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.