Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
李俊赕
self-support
Commits
f1442ebc
Commit
f1442ebc
authored
May 24, 2021
by
linwenqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:提交证件
parent
8d4291f5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
300 additions
and
12 deletions
+300
-12
cert.js
src/common/api/cert.js
+3
-1
pages.json
src/pages.json
+7
-0
detail.vue
src/pages/mine/cert/detail.vue
+1
-1
index.vue
src/pages/mine/cert/index.vue
+10
-10
upload.vue
src/pages/mine/cert/upload.vue
+279
-0
No files found.
src/common/api/cert.js
View file @
f1442ebc
...
...
@@ -2,8 +2,10 @@ const globalUrl = process.uniEnv || {}
const
ucenterApiUrl
=
globalUrl
.
ucenterUrl
.
apiUrl
let
certApiFun
=
function
(
vm
){
let
getCertList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/get-cert-list'
,
params
);
let
submitCert
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/submit-cert'
,
params
);
const
certApi
=
{
getCertList
getCertList
,
submitCert
}
return
certApi
}
...
...
src/pages.json
View file @
f1442ebc
...
...
@@ -216,6 +216,13 @@
"navigationBarTitleText"
:
""
,
//证件详情
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"cert/upload"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件上传
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"contract/index"
,
...
...
src/pages/mine/cert/detail.vue
View file @
f1442ebc
...
...
@@ -10,7 +10,7 @@
></u-navbar>
<view
class=
"content-cody"
>
<view
class=
"title"
>
{{
info
.
type
}}
</view>
<view
class=
"content"
v-for=
"item in info.url"
><image
:src=
"item"
mode=
""
></image></view>
<view
class=
"content"
v-for=
"item in info.url"
><image
:src=
"item"
mode=
"
aspectFit
"
></image></view>
</view>
</view>
</
template
>
...
...
src/pages/mine/cert/index.vue
View file @
f1442ebc
...
...
@@ -102,10 +102,7 @@
this
.
list
[
key
].
iconColor
=
getData
.
status
==
1
?
"#2272FF"
:
"#999999"
;
this
.
list
[
key
].
data
=
getData
;
}
console
.
log
(
this
.
list
);
console
.
log
(
res
);
}).
catch
((
err
)
=>
{
console
.
log
(
err
);
});
},
methods
:
{
...
...
@@ -115,14 +112,17 @@
toDetail
(
key
)
{
let
data
=
this
.
list
[
key
].
data
;
if
(
data
.
status
!=
1
){
return
;
wx
.
navigateTo
({
url
:
'/pages/mine/cert/upload?type='
+
data
.
type_key
});
}
else
{
wx
.
navigateTo
({
url
:
'/pages/mine/cert/detail'
,
success
:
function
(
res
)
{
res
.
eventChannel
.
emit
(
'acceptDataFromCert'
,
data
)
}
});
}
wx
.
navigateTo
({
url
:
'/pages/mine/cert/detail'
,
success
:
function
(
res
)
{
res
.
eventChannel
.
emit
(
'acceptDataFromCert'
,
data
)
}
});
}
}
}
...
...
src/pages/mine/cert/upload.vue
0 → 100644
View file @
f1442ebc
<
template
>
<view
class=
"cert-page"
>
<view>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000"
:border-bottom=
"false"
title=
"证件上传"
title-bold=
"true"
></u-navbar>
</view>
<view
class=
"content-body"
>
<view
class=
"notice-top"
>
请上传您的:
<text
class=
"right"
>
{{
imgList
[
key
].
typeName
}}
</text>
</view>
<view
class=
"notice-two"
>
请点击上传图片,图片大小不大于3M
</view>
<view
class=
"upload-container"
>
<view
class=
"img-container"
v-for=
"(item, index) in imgList[key].desc"
:class=
"
{'u-margin-left-30': index>0}" :key="index">
<image
class=
"upload-img"
@
click=
"handleClick(type, index)"
:src=
"imgs[index]"
mode=
"aspectFill"
>
</image>
<text
class=
"img-desc"
>
{{
item
}}
</text>
</view>
</view>
<view
class=
"notice-bottom"
>
<image
:src=
"icon"
class=
"icon"
></image>
<text
class=
"u-padding-left-10"
>
若无需上传证件反面照,则点击上传正面照即可
</text>
</view>
<view
class=
"button-container"
>
<view
class=
"submit-button"
:class=
"
{'is-ok': isOk}" @click="submitCert()">提交
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
base
from
'@/components/upload/index'
;
export
default
{
mixins
:
[
base
],
data
()
{
return
{
icon
:
process
.
uniEnv
.
qn_base_url
+
"tishi.png"
,
categories
:
[],
param
:
{
url
:
[]
},
key
:
null
,
type
:
null
,
isOk
:
false
,
imgs
:
[
process
.
uniEnv
.
qn_base_url
+
"sahgnchuanzhaopian.png"
,
process
.
uniEnv
.
qn_base_url
+
"sahgnchuanzhaopian.png"
,
],
imgList
:
[{
typeKey
:
'id_card'
,
typeName
:
'身份证'
,
desc
:
[
'上传身份证人像面'
,
'上传身份证国徽面'
],
maxImgs
:
2
},
{
typeKey
:
'electrician_certificate'
,
typeName
:
'电工证'
,
desc
:
[
'上传电工证照片'
,
'无需上传反面照'
],
maxImgs
:
1
},
{
typeKey
:
'driver_license'
,
typeName
:
'驾驶证'
,
desc
:
[
'上传驾驶证照片'
,
'无需上传反面照'
],
maxImgs
:
1
},
{
typeKey
:
'driving_license'
,
typeName
:
'行驶证'
,
desc
:
[
'上传行驶证照片'
,
'无需上传反面照'
],
maxImgs
:
1
},
{
typeKey
:
'vehicle'
,
typeName
:
'车辆照'
,
desc
:
[
'车辆正面/看到车牌'
,
'车辆侧面/看到外观'
],
maxImgs
:
2
},
{
typeKey
:
'high_sky_license'
,
typeName
:
'高空证'
,
desc
:
[
'上传高空证照片'
,
'无需上传反面照'
],
maxImgs
:
1
},
{
typeKey
:
'refrigeration_license'
,
typeName
:
'制冷证'
,
desc
:
[
'上传制冷证照片'
,
'无需上传反面照'
],
maxImgs
:
1
},
{
typeKey
:
'business_license'
,
typeName
:
'营业执照'
,
desc
:
[
'上传营业执照照片'
,
'无需上传反面照'
],
maxImgs
:
1
}
],
}
},
onLoad
(
param
)
{
this
.
type
=
param
.
type
this
.
key
=
this
.
getListKey
(
this
.
type
);
},
methods
:
{
getListKey
(
typeKey
)
{
let
length
=
this
.
imgList
.
length
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
this
.
imgList
[
i
].
typeKey
==
typeKey
)
{
return
i
}
}
},
async
handleClick
(
certType
,
key
)
{
if
(
this
.
imgList
[
this
.
key
].
desc
[
key
]
==
'无需上传反面照'
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
this
.
imgList
[
this
.
key
].
desc
[
key
],
});
return
}
let
self
=
this
self
.
uploadType
=
certType
||
''
let
attr
=
{
category
:
self
.
categories
[
1
]
}
if
(
certType
==
'id_card_front'
)
{
attr
=
{
category
:
self
.
categories
[
2
]
}
}
let
src
=
await
self
.
chooseImg
({
count
:
1
})
self
.
imgs
[
key
]
=
src
[
0
].
path
;
self
.
param
.
url
[
key
]
=
src
[
0
].
key
;
if
(
self
.
param
.
url
.
length
==
this
.
imgList
[
this
.
key
].
maxImgs
){
this
.
isOk
=
true
;
}
else
{
this
.
isOk
=
false
;
}
},
submitCert
()
{
if
(
!
this
.
isOk
){
return
;
}
this
.
param
.
url
=
this
.
param
.
url
.
toString
();
this
.
param
.
type
=
this
.
type
;
this
.
$u
.
api
.
submitCert
(
this
.
param
)
.
then
((
res
)
=>
{
if
(
res
.
status
!=
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
message
,
});
}
wx
.
redirectTo
({
url
:
'/pages/mine/cert/index'
});
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
});
}
}
}
</
script
>
<
style
>
page
{
background
:
#F4F5F7
;
}
.cert-page
{
height
:
70vh
;
margin
:
20
rpx
30
rpx
0
rpx
;
}
.content-body
{
padding
:
40
rpx
30
rpx
60
rpx
;
background-color
:
#FFF
;
border-radius
:
12
rpx
;
}
.notice-top
{
width
:
290
rpx
;
height
:
32
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFang-SC-Bold
,
PingFang-SC
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
32
rpx
;
}
.right
{
color
:
#2272FF
;
}
.notice-two
{
height
:
28
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFang-SC-Regular
,
PingFang-SC
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
28
rpx
;
margin-top
:
18
rpx
;
}
.notice-bottom
{
height
:
20
rpx
;
font-size
:
20
rpx
;
font-family
:
PingFang-SC-Medium
,
PingFang-SC
;
font-weight
:
500
;
color
:
#999999
;
line-height
:
20
rpx
;
margin-top
:
30
rpx
;
display
:
flex
;
}
.submit-button
{
width
:
400
rpx
;
height
:
104
rpx
;
background
:
#D1D4D4
;
border-radius
:
52
rpx
;
margin-top
:
250
rpx
;
text-align
:
center
;
line-height
:
104
rpx
;
display
:
inline-block
;
color
:
#FFFFFF
;
font-weight
:
bold
;
font-size
:
32
rpx
;
}
.is-ok
{
background
:
#2272FF
;
}
.button-container
{
text-align
:
center
;
}
.upload-container
{
display
:
flex
;
}
.upload-img
{
margin-top
:
30
rpx
;
width
:
300
rpx
;
height
:
226
rpx
;
}
.two
{
margin-left
:
30
rpx
;
}
.icon
{
width
:
24
rpx
;
height
:
24
rpx
;
}
.img-container
{
position
:
relative
;
}
.img-desc
{
position
:
absolute
;
bottom
:
10
rpx
;
left
:
0
;
font-size
:
20
rpx
;
color
:
#c5bfbf
;
font-weight
:
400
;
line-height
:
28px
;
text-align
:
center
;
width
:
100%
;
}
</
style
>
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