|
|
@@ -21,7 +21,7 @@
|
|
|
<tr>
|
|
|
<td class="td-width dropdown">
|
|
|
<span class="dropdown-toggle dropdown-back" data-toggle="dropdown">品牌<span class="fa fa-angle-down td-icon"></span></span>
|
|
|
- <ul class="dropdown-menu parameter-selection-ul" role="menu" aria-labelledby="dropdownMenu1">
|
|
|
+ <ul class="dropdown-menu parameter-selection-ul" role="menu" aria-labelledby="dropdownMenu1" style="top: 38px;">
|
|
|
<!--orderBy:'nameCn'-->
|
|
|
<li v-for="b in brands"><a @click="selectBrand(b)"><span>{{b.nameCn}}</span></a></li>
|
|
|
</ul>
|
|
|
@@ -56,8 +56,8 @@
|
|
|
<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" v-if="pro.selected" @click="selectProperty(pro)">
|
|
|
- <a class="text-num">{{pro.selected.value}}</a>
|
|
|
+ <span class="sl-selected" @click="selectProperty(pro.propertyId)" v-if="selectedProduct['a' + 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>
|
|
|
</td>
|
|
|
@@ -71,7 +71,7 @@
|
|
|
</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="v in selectedProperties.values"><a @click="selectPropertyValue(selectedProperties, v)" class="a-color"><span>{{v.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>
|
|
|
@@ -87,9 +87,19 @@
|
|
|
nameCn: null
|
|
|
},
|
|
|
selectedProperties: {},
|
|
|
- list_exp_flag: false
|
|
|
+ list_exp_flag: false,
|
|
|
+ selectedProduct: {},
|
|
|
+ JSONObj: {}
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+// var list = document.getElementsByClassName('list-menu')
|
|
|
+// var container = document.getElementsByClassName('div-table')
|
|
|
+// list.onmouseover = function () {
|
|
|
+// var id = list[0].getAttribute['split-dropdown-trigger']
|
|
|
+// console.log(id)
|
|
|
+// }
|
|
|
+ },
|
|
|
computed: {
|
|
|
kind () {
|
|
|
return this.$store.state.product.kind.kindsParentWithBother.data[this.$store.state.product.kind.kindsParentWithBother.data.length - 1]
|
|
|
@@ -98,7 +108,11 @@
|
|
|
return this.$store.state.product.kind.children.data
|
|
|
},
|
|
|
properties () {
|
|
|
- return this.$store.state.product.kind.kindProperty.data
|
|
|
+ let arr = this.$store.state.product.kind.kindProperty.data
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ this.selectedProduct[ 'a' + arr[i].propertyId ] = ''
|
|
|
+ }
|
|
|
+ return arr
|
|
|
},
|
|
|
brands () {
|
|
|
return this.$store.state.product.kind.brands.data
|
|
|
@@ -124,11 +138,24 @@
|
|
|
this.selectedBrand = {}
|
|
|
this.$emit('loadCmpGoodsByBrandEvent', null)
|
|
|
},
|
|
|
- selectProperty (item) {
|
|
|
- return null
|
|
|
+ selectProperty (propertyId) {
|
|
|
+ this.selectedProduct['a' + propertyId] = ''
|
|
|
+ this.hasProperties = this.isempty(this.selectedProduct)
|
|
|
+ this.$emit('loadCmpGoodsByTypeEvent', null)
|
|
|
+ },
|
|
|
+ isempty (obj) {
|
|
|
+ for (let attr in obj) {
|
|
|
+ if (obj[attr] !== '') {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
},
|
|
|
- selectPropertyValue (item, value) {
|
|
|
- return null
|
|
|
+ selectPropertyValue (item, propertyId) {
|
|
|
+ this.hasProperties = true
|
|
|
+ this.selectedProduct['a' + propertyId] = item
|
|
|
+ this.JSONObj[propertyId] = item.value
|
|
|
+ this.$emit('loadCmpGoodsByTypeEvent', JSON.stringify(this.JSONObj))
|
|
|
},
|
|
|
use_exp_list: function (pro, index) {
|
|
|
this.selectedProperties = pro
|
|
|
@@ -162,7 +189,6 @@
|
|
|
.breadcrumbs ul.list-unstyled.list-inline {
|
|
|
margin-left: 0px;
|
|
|
}
|
|
|
-
|
|
|
.breadcrumbs ul.list-inline.list-unstyled li.crumb-item {
|
|
|
position: relative;
|
|
|
padding-left: 0px;
|