Commit 4e089566 authored by ganjingcun's avatar ganjingcun

deck print

parent e2fc3180
<template> <template>
<div id="app"> <div>
<page-header></page-header>
<router-view></router-view> <router-view></router-view>
<page-footer></page-footer>
</div> </div>
</template> </template>
......
<template>
<div class="content">
<div class="container">
<template>
<el-alert title="上传ydk文件和填写必要的信息之后,卡组表格即可自动生成" type="success">
</el-alert>
</template>
<hr>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="form.name" placeholder="请输入标题姓名" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="Event" :label-width="formLabelWidth">
<el-input v-model="form.event" placeholder="请输入Event" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="ydk文件" :label-width="formLabelWidth">
<el-upload class="upload-demo" :action="uploadUrl" :on-change="handleChange" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
:file-list="fileList3">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">上传卡组文件,大小不能超过3KB</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">确认</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import querystring from 'querystring';
import crypto from 'crypto';
import API from '../api'
import { mapGetters } from 'vuex'
import moment from 'moment'
import tb_language from './tb_lang.js'
export default {
data() {
return {
fileList3: [],
form: {
name: '',
event: '',
},
formLabelWidth: '80px',
isNew: true,
isClick: false,
todayCount: 0,
uploadUrl: API.uploadUrl,
imageUrl: "",
downloadPath: "",
demo_title: "",
demo_url: "",
demo1: [],
demo2: []
}
},
created: function () {
setTimeout(function () {
$(".el-upload__input").hide()
}, 100)
},
computed: {
...mapGetters({
lang: 'getLang',
user: 'getUser'
}),
},
methods: {
handleChange(file, fileList) {
this.fileList3 = fileList.slice(-1);
},
handleAvatarSuccess(res, file) {
this.downloadPath = file.response.path
this.imageUrl = URL.createObjectURL(file.raw);
},
beforeAvatarUpload(file) {
var type = /\.[^\.]+/.exec(file.name);
const isJPG = type[0] === '.ydk';
const isLt2M = file.size / 1024 < 3;
if (!isJPG) {
this.$message.error('上传文件只能是 ydk 格式!');
return false
}
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 3KB!');
return false
}
return true;
},
download: function () {
window.location.href = API.getDownloadUrl(this.downloadPath)
},
onSubmit: function () {
if (!this.form.name || !this.form.name.trim()) {
this.$notify({
title: '警告',
message: '请输入姓名!',
type: 'error'
})
return;
}
if (!this.form.event || !this.form.event.trim()) {
this.$notify({
title: '警告',
message: '请输入event!',
type: 'error'
})
return;
}
if (!this.downloadPath || !this.downloadPath.trim()) {
this.$notify({
title: '警告',
message: '请上传ydk文件!',
type: 'error'
})
return;
}
var opt = {
name: this.form.name,
event: this.form.event,
id: this.downloadPath.slice(7)
}
var request = querystring.stringify(opt);
// var baseUrl = "http://localhost:̃8081"
var baseUrl = "https://mycard.moe/ygopro/arena"
var url = `${baseUrl}/konami.html?${request}`;
window.open(url, "_blank");
},
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div id="app">
<page-header></page-header>
<router-view></router-view>
<page-footer></page-footer>
</div>
</template>
<script>
import PageHeader from './PageHeader'
import PageFooter from './PageFooter'
// import "./assets/css/Projects-Clean.css"
// import "./assets/css/Pretty-Search-Form.css"
//js
// window.jQuery = window.$ = require('jquery');
export default {
name: 'app',
components: {
PageHeader,
PageFooter
}
}
</script>
<style scoped>
#app {
/*font-family: 'Avenir', Helvetica, Arial, sans-serif;*/
/*-webkit-font-smoothing: antialiased;*/
/*-moz-osx-font-smoothing: grayscale;*/
/*color: #2c3e50;*/
/*margin-top: 60px;*/
}
</style>
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<li role="presentation"><a href="https://ygobbs.com/" target="_blank">{{lang.forum}} </a></li> <li role="presentation"><a href="https://ygobbs.com/" target="_blank">{{lang.forum}} </a></li>
<li role="presentation"><a href="#/ranking">{{lang.rank}} </a></li> <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="#/cards">{{lang.card_rank}} </a></li>
<li role="presentation"><a href="#/deckprint">{{lang.deckprint}} </a></li>
<li role="presentation"><a href="https://rep.ygobbs.com">{{lang.battlelog}} </a></li> <li role="presentation"><a href="https://rep.ygobbs.com">{{lang.battlelog}} </a></li>
<!--<li role="presentation"><a href="https://mycard.moe/ygopro/">{{lang.download}} </a></li>--> <!--<li role="presentation"><a href="https://mycard.moe/ygopro/">{{lang.download}} </a></li>-->
<li role="presentation"><a href="#/download">{{lang.download}} </a></li> <li role="presentation"><a href="#/download">{{lang.download}} </a></li>
......
...@@ -10,6 +10,7 @@ module.exports = { ...@@ -10,6 +10,7 @@ module.exports = {
download: '下载', download: '下载',
profile: '个人信息', profile: '个人信息',
account: '用户中心', account: '用户中心',
deckprint: '卡组打印',
signout: '退出', signout: '退出',
signin: '登录 | 注册', signin: '登录 | 注册',
qc: '查询条件', qc: '查询条件',
...@@ -117,6 +118,7 @@ module.exports = { ...@@ -117,6 +118,7 @@ module.exports = {
download: 'Download', download: 'Download',
profile: 'Profile', profile: 'Profile',
account: 'Account', account: 'Account',
deckprint: "Deck Print",
signout: 'Sign out', signout: 'Sign out',
signin: 'Sign in | Sign up', signin: 'Sign in | Sign up',
qc: 'Query conditions', qc: 'Query conditions',
......
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import Home from '@/components/Home'
import Index from '@/components/Index' import Index from '@/components/Index'
import Cards from '@/components/Cards' import Cards from '@/components/Cards'
import Ranking from '@/components/Ranking' import Ranking from '@/components/Ranking'
...@@ -12,6 +13,8 @@ import Deck from '@/components/Deck' ...@@ -12,6 +13,8 @@ import Deck from '@/components/Deck'
import Report from '@/components/Report' import Report from '@/components/Report'
import Vote from '@/components/Vote' import Vote from '@/components/Vote'
import Ads from '@/components/Ads' import Ads from '@/components/Ads'
import Deckprint from '@/components/Deckprint'
// import konami from '@/components/konami'
Vue.use(Router) Vue.use(Router)
...@@ -19,63 +22,89 @@ export default new Router({ ...@@ -19,63 +22,89 @@ export default new Router({
routes: [ routes: [
{ {
path: '/', path: '/',
name: 'Index', name: 'Home',
component: Index component: Home,
}, children: [
{ {
path: '/cards', path: '/',
name: 'Cards', component: Index
component: Cards }
}, ]
{
path: '/ranking',
name: 'Ranking',
component: Ranking
},
{
path: '/download',
name: 'Download',
component: Download
},
{
path: '/profile',
name: 'Profile',
component: Profile
},
{
path: '/userinfo',
name: 'Userinfo',
component: Userinfo
},
{
path: '/cardinfo',
name: 'Cardinfo',
component: Cardinfo
},
{
path: '/history',
name: 'History',
component: History
},
{
path: '/deck',
name: 'Deck',
component: Deck
},
{
path: '/report',
name: 'Report',
component: Report
},
{
path: '/vote',
name: 'Vote',
component: Vote
}, },
{ {
path: '/ads', path: '/home',
name: 'Ads', name: 'home',
component: Ads component: Home,
children: [
{
path: '/cards',
name: 'Cards',
component: Cards
},
{
path: '/ranking',
name: 'Ranking',
component: Ranking
},
{
path: '/download',
name: 'Download',
component: Download
},
{
path: '/profile',
name: 'Profile',
component: Profile
},
{
path: '/userinfo',
name: 'Userinfo',
component: Userinfo
},
{
path: '/cardinfo',
name: 'Cardinfo',
component: Cardinfo
},
{
path: '/deckprint',
name: 'Deckprint',
component: Deckprint
},
{
path: '/history',
name: 'History',
component: History
},
{
path: '/deck',
name: 'Deck',
component: Deck
},
{
path: '/report',
name: 'Report',
component: Report
},
{
path: '/vote',
name: 'Vote',
component: Vote
},
{
path: '/ads',
name: 'Ads',
component: Ads
},
]
}, },
// {
// path: '/konami',
// name: 'konami',
// component: konami
// },
] ]
}) })
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
</div> </div>
<div id="page-container"> <div id="page-container">
<div id="pf1" class="pf w0 h0" data-page-no="1"> <div id="pf1" class="pf w0 h0" data-page-no="1">
<div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="assets/deck/bg1.png" /> <div class="pc pc1 w0 h0">
<img class="bi x0 y0 w1 h1" alt="" src="assets/deck/bg1.png" />
<div class="c x1 y1 w2 h2"> <div class="c x1 y1 w2 h2">
<div class="t m0 x2 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Yu<span class="ls1">#<span class="ls2">Gi</span>#<span class="ls3">Oh!)Deck)Lis<span class="_ _0"></span>t)Form<span <div class="t m0 x2 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Yu<span class="ls1">#<span class="ls2">Gi</span>#<span class="ls3">Oh!)Deck)Lis<span class="_ _0"></span>t)Form<span
class="ls1">)<span class="_ _1"> </span>)</span> class="ls1">)<span class="_ _1"> </span>)</span>
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
<div class="t m0 x4 h6 y5 ff2 fs0 fc0 sc0 ls6 ws0">Event/<span class="ff3 ls5"></span><span class="ls1">:!</span></div> <div class="t m0 x4 h6 y5 ff2 fs0 fc0 sc0 ls6 ws0">Event/<span class="ff3 ls5"></span><span class="ls1">:!</span></div>
</div> </div>
<div class="c x8 y4 w7 h5"> <div class="c x8 y4 w7 h5">
<div class="t m0 x4 h4 y5 ff5 fs0 fc0 sc0 ls1 ws0">YOT SG 2017</div> <div class="t m0 x4 h4 y5 ff5 fs0 fc0 sc0 ls1 ws0">{{ deck.event }}</div>
</div> </div>
<div class="c x1 y1 w2 h2"> <div class="c x1 y1 w2 h2">
<div class="t m0 x0 h4 y6 ff2 fs0 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x0 h4 y6 ff2 fs0 fc0 sc0 ls1 ws0">!</div>
...@@ -291,185 +292,187 @@ ...@@ -291,185 +292,187 @@
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[9].name}}</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[9].name}}</div>
</div> </div>
<div class="c x3 y1f wd hd"> <div class="c x3 y1f wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[10].num}}</div>
</div> </div>
<div class="c x18 y1f we hd"> <div class="c x18 y1f we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[10].name}}</div>
</div> </div>
<div class="c x16 y1f w9 hd"> <div class="c x16 y1f w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[10].num}}</div>
</div> </div>
<div class="c x19 y1f wf hd"> <div class="c x19 y1f wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[10].name}}</div>
</div> </div>
<div class="c x17 y1f w10 hd"> <div class="c x17 y1f w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[10].num}}</div>
</div> </div>
<div class="c x1a y1f w11 hd"> <div class="c x1a y1f w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[10].name}}</div>
</div> </div>
<div class="c x3 y20 wd hd"> <div class="c x3 y20 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[11].num}}</div>
</div> </div>
<div class="c x18 y20 we hd"> <div class="c x18 y20 we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[11].name}}</div>
</div> </div>
<div class="c x16 y20 w9 hd"> <div class="c x16 y20 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[11].num}}</div>
</div> </div>
<div class="c x19 y20 wf hd"> <div class="c x19 y20 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[11].name}}</div>
</div> </div>
<div class="c x17 y20 w10 hd"> <div class="c x17 y20 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[11].num}}</div>
</div> </div>
<div class="c x1a y20 w11 hd"> <div class="c x1a y20 w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[11].name}}</div>
</div> </div>
<div class="c x3 y21 wd he"> <div class="c x3 y21 wd he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[12].num}}</div>
</div> </div>
<div class="c x18 y21 we he"> <div class="c x18 y21 we he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[12].name}}</div>
</div> </div>
<div class="c x16 y21 w9 he"> <div class="c x16 y21 w9 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[12].num}}</div>
</div> </div>
<div class="c x19 y21 wf he"> <div class="c x19 y21 wf he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[12].name}}</div>
</div> </div>
<div class="c x17 y21 w10 he"> <div class="c x17 y21 w10 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[12].num}}</div>
</div> </div>
<div class="c x1a y21 w11 he"> <div class="c x1a y21 w11 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[12].name}}</div>
</div> </div>
<div class="c x3 y22 wd hd"> <div class="c x3 y22 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[13].num}}</div>
</div> </div>
<div class="c x18 y22 we hd"> <div class="c x18 y22 we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[13].name}}</div>
</div> </div>
<div class="c x16 y22 w9 hd"> <div class="c x16 y22 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[13].num}}</div>
</div> </div>
<div class="c x19 y22 wf hd"> <div class="c x19 y22 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[13].name}}</div>
</div> </div>
<div class="c x17 y22 w10 hd"> <div class="c x17 y22 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[13].num}}</div>
</div> </div>
<div class="c x1a y22 w11 hd"> <div class="c x1a y22 w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[13].name}}</div>
</div> </div>
<div class="c x3 y23 wd hd"> <div class="c x3 y23 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[14].num}}</div>
</div> </div>
<div class="c x18 y23 we hd"> <div class="c x18 y23 we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[14].name}}</div>
</div> </div>
<div class="c x16 y23 w9 hd"> <div class="c x16 y23 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[14].num}}</div>
</div> </div>
<div class="c x19 y23 wf hd"> <div class="c x19 y23 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[14].name}}</div>
</div> </div>
<div class="c x17 y23 w10 hd"> <div class="c x17 y23 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[14].num}}</div>
</div> </div>
<div class="c x1a y23 w11 hd"> <div class="c x1a y23 w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[14].name}}</div>
</div> </div>
<div class="c x3 y24 wd he"> <div class="c x3 y24 wd he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[15].num}}</div>
</div> </div>
<div class="c x18 y24 we he"> <div class="c x18 y24 we he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[15].name}}</div>
</div> </div>
<div class="c x16 y24 w9 he"> <div class="c x16 y24 w9 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[15].num}}</div>
</div> </div>
<div class="c x19 y24 wf he"> <div class="c x19 y24 wf he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[15].name}}</div>
</div> </div>
<div class="c x17 y24 w10 he"> <div class="c x17 y24 w10 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[15].num}}</div>
</div> </div>
<div class="c x1a y24 w11 he"> <div class="c x1a y24 w11 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[15].name}}</div>
</div> </div>
<div class="c x3 y25 wd he"> <div class="c x3 y25 wd he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[16].num}}</div>
</div> </div>
<div class="c x18 y25 we he"> <div class="c x18 y25 we he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[16].name}}</div>
</div> </div>
<div class="c x16 y25 w9 he"> <div class="c x16 y25 w9 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[16].num}}</div>
</div> </div>
<div class="c x19 y25 wf he"> <div class="c x19 y25 wf he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[16].name}}</div>
</div> </div>
<div class="c x17 y25 w10 he"> <div class="c x17 y25 w10 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[16].num}}</div>
</div> </div>
<div class="c x1a y25 w11 he"> <div class="c x1a y25 w11 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[16].name}}</div>
</div> </div>
<div class="c x3 y26 wd hd"> <div class="c x3 y26 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[17].num}}</div>
</div> </div>
<div class="c x18 y26 we hd"> <div class="c x18 y26 we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[17].name}}</div>
</div> </div>
<div class="c x16 y26 w9 hd"> <div class="c x16 y26 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[17].num}}</div>
</div> </div>
<div class="c x19 y26 wf hd"> <div class="c x19 y26 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[17].name}}</div>
</div> </div>
<div class="c x17 y26 w10 hd"> <div class="c x17 y26 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[17].num}}</div>
</div> </div>
<div class="c x1a y26 w11 hd"> <div class="c x1a y26 w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[17].name}}</div>
</div> </div>
<div class="c x3 y27 wd hd"> <div class="c x3 y27 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[18].num}}</div>
</div> </div>
<div class="c x18 y27 we hd"> <div class="c x18 y27 we hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[18].name}}</div>
</div> </div>
<div class="c x16 y27 w9 hd"> <div class="c x16 y27 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[18].num}}</div>
</div> </div>
<div class="c x19 y27 wf hd"> <div class="c x19 y27 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[18].name}}</div>
</div> </div>
<div class="c x17 y27 w10 hd"> <div class="c x17 y27 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[18].num}}</div>
</div> </div>
<div class="c x1a y27 w11 hd"> <div class="c x1a y27 w11 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[18].name}}</div>
</div> </div>
<div class="c x3 y28 wd he"> <div class="c x3 y28 wd he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monster[19].num}}</div>
</div> </div>
<div class="c x18 y28 we he"> <div class="c x18 y28 we he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.monster[19].name}}</div>
</div> </div>
<div class="c x16 y28 w9 he"> <div class="c x16 y28 w9 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.spells[19].num}}</div>
</div> </div>
<div class="c x19 y28 wf he"> <div class="c x19 y28 wf he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.spells[19].name}}</div>
</div> </div>
<div class="c x17 y28 w10 he"> <div class="c x17 y28 w10 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.traps[19].num}}</div>
</div> </div>
<div class="c x1a y28 w11 he"> <div class="c x1a y28 w11 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.traps[19].name}}</div>
</div> </div>
<div class="c x3 y29 wd hd"> <div class="c x3 y29 wd hd">
<div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monsterTotal}}</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.monsterTotal}}</div>
</div> </div>
...@@ -526,7 +529,7 @@ ...@@ -526,7 +529,7 @@
<div class="c x19 y30 wf he"> <div class="c x19 y30 wf he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[0].name}}</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[0].name}}</div>
</div> </div>
<!--<div class="c x17 y30 w10 he"> <!--<div class="c x17 y30 w10 he">
<div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y17 ff2 fs2 fc0 sc0 ls1 ws0">!</div>
</div> </div>
...@@ -572,7 +575,7 @@ ...@@ -572,7 +575,7 @@
<div class="c x19 y32 wf hd"> <div class="c x19 y32 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[2].name}}</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[2].name}}</div>
</div> </div>
<!--<div class="c x17 y32 w17 hd"> <!--<div class="c x17 y32 w17 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div>
</div> </div>
...@@ -592,7 +595,7 @@ ...@@ -592,7 +595,7 @@
<div class="c x19 y33 wf hd"> <div class="c x19 y33 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[3].name}}</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.side[3].name}}</div>
</div> </div>
<div class="c x17 y33 w9 hd"> <div class="c x17 y33 w9 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">!</div>
</div> </div>
...@@ -803,13 +806,13 @@ ...@@ -803,13 +806,13 @@
<div class="t m0 x4 h13 y43 ff2 fs4 fc0 sc0 lsb ws0">Description:<span class="ls1">!</span></div> <div class="t m0 x4 h13 y43 ff2 fs4 fc0 sc0 lsb ws0">Description:<span class="ls1">!</span></div>
</div> </div>
<div class="c x3 y42 wd hd"> <div class="c x3 y42 wd hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.extraTotal}}</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.extraTotal}}</div>
</div> </div>
<div class="c x18 y42 w16 hd"> <div class="c x18 y42 w16 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 lsc ws0">&lt;&lt;&lt;!Total!Extra!Deck!<span class="ls1">!</span></div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 lsc ws0">&lt;&lt;&lt;!Total!Extra!Deck!<span class="ls1">!</span></div>
</div> </div>
<div class="c x16 y42 w10 hd"> <div class="c x16 y42 w10 hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 ls1 ws0">{{deck.sideTotal}}</div> <div class="t m0 x4 ha y14 ff3 fs2 fc0 sc0 ls1 ws0">{{deck.sideTotal}}</div>
</div> </div>
<div class="c x19 y42 wf hd"> <div class="c x19 y42 wf hd">
<div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 lsc ws0">&lt;&lt;&lt;!Total!Side!Deck<span class="ls1">!</span></div> <div class="t m0 x4 ha y14 ff2 fs2 fc0 sc0 lsc ws0">&lt;&lt;&lt;!Total!Side!Deck<span class="ls1">!</span></div>
...@@ -831,54 +834,54 @@ ...@@ -831,54 +834,54 @@
<!--card game id--> <!--card game id-->
<div class="c x1f y49 w1d h16"> <div class="c x1f y49 w1d h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">1</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x21 y49 w1d h16"> <div class="c x21 y49 w1d h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">2</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x22 y49 w1e h16"> <div class="c x22 y49 w1e h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">0</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c xa y49 w1d h16"> <div class="c xa y49 w1d h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">0</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c xb y49 w1d h16"> <div class="c xb y49 w1d h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">2</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c xc y49 w1e h16"> <div class="c xc y49 w1e h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">7</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x23 y49 w1e h16"> <div class="c x23 y49 w1e h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">0</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x24 y49 w1d h16"> <div class="c x24 y49 w1d h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">8</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c xe y49 w1e h16"> <div class="c xe y49 w1e h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">7</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c xf y49 w1e h16"> <div class="c xf y49 w1e h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">8</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<!--date--> <!--date-->
<div class="c x10 y4b w1f h18"> <div class="c x10 y4b w1f h18">
<div class="t m0 x20 h17 y4c ff7 fs5 fc0 sc0 ls1 ws0">1</div> <div class="t m0 x20 h17 y4c ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x25 y4d w1f h19"> <div class="c x25 y4d w1f h19">
<div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0">8</div> <div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x26 y4f w1f h16"> <div class="c x26 y4f w1f h16">
<div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0">0</div> <div class="t m0 x20 h17 y4a ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x27 y50 w1f h19"> <div class="c x27 y50 w1f h19">
<div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0">2</div> <div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x28 y4d w1f h19"> <div class="c x28 y4d w1f h19">
<div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0">1</div> <div class="t m0 x20 h17 y4e ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<div class="c x29 y4b w20 h18"> <div class="c x29 y4b w20 h18">
<div class="t m0 x20 h17 y4c ff7 fs5 fc0 sc0 ls1 ws0">8</div> <div class="t m0 x20 h17 y4c ff7 fs5 fc0 sc0 ls1 ws0"></div>
</div> </div>
<!--total--> <!--total-->
...@@ -902,72 +905,75 @@ ...@@ -902,72 +905,75 @@
<script src="https://unpkg.com/vue@2.1.10/dist/vue.js"></script> <script src="https://unpkg.com/vue@2.1.10/dist/vue.js"></script>
<script src="https://unpkg.com/vue-resource@1.2.0/dist/vue-resource.min.js"></script> <script src="https://unpkg.com/vue-resource@1.2.0/dist/vue-resource.min.js"></script>
<script src="https://unpkg.com/jquery@3.3.1/dist/jquery.js"></script>
<script> <script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
new Vue({ new Vue({
el: '#page-container', el: '#page-container',
created: function () { created: function () {
var id = getParameterByName('id');
this.deck.monsterTotal = this.deck.monster.reduce(function (a, b) { this.deck.name = getParameterByName('name');
let x = a.num; this.deck.event = getParameterByName('event');
let y = b.num; if (id) {
if (isNaN(a.num)) { var URL = "http://localhost:3000"
x = 0 // var URL = "https://mycard.moe/ygopro"
} var params = {
if (isNaN(b.num)) { page: this.page
y = 0
} }
return { num: x + y } Vue.http.get(URL + '/api/deckdata/' + id, { 'params': params }).then((res) => {
}).num;
this.deck.spellTotal = this.deck.spells.reduce(function (a, b) { this.deck.monster = res.data.deck.monster
let x = a.num; this.deck.spells = res.data.deck.spells
let y = b.num; this.deck.traps = res.data.deck.traps
if (isNaN(a.num)) { this.deck.extra = res.data.deck.extra
x = 0 this.deck.side = res.data.deck.monster
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.trapTotal = this.deck.traps.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.extraTotal = this.deck.extra.reduce(function (a, b) { var length = this.deck.monster.length
let x = a.num; if (length < 20) {
let y = b.num; for (var i = 0; i < 20 - length; i++) {
if (isNaN(a.num)) { this.deck.monster.push({ "name": "", "num": "" })
x = 0 }
} }
if (isNaN(b.num)) { length = this.deck.spells.length
y = 0 if (length < 20) {
} for (var i = 0; i < 20 - length; i++) {
return { num: x + y } this.deck.spells.push({ "name": "", "num": "" })
}).num; }
}
length = this.deck.traps.length
if (length < 20) {
for (var i = 0; i < 20 - length; i++) {
this.deck.traps.push({ "name": "", "num": "" })
}
}
length = this.deck.extra.length
if (length < 15) {
for (var i = 0; i < 15 - length; i++) {
this.deck.extra.push({ "name": "", "num": "" })
}
}
length = this.deck.side.length
if (length < 20) {
for (var i = 0; i < 15 - length; i++) {
this.deck.side.push({ "name": "", "num": "" })
}
}
this.deck.sideTotal = this.deck.side.reduce(function (a, b) { this.calTotal()
let x = a.num; }, (res) => {
let y = b.num; })
if (isNaN(a.num)) { } else {
x = 0 this.calTotal()
} }
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.mainTotal = parseInt(this.deck.monsterTotal) + parseInt(this.deck.spellTotal) + parseInt(this.deck.trapTotal)
}, },
watch: { watch: {
...@@ -978,7 +984,7 @@ ...@@ -978,7 +984,7 @@
data: function () { data: function () {
return { return {
deck: { deck: {
name: "Joe", name: "",
event: "", event: "",
gameID: "0500270878", gameID: "0500270878",
date: "", date: "",
...@@ -1092,7 +1098,69 @@ ...@@ -1092,7 +1098,69 @@
} }
}, },
methods: { methods: {
calTotal: function () {
this.deck.monsterTotal = this.deck.monster.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.spellTotal = this.deck.spells.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.trapTotal = this.deck.traps.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.extraTotal = this.deck.extra.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.sideTotal = this.deck.side.reduce(function (a, b) {
let x = a.num;
let y = b.num;
if (isNaN(a.num)) {
x = 0
}
if (isNaN(b.num)) {
y = 0
}
return { num: x + y }
}).num;
this.deck.mainTotal = parseInt(this.deck.monsterTotal) + parseInt(this.deck.spellTotal) + parseInt(this.deck.trapTotal)
}
} }
}) })
......
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