|
@@ -11,7 +11,7 @@
|
|
<view class="checkbox-box">
|
|
<view class="checkbox-box">
|
|
<button class="checkbox iconfont"
|
|
<button class="checkbox iconfont"
|
|
:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"
|
|
:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"
|
|
- @click.stop="checkShop(item)" :disabled="item.isDisabled && !isshowDelbtn">
|
|
|
|
|
|
+ @click.stop="checkShop(item)">
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
<view class="text">{{item.name}}</view>
|
|
<view class="text">{{item.name}}</view>
|
|
@@ -23,31 +23,28 @@
|
|
>
|
|
>
|
|
<view class="goods-pros-t">
|
|
<view class="goods-pros-t">
|
|
<!--选择商品-->
|
|
<!--选择商品-->
|
|
- <view class="checkbox-box" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
|
|
|
|
|
|
+ <view class="checkbox-box">
|
|
<button class="checkbox iconfont"
|
|
<button class="checkbox iconfont"
|
|
- :disabled="pros.validFlag == '3' && !isshowDelbtn"
|
|
|
|
:class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']"
|
|
:class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']"
|
|
@click.stop="ischeck(item,pros,idx)">
|
|
@click.stop="ischeck(item,pros,idx)">
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
- <view class="pros-img" @click.stop="navToListPage(pros.productID)" ><image :src="pros.mainImage ? pros.mainImage :''" alt="" /></view>
|
|
|
|
|
|
+ <view class="pros-img" @click.stop="navToListPage(pros.productID)"><image :src="pros.mainImage ? pros.mainImage :''" alt="" /></view>
|
|
<view class="pros-product">
|
|
<view class="pros-product">
|
|
<view class="producttitle" @click.stop="navToListPage(pros.id)" >
|
|
<view class="producttitle" @click.stop="navToListPage(pros.id)" >
|
|
- <text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
|
|
|
|
|
|
+ {{pros.name}}
|
|
</view>
|
|
</view>
|
|
<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
|
|
<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
|
|
<view class="productprice">
|
|
<view class="productprice">
|
|
<!--使用过滤器对总价改变-->
|
|
<!--使用过滤器对总价改变-->
|
|
- <view class="price"
|
|
|
|
- :class="[pros.validFlag == '3' ?'disabled' : '']">
|
|
|
|
- <text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
|
|
|
|
|
|
+ <view class="price"><text>¥</text>
|
|
{{pros.retailPrice ? pros.retailPrice.toFixed(2) : ''}}
|
|
{{pros.retailPrice ? pros.retailPrice.toFixed(2) : ''}}
|
|
</view>
|
|
</view>
|
|
- <view class="count" v-if="pros.validFlag == '2'" :class="[isshowDelbtn ? 'none':'show']">
|
|
|
|
|
|
+ <view class="count" :class="[isshowDelbtn ? 'none':'show']">
|
|
<view class="number-box">
|
|
<view class="number-box">
|
|
- <view class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
|
|
|
|
|
|
+ <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
|
|
<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
|
|
<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
|
|
- <view class="iconfont icon-jiahao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
|
|
|
|
|
|
+ <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -89,8 +86,7 @@
|
|
<view v-if="isEmpty" class="cart-content empty">
|
|
<view v-if="isEmpty" class="cart-content empty">
|
|
<view class="empty-container">
|
|
<view class="empty-container">
|
|
<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
|
|
<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
|
|
- <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
|
|
|
|
- <view class="login-btn" @click="goIndex">去商城</view>
|
|
|
|
|
|
+ <text class="error-text">购物车空空如也~</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -104,7 +100,7 @@
|
|
import tuiNomore from "@/components/tui-components/nomore/nomore"
|
|
import tuiNomore from "@/components/tui-components/nomore/nomore"
|
|
import modalLayer from "@/components/modal-layer"
|
|
import modalLayer from "@/components/modal-layer"
|
|
import { mapState,mapMutations } from 'vuex';
|
|
import { mapState,mapMutations } from 'vuex';
|
|
- import { getSellerShoppingInfo,sellerAddProductNum } from "@/api/seller.js"
|
|
|
|
|
|
+ import { getSellerShoppingInfo,sellerAddProductNum, deleteSellerCart } from "@/api/seller.js"
|
|
|
|
|
|
export default{
|
|
export default{
|
|
components:{
|
|
components:{
|
|
@@ -140,8 +136,10 @@
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onLoad(option){
|
|
|
|
- this.clubId = option.clubId
|
|
|
|
|
|
+ onLoad(){
|
|
|
|
+ this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
|
+ this.clubId = resolve.clubID
|
|
|
|
+ })
|
|
this.setScrollHeight();
|
|
this.setScrollHeight();
|
|
this.initData()
|
|
this.initData()
|
|
},
|
|
},
|
|
@@ -195,9 +193,7 @@
|
|
invalidLength = 0;
|
|
invalidLength = 0;
|
|
item.productsList.forEach(pros => {
|
|
item.productsList.forEach(pros => {
|
|
pros.shopID = item.shopID;
|
|
pros.shopID = item.shopID;
|
|
- if(pros.validFlag == '3') {invalidLength++;}
|
|
|
|
})
|
|
})
|
|
- item.isDisabled = invalidLength === productsListLength;
|
|
|
|
})
|
|
})
|
|
this.pullFlag = false;
|
|
this.pullFlag = false;
|
|
setTimeout(()=>{this.pullFlag = true;},500)
|
|
setTimeout(()=>{this.pullFlag = true;},500)
|
|
@@ -258,12 +254,9 @@
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
productsList.forEach(pros => {
|
|
productsList.forEach(pros => {
|
|
- if(pros.productsChecked && pros.validFlag != '3') {
|
|
|
|
|
|
+ if(pros.productsChecked) {
|
|
productsCheckedLength++;
|
|
productsCheckedLength++;
|
|
}
|
|
}
|
|
- if(pros.validFlag == '3') {
|
|
|
|
- disabledLength++;
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
item.checked = productsCheckedLength === productsList.length - disabledLength;
|
|
item.checked = productsCheckedLength === productsList.length - disabledLength;
|
|
@@ -276,9 +269,6 @@
|
|
if(item.checked) {
|
|
if(item.checked) {
|
|
goodsCheckedLength++;
|
|
goodsCheckedLength++;
|
|
}
|
|
}
|
|
- if(item.isDisabled && !this.isshowDelbtn) {
|
|
|
|
- disabledListLength++;
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
},
|
|
},
|
|
@@ -291,15 +281,9 @@
|
|
let products = item.productsList;
|
|
let products = item.productsList;
|
|
products.forEach(pros=>{
|
|
products.forEach(pros=>{
|
|
if(item.checked) {
|
|
if(item.checked) {
|
|
- if(pros.validFlag =='3'){
|
|
|
|
- // 无效
|
|
|
|
- this.isNnder = true;
|
|
|
|
- pros.productsChecked = this.isshowDelbtn ?true :false;
|
|
|
|
- }else{
|
|
|
|
- // 有效
|
|
|
|
- this.isNnder = false;
|
|
|
|
- pros.productsChecked = true;
|
|
|
|
- }
|
|
|
|
|
|
+ // 有效
|
|
|
|
+ this.isNnder = false;
|
|
|
|
+ pros.productsChecked = true;
|
|
} else {
|
|
} else {
|
|
pros.productsChecked = false;
|
|
pros.productsChecked = false;
|
|
}
|
|
}
|
|
@@ -314,7 +298,7 @@
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.goodsList.forEach((item)=>{
|
|
this.goodsList.forEach((item)=>{
|
|
- item.checked = this.isCheckAll && !item.isDisabled;
|
|
|
|
|
|
+ item.checked = this.isCheckAll;
|
|
this.setProductChecked(item);
|
|
this.setProductChecked(item);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -332,13 +316,7 @@
|
|
productsList=item.productsList;
|
|
productsList=item.productsList;
|
|
prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
|
|
prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
|
|
productsList.forEach(pros =>{
|
|
productsList.forEach(pros =>{
|
|
- if(pros.validFlag =='3'){
|
|
|
|
- validList.push(pros)
|
|
|
|
- validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
|
|
|
|
- item.totalPrice = prosPrice - validPrice
|
|
|
|
- }else{
|
|
|
|
- item.totalPrice = prosPrice
|
|
|
|
- }
|
|
|
|
|
|
+ item.totalPrice = prosPrice
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -353,13 +331,7 @@
|
|
productsList.forEach(pros=>{
|
|
productsList.forEach(pros=>{
|
|
if(pros.productsChecked){
|
|
if(pros.productsChecked){
|
|
prosPrice+=pros.retailPrice*pros.productCount;
|
|
prosPrice+=pros.retailPrice*pros.productCount;
|
|
- if(pros.validFlag =='3'){
|
|
|
|
- validList.push(pros)
|
|
|
|
- validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
|
|
|
|
- this.allPrice = prosPrice - validPrice
|
|
|
|
- }else{
|
|
|
|
- this.allPrice = prosPrice
|
|
|
|
- }
|
|
|
|
|
|
+ this.allPrice = prosPrice
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -375,15 +347,7 @@
|
|
productsList.forEach(pros=>{
|
|
productsList.forEach(pros=>{
|
|
if(pros.productsChecked){
|
|
if(pros.productsChecked){
|
|
prosAllCount+=parseInt(pros.productCount);
|
|
prosAllCount+=parseInt(pros.productCount);
|
|
- if(pros.validFlag =='3'){
|
|
|
|
- validList.push(pros)
|
|
|
|
- validList.forEach(val =>{
|
|
|
|
- validCount += val.productCount
|
|
|
|
- })
|
|
|
|
- this.allCount = prosAllCount - validCount
|
|
|
|
- }else{
|
|
|
|
- this.allCount = prosAllCount
|
|
|
|
- }
|
|
|
|
|
|
+ this.allCount = prosAllCount
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -485,40 +449,12 @@
|
|
this.$api.navigateTo(`/market/pages/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
|
|
this.$api.navigateTo(`/market/pages/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- setOrderGoods(){//本地获取勾选商品信息***暂时丢弃***
|
|
|
|
- let setGoodData = {}
|
|
|
|
- let prosPrice =0;
|
|
|
|
- let prosCount =0;
|
|
|
|
- let goodsArr = this.goodsList.map(el => {
|
|
|
|
- el.productsList = el.productsList.filter(item => item.productsChecked)
|
|
|
|
- prosPrice=el.productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
|
|
|
|
- el.productsList.forEach(pros=>{
|
|
|
|
- el.totalCount += pros.productCount;
|
|
|
|
- })
|
|
|
|
- el.totalPrice = prosPrice
|
|
|
|
- return el
|
|
|
|
- }).filter(el => el.productsList && el.productsList.length !==0);
|
|
|
|
- setGoodData = {
|
|
|
|
- allPrice:this.allPrice,
|
|
|
|
- allCount:this.allCount,
|
|
|
|
- goodList:goodsArr
|
|
|
|
- }
|
|
|
|
- return setGoodData
|
|
|
|
- },
|
|
|
|
showDelManager(){//显示删除商品管理
|
|
showDelManager(){//显示删除商品管理
|
|
this.isshowDelbtn = true;
|
|
this.isshowDelbtn = true;
|
|
this.isNnder = true;
|
|
this.isNnder = true;
|
|
if(this.isCheckAll) {
|
|
if(this.isCheckAll) {
|
|
this.updateBothCheckBtn();
|
|
this.updateBothCheckBtn();
|
|
} else {
|
|
} else {
|
|
- // 失效也被勾选
|
|
|
|
- this.goodsList.forEach(item => {
|
|
|
|
- if(item.checked) {
|
|
|
|
- item.productsList.forEach(pros => {
|
|
|
|
- pros.productsChecked = true;
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
this.updateCheckAllBtn();
|
|
this.updateCheckAllBtn();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -527,17 +463,6 @@
|
|
if(this.isCheckAll) {
|
|
if(this.isCheckAll) {
|
|
this.updateBothCheckBtn();
|
|
this.updateBothCheckBtn();
|
|
} else {
|
|
} else {
|
|
- // 失效商品取消勾选
|
|
|
|
- this.goodsList.forEach(item => {
|
|
|
|
- if(item.isDisabled) {
|
|
|
|
- item.checked = false;
|
|
|
|
- }
|
|
|
|
- item.productsList.forEach(pros => {
|
|
|
|
- if(pros.validFlag == '3') {
|
|
|
|
- pros.productsChecked = false;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
this.updateCheckAllBtn();
|
|
this.updateCheckAllBtn();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -547,7 +472,7 @@
|
|
let products = delitem.productsList
|
|
let products = delitem.productsList
|
|
products.forEach(pros=>{
|
|
products.forEach(pros=>{
|
|
if(pros.productsChecked){
|
|
if(pros.productsChecked){
|
|
- this.delGoodsList += pros.productID+','
|
|
|
|
|
|
+ this.delGoodsList += pros.sellerCartId+','
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -557,7 +482,7 @@
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
- shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
|
|
|
+ deleteSellerCart({sellerCartIds:this.delGoodsList}).then(response =>{
|
|
console.log(response)
|
|
console.log(response)
|
|
this.$util.msg('删除成功',2000);
|
|
this.$util.msg('删除成功',2000);
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
@@ -570,11 +495,6 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- goIndex(){
|
|
|
|
- uni.switchTab({
|
|
|
|
- url: '/pages/tabBar/home/home'
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
goNavto(url){
|
|
goNavto(url){
|
|
uni.navigateTo ({
|
|
uni.navigateTo ({
|
|
url
|
|
url
|