diff --git a/app.js b/app.js index 924af7230..3bc4d5864 100644 --- a/app.js +++ b/app.js @@ -33,8 +33,8 @@ let opts = { //app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts)); //app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts)); -app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); -//app.use('/callComponent',proxy('http://127.0.0.1:8012',opts)); +//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); +app.use('/callComponent',proxy('http://192.168.1.22:8012',opts)); //app.listen(3000); diff --git a/public/components/common/viewImage/viewImage.html b/public/components/common/viewImage/viewImage.html index 55019b13e..f7af62d13 100644 --- a/public/components/common/viewImage/viewImage.html +++ b/public/components/common/viewImage/viewImage.html @@ -1,4 +1,8 @@ -
- - +
+
+ + +
+
\ No newline at end of file diff --git a/public/components/common/viewImage/viewImage.js b/public/components/common/viewImage/viewImage.js index b51ff59e8..da8d812df 100644 --- a/public/components/common/viewImage/viewImage.js +++ b/public/components/common/viewImage/viewImage.js @@ -4,7 +4,7 @@ data: { viewImageInfo: { url: '', - showImage:false + showImage: false } }, _initMethod: function () { @@ -13,14 +13,52 @@ vc.on('viewImage', 'showImage', function (_param) { $that.viewImageInfo.url = _param.url; $that.viewImageInfo.showImage = true; + + $that._launchIntoFullscreen(); }); }, methods: { - - _closeImage:function(){ + + _closeImage: function () { + $that._exitFullscreen(); $that.viewImageInfo.showImage = false; - } + + }, + _launchIntoFullscreen: function () { + let full = document.getElementById("viewImage"); + console.log(full); + if (full.requestFullscreen) { + full.requestFullscreen(); + } + else if (full.mozRequestFullScreen) { + full.mozRequestFullScreen(); + } + else if (full.webkitRequestFullscreen) { + full.webkitRequestFullscreen(); + } + else if (full.msRequestFullscreen) { + full.msRequestFullscreen(); + } + }, + _exitFullscreen: function () { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } + }, } }); + + + document.addEventListener("fullscreenchange", function (e) { + if (document.fullscreenElement) { + console.log('进入全屏') + } else { + $that.viewImageInfo.showImage = false; + } + }) })(window.vc); \ No newline at end of file