Bläddra i källkod

Signed-off-by: 李妹妹 <1639016684@qq.com>

李妹妹 1 vecka sedan
förälder
incheckning
a9d7b901b7

+ 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

+ 77 - 13
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,
@@ -933,6 +936,16 @@
 			this.getLocationByIP();
 			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) {
@@ -954,12 +967,13 @@
 			}
 			this.userinfo = uni.getStorageSync('userinfo');
 			// this.userData = uni.getStorageSync('userData');
-			console.log('全部参数', options);
+			
 			try {
 				const isLogin = await this.utils.checkLiveToken();
 				if (isLogin) {
 					this.haveLogin()
 				}
+				
 			} catch (error) {
 				console.error('初始化失败:', error);
 			}
@@ -1056,6 +1070,9 @@
 				const isLogin = await this.utils.checkLiveToken();
 				if (isLogin) {
 					this.haveLogin()
+					if(this.urlOption.qwUserId){
+						this.getIsAddKf()
+					}
 				} else {
 					this.goLogin();
 				}
@@ -1064,7 +1081,6 @@
 			}
 
 			this.getLocationByIP();
-
 			this.uuId = generateRandomString(16);
 			const isLiveLogin = uni.getStorageSync('isLiveLogin');
 			this.share = uni.getStorageSync('share');
@@ -1750,14 +1766,14 @@
 				this.userInfo = uni.getStorageSync('userInfo');
 				if (this.userInfo) {
 					await this.getUserInfo();
+					
 				}
-
+                  
 				// this.initTime();
 				if (this.liveId) {
 					// 先获取直播间信息
 					await this.getliving(this.liveId);
 					this.isOnload = true;
-
 					await this.getLiveMsg(this.liveItem);
 					await this.getliveViewData();
 					// await this.getliving(this.liveId);
@@ -1811,7 +1827,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,
@@ -1830,6 +1848,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() {
 				// 高德IP定位API,需要替换成你的key
@@ -5440,7 +5504,7 @@
 				}
 
 				&.chat-area-container4 {
-					height: calc(85% - 640rpx);
+					height: calc(85% - 680rpx);
 					flex: 1;
 					transform: none; // 移除之前的变换
 					will-change: auto;
@@ -5491,7 +5555,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) {