价格 数量修改
This commit is contained in:
parent
fdd60d7eb1
commit
1bc054be5d
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view :style="viewColor">
|
<view :style="viewColor">
|
||||||
<view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')">
|
<view class="product-window"
|
||||||
|
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')">
|
||||||
<view class="textpic acea-row row-between-wrapper">
|
<view class="textpic acea-row row-between-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
|
<image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
|
||||||
|
@ -13,7 +14,8 @@
|
||||||
<view>
|
<view>
|
||||||
预售价
|
预售价
|
||||||
¥<text class="num">{{ attr.productSelect.price }}</text>
|
¥<text class="num">{{ attr.productSelect.price }}</text>
|
||||||
<text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></text>
|
<text v-if="presell_type === 2">定金¥<text
|
||||||
|
class="num">{{ attr.productSelect.down_price }}</text></text>
|
||||||
</view>
|
</view>
|
||||||
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
|
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
|
||||||
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
|
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
|
||||||
|
@ -42,8 +44,8 @@
|
||||||
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
||||||
<view class="title">{{ item.attr_name }}</view>
|
<view class="title">{{ item.attr_name }}</view>
|
||||||
<view class="listn acea-row row-middle">
|
<view class="listn acea-row row-middle">
|
||||||
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value"
|
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
|
||||||
@click="tapAttr(indexw, indexn)" :key="indexn">
|
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn">
|
||||||
{{ itemn.attr }}
|
{{ itemn.attr }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -53,25 +55,29 @@
|
||||||
<view class="title">数量</view>
|
<view class="title">数量</view>
|
||||||
<view class="carnum acea-row row-left">
|
<view class="carnum acea-row row-left">
|
||||||
<view class="buy_limit" v-if="minCount>0 || maxCount>0">
|
<view class="buy_limit" v-if="minCount>0 || maxCount>0">
|
||||||
(<text v-if="minCount>0">{{minCount}}件起购<text v-if="minCount>0 && maxCount>0">,</text></text><text v-if="maxCount>0">最多{{maxCount}}件</text>)
|
(<text v-if="minCount>0">{{minCount}}件起购<text
|
||||||
|
v-if="minCount>0 && maxCount>0">,</text></text><text
|
||||||
|
v-if="maxCount>0">最多{{maxCount}}件</text>)
|
||||||
</view>
|
</view>
|
||||||
<view class="item reduce" :class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes">
|
<view class="item reduce" :class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes">
|
||||||
-
|
-
|
||||||
</view>
|
</view>
|
||||||
<view class='item num'>
|
<view class='item num'>
|
||||||
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" @input="bindCode(attr.productSelect.cart_num)" @keydown="btKeyDown" @keyup="btKeyUp"></input>
|
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num"
|
||||||
|
@input="bindCode(attr.productSelect.cart_num)" @keydown="btKeyDown"
|
||||||
|
@keyup="btKeyUp"></input>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="iSplus" class="item plus" :class=" attr.productSelect.cart_num >= attr.productSelect.stock || destri ? 'on' : ''"
|
<view v-if="iSplus" class="item plus"
|
||||||
@click="CartNumAdd">+</view>
|
:class=" attr.productSelect.cart_num >= attr.productSelect.stock || destri ? 'on' : ''"
|
||||||
|
@click="CartNumAdd">+</view>
|
||||||
<view v-else class='item plus' :class='(attr.productSelect.cart_num >= attr.productSelect.quota_show)
|
<view v-else class='item plus' :class='(attr.productSelect.cart_num >= attr.productSelect.quota_show)
|
||||||
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock)? "on":""'
|
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock)? "on":""' @click='CartNumAdd'>+
|
||||||
@click='CartNumAdd'>+</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
|
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
|
||||||
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
|
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
|
||||||
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0"
|
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0" @click="goCat">我要参团</view>
|
||||||
@click="goCat">我要参团</view>
|
|
||||||
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
|
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||||
|
@ -88,7 +94,9 @@
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
attr: {
|
attr: {
|
||||||
|
@ -144,11 +152,10 @@
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted() {},
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 查看大图
|
// 查看大图
|
||||||
loookImg(){
|
loookImg() {
|
||||||
let self = this
|
let self = this
|
||||||
let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image]
|
let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image]
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
|
@ -167,10 +174,11 @@
|
||||||
this.$emit('iptCartNum', num);
|
this.$emit('iptCartNum', num);
|
||||||
},
|
},
|
||||||
btKeyDown(e) {
|
btKeyDown(e) {
|
||||||
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,"");
|
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, "");
|
||||||
},
|
},
|
||||||
btKeyUp(e) {
|
btKeyUp(e) {
|
||||||
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g,"")
|
e.target.value = e.target.value.replace(
|
||||||
|
/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, "")
|
||||||
},
|
},
|
||||||
closeAttr: function() {
|
closeAttr: function() {
|
||||||
this.$emit('myevent');
|
this.$emit('myevent');
|
||||||
|
@ -226,77 +234,95 @@
|
||||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||||
transform: translate3d(0, 100%, 0);
|
transform: translate3d(0, 100%, 0);
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||||
|
|
||||||
&.presell-window {
|
&.presell-window {
|
||||||
padding-bottom: 200rpx;
|
padding-bottom: 200rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window.on {
|
.product-window.on {
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window.join {
|
.product-window.join {
|
||||||
padding-bottom: 30rpx;
|
padding-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic {
|
.product-window .textpic {
|
||||||
padding: 0 80rpx 0 30rpx;
|
padding: 0 80rpx 0 30rpx;
|
||||||
margin-top: 29rpx;
|
margin-top: 29rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .pictrue {
|
.product-window .textpic .pictrue {
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .pictrue image {
|
.product-window .textpic .pictrue image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text {
|
.product-window .textpic .text {
|
||||||
width: 460rpx;
|
width: 460rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #202020;
|
color: #202020;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money {
|
.product-window .textpic .text .money {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 26rpx;
|
margin-top: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--view-priceColor);
|
color: var(--view-priceColor);
|
||||||
}
|
}
|
||||||
.product-window .stock_count{
|
|
||||||
|
.product-window .stock_count {
|
||||||
margin-top: 5rpx;
|
margin-top: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .num {
|
.product-window .textpic .text .money .num {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .stock {
|
.product-window .textpic .text .money .stock {
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-left: 18rpx;
|
margin-left: 18rpx;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .presell_price {
|
.product-window .textpic .text .presell_price {
|
||||||
color: #FF7F00;
|
color: #FF7F00;
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stock {
|
.stock {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-money {
|
.vip-money {
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
margin-left: 6rpx;
|
margin-left: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vipImg {
|
.vipImg {
|
||||||
width: 65rpx;
|
width: 65rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
margin-left: 4rpx;
|
margin-left: 4rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .iconfont {
|
.product-window .textpic .iconfont {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
|
@ -304,22 +330,27 @@
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
color: #8a8a8a;
|
color: #8a8a8a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList {
|
.product-window .productWinList {
|
||||||
max-height: 395rpx;
|
max-height: 395rpx;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item~.item {
|
.product-window .productWinList .item~.item {
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .title {
|
.product-window .productWinList .item .title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn {
|
.product-window .productWinList .item .listn {
|
||||||
padding: 0 30rpx 0 16rpx;
|
padding: 0 30rpx 0 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn .itemn {
|
.product-window .productWinList .item .listn .itemn {
|
||||||
border: 1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
@ -328,11 +359,13 @@
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
margin: 14rpx 0 0 14rpx;
|
margin: 14rpx 0 0 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn .itemn.on {
|
.product-window .productWinList .item .listn .itemn.on {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: var(--view-theme);
|
background-color: var(--view-theme);
|
||||||
border-color: var(--view-theme);
|
border-color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart {
|
.product-window .cart {
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
|
@ -345,22 +378,26 @@
|
||||||
-ms-flex-pack: justify;
|
-ms-flex-pack: justify;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .title {
|
.product-window .cart .title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
line-height: 54rpx;
|
line-height: 54rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum {
|
.product-window .cart .carnum {
|
||||||
height: 54rpx;
|
height: 54rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .buy_limit {
|
.product-window .cart .carnum .buy_limit {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .item {
|
.product-window .cart .carnum .item {
|
||||||
|
|
||||||
width: 63rpx;
|
width: 63rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -368,8 +405,9 @@
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .reduce {
|
.product-window .cart .carnum .reduce {
|
||||||
border: 1px solid #a4a4a4;
|
border: 1px solid #a4a4a4;
|
||||||
width: 44rpx;
|
width: 44rpx;
|
||||||
|
@ -377,12 +415,14 @@
|
||||||
// border-right: 0;
|
// border-right: 0;
|
||||||
border-radius: 0 7rpx 7rpx 0;
|
border-radius: 0 7rpx 7rpx 0;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .reduce.on {
|
.product-window .cart .carnum .reduce.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .plus {
|
.product-window .cart .carnum .plus {
|
||||||
border: 1px solid #a4a4a4;
|
border: 1px solid #a4a4a4;
|
||||||
width: 44rpx;
|
width: 44rpx;
|
||||||
|
@ -391,14 +431,17 @@
|
||||||
border-radius: 0 7rpx 7rpx 0;
|
border-radius: 0 7rpx 7rpx 0;
|
||||||
line-height: 30rpx
|
line-height: 30rpx
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .plus.on {
|
.product-window .cart .carnum .plus.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .num {
|
.product-window .cart .carnum .num {
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .joinBnt {
|
.product-window .joinBnt {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
width: 620rpx;
|
width: 620rpx;
|
||||||
|
@ -408,12 +451,14 @@
|
||||||
line-height: 86rpx;
|
line-height: 86rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 21rpx auto 0 auto;
|
margin: 21rpx auto 0 auto;
|
||||||
&.b-color{
|
|
||||||
|
&.b-color {
|
||||||
background-color: var(--view-theme);
|
background-color: var(--view-theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .joinBnt.on {
|
.product-window .joinBnt.on {
|
||||||
background-color: #bbb;
|
background-color: #bbb;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -356,8 +356,9 @@
|
||||||
<view style='height:120rpx;'></view>
|
<view style='height:120rpx;'></view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 组件 -->
|
<!-- 组件 -->
|
||||||
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
<productWindow :attr="attr" :image="image" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
||||||
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'>
|
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'>
|
||||||
</productWindow>
|
</productWindow>
|
||||||
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
|
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
|
||||||
|
@ -488,7 +489,8 @@
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
preview_key: '',
|
preview_key: '',
|
||||||
comForm: '', // 页面打开的途径,admin代表时后台的预览
|
comForm: '', // 页面打开的途径,admin代表时后台的预览
|
||||||
product_attribute: {}
|
product_attribute: {},
|
||||||
|
image: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: configMap(['hide_mer_status'], mapGetters(['isLogin', 'uid'])),
|
computed: configMap(['hide_mer_status'], mapGetters(['isLogin', 'uid'])),
|
||||||
|
@ -753,7 +755,11 @@
|
||||||
getPreviewProDetail(params).then(res => {
|
getPreviewProDetail(params).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
let storeInfo = res.data;
|
let storeInfo = res.data;
|
||||||
this.product_attribute = res.data.product_attribute
|
// this.product_attribute = res.data.product_attribute
|
||||||
|
|
||||||
|
console.log(res.data.product_attribute);
|
||||||
|
this.image = res.data.image;
|
||||||
|
|
||||||
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
|
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
|
||||||
this.videoCoverImg = storeInfo.slider_image[0]
|
this.videoCoverImg = storeInfo.slider_image[0]
|
||||||
storeInfo.slider_image.splice(0, 1)
|
storeInfo.slider_image.splice(0, 1)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item label="商品主图" prop="formData.imageList" ref="item1" required>
|
<u-form-item label="商品主图" prop="formData.imageList" ref="item1" required>
|
||||||
<text style="color: #E18C34;font-size: 24rpx">上传时应注重真实性、清晰度</text>
|
<text style="color: #E18C34;font-size: 24rpx">上传时应注重真实性、清晰度、至少上传两张</text>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
|
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
|
||||||
<view class="" style="display: flex;flex-wrap: wrap;">
|
<view class="" style="display: flex;flex-wrap: wrap;">
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
{{item.store_name}}
|
{{item.store_name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="margin-top: 10rpx;font-size: 24rpx;color: #989898;">
|
<view class="" style="margin-top: 10rpx;font-size: 24rpx;color: #989898;">
|
||||||
库存: {{item.attrValue[0].stock}}
|
库存: {{ item.attrValue | stockCount}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
style="font-size: 22rpx;">¥</text><text>{{item.attrValue[0].price}}</text><text
|
style="font-size: 22rpx;">¥</text><text>{{item.attrValue[0].price}}</text><text
|
||||||
style="color: #828282;">/{{item.attrValue[0].unit_name}}</text>
|
style="color: #828282;">/{{item.attrValue[0].unit_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="" style="color: #FC452F;font-size: 24rpx;" v-if='isWholeSale'>
|
<view class="" style="color: #FC452F;font-size: 24rpx;" v-if='isWholeSale'>
|
||||||
<text style="color:#989898">批发:</text> <text
|
<text style="color:#989898">批发:</text> <text
|
||||||
style="font-size: 22rpx;">¥</text><text>{{item.attrValue[0].wholesale_price}}</text><text
|
style="font-size: 22rpx;">¥</text><text>{{item.attrValue[0].wholesale_price}}</text><text
|
||||||
|
@ -260,6 +261,11 @@
|
||||||
components: {
|
components: {
|
||||||
Loading,
|
Loading,
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
stockCount(value) {
|
||||||
|
return value.reduce((prev, next) => prev + next.stock, 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
newUser: false,
|
newUser: false,
|
||||||
|
|
|
@ -16,11 +16,12 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="font-size: 24rpx;color: #989898;margin-top: 10rpx;">
|
<view class="" style="font-size: 24rpx;color: #989898;margin-top: 10rpx;">
|
||||||
<!-- 库存: {{short.attrValue[0].stock}}个 -->
|
<!-- 库存: {{short.attrValue[0].stock}}个 -->
|
||||||
库存: {{attrvalueStock}}个
|
库存: {{attrvalueStock}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="color: #FC452F;font-size: 24rpx;">
|
<view class="" style="color: #FC452F;font-size: 24rpx;">
|
||||||
<text style="font-size: 22rpx;">¥</text><text>10.00</text><text style="color: #828282;">/个</text>
|
<text style="font-size: 22rpx;">¥</text><text>10.00</text><text
|
||||||
|
style="color: #828282;">/{{short.attrValue && short.attrValue[0].unit_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -128,10 +129,8 @@
|
||||||
initInfo() {
|
initInfo() {
|
||||||
productDetail(this.mer_id, this.short.product_id).then((res) => {
|
productDetail(this.mer_id, this.short.product_id).then((res) => {
|
||||||
this.short = res.data;
|
this.short = res.data;
|
||||||
this.attrvalueStock = res.data.attrValue[0].stock
|
// 总库存
|
||||||
console.log({
|
this.attrvalueStock = res.data.attrValue.reduce((prev, next) => prev + next.stock, 0);
|
||||||
...res.data
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onUpdate() {
|
onUpdate() {
|
||||||
|
|
|
@ -227,7 +227,7 @@
|
||||||
color: #666666;
|
color: #666666;
|
||||||
|
|
||||||
.audit-info-txt {
|
.audit-info-txt {
|
||||||
word-break: break-all;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue