| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 | 
							- <template>
 
- 	<view>
 
- 		<view class="inner-box" v-if="order!=null">
 
- 			<!-- 时间、价格 -->
 
- 			<view class="time-price">
 
- 				<text class="time">订单金额</text>
 
- 				<view class="price-box">
 
- 					<text class="unit">¥</text>
 
- 					<text class="num"  >{{order.payMoney.toFixed(2)}}</text>
 
- 				</view>
 
- 			</view>
 
- 			<!-- 订单详情查看 -->
 
- 			<view class="order-info">
 
- 				<view class="title">订单信息</view>
 
- 				<view class="item">
 
- 					<text class="label">订单编号</text>
 
- 					<view class="sn-box">
 
- 						<text class="text">{{order.orderSn}}</text>
 
- 						<view class="copy-btn" @click="copyTest(order.orderSn)">复制</view>
 
- 					</view>
 
- 				</view>
 
- 				<view class="item">
 
- 					<text class="label">下单时间</text>
 
- 					<text class="text">{{order.createTime}}</text>
 
- 				</view>
 
- 			</view>
 
- 			<view class="order-info" v-if="isShow==0&&splitOrderTypes&&splitOrderTypes.length>0">
 
- 				<view class="label">配送方式</view>
 
- 				<radio-group @change="splitOrderTypeChange">
 
- 					<view class="item" v-for="(it, i) in splitOrderTypes" :key="i">
 
- 						<view class="left" >
 
- 							<text class="title">{{it.dictLabel}}</text>
 
- 						</view>
 
- 						<label>
 
- 							<radio :value="it.dictValue"  :checked="splitOrderType==it.dictValue" />
 
- 						</label>
 
- 					</view>
 
- 				</radio-group>
 
- 			</view>
 
- 		</view>
 
- 		<!-- 底部按钮 -->
 
- 		<view class="btn-box">
 
- 			<view class="btn" v-if="order!=null" @click="payOrder()">立即支付</view>
 
- 			<!-- <view class="btn1" v-if="order!=null"    >
 
- 				亲友代付
 
- 				<button class='share-btn' data-name="shareBtn" open-type="share">
 
- 				</button>
 
- 			</view> -->
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {getDictByKey} from '@/api/common'
 
- 	import {getPackageOrderById,payment} from '@/api/packageOrder'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				payMethod:null,
 
- 				orderId:null,
 
- 				order:null,
 
- 				splitOrderType: 1,
 
- 				splitOrderTypes: [],
 
- 				isShow: 1
 
- 			}
 
- 		},
 
- 		onLoad(option) {
 
- 			this.orderId=option.orderId;
 
- 			this.payMethod=option.payMethod;
 
- 			
 
- 		},
 
- 		onShow() {
 
- 			this.getPackageOrderById();
 
- 		},
 
