transmit.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view :class="[AppTheme]" class="transmit">
  3. <view class="pop">
  4. <view class="video_blck">
  5. <yfsVideo ref="yvideo" :src="videoSrc"></yfsVideo>
  6. </view>
  7. </view>
  8. <view :class="hasptz==1?'detail-desc':'detail-desc1'" v-if="content">
  9. <view class="d-header"><text>图文详情</text></view>
  10. <u-parse :content="content" :lazy-load="true" :show-with-animation="true">
  11. </u-parse>
  12. </view>
  13. <admyself :opshow="true"></admyself>
  14. </view>
  15. </template>
  16. <script>
  17. import Api from '@/api/broadcast/index.js';
  18. import yfsVideo from '@/components/yfs-video/yfs-video.vue';
  19. export default {
  20. data() {
  21. return {
  22. primary: this.$theme.primary,
  23. videoSrc: '',
  24. title: '',
  25. content: '',
  26. settingFile: getApp().globalData.siteinfo,
  27. hasptz:0
  28. };
  29. },
  30. components: {
  31. yfsVideo
  32. },
  33. onLoad(options) {
  34. let that = this;
  35. Api.getvideo({
  36. id: options.id
  37. }).then(res => {
  38. if (res.status == 200) {
  39. console.log(res.data)
  40. that.videoSrc = res.data.src;
  41. /* 处理富文本*/
  42. if (res.data.content) {
  43. that.content = res.data.content.replace(/\<img src="/gi,
  44. `<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
  45. }
  46. that.hasptz=res.data.hasptz;
  47. that.$refs.yvideo.playvideo(that.videoSrc,res.data.device_id,res.data.hasptz);
  48. uni.setNavigationBarTitle({
  49. title: res.data.title,
  50. success: () => {
  51. console.log("修改标题成功")
  52. },
  53. fail: () => {
  54. console.log("修改标题失败")
  55. },
  56. complete: () => {
  57. console.log("修改标题结束")
  58. },
  59. })
  60. that.title = res.data.title;
  61. } else {
  62. that.$api.msg(res.msg);
  63. setTimeout(() => {
  64. uni.navigateBack({})
  65. }, 1000)
  66. }
  67. });
  68. },
  69. methods: {
  70. },
  71. };
  72. </script>
  73. <style lang="scss">
  74. page {
  75. width: 100%;
  76. height: 100%;
  77. background-color: #FFFFFF;
  78. }
  79. /* 详情 */
  80. .detail-desc {
  81. background-color: #FFFFFF;
  82. margin-top: 450rpx;
  83. line-height: 40rpx;
  84. padding: 0 20rpx 50rpx 20rpx;
  85. box-sizing: border-box;
  86. .d-header {
  87. display: flex;
  88. justify-content: center;
  89. align-items: center;
  90. height: 80upx;
  91. font-size: $font-base + 2upx;
  92. position: relative;
  93. text {
  94. padding: 0 20upx;
  95. background: #fff;
  96. position: relative;
  97. z-index: 1;
  98. }
  99. &:after {
  100. position: absolute;
  101. left: 50%;
  102. top: 50%;
  103. transform: translateX(-50%);
  104. width: 300upx;
  105. height: 0;
  106. content: '';
  107. border-bottom: 1px solid #ccc;
  108. }
  109. }
  110. }
  111. .detail-desc1 {
  112. background-color: #FFFFFF;
  113. margin-top: 20rpx;
  114. line-height: 40rpx;
  115. padding: 0 20rpx 50rpx 20rpx;
  116. box-sizing: border-box;
  117. .d-header {
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. height: 80upx;
  122. font-size: $font-base + 2upx;
  123. position: relative;
  124. text {
  125. padding: 0 20upx;
  126. background: #fff;
  127. position: relative;
  128. z-index: 1;
  129. }
  130. &:after {
  131. position: absolute;
  132. left: 50%;
  133. top: 50%;
  134. transform: translateX(-50%);
  135. width: 300upx;
  136. height: 0;
  137. content: '';
  138. border-bottom: 1px solid #ccc;
  139. }
  140. }
  141. }
  142. .transmit {
  143. width: 100%;
  144. height: 100%;
  145. .pop {
  146. top: 0;
  147. left: 0;
  148. width: 100%;
  149. .video_blck {
  150. width: 100%;
  151. height: 100%;
  152. justify-content: cener;
  153. align-items: center;
  154. }
  155. }
  156. .left_img {
  157. position: absolute;
  158. top: 80rpx;
  159. left: 25rpx;
  160. z-index: 9;
  161. image {
  162. width: 25rpx;
  163. height: 30rpx;
  164. }
  165. }
  166. }
  167. </style>