Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
9ed77306
Commit
9ed77306
authored
Jun 07, 2021
by
liyadong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fb2bfafd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
42 deletions
+116
-42
src/public/static/postcard/css/style.css
src/public/static/postcard/css/style.css
+9
-1
src/public/static/postcard/css/style.less
src/public/static/postcard/css/style.less
+8
-2
src/public/static/postcard/js/main.js
src/public/static/postcard/js/main.js
+3
-1
src/public/static/postcard/js/main.min.js
src/public/static/postcard/js/main.min.js
+1
-1
src/resources/views/card/card.blade.php
src/resources/views/card/card.blade.php
+82
-34
src/resources/views/card/index.blade.php
src/resources/views/card/index.blade.php
+13
-3
No files found.
src/public/static/postcard/css/style.css
View file @
9ed77306
...
...
@@ -552,7 +552,7 @@ textarea {
background
:
none
;
width
:
3.4rem
;
max-width
:
3.4rem
;
text-align
:
center
;
text-align
:
left
;
font-weight
:
bold
;
}
.dialog
.content
ul
li
select
option
{
...
...
@@ -655,6 +655,14 @@ textarea {
.loading
span
:nth-child
(
5
)
{
-webkit-animation-delay
:
0.8s
;
}
.login-info
{
padding
:
.2rem
;
font-size
:
0.4rem
;
color
:
#ffffff
;
}
.login-info
a
{
color
:
#fff
;
}
@-webkit-keyframes
Rotate
{
0
%
{
-webkit-transform
:
rotate
(
0
);
...
...
src/public/static/postcard/css/style.less
View file @
9ed77306
...
...
@@ -508,7 +508,7 @@
background: none;
width: 3.4rem;
max-width: 3.4rem;
text-align:
center
;
text-align:
left
;
font-weight: bold;
option{
.fs(.42rem,#613937);
...
...
@@ -610,7 +610,13 @@
.loading span:nth-child(5){
-webkit-animation-delay:0.8s;
}
.login-info{
padding: .2rem;
.fs(.4rem,#fff);
a{
color: #fff;
}
}
@keyframes Rotate {
0% {
transform: rotate(0);
...
...
src/public/static/postcard/js/main.js
View file @
9ed77306
...
...
@@ -35,6 +35,7 @@ card.ajax = function (data, callback) {
}
// 获取服务器和用户id
card
.
handleGetServer
=
function
(
receive
){
$
(
'
.loading
'
).
show
();
this
.
ajax
({
url
:
'
/ald_bind_info
'
,
type
:
'
get
'
,
...
...
@@ -46,7 +47,6 @@ card.handleGetServer = function (receive){
userId
:
res
.
data
.
userId
}
card
.
handleGetRoleList
(
params
);
$
(
'
.dialog-server
'
).
fadeIn
();
})
}
...
...
@@ -83,6 +83,8 @@ card.handleGetRoleList = function (params){
html
+=
'
<option value="
'
+
item
.
id
+
'
">
'
+
item
.
name
+
'
</option>
'
;
})
$
(
'
.server-select
'
).
html
(
html
);
$
(
'
.loading
'
).
hide
();
$
(
'
.dialog-server
'
).
fadeIn
();
})
}
// 绑定角色
...
...
src/public/static/postcard/js/main.min.js
View file @
9ed77306
var
card
=
{
relationRole
:{},
clickFlag
:
!
0
,
bindInfo
:{}};
card
.
ajax
=
function
(
e
,
t
){
e
.
data
.
_token
=
$
(
'
meta[name="token"]
'
).
attr
(
"
value
"
),
$
.
ajax
({
type
:
e
.
type
?
e
.
type
:
"
GET
"
,
url
:
location
.
origin
+
e
.
url
,
dataType
:
"
json
"
,
data
:
e
.
data
,
error
:
function
(
e
){
try
{
var
t
=
e
.
responseText
;
alert
(
t
.
message
)}
catch
(
e
){
alert
(
"
系统开小差~~
"
)}},
success
:
function
(
e
){
return
1019
==
e
.
error
?(
location
.
href
=
"
/login
"
,
!
1
):
4003
==
e
.
error
?(
location
.
href
=
"
/bind/ald/code
"
,
!
1
):
void
t
(
e
)}}),
setTimeout
(
function
(){
card
.
clickFlag
=!
0
},
1
e3
)},
card
.
handleGetServer
=
function
(
e
){
this
.
ajax
({
url
:
"
/ald_bind_info
"
,
type
:
"
get
"
,
data
:{}},
function
(
e
){
card
.
bindInfo
=
e
.
data
;
var
t
=
{
serverId
:
e
.
data
.
serverId
,
userId
:
e
.
data
.
userId
};
card
.
handleGetRoleList
(
t
),
$
(
"
.dialog-server
"
).
fadeIn
()})},
card
.
handleGetRoleList
=
function
(
e
){
this
.
ajax
({
url
:
"
/get_role_list
"
,
type
:
"
POST
"
,
data
:
e
},
function
(
e
){
var
t
=
e
.
data
,
a
=
""
,
r
=
[];
card
.
relationRole
=
t
;
for
(
var
o
in
t
)
r
.
push
({
id
:
o
,
name
:
t
[
o
].
name
});
a
=
'
<option value="-1">请选择</option>
'
,
$
(
r
).
each
(
function
(
e
,
t
){
a
+=
'
<option value="
'
+
t
.
id
+
'
">
'
+
t
.
name
+
"
</option>
"
}),
$
(
"
.server-select
"
).
html
(
a
)})},
card
.
bindRole
=
function
(
e
){
this
.
ajax
({
url
:
"
/bind/ald/role
"
,
type
:
"
POST
"
,
data
:
e
},
function
(
t
){
0
===
t
.
error
?(
$
(
"
.dialog
"
).
hide
(),
location
.
href
=
"
/card/html?roleId=
"
+
e
.
roleId
+
"
&serverId=
"
+
e
.
serverId
):
alert
(
t
.
msg
)})};
var
initRoleList
=
function
(
e
){
var
t
=
card
.
relationRole
[
e
].
list
,
a
=
'
<option value="-1">请选择</option>
'
;
$
(
t
).
each
(
function
(
e
,
t
){
a
+=
'
<option value="
'
+
t
.
roleId
+
'
">
'
+
t
.
roleName
+
"
</option>
"
}),
$
(
"
.role-select
"
).
html
(
a
)};
$
(
function
(){
$
(
"
.btn-card-bind-role
"
).
click
(
function
(){
var
e
=
$
(
"
.server-select option:selected
"
).
val
(),
t
=
$
(
"
.server-select option:selected
"
).
text
(),
a
=
$
(
"
.role-select option:selected
"
).
val
();
if
(
roleName
=
$
(
"
.role-select option:selected
"
).
text
(),
!
e
||
"
-1
"
==
e
)
return
alert
(
"
请选择服务器
"
),
!
1
;
if
(
!
a
||
"
-1
"
==
a
)
return
alert
(
"
请选择角色
"
),
!
1
;
var
r
=
{
roleId
:
a
,
serverId
:
e
,
serverName
:
t
,
roleName
:
roleName
};
card
.
clickFlag
&&
card
.
bindRole
(
r
)}),
$
(
"
.server-select
"
).
change
(
function
(){
var
e
=
$
(
this
).
val
();
initRoleList
(
e
)})});
\ No newline at end of file
var
card
=
{
relationRole
:{},
clickFlag
:
!
0
,
bindInfo
:{}};
card
.
ajax
=
function
(
e
,
a
){
e
.
data
.
_token
=
$
(
'
meta[name="token"]
'
).
attr
(
"
value
"
),
$
.
ajax
({
type
:
e
.
type
?
e
.
type
:
"
GET
"
,
url
:
location
.
origin
+
e
.
url
,
dataType
:
"
json
"
,
data
:
e
.
data
,
error
:
function
(
e
){
try
{
var
a
=
e
.
responseText
;
alert
(
a
.
message
)}
catch
(
e
){
alert
(
"
系统开小差~~
"
)}},
success
:
function
(
e
){
return
1019
==
e
.
error
?(
location
.
href
=
"
/login
"
,
!
1
):
4003
==
e
.
error
?(
location
.
href
=
"
/bind/ald/code
"
,
!
1
):
void
a
(
e
)}}),
setTimeout
(
function
(){
card
.
clickFlag
=!
0
},
1
e3
)},
card
.
handleGetServer
=
function
(
e
){
$
(
"
.loading
"
).
show
(),
this
.
ajax
({
url
:
"
/ald_bind_info
"
,
type
:
"
get
"
,
data
:{}},
function
(
e
){
card
.
bindInfo
=
e
.
data
;
var
a
=
{
serverId
:
e
.
data
.
serverId
,
userId
:
e
.
data
.
userId
};
card
.
handleGetRoleList
(
a
)})},
card
.
handleGetRoleList
=
function
(
e
){
this
.
ajax
({
url
:
"
/get_role_list
"
,
type
:
"
POST
"
,
data
:
e
},
function
(
e
){
var
a
=
e
.
data
,
t
=
""
,
r
=
[];
card
.
relationRole
=
a
;
for
(
var
o
in
a
)
r
.
push
({
id
:
o
,
name
:
a
[
o
].
name
});
t
=
'
<option value="-1">请选择</option>
'
,
$
(
r
).
each
(
function
(
e
,
a
){
t
+=
'
<option value="
'
+
a
.
id
+
'
">
'
+
a
.
name
+
"
</option>
"
}),
$
(
"
.server-select
"
).
html
(
t
),
$
(
"
.loading
"
).
hide
(),
$
(
"
.dialog-server
"
).
fadeIn
()})},
card
.
bindRole
=
function
(
e
){
this
.
ajax
({
url
:
"
/bind/ald/role
"
,
type
:
"
POST
"
,
data
:
e
},
function
(
a
){
0
===
a
.
error
?(
$
(
"
.dialog
"
).
hide
(),
location
.
href
=
"
/card/html?roleId=
"
+
e
.
roleId
+
"
&serverId=
"
+
e
.
serverId
):
alert
(
a
.
msg
)})};
var
initRoleList
=
function
(
e
){
var
a
=
card
.
relationRole
[
e
].
list
,
t
=
'
<option value="-1">请选择</option>
'
;
$
(
a
).
each
(
function
(
e
,
a
){
t
+=
'
<option value="
'
+
a
.
roleId
+
'
">
'
+
a
.
roleName
+
"
</option>
"
}),
$
(
"
.role-select
"
).
html
(
t
)};
$
(
function
(){
$
(
"
.btn-card-bind-role
"
).
click
(
function
(){
var
e
=
$
(
"
.server-select option:selected
"
).
val
(),
a
=
$
(
"
.server-select option:selected
"
).
text
(),
t
=
$
(
"
.role-select option:selected
"
).
val
();
if
(
roleName
=
$
(
"
.role-select option:selected
"
).
text
(),
!
e
||
"
-1
"
==
e
)
return
alert
(
"
请选择服务器
"
),
!
1
;
if
(
!
t
||
"
-1
"
==
t
)
return
alert
(
"
请选择角色
"
),
!
1
;
var
r
=
{
roleId
:
t
,
serverId
:
e
,
serverName
:
a
,
roleName
:
roleName
};
card
.
clickFlag
&&
card
.
bindRole
(
r
)}),
$
(
"
.server-select
"
).
change
(
function
(){
var
e
=
$
(
this
).
val
();
initRoleList
(
e
)})});
\ No newline at end of file
src/resources/views/card/card.blade.php
View file @
9ed77306
...
...
@@ -29,6 +29,9 @@
</head>
<body>
<div
class=
"container postcard-container"
id=
"test"
>
{{--
<div
class=
"login-info"
>
--}}
{{-- 欢迎您,
<a
href=
"/login"
>
【登录】
</a><a
href=
"/loginout"
>
【注销】
</a>
--}}
{{--
</div>
--}}
<!--角色信息-->
<div
class=
"role-container"
>
<span
class=
"icon-red"
></span>
...
...
@@ -236,46 +239,91 @@
$
(
'
.postcard-container
'
).
removeClass
(
'
fixed
'
);
});
$
(
'
.btn-share
'
).
click
(
function
()
{
$
(
'
.share-img
'
).
show
();
});
$
.
ajax
({
url
:
"
/wx/config
"
,
data
:
{
url
:
location
.
href
.
split
(
'
#
'
)[
0
]
},
type
:
'
GET
'
,
dataType
:
"
json
"
,
async
:
false
,
timeout
:
5000
,
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
if
(
textStatus
==
"
timeout
"
)
{
// 请求超时
}
else
{
var
isWeixin
=
function
()
{
//判断是否是微信
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
match
(
/MicroMessenger/i
)
==
"
micromessenger
"
;
};
function
_wechatConfig
(
o
)
{
wx
.
config
({
debug
:
false
,
appId
:
o
.
appId
,
timestamp
:
o
.
timestamp
,
nonceStr
:
o
.
nonceStr
,
signature
:
o
.
signature
,
jsApiList
:
[
'
onMenuShareTimeline
'
,
'
onMenuShareAppMessage
'
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
}
function
_getWechatJsSdkInfo
(
callback
)
{
$
.
ajax
({
type
:
"
GET
"
,
url
:
"
/wx/config
"
,
data
:{
url
:
location
.
href
},
async
:
false
,
success
:
function
(
data
){
callback
(
data
.
data
);
}
},
success
:
function
(
res
)
{
var
data
=
res
.
data
;
wx
.
config
({
debug
:
true
,
appId
:
data
.
appId
,
timestamp
:
data
.
timestamp
,
nonceStr
:
data
.
nonceStr
,
signature
:
data
.
signature
,
url
:
location
.
href
.
split
(
'
#
'
)[
0
],
jsApiList
:
[
'
onMenuShareAppMessage
'
,
'
onMenuShareTimeline
'
]
});
});
}
wx
.
ready
(
function
()
{
wx
.
onMenuShareAppMessage
({
title
:
'
阿拉德之怒
'
,
// 分享标题
desc
:
'
阿拉德之怒
'
,
// 分享描述
link
:
'
http://uc-signin2.srccwl.com
'
,
// 分享链接,该链接域名或路径必须与当前页面对应// 分享图标的公众号JS安全域名一致
imgUrl
:
'
https://static-platform.srccwl.com/ucSign/ald/sign/images/wx.png
'
,
});
});
if
(
isWeixin
())
{
_getWechatJsSdkInfo
(
_wechatConfig
);
}
wx
.
checkJsApi
({
jsApiList
:
[
'
onMenuShareTimeline
'
,
'
onMenuShareAppMessage
'
],
success
:
function
(
res
)
{
}
});
$
(
'
.btn-share
'
).
click
(
function
()
{
$
(
'
.share-img
'
).
show
();
function
wx_share
(
title
,
link
,
imgurl
,
desc
)
{
//朋友圈
wx
.
onMenuShareTimeline
({
title
:
title
,
link
:
link
,
imgUrl
:
imgurl
,
success
:
function
()
{
},
cancel
:
function
()
{
}
});
//微信好友
wx
.
onMenuShareAppMessage
({
title
:
title
,
desc
:
desc
,
link
:
link
,
imgUrl
:
imgurl
,
type
:
'
link
'
,
dataUrl
:
''
,
success
:
function
()
{
},
cancel
:
function
()
{
}
});
}
wx
.
ready
(
function
()
{
var
title
=
'
阿拉德之怒
'
,
link
=
'
http://uc-card.aldzn.cn
'
,
img
=
"
http://uc-card.aldzn.cn/static/postcard/images/default_img.png
"
,
desc
=
"
阿拉德之怒
"
;
wx_share
(
title
,
link
,
img
,
desc
);
});
wx
.
error
(
function
(
res
)
{
console
.
log
(
res
);
});
});
</script>
...
...
src/resources/views/card/index.blade.php
View file @
9ed77306
...
...
@@ -25,6 +25,9 @@
</head>
<body>
<div
class=
"container home-container"
>
{{--
<div
class=
"login-info"
>
--}}
{{-- 欢迎您,
<a
href=
"/login"
>
【登录】
</a><a
href=
"/loginout"
>
【注销】
</a>
--}}
{{--
</div>
--}}
<div
class=
"header-avatar"
>
<span></span>
<img
src=
"{{ asset('postcard/images/default_img.png') }}"
alt=
""
>
...
...
@@ -48,6 +51,13 @@
</div>
</div>
</div>
<div
class=
"loading hide"
>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<script
type=
"text/javascript"
src=
"//res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>
<script>
$
(
function
(){
...
...
@@ -65,7 +75,7 @@
function
_wechatConfig
(
o
)
{
wx
.
config
({
debug
:
tru
e
,
debug
:
fals
e
,
appId
:
o
.
appId
,
timestamp
:
o
.
timestamp
,
nonceStr
:
o
.
nonceStr
,
...
...
@@ -129,10 +139,10 @@
}
wx
.
ready
(
function
()
{
var
title
=
'
阿拉德之怒
-test
'
,
var
title
=
'
阿拉德之怒
'
,
link
=
'
http://uc-card.aldzn.cn
'
,
img
=
"
http://uc-card.aldzn.cn/static/postcard/images/default_img.png
"
,
desc
=
"
Warning!
阿拉德之怒
"
;
desc
=
"
阿拉德之怒
"
;
wx_share
(
title
,
link
,
img
,
desc
);
});
...
...
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