瀏覽代碼

商品倍数增长

zhengjinyi 5 年之前
父節點
當前提交
650f6b3532

+ 22 - 3
pages/goods/cart.vue

@@ -241,9 +241,11 @@
 								pros.isStep = false
 								if(pros.validFlag == '3' ) {invalidLength++;}
 								if(pros.step === 2){
-									pros.productCount = pros.minBuyNumber 
-									this.totalShopPeice()
-									this.updateShoppogNum(pros)
+									if(pros.productCount % pros.minBuyNumber != 0){
+										pros.productCount = pros.minBuyNumber
+										this.totalShopPeice()
+										this.updateShoppogNum(pros)
+									}
 								}
 							})
 							item.isDisabled = invalidLength === productsListLength;
@@ -276,6 +278,23 @@
 					let resultsData = response.data.pageDate
 					this.hasNextPage = resultsData.hasNextPage;
 					this.goodsList = this.goodsList.concat(resultsData.results)
+					this.goodsList.forEach((item,index) => {
+						let productsListLength = item.productsList.length,
+							invalidLength = 0;
+						item.productsList.forEach(pros => {
+							pros.shopID = item.shopID;
+							pros.isStep = false
+							if(pros.validFlag == '3' ) {invalidLength++;}
+							if(pros.step === 2){
+								if(pros.productCount % pros.minBuyNumber != 0){
+									pros.productCount = pros.minBuyNumber
+									this.totalShopPeice()
+									this.updateShoppogNum(pros)
+								}
+							}
+						})
+						item.isDisabled = invalidLength === productsListLength;
+					})
 					this.pullFlag = false;// 防上拉暴滑
 					setTimeout(()=>{this.pullFlag = true;},500)
 					if(this.hasNextPage){

+ 22 - 3
pages/tabBar/cart/cart.vue

@@ -231,9 +231,11 @@
 								pros.isStep = false
 								if(pros.validFlag == '3' ) {invalidLength++;}
 								if(pros.step === 2){ 
-									pros.productCount = pros.minBuyNumber 
-									this.totalShopPeice()
-									this.updateShoppogNum(pros)
+									if(pros.productCount % pros.minBuyNumber != 0){
+										pros.productCount = pros.minBuyNumber
+										this.totalShopPeice()
+										this.updateShoppogNum(pros)
+									}
 								}
 							})
 							item.isDisabled = invalidLength === productsListLength;
@@ -266,6 +268,23 @@
 					let resultsData = response.data.pageDate
 					this.hasNextPage = resultsData.hasNextPage;
 					this.goodsList = this.goodsList.concat(resultsData.results)
