Kaynağa Gözat

余额充值版本

zhengjinyi 4 yıl önce
ebeveyn
işleme
827e1c4db8

+ 2 - 2
common/config/config.js

@@ -2,9 +2,9 @@ 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.40:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 128 - 0
components/cm-module/modelAlert/order-alert.vue

@@ -0,0 +1,128 @@
+<template name="sharealert">
+	<view class="alert spec" :class="specClass">
+		<view class="model-warp">
+			<view class="content">
+				<view class="content-title"></view>
+				<view class="text-content">
+					<view class="title">分享订单</view>
+					<view class="share">您的分享码:<text class="txt">{{shareCode}}</text></view>
+					<view class="text">
+						<text>有效期为24小时。订单分享后若对方无法直接登录小程序查看订单,请提供该分享码给对方,通过输入分享码查看</text>
+					</view>
+				</view>				
+				<view class="alert-btn">
+
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { queryOrderShareCode } from "@/api/order.js" 
+	export default{
+		name:'sharealert',
+		props:{
+			orderID:{
+				type:Number
+			}
+		},
+		data() {
+			return{
+				shareCode:'',
+			}
+		},
+		created() {
+			
+		},
+		methods:{
+			hideConfirm(){
+				this.$parent.isShareModal = false
+			},
+			btnConfirm(code){//点击事件
+				this.$emit('btnConfirm')
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	/*弹窗*/
+	 .model-warp.none{
+		 display: none;
+	 }
+	 .model-warp.show{
+		 display: block;
+	 }
+	 .model-warp{
+		width: 100%;
+		height: 100%;
+		background: rgba(0,0,0,0.3);
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 10000;
+		transition: all 0.4s;
+		&.none{
+			display: none;			
+		}
+		&.show{
+			display: block;
+		}
+		.content{
+			width: 540rpx;
+			min-height: 310rpx;
+			box-sizing: border-box;
+			position: absolute;
+			left: 50%;
+			top: 50%;
+			transform: translate(-50%,-50%);
+			border-radius: 14rpx;
+			.content-title{
+				width: 100%;
+				height: 232rpx;
+				background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/08/alert%402x.png) no-repeat;
+				background-size: contain;
+			}
+			.text-content{
+				width: 448rpx;
+				height: auto;
+				padding: 20rpx 35rpx;
+				float: left;
+				.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;
+					}
+				}
+				.text{
+					line-height: 36rpx;
+					font-size: $font-size-26;
+					color: $text-color;
+					text-align: justify;
+					margin-top: 22rpx;
+				}
+			}
+			.alert-btn{
+				width: 80%;
+				height: 70rpx;
+				display: flex;
+				margin: 0 auto;
+			}
+		}	
+	}
+</style>

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

@@ -90,7 +90,7 @@
 			bottom: 0;
 			top: 0;
 			margin: auto;
