zhengjinyi 4 anos atrás
pai
commit
37a6a0eef5

+ 2 - 2
common/config/config.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.1.33:8008'	 //俊俊联调地址
-	URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
-	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.10:8008'	 //超超联调地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{

+ 1 - 1
components/cm-module/modelAlert/cancelAlert.vue

@@ -1,5 +1,5 @@
 <template name="alert">
-	<view class="alert spec" :class="specClass">
+	<view class="alert spec">
 		<view class="model-warp">
 			<view class="model-alert">
 				<view class="model-content">

+ 60 - 39
components/cm-module/modelAlert/order-alert.vue

@@ -1,15 +1,31 @@
 <template name="sharealert">
-	<view class="alert spec" :class="specClass">
-		<view class="model-warp">
+	<view class="alert spec" >
+		<view class="model-warp" @click.stop="hideConfirm">
 			<view class="content" v-if="modelType == 1">
 				<view class="content-title"></view>
-				<view class="text-content">
-					<view class="share">您的分享码:<text class="txt">{{shareCode}}</text></view>
+				<view class="text-content clearfix">
 					<view class="text">
-						<text>有效期为24小时。订单分享后若对方无法直接登录小程序查看订单,请提供该分享码给对方,通过输入分享码查看</text>
-					</view>
+						<text>您有采美余额¥{{payModelData.ableUserMoney}}暂未使用,是否需要抵扣订单?</text>
+						<text>抵扣后您只需再支付¥{{payModelData.pendingPayments}}</text></view>
+					<view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
+					<view class="alert-btn" @click="paymentConfirm(1,dataInfo)">抵扣,继续付款</view>
+				</view>				
+			</view>
+			<view class="content" v-if="modelType == 2">
+				<view class="content-title"></view>
+				<view class="text-content clearfix">
+					<view class="text">您有采美余额¥{{payModelData.ableUserMoney}}暂未使用,是否需要抵扣订单?抵扣后订单支付完成</view>
+					<view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
+					<view class="alert-btn" @click="paymentConfirm(2,dataInfo)">抵扣</view>
+				</view>				
+			</view>
+			<view class="content" v-if="modelType == 3">
+				<view class="content-title"></view>
+				<view class="text-content clearfix">
+					<view class="text">目前机构余额剩余¥{{}}是否抵扣订单?</view>
+					<view class="alert-btn" @click="cancelConfirm">不抵扣,继续付款</view>
+					<view class="alert-btn" @click="btnConfirm">抵扣</view>
 				</view>				
-				<view class="alert-btn"></view>
 			</view>
 		</view>
 	</view>
@@ -22,26 +38,40 @@
 		props:{
 			modelType:{
 				type:Number,
-				default:1
+				default:3
 			},
 			orderID:{
 				type:Number
+			},
+			payModelData:{
+				type:Object
 			}
 		},
 		data() {
 			return{
-				shareCode:'',
+				dataInfo:{}
 			}
 		},
 		created() {
-			
+			this.infoData(this.payModelData)
 		},
 		methods:{
+			infoData(el){
+				this.dataInfo = el
+			},
 			hideConfirm(){
-				this.$parent.isShareModal = false
+				this.$parent.isPayModel = false
 			},
-			btnConfirm(code){//点击事件
-				this.$emit('btnConfirm')
+			cancelConfirm(data){
+				this.$emit('cancelConfirm',data)
+			},
+			paymentConfirm(type,data){
+				this.$parent.isPayModel = false
+				let _data = {type:type,order:data}
+				this.$emit('paymentConfirm',_data)
+			},
+			btnConfirm(data){//点击事件
+				this.$emit('btnConfirm',data)
 			}
 		}
 	}
@@ -79,7 +109,12 @@
 			top: 50%;
 			transform: translate(-50%,-50%);
 			border-radius: 14rpx;
