浏览代码

commit -m 服务返佣

zhengjinyi 3 年之前
父节点
当前提交
6f6052c987
共有 1 个文件被更改,包括 124 次插入14 次删除
  1. 124 14
      pages/seller/order/create-order.vue

+ 124 - 14
pages/seller/order/create-order.vue

@@ -5,9 +5,17 @@
 		<!-- 商品 -->
 		<seller-goodsList ref='goods' v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></seller-goodsList>
 		<!-- 返佣订单 -->
-		<view class="Rebate" @click="handleSecondFlag" v-if="goodsData.length==1 && secondflag">
-			<text class="rebate-title">返佣订单</text>
-			<text class="iconfont" :class="rebatecheck?'icon-yixuanze':'icon-weixuanze'" ></text>
+		<view class="order-return" v-if="goodsData.length==1 && secondflag">
+			<view class="order-return-main" @click="handleRebateFlag">
+				<view class="label">是否返佣</view>
+				<view class="label-right">
+					<text class="text-l">{{ rebateFeeText }}</text>
+					<text class="iconfont icon-xiayibu"></text>
+				</view>
+			</view>
+			<view class="order-return-input" v-if="confirmParam.payInfo.rebateFlag === 2">
+				<input class="input" @blur="handleRebateFee($event)" type="number" placeholder="请输入返佣服务费" maxlength="20">
+			</view>
 		</view>
 		<!-- 返佣订单 -->
 		<view class="Rebate" @click="handleSecondFlag" v-if="!secondflag">
@@ -216,10 +224,12 @@
 						postage: 0,				// 运费金额
 						postageFlag: 0,			// 运费类型
 						userBeans: 0,			// 抵扣采美豆数量
+						rebateFee:0, 			// 返佣服务费
 						rebateFlag:0			// 是否返佣订单
 					},
 					unionId:uni.getStorageSync('unionId'),// 用户unionId
 				}, 	
+				rebateFeeText:'否',
 				productIds:'',			  //商品ID,
 				confirmType:1,			  
 				submitState:'',  		  // 提交状态
@@ -480,7 +490,16 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){//提交订单
-				console.log('secondflag',this.secondflag)
+				if(this.confirmParam.addressId == ''){
+					this.$util.msg('请先添加收货地址~',2000)
+					return
+				}
+				if(this.confirmParam.payInfo.rebateFlag ===2){
+					if(this.confirmParam.payInfo.rebateFee == ''){
+						this.$util.msg('请输入返佣服务费',2000)
+						return
+					}
+				}
 				if(this.secondflag){
 					this.modal = true
 					this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
@@ -498,10 +517,7 @@
 			SellerCreateOrderSubmit(){
 				//提交订单
 				if(this.isSubLoading){ return }
-				if(this.confirmParam.addressId == ''){
-					this.$util.msg('请先添加收货地址~',2000)
-					return
-				}
+				
 				this.confirmParam.orderInfo = this.goodsData.map(el => {
 					let productInfo = []
 					el.cartList.forEach(item => {
@@ -545,11 +561,33 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			handleSecondFlag(){// 返佣订单勾选
-				this.rebatecheck = !this.rebatecheck
-				if(this.rebatecheck){
-					this.ischecked = false
-					this.confirmParam.payInfo.rebateFlag=1
+			handleRebateFee(event){// 返佣服务费
+				let rebateFee = Number(event.detail.value)
+				this.confirmParam.payInfo.rebateFee = rebateFee.toFixed(2)
+			},
+			handleRebateFlag(){// 普通订单返佣
+				let self = this
+				uni.showActionSheet({
+					title:'标题',
+					itemList: ['返佣订单', '普通订单,存在返佣服务费','否'],
+					success: (e) => {
+						switch(e.tapIndex){
+							case 0:
+								self.confirmParam.payInfo.rebateFlag = 1
+								self.rebateFeeText = '返佣订单'
+								break
+							case 1:
+								self.confirmParam.payInfo.rebateFlag = 2
+								self.rebateFeeText = '普通订单,存在返佣服务费'
+								break
+							case 2:
+								self.confirmParam.payInfo.rebateFlag = 0
+								self.rebateFeeText = '否'
+								break
+						}
+					}
+				})
+				if(this.confirmParam.payInfo.rebateFlag ===1){
 					this.confirmParam.payInfo.balancePayFlag = 0
 					this.couponAmount = 0
 					this.confirmParam.clubCouponId = 0
@@ -565,7 +603,6 @@
 				}else{
 					this.confirmParam.orderSeen = 1
 					this.$refs.clubVisible.orderVisibleText = '可见'
-					this.confirmParam.payInfo.rebateFlag=0
 					if(this.couponList.length>0){
 						this.confirmParam.clubCouponId = this.couponList[0].clubCouponId 
 						this.$refs.coupon.coupon.couponAmount = this.couponAmount = this.couponList[0].couponAmount
@@ -574,6 +611,27 @@
 					this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
 				}
 			},
+			handleSecondFlag(){// 二手订单勾选返佣
+				this.rebatecheck = !this.rebatecheck
+				if(this.rebatecheck){
+					this.ischecked = false
+					this.confirmParam.payInfo.rebateFlag=1
+					this.confirmParam.payInfo.balancePayFlag = 0
+					this.confirmParam.clubCouponId = 0
+					this.confirmParam.orderSeen = 2
+					this.$refs.clubVisible.orderVisibleText = '不可见'
+					this.$refs.clubVisible.current = 1
+					this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
+					this.$refs.freight.infoData(this.freightData)
+					this.$refs.freight.freightData  = this.freightData
+					this.handleFreightData = this.freightData
+				}else{
+					this.confirmParam.orderSeen = 1
+					this.$refs.clubVisible.orderVisibleText = '可见'
+					this.confirmParam.payInfo.rebateFlag=0
+					this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
+				}
+			},
 			handFreightAlertShow(){//显示邮费弹窗
 				this.isfreightTip = true
 			},
@@ -806,6 +864,58 @@
 			}
 		}
 	}
+	.order-return{
+		width: 100%;
+		height: auto;
+		box-sizing: border-box;
+		padding: 0 24rpx;
+		background: #FFFFFF;
+		float: left;
+		margin: 24rpx 0;
+		.order-return-main{
+			width:100%;
+			height: 86rpx;
+			line-height: 86rpx;
+			.label{
+				float: left;
+				font-weight: bold;
+				color: #333333;
+				font-size: $font-size-28;
+			}
+			.label-right{
+				float: right;
+				color: #2A81FF;
+				.text-l{
+					font-size: 28rpx;
+					font-weight: bold;
+					margin-right: 20rpx;
+				}
+				.icon-xiayibu{
+					line-height: 88rpx;
+					color: #999999;
+					font-weight: normal;
+				}
+			}
+			
+		}
+		.order-return-input{
+			width: 100%;
+			height: 86rpx;
+			padding-bottom: 20rpx;
+			box-sizing: border-box;
+			.input{
+				width: 100%;
+				height: 66rpx;
+				font-size: $font-size-26;
+				border: 1px solid #e1e1e1;
+				line-height: 66rpx;
+				color: #333333;
+				border-radius: 4rpx;
+				box-sizing: border-box;
+				padding: 0 20rpx;
+			}
+		}
+	}
 	.Rebate{
 		width: 702rpx;
 		height: auto;