|
|
@@ -149,7 +149,7 @@
|
|
|
|
|
|
<!-- 规格 -->
|
|
|
<view class="spec-box">
|
|
|
- <view v-for="(item,index) in attrs" :key="index">
|
|
|
+ <view v-for="(item,index) in attrs" :key="item.id">
|
|
|
<view class="title">{{item.attrName}}</view>
|
|
|
<view class="spec-list">
|
|
|
<view v-for="(subItem,subindex) in item.values" :key="subindex"
|
|
|
@@ -438,7 +438,7 @@ import CustomToast from '@/components/custom-toast.vue';
|
|
|
this.loadding = false
|
|
|
if (res.code == 200) {
|
|
|
this.product = res.product;
|
|
|
- this.remainingPurchaseLimit = res.remainingPurchaseLimit;
|
|
|
+ this.remainingPurchaseLimit = res.product.purchaseLimit;
|
|
|
this.singlePurchaseLimit = res.product.singlePurchaseLimit!==0?res.product.singlePurchaseLimit:null
|
|
|
// 如果接口返回了总限购数量和已购买数量,也保存
|
|
|
if (res.product.purchaseLimit !== null) {
|
|
|
@@ -550,8 +550,9 @@ import CustomToast from '@/components/custom-toast.vue';
|
|
|
},
|
|
|
// 规格选择
|
|
|
choseSpec(index, subIndex) {
|
|
|
- this.attrs[index].index = subIndex;
|
|
|
- this.$forceUpdate();
|
|
|
+ // this.attrs[index].index = subIndex;
|
|
|
+ this.$set(this.attrs[index], 'index', subIndex);
|
|
|
+ // this.$forceUpdate();
|
|
|
let productAttr = this.attrs;
|
|
|
let values = [];
|
|
|
for (let i = 0; i < productAttr.length; i++) {
|