+			background-color: #FFFFFF;
+			padding-top: 180rpx;
 			.content-title{
+				position: absolute;
+				left: 0;
+				top: -53rpx;
 				width: 100%;
 				height: 232rpx;
 				background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/08/alert%402x.png) no-repeat;
@@ -92,39 +127,25 @@
 				padding:24rpx;
 				float: left;
 				background-color: #FFFFFF;
-				.title{
-					line-height: 40rpx;
-					font-size: $font-size-28;
-					color: $text-color;
-					text-align: center;
-					font-weight: bold;
-					margin-bottom: 36rpx;
-				}
-				.share{
-					line-height: 36rpx;
-					font-size: $font-size-26;
-					color: $text-color;
-					text-align: justify;
-					margin-top: 22rpx;
-					font-weight: normal;
-					.txt{
-						margin-left: 10rpx;
-						color: #FF2A2A;
-					}
-				}
+				border-radius:0 0 14rpx 14rpx;
 				.text{
-					line-height: 36rpx;
+					letter-spacing: 2rpx;
+					line-height: 50rpx;
 					font-size: $font-size-26;
 					color: $text-color;
 					text-align: justify;
-					margin-top: 22rpx;
+					margin-bottom: 30rpx;
 				}
 			}
 			.alert-btn{
-				width: 80%;
-				height: 70rpx;
-				display: flex;
-				margin: 0 auto;
+				width: 492rpx;
+				height: 88rpx;
+				background: $btn-confirm;
+				line-height: 88rpx;
+				text-align: center;
+				border-radius: 14rpx;
+				color: #FFFFFF;
+				margin-top: 20rpx;
 			}
 		}	
 	}

+ 1 - 1
pages.json

@@ -137,7 +137,7 @@
 		},{
 			"path": "pages/user/order/success",
 			"style": {
-				"navigationBarTitleText": "收银台",
+				"navigationBarTitleText": "支付结果",
 				"navigationStyle":"custom"
 			}
 		},{

+ 54 - 15
pages/user/order/order-list.vue

@@ -79,12 +79,13 @@
 			</swiper-item>
 		</swiper>
 		<!-- 付款弹窗 -->
-		<order-model v-if="isPayModel"></order-model>
+		<order-model v-if="isPayModel" 
+					:payModelData="payModelData" 
+					:modelType='modelType' 
+					@cancelConfirm = "hanldCancelConfirm"
+					@paymentConfirm ='hanldPaymentConfirm'/>
 		<!-- 分享弹窗 -->
-		<share-alert   v-if="isShareModal"
-					   :orderID="btnoRderID" 
-					   @shareConfirm ='onShareAppMessage'>
-		</share-alert>
+		<share-alert   v-if="isShareModal" :orderID="btnoRderID" @shareConfirm ='onShareAppMessage' />
 		<!-- 透明模态层 -->
 		<modal-layer v-if='isModalLayer'></modal-layer>
 	</view>
@@ -149,12 +150,14 @@
 				isClickChange: false,
 				isShareModal: false,//控制分享弹窗
 				isModalLayer: false,
-				isPayModel:true,
+				isPayModel:false,
 				loadding: false,
 				pullUpOn: true,
 				hasNextPage: false,
 				pullFlag: true,
 				navbarHeight:'',
+				payModelData:{},
+				modelType:0,
 				nomoreText: '上拉显示更多',
 			}
 		},
@@ -315,25 +318,61 @@
 						this.handOrderConfirm(data.orderId);
 						break
 					case 'pay':
