Commit 0d3d02e4 authored by 甘瑞文's avatar 甘瑞文

调整百分比

parent 3e7d1838
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet"> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet">
<% } %> <% } %>
</head> </head>
<body> <body style="background: #303133">
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong> Please enable it to continue.</strong>
......
...@@ -67,9 +67,10 @@ export default { ...@@ -67,9 +67,10 @@ export default {
paintTypes, paintTypes,
submitting: false, submitting: false,
backgroundStyle: { backgroundStyle: {
background: `#FFF url(${this.img}) no-repeat`, // background: `#FFF url(${this.img}) no-repeat`,
backgroundSize: 'contain', // backgroundSize: 'contain',
backgroundPosition: 'center' // backgroundPositionX: 'center',
// backgroundPositionY: 'top'
} }
}; };
}, },
...@@ -166,9 +167,14 @@ export default { ...@@ -166,9 +167,14 @@ export default {
} }
} }
.draw-board { .draw-board {
height: 100vh; width: 100%;
width: 100vw; /* background: #f5f5f5; */
background: #f5f5f5; position: absolute;
top: 0;
bottom: 0;
// height: 100vh;
// width: 100vw;
// background: #f5f5f5;
} }
.ans-commit { .ans-commit {
font-size: 40px; font-size: 40px;
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: beige;
p{ p{
font-size: 150px; font-size: 150px;
} }
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
<h1 v-if="step === 'counting'">{{countingText}}</h1> <h1 v-if="step === 'counting'">{{countingText}}</h1>
<el-button <el-button
v-if="step === 'racing'" v-if="step === 'racing'"
type="primary" :type="submitting ? 'default' : 'primary'"
@click="handleSubmit" @click="handleSubmit"
:class="submitting ? 'race' : 'race active'" :class="submitting ? 'race' : 'race active'"
:disabled="submitting"
> >
<i class="el-icon-thumb"></i> <i class="el-icon-thumb"></i>
</el-button> </el-button>
...@@ -61,8 +62,8 @@ export default { ...@@ -61,8 +62,8 @@ export default {
} }
}, },
(data) => { (data) => {
this.submitting = false this.submitting = true
this.step = 'submitted' // this.step = 'submitted'
console.log('回执', data); console.log('回执', data);
}); });
}, },
......
<template> <template>
<div class="board-container"> <div class="board-container" :style="styles">
<quick-response :eventId="eventId" :img="img" v-if="this.currentComponment === 'quick-response'"/> <quick-response :eventId="eventId" :img="img" v-if="this.currentComponment === 'quick-response'"/>
<locker :eventId="eventId" v-if="this.currentComponment === 'locker'"/> <locker :eventId="eventId" v-if="this.currentComponment === 'locker'"/>
<select-question :eventId="eventId" :img="img" v-if="this.currentComponment === 'select-question'"/> <select-question :eventId="eventId" :img="img" v-if="this.currentComponment === 'select-question'"/>
...@@ -25,7 +25,18 @@ export default { ...@@ -25,7 +25,18 @@ export default {
DrawingBoard DrawingBoard
}, },
data() { data() {
let width = window.screen.availWidth;
console.log();
let height = width * 9 / 16;
if(height > window.screen.availHeight ){
height = window.screen.availHeight ;
width = height *16 / 9;
}
return { return {
styles: {
width: width +'px',
height: height +'px'
},
currentComponment: 'locker', currentComponment: 'locker',
eventId: '0', eventId: '0',
img: '' img: ''
...@@ -57,19 +68,21 @@ export default { ...@@ -57,19 +68,21 @@ export default {
}, },
onMsg(msg) { onMsg(msg) {
console.log('home onmsg: ', msg); console.log('home onmsg: ', msg);
if (!msg || !msg.from || msg.from.indexOf('teacher') < 0 || !msg.payload) { if (!msg || !msg.from || msg.from.indexOf('teacher') < 0) {
return
}
if (!msg.payload.eventId || !msg.payload.type || msg.payload.type < 0) {
return return
} }
if (msg.type === 'finish') { if (msg.type === 'question-exit') {
this.currentComponment = 'locker' this.currentComponment = 'locker'
return return
} }
if (msg.type !== 'question') { if (msg.type !== 'question') {
return return
} }
if (!msg.payload || !msg.payload.eventId || !msg.payload.type || msg.payload.type < 0) {
return
}
this.eventId = msg.payload.eventId; this.eventId = msg.payload.eventId;
this.currentComponment = 'locker'; this.currentComponment = 'locker';
this.img = '' this.img = ''
...@@ -105,8 +118,8 @@ export default { ...@@ -105,8 +118,8 @@ export default {
.board-container { .board-container {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; // right: 0;
top: 0; top: 0;
bottom: 0; // bottom: 0;
} }
</style> </style>
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