Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
ztx_wx_gzt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5f967e5c
authored
2026-08-13 14:51:19 +0800
by
lttnew
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
证书
1 parent
b7f2fdc4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
222 additions
and
45 deletions
common/api.js
common/request.js
config.js
level/ztx/cert.vue
level/ztx/examList.vue
level/ztx/studentList.vue
common/api.js
View file @
5f967e5
...
...
@@ -1272,3 +1272,17 @@ export function checkPersonByPersonId(perId) {
method
:
'get'
})
}
export
function
checkCertCode
(
params
)
{
return
request
({
url
:
`/person/info/checkCertCode`
,
method
:
'get'
,
params
:
params
})
}
export
function
submitCert3
(
data
)
{
return
request
({
url
:
`/exam/payment/submitCerts/issueAndUpdateCerts`
,
method
:
'put'
,
data
:
data
})
}
...
...
common/request.js
View file @
5f967e5
import
config
from
'@/config.js'
import
config
from
'@/config.js'
import
_
from
'underscore'
const
excludeUrls
=
[
'getMemberCountInfo'
,
'getInfo'
]
...
...
@@ -23,7 +23,7 @@ function getHeaders() {
const
header
=
{
'Authorization'
:
token
,
'Content-Type'
:
'application/json'
,
// 根据自己的数据类型
'Content-Language'
:
'zh_CN'
,
'Content-Language'
:
'zh_CN'
,
// "Content-Type":"application/x-www-form-urlencoded",
'Ztx-Per-Id'
:
uni
.
getStorageSync
(
'perId'
)
||
'-1'
}
...
...
@@ -55,10 +55,17 @@ const request = function(req) {
// }
return
new
Promise
((
resolve
,
reject
)
=>
{
// 支持 @RequestBody 接口:传 data 则序列化为 JSON 放进请求体
let
reqData
=
req
.
data
if
(
reqData
!==
undefined
&&
reqData
!==
null
)
{
reqData
=
JSON
.
stringify
(
reqData
)
}
else
{
reqData
=
req
.
params
}
uni
.
request
({
url
:
config
.
baseUrl_api
+
req
.
url
,
method
:
req
.
method
,
data
:
req
.
params
,
data
:
req
Data
,
header
:
getHeaders
()
}).
then
(
res
=>
{
switch
(
res
.
statusCode
)
{
...
...
@@ -125,4 +132,4 @@ const request = function(req) {
})
}
export
default
request
export
default
request
...
...
config.js
View file @
5f967e5
...
...
@@ -7,8 +7,8 @@
// const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api";
// const baseUrl_api = 'http://192.168.1.132:8787'
// const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api'
//
const baseUrl_api = 'https://tk001.wxjylt.com/stage-api' //测试环境
const
baseUrl_api
=
'https://system.taekwondo.org.cn/stage-api'
//会员生产
const
baseUrl_api
=
'https://tk001.wxjylt.com/stage-api'
//测试环境
//
const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' //会员生产
// const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api'
export
default
{
baseUrl_api
...
...
level/ztx/cert.vue
View file @
5f967e5
...
...
@@ -34,7 +34,8 @@
</view>
<!-- v-if="item.certStatus != '2'" -->
<view
class=
"func"
>
<button
@
click=
"send(item)"
>
更新证书
</button>
<button
@
click=
"goDetail(item)"
>
查看
</button>
<button
@
click=
"handleSend(item)"
>
下发并生成证书
</button>
</view>
</view>
</view>
...
...
@@ -43,6 +44,25 @@
<image
mode=
"aspectFit"
src=
"/static/nodata.png"
></image>
<text>
暂无数据
</text>
</view>
-->
<!-- 下发证书确认弹层 -->
<uni-popup
ref=
"certPopup"
type=
"center"
:is-mask-click=
"false"
>
<view
class=
"cert-dialog"
>
<view
class=
"cert-dialog__head"
>
<uni-icons
type=
"info-filled"
size=
"24"
color=
"#FAAD14"
/>
<view
class=
"cert-dialog__title"
>
提示
</view>
</view>
<view
class=
"cert-dialog__content"
>
{{
popupContent
}}
</view>
<view
class=
"cert-dialog__btns"
>
<view
class=
"cert-dialog__btn cert-dialog__btn--cancel"
@
click=
"onPopupCancel"
>
取消
</view>
<view
v-if=
"showDownload"
class=
"cert-dialog__btn cert-dialog__btn--download"
@
click=
"onPopupDownload"
>
下载名单
</view>
<view
class=
"cert-dialog__btn cert-dialog__btn--sure"
@
click=
"onPopupSure"
>
确认下发
</view>
</view>
</view>
</uni-popup>
</view>
</
template
>
...
...
@@ -72,6 +92,12 @@
const
deptType
=
ref
(
''
)
const
userType
=
ref
(
''
)
const
paging
=
ref
(
null
)
// 下发证书确认弹层
const
certPopup
=
ref
(
null
)
const
popupContent
=
ref
(
''
)
const
showDownload
=
ref
(
false
)
let
popupSure
=
()
=>
{}
let
popupDownload
=
()
=>
{}
onLoad
((
option
)
=>
{
queryParams
.
value
.
type
=
option
.
type
if
(
option
.
type
==
2
)
{
...
...
@@ -96,6 +122,20 @@
}
})
function
handleSend
(
row
)
{
checkCert
(
row
.
payId
,
()
=>
{
api
.
submitCert3
([{
id
:
row
.
payId
}]).
then
(()
=>
{
uni
.
showToast
({
title
:
`下发成功`
})
getList
()
})
},
()
=>
{
return
`确定下发
${
row
.
name
}
的证书吗`
})
}
function
init
()
{
deptType
.
value
=
app
.
globalData
.
deptType
userType
.
value
=
app
.
globalData
.
userType
...
...
@@ -132,40 +172,86 @@
function
checkCert
(
payIds
,
sureFunc
,
confirmFunc
)
{
return
api
.
checkPersonByPayIds
(
payIds
).
then
(
res
=>
{
if
(
res
.
data
==
1
)
{
confirmFunc
().
then
((
kk
)
=>
{
if
(
kk
.
confirm
){
sureFunc
()
}
// 照片齐全:弹自定义确认框,确认后执行下发
openCertPopup
({
content
:
confirmFunc
(),
showDownload
:
false
,
sure
:
sureFunc
})
}
else
if
(
res
.
data
==
2
||
res
.
data
==
3
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
`存在学员没有照片,是否继续生成?`
,
success
:
(
rr
)
=>
{
if
(
rr
.
confirm
){
sureFunc
()
}
}
// 部分或全部学员没有照片:弹三按钮框,可下载名单
openCertPopup
({
content
:
'存在学员没有照片,是否继续生成?'
,
showDownload
:
true
,
sure
:
sureFunc
,
download
:
()
=>
downloadNoPhotoList
(
payIds
)
})
}
})
}
function
send
(
row
)
{
checkCert
(
row
.
payId
,
()
=>
{
api
.
submitCert2
([{
id
:
row
.
payId
}]).
then
(
res
=>
{
/** 打开自定义确认弹层 */
function
openCertPopup
(
opt
)
{
popupContent
.
value
=
opt
.
content
showDownload
.
value
=
!!
opt
.
showDownload
popupSure
=
opt
.
sure
||
(()
=>
{})
popupDownload
=
opt
.
download
||
(()
=>
{})
certPopup
.
value
.
open
()
}
function
onPopupCancel
()
{
certPopup
.
value
.
close
()
}
function
onPopupSure
()
{
certPopup
.
value
.
close
()
popupSure
()
}
function
onPopupDownload
()
{
popupDownload
()
}
/** 下载没有照片的学员名单(Excel) */
function
downloadNoPhotoList
(
payIds
)
{
uni
.
showLoading
({
title
:
'下载中'
})
uni
.
downloadFile
({
url
:
config
.
baseUrl_api
+
'/person/info/checkPersonByPayIdsAndExport/'
+
payIds
,
header
:
{
'Authorization'
:
uni
.
getStorageSync
(
'token'
)
},
success
:
function
(
res
)
{
uni
.
hideLoading
()
uni
.
showLoading
({
title
:
'正在打开'
})
uni
.
openDocument
({
filePath
:
res
.
tempFilePath
,
fileType
:
'xlsx'
,
showMenu
:
true
,
success
:
function
()
{
uni
.
hideLoading
()
},
fail
:
function
()
{
uni
.
hideLoading
()
uni
.
showToast
({
title
:
'打开失败'
,
icon
:
'none'
,
duration
:
2000
})
}
})
},
fail
:
function
()
{
uni
.
hideLoading
()
uni
.
showToast
({
title
:
`下发成功`
title
:
'下载失败'
,
icon
:
'none'
,
duration
:
2000
})
getList
()
})
},()
=>
{
return
uni
.
showModal
({
title
:
'提示'
,
content
:
`确定下发
${
row
.
name
}
的证书吗`
})
}
})
}
</
script
>
...
...
@@ -180,4 +266,74 @@
width
:
80%
;
word-break
:
break-all
;
}
/* 下发证书确认弹层 */
.cert-dialog
{
width
:
560
rpx
;
background
:
#fff
;
border-radius
:
24
rpx
;
padding
:
40
rpx
32
rpx
28
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
&__head
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-bottom
:
16
rpx
;
}
&
__title
{
font-size
:
32
rpx
;
font-weight
:
600
;
color
:
#303133
;
margin-left
:
10
rpx
;
}
&
__content
{
font-size
:
28
rpx
;
color
:
#606266
;
line-height
:
1.6
;
text-align
:
center
;
margin-bottom
:
36
rpx
;
}
&
__btns
{
width
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
&
__btn
{
flex
:
1
;
margin
:
0
8
rpx
;
height
:
76
rpx
;
line-height
:
76
rpx
;
text-align
:
center
;
font-size
:
28
rpx
;
border-radius
:
38
rpx
;
&--cancel
{
background
:
#f4f4f5
;
color
:
#909399
;
}
&
--download
{
background
:
#fff
;
color
:
#13B5B1
;
border
:
1
rpx
solid
#13B5B1
;
}
&
--sure
{
background
:
#AD181F
;
color
:
#fff
;
}
&
:active
{
opacity
:
0.85
;
}
}
}
</
style
>
\ No newline at end of file
...
...
level/ztx/examList.vue
View file @
5f967e5
...
...
@@ -29,9 +29,9 @@
</view>
</view>
<!-- v-if="item.isCert != '2'" -->
<view
class=
"func"
>
<
!--
<
view
class=
"func"
>
<button
@
click=
"send(item)"
>
更新证书
</button>
</view>
</view>
-->
</view>
</view>
...
...
level/ztx/studentList.vue
View file @
5f967e5
...
...
@@ -82,17 +82,17 @@
uni
.
hideLoading
()
})
}
function
checkCert
(
row
){
return
api
.
checkPersonByPersonId
(
row
.
perId
).
then
(
res
=>
{
if
(
!
res
.
data
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'该学员没有照片,无法生成证书!'
,
success
:
()
=>
{}
})
return
Promise
.
reject
()
}
})
function
checkCert
(
row
){
return
api
.
checkPersonByPersonId
(
row
.
perId
).
then
(
res
=>
{
if
(
!
res
.
data
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'该学员没有照片,无法生成证书!'
,
success
:
()
=>
{}
})
return
Promise
.
reject
()
}
})
}
function
sendCert
(
row
)
{
let
msg
...
...
Write
Preview
Styling with
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