-						if(data.order.onlinePayFlag == '1'){
-							let Amount = data.order.payableAmount - data.order.receiptAmount
-							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.orderId}&payAmount=${Amount}`)
-						}else{
-							this.getOrderPaymentValidation(data.orderId)
-						}
+						this.getOrderPaymentValidation(data)
 						break
 					case 'confirmation':
 						this.handOrderConfirmation(data.orderId);
 						break
 				}
 			},
-			getOrderPaymentValidation(orderid){
-				this.OrderService.OrderPaymentValidation({orderId:orderid}).then(response =>{
-					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${orderid}`)
+			getOrderPaymentValidation(data){//监听根据付款状态做操作
+				this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
+					let dataCode = response.data.code
+					this.payModelData = response.data
+					switch(dataCode){
+						case 1:
+							this.isPayModel = true;
+							this.modelType = 1
+							break;
+						case 2:
+							this.isPayModel = true;
+							this.modelType = 2
+							break;
+						case -1:
+							this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
+							break;
+						default:
+							if(data.onlinePayFlag == '1'){
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.orderId}`)
+							}else{
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
+							}
+					}
+					
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})	
 			},
+			hanldPaymentConfirm(data){//余额抵扣跳转
+				this.OrderService.OrderBalanceDeduction({orderId:data.order.orderId}).then(response =>{
+					if(data.type === 2){
+						let _data = {orderID:data.order.orderId}
+						this.$api.navigateTo(`/pages/user/order/success?type=deduction&data=${JSON.stringify({data:_data})}`)
+					}else{
+						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
+			hanldCancelConfirm(data){//不使用余额抵扣直接跳转收银台
+				console.log(data)
+				if(data.order.onlinePayFlag == '1'){
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.order.orderId}`)
+				}else{
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+				}
+			},
 			handOrderConfirm (id){//确认收货
 				this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
 					confirmReceipt({orderID:id}).then(response =>{

+ 1 - 1
pages/user/order/order-payment.vue

@@ -174,7 +174,7 @@
 						this.nvabarData.haveHome = false
 						this.nvabarData.title = '付款提示'
 						this.invoiceStatus = true
-						this.payableAmount = e.payAmount
+						this.PayOrderCheckoutCounter(this.orderID)
 						this.payBringTitle = '您已通过线下转账的方式支付了订单部分款项,剩余款项依然需要使用线下转账方式,给您带来的不便敬请谅解'
 						break;
 				}

+ 8 - 2
pages/user/order/success.vue

@@ -7,7 +7,7 @@
 					<image src="https://admin-b.caimei365.com/userfiles/1/images/photo/2020/05/%E8%AE%A2%E5%8D%95%E6%94%AF%E4%BB%98%E6%88%90%E5%8A%9F%402x.png" mode=""></image>
 				</view>
 				<view class="cash-text">
-					<text>订单提交并支付成功</text>
+					<text>{{ successText }}</text>
 				</view>
 				<view class="cash-btn">
 					<view class="btn btn-open" @click="this.$api.navigateTo('/pages/user/order/order-details?type=confim&orderID='+orderID)">查看订单</view>
@@ -27,15 +27,21 @@
 					haveBack:false,
 					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
 					showSearch: 0,
-					title: '收银台',  // 导航栏 中间的标题
+					title: '支付结果',  // 导航栏 中间的标题
 					textLeft:this.$store.state.isIphone
 				},
+				successText:'订单提交并支付成功',
 				isIphoneX:this.$store.state.isIphoneX,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				
 			}
 		},
 		onLoad(option) {
+			if(option.type == 'deduction'){
+				this.successText = '支付成功'
+			}else{
+				this.successText = '订单提交并支付成功'
+			}
 			this.initData(option)
 		},
 		methods:{

+ 2 - 2
services/ajax.env.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.1.33:8008'	 //俊俊联调地址
-	URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
-	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.10:8008'	 //超超联调地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{

+ 5 - 1
services/order.service.js

@@ -14,5 +14,9 @@ export default class OrderService {
 	OrderPaymentValidation (data = {}) {
 		return this.AjaxService.get({ url:'/order/paymentValidation', data, isLoading: false })
 	}
-
+	/* 余额抵扣 orderId 订单ID */
+	OrderBalanceDeduction (data = {}) {
+		return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
+	}
+	
 }