Commit 5f0a0505 authored by ganjingcun's avatar ganjingcun

fix

parent 68652392
......@@ -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>
......
......@@ -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 {
......
......@@ -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)
});
......
......@@ -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;
}, 3000)
}, 1500)
}, (res) => {
setTimeout(function () {
_this.isClick = false;
}, 3000)
}, 1500)
this.hasError = true
});
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment