|
|
@@ -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;
|
|
|
|