Administrator 5 years ago
parent
commit
6fe8d5bdef

+ 3 - 4
components/cm-module/listTemplate/immediatelyList.vue

@@ -33,7 +33,7 @@
 		<!-- 单一商品 -->
 		<view class="product-container" v-else :style="{paddingTop:searchStatus?'112rpx':''}" >
 			<view :class="tabIndex" v-if="tabIndex === 0">
-				<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower" scroll-y v-if="productList.length > 0">
+				<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower(tabIndex)" scroll-y v-if="productList.length > 0">
 					<view v-for="(item,index) in productList" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productID)">
 					    <image mode='widthFix' :src="item.mainImage"  class="list-img" alt="list-img"></image>
 						<view class="list-details-info">
@@ -189,15 +189,14 @@
 			...mapState(['hasLogin','userInfo'])
 		},
 		methods:{
-			scrolltolower() {
+			scrolltolower(tabIndex) {
 				if(this.hasNextPage && this.pullFlag) {
 					if(tabIndex ==0){
 						this.getProductAgainInfo(true);
 					}else if(tabIndex==1){
 						console.log('tabindex11111')
-						getcombinationProduct(true);
+						this.getcombinationProduct(true);
 					}
-					
 				}
 			},
 			setScrollHeight() {

+ 12 - 12
seller/pages/cart/immediately.vue

@@ -115,7 +115,6 @@
 				number:0,
 				buyRetailPrice:0,
 				hanldChangeTabIndex:0,
-				buttonText:'加入购物车',
 				productKind:0,
 				productTotalNum:0,
 				productTotalAmount:0,
@@ -133,22 +132,15 @@
 				})
 			},
 			hanldChangeTab(index){
-				// console.log(this.$refs.productList.tabIndex)
 				if(index == 1){
 					this.$refs.productList.getcombinationProduct()
 				}
 			},
 			hanldalertjietiConfim(data){
-				console.log(data,'阶梯')
 				this.ladderPriceList = data.ladderPriceList
-				 // data.ladderPriceList.forEach(item=>{
-					//  this.buyNumRangeShow =item.buyNumRangeShow;
-					//  this.buyPrice = item.buyPrice;
-				 // })
 				this.specClassjieti='show';
 			},
 			hanldOperationConfim(data){//显示选择数量确认弹窗
-				console.log(data)
 				this.handleData = data
 				if(this.$refs.productList.tabIndex == 1){
 					if(data.productKind ==0){
@@ -228,7 +220,6 @@
 			let productID = '';
 			let productNum ='';
 			this.handleData.combinationProductList.forEach(item =>{
-				console.log(item)
 				if(item.initProductNum >0){
 					setGoodsList.productId = item.productID
 					setGoodsList.productNum =item.initProductNum
@@ -244,13 +235,22 @@
 				console.log(params)
 				getCartAddCart({'params':JSON.stringify(params)}).then(response => {
 					this.specClasszuhe = 'hide';
-					this.$util.msg('加入购物车成功',1500,true,'success')
-					this.getClubProductNum()
+					this.$util.msg('加入购物车成功',1500,true,'success');
+					this.getClubProductNum();
+					this.clearProduct();//清空
 					setTimeout(() => {this.specClasszuhe = 'none'}, 200)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
+			clearProduct(data){
+				this.handleData = datadata;
+				console.log('清空')
+				console.log(this.productKind)
+				this.productKind= 0;
+				this.productTotalNum = 0;
+				this.productTotalAmount = 0;
+			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功
 				let params ={
 						productId:this.handleData.productID,
@@ -261,7 +261,7 @@
 				shoppingCartAddCart(params).then(response => {
 					this.specClass = 'hide';
 					this.$util.msg('加入购物车成功',1500,true,'success')
-					this.getClubProductNum()
+					this.getClubProductNum();
 					setTimeout(() => {this.specClass = 'none'}, 200)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);