|
@@ -79,6 +79,37 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="failure-list" v-if="failureList.length>0">
|
|
|
|
+ <view class="failure-title">
|
|
|
|
+ <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
|
|
|
|
+ <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="productlist">
|
|
|
|
+ <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
|
|
|
|
+ <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
|
|
|
|
+ <!--选择商品-->
|
|
|
|
+ <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
|
|
|
|
+ <button class="checkbox iconfont"
|
|
|
|
+ :class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
|
|
|
|
+ </button>
|
|
|
|
+ </view>
|
|
|
|
+ <text class="img-tip">失效</text>
|
|
|
|
+ <view class="pros-img">
|
|
|
|
+ <image :src="failure.mainImage ? failure.mainImage:''" alt="" />
|
|
|
|
+ </view>
|
|
|
|
+ <view class="pros-product">
|
|
|
|
+ <view class="producttitle">{{failure.name}}</view>
|
|
|
|
+ <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
|
|
|
|
+ <view class="productstate">{{failureStateText(failure.validFlag)}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="pros-marks" v-if="failure.isFailureLayer"></view>
|
|
|
|
+ <!--</view>-->
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+
|
|
<!--加载loadding-->
|
|
<!--加载loadding-->
|
|
<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
<tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
|
|
<tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
|
|
@@ -143,12 +174,14 @@
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
clubId:'', //机构ID
|
|
clubId:'', //机构ID
|
|
|
|
+ userID:'',
|
|
kindCount:0,
|
|
kindCount:0,
|
|
serviceProviderId:'',//协销ID
|
|
serviceProviderId:'',//协销ID
|
|
isStock:'',
|
|
isStock:'',
|
|
popupShow:false,
|
|
popupShow:false,
|
|
handlerPros:{},//监听单挑促销商品
|
|
handlerPros:{},//监听单挑促销商品
|
|
promotionsList:[],//促销活动列表
|
|
promotionsList:[],//促销活动列表
|
|
|
|
+ failureList:[], //失效商品列表
|
|
goodsList:[], //购物车的商品
|
|
goodsList:[], //购物车的商品
|
|
delGoodsList:'',//要删除的商品
|
|
delGoodsList:'',//要删除的商品
|
|
setGoodData:'', //确认订单的商品
|
|
setGoodData:'', //确认订单的商品
|
|
@@ -209,6 +242,45 @@
|
|
this.popupShow = true;
|
|
this.popupShow = true;
|
|
this.handlerPros = pros;
|
|
this.handlerPros = pros;
|
|
},
|
|
},
|
|
|
|
+ failureToProduct(failure){
|
|
|
|
+ if(failure.status == 1){
|
|
|
|
+ this.$util.msg('商品已丢失,不能查看',2000)
|
|
|
|
+ return
|
|
|
|
+ }else if(failure.status == 2){
|
|
|
|
+ this.$util.msg('商品已停售,不能查看',2000)
|
|
|
|
+ return
|
|
|
|
+ }else{
|
|
|
|
+ this.isModallayer = true;
|
|
|
|
+ this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ failureStateText(state){
|
|
|
|
+ let stateText = '',
|
|
|
|
+ stateTextObject={
|
|
|
|
+ 0:'商品已停售',
|
|
|
|
+ 10:'商品已丢失'
|
|
|
|
+ }
|
|
|
|
+ Object.keys(stateTextObject).forEach(key => {
|
|
|
|
+ if(key == state){
|
|
|
|
+ stateText = stateTextObject[key]
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return stateText;
|
|
|
|
+ },
|
|
|
|
+ deletefailureList(){
|
|
|
|
+ this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
|
|
|
|
+ this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
|
|
|
|
+ this.SellerService.SellerCartdelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
|
+ this.$util.msg('删除成功',2000);
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.isshowDelbtn = false;
|
|
|
|
+ this.initGetCartGoodsList();
|
|
|
|
+ },2000)
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
setScrollHeight() {
|
|
setScrollHeight() {
|
|
// 窗口高度-footer高度
|
|
// 窗口高度-footer高度
|
|
const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
|
|
const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
|
|
@@ -230,8 +302,12 @@
|
|
this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
this.promotionsList = response.data.promotionsList;
|
|
this.promotionsList = response.data.promotionsList;
|
|
const resultsData = response.data.pageDate;
|
|
const resultsData = response.data.pageDate;
|
|
- if(resultsData.results&&resultsData.results.length > 0){
|
|
|
|
|
|
+ if(resultsData.results.length > 0||response.data.invalidProductList.length>0){
|
|
this.isEmpty =false
|
|
this.isEmpty =false
|
|
|
|
+ }else{
|
|
|
|
+ this.isEmpty =true
|
|
|
|
+ }
|
|
|
|
+ if(resultsData.results&&resultsData.results.length > 0){
|
|
this.hasNextPage = resultsData.hasNextPage;
|
|
this.hasNextPage = resultsData.hasNextPage;
|
|
this.goodsList = resultsData.results;
|
|
this.goodsList = resultsData.results;
|
|
this.goodsList.forEach((item,index) => {
|
|
this.goodsList.forEach((item,index) => {
|
|
@@ -265,7 +341,21 @@
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.goodsList = [];
|
|
this.goodsList = [];
|
|
- this.isEmpty =true
|
|
|
|
|
|
+ }
|
|
|
|
+ if( response.data.invalidProductList && response.data.invalidProductList.length > 0){
|
|
|
|
+ let newFailureList = [],isFailureLayer;
|
|
|
|
+ response.data.invalidProductList.forEach((failure,index) => {
|
|
|
|
+ if(failure.validFlag == 0 || failure.validFlag == 10) {
|
|
|
|
+ isFailureLayer = true
|
|
|
|
+ }else{
|
|
|
|
+ isFailureLayer = false
|
|
|
|
+ }
|
|
|
|
+ newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
|
|
|
|
+ })
|
|
|
|
+ this.failureList = newFailureList;
|
|
|
|
+ console.log(this.failureList)
|
|
|
|
+ } else {
|
|
|
|
+ this.failureList = [];
|
|
}
|
|
}
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.$util.msg(error.msg,2000);
|
|
this.$util.msg(error.msg,2000);
|
|
@@ -669,6 +759,11 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ this.failureList.forEach(failure=>{
|
|
|
|
+ if(failure.productsChecked){
|
|
|
|
+ this.delGoodsList += failure.sellerCartId+','
|
|
|
|
+ }
|
|
|
|
+ })
|
|
if(this.delGoodsList.length == 0){
|
|
if(this.delGoodsList.length == 0){
|
|
this.$util.msg("请选择要删除的商品~",2000);
|
|
this.$util.msg("请选择要删除的商品~",2000);
|
|
return
|
|
return
|
|
@@ -828,6 +923,7 @@
|
|
background-color:#FFFFFF;
|
|
background-color:#FFFFFF;
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
color:$color-system;
|
|
color:$color-system;
|
|
|
|
+ padding: 5rpx;
|
|
&.icon-weixuanze{
|
|
&.icon-weixuanze{
|
|
color: #b2b2b2;
|
|
color: #b2b2b2;
|
|
}
|
|
}
|
|
@@ -1294,4 +1390,167 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .failure-list{
|
|
|
|
+ width: 702rpx;
|
|
|
|
+ height: auto;
|
|
|
|
+ padding: 0 24rpx;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
+ .failure-title{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 82rpx;
|
|
|
|
+ line-height: 82rpx;
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ .title-txt{
|
|
|
|
+ float: left;
|
|
|
|
+ color:#666666;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+ .title-btn{
|
|
|
|
+ float: right;
|
|
|
|
+ color: $color-system;
|
|
|
|
+ text-align: right;
|
|
|
|
+ line-height: 80rpx;
|
|
|
|
+ .butto{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ padding: 0 15rpx;
|
|
|
|
+ font-size: $font-size-26;
|
|
|
|
+ height: 50rpx;
|
|
|
|
+ line-height: 50rpx;
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
+ background:#FFFFFF;
|
|
|
|
+ // border: 1px solid #C9C9C9;
|
|
|
|
+ // color: #999999;
|
|
|
|
+ margin-top: 15rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .productlist{
|
|
|
|
+ padding-top: 10rpx;
|
|
|
|
+ .goods-pros{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: auto;
|
|
|
|
+ padding: 20rpx 0;
|
|
|
|
+ }
|
|
|
|
+ .goods-pros-t{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 210rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+ .img-tip{
|
|
|
|
+ display: block;
|
|
|
|
+ width: 72rpx;
|
|
|
|
+ height: 36rpx;
|
|
|
|
+ line-height: 36rpx;
|
|
|
|
+ font-size: $font-size-24;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ border-radius: 24rpx;
|
|
|
|
+ background:rgba(51,51,51,0.3);
|
|
|
|
+ // position: absolute;
|
|
|
|
+ // left: 0;
|
|
|
|
+ // top: 0;
|
|
|
|
+ }
|
|
|
|
+ .checkbox-box{
|
|
|
|
+ padding: 10rpx;
|
|
|
|
+ }
|
|
|
|
+ .pros-img{
|
|
|
|
+ width: 180rpx;
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+ margin:0 20rpx;
|
|
|
|
+ border:1px solid #f3f3f3;
|
|
|
|
+ position: relative;
|
|
|
|
+ image{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .pros-marks{
|
|
|
|
+ width: 750rpx;
|
|
|
|
+ height: 250rpx;
|
|
|
|
+ z-index: 90;
|
|
|
|
+ background: rgba(0,0,0,.05);
|
|
|
|
+ position: absolute;
|
|
|
|
+ left:-20rpx;
|
|
|
|
+ top: -20rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .goods-pros-b{
|
|
|
|
+ width:622rpx;
|
|
|
|
+ margin-left: 84rpx;
|
|
|
|
+ height: 40rpx;
|
|
|
|
+ padding:0 0 26rpx 0;
|
|
|
|
+ // border-top: 1px solid #EBEBEB;
|
|
|
|
+ &.show{
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ &.none{
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+ .sum{
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ line-height: 40rpx;
|
|
|
|
+ color: $text-color;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ .money{
|
|
|
|
+ color: #FF2A2A;
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ }
|
|
|
|
+ .money-sign{
|
|
|
|
+ font-size: $font-size-24;
|
|
|
|
+ color: #FF2A2A;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .pros-product{
|
|
|
|
+ width: 402rpx;
|
|
|
|
+ height: 100%;
|
|
|
|
+ line-height: 36rpx;
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ position: relative;
|
|
|
|
+ .producttitle{
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ height: auto;
|
|
|
|
+ text-overflow:ellipsis;
|
|
|
|
+ display: -webkit-box;
|
|
|
|
+ word-break: break-all;
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ margin-bottom: 8rpx;
|
|
|
|
+ .no-text{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ height:36rpx;
|
|
|
|
+ padding: 0 12rpx;
|
|
|
|
+ line-height: 36rpx;
|
|
|
|
+ background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
|
|
|
|
+ border-radius:18rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ margin-right: 24rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .productspec{
|
|
|
|
+ height: 36rpx;
|
|
|
|
+ color: #999999;
|
|
|
|
+ font-size: $font-size-26;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ }
|
|
|
|
+ .productstate{
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ height: 44rpx;
|
|
|
|
+ color: #FF2A2A;
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|