Pārlūkot izejas kodu

commit -m 修复测试bug

zhengjinyi 4 gadi atpakaļ
vecāks
revīzija
58b490e447

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 2
common/css/iconfont.scss


+ 1 - 1
components/cm-custom/ws-custom.vue

@@ -110,7 +110,7 @@
 		      	
 		    },
 		    _goHome: function () {
-		      	uni.navigateTo({
+		      	uni.redirectTo({
 		        	url: '/pages/index/index'
 		      	})
 		    }

+ 7 - 1
components/cm-module/creatOrder/goodsList.vue

@@ -25,7 +25,9 @@
 							</view>
 							<view class="productspec">规格:{{ pros.unit }}</view>
 							<view class="productprice">
-								<view class="price"><text>¥{{ (pros.productType == 2 ? 0 : pros.retailPrice) | NumFormat }}</text></view>
+								<view class="price" :class="PromotionsFormat(pros.promotion) ? 'disabled' : ''">
+									<text>¥{{(PromotionsFormat(pros.promotion) ? pros.price : pros.retailPrice)  | NumFormat}}</text>
+								</view>
 								<view class="count"><text class="small">x</text>{{ pros.productCount }}</view>
 							</view>
 						</view>	
@@ -226,6 +228,10 @@
 						width: 48%;
 						color: #FF2A2A;
 						float: left;
+						&.disabled{
+							color: #999999;
+							text-decoration: line-through;
+						}
 					}
 					.count{
 						height: 100%;

+ 4 - 1
components/cm-module/orderDetails/goodsList.vue

@@ -22,7 +22,10 @@
 							<view class="producttitle">{{pros.name}}</view>
 							<view class="productspec product-view" v-if="pros.productCategory != 2">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
 							<view class="product-view">
-								<view class="view-num red">¥{{pros.price | NumFormat}}</view>
+								<view class="view-num red" v-if="pros.productType ==2 || pros.productType ==1">
+									<text>¥0.00</text>
+								</view>
+								<view class="view-num red" v-else>¥{{pros.price | NumFormat}}</view>
 							</view>
 							<view class="floor-item-act" v-if="pros.productPromotion!=null" >
 								<view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags" @click.stop="clickPopupShow(pros.productPromotion)">

+ 25 - 63
pages/user/cart/cart.vue

@@ -246,13 +246,6 @@
 						this.goodsList.forEach((item,index) => {
 							item.productList.forEach(pros => {
 								pros.shopId = item.shopId;
-								// if(pros.step === 2){ 
-								// 	if(pros.productCount % pros.min != 0){
-								// 		pros.productCount = pros.min
-								// 		this.totalShopPeice()
-								// 		this.updateShoppogNum(pros)
-								// 	}
-								// }
 							})
 						})
 						this.totalShopPeice()
@@ -383,44 +376,27 @@
 				let touchPrice = 0;
 				let reducedPrice = 0;//商铺合计满减价
 				this.goodsList.map((item,index)=>{
-					//计算店铺满减后店铺合计
-					// if(item.promotion && item.promotion.mode == 2){
-					// 	let prosPrice=0;
-					// 	let totalOriginalPrice = 0;//商铺合计原价
-					// 	item.productList.forEach(pros=>{
-					// 		prosPrice += pros.price*pros.productCount
-					// 		totalOriginalPrice += pros.originalPrice*pros.productCount
-					// 	})
-					// 	if(prosPrice >= item.promotion.touchPrice){
-					// 		item.totalPrice = prosPrice - item.promotion.reducedPrice  
-					// 		item.reducedPrice = item.promotion.reducedPrice
-					// 		item.totalOriginalPrice = totalOriginalPrice
-					// 	}else{
-					// 		item.reducedPrice = 0  //统计合计价格
-					// 		item.totalPrice = prosPrice
-					// 	}
-					// }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
-						let _totalPrice = 0;
-						let _reducedPrice = 0;
-						let _totalOriginalPrice =0;
-						item.productList.forEach(pros=>{
-							let _price = pros.retailPrice*pros.productCount
-							_totalOriginalPrice += pros.retailPrice*pros.productCount;
-							if(pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2){
-								if(_price >= pros.promotion.touchPrice){
-									_price = _price - pros.promotion.reducedPrice
-									_reducedPrice += pros.promotion.reducedPrice
-								}
-								_totalPrice +=  _price
-							}else{
-								_reducedPrice = 0;
-								_totalPrice += pros.retailPrice*pros.productCount;
+					let _totalPrice = 0;
+					let _reducedPrice = 0;
+					let _totalOriginalPrice =0;
+					item.productList.forEach(pros=>{
+						let _price = pros.retailPrice*pros.productCount
+						_totalOriginalPrice += pros.retailPrice*pros.productCount;
+						if(pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2){
+							if(_price >= pros.promotion.touchPrice){
+								_price = _price - pros.promotion.reducedPrice
+								_reducedPrice += pros.promotion.reducedPrice
 							}
-						})
-						item.reducedPrice = _reducedPrice
-						item.totalOriginalPrice = _totalOriginalPrice
-						item.totalPrice = _totalPrice
-					// }
+							_totalPrice +=  _price
+						}else{
+							_reducedPrice = 0;
+							_totalPrice += pros.retailPrice*pros.productCount;
+						}
+					})
+					item.reducedPrice = _reducedPrice
+					item.totalOriginalPrice = _totalOriginalPrice
+					item.totalPrice = _totalPrice
+					console.log(item.totalPrice)
 				})
 			},
 			totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
@@ -453,22 +429,6 @@
 					reducedPrice += item.reducedprice;
 					originalPrice += item.originalprice;
 				})