-			border-radius: 24rpx;
+			border-radius: 14rpx;
 			.text-content{
 				width: 448rpx;
 				height: 264rpx;

+ 1 - 6
components/cm-module/orderDetails/orderButton.vue

@@ -2,9 +2,7 @@
 	<view class="button-template" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 		<!-- 底部按钮 -->
 		<view class="button-content">
-			<view class="" v-if="onlinePayFlag == 0">
-				<view class="btn btn-pay" v-if="btnState.isPay" @click.stop="btnConfirm('pay')">付款</view>
-			</view>
+			<view class="btn btn-pay" v-if="btnState.isPay" @click.stop="btnConfirm('pay')">付款</view>
 			<view class="btn btn-share" @click.stop="onShareCode">
 				<view class="tips" v-if="shareCode">分享码:{{shareCode}}</view>
 				分享订单
@@ -28,9 +26,6 @@
 			shareCode:{
 				type:String
 			},
-			onlinePayFlag : {
-				type:Number
-			}
 		},
 		watch:{
 			status:{

+ 12 - 16
components/cm-module/orderDetails/orderListButton.vue

@@ -2,15 +2,13 @@
 	<view class="button-template">
 		<!-- 底部按钮 -->
 		<view class="button-content">
-			<view class="" v-if="onlinePayFlag == 0">
-				<view class="btn btn-pay" v-if="btnState.isPay" @click.stop="btnConfirm('pay',orderID)">付款</view>
-			</view>
-			<view class="btn btn-share"  @click.stop="onShareCode(orderID)">分享订单</view>
-			<view class="btn btn-confirm" v-if="btnState.isConfirmation" @click.stop="btnConfirm('confirmation',orderID)">确认订单</view>
-			<view class="btn btn-cancel" v-if="btnState.isCancel" @click.stop="btnConfirm('cancel',orderID)">取消订单</view>
-			<view class="btn btn-delete" v-if="btnState.isDelete" @click.stop="btnConfirm('delete',orderID)">删除订单</view>
-			<view class="btn btn-query" v-if="btnState.isQuery" @click.stop="btnConfirm('query',orderID)">查看物流</view>
-			<view class="btn btn-confirm" v-if="btnState.isConfirm" @click.stop="btnConfirm('confirm',orderID)">确认收货</view>
+			<view class="btn btn-pay" v-if="btnState.isPay" @click.stop="btnConfirm('pay',order)">付款</view>
+			<view class="btn btn-share"  @click.stop="onShareCode(order.orderID)">分享订单</view>
+			<view class="btn btn-confirm" v-if="btnState.isConfirmation" @click.stop="btnConfirm('confirmation',order)">确认订单</view>
+			<view class="btn btn-cancel" v-if="btnState.isCancel" @click.stop="btnConfirm('cancel',order)">取消订单</view>
+			<view class="btn btn-delete" v-if="btnState.isDelete" @click.stop="btnConfirm('delete',order)">删除订单</view>
+			<view class="btn btn-query" v-if="btnState.isQuery" @click.stop="btnConfirm('query',order)">查看物流</view>
+			<view class="btn btn-confirm" v-if="btnState.isConfirm" @click.stop="btnConfirm('confirm',order)">确认收货</view>
 		</view>
 	</view>
 </template>
@@ -22,12 +20,9 @@
 			status: {
 				type:Number
 			},
-			orderID: {
-				type:Number
+			order: {
+				type:Object
 			},
-			onlinePayFlag : {
-				type:Number
-			}
 		},
 		data() {
 			return{
@@ -97,10 +92,11 @@
 				this.$parent.btnoRderID = orderId
 				this.$emit('shareConfirm')
 			},
-			btnConfirm(type,id){
+			btnConfirm(type,order){
 				let data = {
 						type:type,
-						orderId:id
+						orderId:order.orderID,
+						order:order
 					}
 				this.$emit('buttonConfirm',data)
 			}

+ 7 - 2
pages/user/order/order-details.vue

@@ -22,7 +22,6 @@
 						  v-if= "isRequest" 
 						  :status= "btnStatus" 
 						  :shareCode= "shareCode"
-						  :onlinePayFlag="onlinePayFlag"
 						   @buttonConfirm="handButtonConfirm">
 			</order-button>
 		</view>
@@ -117,6 +116,7 @@
 					this.information = resData.order
 					this.btnStatus = resData.order.status
 					this.payStatus = resData.order.payStatus
+					this.payableAmount = resData.order.payableAmount
 					this.shopOrderData = resData.shopOrderList
 					this.orderInvoice = resData.orderInvoice
 					this.onlinePayFlag = resData.order.onlinePayFlag
@@ -148,7 +148,12 @@
 						this.handOrderConfirm()
 						break
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${this.orderID}`)
+						if(this.onlinePayFlag == '1'){
+							let Amount = this.payableAmount - this.receiptAmount
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${this.orderID}&payAmount=${Amount}`)
+						}else{
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${this.orderID}`)
+						}
 						break
 					case 'confirmation':
 						this.handOrderConfirmation()

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

@@ -65,8 +65,7 @@
 								<!-- 底部button -->
 								<order-button ref="orderButton" 
 											  :status="order.status" 
-											  :orderID="order.orderID" 
-											  :onlinePayFlag = "order.onlinePayFlag"
+											  :order="order" 
 											  @buttonConfirm="handButtonConfirm">
 								</order-button>
 							</view>
@@ -79,6 +78,8 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
+		<!-- 付款弹窗 -->
+		<order-model v-if="isPayModel"></order-model>
 		<!-- 分享弹窗 -->
 		<share-alert   v-if="isShareModal"
 					   :orderID="btnoRderID" 
@@ -100,6 +101,7 @@
 	import modalLayer from "@/components/modal-layer"
 	import empty from "@/components/empty";
 	import shareAlert from '@/components/cm-module/modelAlert/shareAlert'			 //分享弹窗
+	import orderModel from '@/components/cm-module/modelAlert/order-alert'			 //付款弹窗
 	import { queryOrderList,cancelOrder,deleteOrder,confirmReceipt, affirmOrder } from "@/api/order.js" 
 	
 	export default {
@@ -113,7 +115,8 @@
 			orderButton,
 			tuiSkeleton,
 			modalLayer,
-			shareAlert
+			shareAlert,
+			orderModel
 		},
 		data() {
 			return {
@@ -146,6 +149,7 @@
 				isClickChange: false,
 				isShareModal: false,//控制分享弹窗
 				isModalLayer: false,
+				isPayModel:true,
 				loadding: false,
 				pullUpOn: true,
 				hasNextPage: false,
@@ -311,13 +315,25 @@
 						this.handOrderConfirm(data.orderId);
 						break
 					case 'pay':
-						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
+						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)
+						}
 						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}`)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
 			handOrderConfirm (id){//确认收货
 				this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
 					confirmReceipt({orderID:id}).then(response =>{

+ 20 - 7
pages/user/order/order-payment.vue

@@ -2,7 +2,7 @@
 	<view class="container cashier" :style="{paddingTop:CustomBar+'px'}">
 		<cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom>
 		<view class="container-cash clearfix" v-if="invoiceStatus">
-			<view class="pay-bring-title">本次交易暂不支持线上支付,请使用线下转账方式付款</view>
+			<view class="pay-bring-title">{{payBringTitle}}</view>
 			<view class="container-wrapper">
 				<view class="pay-content">
 					<view class="pay-p"><text>待付金额</text></view>
@@ -122,6 +122,7 @@
 				receiptStatus:'',
 				invoiceStatus:false,
 				onlinePayFlag:'',
+				payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
 				payStatusText:'使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
 			}
 		},
@@ -153,21 +154,33 @@
 		},
 		methods:{
 			initData(e){
+				this.orderID = e.orderID
+				this.payOrderId ='#'+e.orderID+'#';
 				switch(e.type){
 					case 'confirm':
 						this.nvabarData.haveBack = false
 						this.nvabarData.haveHome = true
 						this.nvabarData.title = '支付'
+						this.PayOrderCheckoutCounter(this.orderID)
 						break;
 					case 'payfirm':
 						this.nvabarData.haveBack = true
 						this.nvabarData.haveHome = false
 						this.nvabarData.title = '选择支付方式'
+						this.PayOrderCheckoutCounter(this.orderID)
+						break;
+					case 'onlinePay':
+						this.nvabarData.haveBack = true
+						this.nvabarData.haveHome = false
+						this.nvabarData.title = '付款提示'
+						this.invoiceStatus = true
+						this.payableAmount = e.payAmount
+						this.payBringTitle = '您已通过线下转账的方式支付了订单部分款项,剩余款项依然需要使用线下转账方式,给您带来的不便敬请谅解'
 						break;
 				}
-				this.orderID = e.orderID
-				this.payOrderId ='#'+e.orderID+'#';
-				this.PayService.PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
+			},
+			PayOrderCheckoutCounter(orderId){
+				this.PayService.PayOrderCheckoutCounter({orderId:orderId}).then(response =>{
 					let data = response.data.order
 					this.payableAmount = data.payableAmount - data.receiptAmount  //待付金额
 					this.receiptStatus =  data.receiptStatus
@@ -247,9 +260,9 @@
 		.pay-bring-title{
 			box-sizing: border-box;
 			width: 100%;
-			height: 96rpx;
-			padding: 0 24rpx;
-			line-height: 96rpx;
+			min-height: 96rpx;
+			padding: 20rpx 24rpx;
+			line-height: 48rpx;
 			text-align: left;
 			font-size: $font-size-24;
 			background:rgba(255,234,221,1);

+ 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.33:8008'	 //俊俊联调地址
-	// URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 4 - 0
services/order.service.js

@@ -10,5 +10,9 @@ export default class OrderService {
 	OrderCommodityData (data = {}) {
 		return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
 	}
+	/* 订单支付,效验付款规则 orderId 订单ID */
+	OrderPaymentValidation (data = {}) {
+		return this.AjaxService.get({ url:'/order/paymentValidation', data, isLoading: false })
+	}
 
 }