Browse Source

商品规格显示问题

home_hotList
whyneedname 2 years ago
parent
commit
c9b04ed404
  1. 8
      components/ProductWindow.vue
  2. 7
      pages/activity/GroupDetails/index.vue
  3. 7
      pages/activity/SeckillDetails/index.vue
  4. 8
      pages/shop/GoodsCon/index.vue
  5. 13
      pages/shop/IntegralGoodsCon/index.vue

8
components/ProductWindow.vue

@ -1,7 +1,7 @@
<template>
<view @touchmove.stop.prevent>
<view>
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''">
<view class="textpic acea-row row-between-wrapper">
<view class="textpic acea-row row-between-wrapper" @touchmove.stop.prevent>
<view class="pictrue">
<image @tap="previewImage" :src="attr.productSelect.image" class="image" />
</view>
@ -46,7 +46,7 @@
</view>
</view>
</view>
<view class="cart acea-row row-between-wrapper">
<view class="cart acea-row row-between-wrapper" @touchmove.stop.prevent>
<view class="">
<view class="title">¥{{ attr.productSelect.price }}</view>
<view >库存剩余{{ attr.productSelect.stock }}{{unitName}}</view>
@ -71,7 +71,7 @@
</view>
<view
class="mask"
@touchmove.prevent
@touchmove.stop.prevent
:hidden="attr.cartAttr === false"
@click="closeAttr"
></view>

7
pages/activity/GroupDetails/index.vue

@ -77,7 +77,7 @@
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>选规格</view>
<view class="acea-row attr-content">
<image v-if="item.image" :src="item.image" v-for="(item,index) in productValue" :key="index" mode="aspectFill"></image>
<image v-if="item.image" :src="item.image" v-for="(item,index) in attrImages" :key="index" mode="aspectFill"></image>
<view class="attrs">{{attr.productAttr[0].attrValueArr.length}}{{attr.productAttr[0].attrName}}可选</view>
<!-- <text>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text> -->
@ -310,6 +310,7 @@ export default {
groupList: {},
attrTxt: '请选择',
productValue: [],
attrImages: [],
attrValue: '',
swiperTip: {
direction: 'vertical',
@ -415,6 +416,10 @@ export default {
that.domStatus = true
console.log(this.storeInfo)
that.DefaultSelect()
for(let i in that.productValue) {
that.attrImages.push(that.productValue[i]);
if(that.attrImages.length == 2) return
}
})
},
DefaultSelect: function() {

7
pages/activity/SeckillDetails/index.vue

@ -78,7 +78,7 @@
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>选规格</view>
<view class="acea-row attr-content">
<image v-if="item.image" :src="item.image" v-for="(item,index) in productValue" :key="index" mode="aspectFill"></image>
<image v-if="item.image" :src="item.image" v-for="(item,index) in attrImages" :key="index" mode="aspectFill"></image>
<view class="attrs">{{attr.productAttr[0].attrValueArr.length}}{{attr.productAttr[0].attrName}}可选</view>
<!-- <text>{{ attrTxt }}</text> -->
<!-- <text class="atterTxt">{{ attrValue }}</text> -->
@ -243,6 +243,7 @@ export default {
cartNum: 1,
attrTxt: '请选择',
productValue: [],
attrImages: [],
attrValue: '',
attr: {
cartAttr: false,
@ -340,6 +341,10 @@ export default {
// that.setProductSelect();
that.domStatus = true
that.DefaultSelect()
for(let i in that.productValue) {
that.attrImages.push(that.productValue[i]);
if(that.attrImages.length == 2) return
}
})
},
updateTitle() {

8
pages/shop/GoodsCon/index.vue

@ -87,8 +87,7 @@
<view>选规格</view>
<view class="acea-row attr-content">
<!-- <text>{{ attrTxt }}</text> -->
<image v-if="item.image" :src="item.image" v-for="(item,index) in productValue" :key="index"
mode="aspectFill"></image>
<image v-if="item.image" :src="item.image" v-for="(item,index) in attrImages" :key="index" mode="aspectFill"></image>
<view class="attrs">
{{attr.productAttr[0].attrValueArr.length}}{{attr.productAttr.length == 1?attr.productAttr[0].attrName:attr.productAttr[0].attrValueArr.length == 1?attr.productAttr[1].attrName:attr.productAttr[0].attrName}}可选
</view>
@ -379,6 +378,7 @@
},
isOpen: false, //
productValue: [],
attrImages: [],
id: 0,
storeInfo: {},
couponList: [],
@ -609,6 +609,10 @@
that.updateTitle()
that.DefaultSelect()
that.getCartCount()
for(let i in that.productValue) {
that.attrImages.push(that.productValue[i]);
if(that.attrImages.length == 2) return
}
})
.catch(err => {
uni.showToast({

13
pages/shop/IntegralGoodsCon/index.vue

@ -34,8 +34,8 @@
<!-- 规格 -->
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>选规格</view>
<view class="acea-row attr-content">
<image v-if="item.image" :src="item.image" v-for="(item,index) in productValue" :key="index" mode="aspectFill"></image>
<view class="acea-row attr-content">
<image v-if="item.image" :src="item.image" v-for="(item,index) in attrImages" :key="index" mode="aspectFill"></image>
<view class="attrs">{{attr.productAttr[0].attrValueArr.length}}{{attr.productAttr.length == 1?attr.productAttr[0].attrName:attr.productAttr[0].attrValueArr.length == 1?attr.productAttr[1].attrName:attr.productAttr[0].attrName}}可选</view>
<!-- <text>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text> -->
@ -150,7 +150,8 @@ export default {
productSelect: {},
},
isOpen: false, //
productValue: [],
productValue: [],
attrImages: [],
id: 0,
storeInfo: {},
couponList: [],
@ -346,7 +347,11 @@ export default {
that.$set(that, 'goodList', goodArray)
that.updateTitle()
that.DefaultSelect()
that.getCartCount()
that.getCartCount()
for(let i in that.productValue) {
that.attrImages.push(that.productValue[i]);
if(that.attrImages.length == 2) return
}
})
.catch(err => {
uni.showToast({

Loading…
Cancel
Save