Commit 9a8c3b03 authored by GaiaXalter's avatar GaiaXalter 💬

决斗数据库 卡组胜率

parent aed5260b
Pipeline #8473 failed with stages
in 60 minutes and 2 seconds
......@@ -14,15 +14,17 @@
"datatables.net-bs": "1.11.3",
"dom-to-image": "2.6.0",
"echarts": "3.7.2",
"element-ui": "1.4.4",
"element-ui": "2.15.7",
"glob-parent": "^6.0.2",
"is-svg": "^4.3.2",
"js-yaml": "^4.1.0",
"moment": "^2.29.1",
"normalize-wheel": "^1.0.1",
"resize-observer-polyfill": "^1.5.1",
"shelljs": "0.7.7",
"swiper": "^7.3.1",
"uuid": "3.1.0",
"vue": "2.4.2",
"vue": "2.5.17",
"vue-clipboard2": "0.3.1",
"vue-resource": "1.3.4",
"vue-router": "2.2.0",
......@@ -59,7 +61,7 @@
"vue-html5-editor": "1.1.1",
"vue-loader": "11.3.4",
"vue-style-loader": "2.0.0",
"vue-template-compiler": "2.4.2",
"vue-template-compiler": "^2.5.17",
"webpack": "2.2.1",
"webpack-bundle-analyzer": "2.2.1",
"webpack-dev-middleware": "1.10.0",
......@@ -2321,16 +2323,17 @@
"license": "ISC"
},
"node_modules/element-ui": {
"version": "1.4.4",
"version": "2.15.7",
"license": "MIT",
"dependencies": {
"async-validator": "1.6.9",
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
"deepmerge": "^1.2.0",
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1"
},
"peerDependencies": {
"vue": "^2.3.0"
"vue": "2.5.17"
}
},
"node_modules/elliptic": {
......@@ -4261,6 +4264,11 @@
"node": ">=4"
}
},
"node_modules/normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
},
"node_modules/nth-check": {
"version": "2.0.1",
"dev": true,
......@@ -5634,6 +5642,11 @@
"dev": true,
"license": "MIT"
},
"node_modules/resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
},
"node_modules/resolve": {
"version": "1.20.0",
"license": "MIT",
......@@ -6176,28 +6189,6 @@
"node": ">=0.10.0"
}
},
"node_modules/svgo/node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"dependencies": {
"sprintf-js": "~1.0.2"
}
},
"node_modules/svgo/node_modules/esprima": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
"integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
"dev": true,
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/swiper": {
"version": "7.3.1",
"funding": [
......@@ -6672,8 +6663,9 @@
"license": "MIT"
},
"node_modules/vue": {
"version": "2.4.2",
"license": "MIT"
"version": "2.5.17",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.5.17.tgz",
"integrity": "sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ=="
},
"node_modules/vue-clipboard2": {
"version": "0.3.1",
......@@ -6776,9 +6768,10 @@
}
},
"node_modules/vue-template-compiler": {
"version": "2.4.2",
"version": "2.5.17",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.5.17.tgz",
"integrity": "sha512-63uI4syCwtGR5IJvZM0LN5tVsahrelomHtCxvRkZPJ/Tf3ADm1U1wG6KWycK3qCfqR+ygM5vewUvmJ0REAYksg==",
"dev": true,
"license": "MIT",
"dependencies": {
"de-indent": "^1.0.2",
"he": "^1.1.0"
......@@ -9147,11 +9140,12 @@
"dev": true
},
"element-ui": {
"version": "1.4.4",
"version": "2.15.7",
"requires": {
"async-validator": "1.6.9",
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
"deepmerge": "^1.2.0",
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1"
}
},
......@@ -10435,6 +10429,11 @@
"sort-keys": "^1.0.0"
}
},
"normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
},
"nth-check": {
"version": "2.0.1",
"dev": true,
......@@ -11431,6 +11430,11 @@
"version": "1.0.0",
"dev": true
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
},
"resolve": {
"version": "1.20.0",
"requires": {
......@@ -11814,32 +11818,6 @@
"mkdirp": "~0.5.1",
"sax": "~1.2.1",
"whet.extend": "~0.9.9"
},
"dependencies": {
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "~1.0.2"
}
},
"esprima": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
"integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
"dev": true
},
"js-yaml": {
"version": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz",
"integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"esprima": "^2.6.0"
}
}
}
},
"swiper": {
......@@ -12149,7 +12127,9 @@
"dev": true
},
"vue": {
"version": "2.4.2"
"version": "2.5.17",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.5.17.tgz",
"integrity": "sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ=="
},
"vue-clipboard2": {
"version": "0.3.1",
......@@ -12227,7 +12207,9 @@
}
},
"vue-template-compiler": {
"version": "2.4.2",
"version": "2.5.17",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.5.17.tgz",
"integrity": "sha512-63uI4syCwtGR5IJvZM0LN5tVsahrelomHtCxvRkZPJ/Tf3ADm1U1wG6KWycK3qCfqR+ygM5vewUvmJ0REAYksg==",
"dev": true,
"requires": {
"de-indent": "^1.0.2",
......@@ -12686,4 +12668,4 @@
"version": "3.7.4"
}
}
}
\ No newline at end of file
}
......@@ -16,6 +16,14 @@ export default class Api {
static clkUrl = `${URL}/clktrack`
static getMonthlyWinRate() {
let monthlyWinRateUrl = 'https://sapi.moecube.com:444/ygopro/analytics/matchup/type?source=mycard-athletic'
return Vue.http.get(monthlyWinRateUrl)
}
static getDownloadUrl(url) {
url = url.slice(7)
var downloadUrl = `${URL}/download/${url}`
......
.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus
{
background-color: #1a4861;
border: 3px solid #161b22;
}
.nav-tabs {
border-bottom: 1px solid black;
}
.well
{
background-color: #1a4861;
border:none;
}
.input-group-addon
{
color: white;
background-color: #161b22;
border: 1px solid black;
}
.form-control
{
border: 1px solid black;
color: white;
background-color: #283044;
}
.tab-img {
height: 72px;
width: 120px;
}
.table-responsive {
border: 1px solid black;
}
\ No newline at end of file
......@@ -3,20 +3,22 @@
<div class="content">
<div class="container">
<div>
<h4 class="color-blue"><i class="glyphicon glyphicon-filter"></i> {{lang.qc}}</h4>
<h4 class="color-blue">
<i class="glyphicon glyphicon-filter"></i>
{{lang.qc}}
</h4>
<div class="well">
<form action="" method="get" role="form" class="form-inline form-filter">
<div class="form-group" style="margin-right: 10px;">
<div class="input-group">
<div class="input-group-addon">{{lang.time}}</div>
<select name="type" class="form-control" id="type" v-on:change="onChange">
<option value="day">{{lang.today}}</option>
<option value="week">{{lang.week}}</option>
<option value="halfmonth">{{lang.half_month}}</option>
<option value="month">{{lang.month}}</option>
<option value="season">{{lang.season}}</option>
</select>
<option value="day">{{lang.today}}</option>
<option value="week">{{lang.week}}</option>
<option value="halfmonth">{{lang.half_month}}</option>
<option value="month">{{lang.month}}</option>
<option value="season">{{lang.season}}</option>
</select>
</div>
</div>
......@@ -32,7 +34,6 @@
</div>
</div>
<div class="form-group" style="margin-right: 10px;">
<div class="input-group">
<div class="input-group-addon">{{lang.type}}</div>
......
......@@ -67,7 +67,7 @@
import image3 from '../assets/img/image3.jpg'
import { mapGetters } from 'vuex'
import API from '../api'
/* import "../assets/darkModelCss/darkMix.css" */
export default {
data() {
return {
......
......@@ -10,7 +10,7 @@
<div role="presentation" class="footer-block-left-link" ><a @click.prevent="login" href="#"> 注册</a></div>
<div class="footer-block-left-link"><a href="#/download">下载</a></div>
<div class="footer-block-left-link"><a href="https://shop387046095.taobao.com/?spm=2013.1.1000126.2.61a97e3emY0JZB">MC商城</a></div>
<div class="footer-block-left-link"><a href="https://shop387046095.taobao.com/?spm=2013.1.1000126.2.61a97e3emY0JZB" target="_blank">MC商城</a></div>
<div class="footer-block-left-link"><a href="https://ygobbs.com/" target="_blank">联系我们</a></div>
</div>
......
......@@ -6,33 +6,35 @@
<!--<nav class="navbar navbar-inverse">-->
<div class="container">
<div class="navbar-header">
<a class="navbar-brand navbar-link" href="index.html"><img src="../assets/img/mycardlogo.png" id="logo">MyCard
<a class="navbar-brand navbar-link" href="index.html"><img src="../assets/img/mycardlogo.png"
id="logo">MyCard
</a>
<button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-1"><span
class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span
class="icon-bar"></span></button>
class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span
class="icon-bar"></span><span class="icon-bar"></span></button>
</div>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="nav navbar-nav navbar-right">
<li role="presentation"><a href="https://ygobbs.com/" target="_blank">{{lang.forum}} </a></li>
<li role="presentation"><a href="https://shop387046095.taobao.com/?spm=2013.1.1000126.2.61a97e3emY0JZB">{{lang.shop}} </a>
<li role="presentation"><a href="https://shop387046095.taobao.com/?spm=2013.1.1000126.2.61a97e3emY0JZB"
target="_blank">{{lang.shop}} </a>
</li>
<li class="dropdown">
<li role="presentation"><a href="#/ranking" >{{lang.rank}} </a></li>
<li role="presentation"><a href="#/cards" >{{lang.card_rank}} </a></li>
<li role="presentation"><a href="#/rates" >{{lang.rates}} </a></li>
<!-- <li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
{{lang.database}} <span class="caret"></span></a>
{{lang.card_rank}} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a href="#/ranking">{{lang.rank}} </a></li>
<li role="presentation"><a href="#/cards">{{lang.card_rank}} </a></li>
</ul>
</li>
</li> -->
<li role="presentation"><a href=" https://event.ygobbs.com">{{lang.race}} </a></li>
<li role="presentation"><a href="#/download">{{lang.download}} </a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
......@@ -41,12 +43,13 @@
<li role="presentation"><a href="#/deckprint">{{lang.deckprint}} </a></li>
<li role="presentation"><a href="#/tabulate">{{lang.tabulate}} </a></li>
<li role="presentation"><a href="https://rep.ygobbs.com">{{lang.battlelog}} </a></li>
<li role="presentation"><a href="#/download">{{lang.download}} </a></li>
</ul>
</li>
<li v-if="user.isLogin" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"><img
v-bind:src="user.avatar_url" id="head-portrait">{{user.username}} <span class="caret"></span></a>
v-bind:src="user.avatar_url" id="head-portrait">{{user.username}} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a href="#/profile">{{lang.profile}} </a></li>
<li role="presentation"><a href="https://accounts.moecube.com/profiles">{{lang.account}} </a></li>
......@@ -71,7 +74,6 @@
</div>
<!--<other-component></other-component>-->
<!-- Form -->
<el-dialog title="MCPRO服务改进调查" v-if="!(voteObj.multiple)" :visible.sync="dialogFormVisible" :size='size'>
......@@ -85,8 +87,8 @@
<div v-for=" item in voteObj.options">
<el-radio v-model="radio" :label="item.key">
<span class='wrap'>
{{item.name}}
</span>
{{item.name}}
</span>
</el-radio>
</div>
</el-form-item>
......@@ -121,29 +123,26 @@
<div id="ads" style="display: none;position: relative;">
<div @click="adClick">
<div v-if="autoClose"
style="text-align: center;position: absolute;width:20px;height: 20px;margin-top: 0px; float: right;background-color: red">
style="text-align: center;position: absolute;width:20px;height: 20px;margin-top: 0px; float: right;background-color: red">
{{timer}}
</div>
<img v-bind:style="{ height: 'auto', width: width }" v-bind:src="adObj.src">
</div>
</div>
</div>
</template>
<script>
import querystring from 'querystring';
import crypto from 'crypto';
import language from './lang';
import {mapGetters} from 'vuex'
import {
mapGetters
} from 'vuex'
import API from '../api'
import moment from 'moment'
export default {
data() {
const cityOptions = ['上海', '北京', '广州', '深圳'];
return {
......@@ -175,27 +174,20 @@
radio: ""
}
},
created: function () {
created: function() {
this.init()
var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i;
var regex_match =
/(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i;
if (regex_match.exec(navigator.userAgent)) {
this.isMobile = true
this.size = 'large';
}
},
mounted: function () {
mounted: function() {
var _this = this
if (location.hash === "#/vote" || location.hash === "#/report" || location.hash === "#/ads") {
return;
}
// var voteTime = localStorage.getItem('voteTime');
// if (voteTime) {
// var today = moment().format('YYYY-MM-DD')
......@@ -203,7 +195,6 @@
// return
// }
// }
var ad_popup = localStorage.getItem('ad_popup');
if (ad_popup) {
var today = moment().format('YYYY-MM-DD')
......@@ -211,11 +202,11 @@
return
}
}
var time = 5000
var _this = this
API.getAd({type: 1}).then((res) => {
API.getAd({
type: 1
}).then((res) => {
if (res.data.auto_close_ad && res.data.auto_close_ad === "true") {
_this.autoClose = true
}
......@@ -226,39 +217,37 @@
} else {
_this.adObj.src = _this.adObj.imgp_url
}
var area = ["800px", "480px"]
if (_this.isMobile) {
area = ["300px", "400px"]
}
layer.open({
type: 1
, title: false //不显示标题栏
// ,closeBtn: false
, area: area
, shade: 0.8
, offset: _this.isMobile ? '100px' : "auto"
, id: 'LAY_layuipro' //设定一个id,防止重复弹出
// ,btn: ['火速围观', '残忍拒绝']
, btnAlign: 'c'
, moveType: 1 //拖拽模式,0或者1
, content: $('#ads')
, success: function (layero) {
type: 1,
title: false //不显示标题栏
// ,closeBtn: false
,
area: area,
shade: 0.8,
offset: _this.isMobile ? '100px' : "auto",
id: 'LAY_layuipro' //设定一个id,防止重复弹出
// ,btn: ['火速围观', '残忍拒绝']
,
btnAlign: 'c',
moveType: 1 //拖拽模式,0或者1
,
content: $('#ads'),
success: function(layero) {
var btn = layero.find('.layui-layer-btn');
btn.find('.layui-layer-btn0').attr({
href: 'http://www.layui.com/'
, target: '_blank'
href: 'http://www.layui.com/',
target: '_blank'
});
}
, success: function () {
},
success: function() {
_this.adImpl()
localStorage.setItem('ad_popup', moment().format('YYYY-MM-DD'));
if (_this.autoClose) {
var int = setInterval(function () {
var int = setInterval(function() {
_this.timer--;
if (_this.timer == 0) {
clearInterval(int)
......@@ -267,108 +256,82 @@
}
}, 1000)
}
}
, end: function () {
},
end: function() {
$("#ads").hide()
}
});
}
}, (res) => {
console.log(res)
});
if (!this.user.isLogin) {
return;
}
API.getVote({user: this.user.id, username: this.user.username}).then((res) => {
API.getVote({
user: this.user.id,
username: this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
this.voteObj = res.data.data
this.voteObj.options = JSON.parse(this.voteObj.options)
if (this.isMobile) {
setTimeout(function () {
setTimeout(function() {
//单个使用
//全局使用。即所有弹出层都默认采用,但是单个配置skin的优先级更高
// layer.config({
// skin: 'demo-class'
// })
layer.open({
type: 1
,
title: ''
,
type: 1,
title: '',
offset: 'b' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
,
area: ['100%', 'auto']
,
closeBtn: 0
,
,
area: ['100%', 'auto'],
closeBtn: 0,
id: 'layerDemo'
// ,skin: 'demo-class'
,
content: '<div style="padding: 20px;margin-bottom: -20px; text-align: center">' + '是否参与问卷调查? <br><p class="voteFoot">参与调查可以改善您游戏体验与获得EXP!</p> ' + '</div>'
,
btn: ['投票Start!', '但是我拒绝!']
,
// ,skin: 'demo-class'
,
content: '<div style="padding: 20px;margin-bottom: -20px; text-align: center">' +
'是否参与问卷调查? <br><p class="voteFoot">参与调查可以改善您游戏体验与获得EXP!</p> ' + '</div>',
btn: ['投票Start!', '但是我拒绝!'],
btnAlign: 'c' //按钮居中
,
,
shade: 0 //不显示遮罩
,
yes: function () {
,
yes: function() {
layer.closeAll();
_this.dialogFormVisible = true;
}
,
btn2: function () {
},
btn2: function() {
console.log('拒绝!')
}
});
}, 1000)
} else {
setTimeout(function () {
setTimeout(function() {
//单个使用
//全局使用。即所有弹出层都默认采用,但是单个配置skin的优先级更高
// layer.config({
// skin: 'demo-class'
// })
layer.open({
type: 1
,
title: 'Hi, ' + _this.user.username
,
type: 1,
title: 'Hi, ' + _this.user.username,
offset: 'rb' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
// , area: ['100%', 'auto']
,
// , area: ['100%', 'auto']
,
id: 'layerDemo'
// ,skin: 'demo-class'
,
content: '<div style="padding: 20px;margin-bottom: -20px; text-align: center">' + '是否参与问卷调查? <br><p class="voteFoot">参与调查可以改善您游戏体验与获得EXP!</p> ' + '</div>'
,
btn: '好的'
,
// ,skin: 'demo-class'
,
content: '<div style="padding: 20px;margin-bottom: -20px; text-align: center">' +
'是否参与问卷调查? <br><p class="voteFoot">参与调查可以改善您游戏体验与获得EXP!</p> ' + '</div>',
btn: '好的',
btnAlign: 'c' //按钮居中
,
,
shade: 0 //不显示遮罩
,
yes: function () {
,
yes: function() {
layer.closeAll();
_this.dialogFormVisible = true;
}
......@@ -376,15 +339,10 @@
}, 1000)
}
}
}, (res) => {
console.log(res)
});
},
computed: {
...mapGetters({
lang: 'getLang',
......@@ -392,30 +350,22 @@
}),
},
methods: {
adClick: function () {
API.adClick({id: this.adObj.id}).then((res) => {
}, (res) => {
adClick: function() {
API.adClick({
id: this.adObj.id
}).then((res) => {}, (res) => {
console.log(res)
});
window.open(this.adObj.click_ref, "_blank");
},
adImpl: function () {
API.adImpl({id: this.adObj.id}).then((res) => {
}, (res) => {
adImpl: function() {
API.adImpl({
id: this.adObj.id
}).then((res) => {}, (res) => {
console.log(res)
});
},
submitVote: function () {
submitVote: function() {
var param = {
user: this.user.id,
username: this.user.username,
......@@ -424,7 +374,6 @@
opids: this.opids,
voteid: this.voteObj.id
}
if (this.voteObj.multiple) {
if (this.opids.length == 0) {
this.$notify({
......@@ -444,146 +393,147 @@
return;
}
}
this.dialogFormVisible = false
var _this = this
API.submitVote(param).then((res) => {
// this.$notify({
// title: '操作成功',
// message: '感谢您的参与, 环境会因为您而变得更好。此问卷为您奖励 EXP + 1 !',
// type: 'success'
// })
if (this.isMobile) {
layer.open({
type: 1
, title: ''
, offset: 'b' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
, area: ['100%', 'auto']
, closeBtn: 0
, id: 'layerDemo'
, time: 10000
, content: '<div style="padding: 20px ;">' + '感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!' + '</div>'
, btn: ['知道了', '参与下一个投票']
, btnAlign: 'c' //按钮居中
, shade: 0 //不显示遮罩
, yes: function () {
type: 1,
title: '',
offset: 'b' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
,
area: ['100%', 'auto'],
closeBtn: 0,
id: 'layerDemo',
time: 10000,
content: '<div style="padding: 20px ;">' + '感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!' + '</div>',
btn: ['知道了', '参与下一个投票'],
btnAlign: 'c' //按钮居中
,
shade: 0 //不显示遮罩
,
yes: function() {
layer.closeAll();
// _this.dialogFormVisible = true;
},
btn2: function (index, layero) {
btn2: function(index, layero) {
//按钮【按钮二】的回调
layer.closeAll();
//return false 开启该代码可禁止点击该按钮关闭
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
}
} else {}
}, (res) => {
console.log(res)
});
}
}, (res) => {
console.log(res)
});
}
}, (res) => {
console.log(res)
});
}
});
} else {
layer.open({
type: 1
, title: 'Hi, ' + _this.user.username
, offset: 'rb' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
, id: 'layerDemo'
, time: 10000
, content: '<div style="padding: 20px ;">' + '感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!' + '</div>'
, btn: ['知道了', '参与下一个投票']
, btnAlign: 'c' //按钮居中
, shade: 0 //不显示遮罩
, yes: function () {
type: 1,
title: 'Hi, ' + _this.user.username,
offset: 'rb' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
,
id: 'layerDemo',
time: 10000,
content: '<div style="padding: 20px ;">' + '感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!' + '</div>',
btn: ['知道了', '参与下一个投票'],
btnAlign: 'c' //按钮居中
,
shade: 0 //不显示遮罩
,
yes: function() {
layer.closeAll();
// _this.dialogFormVisible = true;
},
btn2: function (index, layero) {
btn2: function(index, layero) {
//按钮【按钮二】的回调
layer.closeAll();
//return false 开启该代码可禁止点击该按钮关闭
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({user: _this.user.id, username: _this.user.username}).then((res) => {
API.getVote({
user: _this.user.id,
username: _this.user.username
}).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
}
} else {}
}, (res) => {
console.log(res)
});
}
}, (res) => {
console.log(res)
});
}
}, (res) => {
console.log(res)
});
}
});
}
// localStorage.setItem('voteTime', moment().format('YYYY-MM-DD'));
}, (res) => {
console.log(res)
});
},
init: function () {
init: function() {
var token = querystring.parse(location.search.slice(1)).sso;
if (token) {
localStorage.setItem('token', token);
......@@ -594,7 +544,6 @@
this.render(token);
}
}
var lang = localStorage.getItem('lang');
if (lang === 'en') {
this.toEn()
......@@ -602,52 +551,48 @@
this.toCn()
}
},
render: function (token) {
render: function(token) {
var user = querystring.parse(new Buffer(token, 'base64').toString());
console.log(user)
this.$store.dispatch('login', user);
},
logout: function () {
logout: function() {
localStorage.removeItem('token');
this.$store.dispatch('logout', {});
// var redirectUrl = "http://localhost:8081/index.html";
var redirectUrl = "https://mycard.moe/ygopro/arena/index.html";
var request = querystring.stringify({
'redirect': redirectUrl
});
location.href = "https://ygobbs.com/logout?" + request;
},
login: function () {
login: function() {
var payload = new Buffer(querystring.stringify({
return_sso_url: location.href
})).toString('base64');
var request = querystring.stringify({
'sso': payload,
'sig': crypto.createHmac('sha256', 'zsZv6LXHDwwtUAGa').update(payload).digest('hex')
});
location.href = "https://ygobbs.com/session/sso_provider?" + request;
},
toCn: function () {
toCn: function() {
localStorage.setItem('lang', 'cn');
// this.lang = language['cn'];
// this.$dispatch('lang-change', 'cn')
this.curLang = 'cn'
this.$store.dispatch('getLang', this);
},
toEn: function () {
toEn: function() {
localStorage.setItem('lang', 'en');
// this.lang = language['en'];
// this.$dispatch('lang-change', 'en')
this.curLang = 'en'
this.$store.dispatch('getLang', this);
this.$emit('helloworld')
}
}
}
</script>
<style>
......@@ -671,4 +616,4 @@
body .demo-class .layui-layer-btn{border-top:1px solid #E9E7E7}
body .demo-class .layui-layer-btn a{background:#333;}
body .demo-class .layui-layer-btn .layui-layer-btn1{background:#999;}*/
</style>
</style>
\ No newline at end of file
<template>
<div>
<div class="content">
<div class="container">
<div>
<div class='winRateTitle'>
<div id="winRateTitle-1"> 这个表体现了环境主流之间胜率,显示的胜率为 <div class="winRateTitle-color-1">左边的卡组</div>
VS <div class="winRateTitle-color-2">上边的卡组</div>
</div>
<div id="winRateTitle-2">更新:在每个月<div class="winRateTitle-color-3">20日</div>之前,胜率为<div
class="winRateTitle-color-3">上月胜率</div>。在每个月<div class="winRateTitle-color-3">20日</div>
以及之后,胜率为<div class="winRateTitle-color-3">当月胜率</div>
</div>
</div>
<div class='winRateContent'>
<div class='winRateContent-Tabs'>
<el-tabs v-model='winRateButtonDefault' @tab-click="showClickWinRate">
<el-tab-pane :label=winRateButtonText[0] name='0'> </el-tab-pane>
<el-tab-pane :label=winRateButtonText[1] name='1'> </el-tab-pane>
<el-tab-pane :label=winRateButtonText[2] name='2'> </el-tab-pane>
</el-tabs>
</div>
<div class='winRateTable'>
<el-table :data="tableData" border style="width: 100%" :header-cell-style="hdMonitor"
:cell-style="csMonitor" @sort-change='sortChange'>
<el-table-column v-for="item in tableHead" :key="item.key" :label='item.label'
:property='item.prop' :sortable="item.sortable" :render-header="labelFunction">
<template slot-scope="scope">
<div>{{item.key== 0 ? scope.row[item.label]: scope.row[item.label]+'%'}}
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class='winRateFooter'>查看线上各卡组与单卡使用数据请进入<a class="winRateTitle-color-4"
href="#/cards">【卡片排行】</a></div>
</div>
</div>
</div>
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import API from '../api';
const winRateButtonText = ['先攻胜率', '后攻胜率', '综合胜率']
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {
tableChangeCount: 0,
winRateColumnTitle: [],
winRateButtonDefault: '0',
winRateButtonText,
tableFlag: 0, //0 先攻 1 后攻 2 总
queryJsonStr: [],
tableHead: [],
tableData: [],
totalWinRateData: [],
tableOrder: null,
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
labelFunction(h, l, fontSize) {
let index = l['$index']
let f = 15;
if (typeof(fontSize) != "undefined" && fontSize != null) {
f = fontSize;
}
//列頭的實際寬度
let width = l.column.realWidth;
let maxFontCount = Math.floor((width - 32) / f) - 1;
let chars = l.column.label.split("");
var label = "";
if (maxFontCount < chars.length && index != 0 && index != 11) {
for (let i = 0; i < maxFontCount; i++) {
label += chars[i];
}
label += "..";
} else {
label = l.column.label;
}
return label;
},
sortChange(para) {
this.tableOrder = para.order
},
toPoint(percent) {
percent = percent + ''
let str = percent.replace("%", "");
str = str * 1;
return str;
},
hdMonitor(cell) {
let tempCellCss = {}
tempCellCss["color"] = '#3AB6BA'
tempCellCss["border-color"] = 'black'
if (cell.rowIndex === 0 && cell.columnIndex != 0) {
{
tempCellCss["background-color"] = '#1a4861' //第一行
tempCellCss["border-bottom"] = '0px solid #111822'
if (cell.columnIndex == 11) {
tempCellCss["background-color"] = '#123345' //最后一格
tempCellCss["color"] = '#FFC850'
}
}
}
if (cell.rowIndex === 0 && cell.columnIndex == 0) {
tempCellCss["background-color"] = '#103346' //第一格
tempCellCss["border-bottom"] = '0px solid #111822'
tempCellCss["color"] = '#FFC850'
}
return tempCellCss
},
csMonitor(cell) {
let tempCellCss = {}
let tempCellWinRate = this.toPoint(cell.row[cell.column.property])
tempCellCss["color"] = '#50ffeb'
tempCellCss["border-color"] = '#1a4861'
if (cell.columnIndex != 0) { //表格内
tempCellCss["color"] = '#e2f2ff'
if (tempCellWinRate <= 30) {
tempCellCss["color"] = '#b9ff5c'
}
if (tempCellWinRate >= 70) {
tempCellCss["color"] = '#ff7945'
}
tempCellCss["border-bottom"] = '10px solid #111822'
tempCellCss["border-right"] = '1px solid #111822'
}
if (cell.rowIndex % 2 == 0) {
tempCellCss["background-color"] = '#1b2738'
} else {
tempCellCss["background-color"] = '#283044'
}
if (cell.columnIndex == 0) {
{
tempCellCss["background-color"] = '#1a4861' //第一列
tempCellCss["border-color"] = 'black'
tempCellCss["border-bottom"] = '10px solid #111822'
tempCellCss["font-weight"] = 'bold'
}
}
if (cell.columnIndex == 11) {
{
if (cell.rowIndex % 2 == 0) {
tempCellCss["background-color"] = '#1a4861'
} else {
tempCellCss["background-color"] = '#1a4861'
}
//最后一列
tempCellCss["color"] = '#e2f2ff'
if (tempCellWinRate >= 50) {
tempCellCss["color"] = '#FF0000'
} else {
tempCellCss["color"] = '#e2f2ff'
}
tempCellCss["font-weight"] = 'bold'
}
}
if (this.tableOrder == null) {
let tempLabel = cell.column.label
let tempContent = this.winRateColumnTitle[cell.rowIndex]
if (tempLabel == tempContent) {
{
if (this.tableFlag == '2') {
tempCellCss["color"] = '#39485C'
}
tempCellCss["background-color"] = '#141A21' //胜率50的斜线
}
}
}
return tempCellCss
},
showClickWinRate(tab, event) {
let curTabNo = parseInt(tab.name)
this.tableData = this.totalWinRateData[curTabNo]
this.tableFlag = curTabNo
},
handleColumn(jsonTxT) {
let tempColumnTitle = []
let tempObj = {
label: '卡组种类',
prop: '卡组种类',
key: 0
}
tempObj['sortable'] = false
tempColumnTitle.push(tempObj)
for (let index = 0; index < 10; index++) {
const element = jsonTxT[index].deckb;
let tempColumn = {
label: element,
prop: element,
key: index + 1
}
tempColumn['sortable'] = true
tempColumnTitle.push(tempColumn)
this.winRateColumnTitle.push(element)
}
tempObj = {
label: '均胜率',
prop: '均胜率',
key: 11
}
tempObj['sortable'] = true
tempColumnTitle.push(tempObj)
this.tableHead = tempColumnTitle
for (let x = 0; x < 3; x++) {
let tempRowList = []
for (let j = 0; j < 10; j++) {
let tempRow = {}
tempRow['卡组种类'] = tempColumnTitle[j + 1].label
let avgRowRateList = []
for (let i = 0; i < 10; i++) {
let secondStrikeJson = jsonTxT[10 * i + j]
let firstStrikeJson = jsonTxT[i + 10 * j]
let totalFsMatch = (firstStrikeJson.win + firstStrikeJson.lose + firstStrikeJson.draw)
let totalScMatch = (
secondStrikeJson.win + secondStrikeJson.lose + secondStrikeJson.draw)
let tempWinRate = []
let tempFirstStrikeWinRate = Math.round(firstStrikeJson.win / (totalFsMatch) * 1000) /
10
let tempSecondStrikeWinRate = Math.round(secondStrikeJson.lose / (totalScMatch) * 1000) /
10
let totalWinrate = Math.round((tempFirstStrikeWinRate + tempSecondStrikeWinRate) * 100) /
(2 * 100)
tempWinRate.push(tempFirstStrikeWinRate)
tempWinRate.push(tempSecondStrikeWinRate)
tempWinRate.push(totalWinrate)
tempRow[tempColumnTitle[i + 1].label] = tempWinRate[x]
avgRowRateList.push(tempWinRate[x])
}
tempRow['均胜率'] = (Math.round((avgRowRateList.reduce((prev, current, index, avgRowRateList) => {
return prev + current
}) / 10 * 100)) / 100)
tempRowList.push(tempRow)
}
tempRowList.push()
this.totalWinRateData.push(tempRowList)
}
this.tableData = this.totalWinRateData[0]
}
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {
API.getMonthlyWinRate().then((res) => {
if (isNaN(res.data)) {
this.queryJsonStr = res.data
this.handleColumn(res.data)
} else {}
});
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
<style>
#winRateTitle-1 {
color: #bbcddb;
}
#winRateTitle-2 {
color: #95d144;
}
.winRateTitle-color-1 {
display: inline-block;
color: #50ffeb;
}
.winRateTitle-color-2 {
display: inline-block;
color: #3AB6BA;
}
.winRateTitle-color-3 {
display: inline-block;
color: #FFC850;
}
.winRateTitle {
float: right;
display: block;
}
.winRateContent {
clear: both;
}
.winRateContent-Tabs .el-tabs__item {
color: white;
font-size: 18px;
}
.winRateContent-Tabs .el-tabs__item.is-active {
color: #409eff;
}
.winRateContent-Tabs .el-tabs__item:hover {
color: #409eff;
}
.winRateContent-Tabs .el-tabs__active-bar {
background: #409eff;
}
.el-table,
.el-table__expanded-cell {
background-color: black !important;
}
.el-table--border,
.el-table--group,
.el-table::before {
border-color: black !important;
}
.el-table--border::after,
.el-table--group::after,
.el-table::before {
content: "";
position: absolute;
background-color: black !important;
z-index: 1;
}
.winRateTable {
margin-bottom: 20px;
margin-left: 20px;
margin-right: 20px;
}
.winRateFooter {
text-align: center;
margin-bottom: 20px;
}
.winRateTitle-color-4 {
color: #409eff;
}
</style>
\ No newline at end of file
......@@ -42,7 +42,7 @@ module.exports = {
athleticDueHistory: '竞技场决斗记录',
entertainDueHistory: '娱乐场决斗记录',
tagInfo:'绿色表示获胜方,红色则表示掉线。',
rates:'卡组胜率',
exp_rank: 'EXP 排名',
athletic_rank: 'D.P 排名',
......@@ -52,7 +52,7 @@ module.exports = {
all: '总场',
ratio: '胜率',
violation: '违规次数',
shop:"Merch",
shop:"游戏周边",
userRank: {
expRank: 'EXP排名',
pointRank: '竞技场排名',
......@@ -153,7 +153,7 @@ module.exports = {
athleticDueHistory: 'Athletic Due History',
entertainDueHistory: 'Entertain Due History',
tagInfo:'Green tag represents the winner.Red tag represents player lost connection.',
rates:'Win Rate Chart',
exp_rank: 'EXP Rank',
athletic_rank: 'D.P Rank',
win: 'Win',
......
......@@ -6,7 +6,7 @@ import router from './router'
import VueX from 'vuex'
import store from './store'
import Element from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import 'element-ui/lib/theme-chalk/index.css'
import VueClipboard from 'vue-clipboard2'
......
......@@ -3,6 +3,7 @@ import Router from 'vue-router'
import Home from '@/components/Home'
import Index from '@/components/Index'
import Cards from '@/components/Cards'
import Rates from '@/components/Rates'
import Ranking from '@/components/Ranking'
import Download from '@/components/Download'
import Profile from '@/components/Profile'
......@@ -43,6 +44,11 @@ export default new Router({
name: 'Cards',
component: Cards
},
{
path: '/rates',
name: 'Rates',
component: Rates
},
{
path: '/ranking',
name: 'Ranking',
......
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