+					this.goodsList.forEach((item,index) => {
+						let productsListLength = item.productsList.length,
+							invalidLength = 0;
+						item.productsList.forEach(pros => {
+							pros.shopID = item.shopID;
+							pros.isStep = false
+							if(pros.validFlag == '3' ) {invalidLength++;}
+							if(pros.step === 2){ 
+								if(pros.productCount % pros.minBuyNumber != 0){
+									pros.productCount = pros.minBuyNumber
+									this.totalShopPeice()
+									this.updateShoppogNum(pros)
+								}
+							}
+						})
+						item.isDisabled = invalidLength === productsListLength;
+					})
 					this.pullFlag = false;// 防上拉暴滑
 					setTimeout(()=>{this.pullFlag = true;},500)
 					if(this.hasNextPage){

+ 75 - 6
seller/pages/cart/cart.vue

@@ -42,6 +42,7 @@
 														{{pros.retailPrice ? pros.retailPrice.toFixed(2) : ''}}
 												</view>
 												<view class="count" :class="[isshowDelbtn ? 'none':'show']">
+													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
 													<view class="number-box">
 														<view  class="iconfont icon-jianhao"  @click="changeCountSub(item,pros)"></view>
 														<input class="btn-input" type="number" maxlength='6' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
@@ -187,10 +188,17 @@
 						this.hasNextPage = resultsData.hasNextPage;
 						this.goodsList = resultsData.results;
 						this.goodsList.forEach((item,index) => {
-							let productsListLength = item.productsList.length,
-								invalidLength = 0;
+							let productsListLength = item.productsList.length,invalidLength = 0;
 							item.productsList.forEach(pros => {
 								pros.shopID = item.shopID;
+								pros.isStep = false
+								if(pros.step === 2){
+									if(pros.productCount % pros.minBuyNumber != 0){
+										pros.productCount = pros.minBuyNumber
+										this.totalShopPeice()
+										this.updateShoppogNum(pros)
+									}
+								}
 							})
 						})
 						this.pullFlag = false;
@@ -221,6 +229,20 @@
 					let resultsData = response.data.pageDate
 					this.hasNextPage = resultsData.hasNextPage;
 					this.goodsList = this.goodsList.concat(resultsData.results)
+					this.goodsList.forEach((item,index) => {
+						let productsListLength = item.productsList.length,invalidLength = 0;
+						item.productsList.forEach(pros => {
+							pros.shopID = item.shopID;
+							pros.isStep = false
+							if(pros.step === 2){
+								if(pros.productCount % pros.minBuyNumber != 0){
+									pros.productCount = pros.minBuyNumber
+									this.totalShopPeice()
+									this.updateShoppogNum(pros)
+								}
+							}
+						})
+					})
 					this.pullFlag = false;// 防上拉暴滑
 					setTimeout(()=>{this.pullFlag = true;},500)
 					if(this.hasNextPage){
@@ -351,9 +373,16 @@
 			    })
 			},		
 			changeCountAdd(item,pros){//商品数量加加
-				pros.productCount++
-				this.processActivityPrice(pros)
-				this.isStock =false
+				if(pros.step === 2){
+					pros.isStep = false
+					pros.productCount += pros.minBuyNumber
+					this.processActivityPrice(pros)
+					this.isStock = false
+				}else{
+					pros.productCount++
+					this.processActivityPrice(pros)
+					this.isStock = false
+				}
 				this.updateShoppogNum(pros)
 				this.totalShopPeice();
 			},
@@ -363,7 +392,12 @@
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					return
 				}else{
-					pros.productCount--
+					if(pros.step === 2){
+						pros.isStep = false
+						pros.productCount -= pros.minBuyNumber
+					}else{
+						pros.productCount--
+					}
 					this.processActivityPrice(pros)
 				}
 				this.updateShoppogNum(pros)
@@ -376,7 +410,11 @@
 				}else if(_value < pros.minBuyNumber){	
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					pros.productCount = pros.minBuyNumber
+				}else if(_value % pros.minBuyNumber != 0){
+					pros.isStep = true
+					pros.productCount = pros.minBuyNumber
 				}else{
+					pros.isStep = false
 					pros.productCount = e.detail.value
 					this.processActivityPrice(pros)
 				}
@@ -740,6 +778,37 @@
 					&.none{
 						display: none;
 					}
