Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
GaiaXalter
Ygopro Arena Web
Commits
5f0a0505
Commit
5f0a0505
authored
Sep 28, 2017
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
68652392
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
28 deletions
+51
-28
index.html
index.html
+1
-1
src/api.js
src/api.js
+2
-2
src/components/PageHeader.vue
src/components/PageHeader.vue
+33
-13
src/components/Vote.vue
src/components/Vote.vue
+14
-12
static/assets/css/styles.css
static/assets/css/styles.css
+1
-0
No files found.
index.html
View file @
5f0a0505
...
...
@@ -8,7 +8,7 @@
<link
rel=
"stylesheet"
href=
"assets/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"assets/css/styles.css"
>
<link
rel=
"stylesheet"
href=
"assets/css/font-awesome.min.css"
>
<
link
rel=
"stylesheet"
href=
"assets/layui/css/layui.css"
>
<
!--<link rel="stylesheet" href="assets/layui/css/layui.css">--
>
</head>
<body>
...
...
src/api.js
View file @
5f0a0505
...
...
@@ -5,8 +5,8 @@ import config from './config';
Vue
.
use
(
VueResource
)
const
URL
=
"
http://localhost:3000/api
"
//
const URL = "https://api.mycard.moe/ygopro/arena"
//
const URL = "http://localhost:3000/api"
const
URL
=
"
https://api.mycard.moe/ygopro/arena
"
export
default
class
Api
{
...
...
src/components/PageHeader.vue
View file @
5f0a0505
...
...
@@ -133,13 +133,13 @@
var
voteTime
=
localStorage
.
getItem
(
'
voteTime
'
);
if
(
voteTime
)
{
var
today
=
moment
().
format
(
'
YYYY-MM-DD
'
)
if
(
voteTime
===
today
)
{
return
}
}
//
var voteTime = localStorage.getItem('voteTime');
//
if (voteTime) {
//
var today = moment().format('YYYY-MM-DD')
//
if (voteTime === today) {
//
return
//
}
//
}
API
.
getVote
({
user
:
this
.
user
.
id
,
username
:
this
.
user
.
username
}).
then
((
res
)
=>
{
...
...
@@ -204,15 +204,35 @@
this
.
dialogFormVisible
=
false
var
_this
=
this
API
.
submitVote
(
param
).
then
((
res
)
=>
{
this
.
$notify
({
title
:
'
操作成功
'
,
message
:
'
感谢您的参与, 环境会因为您而变得更好。此问卷为您奖励 EXP + 1 !
'
,
type
:
'
success
'
})
// this.$notify({
// title: '操作成功',
// message: '感谢您的参与, 环境会因为您而变得更好。此问卷为您奖励 EXP + 1 !',
// type: 'success'
// })
layer
.
open
({
type
:
1
,
title
:
'
Hi,
'
+
_this
.
user
.
username
,
offset
:
'
rb
'
//具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
,
id
:
'
layerDemo
'
,
time
:
3000
,
content
:
'
<div style="padding: 10px 80px;">
'
+
'
感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!
'
+
'
</div>
'
,
btn
:
'
知道了
'
,
btnAlign
:
'
c
'
//按钮居中
,
shade
:
0
//不显示遮罩
,
yes
:
function
()
{
layer
.
closeAll
();
// _this.dialogFormVisible = true;
}
});
localStorage
.
setItem
(
'
voteTime
'
,
moment
().
format
(
'
YYYY-MM-DD
'
));
//
localStorage.setItem('voteTime', moment().format('YYYY-MM-DD'));
},
(
res
)
=>
{
console
.
log
(
res
)
});
...
...
src/components/Vote.vue
View file @
5f0a0505
...
...
@@ -146,9 +146,9 @@
created
:
function
()
{
var
lang
=
localStorage
.
getItem
(
'
lang
'
)
||
'
cn
'
;
this
.
init
(
lang
)
},
mounted
:
function
()
{
},
...
...
@@ -165,7 +165,6 @@
if
(
this
.
needRender
)
{
this
.
renderTable
()
}
},
},
data
:
function
()
{
...
...
@@ -324,28 +323,31 @@
var
optionCountMap
=
res
.
data
.
optionCountMap
history
.
data
=
res
.
data
.
data
.
map
(
function
(
row
)
{
row
.
options
=
JSON
.
parse
(
row
.
options
)
var
voteVount
=
0
row
.
options
.
map
(
function
(
option
)
{
var
voteVount
=
0
row
.
options
.
map
(
function
(
option
)
{
option
.
count
=
parseInt
(
optionCountMap
[
option
.
key
])
voteVount
+=
option
.
count
return
option
})
row
.
options
.
map
(
function
(
option
)
{
row
.
options
.
map
(
function
(
option
)
{
var
percentage
=
100
if
(
voteVount
===
0
||
option
.
count
===
0
)
{
if
(
voteVount
===
0
||
option
.
count
===
0
)
{
percentage
=
0
}
else
{
}
else
{
percentage
=
option
.
count
/
voteVount
*
100
}
option
.
percentage
=
percentage
return
option
})
return
row
})
console
.
log
(
history
.
data
)
//
console.log(history.data)
_this
.
history
=
history
setTimeout
(
function
()
{
$
(
"
.el-icon-arrow-right
"
).
trigger
(
'
click
'
)
},
200
)
},
(
res
)
=>
{
//
})
...
...
@@ -385,11 +387,11 @@
_this
.
renderTable
()
setTimeout
(
function
()
{
_this
.
isClick
=
false
;
},
30
00
)
},
15
00
)
},
(
res
)
=>
{
setTimeout
(
function
()
{
_this
.
isClick
=
false
;
},
30
00
)
},
15
00
)
this
.
hasError
=
true
});
...
...
static/assets/css/styles.css
View file @
5f0a0505
...
...
@@ -19,6 +19,7 @@ div.jumbotron {
body
{
font-family
:
Arial
,
Helvetica
,
sans-serif
;
/*font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;*/
}
.site-section
{
...
...
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