视频中心ui提交
parent
84afab46e7
commit
96c9855815
|
|
@ -16,38 +16,20 @@
|
||||||
|
|
||||||
<!-- 日期标题 + 分类筛选(靠右) -->
|
<!-- 日期标题 + 分类筛选(靠右) -->
|
||||||
<view class="filter-bar">
|
<view class="filter-bar">
|
||||||
<text class="date-title">03-26</text>
|
<text class="date-title">
|
||||||
|
<uni-dateformat :date="Date.now()" format="MM-dd" />
|
||||||
|
</text>
|
||||||
<view class="category-tabs">
|
<view class="category-tabs">
|
||||||
<view
|
<view
|
||||||
|
v-for="(item, index) in categoryList"
|
||||||
|
:key="index"
|
||||||
class="category-item"
|
class="category-item"
|
||||||
:class="{ active: activeCategory === 'person' }"
|
:class="{ active: activeCategory === item.type,
|
||||||
@click="handleCategoryClick('person')"
|
'filter-btn': item.type === 'filter' }"
|
||||||
|
@click="handleCategoryClick(item.type)"
|
||||||
>
|
>
|
||||||
<text class="icon">👤</text>
|
<image class="icon" :src="item.imgUrl" mode="aspectFill"/>
|
||||||
<text>人</text>
|
<text>{{ item.name }}</text>
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="category-item"
|
|
||||||
:class="{ active: activeCategory === 'car' }"
|
|
||||||
@click="handleCategoryClick('car')"
|
|
||||||
>
|
|
||||||
<text class="icon">🚗</text>
|
|
||||||
<text>车</text>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="category-item"
|
|
||||||
:class="{ active: activeCategory === 'animal' }"
|
|
||||||
@click="handleCategoryClick('animal')"
|
|
||||||
>
|
|
||||||
<text class="icon">🐾</text>
|
|
||||||
<text>动物</text>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="category-item filter-btn"
|
|
||||||
@click="handleFilterClick"
|
|
||||||
>
|
|
||||||
<text class="icon">🔍</text>
|
|
||||||
<text>筛选</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -62,7 +44,7 @@
|
||||||
<!-- 时间轴(uni-icons实现) -->
|
<!-- 时间轴(uni-icons实现) -->
|
||||||
<view class="time-axis">
|
<view class="time-axis">
|
||||||
<uni-icons type="circle" size="14" color="#1677ff"></uni-icons>
|
<uni-icons type="circle" size="14" color="#1677ff"></uni-icons>
|
||||||
<view class="axis-line" v-if="index !== videoList.length - 1"></view>
|
<view class="axis-line" v-if="index !== videoList.length"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 时间 + 卡片 垂直排列 -->
|
<!-- 时间 + 卡片 垂直排列 -->
|
||||||
|
|
@ -88,6 +70,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {parseTime} from "@/utils/agri";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -101,6 +85,12 @@ export default {
|
||||||
{ week: '四', day: '今', active: true }
|
{ week: '四', day: '今', active: true }
|
||||||
],
|
],
|
||||||
activeCategory: 'person',
|
activeCategory: 'person',
|
||||||
|
categoryList: [
|
||||||
|
{ type: 'person', name: '人', imgUrl: "https://picsum.photos/id/1015/400/200" },
|
||||||
|
{ type: 'car', name: '车', imgUrl: "https://picsum.photos/id/1015/400/200" },
|
||||||
|
{ type: 'animal', name: '动物', imgUrl: "https://picsum.photos/id/1015/400/200" },
|
||||||
|
{ type: 'filter', name: '筛选', imgUrl: "https://picsum.photos/id/1015/400/200" }
|
||||||
|
],
|
||||||
videoList: [
|
videoList: [
|
||||||
{
|
{
|
||||||
time: '13:22:04',
|
time: '13:22:04',
|
||||||
|
|
@ -111,7 +101,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
time: '13:20:20',
|
time: '13:20:20',
|
||||||
device: 'DS-2DE4423DW-D/GLT/...',
|
device: 'DS-2DE4423DW-D/G我饿全额钱31313122LT/...',
|
||||||
event: '画面变化',
|
event: '画面变化',
|
||||||
cover: 'https://picsum.photos/id/1015/400/200',
|
cover: 'https://picsum.photos/id/1015/400/200',
|
||||||
unread: true
|
unread: true
|
||||||
|
|
@ -134,11 +124,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
parseTime,
|
||||||
handleDateClick(item) {
|
handleDateClick(item) {
|
||||||
this.dateList = this.dateList.map(d => ({ ...d, active: d === item }))
|
this.dateList = this.dateList.map(d => ({ ...d, active: d === item }))
|
||||||
},
|
},
|
||||||
handleCategoryClick(type) {
|
handleCategoryClick(type) {
|
||||||
this.activeCategory = type
|
if (type === 'filter') {
|
||||||
|
this.handleFilterClick();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.activeCategory = type;
|
||||||
uni.showToast({ title: `切换到${type === 'person' ? '人' : type === 'car' ? '车' : '动物'}分类` })
|
uni.showToast({ title: `切换到${type === 'person' ? '人' : type === 'car' ? '车' : '动物'}分类` })
|
||||||
},
|
},
|
||||||
handleFilterClick() {
|
handleFilterClick() {
|
||||||
|
|
@ -170,10 +165,11 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
background: #f7f8fd;
|
||||||
margin: 0 10rpx;
|
margin: 0 10rpx;
|
||||||
border: 1rpx solid #e0e0e0;
|
//border: 1rpx solid #e0e0e0;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding: 10rpx 0;
|
padding: 16rpx 0;
|
||||||
}
|
}
|
||||||
.date-tab.active {
|
.date-tab.active {
|
||||||
background-color: #1677ff;
|
background-color: #1677ff;
|
||||||
|
|
@ -181,11 +177,12 @@ export default {
|
||||||
border-color: #1677ff;
|
border-color: #1677ff;
|
||||||
}
|
}
|
||||||
.week {
|
.week {
|
||||||
font-size: 28rpx;
|
font-size: 25rpx;
|
||||||
margin-bottom: 8rpx;
|
margin-bottom: 8rpx;
|
||||||
|
color: #bdbdbd;
|
||||||
}
|
}
|
||||||
.day {
|
.day {
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -198,7 +195,7 @@ export default {
|
||||||
}
|
}
|
||||||
.date-title {
|
.date-title {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 500;
|
font-weight: 400;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
.category-tabs {
|
.category-tabs {
|
||||||
|
|
@ -236,6 +233,8 @@ export default {
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 6rpx;
|
margin-right: 6rpx;
|
||||||
|
width: 16rpx;
|
||||||
|
height: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 视频列表 */
|
/* 视频列表 */
|
||||||
|
|
@ -254,12 +253,12 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 20rpx;
|
margin-right: 14rpx;
|
||||||
padding-top: 8rpx;
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
.axis-line {
|
.axis-line {
|
||||||
width: 1rpx;
|
width: 1rpx;
|
||||||
height: 120rpx; /* 适配时间+卡片高度 */
|
height: 170rpx; /* 适配时间+卡片高度 */
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +279,7 @@ export default {
|
||||||
.time-text {
|
.time-text {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 500;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
.unread-dot {
|
.unread-dot {
|
||||||
width: 12rpx;
|
width: 12rpx;
|
||||||
|
|
@ -293,7 +292,7 @@ export default {
|
||||||
/* 视频卡片 */
|
/* 视频卡片 */
|
||||||
.video-card {
|
.video-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: #f9f9f9;
|
background-color: #f7f8fd;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
@ -302,14 +301,19 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
width: 0;
|
||||||
}
|
}
|
||||||
.device-name {
|
.device-name {
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #8f8f8f;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
padding-right: 10rpx;
|
||||||
}
|
}
|
||||||
.event-type {
|
.event-type {
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue