qxj 1 week ago
parent
commit
e4f2a905a0
3 changed files with 13 additions and 19 deletions
  1. 0 2
      App.vue
  2. 10 12
      pages_course/living.vue
  3. 3 5
      pages_shopping/live/goods.vue

+ 0 - 2
App.vue

@@ -9,11 +9,9 @@
 		},
 		onLaunch: function(options) {
 			console.log("onLaunch在这里", options)
-
 			if (options.query.companyId) {
 				uni.setStorageSync('share', options.query)
 			}
-
 			if (options.query.scene) {
 				uni.setStorageSync('scene', options.query.scene)
 			}

+ 10 - 12
pages_course/living.vue

@@ -396,6 +396,7 @@
 					</view>
 				</view>
 			</u-popup>
+			
 			<!-- 观众列表弹窗 -->
 			<u-popup :show="showadd" @close="close" @open="openViews" round="20rpx" bgColor="#ffffff" zIndex="10077">
 				<view class="view-box">
@@ -562,6 +563,7 @@
 					</view>
 				</view>
 			</view>
+			
 		</view>
 	</view>
 </template>
@@ -665,9 +667,7 @@ export default {
 
 			templateId: 'fxYJu817lxHNKXl0hJypb-y-lLm8CNmGbcwpQmasCVg',
 			isAgreement: false,
-
-			wsNewUrl: 'wss://api.fhhx.runtzh.com/ws/app/webSocket',
-			// wsNewUrl: 'ws://192.168.10.166:7114/ws/app/webSocket',
+			
 			qrFrom: null,
 			scene: '',
 
@@ -2743,14 +2743,12 @@ export default {
 			const now = new Date();
 			this.timestamp = now.getTime();
 		},
-
 		openCart() {
 			this.queryCollect();
 		},
 		close() {
 			this.showadd = false;
 		},
-
 		// 关闭小黄车
 		closeShop() {
 			this.shopping = false;
@@ -2767,7 +2765,7 @@ export default {
 				console.warn('WebSocket 任务不存在或未打开,无需关闭');
 				return;
 			}
-			
+	
 			console.log(`WebSocket连接关闭 - ${isManual ? '手动' : '自动'}`);
 			this.isManualClose = isManual;
 			
@@ -2879,7 +2877,8 @@ export default {
 			const signature = CryptoJS.HmacSHA256(`${this.liveId}${this.userData.userId}${this.userType}${this.timestamp}`, this.timestamp.toString()).toString(CryptoJS.enc.Hex);
 
 			try {
-				const baseWsUrl = 'wss://api.fhhx.runtzh.com/ws/app/webSocket';
+				const baseWsUrl = 'wss://im.fhhx.runtzh.com/ws/app/webSocket';
+				//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}`;
 				if (this.qrFrom) {
@@ -2959,7 +2958,6 @@ export default {
 					this.isSocketOpen = false;
 					this.isConnecting = false;
 					this.stopHeartBeat(); // 清除心跳定时器
-					
 					// 根据关闭原因决定是否重连
 					if (!this.isManualClose) {
 						if (res.code === 1000) {
@@ -3102,7 +3100,6 @@ export default {
 						}
 						// 清除已有定时器(无论状态是否为1,先清掉旧的)
 						clearTimeout(this.lotteryTimer);
-
 						if (this.isShowLottery) {
 							this.lotteryTimer = setInterval(() => {
 								this.countdown = this.handleTime(this.lotteryInfo.updateTime, this.lotteryInfo.duration);
@@ -3292,7 +3289,8 @@ export default {
 				console.error('发送消息异常:', err);
 				if (retries > 0) {
 					setTimeout(() => this.sendMsg(retries - 1), 500);
-				} else {
+				} 
+				else {
 					uni.showToast({
 						title: '发送失败,请稍后再试',
 						icon: 'none'
@@ -3301,8 +3299,7 @@ export default {
 				}
 			}
 		}
-	
-	},
+	}
 	
 
 };
@@ -4345,4 +4342,5 @@ export default {
 		}
 	}
 }
+
 </style>

+ 3 - 5
pages_shopping/live/goods.vue

@@ -15,7 +15,7 @@
 				<view class="num-box">{{ activeBanner }}/{{ banner.length }}</view>
 			</view>
 			<!-- 详细信息 -->
-			<view class="det-info">
+			<view class="det-info" v-if="!!goosDetail">
 				<view class="price-box">
 					<view class="price">
 						<text class="label">会员价</text>
@@ -90,9 +90,7 @@
 </template>
 
 <script>
-	import {
-		liveGoodsDetail
-	} from '@/api/living'
+	import {liveGoodsDetail} from '@/api/living'
 	import {
 		liveOrderKey, // 生成订单key
 	} from "@/api/order.js"
@@ -113,7 +111,7 @@
 				storeId: null,
 				serviceList: ['品质保障', '药师服务', '隐私保护'],
 				productId: null,
-				goosDetail: {}, //商品详情
+				goosDetail: null, //商品详情
 				buyText: "立即购买",
 				goodsNum: 0, //商品选择数量
 				// 当前轮播的图片