|
@@ -159,12 +159,12 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
- 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';
|
|
|
+ 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'
|
|
|
const defaultListQuery = {
|
|
|
clubId:0, // 机构Id
|
|
|
serviceProviderId:0, //协销Id
|
|
@@ -172,7 +172,7 @@
|
|
|
pageNum:1, // 页码
|
|
|
pageSize:10, // 条数
|
|
|
|
|
|
- };
|
|
|
+ }
|
|
|
export default{
|
|
|
components:{
|
|
|
tuiSkeleton,
|
|
@@ -216,14 +216,14 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|
|
|
- this.setScrollHeight();
|
|
|
+ this.setScrollHeight()
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['hasLogin','userInfo'])
|
|
|
},
|
|
|
filters:{
|
|
|
NumFormat(value) {//处理金额
|
|
|
- return Number(value).toFixed(2);
|
|
|
+ return Number(value).toFixed(2)
|
|
|
},
|
|
|
totalprice(val,count){//单件商品的价格 × 数量
|
|
|
return (val * count).toFixed(2)
|
|
@@ -237,7 +237,7 @@
|
|
|
this.submitIds = []
|
|
|
this.$api.getStorage().then((resolve) => {
|
|
|
this.listQuery.serviceProviderId = resolve.serviceProviderId ? resolve.serviceProviderId : 0
|
|
|
- this.initGetCartGoodsList();
|
|
|
+ this.initGetCartGoodsList()
|
|
|
this.getClubProductNum()
|
|
|
})
|
|
|
},
|
|
@@ -245,8 +245,8 @@
|
|
|
this.$api.redirectTo('/pages/login/login?type=4')
|
|
|
},
|
|
|
clickPopupShow(pros,type){//显示活动弹窗
|
|
|
- this.popupShow = true;
|
|
|
- this.handlerPros = pros;
|
|
|
+ this.popupShow = true
|
|
|
+ this.handlerPros = pros
|
|
|
},
|
|
|
failureToProduct(failure){
|
|
|
if(failure.status == 1){
|
|
@@ -256,7 +256,7 @@
|
|
|
this.$util.msg('商品已停售,不能查看',2000)
|
|
|
return
|
|
|
}else{
|
|
|
- this.isModallayer = true;
|
|
|
+ this.isModallayer = true
|
|
|
this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
|
|
|
}
|
|
|
},
|
|
@@ -271,7 +271,7 @@
|
|
|
stateText = stateTextObject[key]
|
|
|
}
|
|
|
})
|
|
|
- return stateText;
|
|
|
+ return stateText
|
|
|
},
|
|
|
deletefailureList(){
|
|
|
this.failureList.forEach(failure=>{ this.delGoodsList += failure.sellerCartId+',' })
|
|
@@ -279,10 +279,10 @@
|
|
|
console.log(this.delGoodsList)
|
|
|
this.SellerService.SellerCartdelete({sellerCartIds:this.delGoodsList}).then(response =>{
|
|
|
console.log(response)
|
|
|
- this.$util.msg('删除成功',2000);
|
|
|
+ this.$util.msg('删除成功',2000)
|
|
|
setTimeout(()=>{
|
|
|
- this.isshowDelbtn = false;
|
|
|
- this.initGetCartGoodsList();
|
|
|
+ this.isshowDelbtn = false
|
|
|
+ this.initGetCartGoodsList()
|
|
|
},2000)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
@@ -291,14 +291,14 @@
|
|
|
},
|
|
|
setScrollHeight() {
|
|
|
// 窗口高度-footer高度
|
|
|
- const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
|
|
|
+ const {windowHeight, pixelRatio} = uni.getSystemInfoSync()
|
|
|
setTimeout(()=> {
|
|
|
- const query = uni.createSelectorQuery().in(this);
|
|
|
- query.selectAll('.footer').boundingClientRect();
|
|
|
+ const query = uni.createSelectorQuery().in(this)
|
|
|
+ query.selectAll('.footer').boundingClientRect()
|
|
|
query.exec(res => {
|
|
|
- this.windowHeight = windowHeight;
|
|
|
+ this.windowHeight = windowHeight
|
|
|
if(res[0][0]) {
|
|
|
- this.scrollHeight = windowHeight - res[0][0].height;
|
|
|
+ this.scrollHeight = windowHeight - res[0][0].height
|
|
|
}
|
|
|
})
|
|
|
}, 500)
|
|
@@ -308,7 +308,7 @@
|
|
|
this.skeletonShow = false
|
|
|
let data = response.data
|
|
|
let dataPage = data.pageDate
|
|
|
- this.promotionsList = data.promotionsList;
|
|
|
+ this.promotionsList = data.promotionsList
|
|
|
|
|
|
if(dataPage.list.length > 0||data.invalidProductList.length>0){
|
|
|
this.isEmpty =false
|
|
@@ -316,12 +316,12 @@
|
|
|
this.isEmpty =true
|
|
|
}
|
|
|
if(dataPage.list && dataPage.list.length > 0){
|
|
|
- this.hasNextPage = dataPage.hasNextPage;
|
|
|
- this.goodsList = dataPage.list;
|
|
|
+ this.hasNextPage = dataPage.hasNextPage
|
|
|
+ this.goodsList = dataPage.list
|
|
|
this.goodsList.forEach((item,index) => {
|
|
|
- let cartListLength = item.cartList.length,invalidLength = 0;
|
|
|
+ let cartListLength = item.cartList.length,invalidLength = 0
|
|
|
item.cartList.forEach(pros => {
|
|
|
- pros.shopId = item.shopId;
|
|
|
+ pros.shopId = item.shopId
|
|
|
pros.isStep = false
|
|
|
if(pros.step === 2){
|
|
|
if(pros.number % pros.min != 0){
|
|
@@ -333,8 +333,8 @@
|
|
|
})
|
|
|
})
|
|
|
this.totalShopPeice()
|
|
|
- this.pullFlag = false;
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
+ this.pullFlag = false
|
|
|
+ setTimeout(()=>{this.pullFlag = true},500)
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
|
this.nomoreText = '上拉显示更多'
|
|
@@ -347,10 +347,10 @@
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.goodsList = [];
|
|
|
+ this.goodsList = []
|
|
|
}
|
|
|
if( response.data.invalidProductList && response.data.invalidProductList.length > 0){
|
|
|
- let newFailureList = [],isFailureLayer;
|
|
|
+ let newFailureList = [],isFailureLayer
|
|
|
response.data.invalidProductList.forEach((failure,index) => {
|
|
|
if(failure.validFlag == 0 || failure.validFlag == 10) {
|
|
|
isFailureLayer = true
|
|
@@ -359,26 +359,26 @@
|
|
|
}
|
|
|
newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
|
|
|
})
|
|
|
- this.failureList = newFailureList;
|
|
|
+ this.failureList = newFailureList
|
|
|
console.log(this.failureList)
|
|
|
} else {
|
|
|
- this.failureList = [];
|
|
|
+ this.failureList = []
|
|
|
}
|
|
|
}).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
getOnReachBottomData(){//上拉加载
|
|
|
this.listQuery.pageNum+=1
|
|
|
this.SellerService.GetSellerShoppingInfo(this.listQuery).then(response =>{
|
|
|
let resultsData = response.data.pageDate
|
|
|
- this.promotionsList = response.data.promotionsList;
|
|
|
- this.hasNextPage = resultsData.hasNextPage;
|
|
|
+ this.promotionsList = response.data.promotionsList
|
|
|
+ this.hasNextPage = resultsData.hasNextPage
|
|
|
this.goodsList = this.goodsList.concat(resultsData.results)
|
|
|
this.goodsList.forEach((item,index) => {
|
|
|
- let productsListLength = item.cartList.length,invalidLength = 0;
|
|
|
+ let productsListLength = item.cartList.length,invalidLength = 0
|
|
|
item.cartList.forEach(pros => {
|
|
|
- pros.shopId = item.shopId;
|
|
|
+ pros.shopId = item.shopId
|
|
|
pros.isStep = false
|
|
|
if(pros.step === 2){
|
|
|
if(pros.number % pros.min != 0){
|
|
@@ -390,8 +390,8 @@
|
|
|
})
|
|
|
})
|
|
|
this.totalShopPeice()
|
|
|
- this.pullFlag = false;// 防上拉暴滑
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
+ this.pullFlag = false// 防上拉暴滑
|
|
|
+ setTimeout(()=>{this.pullFlag = true},500)
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
|
this.nomoreText = '上拉显示更多'
|
|
@@ -401,7 +401,7 @@
|
|
|
this.nomoreText = '已至底部'
|
|
|
}
|
|
|
}).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
getClubProductNum(){// 获取协销下机构购物车数量
|
|
@@ -415,67 +415,67 @@
|
|
|
})
|
|
|
},
|
|
|
ischeck(item,pro){//为未选中的时候改变为true,反之为true
|
|
|
- pro.isChecked = !pro.isChecked;
|
|
|
+ pro.isChecked = !pro.isChecked
|
|
|
if(pro.isChecked) {
|
|
|
if(!this.submitIds.includes(pro.productId*1)){
|
|
|
- this.submitIds.push(pro.productId);
|
|
|
+ this.submitIds.push(pro.productId)
|
|
|
}
|
|
|
} else {
|
|
|
- var lent = this.submitIds.indexOf(pro.productId*1);
|
|
|
+ var lent = this.submitIds.indexOf(pro.productId*1)
|
|
|
if(lent >=0 ){
|
|
|
- this.submitIds.splice(lent, 1);
|
|
|
+ this.submitIds.splice(lent, 1)
|
|
|
}
|
|
|
}
|
|
|
- this.updateProductCheckedAllBtn(item);
|
|
|
- this.updateCheckAllBtn();
|
|
|
+ this.updateProductCheckedAllBtn(item)
|
|
|
+ this.updateCheckAllBtn()
|
|
|
},
|
|
|
updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
|
|
|
let productsList = item.cartList,
|
|
|
productsCheckedLength = 0,
|
|
|
- disabledLength = 0;
|
|
|
+ disabledLength = 0
|
|
|
if(this.isshowDelbtn) {
|
|
|
productsList.forEach(pros => {
|
|
|
if(pros.isChecked) {
|
|
|
- productsCheckedLength++;
|
|
|
+ productsCheckedLength++
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
productsList.forEach(pros => {
|
|
|
if(pros.isChecked) {
|
|
|
- productsCheckedLength++;
|
|
|
+ productsCheckedLength++
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- item.isChecked = productsCheckedLength === productsList.length - disabledLength;
|
|
|
+ item.isChecked = productsCheckedLength === productsList.length - disabledLength
|
|
|
},
|
|
|
updateCheckAllBtn() {// 全选勾选判断
|
|
|
let goodsCheckedLength = 0,
|
|
|
disabledListLength = 0,
|
|
|
- goodsList = this.goodsList;
|
|
|
+ goodsList = this.goodsList
|
|
|
goodsList.forEach(item => {
|
|
|
if(item.isChecked) {
|
|
|
- goodsCheckedLength++;
|
|
|
+ goodsCheckedLength++
|
|
|
}
|
|
|
})
|
|
|
- this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
|
+ this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength
|
|
|
},
|
|
|
checkShop(item){//与单选商品类似
|
|
|
- item.isChecked = !item.isChecked;
|
|
|
- this.setProductChecked(item);
|
|
|
- this.updateCheckAllBtn();
|
|
|
+ item.isChecked = !item.isChecked
|
|
|
+ this.setProductChecked(item)
|
|
|
+ this.updateCheckAllBtn()
|
|
|
},
|
|
|
setProductChecked(item) {
|
|
|
item.cartList.forEach(pros=>{
|
|
|
if(item.isChecked) {
|
|
|
- pros.isChecked = true;
|
|
|
+ pros.isChecked = true
|
|
|
if(!this.submitIds.includes(pros.productId*1)){
|
|
|
- this.submitIds.push(pros.productId);
|
|
|
+ this.submitIds.push(pros.productId)
|
|
|
}
|
|
|
} else {
|
|
|
- pros.isChecked = false;
|
|
|
- var lent = this.submitIds.indexOf(pros.productId*1);
|
|
|
+ pros.isChecked = false
|
|
|
+ var lent = this.submitIds.indexOf(pros.productId*1)
|
|
|
if(lent >=0 ){
|
|
|
- this.submitIds.splice(lent, 1);
|
|
|
+ this.submitIds.splice(lent, 1)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -484,28 +484,28 @@
|
|
|
if(this.isshowDelbtn) {
|
|
|
// 当管理删除按钮出现时,失效的商品可被选择
|
|
|
this.goodsList.forEach((item)=>{
|
|
|
- item.isChecked = this.isCheckAll;
|
|
|
- this.setProductChecked(item);
|
|
|
+ item.isChecked = this.isCheckAll
|
|
|
+ this.setProductChecked(item)
|
|
|
})
|
|
|
} else {
|
|
|
this.goodsList.forEach((item)=>{
|
|
|
- item.isChecked = this.isCheckAll;
|
|
|
- this.setProductChecked(item);
|
|
|
+ item.isChecked = this.isCheckAll
|
|
|
+ this.setProductChecked(item)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
checkAll(){//全选方法内调用方法
|
|
|
- this.isCheckAll = !this.isCheckAll;
|
|
|
- this.updateBothCheckBtn();
|
|
|
+ this.isCheckAll = !this.isCheckAll
|
|
|
+ this.updateBothCheckBtn()
|
|
|
},
|
|
|
totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
|
|
|
- let touchPrice = 0;
|
|
|
- let reducedPrice = 0;//商铺合计满减价
|
|
|
+ let touchPrice = 0
|
|
|
+ let reducedPrice = 0//商铺合计满减价
|
|
|
this.goodsList.map((item,index)=>{
|
|
|
//计算店铺满减后店铺合计
|
|
|
if(item.promotions && item.promotions.mode == 2){
|
|
|
- let prosPrice=0;
|
|
|
- let totalOriginalPrice = 0;//商铺合计原价
|
|
|
+ let prosPrice=0
|
|
|
+ let totalOriginalPrice = 0//商铺合计原价
|
|
|
item.cartList.forEach(pros=>{
|
|
|
prosPrice += pros.price*pros.number
|
|
|
totalOriginalPrice += pros.price*pros.number
|
|
@@ -519,12 +519,12 @@
|
|
|
item.totalPrice = prosPrice
|
|
|
}
|
|
|
}else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
|
|
|
- let _totalPrice = 0;
|
|
|
- let _reducedPrice = 0;
|
|
|
- let _totalOriginalPrice =0;
|
|
|
+ let _totalPrice = 0
|
|
|
+ let _reducedPrice = 0
|
|
|
+ let _totalOriginalPrice =0
|
|
|
item.cartList.forEach(pros=>{
|
|
|
let _price = pros.price*pros.number
|
|
|
- _totalOriginalPrice += pros.price*pros.number;
|
|
|
+ _totalOriginalPrice += pros.price*pros.number
|
|
|
if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
|
|
|
if(_price >= pros.promotions.touchPrice){
|
|
|
_price = _price - pros.promotions.reducedPrice
|
|
@@ -532,8 +532,8 @@
|
|
|
}
|
|
|
_totalPrice += _price
|
|
|
}else{
|
|
|
- _reducedPrice = 0;
|
|
|
- _totalPrice += pros.price*pros.number;
|
|
|
+ _reducedPrice = 0
|
|
|
+ _totalPrice += pros.price*pros.number
|
|
|
}
|
|
|
})
|
|
|
item.reducedPrice = _reducedPrice
|
|
@@ -543,24 +543,24 @@
|
|
|
})
|
|
|
},
|
|
|
totalPeice(){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
|
|
|
- let totalPrice = 0;
|
|
|
- let reducedPrice = 0;
|
|
|
- let originalPrice = 0;
|
|
|
+ let totalPrice = 0
|
|
|
+ let reducedPrice = 0
|
|
|
+ let originalPrice = 0
|
|
|
this.goodsList.forEach((item,index)=>{
|
|
|
- let supplierPrice = 0;
|
|
|
- let supplierReducedPrice = 0;
|
|
|
- item.totalprice = 0;
|
|
|
- item.reducedprice = 0;
|
|
|
- item.originalprice = 0;
|
|
|
+ let supplierPrice = 0
|
|
|
+ let supplierReducedPrice = 0
|
|
|
+ item.totalprice = 0
|
|
|
+ item.reducedprice = 0
|
|
|
+ item.originalprice = 0
|
|
|
item.cartList.forEach(pros=>{
|
|
|
if(pros.isChecked){
|
|
|
- supplierPrice += pros.price*pros.number;
|
|
|
+ supplierPrice += pros.price*pros.number
|
|
|
// 单品满减
|
|
|
if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
|
|
|
// 单品满减-重新计算供应商总价/满减金额
|
|
|
if(pros.price*pros.number >= pros.promotions.touchPrice){
|
|
|
- supplierPrice -= pros.promotions.reducedPrice;
|
|
|
- supplierReducedPrice += pros.promotions.reducedPrice;
|
|
|
+ supplierPrice -= pros.promotions.reducedPrice
|
|
|
+ supplierReducedPrice += pros.promotions.reducedPrice
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -569,51 +569,51 @@
|
|
|
if(item.promotions && item.promotions.mode*1===2){
|
|
|
// 店铺满减-计算供应商总价/满减金额
|
|
|
if(supplierPrice >= item.promotions.touchPrice){
|
|
|
- supplierPrice -= item.promotions.reducedPrice;
|
|
|
- supplierReducedPrice += item.promotions.reducedPrice;
|
|
|
+ supplierPrice -= item.promotions.reducedPrice
|
|
|
+ supplierReducedPrice += item.promotions.reducedPrice
|
|
|
}
|
|
|
}
|
|
|
- item.totalprice = supplierPrice;
|
|
|
- item.reducedprice = supplierReducedPrice;
|
|
|
- item.originalprice = (supplierPrice+supplierReducedPrice);
|
|
|
- totalPrice += item.totalprice;
|
|
|
- reducedPrice += item.reducedprice;
|
|
|
- originalPrice += item.originalprice;
|
|
|
+ item.totalprice = supplierPrice
|
|
|
+ item.reducedprice = supplierReducedPrice
|
|
|
+ item.originalprice = (supplierPrice+supplierReducedPrice)
|
|
|
+ totalPrice += item.totalprice
|
|
|
+ reducedPrice += item.reducedprice
|
|
|
+ originalPrice += item.originalprice
|
|
|
})
|
|
|
//总促销计算
|
|
|
this.promotionsList.forEach(promotions =>{
|
|
|
// 凑单满减
|
|
|
if(promotions.mode*1===2 && promotions.type*1===2){
|
|
|
- let total = 0;
|
|
|
+ let total = 0
|
|
|
promotions.products.forEach(pros=>{
|
|
|
if (this.submitIds.includes(pros.productId*1)){
|
|
|
- total += pros.number * pros.price;
|
|
|
+ total += pros.number * pros.price
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
if(total>=promotions.touchPrice){
|
|
|
- totalPrice -= promotions.reducedPrice;
|
|
|
- reducedPrice += promotions.reducedPrice;
|
|
|
+ totalPrice -= promotions.reducedPrice
|
|
|
+ reducedPrice += promotions.reducedPrice
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
//最后统计商品原价
|
|
|
- this.totalOriginalPrice = originalPrice;
|
|
|
+ this.totalOriginalPrice = originalPrice
|
|
|
//最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
|
|
|
- this.reducedPrice = reducedPrice;
|
|
|
+ this.reducedPrice = reducedPrice
|
|
|
//最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
|
|
|
- this.allPrice = totalPrice ;
|
|
|
+ this.allPrice = totalPrice
|
|
|
},
|
|
|
totalCount(){//计算总数量
|
|
|
this.allCount = 0
|
|
|
let prosAllCount=0
|
|
|
let validCount = 0
|
|
|
- let validList =[];
|
|
|
- let productsList =[];
|
|
|
+ let validList =[]
|
|
|
+ let productsList =[]
|
|
|
this.goodsList.forEach(item=>{
|
|
|
productsList = item.cartList
|
|
|
productsList.forEach(pros=>{
|
|
|
if(pros.isChecked){
|
|
|
- prosAllCount+=parseInt(pros.number);
|
|
|
+ prosAllCount+=parseInt(pros.number)
|
|
|
this.allCount = prosAllCount
|
|
|
}
|
|
|
})
|
|
@@ -631,12 +631,12 @@
|
|
|
this.isStock = false
|
|
|
}
|
|
|
this.updateShoppogNum(pros)
|
|
|
- this.totalShopPeice();
|
|
|
+ this.totalShopPeice()
|
|
|
},
|
|
|
changeCountSub(item,pros){//商品数量减减
|
|
|
if(pros.number<=pros.min){
|
|
|
pros.number= pros.min
|
|
|
- this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
|
|
|
+ this.$util.msg(`该商品最小起订量为${pros.min}`,2000)
|
|
|
return
|
|
|
}else{
|
|
|
if(pros.step === 2){
|
|
@@ -648,14 +648,14 @@
|
|
|
this.processActivityPrice(pros)
|
|
|
}
|
|
|
this.updateShoppogNum(pros)
|
|
|
- this.totalShopPeice();
|
|
|
+ this.totalShopPeice()
|
|
|
},
|
|
|
changeNnmber(e,item,pros){//输入商品数量更新
|
|
|
- let _value = e.detail.value;
|
|
|
+ let _value = e.detail.value
|
|
|
if(!this.$api.isNumber(_value)){
|
|
|
pros.number = pros.min
|
|
|
}else if(_value < pros.min){
|
|
|
- this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
|
|
|
+ this.$util.msg(`该商品最小起订量为${pros.min}`,2000)
|
|
|
pros.number = pros.min
|
|
|
}else if(_value % pros.min != 0){
|
|
|
pros.isStep = true
|
|
@@ -666,10 +666,10 @@
|
|
|
this.processActivityPrice(pros)
|
|
|
}
|
|
|
this.updateShoppogNum(pros)
|
|
|
- this.totalShopPeice();
|
|
|
+ this.totalShopPeice()
|
|
|
},
|
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
|
- let ladderPriceList = pros.ladderPrices;
|
|
|
+ let ladderPriceList = pros.ladderPrices
|
|
|
if(pros.ladderFlag == 0 || pros.actStatus == 1){
|
|
|
pros.price = pros.price
|
|
|
}else{
|
|
@@ -688,16 +688,17 @@
|
|
|
serviceProviderId:this.listQuery.serviceProviderId,
|
|
|
}
|
|
|
).then(response =>{
|
|
|
- this.isshowDelbtn = false;
|
|
|
- this.initGetCartGoodsList();
|
|
|
+ this.isshowDelbtn = false
|
|
|
+ this.isCheckAll = false
|
|
|
+ this.initGetCartGoodsList()
|
|
|
}).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
toConfirmation(){//跳转确认订单页面
|
|
|
- let setGoodsList=[];
|
|
|
- let productIdList = [];
|
|
|
- let productIds = '';
|
|
|
+ let setGoodsList=[]
|
|
|
+ let productIdList = []
|
|
|
+ let productIds = ''
|
|
|
this.goodsList.forEach(res=>{
|
|
|
let products = res.cartList
|
|
|
products.forEach(pros=>{
|
|
@@ -707,7 +708,7 @@
|
|
|
})
|
|
|
})
|
|
|
if(setGoodsList == ''){
|
|
|
- this.$util.msg("请先选择结算商品~",2000);
|
|
|
+ this.$util.msg('请先选择结算商品~',2000)
|
|
|
return
|
|
|
}else{
|
|
|
/**
|
|
@@ -749,23 +750,23 @@
|
|
|
}
|
|
|
},
|
|
|
showDelManager(){//显示删除商品管理
|
|
|
- this.isshowDelbtn = true;
|
|
|
+ this.isshowDelbtn = true
|
|
|
if(this.isCheckAll) {
|
|
|
- this.updateBothCheckBtn();
|
|
|
+ this.updateBothCheckBtn()
|
|
|
} else {
|
|
|
- this.updateCheckAllBtn();
|
|
|
+ this.updateCheckAllBtn()
|
|
|
}
|
|
|
},
|
|
|
hideDelManage(){//隐藏删除商品管理
|
|
|
- this.isshowDelbtn = false;
|
|
|
+ this.isshowDelbtn = false
|
|
|
if(this.isCheckAll) {
|
|
|
- this.updateBothCheckBtn();
|
|
|
+ this.updateBothCheckBtn()
|
|
|
} else {
|
|
|
- this.updateCheckAllBtn();
|
|
|
+ this.updateCheckAllBtn()
|
|
|
}
|
|
|
},
|
|
|
deleteList(){//删除购物车商品
|
|
|
- this.delGoodsList=[];
|
|
|
+ this.delGoodsList=[]
|
|
|
this.goodsList.forEach(delitem=>{
|
|
|
let products = delitem.cartList
|
|
|
products.forEach(pros=>{
|
|
@@ -780,7 +781,7 @@
|
|
|
}
|
|
|
})
|
|
|
if(this.delGoodsList.length == 0){
|
|
|
- this.$util.msg("请选择要删除的商品~",2000);
|
|
|
+ this.$util.msg('请选择要删除的商品~',2000)
|
|
|
return
|
|
|
}else{
|
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
@@ -790,10 +791,10 @@
|
|
|
serviceProviderId:this.listQuery.serviceProviderId
|
|
|
}
|
|
|
).then(response =>{
|
|
|
- this.$util.msg('删除成功',2000);
|
|
|
+ this.$util.msg('删除成功',2000)
|
|
|
setTimeout(()=>{
|
|
|
- this.isshowDelbtn = false;
|
|
|
- this.initGetCartGoodsList();
|
|
|
+ this.isshowDelbtn = false
|
|
|
+ this.initGetCartGoodsList()
|
|
|
},2000)
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
@@ -817,7 +818,7 @@
|
|
|
return false
|
|
|
},
|
|
|
navToListPage(id){
|
|
|
- this.isModallayer = true;
|
|
|
+ this.isModallayer = true
|
|
|
this.$api.navigateTo(`/pages/goods/product?id=${id}`)
|
|
|
}
|
|
|
},
|