depotMonitoring.vue 7.2 KB

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