| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="监控详情"></uni-nav-bar>
- <view class="" style="height:400px">
- <view id="myPlayer"></view>
- </view>
- <view class="btn-box">
- <view class="more" @touchstart="configCamera('move', 8)" @touchend="stopConfigCamera()">
- <image :src="moreSrc" mode="widthFix"></image>
- </view>
- <view class="direc">
- <view class="top" @touchstart="configCamera('move', 0)" @touchend="stopConfigCamera()">
- </view>
- <view class="bottom" @touchstart="configCamera('move', 1)" @touchend="stopConfigCamera()">
- </view>
- <view class="photo" @touchstart="configCamera('takephoto', '')" >
- </view>
- <view class="left" @touchstart="configCamera('move', 2)" @touchend="stopConfigCamera()">
- </view>
- <view class="right" @touchstart="configCamera('move', 6)" @touchend="stopConfigCamera()">
- </view>
- </view>
- <view class="less" @touchstart="configCamera('move', 9)" @touchend="stopConfigCamera()">
- <image :src="lessSrc" mode="widthFix"></image>
- </view>
- </view>
- </view>
- </template>
- <script>
- import EZUIKit from '../../static/js/ezuikit.js'
- export default {
- data() {
- return {
- device_id: '',
- accessToken: "",
- moreSrc: require('../../static/image/monitor/3.png'),
- lessSrc: require('../../static/image/monitor/2.png')
- }
- },
- onLoad(options) {
- this.device_id = options.device_id
- this.accessToken = options.accessToken
- console.log(options)
- this.getAddr()
- },
- methods: {
- getAddr() {
- setTimeout(() => {
- let url = `ezopen://open.ys7.com/${this.device_id}/1.hd.live`
- var player = new EZUIKit.EZUIPlayer({
- id: 'myPlayer',
- url: url,
- autoplay: true,
- accessToken: this.accessToken,
- decoderPath: 'static/js/',
- width: 600,
- height: 400,
- });
- player.play();
- }, 500)
- },
- clickLeft() {
- uni.navigateBack({
- delta: 1
- });
- },
- //上下左右和拍照
- configCamera(ctrl, movenum) {
- if (ctrl == "takephoto") {
- this.$myRequest({
- url: "/api/api_gateway?method=camera.camera_manage.camera_takephoto",
- data: {
- device_id: this.device_id,
- }
- }).then((res) => {
- console.log(111)
- // let data = JSON.parse(res.data.data);
- // if (data.code == 200) {
- // this.picUrl = data.data.picUrl;
- // this.takePhotoDialogVisible = true;
- // } else {
- // this.$message.error(data.msg);
- // }
- });
- } else {
- //上下左右、放大、缩小
- this.$myRequest({
- url: "/api/api_gateway?method=camera.camera_manage.ctrl_camera",
- data: {
- device_id: this.device_id,
- ctrl: ctrl,
- movenum: movenum,
- }
- }).then((res) => {
- console.log(222)
- // if (res.data.message == '') {
- // this.$message.success('指令下发成功')
- // // this.stopConfigCamera() //关闭方向
- // }
- });
- }
- },
- stopConfigCamera() {
- this.$myRequest({
- url: "/api/api_gateway?method=camera.camera_manage.ctrl_camera",
- data: this.qs.stringify({
- device_id: this.device_id,
- ctrl: "stop",
- }),
- });
- }
- }
- }
- </script>
- <style lang="scss">
- .btn-box {
- margin-top: 20px;
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- image {
- width: 200rpx;
- }
- align-items: center;
- .direc {
- width: 300rpx;
- height: 300rpx;
- background: url('../../static/image/monitor/1.png');
- background-size: 100% auto;
- }
- }
- </style>
|