qxj 5 天之前
父節點
當前提交
8c8ec24aaf
共有 5 個文件被更改,包括 1043 次插入925 次删除
  1. 0 3
      App.vue
  2. 5 0
      common/request.js
  3. 62 50
      pages_course/living.vue
  4. 414 336
      pages_shopping/live/confirmCreateOrder.vue
  5. 562 536
      pages_shopping/live/paymentOrder.vue

+ 0 - 3
App.vue

@@ -34,11 +34,8 @@
 			// uni.$TUIKit.on(uni.$TUIKitEvent.ERROR, this.onTIMError);
 			// uni.$TUIKit.on(uni.$TUIKitEvent.NET_STATE_CHANGE, this.onNetStateChange);
 			// uni.$TUIKit.on(uni.$TUIKitEvent.SDK_RELOAD, this.onSDKReload);
-
-			console.log('IM')
 		},
 		onShow: function() {
-			console.log('App Show')
 			uni.getSystemInfo({
 				success: (result) => {
 					// 获取手机系统的状态栏高度(不同手机的状态栏高度不同)

+ 5 - 0
common/request.js

@@ -30,6 +30,11 @@ export default class Request {
 			path = uni.getStorageSync('addressUrl_' + projectCode)
 			token = uni.getStorageSync('TOKEN_WEXIN')
 		}
+		if (router.indexOf("/live/liveData/like") != -1) {
+			path = 'https://im.fhhx.runtzh.com';
+		}
+		
+		
 		// uni.showLoading({
 		// 	title: '加载中'
 		// });

+ 62 - 50
pages_course/living.vue

@@ -310,7 +310,7 @@
 				</view>
 			</view>
 
-			<view class="goods" v-if="isShowGoods" @click="goShop(goodsCard.productId, goodsCard.goodsId)">
+			<view class="goods" v-if="isShowGoods" @click.stop="goShop(goodsCard.productId, goodsCard.goodsId)">
 				<view class="top">
 					<view class="left">
 						<image class="w30 h30 mr8" src="/static/images/signal.png" />
@@ -325,7 +325,7 @@
 						<text class="del">¥{{ goodsCard.otPrice }}</text>
 					</view>
 					<view class="title oneline-hide">{{ goodsCard.productName }}</view>
-					<view class="button" @click="goShop(goodsCard.productId, goodsCard.goodsId)">立即抢购</view>
+					<view class="button">立即抢购</view>
 				</view>
 			</view>
 
@@ -390,25 +390,26 @@
 			</u-popup>
 
 			<!-- 中奖和未中奖 -->
-			<u-popup :show="isShowPrize && havePrize" round="20rpx" mode="center" bgColor="#fff" zIndex="10076">
-				<view class="prize-card" v-if="isCurrentUserWon">
-					<image class="nav-img" src="/static/images/red_head.png" mode="widthFix" />
-					<view class="title">恭喜您 中奖啦!</view>
-					<view class="prize-content" v-for="(item, index) in prizeInfo || []" :key="index">
-						<view class="item">{{ item.userName }}</view>
-						<view class="item">{{ item.userId }}</view>
-						<view class="txt item">{{ item.prizeLevel }}等奖</view>
+			<u-popup :show="isShowPrize && havePrize"  round="20rpx" mode="center" bgColor="#fff" zIndex="10076">
+					<view class="prize-card" v-if="isCurrentUserWon" >
+						<image class="nav-img" src="/static/images/red_head.png" mode="widthFix" />
+						<view class="title">恭喜您 中奖啦!</view>
+						<view class="prize-content" v-for="(item, index) in prizeInfo || []" :key="index">
+							<view class="item">{{ item.userName }}</view>
+							<view class="item">{{ item.userId }}</view>
+							<view class="txt item">{{ item.prizeLevel }}等奖</view>
+						</view>
+						<view class="tip">请填写收货地址,主播将会将奖品发给您</view>
+						<view class="button"
+							@click="navgetTo('/pages_shopping/live/confirmCreateOrder?type=win&productId='+getCurrentUserPrizeProductId+'&liveId='+this.liveId),confirm()">填写地址</view>
+					</view>
+					<view class="no-prize-card" v-else>
+						<image class="img" src="/static/images/no-prize.png" mode="widthFix" />
+						<view class="tip">很遗憾 您未中奖</view>
+						<view class="button" @click="confirm">确认</view>
 					</view>
-					<view class="tip">请截图联系客服领取奖品</view>
-					<view class="button" @click="confirm">确认</view>
-				</view>
-				<view class="no-prize-card" v-else>
-					<image class="img" src="/static/images/no-prize.png" mode="widthFix" />
-					<view class="tip">很遗憾 您未中奖</view>
-					<view class="button" @click="confirm">确认</view>
-				</view>
 			</u-popup>
-
+			
 			<!-- 中奖记录 -->
 			<!-- winning -->
 			<u-popup :show="winning" @close="closeWin" round="20rpx" bgColor="#f3f5f9" zIndex="10076">
@@ -527,6 +528,7 @@
 							</view>
 						</view>
 					</scroll-view> -->
+					
 					<scroll-view enable-flex scroll-y class="shop-list" :style="{ height: boxHeight + 'px' }">
 						<!-- 骨架屏 -->
 						<view v-if="loadingProducts && products.length === 0" class="skeleton-list">
@@ -967,20 +969,33 @@ export default {
 		};
 	},
 	computed: {
-		filteredViewers() {
-			const safeLiveViewers = Array.isArray(this.liveViewersData) ? this.liveViewersData : [];
-			// 截取前3项
-			return safeLiveViewers.slice(0, 3);
-		},
-		isCurrentUserWon() {
-			if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
-				return false;
-			}
-			return this.prizeInfo.some((item) => {
-				return String(item.userId) === String(this.userData.userId);
-			});
-		}
-	},
+				filteredViewers() {
+					const safeLiveViewers = Array.isArray(this.liveViewersData) ? this.liveViewersData : [];
+					// 截取前3项
+					return safeLiveViewers.slice(0, 3);
+				},
+				isCurrentUserWon() {
+					if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+						return false;
+					}
+					return this.prizeInfo.some((item) => {
+						return String(item.userId) === String(this.userData.userId);
+					});
+				},
+				getCurrentUserPrizeProductId() {
+					if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+						return null;
+					}
+					// 在 prizeInfo 中查找当前用户的中奖记录
+					const userPrize = this.prizeInfo.find(item => {
+						return String(item.userId) == String(this.userData.userId);
+					});
+	
+					// 返回商品ID,如果没有找到则返回null
+					return userPrize ? userPrize.productId : null;
+				}
+	
+			},
 	onHide() {
 		//  清除所有定时器(使用增强清理)
 		this.clearAllTimersEnhanced();
@@ -2976,7 +2991,6 @@ export default {
 				url: url
 			});
 		},
