|
@@ -219,13 +219,17 @@
|
|
}, 500)
|
|
}, 500)
|
|
},
|
|
},
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
- let params = {userID:this.userID,pageNum:1,pageSize:this.pageSize}
|
|
|
|
|
|
+ let params = {userID:this.userID}
|
|
queryShoppingCartList(params).then(response =>{
|
|
queryShoppingCartList(params).then(response =>{
|
|
this.skeletonShow = false
|
|
this.skeletonShow = false
|
|
this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
const responseData = response.data
|
|
const responseData = response.data
|
|
- if(responseData.pageDate.length > 0 ){
|
|
|
|
|
|
+ if(responseData.pageDate.length > 0 && responseData.failureList.length > 0){
|
|
this.isEmpty =false
|
|
this.isEmpty =false
|
|
|
|
+ }else{
|
|
|
|
+ this.isEmpty =true
|
|
|
|
+ }
|
|
|
|
+ if(responseData.pageDate && responseData.pageDate.length > 0 ){
|
|
this.goodsList = responseData.pageDate;
|
|
this.goodsList = responseData.pageDate;
|
|
this.goodsList.forEach((item,index) => {
|
|
this.goodsList.forEach((item,index) => {
|
|
let productsListLength = item.productsList.length,
|
|
let productsListLength = item.productsList.length,
|
|
@@ -237,10 +241,9 @@
|
|
item.isDisabled = invalidLength === productsListLength;
|
|
item.isDisabled = invalidLength === productsListLength;
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.isEmpty =true
|
|
|
|
this.goodsList = [];
|
|
this.goodsList = [];
|
|
}
|
|
}
|
|
- if( responseData.failureList.length > 0){
|
|
|
|
|
|
+ if( responseData.failureList && responseData.failureList.length > 0){
|
|
let newFailureList = [],isFailureLayer;
|
|
let newFailureList = [],isFailureLayer;
|
|
responseData.failureList.forEach((failure,index) => {
|
|
responseData.failureList.forEach((failure,index) => {
|
|
if(failure.failureState == 1 || failure.failureState == 2) {
|
|
if(failure.failureState == 1 || failure.failureState == 2) {
|
|
@@ -442,7 +445,7 @@
|
|
},
|
|
},
|
|
changeCountSub(item,pros){//商品数量减减
|
|
changeCountSub(item,pros){//商品数量减减
|
|
if(pros.productCount<=pros.minBuyNumber){
|
|
if(pros.productCount<=pros.minBuyNumber){
|
|
- pros.productCount= pros.minBuyNumber
|
|
|
|
|
|
+ pros.productCount = pros.minBuyNumber
|
|
this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
|
|
this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|