liujiaxin 1 week ago
parent
commit
df63845e4d

+ 8 - 3
api/coupon.js

@@ -4,9 +4,16 @@ let request = new Request().http
  export function getCouponIssueList(data) {
  	 return request('/app/coupon/getCouponIssueList',data,'GET');
  }
+ 
+ 
  export function getCompanyCouponIssueList(data) {
  	 return request('/app/coupon/getCompanyCouponIssueList',data,'GET');
  }
+ export function getMyEnableCouponList(data) {
+ 	 return request('/app/coupon/getMyEnableCouponList',data,'GET');
+ }
+ 
+ 
  export function getCouponIssueById(data) {
  	 return request('/app/coupon/getCouponIssueById',data,'GET');
  }
@@ -23,9 +30,7 @@ let request = new Request().http
  export function getMyCouponList(data) {
  	 return request('/app/coupon/getMyCouponList',data,'GET');
  }
- export function getMyEnableCouponList(data) {
- 	 return request('/app/coupon/getMyEnableCouponList',data,'GET');
- }
+ 
  
  
 

+ 1 - 1
api/living.js

@@ -30,7 +30,7 @@ const api = {
 	getlive: '/app/live/live',
 	liveList: '/app/live/liveList', //直播列表
 	liveShareList: (companyId, pageSize, pageNum) =>
-		`/app/live/liveList/${companyId}?pageSize=${pageSize}&pageNum=${pageNum}`, //直播列表
+		`/app/live/liveList/${companyId}?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
 	subNotifyLive: '/app/live/subNotifyLive' ,//订阅消息
 	coupon: '/app/live/coupon/claim' ,//领取优惠券
 	curCoupon: '/app/live/coupon/curCoupon' ,//优惠券列表

+ 3 - 2
pages_company/shareLive.vue

@@ -37,7 +37,7 @@
 
 <script>
 	import {
-		liveList
+		liveShareList
 	} from '@/api/living.js'
 
 
@@ -119,11 +119,12 @@
 			upCallback(page) {
 				//联网加载数据
 				var that = this;
+				if(!this.companyId) return;
 				// var data = {
 				// 	pageNum: page.num,
 				// 	pageSize: page.size,
 				// };
-				liveList(this.companyId,page.size,page.num).then(res => {
+				liveShareList(this.companyId,page.size,page.num).then(res => {
 					if (res.code == 200) {
 						//设置列表数据
 						if (page.num == 1) {

+ 86 - 23
pages_course/living.vue

@@ -68,16 +68,17 @@
 						<!-- 直播 -->
 						<live-player v-if="liveItem.livingUrl && liveItem.liveType == 1" :id="'myLivePlayer_' + liveId"
 							:src="liveItem.livingUrl" autoplay mode="live" object-fit="contain" :muted="false"
-							orientation="vertical" :enable-play-gesture="true" min-cache="1" max-cache="3"
+							orientation="vertical" :enable-play-gesture="false" min-cache="1" max-cache="3"
 							@statechange="onLiveStateChange($event, liveItem)" @error="onLiveError($event, liveItem)"
 							class="item"></live-player>
 						<!-- 录播 -->
-						<video v-if="liveItem.videoUrl&&liveItem.liveType==2" :id="`myVideo_${liveId}`" class="item"
-							:src="liveItem.videoUrl" :controls="false" object-fit="contain" :custom-cache="false"
-							:enable-progress-gesture="false" vslide-gesture-in-fullscreen="true"
+						<video v-if="liveItem.videoUrl&&liveItem.liveType==2" :id="`myVideo_${liveId}`" :autoplay="true"
+							class="item" :src="liveItem.videoUrl" :controls="false" object-fit="contain"
+							:custom-cache="false" :enable-progress-gesture="false" vslide-gesture-in-fullscreen="false"
 							:show-center-play-btn="false" :http-cache="false" loop @error="videoError"
 							@timeupdate="onVideoTimeUpdate" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause"
-							@play="onVideoPlay" @waiting="onVideoWaiting" :enable-play-gesture="true">
+							@play="onVideoPlay" @waiting="onVideoWaiting" :enable-play-gesture="false"
+							@dblclick="preventDoubleClick">
 						</video>
 						<view v-if="liveItem.videoUrl&&liveItem.liveType==2" class="time">{{liveItem.totalTime}}
 						</view>
@@ -87,20 +88,21 @@
 					<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
 						<!-- 直播回放 -->
 						<video v-if="liveItem.videoUrl&&liveItem.liveType==3" :id="`myVideo_${liveId}`" class="item"
-							:src="liveItem.videoUrl" :controls="true" object-fit="contain" :custom-cache="false"
-							:enable-progress-gesture="liveItem.isSpeedAllowed" vslide-gesture-in-fullscreen="true"
-							:show-center-play-btn="true" :http-cache="false" loop @error="videoError"
-							@timeupdate="onVideoTimeUpdate" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause"
-							@play="onVideoPlay" :enable-play-gesture="true" @waiting="onVideoWaiting">
+							:src="liveItem.videoUrl" :autoplay="true" :controls="true" object-fit="contain"
+							:custom-cache="false" :enable-progress-gesture="liveItem.isSpeedAllowed"
+							vslide-gesture-in-fullscreen="true" :show-center-play-btn="true" :http-cache="false" loop
+							@error="videoError" @timeupdate="onVideoTimeUpdate" @loadedmetadata="onVideoMetaLoaded"
+							@pause="onVideoPause" @play="onVideoPlay" :enable-play-gesture="true"
+							@waiting="onVideoWaiting">
 						</video>
 						<view v-if="liveItem.videoUrl&&liveItem.liveType==3" class="lable">直播回放</view>
 					</view>
 				</view>
 				<view class="trailer-box" v-if="liveItem.status==1">
 					<video v-if="liveItem.previewUrl" :id="`myVideo_${liveId}`" class="item" :src="liveItem.previewUrl"
-						:autoplay="true" :controls="false" object-fit="contain" :custom-cache="false"
+						:autoplay="true" :loop="false" :controls="false" object-fit="contain" :custom-cache="false"
 						:enable-progress-gesture="false" vslide-gesture-in-fullscreen="false"
-						:show-center-play-btn="false" :http-cache="false" loop @error="videoError"
+						:show-center-play-btn="false" :http-cache="false" @error="videoError"
 						@loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause" @play="onVideoPlay"
 						:disable-progress="true" :enable-play-gesture="true" @waiting="onVideoWaiting">
 					</video>
@@ -176,7 +178,7 @@
 							<view class="send" @click="sendMsg()">发送</view>
 						</view>
 						<view class="justify-between mr15 align-center" v-if="!isFocus">
-							<view class="icon-bg ml20" @click="openCart()">
+							<view class="icon-bg ml20" @tap="openCart()">
 								<image src="/static/images/shopping.png" class="w58 h58" />
 							</view>
 						</view>
@@ -305,6 +307,27 @@
 				</view>
 			</u-popup>
 
+			<!-- 更多弹窗 -->
+			<u-popup :show="isMore" @close="closeMore" round='20rpx' bgColor='#f3f5f9' zIndex='10076'>
+				<view class="more-block">
+					<view class="item" @click="isMore=false">
+						<image class="w48 h48" src="/static/images/order.png" />
+						<view style="text-align: center;">兑换好礼</view>
+					</view>
+					<view class=" item" @click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId='+liveId),isMore=false">
+						<image class="w48 h48" src="/static/images/after_sales.png" />
+						<view style="text-align: center;">售后订单</view>
+					</view>
+					<view class=" item" @click="isMore=false">
+						<image class="w48 h48" src="/static/images/points.png" />
+						<view style="text-align: center;">芳华币</view>
+					</view>
+					<view class=" item" @click="isMore=false">
+						<image class="w48 h48" src="/static/images/health_sel.png" />
+						<view style="text-align: center;">中奖记录</view>
+					</view>
+				</view>
+			</u-popup>
 			<!-- 商品弹窗 -->
 			<u-popup :show="shopping" @close="closeShop" round='20rpx' bgColor='#f3f5f9' zIndex='10075'>
 				<view class="shoppop">
@@ -314,15 +337,18 @@
 							<input placeholder="请搜索商品" v-model="inputInfo" @input="handleSearchInput" />
 						</view>
 						<view class=" search-top" @click="navgetTo('/pages_shopping/live/order')">
-							<image class="w48 h48" src="/static/images/order.png" />
-							<view>订单</view>
+							<image class="w48 h48" src="/static/images/carts.png" />
+							<view style="text-align: center;">订单</view>
 						</view>
-
-						<view class=" search-top"
+						<view class="search-top" @click="isMore=true,shopping=false">
+							<image class="w48 h48" src="/static/images/search2.png" />
+							<view style="text-align: center;">更多</view>
+						</view>
+						<!-- <view class=" search-top"
 							@click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId='+liveId)">
 							<image class="w48 h48" src="/static/images/after_sales.png" />
-							<view>售后</view>
-						</view>
+							<view style="text-align: center;">售后</view>
+						</view> -->
 					</view>
 
 					<scroll-view enable-flex scroll-y class="shop-list" :style="{ height: boxHeight + 'px' }">
@@ -362,7 +388,8 @@
 				<view class="coupon-block">
 					<image class="bg" src="/static/images/coupon_bg.png" />
 					<image class="nav" src="/static/images/coupon_top.png" />
-					<image @click="isShowCoupon=false" class="w40 h40 close" src="/static/images/close1.png" />
+					<image @click="isShowCoupon=false" class="w40 h40 close" style="z-index: 99;"
+						src="/static/images/close1.png" />
 					<view class="item">
 						<view class="title">{{couponInfo.couponName}}</view>
 						<view class="price">¥<text class="bold">{{couponInfo.couponPrice}}</text></view>
@@ -424,6 +451,7 @@
 		},
 		data() {
 			return {
+				isMore:false,
 				value: '',
 				totalTraffic: 0, // 总流量(字节)
 				bitrate: 1600, // 默认码率 0.16Mbps
@@ -759,7 +787,17 @@
 				immediate: true
 			}
 		},
-		methods: {
+		methods: { // 阻止双击事件
+			preventDoubleClick(e) {
+				e.preventDefault();
+				e.stopPropagation();
+				return false;
+			},
+			finishTime() {
+				if (this.liveItem.finishTime) {
+
+				}
+			},
 			// 清理所有定时器
 			clearAllTimers() {
 				if (this.liveViewDataTimer) {
@@ -1217,6 +1255,13 @@
 
 			// 视频暂停
 			onVideoPause(e) {
+				if (this.liveItem.liveType === 2) {
+					const videoId = `myVideo_${this.liveId}`;
+					const videoContext = uni.createVideoContext(videoId, this);
+					setTimeout(() => {
+						videoContext.play();
+					}, 100);
+				}
 				// this.isVideoPlaying = false;
 				// 暂停时保存进度
 				this.saveVideoProgress();
@@ -1285,12 +1330,12 @@
 				};
 				coupon(data)
 					.then(res => {
+						this.isShowCoupon = false
 						if (res.code == 200) {
 							uni.showToast({
 								title: res.msg,
 								icon: 'none'
 							});
-							this.isShowCoupon = false
 						} else {
 							uni.showToast({
 								title: res.msg,
@@ -1392,7 +1437,6 @@
 					return;
 				}
 				liveOrderUser(this.liveId).then(res => {
-						// console.log("正在购买", res)
 						if (res.code == 200) {
 							this.orderUser = res;
 						} else {
@@ -1930,8 +1974,12 @@
 			async queryCollect() {
 				if (!this.liveId) return;
 				if (this.inputInfo == null) this.inputInfo = ''
+				uni.showLoading({
+					title: '加载中'
+				});
 				try {
 					const res = await liveStore(this.liveId, this.inputInfo);
+					uni.hideLoading()
 					if (res.code === 200) {
 						// 数据绑定到当前 liveItem,避免全局污染
 						this.products = Array.isArray(res.data) ? res.data : [];
@@ -1958,6 +2006,9 @@
 			closeShop() {
 				this.shopping = false;
 			},
+			closeMore(){
+				this.isMore = false;
+			},
 			// 关闭WebSocket连接(isManual:是否手动关闭)
 			closeWebSocket(isManual = true) {
 				if (!this.socket || !this.isSocketOpen) {
@@ -3168,6 +3219,7 @@
 			position: relative;
 			z-index: 2;
 			padding: 24rpx 0 68rpx;
+
 			.white-item {
 				width: 40rpx;
 				height: 40rpx;
@@ -3198,6 +3250,7 @@
 					background: rgba(255, 255, 255, 0.5);
 					border-radius: 4rpx 4rpx 4rpx 4rpx;
 				}
+
 				.selected {
 					background: #FFEB66;
 				}
@@ -3220,6 +3273,16 @@
 		}
 	}
 
+	.more-block {
+		border-radius: 20rpx 0 0 20rpx;
+		padding: 70rpx 30rpx;
+		display: flex;
+		justify-content: space-between;
+		.item{
+			text-align: center;
+		}
+	}
+
 	.shoppop {
 		padding: 22rpx 16rpx;
 

+ 13 - 4
pages_shopping/live/goods.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="">
-		<view class="content">
+		<view class="content" v-cloak>
 			<view class="shop-banner">
 
 				<view class="shop-banner" @click="showImg()">
@@ -360,7 +360,11 @@
 			//商品详情
 			getliveGoods() {
 				if (!this.productId) return;
+				uni.showLoading({
+					title: '加载中'
+				});
 				liveGoodsDetail(this.productId).then(res => {
+						uni.hideLoading()
 						if (res.code == 200) {
 							// console.log("小黄车 商品详情>>>>", res)
 							this.goosDetail = res.data
@@ -382,6 +386,9 @@
 </script>
 
 <style lang="scss">
+	  [v-cloak] {
+	    display: none;
+	  }
 	.content {
 		font-family: PingFang SC;
 	}
@@ -1221,9 +1228,11 @@
 			padding-bottom: 24rpx;
 			border-bottom: 1px solid #ECECEC;
 		}
-.inner{
-	margin-bottom:100rpx ;
-}
+
+		.inner {
+			margin-bottom: 100rpx;
+		}
+
 		.det-title {
 			display: flex;
 			align-items: center;

+ 1 - 1
pages_shopping/live/storeOrderDetail.vue

@@ -283,7 +283,7 @@
 			};
 		},
 		onLoad(option) {
-			this.orderId = option.orderId
+			this.orderId = option.id
 			if (!option.orderCode) {}
 		},
 		onShow() {