-
 		// 修改获取直播信息方法
 		async getliving(liveId) {
 			if (!liveId) return;
@@ -3010,7 +3024,6 @@ export default {
 							clearInterval(this.liveStartTimer);
 						}
 					}, 1000);
-
 					this.$set(this.liveItem, 'previewUrl', res.data.previewUrl);
 					this.$set(this.liveItem, 'livingUrl', ''); // 清空直播流
 					this.$set(this.liveItem, 'videoUrl', ''); // 清空回放视频
@@ -3080,7 +3093,7 @@ export default {
 			try {
 				const res = await liveDataLike(this.liveId);
 				if (res?.like) {
-					this.liveViewData.like++; // 只更新当前直播间的点赞数
+					this.liveViewData.like++; //只更新当前直播间的点赞数
 				} else {
 					uni.showToast({
 						title: res.msg,
@@ -3095,14 +3108,12 @@ export default {
 		//直播间点赞、关注、在线人数数据
 		getliveViewData(liveItem) {
 			if (!liveItem || !this.liveId) return;
-			getLiveViewData(this.liveId)
-				.then((res) => {
+			getLiveViewData(this.liveId).then((res) => {
 					if (res.code == 200) {
 						// 强制响应式更新,确保数据实时显示
 						this.liveViewData = res;
 					}
-				})
-				.catch((error) => {
+				}).catch((error) => {
 					console.error('获取直播间数据失败:', error);
 					// 失败时兜底,避免显示异常
 					this.liveViewData = {
@@ -3118,13 +3129,12 @@ export default {
 				clearInterval(this.liveViewDataTimer);
 				this.liveViewDataTimer = null;
 			}
-			// 启动新定时器,每30秒执行一次
 			this.liveViewDataTimer = setInterval(() => {
 				// 安全校验:确保liveItem和liveId存在(避免无效请求)
 				if (this.liveItem && this.liveId) {
 					this.getliveViewData(this.liveItem);
 				}
-			}, 30000);
+			}, 20000);
 		},
 		// 去购买,跳商品详情
 		goShop(productId, goodsId) {
@@ -3320,6 +3330,7 @@ export default {
 				//const baseWsUrl = 'wss://api.fhhx.runtzh.com/ws/app/webSocket';
 				// const baseWsUrl = 'ws://192.168.10.166:7114/ws/app/webSocket';
 				let wsUrl = `${baseWsUrl}?userId=${this.userData.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${signature}`;
+				console.log("qxj wsUrl",wsUrl);
 				if (this.qrFrom) {
 					wsUrl += this.qrFrom;
 				}
@@ -3545,7 +3556,6 @@ export default {
 						if (this.isShowRed) {
 							this.redTimer = setInterval(() => {
 								const redCountdown = this.handleTime(this.redInfo.updateTime, this.redInfo.duration);
-
 								if (!redCountdown) {
 									this.isShowRed = false;
 									clearInterval(this.redTimer);
@@ -3560,9 +3570,12 @@ export default {
 						const couponData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
 						this.couponInfo = couponData || {};
 						this.isShowCoupon = socketMessage.status === 1;
-						if (this.isShowCoupon) {
-						}
-					} else if (socketMessage.cmd == 'lottery') {
+						if (this.isShowCoupon) {}
+					} 
+					else if (socketMessage.cmd == 'likeDetail') {
+						this.liveViewData.like=socketMessage.data;
+					}
+					else if (socketMessage.cmd == 'lottery') {
 						const lotteryData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
 						this.lotteryInfo = lotteryData || {};
 						this.isShowLottery = socketMessage.status === 1;
@@ -3571,7 +3584,6 @@ export default {
 						}
 						// 清除已有定时器(无论状态是否为1,先清掉旧的)
 						clearTimeout(this.lotteryTimer);
-
 						if (this.isShowLottery) {
 							this.lotteryTimer = setInterval(() => {
 								this.countdown = this.handleTime(this.lotteryInfo.updateTime, this.lotteryInfo.duration);
@@ -4116,12 +4128,11 @@ export default {
 	.side-group {
 		position: absolute;
 		top: 52%;
-		right: 30rpx;
+		right: 24rpx;
 		z-index: 1000;
 		display: flex;
 		flex-direction: column;
 		align-items: center;
-		
 		.side-item {
 			font-weight: 500;
 			font-size: 22rpx;
@@ -4617,7 +4628,7 @@ export default {
 		}
 
 		.bg {
-			height: 432rpx;
+			height: 452rpx;
 			width: 100%;
 		}
 
@@ -4662,6 +4673,7 @@ export default {
 		opacity: 1;
 	}
 }
+
 .shop-prompt {
 	position: absolute;
 	bottom: 750rpx;

+ 414 - 336
pages_shopping/live/confirmCreateOrder.vue

@@ -39,7 +39,7 @@
 						<text class="price-info-num">{{(orderData.totalPrice||0).toFixed(2)}}</text>
 					</view>
 				</view>
-				<view class="points" @click="openCoupon()">
+				<view class="points" @click="couponVisible = true;">
 					<view class="left">
 						<text class="text">优惠券</text>
 					</view>
@@ -128,7 +128,8 @@
 		createReward, // 创建中奖订单
 		userAddr, // 获取用户收货地址
 		computed,
-		computedReward
+		computedReward,
+		liveOrderKey, // 生成订单key
 	} from "@/api/order.js"
 	import {
 		curCoupon
@@ -158,23 +159,27 @@
 				checked: false,
 				cartIds: null,
 				confirmParam: [],
-				type:'',
-
+				type: '',
+				isFirstLoad: true,
 			}
 		},
 
 		onLoad(options) {
-			// uni.$on('updateAddress', this.handleAddressUpdate);
 			console.log("确认订单", options)
 			this.orderKey = options.orderKey;
 			this.liveId = options.liveId
 			this.goodsId = options.goodsId
 			this.productId = options.productId
 			this.totalNum = Number(options.totalNum) || 0
+			this.type = options.type
+			this.isFirstLoad = true;
 			
-			this.type=options.type
+			if (options.type == 'win') {
+				this.getKey()
+			}
 		},
 		onShow() {
+			this.openCoupon()
 			this.getUserAddr()
 			uni.$on('updateAddress', (e) => {
 				this.address = e;
@@ -189,17 +194,14 @@
 			// });
 		},
 		onUnload() {
-			// 页面卸载时移除监听,避免内存泄漏
 			uni.$off('updateAddress', this.handleAddressUpdate);
 		},
 		beforeDestroy() {
-			// 移除事件监听,避免内存泄漏
 			uni.$off('updateAddress');
 		},
 		methods: {
 			handleAddressUpdate(item) {
 				console.log('接收到地址数据:', item);
-				// 在这里处理地址数据
 				this.cityId = item.cityId;
 				this.address = item;
 				this.addressId = item.addressId;
@@ -208,13 +210,12 @@
 				} else {
 					this.computedOrder()
 				}
-				// 更新页面显示或其他操作
 			},
 			// 获取用户收货地址
 			getUserAddr() {
 				userAddr().then(res => {
 						if (res.code == 200) {
-							console.log("用户收货地址>>>>", res.data)
+							//console.log("用户收货地址>>>>", res.data)
 							if (res.data && !this.address) {
 								this.address = res.data;
 							}
@@ -236,7 +237,21 @@
 					rej => {}
 				);
 			},
-
+			// 获得key
+			getKey() {
+				liveOrderKey().then(res => {
+						if (res.code == 200) {
+							this.orderKey = res.orderKey
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					rej => {}
+				);
+			},
 			// 查询创建订单信息
 			computedOrder() {
 				let data = {
@@ -265,14 +280,14 @@
 			computedRewardOrder() {
 				let data = {
 					cityId: this.cityId || '',
-					productId: this.productId,
+					productId: this.productId ,
 					orderKey: this.orderKey,
 					totalNum: 1,
 				}
 				computedReward(data).then(res => {
 						if (res.code == 200) {
 							console.log("查询创建订单信息>>>>", res.data)
-							this.orderData = res.data
+							this.orderData = res.data||{}
 						} else {
 							uni.showToast({
 								title: res.msg,
@@ -287,7 +302,6 @@
 
 			// 创建订单
 			createLiveOrder() {
-
 				let data = {
 					cityId: this.cityId,
 					liveId: this.liveId,
@@ -304,20 +318,47 @@
 
 				}
 
-				return createliveOrder(data).then(res => { // 添加 return
+				return createliveOrder(data).then(res => { 
 					if (res.code == 200) {
 						this.orderList = res.order;
-						return res.order; // 返回订单数据供后续使用
+						return res.order; 
 					} else {
 						uni.showToast({
 							title: res.msg,
 							icon: 'none'
 						});
-						throw new Error(res.msg); // 抛出错误以便 submitOrder 捕获
+						throw new Error(res.msg); 
 					}
 				});
 			},
-
+			// 创建抽奖订单
+			createRewardOrder() {
+			    let data = {
+			        cityId: this.cityId,
+			        liveId: this.liveId,
+			        orderKey: this.orderKey,
+			        userName: this.address.realName,
+			        userPhone: this.address.phone,
+			        userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' + this.address.detail,
+			        cartId: "5",
+			        productId: this.productId,
+			        totalNum: this.totalNum,
+			        couponUserId: this.couponUserId
+			    }
+			
+			    return createReward(data).then(res => {
+			        if (res.code == 200) {
+			            this.orderList = res.order || {};
+			            return res.order || {};
+			        } else {
+			            uni.showToast({
+			                title: res.msg,
+			                icon: 'none'
+			            });
+			            throw new Error(res.msg);
+			        }
+			    });
+			},
 			couponSelect(item) {
 				this.couponText = "-¥" + (item.couponPrice || 0).toFixed(2);
 				this.couponUserId = item.id;
@@ -329,15 +370,48 @@
 				}
 
 			},
+			// 自动选择最大优惠券
+			autoSelectMaxCoupon() {
+				if (this.couponsList.length === 0 || !this.isFirstLoad) {
+					return;
+				}
+				const availableCoupons = this.couponsList.filter(item => 
+					item.status === 0 && item.useMinPrice <= (this.orderData.totalPrice || 0)
+				);
+				if (availableCoupons.length === 0) {
+					return;
+				}
+				availableCoupons.sort((a, b) => b.couponPrice - a.couponPrice);
+				const maxCoupon = availableCoupons[0];
+				this.couponText = "-¥" + (maxCoupon.couponPrice || 0).toFixed(2);
+				this.couponUserId = maxCoupon.id;
+				
+				console.log('自动选择最大优惠券:', maxCoupon);
+				this.isFirstLoad = false;
+				// 重新计算订单价格
+				if (this.type == 'win') {
+					this.computedRewardOrder()
+				} else {
+					this.computedOrder()
+				}
+			},
 			openCoupon() {
 				console.log("点了优惠券列表")
+				if (!this.liveId || !this.goodsId) {
+					console.log('缺少必要参数,跳过优惠券请求');
+					return;
+				}
 				const data = {
 					liveId: this.liveId,
 					goodsId: this.goodsId
 				};
 				curCoupon(data).then(res => {
-					this.couponVisible = true;
-					this.couponsList = res.data
+					this.couponsList = res.data || [];
+					if (this.isFirstLoad) {
+						setTimeout(() => {
+							this.autoSelectMaxCoupon();
+						}, 100);
+					}
 				})
 			},
 			openAddress() {
@@ -347,322 +421,326 @@
 			},
 			// 提交订单
 			async submitOrder() {
-				try {
-					if (this.orderKey == null) {
-						uni.showToast({
-							icon: 'none',
-							title: '订单KEY不存在',
-						});
-						return;
-					}
-					if (this.address == null) {
-						uni.showToast({
-							icon: 'none',
-							title: '收货地址不能为空',
-						});
-						return;
-					}
-					let orderList;
-					orderList = await this.createLiveOrder(); // 等待订单数据返回
-					console.log("orderList>>", orderList)
-					const orderListStr = encodeURIComponent(JSON.stringify(orderList));
-					uni.navigateTo({
-						url: `/pages_shopping/live/paymentOrder?orderList=${orderListStr}&couponUserId=${this.couponUserId}`
-					});
-				} catch (error) {
-					uni.showToast({
-						title: res.msg,
-						icon: 'none'
-					});
-				}
+			    try {
+			        if (this.orderKey == null) {
+			            uni.showToast({
+			                icon: 'none',
+			                title: '订单KEY不存在',
+			            });
+			            return;
+			        }
+			        if (this.address == null) {
+			            uni.showToast({
+			                icon: 'none',
+			                title: '收货地址不能为空',
+			            });
+			            return;
+			        }
+			        let orderList;
+			        if (this.type == "win") {  
+			            orderList = await this.createRewardOrder(); // 中奖订单
+			        } else {
+			            orderList = await this.createLiveOrder(); // 购买订单
+			        }
+			        console.log("orderList>>", orderList)
+			        const orderListStr = encodeURIComponent(JSON.stringify(orderList));
+			        uni.navigateTo({
+			            url: `/pages_shopping/live/paymentOrder?orderList=${orderListStr}&couponUserId=${this.couponUserId}&type=${this.type}`
+			        });
+			    } catch (error) {
+			        console.error('提交订单错误:', error);
+			        uni.showToast({
+			            title: error.message || '提交订单失败',
+			            icon: 'none'
+			        });
+			    }
 			},
 		}
 	}
-</script>
-
-<style lang="scss">
-	.inner-box {
-		padding: 20rpx 20rpx 140rpx;
-
-		.address-box {
-			margin-bottom: 20rpx;
-			box-sizing: border-box;
-			min-height: 171rpx;
-			background: #FFFFFF;
-			border-radius: 16rpx;
-			background-repeat: no-repeat;
-			background-size: 100% 30rpx;
-			background-position: left bottom;
-			padding: 38rpx 30rpx 36rpx;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-
-			.left {
-				width: 92%;
-
-				.name-box {
-					display: flex;
-					align-items: center;
-
-					.text {
-						font-size: 32rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #111111;
-						line-height: 1;
-
-						&.name {
-							margin-right: 30rpx;
-						}
-					}
-				}
-
-				.address {
-					font-size: 28rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #666666;
-					line-height: 42rpx;
-					text-align: left;
-					margin-top: 23rpx;
-				}
-			}
-
-			.arrow-box {
-				width: 12rpx;
-				height: 23rpx;
-				display: flex;
-				align-items: cenetr;
-				justify-content: cenetr;
-
-				image {
-					width: 100%;
-					height: 100%;
-				}
-			}
-		}
-
-		.price-info {
-			background: #FFFFFF;
-			border-radius: 16rpx;
-
-			&-title {
-				padding: 30rpx 30rpx 20rpx 30rpx;
-				font-family: PingFang SC, PingFang SC;
-				font-weight: 500;
-				font-size: 30rpx;
-				color: #111;
-			}
-
-			&-unit {
-				font-size: 24rpx;
-			}
-
-			&-num {
-				font-size: 28rpx;
-			}
-		}
-
-		.points {
-			height: 88rpx;
-			padding: 0 30rpx;
-			background: #FFFFFF;
-			border-radius: 16rpx;
-
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-
-			.left {
-				display: flex;
-				align-items: center;
-
-				image {
-					width: 28rpx;
-					height: 28rpx;
-					margin-right: 20rpx;
-				}
-
-				.text {
-					font-size: 28rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #666666;
-				}
-			}
-
-			.right {
-				display: flex;
-				align-items: center;
-
-				.text {
-					font-size: 28rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #111111;
-
-				}
-
-				image {
-					margin-left: 15rpx;
-					width: 14rpx;
-					height: 24rpx;
-				}
-			}
-		}
-	}
-
-
-	.btn-foot {
-		box-sizing: border-box;
-		width: 100%;
-		height: 121rpx;
-		background: #FFFFFF;
-		padding: 16rpx 30rpx 16rpx 60rpx;
-		display: flex;
-		align-items: center;
-		justify-content: flex-end;
-		position: fixed;
-		left: 0;
-		bottom: 0;
-		z-index: 99;
-
-		.right {
-			display: flex;
-			align-items: center;
-
-			.total {
-				display: flex;
-				align-items: flex-end;
-				margin-right: 36rpx;
-
-				.label {
-					font-size: 26rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #999999;
-					line-height: 1.5;
-				}
-
-				.price {
-					display: flex;
-					align-items: flex-end;
-
-					.unit {
-						font-size: 32rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #FF6633;
-						line-height: 1.2;
-						margin-right: 10rpx;
-					}
-
-					.num {
-						font-size: 50rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #FF6633;
-						line-height: 1;
-					}
-				}
-			}
-
-			.btn {
-				width: 200rpx;
-				height: 88rpx;
-				line-height: 88rpx;
-				text-align: center;
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #FFFFFF;
-				background: #2BC7B9;
-				border-radius: 44rpx;
-			}
-		}
-	}
-
-	.coupon {
-		height: 100%;
-	}
-
-	/*优惠券列表公共*/
-	.coupon-list {}
-
-	.coupon-list .item {
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		width: 100%;
-		height: 1.7 * 100rpx;
-		margin-bottom: 0.16 * 100rpx;
-	}
-
-	.coupon-list .item .money {
-		background-size: 100% 100%;
-		width: 2.4 * 100rpx;
-		height: 100%;
-		color: #fff;
-		font-size: 0.36 * 100rpx;
-		font-weight: bold;
-		text-align: center;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-		position: relative;
-
-	}
-
-	.coupon-list .item .money .img {
-		position: absolute;
-		width: 2.4 * 100rpx;
-		height: 100%;
-		color: #fff;
-
-	}
-
-	.coupon-list .item .money .num {
-		font-size: 0.6 * 100rpx;
-	}
-
-	.coupon-list .item .money .pic-num {
-		font-size: 20rpx;
-		z-index: 99;
-	}
-
-
-	.coupon-list .item .text {
-		width: 4.5 * 100rpx;
-		padding: 0 0.17 * 100rpx 0 0.24 * 100rpx;
-		background-color: #fff;
-		box-sizing: border-box;
-	}
-
-	.coupon-list .item .text .condition {
-		font-size: 0.3 * 100rpx;
-		color: #282828;
-		height: 0.93 * 100rpx;
-		line-height: 0.93 * 100rpx;
-		border-bottom: 1px solid #f0f0f0;
-	}
-
-	.coupon-list .item .text .data {
-		font-size: 0.2 * 100rpx;
-		color: #999;
-		height: 0.76 * 100rpx;
-	}
-
-	.coupon-list .item .text .data .bnt {
-		width: 1.36 * 100rpx;
-		height: 0.44 * 100rpx;
-		border-radius: 0.22 * 100rpx;
-		font-size: 0.22 * 100rpx;
-		color: #fff;
-		text-align: center;
-		line-height: 0.44 * 100rpx;
-		background-color: red;
-	}
+</script>
+<style lang="scss">
+	.inner-box {
+		padding: 20rpx 20rpx 140rpx;
+
+		.address-box {
+			margin-bottom: 20rpx;
+			box-sizing: border-box;
+			min-height: 171rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+			background-repeat: no-repeat;
+			background-size: 100% 30rpx;
+			background-position: left bottom;
+			padding: 38rpx 30rpx 36rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.left {
+				width: 92%;
+
+				.name-box {
+					display: flex;
+					align-items: center;
+
+					.text {
+						font-size: 32rpx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #111111;
+						line-height: 1;
+
+						&.name {
+							margin-right: 30rpx;
+						}
+					}
+				}
+
+				.address {
+					font-size: 28rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					line-height: 42rpx;
+					text-align: left;
+					margin-top: 23rpx;
+				}
+			}
+
+			.arrow-box {
+				width: 12rpx;
+				height: 23rpx;
+				display: flex;
+				align-items: cenetr;
+				justify-content: cenetr;
+
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+
+		.price-info {
+			background: #FFFFFF;
+			border-radius: 16rpx;
+
+			&-title {
+				padding: 30rpx 30rpx 20rpx 30rpx;
+				font-family: PingFang SC, PingFang SC;
+				font-weight: 500;
+				font-size: 30rpx;
+				color: #111;
+			}
+
+			&-unit {
+				font-size: 24rpx;
+			}
+
+			&-num {
+				font-size: 28rpx;
+			}
+		}
+
+		.points {
+			height: 88rpx;
+			padding: 0 30rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.left {
+				display: flex;
+				align-items: center;
+
+				image {
+					width: 28rpx;
+					height: 28rpx;
+					margin-right: 20rpx;
+				}
+
+				.text {
+					font-size: 28rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+				}
+			}
+
+			.right {
+				display: flex;
+				align-items: center;
+
+				.text {
+					font-size: 28rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #111111;
+
+				}
+
+				image {
+					margin-left: 15rpx;
+					width: 14rpx;
+					height: 24rpx;
+				}
+			}
+		}
+	}
+
+
+	.btn-foot {
+		box-sizing: border-box;
+		width: 100%;
+		height: 121rpx;
+		background: #FFFFFF;
+		padding: 16rpx 30rpx 16rpx 60rpx;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		z-index: 99;
+
+		.right {
+			display: flex;
+			align-items: center;
+
+			.total {
+				display: flex;
+				align-items: flex-end;
+				margin-right: 36rpx;
+
+				.label {
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					line-height: 1.5;
+				}
+
+				.price {
+					display: flex;
+					align-items: flex-end;
+
+					.unit {
+						font-size: 32rpx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #FF6633;
+						line-height: 1.2;
+						margin-right: 10rpx;
+					}
+
+					.num {
+						font-size: 50rpx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #FF6633;
+						line-height: 1;
+					}
+				}
+			}
+
+			.btn {
+				width: 200rpx;
+				height: 88rpx;
+				line-height: 88rpx;
+				text-align: center;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FFFFFF;
+				background: #2BC7B9;
+				border-radius: 44rpx;
+			}
+		}
+	}
+
+	.coupon {
+		height: 100%;
+	}
+
+	/*优惠券列表公共*/
+	.coupon-list {}
+
+	.coupon-list .item {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		width: 100%;
+		height: 1.7 * 100rpx;
+		margin-bottom: 0.16 * 100rpx;
+	}
+
+	.coupon-list .item .money {
+		background-size: 100% 100%;
+		width: 2.4 * 100rpx;
+		height: 100%;
+		color: #fff;
+		font-size: 0.36 * 100rpx;
+		font-weight: bold;
+		text-align: center;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+
+	}
+
+	.coupon-list .item .money .img {
+		position: absolute;
+		width: 2.4 * 100rpx;
+		height: 100%;
+		color: #fff;
+
+	}
+
+	.coupon-list .item .money .num {
+		font-size: 0.6 * 100rpx;
+	}
+
+	.coupon-list .item .money .pic-num {
+		font-size: 20rpx;
+		z-index: 99;
+	}
+
+
+	.coupon-list .item .text {
+		width: 4.5 * 100rpx;
+		padding: 0 0.17 * 100rpx 0 0.24 * 100rpx;
+		background-color: #fff;
+		box-sizing: border-box;
+	}
+
+	.coupon-list .item .text .condition {
+		font-size: 0.3 * 100rpx;
+		color: #282828;
+		height: 0.93 * 100rpx;
+		line-height: 0.93 * 100rpx;
+		border-bottom: 1px solid #f0f0f0;
+	}
+
+	.coupon-list .item .text .data {
+		font-size: 0.2 * 100rpx;
+		color: #999;
+		height: 0.76 * 100rpx;
+	}
+
+	.coupon-list .item .text .data .bnt {
+		width: 1.36 * 100rpx;
+		height: 0.44 * 100rpx;
+		border-radius: 0.22 * 100rpx;
+		font-size: 0.22 * 100rpx;
+		color: #fff;
+		text-align: center;
+		line-height: 0.44 * 100rpx;
+		background-color: red;
+	}
 </style>

+ 562 - 536
pages_shopping/live/paymentOrder.vue

@@ -1,537 +1,563 @@
-<template>
-	<view class="content">
-		<view class="inner">
-			<!-- 时间、价格 -->
-			<view class="time-price">
-				<text class="time">待支付</text>
-				<view class="price-box">
-					<text class="unit">¥</text>
-					<text class="num">{{order ? (Number(order.payMoney) || 0).toFixed(2) : "0.00"}}</text>
-				</view>
-
-			</view>
-			<!-- 支付方式 -->
-			<view class="pay-type">
-				<view class="title">支付方式</view>
-				<radio-group @change="handlePayTypeChange">
-					<view class="item">
-						<view class="left">
-							<image src="/static/images/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
-						</view>
-						<label>
-							<radio :value="1" :checked="payType === 1" />
-						</label>
-					</view>
-					<!-- #ifdef APP-PLUS||H5 -->
-					<view class="item">
-						<view class="left">
-							<image src="/static/images/zfb.png" mode=""></image>
-							<text class="text">支付宝</text>
-						</view>
-						<label>
-							<radio :value="2" :checked="payType === 2" />
-						</label>
-					</view>
-					<!-- #endif -->
-				</radio-group>
-			</view>
-			<!-- 订单详情查看 -->
-			<view class="order-info">
-				<view class="title">订单信息</view>
-				<view class="item">
-					<text class="label">订单编号</text>
-					<view class="sn-box">
-						<view>
-							<view class="text">{{order.orderCode}}</view>
-						</view>
-					</view>
-				</view>
-				<view class="item">
-					<text class="label">下单时间</text>
-					<text class="text">{{ formattedDate}} </text>
-				</view>
-				<view class="item">
-					<text class="label">订单金额</text>
-					<text class="text"
-						v-if="order!=null">{{order ? (Number(order.totalPrice) || 0).toFixed(2) : "0.00"}}</text>
-				</view>
-				<view class="item">
-					<text class="label">优惠券</text>
-					<text class="text">-¥{{order ? (Number(order.discountMoney) || 0).toFixed(2) : "0.00"}} </text>
-				</view>
-			</view>
-
-		</view>
-		<view class="btn-box">
-			<view class="btn" @click="payOrder()">去支付</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import dayjs from 'dayjs';
-	import {
-		weChatPayment
-	} from '@/api/pay_new'
-	import {
-		zfbPayment,
-		// weChatPayment
-	} from '@/api/pay'
-	export default {
-		data() {
-			return {
-				payPrice: null,
-				newOrder: {},
-				payType: 2,
-				order: null,
-				orderId: null,
-				payDelivery: 0,
-				payMoney: 0,
-				config: null,
-				payType: 1,
-				user: null,
-				couponUserId: null
-			}
-		},
-		computed: {
-			formattedDate() {
-				return this.order?.createTime ? dayjs(this.order.createTime).format('YYYY-MM-DD HH:mm:ss') : '';
-			},
-			payLimitTime() {
-				return this.order?.updateTime ?
-					dayjs(this.order.updateTime).add(2, 'day').format('YYYY-MM-DD HH:mm:ss') :
-					'';
-			}
-		},
-		onLoad(options) {
-			// if (options.payPrice) {
-			// 	this.payPrice = options.payPrice;
-			// }
-			if (options.couponUserId) {
-				this.couponUserId = options.couponUserId;
-			}
-			console.log("支付订单是>>", options)
-			// this.orderKey = options.orderKey;
-			// this.liveId = options.liveId
-			// this.productId=options.productId
-			// console.log("支付订单",options)
-
-			if (options.orderList) {
-				try {
-					const decoded = decodeURIComponent(options.orderList);
-					this.order = JSON.parse(decoded) || {}; // 默认空对象
-				} catch (e) {
-					console.error('参数解析失败:', e);
-					this.order = {}; // 显式赋默认值
-				}
-			}
-		},
-		// //发送给朋友
-		// onShareAppMessage(res) {
-		// 	const combinationOrderId = this.combinationOrderId ?
-		// 		`&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
-		// 	return {
-		// 		title: "帮TA支付",
-		// 		path: '/pages_user/user/otherPaymentOrder?orderId=' + this.orderId + combinationOrderId,
-		// 		imageUrl: '/static/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
-		// 	}
-
-		// },
-		methods: {
-			weixinPayOrder() {
-				var data = {
-					orderId: this.order.orderId,
-					payType: 1
-					// payType: this.order.payType
-				};
-
-				var that = this;
-				uni.showLoading();
-				weChatPayment(data).then(
-					res => {
-						if (res.code == 200) {
-							console.log(res);
-
-							if (res.payType == 1 || res.payType == 2) {
-								var result = JSON.parse(res.result);
-								uni.requestPayment({
-									provider: 'wxpay',
-									timeStamp: result.timeStamp,
-									nonceStr: result.nonceStr,
-									package: result.package,
-									signType: result.signType,
-									paySign: result.paySign,
-									success: function(res) {
-										uni.hideLoading();
-
-										uni.redirectTo({
-											url: "./success?order=" + JSON.stringify(that.newOrder)
-										})
-
-
-									},
-									fail: function(err) {
-										uni.showToast({
-											icon: 'none',
-											title: 'fail:' + JSON.stringify(err),
-										});
-										uni.hideLoading();
-									}
-								});
-							}
-
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: res.msg,
-							});
-						}
-					},
-					rej => {}
-				);
-
-			},
-
-
-
-
-
-
-
-
-
-
-			payOrder() {
-				if (this.payType == 1) {
-					// this.doWechatPay()
-					console.log("这个order", this.order)
-					const {
-						itemJson,
-						...newOrder
-					} = this.order;
-					this.newOrder = newOrder;
-					console.log("这个newOrder", this.newOrder)
-					this.weixinPayOrder()
-				} else if (this.payType == 2) {
-					this.doAlipay()
-				} else {
-					uni.showToast({
-						title: "暂时无可用支付",
-						icon: 'none'
-					})
-				}
-			},
-
-			// 选微信支付或者支付宝支付
-			handlePayTypeChange(e) {
-				this.payType = e.detail.value; // 获取选中的 value
-				console.log('当前选中:', this.payType);
-			},
-
-			getUserInfo() {
-				getUserInfo().then(
-					res => {
-						if (res.code == 200) {
-							if (res.user != null) {
-								this.user = res.user;
-							}
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: "请求失败",
-							});
-						}
-					},
-					rej => {}
-				);
-			},
-			getStoreConfig() {
-				getStoreConfig().then(
-					res => {
-						if (res.code == 200) {
-							this.config = res.data
-							console.log(this.config);
-						}
-					},
-					rej => {}
-				);
-			},
-			payTypeChange(e) {
-				if (this.combinationOrderId) {
-					this.editPayTypeByCombinationId(e.detail.value)
-				} else {
-					this.editPayType(e.detail.value)
-				}
-			},
-			editPayType(payType) {
-				var data = {
-					orderId: this.orderId,
-					payType: payType
-				};
-				var that = this;
-				uni.showLoading();
-				editPayType(data).then(
-					res => {
-						if (res.code == 200) {
-							console.log(res);
-							uni.hideLoading();
-							that.order = res.order;
-							that.order.orderCodes = that.order.orderCode ? [that.order.orderCode] : []
-							that.orderCode = that.order.orderCode
-							// this.payType=this.order.payType
-							this.payMoney = this.order.payMoney;
-							this.payDelivery = this.order.payDelivery;
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: res.msg,
-							});
-						}
-					},
-					rej => {}
-				);
-
-			},
-
-		}
-	}
-</script>
-
-<style lang="scss">
-	page {
-		height: 100%;
-	}
-
-	.content {
-		height: 100%;
-		display: flex;
-		flex-direction: column;
-		justify-content: space-between;
-
-		.inner {
-			padding: 20upx;
-
-			.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;
-					}
-				}
-			}
-
-			.pay-type {
-				box-sizing: border-box;
-				background: #FFFFFF;
-				border-radius: 16upx;
-				margin-top: 20upx;
-				padding: 40upx 30upx;
-				display: flex;
-				flex-direction: column;
-				justify-content: space-between;
-
-				.title {
-					font-size: 28upx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #999999;
-					line-height: 1;
-					margin-bottom: 10upx;
-				}
-
-				.item {
-					padding: 15upx 0upx;
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-
-					.left {
-						display: flex;
-						align-items: center;
-
-						image {
-							width: 44upx;
-							height: 44upx;
-							margin-right: 20upx;
-						}
-
-						.text {
-							font-size: 30upx;
-							font-family: PingFang SC;
-							font-weight: bold;
-							color: #222222;
-							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;
-				}
-
-				.item {
-					margin-top: 40upx;
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-
-					.label {
-						font-size: 26upx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #666666;
-						line-height: 1;
-					}
-
-					.text {
-						font-size: 26upx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #222222;
-						line-height: 32upx;
-					}
-
-					.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-weight: 500;
-							color: #222222;
-							background: #F5F5F5;
-							border-radius: 4upx;
-							margin-left: 24upx;
-						}
-					}
-
-				}
-
-				.line {
-					width: 100%;
-					height: 1px;
-					background: #F0F0F0;
-					margin-top: 30upx;
-				}
-			}
-		}
-
-		.btn-box {
-			height: 242upx;
-			background: #FFFFFF;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			flex-direction: column;
-
-			.btn {
-				width: 91.73%;
-				height: 88upx;
-				line-height: 88upx;
-				font-size: 30upx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #FFFFFF;
-				text-align: center;
-				background: #2BC7B9;
-				border-radius: 44upx;
-				margin-bottom: 10rpx;
-			}
-
-			.other-btn {
-				width: 91.73%;
-				height: 88upx;
-				line-height: 88upx;
-				font-size: 30upx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #2BC7B9;
-				border: 1rpx solid #2BC7B9;
-				text-align: center;
-				background: #FFFFFF;
-				border-radius: 44upx;
-				margin-bottom: 10rpx;
-				position: relative;
-
-				.share {
-					display: inline-block;
-					position: absolute;
-					top: 0;
-					left: 0;
-					width: 100%;
-					height: 100%;
-					opacity: 0;
-				}
-			}
-		}
-	}
+<template>
+	<view class="content">
+		<view class="inner">
+			<!-- 时间、价格 -->
+			<view class="time-price">
+				<text class="time">待支付</text>
+				<view class="price-box">
+					<text class="unit">¥</text>
+					<text class="num">{{order ? (Number(order.payMoney) || 0).toFixed(2) : "0.00"}}</text>
+				</view>
+
+			</view>
+			<!-- 支付方式 -->
+			<view class="pay-type">
+				<view class="title">支付方式</view>
+				<radio-group @change="handlePayTypeChange">
+					<view class="item">
+						<view class="left">
+							<image src="/static/images/wecha_pay.png" mode=""></image>
+							<text class="text">微信支付</text>
+						</view>
+						<label>
+							<radio :value="1" :checked="payType === 1" />
+						</label>
+					</view>
+					<!-- #ifdef APP-PLUS||H5 -->
+					<view class="item">
+						<view class="left">
+							<image src="/static/images/zfb.png" mode=""></image>
+							<text class="text">支付宝</text>
+						</view>
+						<label>
+							<radio :value="2" :checked="payType === 2" />
+						</label>
+					</view>
+					<!-- #endif -->
+				</radio-group>
+			</view>
+			<!-- 订单详情查看 -->
+			<view class="order-info">
+				<view class="title">订单信息</view>
+				<view class="item">
+					<text class="label">订单编号</text>
+					<view class="sn-box">
+						<view>
+							<view class="text">{{order.orderCode}}</view>
+						</view>
+					</view>
+				</view>
+				<view class="item">
+					<text class="label">下单时间</text>
+					<text class="text">{{ formattedDate}} </text>
+				</view>
+				<view class="item">
+					<text class="label">订单金额</text>
+					<text class="text"
+						v-if="order!=null">{{order ? (Number(order.totalPrice) || 0).toFixed(2) : "0.00"}}</text>
+				</view>
+				<view class="item">
+					<text class="label">优惠券</text>
+					<text class="text">-¥{{order ? (Number(order.discountMoney) || 0).toFixed(2) : "0.00"}} </text>
+				</view>
+			</view>
+
+		</view>
+		<view class="btn-box">
+			<view class="btn" @click="payOrder()">去支付</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import dayjs from 'dayjs';
+	import {
+		weChatPayment
+	} from '@/api/pay_new'
+	import {
+		zfbPayment,
+		// weChatPayment
+	} from '@/api/pay'
+	import {
+		payConfirmReward,
+	} from '@/api/order'
+	export default {
+		data() {
+			return {
+				type:'',
+				payPrice: null,
+				newOrder: {},
+				payType: 2,
+				order: null,
+				orderId: null,
+				payDelivery: 0,
+				payMoney: 0,
+				config: null,
+				payType: 1,
+				user: null,
+				couponUserId: null
+			}
+		},
+		computed: {
+			formattedDate() {
+				return this.order?.createTime ? dayjs(this.order.createTime).format('YYYY-MM-DD HH:mm:ss') : '';
+			},
+			payLimitTime() {
+				return this.order?.updateTime ?
+					dayjs(this.order.updateTime).add(2, 'day').format('YYYY-MM-DD HH:mm:ss') :
+					'';
+			}
+		},
+		onLoad(options) {
+			// if (options.payPrice) {
+			// 	this.payPrice = options.payPrice;
+			// }
+			if (options.couponUserId) {
+				this.couponUserId = options.couponUserId;
+			}
+			console.log("支付订单是>>", options)
+			this.type = options.type;
+			// this.liveId = options.liveId
+			// this.productId=options.productId
+			// console.log("支付订单",options)
+
+			if (options.orderList) {
+				try {
+					const decoded = decodeURIComponent(options.orderList);
+					this.order = JSON.parse(decoded) || {}; // 默认空对象
+				} catch (e) {
+					console.error('参数解析失败:', e);
+					this.order = {}; // 显式赋默认值
+				}
+			}
+		},
+		// //发送给朋友
+		// onShareAppMessage(res) {
+		// 	const combinationOrderId = this.combinationOrderId ?
+		// 		`&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
+		// 	return {
+		// 		title: "帮TA支付",
+		// 		path: '/pages_user/user/otherPaymentOrder?orderId=' + this.orderId + combinationOrderId,
+		// 		imageUrl: '/static/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
+		// 	}
+
+		// },
+		methods: {
+			weixinPayOrder() {
+				var data = {
+					orderId: this.order.orderId,
+					payType: 1
+					// payType: this.order.payType
+				};
+
+				var that = this;
+				uni.showLoading();
+				weChatPayment(data).then(
+					res => {
+						if (res.code == 200) {
+							console.log(res);
+
+							if (res.payType == 1 || res.payType == 2) {
+								var result = JSON.parse(res.result);
+								uni.requestPayment({
+									provider: 'wxpay',
+									timeStamp: result.timeStamp,
+									nonceStr: result.nonceStr,
+									package: result.package,
+									signType: result.signType,
+									paySign: result.paySign,
+									success: function(res) {
+										uni.hideLoading();
+
+										uni.redirectTo({
+											url: "./success?order=" + JSON.stringify(that.newOrder)
+										})
+
+
+									},
+									fail: function(err) {
+										uni.showToast({
+											icon: 'none',
+											title: 'fail:' + JSON.stringify(err),
+										});
+										uni.hideLoading();
+									}
+								});
+							}
+
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+
+			},
+
+
+
+
+
+
+
+
+
+
+			payOrder() {
+				if (this.type == 'win') {
+					this.toPayConfirmReward()
+				} else {
+					if (this.payType == 1) {
+						console.log("这个order", this.order)
+						const {
+							itemJson,
+							...newOrder
+						} = this.order;
+						this.newOrder = newOrder;
+						console.log("这个newOrder", this.newOrder)
+						this.weixinPayOrder()
+					} else {
+						uni.showToast({
+							title: "暂时无可用支付",
+							icon: 'none'
+						})
+					}
+				}
+			},
+
+			// 选微信支付或者支付宝支付
+			handlePayTypeChange(e) {
+				this.payType = e.detail.value; // 获取选中的 value
+				console.log('当前选中:', this.payType);
+			},
+			toPayConfirmReward() {
+				let data={
+					orderId:this.order.orderId
+				}
+				payConfirmReward(data).then(
+					res => {
+						if (res.code == 200) {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+
+			getUserInfo() {
+				getUserInfo().then(
+					res => {
+						if (res.code == 200) {
+							if (res.user != null) {
+								this.user = res.user;
+							}
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			getStoreConfig() {
+				getStoreConfig().then(
+					res => {
+						if (res.code == 200) {
+							this.config = res.data
+							console.log(this.config);
+						}
+					},
+					rej => {}
+				);
+			},
+			payTypeChange(e) {
+				if (this.combinationOrderId) {
+					this.editPayTypeByCombinationId(e.detail.value)
+				} else {
+					this.editPayType(e.detail.value)
+				}
+			},
+			editPayType(payType) {
+				var data = {
+					orderId: this.orderId,
+					payType: payType
+				};
+				var that = this;
+				uni.showLoading();
+				editPayType(data).then(
+					res => {
+						if (res.code == 200) {
+							console.log(res);
+							uni.hideLoading();
+							that.order = res.order;
+							that.order.orderCodes = that.order.orderCode ? [that.order.orderCode] : []
+							that.orderCode = that.order.orderCode
+							// this.payType=this.order.payType
+							this.payMoney = this.order.payMoney;
+							this.payDelivery = this.order.payDelivery;
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+
+			},
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+	}
+
+	.content {
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+
+		.inner {
+			padding: 20upx;
+
+			.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;
+					}
+				}
+			}
+
+			.pay-type {
+				box-sizing: border-box;
+				background: #FFFFFF;
+				border-radius: 16upx;
+				margin-top: 20upx;
+				padding: 40upx 30upx;
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+
+				.title {
+					font-size: 28upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					line-height: 1;
+					margin-bottom: 10upx;
+				}
+
+				.item {
+					padding: 15upx 0upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+
+					.left {
+						display: flex;
+						align-items: center;
+
+						image {
+							width: 44upx;
+							height: 44upx;
+							margin-right: 20upx;
+						}
+
+						.text {
+							font-size: 30upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #222222;
+							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;
+				}
+
+				.item {
+					margin-top: 40upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+
+					.label {
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #666666;
+						line-height: 1;
+					}
+
+					.text {
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #222222;
+						line-height: 32upx;
+					}
+
+					.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-weight: 500;
+							color: #222222;
+							background: #F5F5F5;
+							border-radius: 4upx;
+							margin-left: 24upx;
+						}
+					}
+
+				}
+
+				.line {
+					width: 100%;
+					height: 1px;
+					background: #F0F0F0;
+					margin-top: 30upx;
+				}
+			}
+		}
+
+		.btn-box {
+			height: 242upx;
+			background: #FFFFFF;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-direction: column;
+
+			.btn {
+				width: 91.73%;
+				height: 88upx;
+				line-height: 88upx;
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FFFFFF;
+				text-align: center;
+				background: #2BC7B9;
+				border-radius: 44upx;
+				margin-bottom: 10rpx;
+			}
+
+			.other-btn {
+				width: 91.73%;
+				height: 88upx;
+				line-height: 88upx;
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #2BC7B9;
+				border: 1rpx solid #2BC7B9;
+				text-align: center;
+				background: #FFFFFF;
+				border-radius: 44upx;
+				margin-bottom: 10rpx;
+				position: relative;
+
+				.share {
+					display: inline-block;
+					position: absolute;
+					top: 0;
+					left: 0;
+					width: 100%;
+					height: 100%;
+					opacity: 0;
+				}
+			}
+		}
+	}
 </style>