depotMonitoring.vue 7.0 KB

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