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
7687117a
Commit
7687117a
authored
Apr 12, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:督导首页,检查页面的接口
parent
2372d2b0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
426 additions
and
266 deletions
+426
-266
index.html
index.html
+2
-3
index.js
index.js
+58
-23
util.js
sdk/util.js
+221
-190
_checkrecord.html
src/_checkrecord.html
+6
-5
_checkrecord.js
src/_checkrecord.js
+120
-36
_shanghu_list.html
src/_shanghu_list.html
+1
-1
_shanghu_list.js
src/_shanghu_list.js
+18
-8
No files found.
index.html
View file @
7687117a
...
...
@@ -29,16 +29,15 @@
<body>
<!-- 获取授权用户信息 本地token等操作 -->
<script
<
!-- <
script
type="text/javascript"
src="sdk/jssdk2/index.js"
></script>
></script>
-->
<script
type=
"text/javascript"
>
gemhoUtil
.
setCookie
(
'
token
'
,
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiMTU4YjM0M2MtNTFmMS00ZDYzLTk0ZWUtNzcxZWRkYTAxMjFmIn0.ehBDVx2ldKNypKcQ4Vnzzii7Dy9El8gRBRQ1Fs_Lq0tkp-zCxSHoEesF5YsWD5weKSaYdAYj_3gXQk-P832QrA
'
)
// 存储1天后过期
console
.
log
(
gemhoUtil
.
getCookie
(
'
token
'
))
</script>
<div
id=
"app"
...
...
index.js
View file @
7687117a
...
...
@@ -113,6 +113,7 @@ window.onload = function () {
// alert('扫码成功'+JSON.stringify(data))
// location.href = 'shanghu_home.html'
gemhoUtil
.
navigatePage
(
`src/_checkrecord.html`
)
//成功回调
},
...
...
@@ -122,7 +123,7 @@ window.onload = function () {
},
})
}
else
{
this
.
userInfo
.
userType
===
'
s
j
'
this
.
userInfo
.
userType
===
'
s
hop
'
?
(
toData
=
'
checkrecord
'
)
:
(
toData
=
'
shanghu_list
'
)
...
...
@@ -163,23 +164,23 @@ window.onload = function () {
this
.
showPicker
=
false
},
getUserInfo
()
{
// http.get('/gq/information/getAll/1 ').then((res) => {})
vant
.
Toast
.
loading
({
message
:
'
正在加载...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
setTimeout
(()
=>
{
http2
.
post
(
// http2.post(
http
.
post
(
'
/gq/asd/common
'
,
{
serviceId
:
API_KEY_MAP
[
'
no-page
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
no-page
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
no-page
'
][
'
privateKey
'
],
reqParams
:
{
sign
:
1
,
sign
:
9
,
pageNum
:
this
.
page
++
,
// 每次请求增加下一页
pageSize
:
this
.
size
,
sort
:
'
lawId,desc
'
,
},
},
...
...
@@ -194,12 +195,8 @@ window.onload = function () {
return
}
if
(
res
)
{
// console.log('接口回调数据', JSON.parse(res))
var
result
=
JSON
.
parse
(
res
)
// this.list.push(...result.content)
// this.total = result.totalElements
if
(
res
.
code
!==
200
&&
res
.
data
==
null
)
{
if
(
result
.
code
!==
200
&&
result
.
data
==
null
)
{
return
}
this
.
userInfo
=
{
...
...
@@ -209,14 +206,14 @@ window.onload = function () {
deptId
:
'
1
'
,
// 登录用户部门id
deptName
:
result
.
data
.
roleDeptNameVo
.
deptName
,
// 登录用户部门name
businessAddress
:
result
.
data
.
merchantInfoNumVo
.
businessAddress
,
//
result
.
data
.
merchantInfoNumVo
?
.
businessAddress
,
//
smallPlaceTypeName
:
result
.
data
.
merchantInfoNumVo
.
smallPlaceTypeName
,
//
unitName
:
result
.
data
.
merchantInfoNumVo
.
unitName
,
//
result
.
data
.
merchantInfoNumVo
?
.
smallPlaceTypeName
,
//
unitName
:
result
.
data
.
merchantInfoNumVo
?
.
unitName
,
//
role
:
'
dudao
'
,
roleName
:
result
.
data
.
roleDeptNameVo
.
roleName
,
}
gemhoUtil
.
setCookie
(
'
userType
'
,
this
.
userInfo
.
userType
)
// 生成最终菜单列表
this
.
menuList
=
(
result
.
data
.
modules
||
[]).
map
(
(
moduleItem
)
=>
({
...
...
@@ -248,16 +245,54 @@ window.onload = function () {
},
// 获取用户数据的方法
getUserData
()
{
http
.
get
(
'
/gq/checkRecord/merHomeStatistics?merId=1&date=
'
+
this
.
selectedDate
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
userData
=
res
.
data
vant
.
Toast
.
loading
({
message
:
'
正在加载...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
setTimeout
(()
=>
{
// http2.post(
http
.
post
(
'
/gq/asd/common
'
,
{
serviceId
:
API_KEY_MAP
[
'
no-page
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
no-page
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
no-page
'
][
'
privateKey
'
],
reqParams
:
{
sign
:
6
,
pageNum
:
this
.
page
++
,
// 每次请求增加下一页
pageSize
:
this
.
size
,
date
:
this
.
selectedDate
,
sort
:
'
lawId,desc
'
,
},
},
(
res
)
=>
{
if
(
!
res
)
{
// 中台返回为undefined 重新请求
vant
.
Toast
.
clear
()
this
.
page
=
this
.
page
-
1
// 重新请求后,分页数恢复上一次请求的值
setTimeout
(()
=>
{
// this.getList()
},
0
)
return
}
if
(
res
)
{
var
result
=
JSON
.
parse
(
res
)
this
.
userData
=
result
.
data
}
}
})
)
},
0
)
// http
// .get(
// '/gq/checkRecord/merHomeStatistics?merId=1&date=' +
// this.selectedDate
// )
// .then((res) => {
// if (res.code == 200) {
// this.userData = res.data
// }
// })
},
},
//过滤器
...
...
sdk/util.js
View file @
7687117a
var
gemhoUtil
=
window
.
gemhoUtil
||
{}
gemhoUtil
.
formatDate
=
function
(
date
,
type
)
{
var
ymd
=
`
${
date
.
getFullYear
()}
-
${((
date
.
getMonth
()
+
1
)
>
9
?
''
:
'
0
'
)
+
(
date
.
getMonth
()
+
1
)}
-
${(
date
.
getDate
()
>
9
?
''
:
'
0
'
)
+
date
.
getDate
()}
`
;
if
(
type
===
'
YYYY-MM-DD HH:MM:SS
'
)
{
return
ymd
+
'
00:00:00
'
;
}
return
ymd
gemhoUtil
.
formatDate
=
function
(
date
,
type
)
{
var
ymd
=
`
${
date
.
getFullYear
()}
-
${
(
date
.
getMonth
()
+
1
>
9
?
''
:
'
0
'
)
+
(
date
.
getMonth
()
+
1
)
}
-
${(
date
.
getDate
()
>
9
?
''
:
'
0
'
)
+
date
.
getDate
()}
`
if
(
type
===
'
YYYY-MM-DD HH:MM:SS
'
)
{
return
ymd
+
'
00:00:00
'
}
return
ymd
}
gemhoUtil
.
getTargetDateYMD
=
function
(
dayLength
,
type
)
{
var
dayLength
=
dayLength
||
0
;
var
tempDate
=
new
Date
();
tempDate
.
setDate
(
tempDate
.
getDate
()
+
dayLength
);
var
year
=
tempDate
.
getFullYear
();
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
;
var
day
=
tempDate
.
getDate
()
<
10
?
"
0
"
+
tempDate
.
getDate
()
:
tempDate
.
getDate
();
return
year
+
"
-
"
+
month
+
"
-
"
+
day
;
gemhoUtil
.
getTargetDateYMD
=
function
(
dayLength
,
type
)
{
var
dayLength
=
dayLength
||
0
var
tempDate
=
new
Date
()
tempDate
.
setDate
(
tempDate
.
getDate
()
+
dayLength
)
var
year
=
tempDate
.
getFullYear
()
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
var
day
=
tempDate
.
getDate
()
<
10
?
'
0
'
+
tempDate
.
getDate
()
:
tempDate
.
getDate
()
return
year
+
'
-
'
+
month
+
'
-
'
+
day
}
gemhoUtil
.
getTargetDateYM
=
function
(
dayLength
,
type
)
{
var
dayLength
=
dayLength
||
0
;
var
tempDate
=
new
Date
();
tempDate
.
setDate
(
tempDate
.
getDate
()
+
dayLength
);
var
year
=
tempDate
.
getFullYear
();
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
;
return
year
+
"
-
"
+
month
;
gemhoUtil
.
getTargetDateYM
=
function
(
dayLength
,
type
)
{
var
dayLength
=
dayLength
||
0
var
tempDate
=
new
Date
()
tempDate
.
setDate
(
tempDate
.
getDate
()
+
dayLength
)
var
year
=
tempDate
.
getFullYear
()
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
return
year
+
'
-
'
+
month
}
gemhoUtil
.
getTargetDateYMByPara
=
function
(
date
)
{
var
tempDate
=
date
;
var
year
=
tempDate
.
getFullYear
();
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
;
return
year
+
"
-
"
+
month
;
gemhoUtil
.
getTargetDateYMByPara
=
function
(
date
)
{
var
tempDate
=
date
var
year
=
tempDate
.
getFullYear
()
var
month
=
tempDate
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
tempDate
.
getMonth
()
+
1
)
:
tempDate
.
getMonth
()
+
1
return
year
+
'
-
'
+
month
}
/**
*
*
* @functionName: getPageName
* @Description: get page name from URL
* @Description: get page name from URL
* @author: zjb
*
*
*/
gemhoUtil
.
getPageName
=
function
()
{
var
pathname
=
window
.
location
.
pathname
;
if
(
pathname
)
{
pathname
=
pathname
.
split
(
'
/
'
);
return
pathname
[
pathname
.
length
-
1
].
split
(
'
.
'
)[
0
];
}
else
{
return
''
;
}
gemhoUtil
.
getPageName
=
function
()
{
var
pathname
=
window
.
location
.
pathname
if
(
pathname
)
{
pathname
=
pathname
.
split
(
'
/
'
)
return
pathname
[
pathname
.
length
-
1
].
split
(
'
.
'
)[
0
]
}
else
{
return
''
}
}
/**
*
*
* @functionName: getNavigator
* @Description: get navigator
* @Description: get navigator
* @author: zjb
*
*
*/
gemhoUtil
.
getNavigator
=
function
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
indexOf
(
'
chrome
'
)
!=
-
1
)
{
return
'
Chrome
'
;
}
else
if
(
ua
.
indexOf
(
'
firefox
'
)
!=
-
1
)
{
return
'
Firefox
'
;
}
else
if
(
ua
.
indexOf
(
'
safari
'
)
!=
-
1
)
{
return
'
Safari
'
;
}
else
if
(
ua
.
indexOf
(
'
opera
'
)
!=
-
1
)
{
return
'
Opera
'
;
}
else
{
return
'
Unknow
'
;
}
gemhoUtil
.
getNavigator
=
function
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
()
if
(
ua
.
indexOf
(
'
chrome
'
)
!=
-
1
)
{
return
'
Chrome
'
}
else
if
(
ua
.
indexOf
(
'
firefox
'
)
!=
-
1
)
{
return
'
Firefox
'
}
else
if
(
ua
.
indexOf
(
'
safari
'
)
!=
-
1
)
{
return
'
Safari
'
}
else
if
(
ua
.
indexOf
(
'
opera
'
)
!=
-
1
)
{
return
'
Opera
'
}
else
{
return
'
Unknow
'
}
}
/**
*
*
* @functionName: getParameter
* @Description: get parameter from URL
* @Description: get parameter from URL
* @author: zjb
*
*
*/
gemhoUtil
.
getParameter
=
function
(
name
)
{
var
search
=
location
.
search
if
(
!
search
)
{
return
false
}
search
=
search
.
split
(
'
?
'
)
var
data
=
search
[
1
].
split
(
'
=
'
)
if
(
search
[
1
].
indexOf
(
name
)
==
-
1
)
{
return
''
return
}
if
(
search
[
1
].
indexOf
(
'
&
'
)
==
-
1
)
{
data
=
search
[
1
].
split
(
'
=
'
)
return
data
[
1
]
}
else
{
data
=
search
[
1
].
split
(
'
&
'
)
for
(
var
i
=
0
;
i
<=
data
.
length
-
1
;
i
++
)
{
var
l_data
=
data
[
i
].
split
(
'
=
'
)
if
(
l_data
[
0
]
==
name
)
{
return
l_data
[
1
]
break
}
else
{
continue
}
}
}
}
/**
*
* @functionName: getParameter
* @Description: get parameter from URL
* @author: yl
*
*/
gemhoUtil
.
getParameter
=
function
(
name
)
{
var
search
=
location
.
search
;
if
(
!
search
)
{
return
false
;
}
search
=
search
.
split
(
'
?
'
)
var
data
=
search
[
1
].
split
(
'
=
'
);
if
(
search
[
1
].
indexOf
(
name
)
==
(
-
1
))
{
return
''
;
return
;
}
if
(
search
[
1
].
indexOf
(
'
&
'
)
==
(
-
1
))
{
data
=
search
[
1
].
split
(
'
=
'
);
return
data
[
1
];
}
else
{
data
=
search
[
1
].
split
(
'
&
'
);
for
(
var
i
=
0
;
i
<=
data
.
length
-
1
;
i
++
)
{
var
l_data
=
data
[
i
].
split
(
'
=
'
);
if
(
l_data
[
0
]
==
name
)
{
return
l_data
[
1
];
break
;
}
else
{
continue
;
}
}
}
gemhoUtil
.
getUrlParams
=
function
()
{
const
search
=
window
.
location
.
search
const
params
=
new
URLSearchParams
(
search
)
const
paramsObj
=
{}
for
(
const
[
key
,
value
]
of
params
)
{
paramsObj
[
key
]
=
decodeURIComponent
(
value
)
}
return
paramsObj
}
/**
*
*
* @functionName: setParameter
* @Description: set parameter to URL
* @Description: set parameter to URL
* @author: zjb
*
*
*/
gemhoUtil
.
setParameter
=
function
()
{
if
(
arguments
.
length
)
{
var
url
=
arguments
[
0
],
paramsObj
=
arguments
[
1
];
if
(
paramsObj
)
{
var
parameter
=
''
;
for
(
var
x
in
paramsObj
)
{
parameter
+=
x
+
'
=
'
+
paramsObj
[
x
]
+
'
&
'
;
}
url
+=
'
?
'
+
parameter
.
substr
(
0
,
parameter
.
length
-
1
);
}
return
url
;
}
gemhoUtil
.
setParameter
=
function
()
{
if
(
arguments
.
length
)
{
var
url
=
arguments
[
0
],
paramsObj
=
arguments
[
1
]
if
(
paramsObj
)
{
var
parameter
=
''
for
(
var
x
in
paramsObj
)
{
parameter
+=
x
+
'
=
'
+
paramsObj
[
x
]
+
'
&
'
}
url
+=
'
?
'
+
parameter
.
substr
(
0
,
parameter
.
length
-
1
)
}
return
url
}
}
/**
* @functionName: setCookie
* @Description: set cookies
* @Description: set cookies
* @author: zjb
*/
gemhoUtil
.
setCookie
=
function
(
name
,
value
,
days
)
{
var
len
=
arguments
.
length
;
if
(
len
==
2
)
{
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
30
*
24
*
60
*
60
*
1000
);
document
.
cookie
=
name
+
'
=
'
+
escape
(
value
)
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
;
}
else
if
(
len
==
3
)
{
var
exp
=
new
Date
();
exp
.
setDate
(
exp
.
getDate
()
+
parseInt
(
days
));
exp
.
setHours
(
1
,
0
,
0
,
0
);
document
.
cookie
=
name
+
'
=
'
+
escape
(
value
)
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
;
}
gemhoUtil
.
setCookie
=
function
(
name
,
value
,
days
)
{
var
len
=
arguments
.
length
if
(
len
==
2
)
{
var
exp
=
new
Date
()
exp
.
setTime
(
exp
.
getTime
()
+
30
*
24
*
60
*
60
*
1000
)
document
.
cookie
=
name
+
'
=
'
+
escape
(
value
)
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
}
else
if
(
len
==
3
)
{
var
exp
=
new
Date
()
exp
.
setDate
(
exp
.
getDate
()
+
parseInt
(
days
))
exp
.
setHours
(
1
,
0
,
0
,
0
)
document
.
cookie
=
name
+
'
=
'
+
escape
(
value
)
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
}
}
/**
*
*
* @functionName: getCookie
* @Description: get cookies
* @Description: get cookies
* @author: zjb
*
*
*/
gemhoUtil
.
getCookie
=
function
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
'
(^| )
'
+
name
+
'
=([^;]*)(;|$)
'
);
if
(
arr
=
document
.
cookie
.
match
(
reg
))
return
unescape
(
arr
[
2
]);
else
return
null
;
gemhoUtil
.
getCookie
=
function
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
'
(^| )
'
+
name
+
'
=([^;]*)(;|$)
'
)
if
((
arr
=
document
.
cookie
.
match
(
reg
)))
return
unescape
(
arr
[
2
])
else
return
null
}
/**
*
*
* @functionName: delCookie
* @Description: delete cookies
* @Description: delete cookies
* @author: zjb
*
*
*/
gemhoUtil
.
delCookie
=
function
(
name
)
{
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
-
1
);
var
cval
=
getCookie
(
name
);
if
(
cval
!=
null
)
document
.
cookie
=
name
+
'
=
'
+
cval
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
;
gemhoUtil
.
delCookie
=
function
(
name
)
{
var
exp
=
new
Date
()
exp
.
setTime
(
exp
.
getTime
()
-
1
)
var
cval
=
getCookie
(
name
)
if
(
cval
!=
null
)
document
.
cookie
=
name
+
'
=
'
+
cval
+
'
;expires=
'
+
exp
.
toGMTString
()
+
'
;path=/
'
}
/**
*
* @functionName:
* @Description: 获取url页面名称方法
*
* @functionName:
* @Description: 获取url页面名称方法
* @param: date
*/
gemhoUtil
.
getPageName
=
function
()
{
var
pageN
=
window
.
location
.
pathname
;
pageN
=
pageN
.
substring
(
pageN
.
lastIndexOf
(
"
/
"
)
+
1
,
pageN
.
indexOf
(
"
.
"
));
if
(
pageN
)
return
pageN
;
gemhoUtil
.
getPageName
=
function
()
{
var
pageN
=
window
.
location
.
pathname
pageN
=
pageN
.
substring
(
pageN
.
lastIndexOf
(
'
/
'
)
+
1
,
pageN
.
indexOf
(
'
.
'
))
if
(
pageN
)
return
pageN
}
/**
...
...
@@ -196,32 +226,33 @@ gemhoUtil.getPageName = function() {
* @returns
* @demo navigatePage('/warehouse/company/companyDetail.html?companyId=1002');
*/
gemhoUtil
.
navigatePage
=
function
(
path
,
title
)
{
vant
.
Toast
.
loading
({
message
:
title
||
'
页面跳转中...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
});
if
(
!
path
)
{
return
;
}
var
url
=
''
;
if
(
path
.
indexOf
(
'
?
'
)
>
-
1
)
{
// 带有参数
url
+=
path
+
'
&rev=
'
+
(
+
new
Date
())
}
else
{
url
+=
path
+
'
?rev=
'
+
(
+
new
Date
())
}
// 保存当前的滚动位置
var
scrollPosition
=
window
.
scrollY
;
gemhoUtil
.
navigatePage
=
function
(
path
,
title
)
{
vant
.
Toast
.
loading
({
message
:
title
||
'
页面跳转中...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
// 利用 pushState 在浏览器历史记录中添加新状态
// history.pushState({ scrollPosition: scrollPosition }, '');
console
.
log
(
'
跳转页面
'
,
scrollPosition
)
gemhoUtil
.
setCookie
(
'
scrollPosition
'
,
scrollPosition
)
location
.
href
=
url
;
if
(
!
path
)
{
return
}
var
url
=
''
if
(
path
.
indexOf
(
'
?
'
)
>
-
1
)
{
// 带有参数
url
+=
path
+
'
&rev=
'
+
+
new
Date
()
}
else
{
url
+=
path
+
'
?rev=
'
+
+
new
Date
()
}
// 保存当前的滚动位置
var
scrollPosition
=
window
.
scrollY
// 利用 pushState 在浏览器历史记录中添加新状态
// history.pushState({ scrollPosition: scrollPosition }, '');
console
.
log
(
'
跳转页面
'
,
scrollPosition
)
gemhoUtil
.
setCookie
(
'
scrollPosition
'
,
scrollPosition
)
location
.
href
=
url
}
/**
...
...
@@ -230,40 +261,40 @@ gemhoUtil.navigatePage = function(path, title) {
* @returns
* @demo nav2asd('src/_shanghu_home.html?id=1002');
*/
gemhoUtil
.
nav2asd
=
function
(
opt
)
{
const
baseUrl
=
'
https://web1.isdapp.shandong.gov.cn/jmopen_files/unzip/d14b94db457149eab6260efd27deba47/gqyjglptxiefn/
'
lightAppJssdk
.
navigation
.
show
({
url
:
baseUrl
+
(
opt
.
url
||
'
index.html
'
),
title
:
title
||
'
高区安全“码”上查监管平台
'
,
isgoback
:
'
0
'
,
success
:
function
(
data
)
{
// 成功回调
},
fail
:
function
(
data
)
{
// 错误返回
}
});
gemhoUtil
.
nav2asd
=
function
(
opt
)
{
const
baseUrl
=
'
https://web1.isdapp.shandong.gov.cn/jmopen_files/unzip/d14b94db457149eab6260efd27deba47/gqyjglptxiefn/
'
lightAppJssdk
.
navigation
.
show
({
url
:
baseUrl
+
(
opt
.
url
||
'
index.html
'
),
title
:
title
||
'
高区安全“码”上查监管平台
'
,
isgoback
:
'
0
'
,
success
:
function
(
data
)
{
// 成功回调
},
fail
:
function
(
data
)
{
// 错误返回
},
})
}
/**
* 爱山东下载方法
* @param {Object} url 下载文件全路径
* https://h5.tfryb.com/hos-server/pub/jmas/jmasbucket//jmopen_files/webapp/jssdk/be0c4a53adf04f9db4e39a303af78689.docx
*/
gemhoUtil
.
downloadFile
=
function
(
url
){
lightAppJssdk
.
download
.
downloadFiles
({
filePath
:
'
https://h5.tfryb.com/hos-server/pub/jmas/jmasbucket//jmopen_files/webapp/jssdk/be0c4a53adf04f9db4e39a303af78689.docx
'
,
success
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
))
},
fail
:
function
(
err
)
{
alert
(
JSON
.
stringify
(
err
))
}
})
gemhoUtil
.
downloadFile
=
function
(
url
)
{
lightAppJssdk
.
download
.
downloadFiles
({
filePath
:
'
https://h5.tfryb.com/hos-server/pub/jmas/jmasbucket//jmopen_files/webapp/jssdk/be0c4a53adf04f9db4e39a303af78689.docx
'
,
success
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
))
},
fail
:
function
(
err
)
{
alert
(
JSON
.
stringify
(
err
))
},
})
}
// aes解密
function
aes_Decrypt
(
word
,
key
)
{
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
key
)
//转为128bit
...
...
@@ -271,7 +302,7 @@ function aes_Decrypt(word, key) {
var
str
=
CryptoJS
.
enc
.
Base64
.
stringify
(
srcs
)
//变为Base64编码的字符串
var
decrypt
=
CryptoJS
.
AES
.
decrypt
(
str
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
spadding
:
CryptoJS
.
pad
.
Pkcs7
spadding
:
CryptoJS
.
pad
.
Pkcs7
,
})
return
decrypt
.
toString
(
CryptoJS
.
enc
.
Utf8
)
}
...
...
@@ -279,4 +310,4 @@ function aes_Decrypt(word, key) {
// sm2解密,需要创建加密应用时的私钥
function
sm2_Decrypt
(
word
,
key
)
{
return
SM
.
decrypt
(
word
,
key
)
}
\ No newline at end of file
}
src/_checkrecord.html
View file @
7687117a
...
...
@@ -14,11 +14,11 @@
<div
class=
"header"
>
<!-- <div class="level">安全等级</div> -->
<div
class=
"title"
>
<img
src=
"../image/code/sj.png"
alt=
""
><span>
{{u
serInfo.u
nitName}}
</span>
<img
src=
"../image/code/sj.png"
alt=
""
><span>
{{unitName}}
</span>
</div>
<div
class=
"detail"
>
<van-row>
<van-col
span=
"24"
>
场所类型: {{
userInfo.
smallPlaceTypeName}}
</van-col>
<van-col
span=
"24"
>
场所类型: {{smallPlaceTypeName}}
</van-col>
</van-row>
<van-row
type=
"flex"
justify=
"space-around"
style=
"width:100%; margin-top: .3rem; margin-bottom: .3rem;"
>
...
...
@@ -43,7 +43,7 @@
<van-list>
<van-cell
v-for=
"item in hazardList"
:key=
"item.id"
>
<van-cell
v-for=
"item in hazardList"
:key=
"item.id"
@
click=
"viewDetail(item.id)"
>
<div
style=
"width: 100%;"
>
<!-- 第一行:隐患描述 -->
<div
style=
"
...
...
@@ -54,7 +54,8 @@
font-size: 0.3rem;
font-weight: bold;
font-family: PingFang SC;
"
>
{{ item.remark }}
</div>
"
>
九小场所消防安全检查清单
</div>
<!-- ">{{ item.remark }}</div> -->
<!-- 第二行:状态和时间 -->
<div
style=
"display: flex; justify-content: start; gap: .34rem; margin: 8px 0;"
>
...
...
@@ -62,7 +63,7 @@
</div>
<!-- 第三行:商家和箭头 -->
<div
style=
"display: flex; justify-content: start; gap: .4rem; align-items: center;"
>
<span>
检查人:{{item.checkPeople}}
</span>
<span>
检查人:{{item.checkPeople
Name
}}
</span>
<span>
隐患数:{{item.hiddenCount}}
</span>
<span>
未整改:{{item.notRectifiedCount}}
</span>
</div>
...
...
src/_checkrecord.js
View file @
7687117a
...
...
@@ -17,62 +17,146 @@ window.addEventListener('load', function () {
hiddenCount
:
0
,
//隐患数
hiddenNoReCount
:
0
,
//未整改数
},
page
:
1
,
size
:
10
,
merId
:
null
,
// 商户id
unitName
:
''
,
// 单位名称
smallPlaceTypeName
:
''
,
// 场所类型
}
},
created
()
{
let
urlParams
=
gemhoUtil
.
getUrlParams
()
this
.
merId
=
urlParams
.
id
this
.
unitName
=
urlParams
.
unitName
this
.
smallPlaceTypeName
=
urlParams
.
smallPlaceTypeName
this
.
init
()
},
computed
:
{},
methods
:
{
//初始化页面
init
()
{
this
.
getUserInfo
()
this
.
getUserData
()
this
.
getMerchantSelfCheckData
()
},
/**请求数据 */
// 获取用户数据的方法
getUserData
()
{
http
.
get
(
'
/gq/checkRecord/merHomeStatistics?date=
'
+
this
.
selectedDate
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
userData
=
res
.
data
}
})
},
//获取用户信息
getUserInfo
()
{
http
.
get
(
'
/gq/information/getAll/141
'
).
then
((
res
)
=>
{
if
(
res
.
code
!==
200
&&
res
.
data
==
null
)
{
return
}
if
(
res
.
data
.
roleDeptNameVo
.
roleName
==
'
商户
'
)
{
this
.
userInfo
=
{
userType
:
'
sj
'
,
// 登录用户type
userId
:
'
1
'
,
// 登录用户id
userName
:
'
张三
'
,
// 登录用户name
deptId
:
'
1
'
,
// 登录用户部门id
deptName
:
res
.
data
.
roleDeptNameVo
.
deptName
,
// 登录用户部门name
businessAddress
:
res
.
data
.
merchantInfoNumVo
.
businessAddress
,
//
smallPlaceTypeName
:
res
.
data
.
merchantInfoNumVo
.
smallPlaceTypeName
,
//
unitName
:
res
.
data
.
merchantInfoNumVo
.
unitName
,
//
role
:
'
dudao
'
,
roleName
:
'
商家
'
,
}
}
// http
// .get('/gq/checkRecord/merHomeStatistics?date=' + this.selectedDate)
// .then((res) => {
// if (res.code == 200) {
// this.userData = res.data
// }
// })
vant
.
Toast
.
loading
({
message
:
'
正在加载...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
setTimeout
(()
=>
{
// http2.post(
http
.
post
(
'
/gq/asd/common
'
,
{
serviceId
:
API_KEY_MAP
[
'
no-page
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
no-page
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
no-page
'
][
'
privateKey
'
],
reqParams
:
{
sign
:
6
,
merId
:
this
.
merId
,
pageNum
:
this
.
page
++
,
// 每次请求增加下一页
pageSize
:
this
.
size
,
date
:
this
.
selectedDate
,
sort
:
'
lawId,desc
'
,
},
},
(
res
)
=>
{
if
(
!
res
)
{
// 中台返回为undefined 重新请求
vant
.
Toast
.
clear
()
this
.
page
=
this
.
page
-
1
// 重新请求后,分页数恢复上一次请求的值
setTimeout
(()
=>
{
// this.getList()
},
0
)
return
}
if
(
res
)
{
var
result
=
JSON
.
parse
(
res
)
this
.
userData
=
result
.
data
}
}
)
},
0
)
},
//获取商户自查数据
getMerchantSelfCheckData
()
{
http
.
get
(
'
/gq/checkRecord/list?merId=1&pageSize=10&pageNum=0&type=
'
+
this
.
activeTab
// 更多示例数据...
vant
.
Toast
.
loading
({
message
:
'
正在加载...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
setTimeout
(()
=>
{
// http2.post(
http
.
post
(
'
/gq/asd/common
'
,
{
serviceId
:
API_KEY_MAP
[
'
page
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
page
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
page
'
][
'
privateKey
'
],
reqParams
:
{
sign
:
1
,
type
:
this
.
activeTab
,
merId
:
this
.
merId
,
pageNum
:
this
.
page
++
,
// 每次请求增加下一页
pageSize
:
this
.
size
,
sort
:
'
lawId,desc
'
,
},
},
(
res
)
=>
{
if
(
!
res
)
{
// 中台返回为undefined 重新请求
vant
.
Toast
.
clear
()
this
.
page
=
this
.
page
-
1
// 重新请求后,分页数恢复上一次请求的值
setTimeout
(()
=>
{
// this.getList()
},
0
)
return
}
if
(
res
)
{
var
result
=
JSON
.
parse
(
res
)
if
(
result
.
code
!==
200
&&
result
.
data
==
null
)
{
return
}
this
.
hazardList
=
result
.
rows
if
(
this
.
page
*
this
.
size
>=
this
.
total
)
{
this
.
finished
=
true
// 下滑不在刷新数据
}
}
this
.
loading
=
false
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
vant
.
Toast
.
clear
()
})
},
0
)
this
.
$nextTick
(()
=>
{
// 滚动条跳转位置
window
.
scrollTo
(
0
,
gemhoUtil
.
getCookie
(
'
scrollPosition
'
))
})
}
)
.
then
((
res
)
=>
{
this
.
hazardList
=
res
.
rows
})
},
0
)
},
viewDetail
(
id
)
{
let
param
=
{
id
:
id
,
flag
:
'
JC_XQ
'
,
pageName
:
'
_checkrecord
'
,
}
let
url
=
gemhoUtil
.
setParameter
(
'
_check_info.html
'
,
param
)
gemhoUtil
.
navigatePage
(
url
,
'
跳转中...
'
)
// 这里添加跳转逻辑
},
},
})
...
...
src/_shanghu_list.html
View file @
7687117a
...
...
@@ -58,7 +58,7 @@
<!-- 隐患列表 -->
<van-list
v-model:loading=
"loading"
:offset=
"10"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
:immediate-check=
"false"
>
<van-cell
v-for=
"item in list"
:key=
"item.id"
style=
"margin-bottom: 0.25rem;margin-top: 0.25rem;"
@
click=
"viewDetail(item
.id
)"
>
style=
"margin-bottom: 0.25rem;margin-top: 0.25rem;"
@
click=
"viewDetail(item)"
>
<div
style=
"width: 100%;"
>
<!-- 第一行:隐患描述 -->
<div
style=
"
...
...
src/_shanghu_list.js
View file @
7687117a
...
...
@@ -24,8 +24,15 @@ window.addEventListener('load', function () {
onSearch
()
{
console
.
log
(
'
xxxx
'
,
this
.
unitName
)
},
detail
(
index
)
{
gemhoUtil
.
navigatePage
(
'
_sh.html?law_id=
'
+
this
.
list
[
index
].
lawId
)
viewDetail
(
itme
)
{
let
param
=
{
id
:
itme
.
id
,
unitName
:
itme
.
unitName
,
smallPlaceTypeName
:
itme
.
smallPlaceTypeName
,
pageName
:
'
_shanghu_list
'
,
}
let
url
=
gemhoUtil
.
setParameter
(
'
_checkrecord.html
'
,
param
)
gemhoUtil
.
navigatePage
(
url
,
'
跳转中...
'
)
},
getList
()
{
vant
.
Toast
.
loading
({
...
...
@@ -34,16 +41,17 @@ window.addEventListener('load', function () {
loadingType
:
'
spinner
'
,
})
setTimeout
(()
=>
{
http2
.
post
(
// http2.post(
http
.
post
(
'
/gq/asd/common
'
,
{
serviceId
:
API_KEY_MAP
[
'
page
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
page
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
page
'
][
'
privateKey
'
],
reqParams
:
{
sign
:
9
,
sign
:
10
,
pageNum
:
this
.
page
++
,
// 每次请求增加下一页
pageSize
:
this
.
size
,
sort
:
'
lawId,desc
'
,
},
},
...
...
@@ -51,7 +59,7 @@ window.addEventListener('load', function () {
if
(
!
res
)
{
// 中台返回为undefined 重新请求
vant
.
Toast
.
clear
()
this
.
page
=
th
e
-
1
// 重新请求后,分页数恢复上一次请求的值
this
.
page
=
th
is
.
pag
e
-
1
// 重新请求后,分页数恢复上一次请求的值
setTimeout
(()
=>
{
// this.getList()
},
0
)
...
...
@@ -61,8 +69,10 @@ window.addEventListener('load', function () {
// console.log('接口回调数据', JSON.parse(res))
var
result
=
JSON
.
parse
(
res
)
this
.
list
.
push
(...
result
.
content
)
this
.
total
=
result
.
totalElements
this
.
list
=
result
.
data
// this.total = result.totalElements
if
(
this
.
page
*
this
.
size
>=
this
.
total
)
{
this
.
finished
=
true
// 下滑不在刷新数据
...
...
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