-				//  //总促销计算
-				// this.promotionsList.forEach(promotions =>{
-				// 	// 凑单满减
-				// 	if(promotion.mode*1===2 && promotion.type*1===2){
-				// 		let total = 0;
-				// 		 promotion.productList.forEach(pros=>{
-				// 			if (this.submitIds.includes(pros.productId*1)){
-				// 				total += pros.productCount * pros.price;
-				// 			}
-				// 		});
-				// 		if(total>=promotion.touchPrice){
-				// 			totalPrice -= promotion.reducedPrice;
-				// 			reducedPrice += promotion.reducedPrice;
-				// 		}
-				// 	}
-				// });
 				//最后统计商品原价
 				this.totalOriginalPrice = originalPrice;
 				//最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
@@ -523,22 +483,24 @@
 				this.totalShopPeice();
 			},
 			changeInput(pros){//输入商品数量更新
-				pros.isStep = false
+			
 			},
 			changeNnmber(e,item,pros){//输入商品数量更新
 				let _value = Number(e.detail.value);
 				if(!this.$api.isNumber(_value)){
 					pros.productCount = pros.minBuyNumber
 				}else if(_value < pros.minBuyNumber){	
+					console.log('111111')
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					pros.productCount = pros.minBuyNumber
 				}else if(_value % pros.minBuyNumber != 0){
+					console.log('22222222')
 					pros.productCount = pros.minBuyNumber
 				}else{
-					pros.productCount = e.detail.value
+					console.log('33333333')
+					pros.productCount = _value
 					this.processActivityPrice(pros)
 				}
-				console.log('222222222222')
 				this.updateShoppogNum(pros)
 				this.totalShopPeice();
 			},

+ 14 - 8
pages/user/order/create-order.vue

@@ -1,7 +1,5 @@
 <template>
 	<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
-		<!-- 透明模态层 -->
-		<modal-layer v-if='modallayer'></modal-layer>
 		<!-- 地址选择 -->
 		<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
 		<!-- 商品 -->
@@ -36,7 +34,7 @@
 				</view>
 			</view>
 			<view class="footer-submit" @click.stop="orderSubmitMit">
