Toast.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <script setup>
  2. import { onMounted, ref, defineProps, onUnmounted } from 'vue';
  3. import { message } from 'ant-design-vue';
  4. import 'ezuikit-flv/style.css'; // @since 2.0.1
  5. import EzuikitFlv from 'ezuikit-flv';
  6. import fetchApp from '@/axios/fetchApp.js';
  7. const dateType = ref(0);
  8. const player = ref(null);
  9. const props = defineProps(['pageinfo']);
  10. console.log('props.pageinfo', props.pageinfo);
  11. // top类型切换
  12. const selectType = type => {
  13. console.log(type);
  14. dateType.value = type;
  15. if (type == 2) {
  16. initPlayer();
  17. }
  18. };
  19. // 初始化直播
  20. const initPlayer = () => {
  21. if (!props.pageinfo.tenantList || !props.pageinfo.tenantList?.length || !props.pageinfo.tenantList[0].tenantId) return message.error('暂无监控资源!');
  22. try {
  23. fetchApp.get('/v2/api/screen/getCameraAddress?organizationId=' + props.pageinfo.tenantList[0].tenantId).then(res => {
  24. if (res.code == 200) {
  25. const videoUrl = res.data.data.url;
  26. if (!videoUrl) return message.error('暂无监控资源!');
  27. setTimeout(() => {
  28. player.value = new EzuikitFlv({
  29. url: videoUrl,
  30. id: 'video_content',
  31. decoder: '/decoder.js', // 自定义解码库加载地址, 默认放置在服务器根目录下
  32. autoPlay: true
  33. });
  34. }, 500);
  35. }
  36. });
  37. } catch (error) {
  38. console.log('error', error);
  39. message.error('暂无监控资源!');
  40. }
  41. };
  42. onUnmounted(() => {
  43. if (player.value) {
  44. player.value.destroy();
  45. }
  46. });
  47. </script>
  48. <template>
  49. <div class="the-box9">
  50. <div class="change-num">
  51. <div class="change-num-item" :class="{ isActive: dateType === 0 }" @click="selectType(0)">
  52. <img v-if="dateType === 0" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
  53. <img v-if="dateType === 0" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
  54. <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
  55. <div class="text">本周菜品</div>
  56. </div>
  57. <div class="change-num-item" :class="{ isActive: dateType === 1 }" @click="selectType(1)">
  58. <img v-if="dateType === 1" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
  59. <img v-if="dateType === 1" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
  60. <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
  61. <div class="text">本周活动</div>
  62. </div>
  63. <div class="change-num-item" :class="{ isActive: dateType === 2 }" @click="selectType(2)">
  64. <img v-if="dateType === 2" class="btn" src="@/assets/img/index/box8/button-bg.png" alt="" />
  65. <img v-if="dateType === 2" class="icon" src="@/assets/img/index/box8/button-icon-select.png" alt="" />
  66. <img v-else class="icon" src="@/assets/img/index/box8/button-icon.png" alt="" />
  67. <div class="text">监控视频</div>
  68. </div>
  69. </div>
  70. <div class="info_contenbox">
  71. <div class="activebox" v-if="dateType == 0">
  72. <div class="scollrcontent" v-if="pageinfo.weekDishes">
  73. <div class="list_dishe" v-for="(item, index) in pageinfo.weekDishes" :key="index">
  74. <p class="week_name">{{ item[0] }}</p>
  75. <p class="valuetext" v-html="item[1]"></p>
  76. <p class="valuetext" v-html="item[2]"></p>
  77. <p class="valuetext" v-html="item[3]"></p>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="activebox" v-if="dateType == 1">
  82. <div class="headoinfo">
  83. <p class="time_name">上午</p>
  84. <p class="time_text1">08:00-09:00</p>
  85. <p class="time_text2"></p>
  86. <p class="time_name">下午</p>
  87. <p class="time_text1">16:00-17:00</p>
  88. <!-- <p class="time_text2">16:00-17:00</p> -->
  89. </div>
  90. <div class="scollrcontent">
  91. <div class="list_detial" v-for="(item, index) in pageinfo.weekActivity" :key="index">
  92. <p class="time_name">{{ item.weekday }}</p>
  93. <div class="time_text1">
  94. <p>{{ item.morning }}</p>
  95. </div>
  96. <div class="time_text1">
  97. <p>{{ item.afternoon }}</p>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div id="video_content" style="width: 430px !important; height: 280px !important; margin-left: -15px !important" v-if="dateType == 2"></div>
  103. <!-- <div class="video_content" v-if="dateType == 2">
  104. <video autoplay muted :src="pageinfo && pageinfo.monitoringVideo ? pageinfo.monitoringVideo : '../../../assets//img/index/video.mp4'"></video>
  105. </div> -->
  106. </div>
  107. </div>
  108. </template>
  109. <style scoped lang="scss">
  110. .the-box9 {
  111. box-sizing: border-box;
  112. padding: 17px 27px;
  113. height: 100%;
  114. .change-num {
  115. position: absolute;
  116. top: 5px;
  117. right: 0;
  118. display: flex;
  119. align-content: center;
  120. .change-num-item {
  121. width: 100px;
  122. white-space: nowrap;
  123. height: 27px;
  124. font-size: 0;
  125. margin-right: 6px;
  126. position: relative;
  127. &:hover {
  128. cursor: pointer;
  129. }
  130. .btn {
  131. width: 100%;
  132. height: 100%;
  133. position: absolute;
  134. top: 0;
  135. left: 0;
  136. z-index: 10;
  137. }
  138. .icon {
  139. width: 25px;
  140. height: 25px;
  141. position: absolute;
  142. top: 0;
  143. bottom: 0;
  144. left: 12px;
  145. margin: auto;
  146. z-index: 20;
  147. }
  148. .text {
  149. color: #d7e1e1;
  150. font-size: 14px;
  151. position: absolute;
  152. left: 36px;
  153. top: 0;
  154. bottom: 0;
  155. margin: auto;
  156. height: fit-content;
  157. z-index: 30;
  158. }
  159. }
  160. .isActive {
  161. .text {
  162. color: #00feff;
  163. }
  164. }
  165. }
  166. .info_contenbox {
  167. // border: 1px solid red;
  168. height: 330px;
  169. .activebox {
  170. width: 100%;
  171. height: 100%;
  172. .disheshead {
  173. display: flex;
  174. height: 30px;
  175. .head_text {
  176. width: 28%;
  177. display: block;
  178. color: #ffffff;
  179. font-size: 12px;
  180. text-align: center;
  181. white-space: nowrap;
  182. }
  183. .head_textnull {
  184. width: 10%;
  185. display: block;
  186. }
  187. }
  188. .headoinfo {
  189. width: 100%; // 473px
  190. height: 30px;
  191. // border: 1px solid red;
  192. display: flex;
  193. .time_name {
  194. width: 90px;
  195. text-align: right;
  196. font-size: 12px;
  197. color: #ffffff;
  198. // border: 1px solid red;
  199. }
  200. .time_text1 {
  201. width: 90px;
  202. color: #ffffff;
  203. font-size: 12px;
  204. white-space: nowrap;
  205. }
  206. .time_text2 {
  207. width: 90px;
  208. color: #ffffff;
  209. font-size: 12px;
  210. white-space: nowrap;
  211. }
  212. }
  213. .scollrcontent {
  214. width: 100%;
  215. height: 300px;
  216. overflow-y: scroll;
  217. .list_dishe {
  218. display: flex;
  219. width: 100%;
  220. .week_name {
  221. width: 10%;
  222. text-align: left;
  223. font-size: 12px;
  224. color: #ffffff;
  225. display: block;
  226. white-space: nowrap;
  227. }
  228. .valuetext {
  229. width: 29%;
  230. display: block;
  231. font-size: 12px;
  232. color: #ffffff;
  233. line-height: 1.3;
  234. text-align: center;
  235. }
  236. }
  237. .list_detial {
  238. display: flex;
  239. .time_name {
  240. width: 56px;
  241. text-align: left;
  242. font-size: 12px;
  243. color: #ffffff;
  244. // border: 1px solid red;
  245. }
  246. .time_text1 {
  247. width: 50%;
  248. p {
  249. color: #ffffff;
  250. font-size: 12px;
  251. text-align: center;
  252. }
  253. }
  254. .time_text2 {
  255. width: 90px;
  256. p {
  257. color: #ffffff;
  258. font-size: 12px;
  259. text-align: center;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. .my-play {
  266. position: absolute;
  267. top: 50px;
  268. z-index: 10;
  269. left: 8px;
  270. color: white;
  271. }
  272. .video_content {
  273. width: 100%;
  274. height: 100%;
  275. img {
  276. width: 100%;
  277. height: 100%;
  278. }
  279. video {
  280. width: 100%;
  281. height: 100%;
  282. border-radius: 10px;
  283. }
  284. }
  285. }
  286. }
  287. /* 设置滚动条的样式 */
  288. .toady_activebox::-webkit-scrollbar,
  289. .scollrcontent::-webkit-scrollbar {
  290. width: 8px;
  291. height: 0px;
  292. }
  293. /* 滚动槽 */
  294. .toady_activebox::-webkit-scrollbar-track,
  295. .scollrcontent::-webkit-scrollbar-track {
  296. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
  297. border-radius: 10px;
  298. }
  299. /* 滚动条滑块 */
  300. .toady_activebox::-webkit-scrollbar-thumb,
  301. .scollrcontent::-webkit-scrollbar-thumb {
  302. border-radius: 10px;
  303. background: rgba(0, 0, 0, 0.1);
  304. -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
  305. }
  306. .toady_activebox::-webkit-scrollbar-thumb:window-inactive,
  307. .scollrcontent::-webkit-scrollbar-thumb:window-inactive {
  308. background: rgba(0, 13, 94, 0.1);
  309. }
  310. </style>