feat: 图片浏览器的样式调整

This commit is contained in:
2025-10-22 19:29:27 +08:00
parent df5e9e92a1
commit 6eadcb46cd
4 changed files with 42 additions and 39 deletions

View File

@@ -22,10 +22,6 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="custom-indicator">
图片{{ active + 1 }}/{{ thumbnails.length }}
</view>
<!-- 缩略图部分 --> <!-- 缩略图部分 -->
<view <view
v-if="showThumbnails" v-if="showThumbnails"
@@ -52,16 +48,26 @@
:src="thumb.photoUrl" :src="thumb.photoUrl"
mode="aspectFill" mode="aspectFill"
></image> ></image>
<text>{{ thumb.photoName }}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="custom-indicator">
<uni-icons fontFamily="znicons" size="10" color="#fff">{{
zniconsMap["zn-camera"]
}}</uni-icons>
<text class="custom-indicator-text">{{ thumbnails.length }}</text>
<uni-icons fontFamily="znicons" size="10" color="#fff">{{
zniconsMap["zn-nav-arrow-right"]
}}</uni-icons>
</view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, computed, nextTick } from "vue"; import { ref, computed, nextTick } from "vue";
import { zniconsMap } from "@/static/fonts/znicons.js";
// Props定义 // Props定义
const props = defineProps({ const props = defineProps({

View File

@@ -1,3 +1,8 @@
@font-face {
font-family: znicons;
src: url("@/static/fonts/znicons.ttf");
}
.image-swiper { .image-swiper {
position: relative; position: relative;
width: 100%; width: 100%;
@@ -13,27 +18,32 @@
height: 100%; height: 100%;
} }
.custom-indicator {
position: absolute;
top: 8px;
right: 8px;
z-index: 10;
background: rgba(0, 0, 0, 0.5);
border-radius: $uni-border-radius-50px;
padding: 3px 8px;
font-size: 8px;
color: #fff;
}
.thumbnail-box { .thumbnail-box {
position: absolute; position: absolute;
left: 12px; left: 12px;
right: 12px; right: 12px;
height: 60px; display: flex;
align-items: flex-end;
flex-direction: row;
}
.custom-indicator {
margin-left: 12px;
background: rgba(0, 0, 0, 0.5);
border-radius: $uni-border-radius-50px;
padding: 0 6px 4px 8px;
}
.custom-indicator-text {
margin: 0 4px;
font-size: 10px;
text-align: center;
align-items: center;
color: #fff;
} }
.thumbnail-scroll { .thumbnail-scroll {
width: 100%; flex: 1;
height: 100%; height: 100%;
white-space: nowrap; white-space: nowrap;
} }
@@ -42,7 +52,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
padding: 0 5px;
} }
.thumbnail-item { .thumbnail-item {
@@ -52,29 +61,17 @@
&.active { &.active {
.thumbnail-image { .thumbnail-image {
border: 1px solid #fff; border: 2px solid #fff;
} }
} }
} }
.thumbnail-item .thumbnail-image { .thumbnail-item .thumbnail-image {
width: 48px; width: 36px;
height: 38px; height: 36px;
border-radius: 4px; border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid transparent; border: 2px solid transparent;
transition: all 0.3s ease; transition: all 0.3s ease;
display: block; display: block;
} }
.thumbnail-item text {
color: #fff;
font-size: 8px;
display: block;
margin-top: 4px;
transition: all 0.3s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 48px;
}

View File

@@ -8,7 +8,7 @@
:border-radius="0" :border-radius="0"
:height="300" :height="300"
:images="goodsData.commodityPhotoList" :images="goodsData.commodityPhotoList"
thumbnailBottom="36px" thumbnailBottom="42px"
/> />
<view class="goods-content"> <view class="goods-content">

View File

@@ -63,7 +63,7 @@ $button-color: #00a6ff;
} }
.goods-content { .goods-content {
border-radius: 12px 12px 0 0; border-radius: 28px 28px 0 0;
background-color: #fff; background-color: #fff;
padding: 12px; padding: 12px;
position: relative; position: relative;