Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-ASD
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xinzhedeai
GaoQuYingJiH5-ASD
Commits
c8a7e115
Commit
c8a7e115
authored
Oct 13, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:商户图片编辑、删除、相册选择每次一个。
parent
25b982ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
111 deletions
+122
-111
_shanghu_detail-edit.css
src/_shanghu_detail-edit.css
+6
-0
_shanghu_detail-edit.html
src/_shanghu_detail-edit.html
+43
-40
_shanghu_detail-edit.js
src/_shanghu_detail-edit.js
+73
-71
No files found.
src/_shanghu_detail-edit.css
View file @
c8a7e115
...
...
@@ -244,3 +244,9 @@ select:disabled {
font-size
:
16px
;
transition
:
color
0.2s
;
}
.img-wrapper
{
display
:
flex
;
gap
:
.12rem
;
}
\ No newline at end of file
src/_shanghu_detail-edit.html
View file @
c8a7e115
...
...
@@ -197,22 +197,23 @@
</select>
</div>
</div>
<div>
<h5
class=
"imager-item-title"
>
<span
class=
"form-label"
>
商家平面图
</span>
<span
class=
"form-label"
>
商家平面
疏散
图
</span>
<span></span>
</h5>
<!-- 详情模式 -->
<!-- <div class="img-wrapper" style="display: flex;gap:.16rem;">
<div style="position: relative;" v-for="(imgItem, index) in formData.floor
PlanPhotos
">
<div style="position: relative;" v-for="(imgItem, index) in formData.floor
EvacuationPlan
">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.floor
PlanPhotos
, index)" />
@click="showImage(formData.floor
EvacuationPlan
, index)" />
<div v-if="flag=='XG'" class="van-uploader__preview-delete"
@click="handleDeleteFloorPlan(index, 'floorPlan')"><i
@click="handleDeleteFloorPlan(index, 'floor
Evacuation
Plan')"><i
class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.floor
PlanPhotos
.length<4 && flag=='XG' ">
<van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floorPlan')"
<div v-if="formData.floor
EvacuationPlan
.length<4 && flag=='XG' ">
<van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floor
Evacuation
Plan')"
class="uploader-wrapper" :deletable="false" :preview-image="false">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
...
...
@@ -220,36 +221,37 @@
</div> -->
<!-- 开始 -->
<div
class=
"img-wrapper"
>
<div
style=
"position: relative;width:1.6rem;
float: left;margin-right: .1rem;"
v-for=
"(imgItem, index) in formData.floorPlanPhotos
"
>
<div
style=
"position: relative;width:1.6rem;
"
v-for=
"(imgItem, index) in formData.floorEvacuationPlan
"
>
<img
:src=
"previewUrl + imgItem"
style=
"width: 1.6rem; height: 1.6rem;"
@
click=
"showImage(formData.floor
PlanPhotos
, index)"
/>
@
click=
"showImage(formData.floor
EvacuationPlan
, index)"
/>
<div
v-if=
"flag=='XG'"
class=
"van-uploader__preview-delete"
@
click=
"handleDeleteFloorPlan(index, 'floorPlan')"
><i
@
click=
"handleDeleteFloorPlan(index, 'floor
Evacuation
Plan')"
><i
class=
"van-icon van-icon-cross van-uploader__preview-delete-icon"
></i></div>
</div>
<div
v-if=
"formData.floor
PlanPhotos
.length<4 && flag=='XG' "
>
<div
v-if=
"formData.floor
EvacuationPlan
.length<4 && flag=='XG' "
>
<img
src=
"../image/code/upload.png"
style=
"width:1.6rem;height: 1.6rem;"
alt=
""
srcset=
""
@
click=
"paizhao('floor
Plan',4
)"
>
alt=
""
srcset=
""
@
click=
"paizhao('floor
EvacuationPlan',1
)"
>
</div>
</div>
<!-- 结束 -->
</div>
<div>
<h5
class=
"imager-item-title"
>
<span
class=
"form-label"
>
商家平面疏散
图
</span>
<span
class=
"form-label"
>
商家平面
图
</span>
<span></span>
</h5>
<!-- 详情模式 -->
<!-- <div class="img-wrapper" style="display: flex;gap:.16rem;">
<div style="position: relative;" v-for="(imgItem, index) in formData.floorEvacuationPlan
">
<div style="position: relative;" v-for="(imgItem, index) in formData.floorPlanPhotos
">
<img :src="previewUrl + imgItem" style="width: 1.6rem; height: 1.6rem;"
@click="showImage(formData.floorEvacuationPlan
, index)" />
@click="showImage(formData.floorPlanPhotos
, index)" />
<div v-if="flag=='XG'" class="van-uploader__preview-delete"
@click="handleDeleteFloorPlan(index, 'floorEvacuation
Plan')"><i
@click="handleDeleteFloorPlan(index, 'floor
Plan')"><i
class="van-icon van-icon-cross van-uploader__preview-delete-icon"></i></div>
</div>
<div v-if="formData.floorEvacuationPlan
.length<4 && flag=='XG' ">
<van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floorEvacuation
Plan')"
<div v-if="formData.floorPlanPhotos
.length<4 && flag=='XG' ">
<van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floor
Plan')"
class="uploader-wrapper" :deletable="false" :preview-image="false">
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="">
</van-uploader>
...
...
@@ -257,20 +259,21 @@
</div> -->
<!-- 开始 -->
<div
class=
"img-wrapper"
>
<div
style=
"position: relative;width:1.6rem;
float: left;margin-right: .1rem;"
v-for=
"(imgItem, index) in formData.floorEvacuationPlan
"
>
<div
style=
"position: relative;width:1.6rem;
"
v-for=
"(imgItem, index) in formData.floorPlanPhotos
"
>
<img
:src=
"previewUrl + imgItem"
style=
"width: 1.6rem; height: 1.6rem;"
@
click=
"showImage(formData.floor
EvacuationPlan
, index)"
/>
@
click=
"showImage(formData.floor
PlanPhotos
, index)"
/>
<div
v-if=
"flag=='XG'"
class=
"van-uploader__preview-delete"
@
click=
"handleDeleteFloorPlan(index, 'floor
EvacuationPlan
')"
><i
@
click=
"handleDeleteFloorPlan(index, 'floor
PlanPhotos
')"
><i
class=
"van-icon van-icon-cross van-uploader__preview-delete-icon"
></i></div>
</div>
<div
v-if=
"formData.floor
EvacuationPlan
.length<4 && flag=='XG' "
>
<div
v-if=
"formData.floor
PlanPhotos
.length<4 && flag=='XG' "
>
<img
src=
"../image/code/upload.png"
style=
"width:1.6rem;height: 1.6rem;"
alt=
""
srcset=
""
@
click=
"paizhao('floor
EvacuationPlan',4
)"
>
alt=
""
srcset=
""
@
click=
"paizhao('floor
PlanPhotos',1
)"
>
</div>
</div>
<!-- 结束 -->
</div>
<div
style=
"overflow: hidden;"
>
<h5
class=
"imager-item-title"
>
<span
class=
"form-label"
>
营业执照
</span>
...
...
@@ -294,7 +297,7 @@
</div> -->
<!-- 开始 -->
<div
class=
"img-wrapper"
>
<div
style=
"position: relative;width:1.6rem;
float: left;margin-right: .1rem;
"
v-for=
"(imgItem, index) in formData.businessLicensePhotos"
>
<div
style=
"position: relative;width:1.6rem;"
v-for=
"(imgItem, index) in formData.businessLicensePhotos"
>
<img
:src=
"previewUrl + imgItem"
style=
"width: 1.6rem; height: 1.6rem;"
@
click=
"showImage(formData.businessLicensePhotos, index)"
/>
<div
v-if=
"flag=='XG'"
class=
"van-uploader__preview-delete"
...
...
@@ -332,7 +335,7 @@
</div> -->
<!-- 开始 -->
<div
class=
"img-wrapper"
>
<div
style=
"position: relative;width:1.6rem;
float: left;margin-right: .1rem;
"
v-for=
"(imgItem, index) in formData.storefrontPhotos"
>
<div
style=
"position: relative;width:1.6rem;"
v-for=
"(imgItem, index) in formData.storefrontPhotos"
>
<img
:src=
"previewUrl + imgItem"
style=
"width: 1.6rem; height: 1.6rem;"
@
click=
"showImage(formData.storefrontPhotos, index)"
/>
<div
v-if=
"flag=='XG'"
class=
"van-uploader__preview-delete"
...
...
src/_shanghu_detail-edit.js
View file @
c8a7e115
...
...
@@ -161,11 +161,11 @@ window.addEventListener('load', function () {
console
.
log
(
'
chooseFileUpload方法
'
,
value
)
var
photosVar
=
[]
// 根据选择的图片不同进行区分设置
if
(
VUE
.
photosType
===
'
floorPlan
'
){
if
(
VUE
.
photosType
===
'
floorPlan
Photos
'
){
photosVar
=
VUE
.
formData
.
floorPlanPhotos
}
else
if
(
VUE
.
photosType
===
'
businessLicensePhotos
'
){
photosVar
=
VUE
.
formData
.
businessLicensePhotos
}
else
if
(
VUE
.
photosType
===
'
store
Front
'
){
}
else
if
(
VUE
.
photosType
===
'
store
frontPhotos
'
){
photosVar
=
VUE
.
formData
.
storefrontPhotos
}
else
if
(
VUE
.
photosType
===
'
floorEvacuationPlan
'
){
photosVar
=
VUE
.
formData
.
floorEvacuationPlan
...
...
@@ -186,7 +186,9 @@ window.addEventListener('load', function () {
if
(
photosVar
.
length
>
maxSelectNum
)
{
const
result
=
photosVar
.
slice
(
0
,
maxSelectNum
)
console
.
log
(
'
大小比较
'
,
photosVar
.
length
>
maxSelectNum
,
result
)
photosVar
=
result
photosVar
=
[]
photosVar
.
push
(...
result
)
}
}
},
...
...
@@ -240,83 +242,83 @@ window.addEventListener('load', function () {
},
// 处理平面图删除
handleDeleteFloorPlan
(
index
,
type
)
{
if
(
type
===
'
floorPlan
'
){
if
(
type
===
'
floorPlan
Photos
'
){
this
.
formData
.
floorPlanPhotos
.
splice
(
index
,
1
);
}
else
if
(
type
===
'
license
'
){
}
else
if
(
type
===
'
businessLicensePhotos
'
){
this
.
formData
.
businessLicensePhotos
.
splice
(
index
,
1
);
}
else
if
(
type
===
'
store
Front
'
){
}
else
if
(
type
===
'
store
frontPhotos
'
){
this
.
formData
.
storefrontPhotos
.
splice
(
index
,
1
);
}
else
if
(
type
===
'
floorEvacuationPlan
'
){
this
.
formData
.
floorEvacuationPlan
.
splice
(
index
,
1
);
}
},
beforeRead
(
file
)
{
if
(
!
[
'
image/png
'
,
'
image/jpeg
'
,
'
image/jpg
'
].
includes
(
file
.
type
)){
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
'
文件格式不正确
'
})
return
;
}
if
(
file
.
size
>
(
10
*
1024
*
1024
))
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
'
文件大小不可超过10M
'
})
return
false
;
}
return
true
;
},
afterRead
(
file
,
type
)
{
// 调用爱山东中台系统,将数据流传递过去
vant
.
Toast
.
loading
({
message
:
'
正在处理...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
});
// 文件读取完成后的处理逻辑
const
formData
=
new
FormData
();
formData
.
append
(
'
file
'
,
file
.
file
);
// 通过FormData构建要上传的文件数据
// formData.append('biz_content',SM.encrypt('dangerjob', API_KEY_MAP["upload"]["publicKey"]));
// 发送HTTP POST请求
fetch
(
BASE_URL
+
'
/common/upload
'
,
{
method
:
'
POST
'
,
body
:
formData
,
headers
:
{
'
Authorization
'
:
gemhoUtil
.
getCookie
(
'
token
'
),
}
})
.
then
(
response
=>
{
if
(
response
.
ok
)
{
return
response
.
json
();
}
throw
new
Error
(
'
Network response was not ok.
'
);
})
.
then
(
value
=>
{
console
.
log
(
value
,
'
value图片上********
'
);
// 处理后端返回的数据
if
(
value
){
// 返回信息不为空,则进行解密操作
if
(
type
===
'
floorPlan
'
){
this
.
formData
.
floorPlanPhotos
.
push
(
value
.
fileName
)
}
else
if
(
type
===
'
license
'
){
this
.
formData
.
businessLicensePhotos
.
push
(
value
.
fileName
)
}
else
if
(
type
===
'
storeFront
'
){
this
.
formData
.
storefrontPhotos
.
push
(
value
.
fileName
)
}
else
if
(
type
===
'
floorEvacuationPlan
'
){
this
.
formData
.
floorEvacuationPlan
.
push
(
value
.
fileName
)
}
// 可根据后端返回的数据做进一步处理,如显示上传成功信息等
setTimeout
(()
=>
{
vant
.
Toast
.
clear
()
},
0
);
}
else
{
this
.
afterRead
(
file
)
}
})
.
catch
(
error
=>
{
// console.error('There has been a problem with your fetch operation:', error);
});
},
//
beforeRead(file) {
//
if(!['image/png','image/jpeg','image/jpg'].includes(file.type)){
//
vant.Dialog.alert({
//
title: '信息提示',
//
message: '文件格式不正确'
//
})
//
return;
//
}
//
if (file.size > (10 * 1024 * 1024)) {
//
vant.Dialog.alert({
//
title: '信息提示',
//
message: '文件大小不可超过10M'
//
})
//
return false;
//
}
//
return true;
//
},
//
afterRead(file, type) { // 调用爱山东中台系统,将数据流传递过去
//
vant.Toast.loading({
//
message: '正在处理...',
//
forbidClick: true,
//
loadingType: 'spinner',
//
});
//
// 文件读取完成后的处理逻辑
//
const formData = new FormData();
//
formData.append('file', file.file); // 通过FormData构建要上传的文件数据
//
// formData.append('biz_content',SM.encrypt('dangerjob', API_KEY_MAP["upload"]["publicKey"]));
//
// 发送HTTP POST请求
//
fetch(BASE_URL + '/common/upload', {
//
method: 'POST',
//
body: formData,
//
headers: {
//
'Authorization': gemhoUtil.getCookie('token'),
//
}
//
})
//
.then(response => {
//
if (response.ok) {
//
return response.json();
//
}
//
throw new Error('Network response was not ok.');
//
})
//
.then(value => {
//
console.log(value, 'value图片上********'); // 处理后端返回的数据
//
if(value){ // 返回信息不为空,则进行解密操作
// if(type === 'floorPlanPhotos
'){
//
this.formData.floorPlanPhotos.push(value.fileName)
// }else if(type === 'businessLicensePhotos
'){
//
this.formData.businessLicensePhotos.push(value.fileName)
// }else if(type === 'storefrontPhotos
'){
//
this.formData.storefrontPhotos.push(value.fileName)
//
}else if(type === 'floorEvacuationPlan'){
//
this.formData.floorEvacuationPlan.push(value.fileName)
//
}
//
// 可根据后端返回的数据做进一步处理,如显示上传成功信息等
//
setTimeout(() => {
//
vant.Toast.clear()
//
}, 0);
//
}else{
//
this.afterRead(file)
//
}
//
})
//
.catch(error => {
//
// console.error('There has been a problem with your fetch operation:', error);
//
});
//
},
viewDetail
(
item
)
{
let
params
=
{
id
:
item
.
id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment