feat: 标签样式调整

This commit is contained in:
杨航
2025-09-04 11:23:29 +08:00
parent edacc23204
commit 48009d8f90
3 changed files with 51 additions and 12 deletions
+6 -1
View File
@@ -9,7 +9,7 @@
<view class="item-title">{{itemInfo.crsName}}</view>
<scroll-view class="item-tags" :scroll-x="true">
<view class="item-tag-view">
<view class="item-tag" v-for="item in tagsShowList">{{item.tagName}}</view>
<view :class="['item-tag', this.activeTag.includes(item.tagId)?'active-tag':'']" v-for="item in tagsShowList">{{item.tagName}}</view>
</view>
</scroll-view>
<view class="item-publish">更新{{itemInfo.mtTime}}</view>
@@ -135,6 +135,11 @@
text-overflow: ellipsis;
max-width: 200rpx;
box-sizing: border-box;
&.active-tag{
background-color: #ffa150;
color: #fff;
border: 2rpx solid #ffa150;
}
}
}
}
+42 -8
View File
@@ -48,21 +48,23 @@
<view :class="['model-filter-list',showFilterList?'show':'']" @click="showFilterList = false"></view>
<uv-scroll-list class="tags-view" :indicator="false">
<uv-tags text="全部"
shape="circle"
plain
bgColor="#f6f8fa"
borderColor="#f6f8fa"
color="#333"
class="tags-item"
size="mini"
size="medium"
:type="activeTag.length === 0?'primary':'info'"
@click="chooseTag({value:''})"
></uv-tags>
<uv-tags :text="item.label"
v-for="item in tagsList"
:key="item.value"
shape="circle"
plain
:type="activeTag.includes(item.value)?'primary':'info'"
size="medium"
:bgColor="'#f6f8fa'"
:borderColor="activeTag.includes(item.value)?'#06f' : '#f6f8fa'"
:color="activeTag.includes(item.value)?'#06f' : '#333'"
@click="chooseTag(item)"
class="tags-item" size="mini"
:class="activeTag.includes(item.value)?'tags-item active-tags-item':'tags-item'"
></uv-tags>
</uv-scroll-list>
<view class="course-list">
@@ -556,13 +558,45 @@ import { onShow } from "@dcloudio/uni-app"
.tags-view{
height: 84rpx;
display: block;
padding: 20rpx 120rpx 20rpx 20rpx;
padding: 15rpx 120rpx 15rpx 20rpx;
box-sizing: border-box;
white-space: nowrap;
border-bottom: 2rpx solid #eee;
.tags-item{
margin-right: 30rpx;
display: inline-block;
&.active-tags-item{
position: relative;
overflow: hidden;
border-radius: 4rpx;
overflow: hidden;
&::before{
content: '';
display: block;
width: 40rpx;
height: 40rpx;
position: absolute;
right: -20rpx;
bottom: -20rpx;
transform: rotateZ(-45deg);
background-color: #06f;
overflow: hidden;
z-index: 10;
}
&::after{
content: '';
display: block;
width: 8rpx;
height: 4rpx;
position: absolute;
right: 3rpx;
bottom: 8rpx;
transform: rotateZ(-45deg);
border-left: 1px solid #fff;
border-bottom: 1px solid #fff;
z-index: 11;
}
}
::v-deep .uv-tags{
padding: 0 20rpx;
.uv-tags__text{