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

7
pages/activity/GroupDetails/index.vue

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

7
pages/activity/SeckillDetails/index.vue

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

8
pages/shop/GoodsCon/index.vue

@ -87,8 +87,7 @@
<view>选规格</view> <view>选规格</view>
<view class="acea-row attr-content"> <view class="acea-row attr-content">
<!-- <text>{{ attrTxt }}</text> --> <!-- <text>{{ attrTxt }}</text> -->
<image v-if="item.image" :src="item.image" v-for="(item,index) in productValue" :key="index" <image v-if="item.image" :src="item.image" v-for="(item,index) in attrImages" :key="index" mode="aspectFill"></image>
mode="aspectFill"></image>
<view class="attrs"> <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}}可选 {{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> </view>
@ -379,6 +378,7 @@
}, },
isOpen: false, // isOpen: false, //
productValue: [], productValue: [],
attrImages: [],
id: 0, id: 0,
storeInfo: {}, storeInfo: {},
couponList: [], couponList: [],
@ -609,6 +609,10 @@
that.updateTitle() that.updateTitle()
that.DefaultSelect() 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 => { .catch(err => {
uni.showToast({ uni.showToast({

13
pages/shop/IntegralGoodsCon/index.vue

@ -34,8 +34,8 @@
<!-- 规格 --> <!-- 规格 -->
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap"> <view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>选规格</view> <view>选规格</view>
<view class="acea-row attr-content"> <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.length == 1?attr.productAttr[0].attrName:attr.productAttr[0].attrValueArr.length == 1?attr.productAttr[1].attrName:attr.productAttr[0].attrName}}可选</view> <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>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text> --> <text class="atterTxt">{{ attrValue }}</text> -->
@ -150,7 +150,8 @@ export default {
productSelect: {}, productSelect: {},
}, },
isOpen: false, // isOpen: false, //
productValue: [], productValue: [],
attrImages: [],
id: 0, id: 0,
storeInfo: {}, storeInfo: {},
couponList: [], couponList: [],
@ -346,7 +347,11 @@ export default {
that.$set(that, 'goodList', goodArray) that.$set(that, 'goodList', goodArray)
that.updateTitle() that.updateTitle()
that.DefaultSelect() 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 => { .catch(err => {
uni.showToast({ uni.showToast({

Loading…
Cancel
Save