This commit is contained in:
2025-06-21 15:38:38 +08:00
parent be8a44b623
commit 481ef6edd4
13 changed files with 64 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import {ref} from 'vue';
import SY_ICON from '../static/icons/水印_预览.png';
const {src, list, imageClass, sy} = defineProps({
src: {
@@ -57,6 +58,8 @@ defineExpose({
<swiper class="!size-full" :current="cur" @change="({detail:{current}})=>cur=current">
<swiper-item v-for="src in list">
<image class="!size-full" :src="src" mode="aspectFit"></image>
<image v-if="sy" class="!size-full !absolute left-0 top-0" :src="SY_ICON"
mode="aspectFit"></image>
</swiper-item>
</swiper>

View File

@@ -1,8 +1,10 @@
<script setup>
import {ref} from "vue";
import testIcon from '../static/images/test.png';
import XImage from "./XImage.vue";
import ICON from "../static/icons/水印_素材案例.png";
const XImageRef = ref();
const {list, showSY} = defineProps({
list: {
type: Array,
@@ -15,13 +17,19 @@ const {list, showSY} = defineProps({
default: false,
}
});
const openPrew = () => {
XImageRef.value.open();
}
</script>
<template>
<view class="relative">
<x-image class="!w-[160rpx] !h-[160rpx]" mode="aspectFill" :src="list[0]" :list="list"></x-image>
<x-image :sy="showSY" ref="XImageRef" class="!w-[160rpx] !h-[160rpx]" mode="aspectFill" :src="list[0]"
:list="list"></x-image>
<image v-if="showSY" class="!size-full !absolute left-0 top-0" :src="ICON" mode="aspectFill"></image>
<image v-if="showSY" class="!size-full !absolute left-0 top-0" :src="ICON" mode="aspectFill"
@click="openPrew"></image>
<view class="!flex absolute left-1/2 -translate-x-1/2 bottom-[20rpx] z-10 gap-[8rpx]">
<view v-for="(_v, index) in list"

View File

@@ -34,7 +34,7 @@ const upload = async () => {
<template>
<view class="!flex gap-[12rpx] flex-wrap">
<view class="x-upload" @click="upload" v-if="!single || single && files.length < 1">
<view class="x-upload" @click="upload" v-if="!single || single && files?.length < 1">
<image class="!size-[28rpx]" :src="ADDICON"></image>
<view>上传图片</view>
</view>