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 5253a6b2
authored
Mar 26, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 上传新增加载状态
1 parent
7561a064
Pipeline
#141
for
5253a6b2
failed
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
15 deletions
apps/web/venus-usedcar-quality/src/components/CustomizeForm/Index.vue
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/Index.vue
View file @
5253a6b
...
@@ -266,11 +266,9 @@ defineExpose({
...
@@ -266,11 +266,9 @@ defineExpose({
<
template
>
<
template
>
<div>
<div>
<van-overlay
:show=
"pageLoading"
>
<van-overlay
:show=
"pageLoading"
z-index=
"2000"
>
<div
class=
"loadingBox"
>
<div
class=
"loadingBox"
>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
加载中...
</van-loading>
加载中...
</van-loading>
</div>
</div>
</van-overlay>
</van-overlay>
<div
v-if=
"!pageLoading"
>
<div
v-if=
"!pageLoading"
>
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelectAndImageUpload.vue
View file @
5253a6b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
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'
;
import
{
showImagePreview
}
from
'vant'
;
...
@@ -48,7 +48,7 @@ async function onFileChange(ev: Event) {
...
@@ -48,7 +48,7 @@ async function onFileChange(ev: Event) {
const
file
=
input
.
files
?.[
0
];
const
file
=
input
.
files
?.[
0
];
input
.
value
=
""
;
input
.
value
=
""
;
if
(
!
file
)
return
;
if
(
!
file
)
return
;
const
fileSize
=
file
.
size
/
1024
/
1024
;
const
fileSize
=
file
.
size
/
1024
/
1024
;
if
(
fileSize
&&
fileSize
>
5
)
{
if
(
fileSize
&&
fileSize
>
5
)
{
return
showToast
(
`文件大小不能超过5MB`
);
return
showToast
(
`文件大小不能超过5MB`
);
}
}
...
@@ -88,6 +88,13 @@ function previewImage(url: string) {
...
@@ -88,6 +88,13 @@ function previewImage(url: string) {
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<van-overlay
:show=
"uploading"
z-index=
"2000"
>
<div
class=
"loadingBox"
>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
上传中...
</van-loading>
</div>
</van-overlay>
<div
class=
"buttonSelect"
>
<div
class=
"buttonSelect"
>
<div
class=
"title"
>
<div
class=
"title"
>
<div
class=
"titleContent"
>
<div
class=
"titleContent"
>
...
@@ -110,10 +117,11 @@ function previewImage(url: string) {
...
@@ -110,10 +117,11 @@ function previewImage(url: string) {
<div
class=
"deleteBox"
@
click=
"handleDelete(url)"
>
<div
class=
"deleteBox"
@
click=
"handleDelete(url)"
>
<van-icon
color=
"#999999"
name=
"clear"
size=
"20"
/>
<van-icon
color=
"#999999"
name=
"clear"
size=
"20"
/>
</div>
</div>
<van-image
height=
"96"
:src=
"url"
@
click=
"previewImage(url)"
style=
"border-radius: 8px;"
width=
"96
"
/>
<van-image
:src=
"url"
@
click=
"previewImage(url)"
class=
"uploadBoxImg"
width=
"96"
height=
"96"
radius=
"8px
"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -182,6 +190,12 @@ function previewImage(url: string) {
...
@@ -182,6 +190,12 @@ function previewImage(url: string) {
border-radius
:
8px
;
border-radius
:
8px
;
}
}
.uploadBoxImg
{
width
:
96px
;
height
:
96px
;
border-radius
:
8px
;
}
.plusBox
{
.plusBox
{
float
:
left
;
float
:
left
;
margin-top
:
22px
;
margin-top
:
22px
;
...
@@ -210,4 +224,14 @@ function previewImage(url: string) {
...
@@ -210,4 +224,14 @@ function previewImage(url: string) {
height
:
20px
;
height
:
20px
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.loadingBox
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
width
:
80px
;
height
:
80px
;
transform
:
translate
(
-50%
,
-50%
);
}
</
style
>
</
style
>
apps/web/venus-usedcar-quality/src/components/CustomizeForm/customizeUploadFile.vue
View file @
5253a6b
...
@@ -65,9 +65,7 @@ async function onFileChange(ev: Event) {
...
@@ -65,9 +65,7 @@ async function onFileChange(ev: Event) {
const
url
=
(
typeof
res
.
aliyunAddress
===
"string"
&&
res
.
aliyunAddress
)
||
(
typeof
res
.
url
===
"string"
&&
res
.
url
)
||
""
;
const
url
=
(
typeof
res
.
aliyunAddress
===
"string"
&&
res
.
aliyunAddress
)
||
(
typeof
res
.
url
===
"string"
&&
res
.
url
)
||
""
;
showToast
(
"上传成功"
);
showToast
(
"上传成功"
);
pickerValue
.
value
.
push
(
url
);
pickerValue
.
value
.
push
(
url
);
console
.
log
(
"pickerValue.value"
,
pickerValue
.
value
);
console
.
log
(
"pickerValue.value"
,
pickerValue
.
value
);
updateData
();
updateData
();
}
catch
(
error
:
unknown
)
{
}
catch
(
error
:
unknown
)
{
const
msg
=
error
instanceof
Error
?
error
.
message
:
String
(
error
);
const
msg
=
error
instanceof
Error
?
error
.
message
:
String
(
error
);
...
@@ -98,6 +96,12 @@ function previewImage(url: string) {
...
@@ -98,6 +96,12 @@ function previewImage(url: string) {
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<van-overlay
:show=
"uploading"
z-index=
"2000"
>
<div
class=
"loadingBox"
>
<van-loading
color=
"#1989fa"
size=
"24px"
vertical
>
上传中...
</van-loading>
</div>
</van-overlay>
<div
class=
"buttonSelect"
>
<div
class=
"buttonSelect"
>
<div
class=
"title"
>
<div
class=
"title"
>
<div
class=
"titleContent"
>
<div
class=
"titleContent"
>
...
@@ -122,19 +126,16 @@ function previewImage(url: string) {
...
@@ -122,19 +126,16 @@ function previewImage(url: string) {
<div
class=
"deleteBox"
@
click=
"handleDelete(url)"
>
<div
class=
"deleteBox"
@
click=
"handleDelete(url)"
>
<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'"
@
click=
"previewImage(url)"
height=
"96"
:src=
"url"
<van-image
v-if=
"item.interactionType == 'image_upload'"
:src=
"url"
@
click=
"previewImage(url)"
class=
"uploadBoxImg"
width=
"96"
height=
"96"
radius=
"8px"
/>
style=
"border-radius: 8px;height: 96px;width: 96px;"
width=
"96"
/>
<!-- 视频 -->
<!-- 视频 -->
<video
width=
"96"
v-if=
"item.interactionType == 'video_upload'"
:src=
"url"
<video
v-if=
"item.interactionType == 'video_upload'"
:src=
"url"
class=
"uploadBoxImg"
controls
>
style=
"border-radius: 8px;height: 96px;width: 96px;"
controls
>
您的浏览器不支持 video 标签。
您的浏览器不支持 video 标签。
</video>
</video>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -203,6 +204,12 @@ function previewImage(url: string) {
...
@@ -203,6 +204,12 @@ function previewImage(url: string) {
border-radius
:
8px
;
border-radius
:
8px
;
}
}
.uploadBoxImg
{
width
:
96px
;
height
:
96px
;
border-radius
:
8px
;
}
.plusBox
{
.plusBox
{
float
:
left
;
float
:
left
;
margin-top
:
22px
;
margin-top
:
22px
;
...
@@ -231,4 +238,14 @@ function previewImage(url: string) {
...
@@ -231,4 +238,14 @@ function previewImage(url: string) {
height
:
20px
;
height
:
20px
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.loadingBox
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
width
:
80px
;
height
:
80px
;
transform
:
translate
(
-50%
,
-50%
);
}
</
style
>
</
style
>
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