Browse Source

ttf,audio

许静 6 years ago
parent
commit
dc10fefd6c
5 changed files with 25 additions and 11 deletions
  1. 1
    1
      config/index.js
  2. 1
    0
      src/App.vue
  3. 4
    0
      src/pages/font.css
  4. BIN
      src/pages/kangxi.ttf
  5. 19
    10
      src/pages/welcome.vue

+ 1
- 1
config/index.js View File

26
         },
26
         },
27
       },
27
       },
28
       '/api/ws': {
28
       '/api/ws': {
29
-        target: 'http://192.168.0.67:8081', 
29
+        target: 'http://192.168.0.67:8080', 
30
         changeOrigin: true,
30
         changeOrigin: true,
31
         ws: true,
31
         ws: true,
32
         pathRewrite: {
32
         pathRewrite: {

+ 1
- 0
src/App.vue View File

12
 </script>
12
 </script>
13
 
13
 
14
 <style>
14
 <style>
15
+ @import "./../src/pages/font.css";
15
 #app {
16
 #app {
16
   width: 100%;
17
   width: 100%;
17
   height: 100%;
18
   height: 100%;

+ 4
- 0
src/pages/font.css View File

1
+@font-face {
2
+  font-family: "康熙字典体";
3
+  src:url('./kangxi.ttf')format('opentype');
4
+ }

BIN
src/pages/kangxi.ttf View File


+ 19
- 10
src/pages/welcome.vue View File

17
              <span>{{user.words}}</span>
17
              <span>{{user.words}}</span>
18
             </li>
18
             </li>
19
           </ul>
19
           </ul>
20
-          <div v-if="audios.length > 0" :hidden="true">
20
+           </div>
21
+          <!-- <div v-if="audios.length > 0" :hidden="true">
21
             <div v-for="(audio, k) in audios" :key="k+'audio'">
22
             <div v-for="(audio, k) in audios" :key="k+'audio'">
22
               <audio v-if="audio.isShow" @ended="audioEnd(k)" autoplay>
23
               <audio v-if="audio.isShow" @ended="audioEnd(k)" autoplay>
23
                 <source :src="audio.url">
24
                 <source :src="audio.url">
24
               </audio>
25
               </audio>
25
             </div>
26
             </div>
27
+          </div> -->
28
+          <div >
29
+            <div v-for="(audio, k) in audios" :key="k+'audio'">
30
+              <audio  @ended="audioEnd(k)" autoplay>
31
+                <source :src="audio.url">
32
+              </audio>
33
+            </div>
26
           </div>
34
           </div>
27
         </div>
35
         </div>
28
-      </div>
29
     </div>
36
     </div>
30
     </div>
37
     </div>
31
       <x-maquee class="marquee" v-if="pageDetail !== null && (pageDetail.detail.noticeShow || pageDetail.detail.weatherShow)">
38
       <x-maquee class="marquee" v-if="pageDetail !== null && (pageDetail.detail.noticeShow || pageDetail.detail.weatherShow)">
141
 
148
 
142
     // window.console.log(this.$route.query.id, this.$route.query)
149
     // window.console.log(this.$route.query.id, this.$route.query)
143
 
150
 
144
-    const wsURI = `${window.location.origin.replace('http', 'ws')}/api/ws/${this.$route.query.id}`
145
-    this.ws.connect(wsURI)
151
+    // const wsURI = `${window.location.origin.replace('http', 'ws')}/api/ws/${this.$route.query.id}`
152
+    this.ws.connect('ws://192.168.0.67:8080/ws/screen/113')
146
     this.init()
153
     this.init()
147
     this.pageTimer = window.setInterval(() => {
154
     this.pageTimer = window.setInterval(() => {
148
       let curMin = new Date().getMinutes() - 0
155
       let curMin = new Date().getMinutes() - 0
158
     }, 1000)
165
     }, 1000)
159
   },
166
   },
160
   mounted () {
167
   mounted () {
161
-    console.log(this.users, 'this.users')
162
   },
168
   },
163
   updated () {
169
   updated () {
164
     this.$nextTick(() => {
170
     this.$nextTick(() => {
201
       if (!msg) {
207
       if (!msg) {
202
         return
208
         return
203
       }
209
       }
204
-
205
       const res = JSON.parse(e.data)
210
       const res = JSON.parse(e.data)
206
       if (res.type && res.type === 'cmd') {
211
       if (res.type && res.type === 'cmd') {
207
         // 如果这种类型的消息, 说明是行为控制
212
         // 如果这种类型的消息, 说明是行为控制
215
         }
220
         }
216
       } else {
221
       } else {
217
         this.newData({
222
         this.newData({
218
-          name: !res.person.name ? '' : res.person.name,
223
+          name: !res.person.words ? '' : res.person.words,
219
           classId: res.person.typeId,
224
           classId: res.person.typeId,
220
           words: res.taVisitingWords.words,
225
           words: res.taVisitingWords.words,
221
           url: res.audio
226
           url: res.audio
242
 
247
 
243
 <!-- Add "scoped" attribute to limit CSS to this component only -->
248
 <!-- Add "scoped" attribute to limit CSS to this component only -->
244
 <style lang="scss" scoped>
249
 <style lang="scss" scoped>
250
+ @import "./font.css";
245
 .welcomePage {
251
 .welcomePage {
246
   $mainfontcolor: #000;
252
   $mainfontcolor: #000;
247
   width: 100%;
253
   width: 100%;
251
   background: url('../assets/images/welcome/bg.jpg') no-repeat center ;
257
   background: url('../assets/images/welcome/bg.jpg') no-repeat center ;
252
   background-size: 100% 100%;
258
   background-size: 100% 100%;
253
    .fade-item {
259
    .fade-item {
254
-    transition: all 1s;
260
+    transition: all 0.5s;
255
     display: inline-block;
261
     display: inline-block;
256
   }
262
   }
257
   .fade-enter,
263
   .fade-enter,
279
         width: 100%;
285
         width: 100%;
280
         height: 100%;
286
         height: 100%;
281
         position: absolute;
287
         position: absolute;
282
-        top:88vh;
288
+        top:86vh;
283
         margin-left: 5vw;
289
         margin-left: 5vw;
284
         li{
290
         li{
291
+           font-family: "康熙字典体";
285
           span{
292
           span{
286
-            width: 60%;
293
+            width: 100%;
287
             font-size: 6vw;
294
             font-size: 6vw;
295
+            font-family: "康熙字典体";
288
             display: block;
296
             display: block;
289
             text-align: center;
297
             text-align: center;
298
+            line-height: 1.4;
290
           }
299
           }
291
         }
300
         }
292
     }
301
     }