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
c78dbc03
Commit
c78dbc03
authored
Jul 31, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better:消费者图片上传camera
parent
082d498a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
49 deletions
+110
-49
_consumer_home.css
src/_consumer_home.css
+18
-47
_consumer_home.html
src/_consumer_home.html
+26
-2
_consumer_home.js
src/_consumer_home.js
+66
-0
No files found.
src/_consumer_home.css
View file @
c78dbc03
...
...
@@ -153,53 +153,6 @@ body {
color
:
#737373
;
}
.subNavWrapper
{
background-color
:
#f5f6fa
;
padding
:
0.2rem
0.2rem
;
margin-top
:
-0.3rem
;
}
.subNavWrapper
.van-tab__text
{
color
:
#5b5b5b
;
}
.subNavWrapper
.van-tab--active
span
{
color
:
#fff
;
font-size
:
0.28rem
;
}
.subNavWrapper
.van-tabs__nav--card
{
border
:
none
!important
;
}
.subNavWrapper
.van-tabs--card
{
margin-bottom
:
0.3rem
;
}
.subNavWrapper
.van-tabs__nav--card
.van-tab
{
color
:
#5b5b5b
;
border
:
none
!important
;
}
.subNavWrapper
.van-tabs__nav--card
.van-tab.van-tab--active
{
color
:
#ffffff
;
background
:
#58a5e8
;
border-radius
:
0.4rem
;
}
.subNavWrapper
.van-list
{
background
:
#f5f6fa
;
}
.subNavWrapper
.van-cell
{
margin-bottom
:
0.3rem
;
}
.subNavWrapper
.van-tabs__nav
{
background
:
#f5f6fa
;
margin
:
0
;
}
.navToBtn
{
color
:
#5b5b5b
;
font-size
:
0.36rem
;
...
...
@@ -207,3 +160,21 @@ body {
position
:
absolute
;
right
:
0
;
}
.form-label-div
{
height
:
50px
;
line-height
:
50px
;
padding
:
0
12px
;
font-size
:
.28rem
;
font-weight
:
500
;
margin-bottom
:
-.3rem
;
}
.img-wrapper
{
display
:
flex
;
gap
:
.16rem
;
margin-top
:
0.25rem
;
margin-bottom
:
0.15rem
;
flex-wrap
:
wrap
;
}
\ No newline at end of file
src/_consumer_home.html
View file @
c78dbc03
...
...
@@ -205,14 +205,38 @@
</div>
</div>
<div>
<
!-- <
div>
<h5 class="imager-item-title">
<span>请上传图片(最多4张)</span>
<span></span>
</h5>
<div>
<van-uploader v-model="formData.photos" :max-count="4" multiple
:after-read=
"handleFileUpload"
class=
"uploader-wrapper"
/>
:after-read="handleFileUpload" class="uploader-wrapper" :disabled="true" >
<img src="../image/code/upload.png" style="width:0;height: 0;" alt="" srcset="" @click="paizhao()">
</van-uploader>
</div>
<div>
<img src="../image/code/upload.png" style="width:1.6rem;height: 1.6rem;" alt="" srcset="" @click="paizhao()">
</div>
</div> -->
<!-- 详情模式 -->
<div
class=
"form-label form-label-div title_require title_requirediv"
style=
"width: 4rem;"
>
上传作业证件(最多4张)
</div>
<div
class=
"img-wrapper"
>
<div
style=
"position: relative;"
v-for=
"(imgItem, index) in formData.photos"
>
<img
:src=
"previewUrl + imgItem"
style=
"width: 1.6rem; height: 1.6rem;"
@
click=
"showImage(formData.photos, index)"
/>
<div
class=
"van-uploader__preview-delete"
@
click=
"handleDeleteFloorPlan(index)"
><i
class=
"van-icon van-icon-cross van-uploader__preview-delete-icon"
></i></div>
</div>
<div
v-if=
"formData.photos.length < 4"
>
<!-- <van-uploader :before-read="beforeRead" :after-read="(file) => afterRead(file, 'floorPlan')"
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> -->
<img
src=
"../image/code/upload.png"
style=
"width:1.6rem;height: 1.6rem;"
alt=
""
srcset=
""
@
click=
"paizhao()"
>
</div>
</div>
...
...
src/_consumer_home.js
View file @
c78dbc03
...
...
@@ -14,6 +14,7 @@ window.addEventListener("load", function () {
// maxDate: new Date(2099, 11, 31), // 最大可选日期
// 日期选择的最小范围,这里设置为当前日期的前 10 年
// maxDate: new Date(new Date().getFullYear() + 10, 11),
previewUrl
:
BASE_URL
,
// 新增以下数据
formData
:
{
submitDate
:
gemhoUtil
.
getTargetDateYMD
(),
...
...
@@ -23,6 +24,7 @@ window.addEventListener("load", function () {
area
:
''
,
businessHours
:
''
,
type
:
''
,
// 新增类型字段
photos
:
[]
},
merId
:
''
,
merInformation
:
{
// 新增商户信息对象
...
...
@@ -47,6 +49,70 @@ window.addEventListener("load", function () {
// }
// },
methods
:
{
// 处理平面图删除
handleDeleteFloorPlan
(
index
,
type
)
{
this
.
formData
.
photos
.
splice
(
index
,
1
);
},
paizhao
()
{
var
data
=
[
"
相册
"
,
"
相机
"
];
var
maxSelectNum
=
4
;
lightAppJssdk
.
notification
.
showMediaAlert
({
arg0
:
data
,
success
:
function
(
data
)
{
console
.
log
(
'
选择菜单的数据
'
,
data
)
// formData.append('file', file.file); // 通过FormData构建要上传的文件数据
// alert(data);
var
pam1
=
{
"
url
"
:
BASE_URL
+
'
/common/uploads
'
,
// url:'sdfsdfsd',
"
fileKey
"
:
"
files
"
,
// "fileKey": "files",
"
params
"
:
{
},
"
header
"
:
{
'
Authorization
'
:
gemhoUtil
.
getCookie
(
'
token
'
),
},
"
chooseType
"
:
"
chooseFileUpload
"
,
"
transmissionType
"
:
0
,
//1-base64 0-图片地址"maxSize": 10, "maxSelectNum": 9,
"
maxSize
"
:
10
,
"
maxSelectNum
"
:
maxSelectNum
,
}
if
(
data
.
index
==
0
)
{
pam1
.
chooseType
=
"
chooseImageUpload
"
// pam1.fileKey = "file"
}
else
if
(
data
.
index
==
1
)
{
pam1
.
chooseType
=
"
takingPicturesUpload
"
// pam1.fileKey = "picfile"
}
console
.
log
(
'
请求接口i偶路径
'
,
pam1
)
chooseFileUploadTest
(
pam1
)
// setTimeout('onHidePreloaders()', 2000);
},
fail
:
function
(
data
)
{
console
.
log
(
data
);
}
});
function
chooseFileUploadTest
(
pam
)
{
lightAppJssdk
.
uploadFile
.
chooseFileUpload
({
arg0
:
pam
,
success
:
function
(
value
)
{
console
.
log
(
value
,
'
chooseFileUploadTest图片上传回调
'
)
if
(
value
){
VUE
.
formData
.
photos
.
push
(...
JSON
.
parse
(
value
).
fileNames
)
if
(
VUE
.
formData
.
photos
.
length
>
maxSelectNum
){
const
result
=
VUE
.
formData
.
photos
.
slice
(
0
,
maxSelectNum
)
VUE
.
formData
.
photos
=
result
}
}
},
fail
:
function
(
data1
)
{
console
.
log
(
data1
);
}
});
};
},
openDebug
()
{
// 双击开启debugg模式,再次双击则关闭
console
.
log
(
'
开启关闭debug
'
)
if
(
localStorage
.
getItem
(
'
debug
'
)
==
'
Y
'
)
{
...
...
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