- 		methods: {
 
- 			getDictByKey(splitOrderType){
 
- 				var that=this;
 
- 				var data={key:"sys_package_split_order_type"}
 
- 				getDictByKey(data).then(
 
- 					res => {
 
- 						if(res.code==200&&res.data.length > 0){
 
- 							const targetValues = splitOrderType.map(String);
 
- 							const result = res.data.filter(item => targetValues.includes(item.dictValue));
 
- 							this.splitOrderTypes=result
 
- 							this.splitOrderType  = this.splitOrderTypes[0].dictValue
 
- 						} else {
 
- 							this.splitOrderTypes = []
 
- 							this.splitOrderType = 1
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			copyTest(text) {
 
- 				// 复制方法
 
- 				uni.setClipboardData({
 
- 					data:text,
 
- 					success:()=>{
 
- 						uni.showToast({
 
- 							title:'内容已成功复制到剪切板',
 
- 							icon:'none'
 
- 						})
 
- 					}
 
- 				});
 
- 			},
 
- 			getPackageOrderById(){
 
- 				var data={orderId:this.orderId};
 
- 				console.log(data)
 
- 				uni.hideLoading();
 
- 				getPackageOrderById(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							this.order=res.order
 
- 							this.isShow = res.package ? res.package.isShow : 1;
 
- 							const splitOrderType = res.package ?res.package.splitOrderType.split(','):[];
 
- 							if(splitOrderType&&splitOrderType.length > 0) {
 
- 								this.getDictByKey(splitOrderType);
 
- 							}
 
- 							// 让用户自主点击支付
 
- 							// if(this.payMethod!=null&&this.payMethod=='app'){
 
- 							// 	this.payOrder();
 
- 							// }
 
- 						}else{
 
- 							uni.showToast({
 
- 								title: res.msg,
 
- 								icon: 'none'
 
- 							}) 
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			payOrder(){
 
- 				let data = {orderId:this.orderId,appId: getApp().globalData.appId};
 
- 				if(this.isShow ==0&&this.splitOrderTypes&&this.splitOrderTypes.length > 0) {
 
- 					data = {
 
- 						orderId:this.orderId,
 
- 						splitOrderType: this.splitOrderType,
 
- 						appId: getApp().globalData.appId
 
- 					}
 
- 				}
 
- 				var that=this;
 
- 				uni.showLoading();
 
- 				payment(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							if(res.isPay==0){
 
- 								if(res.type=="tz"){
 
- 									uni.setStorageSync("ztPayUrl",res.data.body.url)
 
- 									uni.navigateTo({
 
- 										url:"/pages_order/tzPay"
 
- 									})
 
- 								}
 
- 								if(res.type=="yb"){
 
- 									var payData=JSON.parse(res.data.pay_info)
 
- 									console.log(payData)
 
- 									uni.requestPayment({
 
- 									 	provider: 'wxpay',
 
- 									 	timeStamp: payData.timeStamp,
 
- 									 	nonceStr: payData.nonceStr,
 
- 									 	package: payData.package,
 
- 									 	signType: payData.signType,
 
- 									 	paySign: payData.paySign,
 
- 									 	success: function(res) {
 
- 											console.log(that.order.orderId)
 
- 									 		 uni.hideLoading();
 
- 											 uni.redirectTo({
 
- 											 	url:"./packageOrderPaySuccess?orderId="+that.order.orderId
 
- 											 }) 
 
- 											 
 
- 									 	},
 
- 									 	fail: function(err) {
 
- 											uni.showToast({
 
- 												icon:'none',
 
- 												title:'fail:' + JSON.stringify(err),
 
- 											});
 
- 									 		uni.hideLoading();
 
- 											
 
- 									 	}
 
- 									});
 
- 									
 
- 								}
 
- 								else if(res.type=="hf"){
 
- 									var payData=JSON.parse(res.data.pay_info)
 
- 									console.log(payData)
 
- 									uni.requestPayment({
 
- 									 	provider: 'wxpay',
 
- 									 	timeStamp: payData.timeStamp,
 
- 									 	nonceStr: payData.nonceStr,
 
- 									 	package: payData.package,
 
- 									 	signType: payData.signType,
 
- 									 	paySign: payData.paySign,
 
- 									 	success: function(res) {
 
- 											console.log(that.order.orderId)
 
- 									 		 uni.hideLoading();
 
- 											 uni.redirectTo({
 
- 											 	url:"./packageOrderPaySuccess?orderId="+that.order.orderId
 
- 											 }) 
 
- 											 
 
- 									 	},
 
- 									 	fail: function(err) {
 
- 											uni.showToast({
 
- 												icon:'none',
 
- 												title:'fail:' + JSON.stringify(err),
 
- 											});
 
- 									 		uni.hideLoading();
 
- 											
 
- 									 	}
 
- 									});
 
- 									
 
- 								}
 
- 								else if(res.type=="wx"){
 
- 									uni.requestPayment({
 
- 									 	provider: 'wxpay',
 
- 									 	timeStamp: res.data.timeStamp,
 
- 									 	nonceStr: res.data.nonceStr,
 
- 									 	package: res.data.packageValue,
 
- 									 	signType: res.data.signType,
 
- 									 	paySign: res.data.paySign,
 
- 									 	success: function(res) {
 
- 											console.log(that.order.orderId)
 
- 									 		 uni.hideLoading();
 
- 											 uni.redirectTo({
 
- 											 	url:"./packageOrderPaySuccess?orderId="+that.order.orderId
 
- 											 }) 
 
- 											 
 
- 									 	},
 
- 									 	fail: function(err) {
 
- 											uni.showToast({
 
- 												icon:'none',
 
- 												title:'fail:' + JSON.stringify(err),
 
- 											});
 
- 									 		uni.hideLoading();
 
- 											
 
- 									 	}
 
- 									});
 
- 									
 
- 								}
 
- 							}
 
- 							else{
 
- 								uni.hideLoading();
 
- 								uni.redirectTo({
 
- 									url:"./packageOrderPaySuccess?orderId="+that.order.orderId
 
- 								}) 
 
- 							}
 
- 						}else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: res.msg,
 
- 							});
 
- 							this.$reLoginCheck(res.msg)
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 				
 
- 			},
 
- 			splitOrderTypeChange(e){
 
- 				this.splitOrderType=e.detail.value;
 
- 			},
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	.inner-box{
 
- 		padding: 20upx 20upx 300upx;
 
- 		.time-price{
 
- 			box-sizing: border-box;
 
- 			padding: 50upx 0upx;
 
- 			background: #FFFFFF;
 
- 			border-radius: 16upx;
 
- 			display: flex;
 
- 			flex-direction: column;
 
- 			align-items: center;
 
- 			.time{
 
- 				font-size: 32upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: 500;
 
- 				color: #222222;
 
- 				line-height: 1;
 
- 				text-align: center;
 
- 			}
 
- 			.desc{
 
- 				margin: 30upx 0upx 15upx;
 
- 				font-size: 26upx;
 
- 				font-family: PingFang SC;
 
- 				color: #999999;
 
- 				line-height: 1;
 
- 				text-align: center;
 
- 			}
 
- 			.price-box{
 
- 				display: flex;
 
- 				align-items: flex-end;
 
- 				margin-top: 28upx;
 
- 				.unit{
 
- 					font-size: 32upx;
 
- 					font-family: PingFang SC;
 
- 					font-weight: bold;
 
- 					color: #FF6633;
 
- 					line-height: 1.3;
 
- 					margin-right: 10upx;
 
- 				}
 
- 				.num{
 
- 					font-size: 56upx;
 
- 					font-family: PingFang SC;
 
- 					font-weight: bold;
 
- 					color: #FF6633;
 
- 					line-height: 1;
 
- 				}
 
- 			}
 
- 		}
 
- 		.order-info{
 
- 			margin-top: 20upx;
 
- 			background: #FFFFFF;
 
- 			border-radius: 16upx;
 
- 			padding: 40upx 30upx;
 
- 			.title{
 
- 				font-size: 30upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: bold;
 
- 				color: #222222;
 
- 				line-height: 1;
 
- 			}
 
- 			.text{
 
- 				font-size: 26upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: 500;
 
- 				color: #222222;
 
- 				line-height: 32upx;
 
- 			}
 
- 			.label{
 
- 				font-size: 26upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: 500;
 
- 				color: #666666;
 
- 				line-height: 1;
 
- 			}
 
- 			.item{
 
- 				margin-top: 40upx;
 
- 				display: flex;
 
- 				align-items: center;
 
- 				justify-content: space-between;
 
- 				.cont-text{
 
- 					font-size: 26upx;
 
- 					font-family: PingFang SC;
 
- 					font-weight: 500;
 
- 					color: #666666;
 
- 					.bold{
 
- 						color: #111111;
 
- 					}
 
- 				}
 
- 				.sn-box{
 
- 					display: flex;
 
- 					align-items: center;
 
- 					.copy-btn{
 
- 						width: 58upx;
 
- 						height: 32upx;
 
- 						line-height: 32upx;
 
- 						text-align: center;
 
- 						font-size: 22upx;
 
- 						font-family: PingFang SC;
 
- 						font-weight: 500;
 
- 						color: #222222;
 
- 						background: #F5F5F5;
 
- 						border-radius: 4upx;
 
- 						margin-left: 24upx;
 
- 					}
 
- 				}
 
- 				 
 
- 			}
 
- 			.line{
 
- 				width: 100%;
 
- 				height: 1px;
 
- 				background: #F0F0F0;
 
- 				margin-top: 30upx;
 
- 			}
 
- 		}
 
- 	}
 
- 	
 
- 	
 
- 	.btn-box{
 
- 	 	z-index: 9999;
 
- 	 	width: 100%;
 
- 	 	padding: 30rpx 30upx 0rpx;
 
- 	 	position: fixed;
 
- 	 	bottom: 0;
 
- 	 	left: 0;
 
- 	 	box-sizing: border-box;
 
- 	 	background-color: #ffffff;
 
- 	 	display: flex;
 
- 		flex-direction: column;
 
- 	 	align-items: center;
 
- 	 	justify-content: center;
 
- 	 	.btn{
 
- 			margin-bottom: 20rpx;
 
- 	 		width: 100%;
 
- 	 		height: 88upx;
 
- 	 		line-height: 88upx;
 
- 	 		text-align: center;
 
- 	 		font-size: 34upx;
 
- 	 		font-family: PingFang SC;
 
- 	 		font-weight: 400;
 
- 	 		color: #FFFFFF;
 
- 	 		background: #2583EB;
 
- 	 		border-radius: 10upx;
 
- 			position: relative;
 
- 	 	}
 
- 		.btn1{
 
- 			margin-bottom: 20rpx;
 
- 			width: 100%;
 
- 			height: 88upx;
 
- 			line-height: 88upx;
 
- 			text-align: center;
 
- 			font-size: 34upx;
 
- 			font-family: PingFang SC;
 
- 			font-weight: 400;
 
- 			color: #2583EB;
 
- 			border: 1rpx solid #2583EB;
 
- 			border-radius: 10upx;
 
- 			position: relative;
 
- 			.share-btn {
 
- 				top:0rpx;
 
- 				left:0rpx;
 
- 				position: absolute;
 
- 				width: 100%;
 
- 				height: 88upx;
 
- 				display: flex;
 
- 				opacity: 0;
 
- 			}
 
- 		}
 
- 	}
 
- 	 
 
- </style>
 
 
  |