笔记时间不一样

This commit is contained in:
zhaofang
2022-10-28 15:09:09 +08:00
parent 931dfcc7fb
commit 15feb57769
3 changed files with 12 additions and 11 deletions

View File

@@ -440,3 +440,10 @@ export function formatSecondToHour(second) {
h = h.toFixed(n);
return h;
}
// 秒换成时分秒
export function getHMS(time) {
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
return hour + ':' + min + ':' + sec
}

View File

@@ -184,7 +184,7 @@ import interactBar from '@/components/Portal/interactBar.vue';
import FileUpload from '@/components/NoteUpload/index.vue';
import AuthorImg from '@/components/Portal/authorImg.vue';
import { mapGetters } from 'vuex';
import {formatDate,formatDateShort} from '@/utils/tools.js';
import {formatDate,formatDateShort,getHMS} from '@/utils/tools.js';
import apiUser from "@/api/system/user.js";
export default {
components:{interactBar,FileUpload,AuthorImg},
@@ -193,6 +193,7 @@ export default {
},
data(){
return{
getHMS,
dialogVisibleBigImage:false, // 显示图片放大框 true-显示弹框false-隐藏弹框
currentImagePath:'',
userData:{},
@@ -540,14 +541,6 @@ export default {
})
},
// 根据秒数转换成对应的时分秒
getHMS(time) {
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
return hour + ':' + min + ':' + sec
},
handleSizeChange(val) {
this.paegSize = val;
this.pageIndex = 1;

View File

@@ -8,8 +8,7 @@
</div>
<div class="edit-content">
<div class="note-tit">
<h3 @click="toCoursePage()" :style="{cursor:editdata.type==1? 'pointer':''}"> {{ editdata.courseName }} </h3>
<div @click="toCoursePage()" v-if="editdata.playTime != ''" :style="{cursor:editdata.type==1? 'pointer':''}"><img :src="`${webBaseUrl}/images/coteplay.png`" alt="">8:40</div>
<div @click="toCoursePage()" v-if="editdata.playTime != ''" :style="{cursor:editdata.type==1? 'pointer':''}"><img :src="`${webBaseUrl}/images/coteplay.png`" alt="">{{getHMS(editdata.playTime)}}</div>
</div>
<div class="note-text" v-if="editdata.contentType != 3">
<!-- <input style="vertical-align:top;outline:none;" type="textarea" :rows="4" v-model="editdata.content"> -->
@@ -60,9 +59,11 @@
<script>
import apiNote from '@/api/phase2/note.js'
import {getHMS} from '@/utils/tools.js';
export default {
data () {
return {
getHMS,
imgContent:[],
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
isShowList:false,