-				<view class="btn">提交订单</view>
+				<view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
 			</view>
 		</view>
 	</view>
@@ -48,7 +46,6 @@
 	import sellerInvoice from '@/components/cm-module/creatOrder/sellerInvoice'
 	import sellerFreight from '@/components/cm-module/creatOrder/sellerFreight'
 	import freightAlert from '@/components/cm-module/modelAlert/freightAlert.vue'
-	import modalLayer from "@/components/modal-layer"
 	export default {
 		components:{
 			choiceAddress,
@@ -56,11 +53,10 @@
 			sellerInvoice,
 			sellerFreight,
 			freightAlert,
-			modalLayer,
 		},
 		data() {
 			return {
-				modallayer:false,
+				isSubLoading:false,
 				orderID:0,
 				userId:'',
 				productIds:'',			  //获取上一级页面商品信息
@@ -94,9 +90,11 @@
 		onLoad(option){//商品数据
 			let data = JSON.parse(option.data);
 			this.allPrice = data.data.allPrice;
+			this.allCount = data.data.allCount;
 			this.payAllPrice = this.totalPrice;
 			this.userId = data.data.userId
 			this.productIds = data.data.productID
+			console.log(this.allCount)
 			this.getInitCrearOrder();
 		},
 		filters:{
@@ -184,6 +182,7 @@
 				this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
 			},
 			orderSubmitMit(){//提交订单
+				if(this.isSubLoading){ return; }
 				if(this.addressId == ''){
 					this.$util.msg('请先添加收货地址~',2000)
 					return
@@ -205,7 +204,7 @@
 				this.payInfo = {
 						orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
 						balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
-						freight:0,//邮费
+						freight:-1,//邮费
 						freePostFlag:-1//运费形式
 					}
 					console.log(this.payInfo)
@@ -216,10 +215,13 @@
 						payInfo:this.payInfo,		  //订单信息
 						orderInvoice:this.invoiceData //发票信息
 					}
-				this.modalLayer = true;	
+				this.isSubLoading = true;	
 				this.OrderService.CreatedOrderSubmit(params).then(response =>{
 					const data = response.data;
 					this.$util.msg('订单提交成功',2000,true,'success')
+					setTimeout(()=>{
+						this.isSubLoading = false;
+					},2000)
 					setTimeout(()=>{
 						this.$api.redirectTo(`/pages/user/order/success?orderId=${data.orderId}`)
 					},2000)
@@ -446,6 +448,10 @@
 				text-align: center;
 				line-height: 80rpx;
 				border-radius: 40rpx;
+				&.disabled{
+					background: #e4e8eb;
+					color: #999999;
+				}
 			}
 		}
 	}

+ 4 - 1
pages/user/order/order-list.vue

@@ -45,7 +45,10 @@
 												<view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
 												<view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
 												<view class="productprice">
-													<view class="price tui-skeleton-fillet">
+													<view class="price " v-if="pros.productType ==2 || pros.productType ==1">
+														<text>¥0.00</text>
+													</view>
+													<view class="price tui-skeleton-fillet" v-else>
 														<text>¥{{pros.price | NumFormat}}</text>
 													</view>
 													<view class="count tui-skeleton-fillet">

+ 6 - 5
pages/user/order/order-payment.vue

@@ -270,11 +270,12 @@
 						this.isUnbindWxPay = false
 					}
 					//判断线上线下显示
-					if(this.optionType == 'onlinePay'){
-						this.invoiceStatus = true
-					}else{
-						this.invoiceStatus = data.invoiceStatus
-					}
+					this.invoiceStatus = true
+					// if(this.optionType == 'onlinePay'){
+					// 	this.invoiceStatus = true
+					// }else{
+					// 	this.invoiceStatus = data.invoiceStatus
+					// }
 					if(data.receiptAmount > 0){
 						this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
 						this.isReceiptStatus = false

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels