Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7be3fa33
authored
Mar 27, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 新增图片预览功能
1 parent
6fb200ae
Pipeline
#148
for
7be3fa33
failed
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelectAndImageUpload.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/customizeUploadFile.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelectAndImageUpload.vue
View file @
7be3fa3
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
import
{
onMounted
,
computed
,
ref
}
from
"vue"
;
import
{
onMounted
,
computed
,
ref
}
from
"vue"
;
import
{
uploadFile
}
from
"@/utils/upload.js"
;
import
{
uploadFile
}
from
"@/utils/upload.js"
;
import
{
showToast
}
from
"vant"
;
import
{
showToast
}
from
"vant"
;
import
{
showImagePreview
}
from
'vant'
;
const
props
=
defineProps
({
const
props
=
defineProps
({
item
:
{
item
:
{
...
@@ -81,10 +80,14 @@ function updateData() {
...
@@ -81,10 +80,14 @@ function updateData() {
}
}
// 图片预览
// 图片预览
const
imagePreview
=
ref
(
false
);
const
previewImagesList
=
ref
([]);
function
previewImage
(
url
:
string
)
{
function
previewImage
(
url
:
string
)
{
showImagePreview
([
url
]);
previewImagesList
.
value
=
[
url
];
imagePreview
.
value
=
true
;
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -97,6 +100,8 @@ function previewImage(url: string) {
...
@@ -97,6 +100,8 @@ function previewImage(url: string) {
</div>
</div>
</van-overlay>
</van-overlay>
<van-image-preview
v-model:show=
"imagePreview"
:images=
"previewImagesList"
></van-image-preview>
<div
class=
"buttonSelect"
>
<div
class=
"buttonSelect"
>
<div
class=
"title"
>
<div
class=
"title"
>
<div
class=
"titleContent"
>
<div
class=
"titleContent"
>
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/customizeUploadFile.vue
View file @
7be3fa3
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
import
{
onMounted
,
computed
,
ref
}
from
"vue"
;
import
{
onMounted
,
computed
,
ref
}
from
"vue"
;
import
{
uploadFile
}
from
"@/utils/upload.js"
;
import
{
uploadFile
}
from
"@/utils/upload.js"
;
import
{
showToast
}
from
"vant"
;
import
{
showToast
}
from
"vant"
;
import
{
showImagePreview
}
from
'vant'
;
const
props
=
defineProps
({
const
props
=
defineProps
({
item
:
{
item
:
{
...
@@ -89,8 +88,11 @@ function updateData() {
...
@@ -89,8 +88,11 @@ function updateData() {
}
}
// 图片预览
// 图片预览
const
imagePreview
=
ref
(
false
);
const
previewImagesList
=
ref
([]);
function
previewImage
(
url
:
string
)
{
function
previewImage
(
url
:
string
)
{
showImagePreview
([
url
]);
previewImagesList
.
value
=
[
url
];
imagePreview
.
value
=
true
;
}
}
</
script
>
</
script
>
...
@@ -104,6 +106,9 @@ function previewImage(url: string) {
...
@@ -104,6 +106,9 @@ function previewImage(url: string) {
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
上传中...
</van-loading>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
上传中...
</van-loading>
</div>
</div>
</van-overlay>
</van-overlay>
<van-image-preview
v-model:show=
"imagePreview"
:images=
"previewImagesList"
></van-image-preview>
<div
class=
"buttonSelect"
>
<div
class=
"buttonSelect"
>
<div
class=
"title"
>
<div
class=
"title"
>
<div
class=
"titleContent"
>
<div
class=
"titleContent"
>
...
@@ -129,7 +134,7 @@ function previewImage(url: string) {
...
@@ -129,7 +134,7 @@ function previewImage(url: string) {
<van-icon
color=
"#999999"
name=
"clear"
size=
"20"
/>
<van-icon
color=
"#999999"
name=
"clear"
size=
"20"
/>
</div>
</div>
<!-- 图片 -->
<!-- 图片 -->
<van-image
v-if=
"item.interactionType == 'image_upload'"
:src=
"url"
@
click=
"previewImage(url)"
class=
"uploadBoxImg"
width=
"96"
height=
"96"
radius=
"8px
"
/>
<van-image
v-if=
"item.interactionType == 'image_upload'"
:src=
"url"
class=
"uploadBoxImg"
width=
"96"
height=
"96"
radius=
"8px"
@
click=
"previewImage(url)
"
/>
<!-- 视频 -->
<!-- 视频 -->
<video
v-if=
"item.interactionType == 'video_upload'"
:src=
"url"
class=
"uploadBoxImg"
controls
>
<video
v-if=
"item.interactionType == 'video_upload'"
:src=
"url"
class=
"uploadBoxImg"
controls
>
您的浏览器不支持 video 标签。
您的浏览器不支持 video 标签。
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment