优化
This commit is contained in:
		| @@ -42,12 +42,12 @@ | |||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|           <div class="play-status"> |           <div class="play-status"> | ||||||
|             <div class="live" v-if="isLiveing"> |             <div class="live"> | ||||||
|               <span class="label"></span> |               <span class="label" v-if="isLiveing"></span> | ||||||
|               <i>直播中</i> |               <i v-if="isLiveing">直播中</i> | ||||||
|               <em>{{ date }}</em> |               <em>{{ date }}</em> | ||||||
|             </div> |             </div> | ||||||
|             <div v-else class="back-btn" @click="backLiveing">回到直播</div> |             <div v-if="!isLiveing" class="back-btn" @click="backLiveing">回到直播</div> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|         <div class="right"> |         <div class="right"> | ||||||
| @@ -154,6 +154,7 @@ | |||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     mounted () { |     mounted () { | ||||||
|  |       this.date = this.$moment(new Date()).format('YYYY-MM-DD') | ||||||
|       this.form.date = this.$moment(new Date()).format('YYYY-MM-DD') |       this.form.date = this.$moment(new Date()).format('YYYY-MM-DD') | ||||||
|       this.$nextTick(() => { |       this.$nextTick(() => { | ||||||
|         this.width = document.querySelector(`#${this.videoId}`).offsetWidth + 'px' |         this.width = document.querySelector(`#${this.videoId}`).offsetWidth + 'px' | ||||||
| @@ -221,8 +222,8 @@ | |||||||
|         this.instance.post(`/app/appzyvideoequipment/getSlwPlaybackTime`, null, { |         this.instance.post(`/app/appzyvideoequipment/getSlwPlaybackTime`, null, { | ||||||
|           params: { |           params: { | ||||||
|             ids: this.id, |             ids: this.id, | ||||||
|             startTime: this.form.date + ' 00:00:00', |             startTime: this.date + ' 00:00:00', | ||||||
|             endTime: this.form.date + ' 23:59:59', |             endTime: this.date + ' 23:59:59', | ||||||
|           } |           } | ||||||
|         }).then(res => { |         }).then(res => { | ||||||
|           if (res.code == 0) { |           if (res.code == 0) { | ||||||
| @@ -230,8 +231,8 @@ | |||||||
|               const times = res.data[0].times |               const times = res.data[0].times | ||||||
|  |  | ||||||
|               this.times = times.map(item => { |               this.times = times.map(item => { | ||||||
|                 const startTime = (item.startTime - new Date(this.form.date + ' 00:00:00').getTime()) / 1000 |                 const startTime = (item.startTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 | ||||||
|                 const endTime = (item.endTime - new Date(this.form.date + ' 00:00:00').getTime()) / 1000 |                 const endTime = (item.endTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 | ||||||
|  |  | ||||||
|                 return { |                 return { | ||||||
|                   startTime: Number(startTime.toFixed(0)), |                   startTime: Number(startTime.toFixed(0)), | ||||||
| @@ -467,6 +468,7 @@ | |||||||
|           .live { |           .live { | ||||||
|             display: flex; |             display: flex; | ||||||
|             align-items: center; |             align-items: center; | ||||||
|  |             line-height: 1; | ||||||
|             padding: 2px 5px; |             padding: 2px 5px; | ||||||
|             color: rgba(0,255,0,.8); |             color: rgba(0,255,0,.8); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -34,12 +34,12 @@ | |||||||
|             </div> |             </div> | ||||||
|           </div> --> |           </div> --> | ||||||
|           <div class="play-status"> |           <div class="play-status"> | ||||||
|             <div class="live" v-if="isLiveing"> |             <div class="live"> | ||||||
|               <span class="label"></span> |               <span class="label" v-if="isLiveing"></span> | ||||||
|               <i>直播中</i> |               <i v-if="isLiveing">直播中</i> | ||||||
|               <em>{{ date }}</em> |               <em>{{ date }}</em> | ||||||
|             </div> |             </div> | ||||||
|             <div v-else class="back-btn" @click="backLiveing">回到直播</div> |             <div v-if="!isLiveing" class="back-btn" @click="backLiveing">回到直播</div> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|         <div class="right"> |         <div class="right"> | ||||||
| @@ -295,8 +295,6 @@ | |||||||
|         const date = new Date() |         const date = new Date() | ||||||
|         const seconds = date.getHours() * 3600 + date.getMinutes() * 60 + date.getSeconds() |         const seconds = date.getHours() * 3600 + date.getMinutes() * 60 + date.getSeconds() | ||||||
|  |  | ||||||
|         console.log(this.canvasWidth) |  | ||||||
|  |  | ||||||
|         this.x = seconds / (24 * 60 * 60) * this.canvasWidth + 100 |         this.x = seconds / (24 * 60 * 60) * this.canvasWidth + 100 | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
| @@ -564,6 +562,7 @@ | |||||||
|           .live { |           .live { | ||||||
|             display: flex; |             display: flex; | ||||||
|             align-items: center; |             align-items: center; | ||||||
|  |             line-height: 1; | ||||||
|             padding: 2px 5px; |             padding: 2px 5px; | ||||||
|             color: rgba(0,255,0,.8); |             color: rgba(0,255,0,.8); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user