Browse Source

修改商品规格选择错乱的问题

master
gaoxs 5 years ago
parent
commit
5093e5a76c
  1. 5
      components/ProductWindow.vue
  2. 8
      components/UserEvaluation.vue
  3. 5
      pages/shop/GoodsCon/index.vue

5
components/ProductWindow.vue

@ -66,6 +66,7 @@ export default {
return {};
},
mounted: function() {
console.log(this);
},
methods: {
closeAttr: function() {
@ -81,7 +82,8 @@ export default {
//
// H5attrH5
// props
// this.attr.productAttr[res.indexw].index = res.indexn;
//
this.attr.productAttr[indexw].index = indexn;
let that = this;
let value = that
.getCheckedValue()
@ -100,6 +102,7 @@ export default {
getCheckedValue: function() {
let productAttr = this.attr.productAttr;
let value = [];
console.log(productAttr)
for (let i = 0; i < productAttr.length; i++) {
for (let j = 0; j < productAttr[i].attrValueArr.length; j++) {
if (productAttr[i].index === j) {

8
components/UserEvaluation.vue

@ -10,7 +10,7 @@
<view class="start" :class="'star' + item.star"></view>
</view>
</view>
<view class="time">{{ item.add_time }} {{ item.suk }}</view>
<view class="time">{{ dataFormat(item.addTime) }} {{ item.suk }}</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
@ -26,6 +26,8 @@
</view>
</template>
<script>
import { dataFormat } from "@/utils";
export default {
name: "UserEvaluation",
props: {
@ -38,6 +40,8 @@ export default {
return {};
},
mounted: function() {},
methods: {}
methods: {
dataFormat,
}
};
</script>

5
pages/shop/GoodsCon/index.vue

@ -330,6 +330,7 @@ export default {
getProductDetail(that.id, form)
.then(res => {
that.$set(that, "storeInfo", res.data.storeInfo);
// attr attr
that.$set(that.attr, "productAttr", res.data.productAttr);
that.$set(that, "productValue", res.data.productValue);
that.$set(that, "replyCount", res.data.replyCount);
@ -496,11 +497,15 @@ export default {
this.isOpen = true;
},
changeattr: function(msg) {
//
console.log(msg)
this.attr.cartAttr = msg;
this.isOpen = false;
},
//
ChangeAttr: function(res) {
//
console.log(res)
let productSelect = this.productValue[res.value];
if (productSelect) {
this.attr.productAttr[res.indexw].index = res.indexn;

Loading…
Cancel
Save