|
@@ -9,10 +9,13 @@
|
|
|
<view class="shoptitle">
|
|
|
<!--选择商店的全部商品"-->
|
|
|
<view class="checkbox-box" @click.stop="checkShop(item)">
|
|
|
- <button class="checkbox iconfont"
|
|
|
+ <view class="checkbox iconfont"
|
|
|
:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"
|
|
|
:disabled="item.isDisabled && !isshowDelbtn">
|
|
|
- </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.promotions" class="floor-item-act">
|
|
|
+ <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
|
</view>
|
|
|
<view class="text">{{item.name}}</view>
|
|
|
</view>
|
|
@@ -20,34 +23,46 @@
|
|
|
<view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
|
|
|
<view class="goods-pros-t">
|
|
|
<!--选择商品-->
|
|
|
- <view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
|
|
|
- <button class="checkbox iconfont"
|
|
|
- :disabled="pros.validFlag == '3' && !isshowDelbtn"
|
|
|
- :class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
|
|
|
- </button>
|
|
|
+ <view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == 3 && !isshowDelbtn ?'disabled' : '']">
|
|
|
+ <view class="checkbox iconfont"
|
|
|
+ :disabled="pros.validFlag == 3 && !isshowDelbtn"
|
|
|
+ :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.image ? pros.image:''" alt="" /></view>
|
|
|
<view class="pros-product">
|
|
|
<view class="producttitle" @click.stop="navToListPage(pros.productId)" >
|
|
|
- <text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
|
|
|
+ <text v-if="pros.validFlag == 3" class="no-text">商品已下架</text>{{pros.name}}
|
|
|
</view>
|
|
|
<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
|
|
|
<view class="productprice">
|
|
|
<!--使用过滤器对总价改变-->
|
|
|
- <view class="price" :class="[pros.validFlag == '3' ?'disabled' : '']">
|
|
|
- <text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
|
|
|
+ <view class="price" :class="[pros.validFlag == 3 || pros.promotions.type == 1 && pros.promotions.mode == 1 ?'disabled' : '']">
|
|
|
+ <text :class="[pros.validFlag == 3 || pros.promotions.type == 1 && pros.promotions.mode == 1 ?'disabled' : 'money-sign']">¥</text>
|
|
|
{{pros.price | NumFormat}}
|
|
|
</view>
|
|
|
- <view class="count" v-if="pros.validFlag == '2'" :class="[isshowDelbtn ? 'none':'show']">
|
|
|
+ <view class="count" v-if="pros.validFlag == 2" :class="[isshowDelbtn ? 'none':'show']">
|
|
|
<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
|
|
|
<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
|
|
|
<view class="number-box">
|
|
|
- <view class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
|
|
|
+ <view class="iconfont icon-jianhao" :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountSub(item,pros)"></view>
|
|
|
<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
|
|
|
- <view class="iconfont icon-jiahao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
|
|
|
+ <view class="iconfont icon-jiahao" :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-show="pros.actStatus==1" class="floor-item-act">
|
|
|
+ <view v-if="pros.promotions.type == 1 && pros.promotions.mode == 1" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
|
|
|
+ {{pros.promotions.name}}
|
|
|
+ <text v-if ="pros.promotions!=null">
|
|
|
+ :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
|
|
|
+ <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -72,7 +87,7 @@
|
|
|
</button>
|
|
|
</view>
|
|
|
<view class="pros-img">
|
|
|
- <image :src="failure.mainImage ? failure.mainImage:''" alt="" />
|
|
|
+ <image :src="failure.image ? failure.image:''" alt="" />
|
|
|
<text class="img-tip">失效</text>
|
|
|
</view>
|
|
|
<view class="pros-product">
|
|
@@ -96,7 +111,16 @@
|
|
|
<view class="foot-check-delbtn">
|
|
|
<button class="delBtn" @tap.stop="showDelManager">删除</button>
|
|
|
</view>
|
|
|
- <view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
|
|
|
+ <view class="sum">
|
|
|
+ <view class="sum-none" v-if="reducedPrice>0">
|
|
|
+ <text class="money-sign">¥</text>
|
|
|
+ <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
|
|
|
+ <text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
|
|
|
+ </view>
|
|
|
+ <view class="sum-price">
|
|
|
+ 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view v-if="!isshowDelbtn" class="footer-ri" >
|
|
|
<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
|
|
@@ -115,6 +139,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 促销活动弹窗 -->
|
|
|
+ <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
|
|
|
<!-- 透明模态层 -->
|
|
|
<modal-layer v-if='modallayer'></modal-layer>
|
|
|
</view>
|
|
@@ -124,6 +150,7 @@
|
|
|
import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
|
|
|
import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
|
|
|
import tuiNomore from "@/components/tui-components/nomore/nomore"
|
|
|
+ import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
|
|
|
import modalLayer from "@/components/modal-layer"
|
|
|
import { mapState,mapMutations } from 'vuex';
|
|
|
|
|
@@ -132,6 +159,7 @@
|
|
|
tuiSkeleton,
|
|
|
tuiLoadmore,
|
|
|
tuiNomore,
|
|
|
+ activiPopup,
|
|
|
modalLayer
|
|
|
},
|
|
|
data(){
|
|
@@ -141,12 +169,16 @@
|
|
|
userID:'',
|
|
|
alertType:'',
|
|
|
isStock:'',
|
|
|
+ popupShow:false,
|
|
|
+ handlerPros:{},//监听单挑促销商品
|
|
|
failureList:[], //失效商品列表
|
|
|
goodsList:[], //购物车的商品
|
|
|
delGoodsList:'',//要删除的商品
|
|
|
setGoodData:'', //确认订单的商品
|
|
|
isCheckAll:false,//是否全选
|
|
|
allPrice:0,//所有价格
|
|
|
+ totalOriginalPrice:0,//所有原价价
|
|
|
+ reducedPrice:0,//满减
|
|
|
allCount:0,//被选中的产品数量
|
|
|
isNnder:true,
|
|
|
isModallayer:false,
|
|
@@ -198,6 +230,10 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ clickPopupShow(pros,type){
|
|
|
+ this.popupShow = true;
|
|
|
+ this.handlerPros = pros;
|
|
|
+ },
|
|
|
setScrollHeight() {
|
|
|
// 窗口高度-footer高度
|
|
|
const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
|
|
@@ -232,7 +268,7 @@
|
|
|
pros.shopID = item.shopID;
|
|
|
pros.isStep = false
|
|
|
pros.productsChecked = false
|
|
|
- if(pros.validFlag == '3' ) {invalidLength++;}
|
|
|
+ if(pros.validFlag == 3 ) {invalidLength++;}
|
|
|
if(pros.step === 2){
|
|
|
if(pros.number % pros.min != 0){
|
|
|
pros.number = pros.min
|
|
@@ -247,10 +283,10 @@
|
|
|
} else {
|
|
|
this.goodsList = [];
|
|
|
}
|
|
|
- if( responseData.failureList && responseData.failureList.length > 0){
|
|
|
+ if( data.invalid && data.invalid.length > 0){
|
|
|
let newFailureList = [],isFailureLayer;
|
|
|
- responseData.failureList.forEach((failure,index) => {
|
|
|
- if(failure.failureState == 1 || failure.failureState == 2) {
|
|
|
+ data.invalid.forEach((failure,index) => {
|
|
|
+ if(failure.status == 1 || failure.status == 2) {
|
|
|
isFailureLayer = true
|
|
|
}else{
|
|
|
isFailureLayer = false
|
|
@@ -274,6 +310,7 @@
|
|
|
console.log(pro.productsChecked)
|
|
|
this.updateProductCheckedAllBtn(item);
|
|
|
this.updateCheckAllBtn();
|
|
|
+
|
|
|
},
|
|
|
updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
|
|
|
let productsList = item.cartList,
|
|
@@ -287,10 +324,10 @@
|
|
|
})
|
|
|
} else {
|
|
|
productsList.forEach(pros => {
|
|
|
- if(pros.productsChecked && pros.validFlag != '3') {
|
|
|
+ if(pros.productsChecked && pros.validFlag != 3) {
|
|
|
productsCheckedLength++;
|
|
|
}
|
|
|
- if(pros.validFlag == '3') {disabledLength++;}
|
|
|
+ if(pros.validFlag == 3) {disabledLength++;}
|
|
|
})
|
|
|
}
|
|
|
item.checked = productsCheckedLength === productsList.length - disabledLength;
|
|
@@ -321,10 +358,9 @@
|
|
|
this.updateCheckAllBtn();
|
|
|
},
|
|
|
setProductChecked(item) {
|
|
|
- let products = item.cartList;
|
|
|
- products.forEach(pros=>{
|
|
|
+ item.cartList.forEach(pros=>{
|
|
|
if(item.checked) {
|
|
|
- if(pros.validFlag =='3'){
|
|
|
+ if(pros.validFlag == 3){
|
|
|
// 无效
|
|
|
this.isNnder = true;
|
|
|
pros.productsChecked = this.isshowDelbtn ?true :false;
|
|
@@ -337,7 +373,6 @@
|
|
|
pros.productsChecked = false;
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
updateBothCheckBtn() {
|
|
|
if(this.isshowDelbtn) {
|
|
@@ -368,11 +403,11 @@
|
|
|
let productsList=[];
|
|
|
this.goodsList.map((item,index)=>{
|
|
|
productsList=item.cartList;
|
|
|
- prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.number,0);
|
|
|
+ prosPrice=productsList.reduce((p,e)=>p+e.price*e.number,0);
|
|
|
productsList.forEach(pros =>{
|
|
|
- if(pros.validFlag =='3'){
|
|
|
+ if(pros.validFlag ==3){
|
|
|
validList.push(pros)
|
|
|
- validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
|
|
|
+ validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
|
|
|
item.totalPrice = prosPrice - validPrice
|
|
|
}else{
|
|
|
item.totalPrice = prosPrice
|
|
@@ -390,10 +425,10 @@
|
|
|
productsList=item.cartList;
|
|
|
productsList.forEach(pros=>{
|
|
|
if(pros.productsChecked){
|
|
|
- prosPrice+=pros.retailPrice*pros.number;
|
|
|
- if(pros.validFlag =='3'){
|
|
|
+ prosPrice+=pros.price*pros.number;
|
|
|
+ if(pros.validFlag ==3){
|
|
|
validList.push(pros)
|
|
|
- validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
|
|
|
+ validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
|
|
|
this.allPrice = prosPrice - validPrice
|
|
|
}else{
|
|
|
this.allPrice = prosPrice
|
|
@@ -413,7 +448,7 @@
|
|
|
productsList.forEach(pros=>{
|
|
|
if(pros.productsChecked){
|
|
|
prosAllCount+=parseInt(pros.number);
|
|
|
- if(pros.validFlag =='3'){
|
|
|
+ if(pros.validFlag ==3){
|
|
|
validList.push(pros)
|
|
|
validList.forEach(val =>{
|
|
|
validCount += val.number
|
|
@@ -480,19 +515,18 @@
|
|
|
this.totalShopPeice();
|
|
|
},
|
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
|
- let ladderPriceList = pros.ladderPriceList;
|
|
|
- if(pros.ladderPriceFlag == '0' || pros.actStatus == 1){
|
|
|
- pros.retailPrice = pros.retailPrice
|
|
|
+ let ladderPriceList = pros.ladderPrices;
|
|
|
+ if(pros.ladderFlag == '0' || pros.actStatus == 1){
|
|
|
+ pros.price = pros.price
|
|
|
}else{
|
|
|
ladderPriceList.forEach((item,index)=>{
|
|
|
if(pros.number>=item.buyNum){
|
|
|
- pros.retailPrice = item.buyPrice
|
|
|
+ pros.price = item.buyPrice
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
updateShoppogNum(pros){//加减购物车商品更新到后台
|
|
|
- console.log(pros)
|
|
|
let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
|
|
|
this.ProductService.shoppingCartUpdate(params).then(response =>{
|
|
|
this.isshowDelbtn = false;
|
|
@@ -580,7 +614,7 @@
|
|
|
item.checked = false;
|
|
|
}
|
|
|
item.cartList.forEach(pros => {
|
|
|
- if(pros.validFlag == '3') {
|
|
|
+ if(pros.validFlag == 3) {
|
|
|
pros.productsChecked = false;
|
|
|
}
|
|
|
})
|
|
@@ -609,7 +643,7 @@
|
|
|
})
|
|
|
this.failureList.forEach(failure=>{
|
|
|
if(failure.productsChecked){
|
|
|
- this.delGoodsList += failure.productID+','
|
|
|
+ this.delGoodsList += failure.productId+','
|
|
|
}
|
|
|
})
|
|
|
if(this.delGoodsList.length == 0){
|
|
@@ -658,15 +692,15 @@
|
|
|
this.$api.navigateTo(`/pages/goods/product?id=${id}`)
|
|
|
},
|
|
|
failureToProduct(failure){
|
|
|
- if(failure.failureState == 1){
|
|
|
+ if(failure.status == 1){
|
|
|
this.$util.msg('商品已丢失,不能查看',2000)
|
|
|
return
|
|
|
- }else if(failure.failureState == 2){
|
|
|
+ }else if(failure.status == 2){
|
|
|
this.$util.msg('商品已停售,不能查看',2000)
|
|
|
return
|
|
|
}else{
|
|
|
this.isModallayer = true;
|
|
|
- this.$api.navigateTo(`/pages/goods/product?id=${failure.productID}`)
|
|
|
+ this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
|
|
|
}
|
|
|
},
|
|
|
failureStateText(state){
|
|
@@ -801,22 +835,42 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
height: 80rpx;
|
|
|
- // border-bottom: 1px solid #EBEBEB;
|
|
|
line-height: 80rpx;
|
|
|
.checkbox-box{
|
|
|
padding: 10rpx;
|
|
|
}
|
|
|
.text{
|
|
|
+ width: 450rpx;
|
|
|
display: block;
|
|
|
overflow: hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
white-space: nowrap;
|
|
|
- margin-left: 37rpx;
|
|
|
+ margin-left: 20rpx;
|
|
|
font-size: $font-size-28;
|
|
|
color: $text-color;
|
|
|
text-align: left;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+ .floor-item-act{
|
|
|
+ height: 56rpx;
|
|
|
+ text-align: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ float: left;
|
|
|
+ padding:10rpx 0;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ .floor-tags{
|
|
|
+ float: right;
|
|
|
+ height: 36rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ background-color: rgba(225, 86, 22, 0.1);
|
|
|
+ line-height: 36rpx;
|
|
|
+ color: $color-system;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ padding:0 16rpx;
|
|
|
+ font-size: $font-size-20;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.goods-pros{
|
|
|
width: 100%;
|
|
@@ -908,10 +962,8 @@
|
|
|
font-size: $font-size-26;
|
|
|
}
|
|
|
.productprice{
|
|
|
- height: 48rpx;
|
|
|
- position: absolute;
|
|
|
width: 100%;
|
|
|
- bottom: 0;
|
|
|
+ height: 48rpx;
|
|
|
.price{
|
|
|
line-height: 48rpx;
|
|
|
font-size: $font-size-28;
|
|
@@ -920,6 +972,7 @@
|
|
|
float: left;
|
|
|
&.disabled{
|
|
|
color: #999999;
|
|
|
+ text-decoration: line-through;
|
|
|
}
|
|
|
.money-sign{
|
|
|
font-size: $font-size-24;
|
|
@@ -1004,6 +1057,26 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .floor-item-act{
|
|
|
+ height: 56rpx;
|
|
|
+ text-align: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ float: left;
|
|
|
+ padding:10rpx 0;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ .floor-tags{
|
|
|
+ float: right;
|
|
|
+ height: 36rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ background-color: rgba(225, 86, 22, 0.1);
|
|
|
+ line-height: 36rpx;
|
|
|
+ color: $color-system;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ padding:0 16rpx;
|
|
|
+ font-size: $font-size-20;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.failure-list{
|
|
@@ -1213,17 +1286,51 @@
|
|
|
}
|
|
|
}
|
|
|
.sum{
|
|
|
- font-size: $font-size-28;
|
|
|
- line-height: 110rpx;
|
|
|
- color: $text-color;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
- .money{
|
|
|
- color: #FF2A2A;
|
|
|
+ width: 280rpx;
|
|
|
+ height: 110rpx;
|
|
|
+ float: right;
|
|
|
+ .sum-none{
|
|
|
+ width: 100%;
|
|
|
+ height: 55rpx;
|
|
|
+ line-height: 55rpx;
|
|
|
+ color: $text-color;
|
|
|
+ float: left;
|
|
|
+ text-align: right;
|
|
|
+ .money{
|
|
|
+ font-size: $font-size-26;
|
|
|
+ color: #999999;
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
+ .money-sign{
|
|
|
+ font-size: $font-size-26;
|
|
|
+ color: #999999;
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
+ .money-reduced{
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: $font-size-26;
|
|
|
+ color: $color-system;
|
|
|
+ .iconfont{
|
|
|
+ font-size: $font-size-34;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .money-sign{
|
|
|
- font-size: $font-size-24;
|
|
|
- color: #FF2A2A;
|
|
|
+ .sum-price{
|
|
|
+ text-align: right;
|
|
|
+ width: 100%;
|
|
|
+ height: 55rpx;
|
|
|
+ line-height: 55rpx;
|
|
|
+ font-size: $font-size-30;
|
|
|
+ color: $text-color;
|
|
|
+ float: left;
|
|
|
+ font-weight: bold;
|
|
|
+ .money{
|
|
|
+ color: #FF2A2A;
|
|
|
+ }
|
|
|
+ .money-sign{
|
|
|
+ font-size: $font-size-24;
|
|
|
+ color: #FF2A2A;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|