15fenzhong chuxian

This commit is contained in:
theluyuan 2020-12-03 18:09:13 +08:00
parent bee34c8a6f
commit 7c49b3439a

View File

@ -27,7 +27,7 @@
<div class="right" @click="bianji" v-if="info.livestatus == 0">
{{lan.$t('bianjixinxi')}}
</div>
<div class="right" @click="kaishi" v-if="info.livestatus == 0">
<div class="right" @click="kaishi" v-if="info.livestatus == 0 && timestart">
{{lan.$t('kaishizhibo')}}
</div>
</div>
@ -199,8 +199,10 @@
<script lang="ts">
import { livestart, share } from '@/api';
import router from '@/router';
import store from '@/store';
import { useI18n } from '@/utils/i18n';
import { defineComponent, onUpdated, ref, watch } from "vue";
import dayjs from 'dayjs';
import { computed, defineComponent, onUpdated, ref, watch } from "vue";
import { onBeforeRouteLeave } from 'vue-router';
export default defineComponent({
@ -267,6 +269,31 @@ export default defineComponent({
fxtc.value = true
}
// const liveinfo = ref(props.liveinfo)
const zid = computed(()=>store.state.userinfo.zoneValue)
const timestart = computed(()=>{
/* eslint-disable */
const utc = require('dayjs/plugin/utc') // dependent on utc plugin
/* eslint-disable */
const timezone = require('dayjs/plugin/timezone')
dayjs.extend(utc)
dayjs.extend(timezone)
const days: any = dayjs;
if(zid.value != ""){
const now = days().tz(zid.value).unix();
let dateline: string;
if(props.info){
dateline = props.info.dateline
const start = days(dateline).unix()
if(start - now < 15 * 60){
return true;
}else {
return false;
}
}
}
return false;
})
return {
bianji,
kaishi,
@ -277,6 +304,7 @@ export default defineComponent({
fxtc,
show,
modalNode: () => document.getElementsByClassName("modal-container")[0],
timestart
}
}
});