|
|
@@ -103,19 +103,20 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="detail.goods_attr_list.length > 0">
|
|
|
+ <view v-if="detail.goods_spec_list.length > 0">
|
|
|
<view class="goods_spec">
|
|
|
<text>{{detail.goods_attr}}</text>
|
|
|
</view>
|
|
|
<view class="goods_spec_list">
|
|
|
<view class="goods_spec_list_item"
|
|
|
- v-for="(item,index) in detail.goods_attr_list" :key="index"
|
|
|
+ v-for="(item,index) in detail.goods_spec_list[goodsSpecIndex].attr_list" :key="index"
|
|
|
:class="goodsAttrIndex == index ? 'goods_spec_list_item_active' : ''"
|
|
|
@click="goodsAttrChange(item,index)">
|
|
|
<span>{{item.attr_name}}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
<checkbox-group class="flex_r flex_ac flex_jc" @change="checkboxChange">
|
|
|
<label class="option_box">
|
|
|
@@ -200,7 +201,7 @@ export default {
|
|
|
detail: {
|
|
|
goods: {},
|
|
|
goods_spec_list: [],
|
|
|
- goods_attr_list: [],
|
|
|
+
|
|
|
}, // 商品详情
|
|
|
checked: false, //是否选中协议
|
|
|
buyNum: 1, //购买数量
|
|
|
@@ -242,10 +243,12 @@ export default {
|
|
|
this.detail.goods_img = imgs;
|
|
|
if (this.detail.goods_spec_list.length > 0) {
|
|
|
this.specId = this.detail.goods_spec_list[0].id
|
|
|
+
|
|
|
+ if (this.detail.goods_spec_list[0].attr_list.length > 0) {
|
|
|
+ this.attrId = this.detail.goods_spec_list[0].attr_list[0].id
|
|
|
+ }
|
|
|
}
|
|
|
- if (this.detail.goods_attr_list.length > 0) {
|
|
|
- this.attrId = this.detail.goods_attr_list[0].id
|
|
|
- }
|
|
|
+
|
|
|
this.getPrice()
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
@@ -376,6 +379,12 @@ export default {
|
|
|
goodsSpecChange(item,index){
|
|
|
this.goodsSpecIndex = index;
|
|
|
this.specId = item.id
|
|
|
+ this.goodsAttrIndex = 0
|
|
|
+ if(this.detail.goods_spec_list[this.goodsSpecIndex].attr_list.length > 0){
|
|
|
+ this.attrId = this.detail.goods_spec_list[this.goodsSpecIndex].attr_list[0].id
|
|
|
+ }else{
|
|
|
+ this.attrId = "0"
|
|
|
+ }
|
|
|
this.getPrice()
|
|
|
},
|
|
|
goodsAttrChange(item,index){
|