Explorar o código

Merge branch 'master' of ssh://10.10.101.21/source/mall-web-ssr into HEAD

yangc %!s(int64=8) %!d(string=hai) anos
pai
achega
477e1065a1
Modificáronse 1 ficheiros con 18 adicións e 5 borrados
  1. 18 5
      components/product/CategoryProperty.vue

+ 18 - 5
components/product/CategoryProperty.vue

@@ -55,8 +55,8 @@
           </thead>
           <tbody>
           <tr v-if="hasProperties" class="tr-properties">
-            <td v-for="pro in properties" class="td-properties" style="vertical-align:middle;" >
- 								<span class="sl-selected" @click="selectProperty(pro.propertyId)" v-if="selectedProduct['a' + pro.propertyId] != ''">
+            <td v-for="pro in properties" class="td-properties" style="vertical-align:middle;" v-bind="selectedProduct">
+ 								<span class="sl-selected" @click="selectProperty(pro.propertyId)" v-if="!isDel(pro.propertyId)">
  									<a class="text-num" v-text="selectedProduct['a' + pro.propertyId].value" style="color: #5078CB"></a>
 									<span><i class="fa fa-close"></i></span>
  								</span>
@@ -71,7 +71,11 @@
         </table>
       </div>
           <ul v-show="list_exp_flag" @mouseenter="show_exp_list()" @mouseleave="hide_exp_list()" class="parameter-selection-ul drop-down-list" role="menu" aria-labelledby="dropdownMenu1">
-            <li v-for="item in selectedProperties.values"><a @click="selectPropertyValue(item, selectedProperties.propertyId)" class="a-color"><span>{{item.value}}</span></a></li>
+            <li v-for="item in selectedProperties.values">
+              <a @click="selectPropertyValue(item, selectedProperties.propertyId)" class="a-color">
+                <span>{{item.value}}</span>
+              </a>
+            </li>
           </ul>
     </div>
   </div>
@@ -100,6 +104,11 @@
 //        console.log(id)
 //      }
     },
+    filters: {
+      sortText: function (text) {
+        return text.sort()
+      }
+    },
     computed: {
       kind () {
         return this.$store.state.product.kind.kindsParentWithBother.data[this.$store.state.product.kind.kindsParentWithBother.data.length - 1]
@@ -140,8 +149,10 @@
       },
       selectProperty (propertyId) {
         this.selectedProduct['a' + propertyId] = ''
-        this.hasProperties = this.isempty(this.selectedProduct)
         this.$emit('loadCmpGoodsByTypeEvent', null)
+        this.hasProperties = this.isempty(this.selectedProduct)
+        this.list_exp_flag = true
+        this.list_exp_flag = false
       },
       isempty (obj) {
         for (let attr in obj) {
@@ -151,6 +162,9 @@
         }
         return false
       },
+      isDel (propertyId) {
+        return this.selectedProduct['a' + propertyId] === ''
+      },
       selectPropertyValue (item, propertyId) {
         this.hasProperties = true
         this.selectedProduct['a' + propertyId] = item
@@ -773,7 +787,6 @@
     float: left;
   }
   .drop-down-list {
-    max-width: 150px;
     position: absolute;
     top: 40px;
     left: 135px;