| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <script setup>
- import { onMounted, ref, defineProps, onUnmounted } from 'vue';
- import { message } from 'ant-design-vue';
- import 'ezuikit-flv/style.css'; // @since 2.0.1
- import EzuikitFlv from 'ezuikit-flv';
- import fetchApp from '@/axios/fetchApp.js';
- const dateType = ref(0);
- const player = ref(null);
- const props = defineProps(['pageinfo']);
- console.log('props.pageinfo', props.pageinfo);
- // top类型切换
- const selectType = type => {
- console.log(type);
- dateType.value = type;
- if (type == 2) {
- initPlayer();
- }
- };
- // 初始化直播
- const initPlayer = () => {
- if (!props.pageinfo.tenantList || !props.pageinfo.tenantList?.length || !props.pageinfo.tenantList[0].tenantId) return message.error('暂无监控资源!');
- try {
- fetchApp.get('/v2/api/screen/getCameraAddress?organizationId=' + props.pageinfo.tenantList[0].tenantId).then(res => {
- if (res.code == 200) {
- const videoUrl = res.data.data.url;
- if (!videoUrl) return message.error('暂无监控资源!');
- setTimeout(() => {
- player.value = new EzuikitFlv({
- url: videoUrl,
- id: 'video_content',
- decoder: '/decoder.js', // 自定义解码库加载地址, 默认放置在服务器根目录下
- autoPlay: true
- });
- }, 500);
- }
- });
- } catch (error) {
- console.log('error', error);
- message.error('暂无监控资源!');
- }
- };
- onUnmounted(() => {
- if (player.value) {
- player.value.destroy();
- }
- });
- </script>
- <template>
- <div class="the-box9">
- <div class="change-num">
- <div class="change-num-item" :class="{ isActive: dateType === 0 }" @click="selectType(0)">
- <img v-if="dateType === 0" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
- <img v-if="dateType === 0" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
- <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
- <div class="text">本周菜品</div>
- </div>
- <div class="change-num-item" :class="{ isActive: dateType === 1 }" @click="selectType(1)">
- <img v-if="dateType === 1" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
- <img v-if="dateType === 1" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
- <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
- <div class="text">本周活动</div>
- </div>
- <div class="change-num-item" :class="{ isActive: dateType === 2 }" @click="selectType(2)">
- <img v-if="dateType === 2" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
- <img v-if="dateType === 2" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
- <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
- <div class="text">监控视频</div>
- </div>
- </div>
- <div class="info_contenbox">
- <div class="activebox" v-if="dateType == 0">
- <div class="scollrcontent" v-if="pageinfo.weekDishes">
- <div class="list_dishe" v-for="(item, index) in pageinfo.weekDishes" :key="index">
- <p class="week_name">{{ item[0] }}</p>
- <p class="valuetext" v-html="item[1]"></p>
- <p class="valuetext" v-html="item[2]"></p>
- <p class="valuetext" v-html="item[3]"></p>
- </div>
- </div>
- </div>
- <div class="activebox" v-if="dateType == 1">
- <div class="headoinfo">
- <p class="time_name">上午</p>
- <p class="time_text1">08:00-09:00</p>
- <p class="time_text2"></p>
- <p class="time_name">下午</p>
- <p class="time_text1">16:00-17:00</p>
- <!-- <p class="time_text2">16:00-17:00</p> -->
- </div>
- <div class="scollrcontent">
- <div class="list_detial" v-for="(item, index) in pageinfo.weekActivity" :key="index">
- <p class="time_name">{{ item.weekday }}</p>
- <div class="time_text1">
- <p>{{ item.morning }}</p>
- </div>
- <div class="time_text1">
- <p>{{ item.afternoon }}</p>
- </div>
- </div>
- </div>
- </div>
- <div id="video_content" style="width: 430px !important; height: 280px !important; margin-left: -15px !important" v-if="dateType == 2"></div>
- <!-- <div class="video_content" v-if="dateType == 2">
- <video autoplay muted :src="pageinfo && pageinfo.monitoringVideo ? pageinfo.monitoringVideo : '../../../assets//img/index/video.mp4'"></video>
- </div> -->
- </div>
- </div>
- </template>
- <style scoped lang="scss">
- .the-box9 {
- box-sizing: border-box;
- padding: 17px 27px;
- height: 100%;
- .change-num {
- position: absolute;
- top: 5px;
- right: 0;
- display: flex;
- align-content: center;
- .change-num-item {
- width: 100px;
- white-space: nowrap;
- height: 27px;
- font-size: 0;
- margin-right: 6px;
- position: relative;
- &:hover {
- cursor: pointer;
- }
- .btn {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 10;
- }
- .icon {
- width: 25px;
- height: 25px;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 12px;
- margin: auto;
- z-index: 20;
- }
- .text {
- color: #d7e1e1;
- font-size: 14px;
- position: absolute;
- left: 36px;
- top: 0;
- bottom: 0;
- margin: auto;
- height: fit-content;
- z-index: 30;
- }
- }
- .isActive {
- .text {
- color: #00feff;
- }
- }
- }
- .info_contenbox {
- // border: 1px solid red;
- height: 330px;
- .activebox {
- width: 100%;
- height: 100%;
- .disheshead {
- display: flex;
- height: 30px;
- .head_text {
- width: 28%;
- display: block;
- color: #ffffff;
- font-size: 12px;
- text-align: center;
- white-space: nowrap;
- }
- .head_textnull {
- width: 10%;
- display: block;
- }
- }
- .headoinfo {
- width: 100%; // 473px
- height: 30px;
- // border: 1px solid red;
- display: flex;
- .time_name {
- width: 90px;
- text-align: right;
- font-size: 12px;
- color: #ffffff;
- // border: 1px solid red;
- }
- .time_text1 {
- width: 90px;
- color: #ffffff;
- font-size: 12px;
- white-space: nowrap;
- }
- .time_text2 {
- width: 90px;
- color: #ffffff;
- font-size: 12px;
- white-space: nowrap;
- }
- }
- .scollrcontent {
- width: 100%;
- height: 300px;
- overflow-y: scroll;
- .list_dishe {
- display: flex;
- width: 100%;
- .week_name {
- width: 10%;
- text-align: left;
- font-size: 12px;
- color: #ffffff;
- display: block;
- white-space: nowrap;
- }
- .valuetext {
- width: 29%;
- display: block;
- font-size: 12px;
- color: #ffffff;
- line-height: 1.3;
- text-align: center;
- }
- }
- .list_detial {
- display: flex;
- .time_name {
- width: 56px;
- text-align: left;
- font-size: 12px;
- color: #ffffff;
- // border: 1px solid red;
- }
- .time_text1 {
- width: 50%;
- p {
- color: #ffffff;
- font-size: 12px;
- text-align: center;
- }
- }
- .time_text2 {
- width: 90px;
- p {
- color: #ffffff;
- font-size: 12px;
- text-align: center;
- }
- }
- }
- }
- }
- .my-play {
- position: absolute;
- top: 50px;
- z-index: 10;
- left: 8px;
- color: white;
- }
- .video_content {
- width: 100%;
- height: 100%;
- img {
- width: 100%;
- height: 100%;
- }
- video {
- width: 100%;
- height: 100%;
- border-radius: 10px;
- }
- }
- }
- }
- /* 设置滚动条的样式 */
- .toady_activebox::-webkit-scrollbar,
- .scollrcontent::-webkit-scrollbar {
- width: 8px;
- height: 0px;
- }
- /* 滚动槽 */
- .toady_activebox::-webkit-scrollbar-track,
- .scollrcontent::-webkit-scrollbar-track {
- -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
- border-radius: 10px;
- }
- /* 滚动条滑块 */
- .toady_activebox::-webkit-scrollbar-thumb,
- .scollrcontent::-webkit-scrollbar-thumb {
- border-radius: 10px;
- background: rgba(0, 0, 0, 0.1);
- -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
- }
- .toady_activebox::-webkit-scrollbar-thumb:window-inactive,
- .scollrcontent::-webkit-scrollbar-thumb:window-inactive {
- background: rgba(0, 13, 94, 0.1);
- }
- </style>
|