depotMonitoring.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="wrap">
  3. <view class='title'>库点监控管理</view>
  4. <view class="dropdown">
  5. <view class="left">仓库名称</view>
  6. <view class="right" @click='show1=true'>
  7. <view>{{warehouseName}}</view>
  8. <u-icon name="arrow-right" color=""></u-icon>
  9. <u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
  10. :range="warehouseList"></u-picker>
  11. </view>
  12. </view>
  13. <view class="content no-content" v-if="warehouseName!='山东诸城迈饶库'">暂无视频</view>
  14. <view class="content" v-if="warehouseName=='山东诸城迈饶库'">
  15. <view class='title'>监控视频</view>
  16. <view class="video-list">
  17. <view class="video-list-item" v-for="(item,index) in videoList" :key="index">
  18. <view class="img-content" v-show="!item.isPlay">
  19. <image class="img play" src="../../static/img/play-btn.png" mode="" @click="playVideo(item)"></image>
  20. </view>
  21. <iframe class='video-iframe' v-show="item.isPlay" :src="item.src" width="" height="" allowfullscreen="true"
  22. webkitallowfullscreen="true" mozallowfullscreen="true"
  23. allow="autoplay; fullscreen; microphone;"></iframe>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. mapState
  32. } from 'vuex';
  33. export default {
  34. components: {
  35. },
  36. data() {
  37. return {
  38. show1: false,
  39. warehouseName: '',
  40. warehouseList: [],
  41. monitorUrl2:'',
  42. videoList:[
  43. {
  44. src:'123',
  45. isPlay:false
  46. },
  47. {
  48. src:'123',
  49. isPlay:false
  50. },
  51. {
  52. src:'123',
  53. isPlay:false
  54. },
  55. {
  56. src:'123',
  57. isPlay:false
  58. },
  59. ]
  60. }
  61. },
  62. onLoad() {
  63. },
  64. // #ifndef MP
  65. onNavigationBarButtonTap(e) {
  66. const index = e.index;
  67. if (index === 0) {
  68. this.navTo('/pages/set/set');
  69. } else if (index === 1) {
  70. // #ifdef APP-PLUS
  71. const pages = getCurrentPages();
  72. const page = pages[pages.length - 1];
  73. const currentWebview = page.$getAppWebview();
  74. currentWebview.hideTitleNViewButtonRedDot({
  75. index
  76. });
  77. // #endif
  78. uni.navigateTo({
  79. url: '/pages/notice/notice'
  80. })
  81. }
  82. },
  83. // #endif
  84. computed: {
  85. ...mapState(['hasLogin', 'userInfo']),
  86. },
  87. onShow() {debugger
  88. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  89. console.log("checkSession", res)
  90. if (res.data.data == "INVALID") {
  91. uni.showModal({
  92. title: '登录提示',
  93. content: '当前登入信息验证失败,是否重新登录?',
  94. showCancel: true,
  95. confirmText: '登录',
  96. success: (e) => {
  97. if (e.confirm) {
  98. uni.navigateTo({
  99. url: '/pages/public/login'
  100. })
  101. }
  102. },
  103. fail: () => {},
  104. complete: () => {}
  105. })
  106. }
  107. })
  108. this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
  109. phone: this.userInfo.phone
  110. }).then(res => {
  111. if (res.data.code == 200) {
  112. debugger
  113. this.init(res.data.data[0].compId)
  114. }
  115. })
  116. console.log("hasLogin", this.hasLogin)
  117. },
  118. methods: {
  119. /**
  120. * 统一跳转接口,拦截未登录路由
  121. * navigator标签现在默认没有转场动画,所以用view
  122. */
  123. navTo(url) {
  124. if (!this.hasLogin) {
  125. url = '/pages/public/login';
  126. }
  127. uni.navigateTo({
  128. url
  129. })
  130. },
  131. init(compId) {
  132. console.log(this.userInfo)
  133. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  134. compId: compId,
  135. }).then(res => {
  136. if (res.data.data.length != 0) {
  137. console.log('res', res.data.data)
  138. this.warehouseName = res.data.data[0].warehouseName
  139. // let _showData = uni.getStorageSync("erpSelectWarehous")
  140. // let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
  141. // this.allWarehouse = res.data.data
  142. this.warehouseList = res.data.data;
  143. // if (_showData) {
  144. // this.warehouseName = _showData.warehouseName
  145. // this.compId = _showData.compId
  146. // this.agent = _showData.agent
  147. // this.binNumber = _showCWData.binNumber
  148. // this.warehouseCWList = _showData.positionInfos
  149. // this.warehouseId = _showData.id
  150. // this.baseId = _showCWData.baseId
  151. // this.positionId = _showCWData.id
  152. // this.personCharge = _showData.personCharge
  153. // } else {
  154. // this.allWarehouse = res.data.data
  155. // this.warehouseName = res.data.data[0].warehouseName
  156. // this.warehouseList = res.data.data;
  157. // this.compId = res.data.data[0].compId
  158. // this.agent = res.data.data[0].agent
  159. // this.binNumber = res.data.data[0].positionInfos[0].binNumber
  160. // this.warehouseCWList = res.data.data[0].positionInfos
  161. // this.warehouseId = res.data.data[0].id
  162. // this.baseId = res.data.data[0].positionInfos[0].baseId
  163. // this.positionId = res.data.data[0].positionInfos[0].id
  164. // this.personCharge = res.data.data[0].personCharge
  165. // }
  166. } else {
  167. this.warehouseList = []
  168. this.warehouseCWList = []
  169. this.warehouseName = '暂无仓库'
  170. this.binNumber = '暂无'
  171. }
  172. })
  173. },
  174. warehousechange(e) {
  175. this.warehouseName = this.warehouseList[e[0]].warehouseName
  176. console.log(this.warehouseName)
  177. },
  178. playVideo(item){
  179. console.log(item)
  180. item.isPlay = true
  181. }
  182. }
  183. }
  184. </script>
  185. <style lang='scss' scoped>
  186. page {
  187. background: #F5F6FA;
  188. }
  189. .wrap {
  190. background: #fff;
  191. margin: 10px;
  192. border-radius: 10px;
  193. padding: 10px;
  194. .title {
  195. font-size: 16px;
  196. font-weight: 700;
  197. }
  198. .dropdown {
  199. display: flex;
  200. margin: 20rpx 0;
  201. justify-content: space-between;
  202. /* border-bottom: 1px solid #EEEEEE; */
  203. padding-bottom: 20rpx;
  204. .left,
  205. .right {
  206. display: flex;
  207. align-items: center;
  208. }
  209. }
  210. }
  211. .video-list{
  212. position: relative;
  213. .video-list-item{
  214. position: relative;
  215. height: 400rpx;
  216. margin: 20rpx 0;
  217. .img-content{
  218. position: relative;
  219. width: 100%;
  220. height: 400rpx;
  221. background: green;
  222. .play{
  223. position: absolute;
  224. width: 100rpx;
  225. height: 100rpx;
  226. top: 0;
  227. bottom: 0;
  228. left: 0;
  229. right: 0;
  230. margin: auto;
  231. z-index: 3;
  232. }
  233. }
  234. .img{
  235. }
  236. .video-iframe{
  237. position: absolute;
  238. width: 100%;
  239. height: 100%;
  240. z-index: 1;
  241. border: 0;
  242. }
  243. }
  244. }
  245. .no-content{
  246. text-align: center;
  247. }
  248. </style>