+					.count-tips{
+						width: auto;
+						display: inline-block;
+						padding: 0 15rpx;
+						line-height: 44rpx;
+						height: 44rpx;
+						border-radius: 22rpx;
+						background: $btn-confirm;
+						font-size: $font-size-24;
+						text-align: center;
+						color: #FFFFFF;
+						position: absolute;
+						top:-60rpx;
+						left: -5rpx; 
+						z-index: 5;
+						&.step{
+							left:-217rpx
+						}
+						&::before{
+							content: "";
+							position: absolute;
+							bottom: -30rpx;
+							right: 15rpx;
+							z-index:1;
+							width: 0; 
+							height: 0;
+							border-width: 18rpx;
+							border-style: solid;
+							border-color:$color-system transparent transparent transparent;
+						}
+					}
 					.number-box{
 						display: flex;
 						justify-content: center;

+ 2 - 2
services/ajax.env.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
-	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 6 - 2
supplier/pages/deliver/add-logistics.vue

@@ -36,7 +36,7 @@
 						<image :src="item" mode="aspectFill" @click.stop="previewImg(index)"></image>
 						<text class="iconfont icon-iconfontguanbi" @click.stop="deletePhotoFn(index)"></text>
 					</view>
-					<view class="photo-item add" @click.stop="uploadPhotoFn" v-if="photoLists.length<10">
+					<view class="photo-item add" @click.stop="uploadPhotoFn" v-if="photoLists.length<10 || photoLists.length == 0">
 						<text class="iconfont icon-jiahao"></text>
 					</view>
 				</view>
@@ -110,7 +110,11 @@
 			initGetLogisticsInfo(){
 				this.ShopService.GetLogisticsInfo({ logisticsBatchId : this.logisticsBatchId, shopOrderId:this.info.shopOrderId }).then(response =>{
 					const data = response.data.logisticsBatch
-					this.photoLists = data.remarkImages
+					if(data.remarkImages!=null){
+						this.photoLists = data.remarkImages
+					}else{
+						this.photoLists =[]
+					}
 					this.info.note = data.remark
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);

+ 4 - 4
supplier/pages/deliver/deliver-record.vue

@@ -16,8 +16,8 @@
 							<view class="top-viewlabel">发货时间:</view>
 							<view class="top-viewtext">{{item.deliveryTime}}</view>
 						</view>
-						<view class="top-view">
-							<view class="top-viewlabel" v-for="(logist,idx) in item.logisticsInformationList" :key="logist.id">{{logist.logisticsCompanyName}}:</view>
+						<view class="top-view" v-for="(logist,idx) in item.logisticsInformationList" :key="logist.id">
+							<view class="top-viewlabel">{{logist.logisticsCompanyName}}:</view>
 							<view class="top-viewtext">
 								<text>{{logist.nu}}</text>
 							</view>
@@ -43,7 +43,7 @@
 								</view>
 							</view>	
 						</view>
-						<view class="goods-pros-b clearfix">
+						<view class="goods-pros-b clearfix" v-show="item.remarkImages.length>0">
 							<view class="b-label">拍照备注</view>
 							<view class="b-photo">
 								<view class="b-imageView" v-for="(imgItem,imgIdx) in item.remarkImages" :key="imgIdx" >
@@ -52,7 +52,7 @@
 							</view>
 						</view>
 						<view class="goods-pros-b clearfix" v-if="item.remark!=''">
-							<view class="b-label">拍照备注</view>
+							<view class="b-label">文字备注</view>
 							<view class="b-photo">
 								<view class="text">{{item.remark ? item.remark : ''}}</view>
 							</view>

+ 3 - 3
supplier/pages/order/order-details.vue

@@ -41,13 +41,13 @@
 									<view class="view-num">未发货:{{pros.notOutStore-pros.actualCancelNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已退货:{{pros.returnedNum}}</view>
-									<view class="view-num">已取消:{{pros.actualCancelNum}}</view>
+									<view class="view-num" v-if="pros.returnedNum>0">已退货:{{pros.returnedNum}}</view>
+									<view class="view-num" v-if="pros.actualCancelNum>0">已取消:{{pros.actualCancelNum}}</view>
 								</view>
 							</view>	
 						</view>
 					</view>	
-					<view class="goods-pros-m" v-if="orderInfo.note!=''">
+					<view class="goods-pros-m" v-if="orderInfo.note!=null || orderInfo.note!=''">
 						<view class="m-text">留言:</view>
 						<view class="m-input">
 							<view class="text">{{orderInfo.note ? orderInfo.note : ''}}</view>

+ 3 - 3
supplier/pages/order/order-service-details.vue

@@ -41,14 +41,14 @@
 									<view class="view-num">未发货:{{pros.notOutStore-pros.actualCancelNum}}</view>
 								</view>
 								<view class="product-view">
-									<view class="view-num">已退货:{{pros.returnedNum}}</view>
-									<view class="view-num">已取消:{{pros.actualCancelNum}}</view>
+									<view class="view-num" v-if="pros.returnedNum>0">已退货:{{pros.returnedNum}}</view>
+									<view class="view-num" v-if="pros.actualCancelNum>0">已取消:{{pros.actualCancelNum}}</view>
 								</view>
 								<text class="iconfont icon-genghuan"></text>
 							</view>	
 						</view>
 					</view>	
-					<view class="goods-pros-m" v-if="orderInfo.note!=''">
+					<view class="goods-pros-m" v-if="orderInfo.note!=null || orderInfo.note!=''">
 						<view class="m-text">留言:</view>
 						<view class="m-input">
 							<view class="text">{{orderInfo.note ? orderInfo.note : ''}}</view>