Bladeren bron

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pages_course/living.vue
yuhongqi 1 week geleden
bovenliggende
commit
a55c220f55

+ 6 - 1
api/living.js

@@ -232,4 +232,9 @@ export function loginByMp(data) {
 
 export function getUserInfo() {
 	return request('/liveAPP/app/user/getUserInfo', null, 'GET');
-}
+}
+
+// 关注客服
+export function getIsAddKf(data) {
+	return request('/app/live/liveWatchUser/liveIsAddKf', data, 'POST', 'application/json;charset=UTF-8');
+}

+ 2 - 2
api/storeAfterSales.js

@@ -9,8 +9,8 @@ let request = new Request().http
  }
  
  export function getAfterSalesList(data) {
- 	 return request('/app/storeAfterSales/getStoreAfterSalesList',data,'GET');///旧版
-	 //return request('/app/order/getMergedAfterSalesList',data,'GET');
+ 	 //return request('/app/storeAfterSales/getStoreAfterSalesList',data,'GET');///旧版
+	 return request('/app/order/getMergedAfterSalesList',data,'GET');
  } 
  
  export function getAfterSalesDetails(data) {

+ 7 - 2
api/storeOrder.js

@@ -3,8 +3,8 @@ let request = new Request().http
 
  
  export function getMyStoreOrderList(data) {
- 	 return request('/app/storeOrder/getMyStoreOrderList',data,'GET');//旧版
-	 //return request('/app/order/getMyMergedOrderList',data,'GET')
+ 	 //return request('/app/storeOrder/getMyStoreOrderList',data,'GET');//旧版
+	 return request('/app/order/getMyMergedOrderList',data,'GET')
  } 
  export function getCompanyStoreOrderList(data) {
  	 return request('/app/storeOrder/getCompanyStoreOrderList',data,'GET');
@@ -51,6 +51,11 @@ let request = new Request().http
  
  export function cancelOrder(data) {
  	 return request('/app/storeOrder/cancelOrder',data,'POST','application/json;charset=UTF-8');
+	 
+ }
+ // 取消直播订单
+ export function cancelLiveOrder(data) {
+ 	return request('/app/live/liveOrder/cancelOrder', data, 'POST', 'application/json;charset=UTF-8')
  }
  export function finishOrder(data) {
  	 return request('/app/storeOrder/finishOrder',data,'POST','application/json;charset=UTF-8');

+ 8 - 8
common/request.js

@@ -13,8 +13,8 @@ export default class Request {
 		let path = 'https://userapp.klbycp.com/store'; //百域承品
 		let path2 = 'https://userapp.klbycp.com'; //百域承品
 
-		// let path = 'http://qeeaf625.natappfree.cc/store'; //本地
-		// let path2 = 'http://qeeaf625.natappfree.cc'; //本地
+		// let path = 'http://gd3c3bb9.natappfree.cc/store'; //本地
+		// let path2 = 'http://gd3c3bb9.natappfree.cc'; //本地
 
 		let type = 0
 		uni.setStorageSync('requestPath', path2)
@@ -25,13 +25,13 @@ export default class Request {
 		if (router.indexOf("/live/liveData/like") != -1) {
 			path = 'https://im.fhhx.runtzh.com';
 		}
-// if (router.indexOf("/app/order/getMyMergedOrderList") != -1) {
-// 			path = 'https://userapp.klbycp.com';
-// 		}
+if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/app/order/deleteOrder") != -1) {
+			path = 'https://userapp.klbycp.com';
+		}
 	
-			// if (router.indexOf("/app/order/getMergedAfterSalesList") != -1) {
-			// 		path = 'http://sce93275.natappfree.cc';
-			// 	}
+			if (router.indexOf("/app/order/getMergedAfterSalesList") != -1) {
+					path = 'https://userapp.klbycp.com';
+				}
 		if (router.indexOf("/live") !== -1 || router.indexOf("/liveAPP") !== -1) {
 			// path = 'https://userapp.klbycp.com';
 			path = path2

+ 86 - 20
pages_course/living.vue

@@ -17,7 +17,7 @@
 					src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/readyStart.png">
 				</image>
 				<view class="countdown-container" v-if="liveItem.status == 1 && liveCountdown">
-					<!-- <view class="live-name">{{ liveItem.liveName }}</view> -->
+					<view class="live-name" v-if="liveItem.previewUrl">{{ liveItem.liveName }}</view>
 					<view class="countdown-display">
 						<text class="countdown-label">距离开播还有</text>
 						<view class="countdown-unit">
@@ -173,7 +173,7 @@
 				<view class="videolist" v-if="liveItem.status == 3">
 					<view class="video-container" style="height: 500rpx;"
 						:class="{'horizontal-layout': liveItem.showType == 1, 'fullscreen-mode': isFullscreen}">
-						<view class="live-end-message">直播已结束</view>
+						<view class="live-end-message" :style="{marginTop:liveItem.showType === 2?'50%':''}">直播已结束</view>
 					</view>
 				</view>
 
@@ -214,8 +214,8 @@
 				<!-- 底部聊天区域 -->
 				<view class="chat-area-container" :class="{
 				    'chat-area-container2': liveItem.showType == 1,
-					'chat-area-container3': liveItem.status == 1 && !liveItem.previewUrl,
-					'chat-area-container4': liveItem.status == 1 && liveItem.previewUrl,
+					'chat-area-container3': liveItem.status == 1 && !liveItem.previewUrl && liveItem.showType == 1,
+					'chat-area-container4': liveItem.status == 1 && liveItem.previewUrl && liveItem.showType == 1,
 				    'chat-area-focused': isFocus
 				  }" :style="{ '--keyboard-height': keyboardHeight + 'rpx' ,'display':isFullscreen?'none':''}">
 					<view class="tabs_bg" v-if="liveItem.showType == 1">
@@ -239,7 +239,7 @@
 							:style="{ height: liveItem.showType === 1?`calc(100% - ${commonViewHeight}px)`:liveItem.status == 1?'100%':'',marginTop:liveItem.showType === 1?commonViewHeight+'px':'' }"
 							:enhanced="true" :bounces="false" :show-scrollbar="false" :fast-deceleration="false"
 							:enable-back-to-top="false" class="message-scroll-view"
-							:class="liveItem.status == 1 ? 'message-scroll2' : ''" :scroll-top="scrollTop"
+							:class="liveItem.status == 1 ? '' : ''" :scroll-top="scrollTop"
 							:scroll-into-view="scrollIntoView" @scroll="onScroll" ref="scrollView">
 							<view class="message-list" v-for="(item, talkIndex) in (talklist || [])"
 								:key="item.uniqueId " :id="`list_${item.uniqueId }`" v-show="item.cmd != 'red' ">
@@ -716,7 +716,9 @@
 		internetTraffic, // 流量(缓冲百分比),
 		liveInternetTraffic, // 直播流量(缓冲百分比),
 		loginByMp,
-		getUserInfo
+		getUserInfo,
+		getIsAddKf,
+		liveWatchUser
 	} from '@/api/living.js';
 	import {
 		editUser
@@ -748,6 +750,7 @@
 		},
 		data() {
 			return {
+				urlOption:{},
 				menuButtonInfo: {}, // 胶囊按钮布局信息
 				isHeight: false,
 				isFullscreen: false,
@@ -936,10 +939,20 @@
 		async onLoad(options) {
 			this.getMenuButtonInfo(); // 初始化获取胶囊信息
 			this.initTime()
-			
+
 			// 解析参数
 			if (options.liveId) {
 				this.liveId = options.liveId;
+
+			}
+			if(options.qwUserId){
+				this.urlOption.companyId=options.companyId
+				this.urlOption.companyUserId=options.companyUserId
+				this.urlOption.corpId=options.corpId
+				this.urlOption.liveId=options.liveId
+				this.urlOption.qwUserId=options.qwUserId
+				this.urlOption.qwExternalId=options.externalId
+				this.urlOption.chatId=options.chatId
 			}
 			// 扫码传来的参数
 			if (options.scene) {
@@ -961,8 +974,10 @@
 			}
 			this.userinfo = uni.getStorageSync('userinfo');
 			console.log('全部参数', options);
-			
+
 			// 优先判断登录状态,然后加载数据
+			// this.userData = uni.getStorageSync('userData');
+
 			try {
 				const isLogin = await this.utils.checkLiveToken();
 				this.hasCheckedLogin = true;
@@ -973,11 +988,12 @@
 					// 未登录:先登录,登录成功后再加载数据
 					this.goLogin();
 				}
+
 			} catch (error) {
 				console.error('初始化失败:', error);
 				this.hasCheckedLogin = true;
 			}
-			
+
 			// 异步加载位置信息(不阻塞主流程)
 			if (!this.hasLoadedLocation) {
 				this.getLocationByIP();
@@ -1056,6 +1072,7 @@
 			setTimeout(() => {
 				uni.stopPullDownRefresh();
 			}, 1000);
+			this.getliving(this.liveId);
 		},
 		mounted() {
 			// 获取 video 上下文
@@ -1090,7 +1107,7 @@
 					this.hasCheckedLogin = true;
 				}
 			}
-			
+
 			// 位置信息只加载一次
 			if (!this.hasLoadedLocation) {
 				this.getLocationByIP();
@@ -1793,12 +1810,13 @@
 				if (this.isOnload) {
 					return;
 				}
-				
+
 				this.userInfo = uni.getStorageSync('userInfo');
 				if (this.userInfo) {
 					await this.getUserInfo();
 				}
 
+				// this.initTime();
 				if (this.liveId) {
 					// 优先加载直播间信息(包含视频资源URL)
 					await this.getliving(this.liveId);
@@ -1811,7 +1829,7 @@
 					]).catch(err => {
 						console.error('加载数据失败:', err);
 					});
-					
+
 					// 其他非关键数据异步加载
 					this.getCurrentActivities();
 					this.getliveOrder();
@@ -1863,7 +1881,9 @@
 										this.haveLogin()
 										this.userlogo = true
 										// console.log("TOKEN_KEYAuto",TOKEN_KEYAuto)
-										// this.getIsAddKf() 
+										if(this.urlOption.qwUserId){
+											this.getIsAddKf()										//this.getIsAddKf()
+										}
 									} else {
 										uni.showToast({
 											title: res.msg,
@@ -1882,6 +1902,52 @@
 					}
 				})
 			},
+			// liveWatchUser(){
+			// 	var data={
+			// 		qwUserId:this.urlOption.qwUserId,
+			// 		liveId:this.urlOption.liveId,
+			// 		userId:this.userInfo.userId,
+			// 		corpId:this.urlOption.corpId,
+			// 		companyUserId:this.urlOption.companyUserId,
+			// 		qwExternalId:this.urlOption.qwExternalId,
+			// 		companyId:this.urlOption.companyId,
+			// 		chatId:this.urlOption.chatId,
+			// 	}
+			// 	liveWatchUser(data).then(
+			// 		res => {
+			// 			if (res.code == 200) {
+
+			// 			} else {
+			// 				uni.showToast({
+			// 					icon: 'none',
+			// 					title: res.msg,
+			// 				});
+			// 			}
+			// 		},
+			// 		rej => {}
+			// 	);
+			// },
+			// 客服
+			getIsAddKf() {
+				// {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
+				getIsAddKf(this.urlOption).then(res => {
+						if (res.code == 200) {
+							this.isAddKf = 1
+							//this.getH5CourseVideoDetails()
+						} else if (res.code == 401) {
+							this.isAddKf = 0
+							this.goLogin();
+							}
+						else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					err => {}
+				);
+			},
 			clickTabs(item) {},
 			getLocationByIP() {
 				// 防止重复请求
@@ -1889,7 +1955,7 @@
 					return;
 				}
 				this.hasLoadedLocation = true;
-				
+
 				// 高德IP定位API,需要替换成你的key
 				const key = '4e13632be0cc278f56825919603c07cf';
 				uni.request({
@@ -3845,13 +3911,13 @@
 			// 修改获取直播信息方法
 			async getliving(liveId) {
 				if (!liveId) return;
-				
+
 				// 防止重复请求
 				if (this.isLoadingLiveInfo) {
 					console.log('正在加载直播间信息,跳过重复请求');
 					return;
 				}
-				
+
 				this.isLoadingLiveInfo = true;
 				const param = {
 					id: liveId
@@ -3859,7 +3925,7 @@
 				try {
 					const res = await getlive(param);
 					this.isLoadingLiveInfo = false;
-					
+
 					if (res.code !== 200) {
 						uni.showToast({
 							title: res.msg,
@@ -4009,7 +4075,7 @@
 			//直播间点赞、关注、在线人数数据
 			getliveViewData() {
 				if (!this.liveId) return;
-				
+
 				// 使用 Promise 包装,支持 await
 				return getLiveViewData(this.liveId).then((res) => {
 					if (res.code == 200) {
@@ -5516,7 +5582,7 @@
 				}
 
 				&.chat-area-container4 {
-					height: calc(85% - 640rpx);
+					height: calc(85% - 680rpx);
 					flex: 1;
 					transform: none; // 移除之前的变换
 					will-change: auto;
@@ -5567,7 +5633,7 @@
 					position: relative;
 
 					&.chat-content-focused {
-						height: 100rpx;
+						height: 100rpx  !important;
 					}
 
 					.notice-message {

+ 4 - 3
pages_shopping/live/confirmCreateOrder.vue

@@ -358,8 +358,8 @@
 					productId: this.productId,
 					totalNum: this.totalNum,
 					couponUserId: this.couponUserId,
-					attrValueId: this.productValueSelect
-
+					attrValueId: this.productValueSelect,
+                     appId: wx.getAccountInfoSync().miniProgram.appId
 				}
 
 				return createliveOrder(data).then(res => {
@@ -390,7 +390,8 @@
 					productId: this.productId,
 					totalNum: 1,
 					couponUserId: this.couponUserId,
-					recordId: this.recordId
+					recordId: this.recordId,
+					appId: wx.getAccountInfoSync().miniProgram.appId
 				}
 
 				return createReward(data).then(res => {

+ 4 - 2
pages_shopping/live/paymentOrder.vue

@@ -182,7 +182,8 @@
 			weixinPayOrder() {
 				var data = {
 					orderId: this.order.orderId,
-					payType: 1
+					payType: 1,
+					appId: wx.getAccountInfoSync().miniProgram.appId
 				};
 				this.payParams = data
 				var that = this;
@@ -320,7 +321,8 @@
 			
 			toPayConfirmReward() {
 				let data = {
-					orderId: this.order.orderId
+					orderId: this.order.orderId,
+					appId: wx.getAccountInfoSync().miniProgram.appId
 				}
 				payConfirmReward(data).then(
 					res => {

+ 20 - 2
pages_user/user/storeOrder.vue

@@ -171,7 +171,7 @@
 </template>
 
 <script>
-	import {getMyStoreOrderList,cancelOrder,deleteOrder as deleteOrderApi} from '@/api/storeOrder'
+	import {getMyStoreOrderList,cancelOrder,canceliveOrder, deleteOrder as deleteOrderApi, cancelLiveOrder} from '@/api/storeOrder'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
 		mixins: [MescrollMixin], 
@@ -296,7 +296,8 @@
 							var data = {
 								orderId:item.orderType==2?item.orderId:item.id
 							};
-							cancelOrder(data).then(res => {
+							if(item.orderType==2){
+							cancelLiveOrder(data).then(res => {
 								if(res.code==200){
 									uni.showToast({
 										icon:'success',
@@ -310,6 +311,23 @@
 									});
 								}
 							});
+							}else{
+								cancelOrder(data).then(res => {
+									if(res.code==200){
+										uni.showToast({
+											icon:'success',
+											title: "操作成功",
+										});
+										 that.mescroll.resetUpScroll()
+									}else{
+										uni.showToast({
+											icon:'none',
+											title: res.msg,
+										});
+									}
+								});
+							}
+							
 				        } 
 						else if (res.cancel) {