From 3d43cd90f46f76316dbde60cb96cfbdc43152e90 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 19 六月 2025 20:03:55 +0800
Subject: [PATCH] 注释客户管理,用户权限页面优化
---
pages/tabbar/index/home.vue | 130 ++++++++++++++++++++++++++++---------------
1 files changed, 84 insertions(+), 46 deletions(-)
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index 9ba0f38..8444073 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -9,55 +9,77 @@
@change="onSwiperChange"
>
<swiper-item v-for="(item, index) in videoList" :key="item.id">
- <!-- 鎾斁鎸夐挳锛堜粎褰撹棰戞殏鍋滄椂鏄剧ず锛� -->
- <view
- class="play-icon"
- @click="togglePlay(index)"
- v-if="!currentVideoIsPlaying"
- >
- <image src="/static/video/play.png" style="width: 45px;height: 45px" mode="aspectFit"></image>
- </view>
- <video
- :id="'video'+index"
- :ref="'video'+index"
- :src="item.videoUrl"
- :autoplay="currentIndex === index"
- :controls="false"
- :loop="true"
- :object-fit="item.objectFit"
- :enable-progress-gesture="false"
- class="video-item"
- @play="onPlay(item.id, index)"
- @pause="onPause(index)"
- @ended="onEnded(index)"
- @click="togglePlay(index)"
- @timeupdate="onTimeUpdate($event)"
- @loadedmetadata="onLoadedMetadata($event)"
-
- ></video>
- <!-- 鑷畾涔夋帶鍒舵潯 -->
- <view
- @touchstart="handleTouchStart"
- @touchmove="handleTouchMove"
- @touchend="handleTouchEnd"
- class="container">
- <!-- 杩涘害鏉� - 鏁翠釜鍖哄煙鍙嫋鍔� -->
- <view class="process-warp" :style="{ opacity: showProcess ? 1 : 0 }">
- <!-- 鏄剧ず褰撳墠杩涘害 -->
- <view class="progress-text">{{ hasPlayTime }}/{{formartDuration}}</view>
+ <view style="width: 100%;height: 100%;" v-if="item.videoContentType === 'video'">
+ <!-- 鎾斁鎸夐挳锛堜粎褰撹棰戞殏鍋滄椂鏄剧ず锛� -->
<view
- class="progress-bar"
- id="progressBar"
+ class="play-icon"
+ @click="togglePlay(index)"
+ v-if="!currentVideoIsPlaying"
>
-
- <!-- 宸插~鍏呴儴鍒� -->
- <view class="progress-fill" :style="{ width: progress + '%' }"></view>
+ <image src="/static/video/play.png" style="width: 45px;height: 45px" mode="aspectFit"></image>
</view>
- </view>
-
-
-
+ <video
+ :id="'video'+index"
+ :ref="'video'+index"
+ :src="item.videoUrl"
+ :autoplay="currentIndex === index"
+ :controls="false"
+ :loop="true"
+ :object-fit="item.objectFit"
+ :enable-progress-gesture="false"
+ class="video-item"
+ @play="onPlay(item.id, index)"
+ @pause="onPause(index)"
+ @ended="onEnded(index)"
+ @click="togglePlay(index)"
+ @timeupdate="onTimeUpdate($event)"
+ @loadedmetadata="onLoadedMetadata($event)"
+
+ ></video>
+ <!-- 鑷畾涔夋帶鍒舵潯 -->
+ <view
+ @touchstart="handleTouchStart"
+ @touchmove="handleTouchMove"
+ @touchend="handleTouchEnd"
+ class="container">
+ <!-- 杩涘害鏉� - 鏁翠釜鍖哄煙鍙嫋鍔� -->
+ <view class="process-warp" :style="{ opacity: showProcess ? 1 : 0 }">
+ <!-- 鏄剧ず褰撳墠杩涘害 -->
+ <view class="progress-text">{{ hasPlayTime }}/{{formartDuration}}</view>
+ <view
+ class="progress-bar"
+ id="progressBar"
+ >
+
+ <!-- 宸插~鍏呴儴鍒� -->
+ <view class="progress-fill" :style="{ width: progress + '%' }"></view>
+ </view>
+ </view>
+ </view>
</view>
+ <view style="width: 100%; height: 100%;" v-else-if="item.videoContentType === 'img'">
+ <uni-swiper-dot
+ :info="item.imgs"
+ :current="currentImgIndex"
+ mode="round"
+ style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;"
+ :dots-styles="{width: 24, bottom: 24,selectedBackgroundColor: 'green', backgroundColor: 'gray'}"
+ >
+ <swiper class="swiper-box" @change="imgChange" :autoplay="true" :interval="3000">
+ <swiper-item v-for="img in item.imgs" :key="img">
+ <view class="swiper-item">
+ <!-- 璋冩暣 image 鏍峰紡锛屼娇鍏跺眳涓笖鎸夋瘮渚嬬缉鏀� -->
+ <image
+ :src="img"
+ mode="aspectFit"
+ style="width: 100%; height: 100%; display: block; margin: 0 auto;"
+ ></image>
+ </view>
+ </swiper-item>
+ </swiper>
+ </uni-swiper-dot>
+ </view>
+
<!-- 鎮寕鍟嗗搧閾炬帴灞� -->
<view class="goods-link-warp">
@@ -214,6 +236,7 @@
},
data() {
return {
+ currentImgIndex: 0, // 鎾斁鍒扮鍑犲紶鍥�--绱㈠紩
currentTime: 0,
formartDuration: '',
duration: 0,
@@ -297,6 +320,10 @@
this.initVideoContexts();
},
methods: {
+ // 杞挱鍥惧彉鍖�
+ imgChange(e) {
+ this.currentImgIndex = e.detail.current;
+ },
// 鑾峰彇杩涘害鏉$殑浣嶇疆鍜屽昂瀵�
getBarRect() {
const query = uni.createSelectorQuery().in(this);
@@ -375,7 +402,7 @@
const videoId = this.commentForm.videoId;
this.commentForm = { // 璇勮琛ㄥ崟鏁版嵁
id: '',
- videoId: '',
+ videoId: videoId,
commentContent: '',
replyId: '',
replyUserId: '',
@@ -1167,4 +1194,15 @@
font-size: 14px;
color: #666;
}
+ .swiper-box {
+ width: 100%;
+ height: 1400rpx;
+ }
+ .swiper-item {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.8.0