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
a226fa84
Commit
a226fa84
authored
May 10, 2021
by
林文清
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:我的证书
parent
65f7dadc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
258 additions
and
14 deletions
+258
-14
cert.js
src/common/api/cert.js
+13
-0
index.js
src/common/api/index.js
+4
-1
pages.json
src/pages.json
+32
-13
detail.vue
src/pages/mine/cert/detail.vue
+65
-0
list.vue
src/pages/mine/cert/list.vue
+144
-0
No files found.
src/common/api/cert.js
0 → 100644
View file @
a226fa84
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
);
const
certApi
=
{
getCertList
}
return
certApi
}
module
.
exports
=
{
certApiFun
}
\ No newline at end of file
src/common/api/index.js
View file @
a226fa84
...
...
@@ -10,6 +10,7 @@ import {
import
{
learnApiFun
}
from
"@/common/api/learn.js"
;
import
{
orderApiFun
}
from
"@/common/api/order.js"
;
import
{
assessmentApiFun
}
from
"@/common/api/assessment.js"
import
{
certApiFun
}
from
"@/common/api/cert.js"
let
apiFun
=
function
(
vm
)
{
let
commonApi
=
commonApiFun
(
vm
);
let
settledApi
=
settledApiFun
(
vm
)
...
...
@@ -17,13 +18,15 @@ let apiFun = function(vm) {
let
learnApi
=
learnApiFun
(
vm
)
let
assessmentApi
=
assessmentApiFun
(
vm
)
let
orderApi
=
orderApiFun
(
vm
)
let
certApi
=
certApiFun
(
vm
)
let
apiUrl
=
{
...
commonApi
,
...
settledApi
,
...
cloudApi
,
...
learnApi
,
...
orderApi
,
...
assessmentApi
...
assessmentApi
,
...
certApi
}
return
apiUrl
}
...
...
src/pages.json
View file @
a226fa84
...
...
@@ -166,6 +166,20 @@
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"cert/list"
,
"style"
:
{
"navigationBarTitleText"
:
"我的证件"
,
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"cert/detail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件详情
"navigationStyle"
:
"custom"
}
}
]
},
...
...
@@ -469,6 +483,11 @@
"name"
:
"学习 - 首页"
,
//模式名称
"path"
:
"pages/index/learn"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"我的 - 我的证件 - 列表"
,
//模式名称
"path"
:
"pages/mine/cert/list"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
]
}
...
...
src/pages/mine/cert/detail.vue
0 → 100644
View file @
a226fa84
<
template
>
<view
class=
"cert-page"
>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000"
:border-bottom=
"false"
title=
"我的证件"
title-bold=
"true"
></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>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
info
:
{
type
:
""
,
url
:
null
}
}
},
onLoad
()
{
var
that
=
this
;
const
eventChannel
=
this
.
getOpenerEventChannel
()
eventChannel
.
on
(
'acceptDataFromCert'
,
function
(
data
)
{
try
{
let
urlArr
=
data
.
url
.
split
(
','
);
that
.
info
.
type
=
data
.
type
;
that
.
info
.
url
=
urlArr
;
console
.
log
(
urlArr
);
}
catch
(
e
){}
console
.
log
(
that
.
info
);
})
},
}
</
script
>
<
style
>
.cert-page
{
font-size
:
28
rpx
;
margin
:
30
rpx
;
}
.content-cody
{
padding-left
:
30
rpx
;
padding-right
:
30
rpx
;
background-color
:
#F4F5F7
;
border-radius
:
12
rpx
;
}
.title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
}
.content
{
padding-top
:
30
rpx
;
}
</
style
>
src/pages/mine/cert/list.vue
0 → 100644
View file @
a226fa84
<
template
>
<view
class=
"cert-page"
>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000"
:border-bottom=
"false"
title=
"我的证件"
title-bold=
"true"
></u-navbar>
<view
class=
"content-cody"
>
<u-cell-group>
<u-cell-item
v-for=
"item in list"
:title=
"item.name"
:value=
"item.isUploadName"
:arrow=
"true"
:value-style=
"
{'color': item.color}" @click="toDetail(item.keyName)">
<u-icon
slot=
"icon"
size=
"32"
name=
"checkmark-circle"
:color=
"item.iconColor"
></u-icon>
</u-cell-item>
</u-cell-group>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
list
:
{
id_card
:
{
name
:
"身份证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"id_card"
,
color
:
"#999999"
},
electrician_certificate
:
{
name
:
"电工证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"electrician_certificate"
,
color
:
"#999999"
},
driver_license
:
{
name
:
"驾驶证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"driver_license"
,
color
:
"#999999"
},
driving_license
:
{
name
:
"行驶证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"driving_license"
,
color
:
"#999999"
},
vehicle
:
{
name
:
"车辆照"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"vehicle"
,
color
:
"#999999"
},
high_sky_license
:
{
name
:
"高空证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"high_sky_license"
,
color
:
"#999999"
},
refrigeration_license
:
{
name
:
"制冷证"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"refrigeration_license"
,
color
:
"#999999"
},
business_license
:
{
name
:
"营业执照"
,
isUpload
:
false
,
isUploadName
:
""
,
keyName
:
"business_license"
,
color
:
"#999999"
},
}
}
},
onLoad
()
{
let
that
=
this
;
this
.
$u
.
api
.
getCertList
()
.
then
((
res
)
=>
{
if
(
res
.
code
!=
200
){
return
}
for
(
let
key
in
this
.
list
){
let
getData
=
res
.
data
[
key
];
this
.
list
[
key
].
isUpload
=
getData
.
status
;
this
.
list
[
key
].
isUploadName
=
getData
.
status
==
1
?
'已上传'
:
'未上传'
;
this
.
list
[
key
].
color
=
getData
.
status
==
1
?
"#999999"
:
"#2272FF"
;
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
:
{
isUpload
(
typeBool
)
{
return
typeBool
?
'已上传'
:
'未上传'
},
toDetail
(
key
)
{
let
data
=
this
.
list
[
key
].
data
;
if
(
data
.
status
!=
1
){
return
;
}
wx
.
navigateTo
({
url
:
'/pages/mine/cert/detail'
,
success
:
function
(
res
)
{
res
.
eventChannel
.
emit
(
'acceptDataFromCert'
,
data
)
}
});
}
}
}
</
script
>
<
style
>
.cert-page
{
font-size
:
28
rpx
;
margin
:
30
rpx
;
}
.content-cody
{
/* padding-left: 30rpx;
padding-right: 30rpx; */
padding-left
:
30
rpx
;
padding-right
:
30
rpx
;
background-color
:
#ffffff
;
border-radius
:
12
rpx
;
}
.rightBlue
{
color
:
#007AFF
;
}
</
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