|
@@ -1,62 +1,85 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="item-cmd_bx" @click="customNum(info.variety)">
|
|
|
|
|
- <view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
|
|
|
|
|
- <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="cmd-info_bx">
|
|
|
|
|
- <view class="tit" >
|
|
|
|
|
- <text style="font-size:20upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
|
|
|
|
|
- v-if="info.presell == 1">预售</text>
|
|
|
|
|
|
|
+ <view class="product-item">
|
|
|
|
|
+ <view class="item-cmd_bx" @click="customNum(info.variety)">
|
|
|
|
|
+ <view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
|
|
|
|
|
+ <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cmd-info_bx">
|
|
|
|
|
+ <view class="tit" >
|
|
|
|
|
+ <text style="font-size:20upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
|
|
|
|
|
+ v-if="info.presell == 1">预售</text>
|
|
|
|
|
|
|
|
- <text style="font-size:20upx;border:1upx solid red;color:white;background-color:red;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
|
|
|
|
|
- v-if="info.limitBuy > 0">限购{{ info.limitBuy }}份</text>
|
|
|
|
|
|
|
+ <text style="font-size:20upx;border:1upx solid red;color:white;background-color:red;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
|
|
|
|
|
+ v-if="info.limitBuy > 0">限购{{ info.limitBuy }}份</text>
|
|
|
|
|
|
|
|
- {{ info.name||''}}
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="kc num-open_bx flex-space">
|
|
|
|
|
- <view>
|
|
|
|
|
- <view class="flex-space" v-if="Number(info.discountPrice)>0" style="position:absolute;top:14upx;">
|
|
|
|
|
- <view style="padding:2upx 10upx 5upx 10upx;text-align: center;color: red;border: 1px solid red;margin-right: 20upx;line-height: 1;font-size: 20upx">
|
|
|
|
|
- {{parseFloat(((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1))+'折'}}
|
|
|
|
|
- </view>
|
|
|
|
|
- <text style="text-decoration:line-through;color:#A9A9A9">¥{{parseFloat(info.prePrice)}}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-space" style="color:#333333;position:absolute;top:13upx;" v-else>
|
|
|
|
|
- <block v-if="info.ratioType == 0">
|
|
|
|
|
- {{info.ratio}}{{info.smallUnit}}/{{info.bigUnit}}
|
|
|
|
|
- </block>
|
|
|
|
|
- <block v-else>
|
|
|
|
|
- 若干{{info.smallUnit}}/{{info.bigUnit}}
|
|
|
|
|
- </block>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="price" v-if="info.myLevel && info.myLevel == 2">
|
|
|
|
|
- <!--平潭满天星,不展示原价,比较特殊-->
|
|
|
|
|
- <text style="color:#a7a2a2;text-decoration:line-through;font-size:30upx;font-weight:bold;" v-if="Number(shopId)!=38322">¥{{parseFloat(info.defaultGradePrice) }}</text>
|
|
|
|
|
- <text style="font-weight:bold;margin-left:10upx;font-size:30upx;">会员¥{{ parseFloat(info.price) }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="price" style="font-weight:bold;font-size:30upx;" v-else>¥{{ info.price ? parseFloat(info.price) : 0 }}</view>
|
|
|
|
|
|
|
+ {{ info.name||''}}
|
|
|
</view>
|
|
</view>
|
|
|
- <view style="text-align: right" >
|
|
|
|
|
- <view class="open-bx" >
|
|
|
|
|
- <i class="iconfont iconjian" @click.stop="delEvent(info.variety)" v-if="bigCount > 0 || smallCount > 0"></i>
|
|
|
|
|
- <text class="num">
|
|
|
|
|
- <text v-if="bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ `${bigCount}` }}</text>
|
|
|
|
|
- <text v-if="smallCount > 0" >{{ `${smallCount}` }}</text>
|
|
|
|
|
- </text>
|
|
|
|
|
- <i class="iconfont iconzeng" @click.stop="addEvents(info.variety)"></i>
|
|
|
|
|
|
|
+ <view class="kc num-open_bx flex-space">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <view class="flex-space" v-if="Number(info.discountPrice)>0" style="position:absolute;top:14upx;">
|
|
|
|
|
+ <view style="padding:2upx 10upx 5upx 10upx;text-align: center;color: red;border: 1px solid red;margin-right: 20upx;line-height: 1;font-size: 20upx">
|
|
|
|
|
+ {{parseFloat(((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1))+'折'}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text style="text-decoration:line-through;color:#A9A9A9">¥{{parseFloat(info.prePrice)}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-space" style="color:#333333;position:absolute;top:13upx;" v-else>
|
|
|
|
|
+ <block v-if="info.ratioType == 0">
|
|
|
|
|
+ {{info.ratio}}{{info.smallUnit}}/{{info.bigUnit}}
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ 若干{{info.smallUnit}}/{{info.bigUnit}}
|
|
|
|
|
+ </block>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="price" v-if="info.myLevel && info.myLevel == 2">
|
|
|
|
|
+ <text style="color:#a7a2a2;text-decoration:line-through;font-size:30upx;font-weight:bold;" v-if="Number(shopId)!=38322">¥{{parseFloat(info.defaultGradePrice) }}</text>
|
|
|
|
|
+ <text style="font-weight:bold;margin-left:10upx;font-size:30upx;">会员¥{{ parseFloat(info.price) }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="price" style="font-weight:bold;font-size:30upx;" v-else>¥{{ info.price ? parseFloat(info.price) : 0 }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <stock v-if="showStock && showStock == '1'">
|
|
|
|
|
- <text v-if="Number(info.stock) > Number(info.stockWarning)" style="color:#333;margin-right:55upx;">还剩 {{ parseFloat(info.stock) }}</text>
|
|
|
|
|
- <text v-else style="color:red;font-weight:bold;margin-right:55upx;">还剩 {{ parseFloat(info.stock) }}</text>
|
|
|
|
|
- </stock>
|
|
|
|
|
- <stock v-else>
|
|
|
|
|
- <stock v-if="showSold && showSold == 1">
|
|
|
|
|
- <text style="color:#333;margin-right:55upx;">已售 {{ info.actualSold ? parseInt(info.actualSold):0 }}</text>
|
|
|
|
|
|
|
+ <view style="text-align: right" >
|
|
|
|
|
+ <view class="open-bx" >
|
|
|
|
|
+ <i class="iconfont iconjian" @click.stop="delEvent(info.variety)" v-if="bigCount > 0 || smallCount > 0"></i>
|
|
|
|
|
+ <text class="num">
|
|
|
|
|
+ <text v-if="bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ `${bigCount}` }}</text>
|
|
|
|
|
+ <text v-if="smallCount > 0" >{{ `${smallCount}` }}</text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ <i class="iconfont iconzeng" @click.stop="addEvents(info.variety)"></i>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <stock v-if="showStock && showStock == '1'">
|
|
|
|
|
+ <text v-if="Number(info.stock) > Number(info.stockWarning)" style="color:#333;margin-right:55upx;">还剩 {{ parseFloat(info.stock) }}</text>
|
|
|
|
|
+ <text v-else style="color:red;font-weight:bold;margin-right:55upx;">还剩 {{ parseFloat(info.stock) }}</text>
|
|
|
|
|
+ </stock>
|
|
|
|
|
+ <stock v-else>
|
|
|
|
|
+ <stock v-if="showSold && showSold == 1">
|
|
|
|
|
+ <text style="color:#333;margin-right:55upx;">已售 {{ info.actualSold ? parseInt(info.actualSold):0 }}</text>
|
|
|
|
|
+ </stock>
|
|
|
</stock>
|
|
</stock>
|
|
|
- </stock>
|
|
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="remark-bar" v-if="info.itemRemark" @click.stop>
|
|
|
|
|
+ <text class="remark-label">备注</text>
|
|
|
|
|
+ <text class="remark-text">{{ info.itemRemark }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="extra-line extra-line--middle" v-if="showMiddleExtra" @click.stop>
|
|
|
|
|
+ <text style="font-weight:bold;" v-if="Number(info.reachNum)>0">
|
|
|
|
|
+ 满{{info.reachNum}}扎,每扎优惠 ¥{{parseFloat(info.reachNumDiscount)}}<block v-if="info.presell == 0">(提交订单后优惠)</block>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ <block v-if="info.presell && info.presell == 1"><block v-if="Number(info.reachNum)>0">,</block>到货日期
|
|
|
|
|
+ <block v-if="!$util.isEmpty(info.presellDateShow)">
|
|
|
|
|
+ <text v-for="(dateItem, dateIndex) in info.presellDateShow" :key="dateIndex">{{dateItem}}<text v-if="dateIndex!=info.presellDateShow.length-1">,</text></text>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="extra-line" v-else-if="showMyStock" @click.stop>
|
|
|
|
|
+ <text v-if="info.myLack == 0" class="my-stock my-stock--ok">
|
|
|
|
|
+ 我剩{{info.myStock?info.myStock:0}}<text class="on-road" v-if="info.myOnStock>0">路上{{info.myOnStock?info.myOnStock:0}}</text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ <text v-else class="my-stock my-stock--lack">
|
|
|
|
|
+ 我剩{{info.myStock?info.myStock:0}}<text class="on-road" v-if="info.myOnStock>0">路上{{info.myOnStock?info.myOnStock:0}}</text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -97,6 +120,14 @@ export default {
|
|
|
default: false
|
|
default: false
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ showMiddleExtra() {
|
|
|
|
|
+ return this.info.presell == 1 || Number(this.info.reachNum) > 0;
|
|
|
|
|
+ },
|
|
|
|
|
+ showMyStock() {
|
|
|
|
|
+ return !this.showMiddleExtra && this.info.myDisplay == 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {}
|
|
return {}
|
|
|
},
|
|
},
|
|
@@ -106,13 +137,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
addEvents(variety) {
|
|
addEvents(variety) {
|
|
|
if(variety == 0){
|
|
if(variety == 0){
|
|
|
- const ratio = Number(this.info.ratio);
|
|
|
|
|
if(this.offVerifyRepertory){
|
|
if(this.offVerifyRepertory){
|
|
|
if(this.info.stock<=0){
|
|
if(this.info.stock<=0){
|
|
|
uni.showToast({title:'没有货了',icon:'none'})
|
|
uni.showToast({title:'没有货了',icon:'none'})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- //如果花材库存剩2.5扎时,一直点加号会显示210扎,暂时在这边限制只能下大单位,而且只能用>=限制才有效,用>无效。本来要在父方法里限制,未来再解决这个问题
|
|
|
|
|
if (Number(this.bigCount) >= Number(this.info.bigNum)) {
|
|
if (Number(this.bigCount) >= Number(this.info.bigNum)) {
|
|
|
this.$msg("库存只剩"+this.info.bigNum);
|
|
this.$msg("库存只剩"+this.info.bigNum);
|
|
|
return
|
|
return
|
|
@@ -120,7 +149,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.$emit("add", this.info);
|
|
this.$emit("add", this.info);
|
|
|
}else{
|
|
}else{
|
|
|
- //去特殊品种页
|
|
|
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -128,7 +156,6 @@ export default {
|
|
|
if(variety == 0){
|
|
if(variety == 0){
|
|
|
this.$emit("del", this.info);
|
|
this.$emit("del", this.info);
|
|
|
}else{
|
|
}else{
|
|
|
- //去特殊品种页
|
|
|
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -152,7 +179,6 @@ export default {
|
|
|
smallCount: this.smallCount
|
|
smallCount: this.smallCount
|
|
|
});
|
|
});
|
|
|
}else{
|
|
}else{
|
|
|
- //去特殊品种页
|
|
|
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
this.$emit("goToSpecialVariety", this.info);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -160,9 +186,63 @@ export default {
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.item-cmd_bx {
|
|
|
|
|
|
|
+.product-item {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
margin-bottom: 20upx;
|
|
margin-bottom: 20upx;
|
|
|
|
|
+}
|
|
|
|
|
+.remark-bar {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-top: 4upx;
|
|
|
|
|
+ padding: 6upx 10upx;
|
|
|
|
|
+ background: #fff8f2;
|
|
|
|
|
+ border-left: 5upx solid #ff8c3a;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+.remark-label {
|
|
|
|
|
+ font-size: 28upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: #ff8c3a;
|
|
|
|
|
+ line-height: 1.2;
|
|
|
|
|
+ margin-right: 10upx;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.remark-text {
|
|
|
|
|
+ font-size: 30upx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ color: #ff2842;
|
|
|
|
|
+ line-height: 1.3;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.extra-line {
|
|
|
|
|
+ margin-top: 8upx;
|
|
|
|
|
+ font-size: 24upx;
|
|
|
|
|
+ color: #3385ff;
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ word-wrap: break-word;
|
|
|
|
|
+ white-space: normal;
|
|
|
|
|
+}
|
|
|
|
|
+.extra-line--middle {
|
|
|
|
|
+ font-size: 26upx;
|
|
|
|
|
+}
|
|
|
|
|
+.my-stock--ok {
|
|
|
|
|
+ color: green;
|
|
|
|
|
+ font-weight: normal;
|
|
|
|
|
+}
|
|
|
|
|
+.my-stock--lack {
|
|
|
|
|
+ color: #3385ff;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+}
|
|
|
|
|
+.on-road {
|
|
|
|
|
+ margin-left: 9upx;
|
|
|
|
|
+}
|
|
|
|
|
+.item-cmd_bx {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
.img_bx {
|
|
.img_bx {
|
|
|
height: 140upx;
|
|
height: 140upx;
|
|
|
width: 140upx;
|
|
width: 140upx;
|
|
@@ -228,4 +308,4 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|