From cb2e912aaeeb603bb9ed87a1c2fe55c81c1ff07d Mon Sep 17 00:00:00 2001 From: jennyliang220 Date: Fri, 13 Jul 2018 12:37:25 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E5=A4=9C?= =?UTF-8?q?=E9=97=B4=E6=A8=A1=E5=BC=8F=E9=97=AA=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html | 4 ++-- .../mip-shell-xiaoshuo/example/mipx-xiaoshuo-2.html | 4 ++-- .../mip-shell-xiaoshuo/example/mipx-xiaoshuo-3.html | 4 ++-- components/mip-shell-xiaoshuo/mip-shell-xiaoshuo.less | 8 ++++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html index 6a476437..71d6d206 100644 --- a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html +++ b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html @@ -383,7 +383,7 @@

第1章 灵魂重生

- - + + \ No newline at end of file diff --git a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-2.html b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-2.html index e59a3bdc..ec61f43f 100644 --- a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-2.html +++ b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-2.html @@ -428,7 +428,7 @@

第2章 灵魂重生

- - + + \ No newline at end of file diff --git a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-3.html b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-3.html index 44f1712d..58b9b712 100644 --- a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-3.html +++ b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-3.html @@ -427,7 +427,7 @@

第3章 牛刀小试

- - + + \ No newline at end of file diff --git a/components/mip-shell-xiaoshuo/mip-shell-xiaoshuo.less b/components/mip-shell-xiaoshuo/mip-shell-xiaoshuo.less index 15f56cf8..b0c6b473 100644 --- a/components/mip-shell-xiaoshuo/mip-shell-xiaoshuo.less +++ b/components/mip-shell-xiaoshuo/mip-shell-xiaoshuo.less @@ -364,8 +364,12 @@ html[mip-shell-xiaoshuo-theme="paper"] { html[mip-shell-xiaoshuo-theme="night"] { /*#mip-page-loading-wrapper shell加载中效果*/ - #mip-page-loading-wrapper { - background: black; + #mip-page-loading-wrapper, + .mip-page-fade-header-wrapper { + background: #191919!important; + .mip-shell-header { + background: #191919!important; + } } .mip-shell-header-wrapper{ .mip-shell-header { From 520b3ab53155e76a243f153df7b2ee08c14f170e Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Fri, 13 Jul 2018 13:20:46 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2UC=E8=A7=86?= =?UTF-8?q?=E9=A2=91=EF=BC=8C15=E7=A7=92=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/mipx-xiaoshuo-1.html | 220 ++++++++++-------- .../example/mipx-xiaoshuo-2.html | 220 ++++++++++-------- .../example/mipx-xiaoshuo-3.html | 220 ++++++++++-------- .../mip-novel-video/mip-novel-video.vue | 5 +- components/mip-novel-video/video-detector.js | 4 +- 5 files changed, 390 insertions(+), 279 deletions(-) diff --git a/components/mip-novel-video/example/mipx-xiaoshuo-1.html b/components/mip-novel-video/example/mipx-xiaoshuo-1.html index 16655af2..2fed0961 100644 --- a/components/mip-novel-video/example/mipx-xiaoshuo-1.html +++ b/components/mip-novel-video/example/mipx-xiaoshuo-1.html @@ -1,3 +1,4 @@ + @@ -17,51 +18,77 @@ } @font-face { font-family: xiaoshuo; + src: url(font/xiaoshuo.eot?t=1515560671046); src: url(font/xiaoshuo.eot?t=1515560671046#iefix) format("embedded-opentype"), url(font/xiaoshuo.woff) format("woff"), url(font/xiaoshuo.ttf?t=1515560671046) format("truetype"), url(font/xiaoshuo.svg?t=1515560671046#xiaoshuo) format("svg"); - } .icon-xiaoshuo { + } + + .icon-xiaoshuo { font-family: xiaoshuo!important; font-size: 16px; font-style: normal; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - } .icon-paihangbang:before { + } + + .icon-paihangbang:before { content: "\e663"; - } .icon-mianfei:before { + } + + .icon-mianfei:before { content: "\e665"; - } .icon-tuijian:before { + } + + .icon-tuijian:before { content: "\e668"; - } #header { + } + + #header { height: 44px; - padding-right: 17px; ; + padding-right: 17px;; padding-left: 17px; border-bottom: 1px solid #f1f1f1; line-height: 44px; - } #header .left, + } + + #header .left, #header .right { position: absolute; - z-index: 10; ; + z-index: 10;; top: 0; - } #header .left { + } + + #header .left { left: 17px; text-align: left; - } #header .right { + } + + #header .right { right: 17px; - } #header a { + } + + #header a { width: 22px; height: 44px; line-height: 44px; color: #333; - } #header h4 { + } + + #header h4 { margin: 0; padding: 0 50px; text-align: center; - } #footer { + } + + #footer { font-size: 12px; - line-height: 50px; ; + line-height: 50px;; text-align: center; color: #999; - } .text-box { + } + + .text-box { display: inline-block; overflow: hidden; box-sizing: content-box; @@ -75,35 +102,54 @@ vertical-align: middle; text-decoration: none; border-radius: 2px; - } .text-box.text-box-gray { - border: 1px solid #e3e3e3; ; + } + + .text-box.text-box-gray { + border: 1px solid #e3e3e3;; color: #999; - } .text-right { + } + + .text-right { text-align: right; - } .text-center { + } + + .text-center { text-align: center; - } ul { + } + + ul { list-style: none; - } .btn.btn-black, + } + + .btn.btn-black, button.btn-black { - padding-right: 0; ; + padding-right: 0;; padding-left: 0; border-color: #707379; text-align: center; color: #000; - } .color-gray { + } + + .color-gray { color: #555; - } a { + } + + a { -webkit-tap-highlight-color: rgba(0, 0, 0, .2); - } mip-scrollbox [data-wrapper] [data-inner], + } + + mip-scrollbox [data-wrapper] [data-inner], mip-scrollbox [data-wrapper] [data-item], mip-scrollbox [data-wrapper] [data-scroller] { position: relative; - } .scrollbox-more .scrollbox-more-wrap { + } + + .scrollbox-more .scrollbox-more-wrap { position: absolute; - width: 100%; ; + width: 100%;; height: 100%; } + .link { display: inline-block; margin: 10px 0; @@ -125,11 +171,11 @@ - 打开目录 - 打开设置 - 下一页 -
-

第1章 灵魂重生

+ 打开目录 + 打开设置 + 上一页 +
+

第3章 牛刀小试

“贱人,你竟敢背叛我!”

@@ -323,74 +369,64 @@

第1章 灵魂重生

陆宇眼神坚定,他是魂天师,就算是废武魂,他也一样能搅动天地,称雄万世!

- 下一页 + 上一页
小说网 © 2018 - 冀ICP备xxxx号
- - + - -© 2018 GitHub, Inc. -Terms -Privacy -Security -Status -Help -Contact GitHub -API -Training -Shop -Blog + \ No newline at end of file diff --git a/components/mip-novel-video/example/mipx-xiaoshuo-2.html b/components/mip-novel-video/example/mipx-xiaoshuo-2.html index 16655af2..2fed0961 100644 --- a/components/mip-novel-video/example/mipx-xiaoshuo-2.html +++ b/components/mip-novel-video/example/mipx-xiaoshuo-2.html @@ -1,3 +1,4 @@ + @@ -17,51 +18,77 @@ } @font-face { font-family: xiaoshuo; + src: url(font/xiaoshuo.eot?t=1515560671046); src: url(font/xiaoshuo.eot?t=1515560671046#iefix) format("embedded-opentype"), url(font/xiaoshuo.woff) format("woff"), url(font/xiaoshuo.ttf?t=1515560671046) format("truetype"), url(font/xiaoshuo.svg?t=1515560671046#xiaoshuo) format("svg"); - } .icon-xiaoshuo { + } + + .icon-xiaoshuo { font-family: xiaoshuo!important; font-size: 16px; font-style: normal; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - } .icon-paihangbang:before { + } + + .icon-paihangbang:before { content: "\e663"; - } .icon-mianfei:before { + } + + .icon-mianfei:before { content: "\e665"; - } .icon-tuijian:before { + } + + .icon-tuijian:before { content: "\e668"; - } #header { + } + + #header { height: 44px; - padding-right: 17px; ; + padding-right: 17px;; padding-left: 17px; border-bottom: 1px solid #f1f1f1; line-height: 44px; - } #header .left, + } + + #header .left, #header .right { position: absolute; - z-index: 10; ; + z-index: 10;; top: 0; - } #header .left { + } + + #header .left { left: 17px; text-align: left; - } #header .right { + } + + #header .right { right: 17px; - } #header a { + } + + #header a { width: 22px; height: 44px; line-height: 44px; color: #333; - } #header h4 { + } + + #header h4 { margin: 0; padding: 0 50px; text-align: center; - } #footer { + } + + #footer { font-size: 12px; - line-height: 50px; ; + line-height: 50px;; text-align: center; color: #999; - } .text-box { + } + + .text-box { display: inline-block; overflow: hidden; box-sizing: content-box; @@ -75,35 +102,54 @@ vertical-align: middle; text-decoration: none; border-radius: 2px; - } .text-box.text-box-gray { - border: 1px solid #e3e3e3; ; + } + + .text-box.text-box-gray { + border: 1px solid #e3e3e3;; color: #999; - } .text-right { + } + + .text-right { text-align: right; - } .text-center { + } + + .text-center { text-align: center; - } ul { + } + + ul { list-style: none; - } .btn.btn-black, + } + + .btn.btn-black, button.btn-black { - padding-right: 0; ; + padding-right: 0;; padding-left: 0; border-color: #707379; text-align: center; color: #000; - } .color-gray { + } + + .color-gray { color: #555; - } a { + } + + a { -webkit-tap-highlight-color: rgba(0, 0, 0, .2); - } mip-scrollbox [data-wrapper] [data-inner], + } + + mip-scrollbox [data-wrapper] [data-inner], mip-scrollbox [data-wrapper] [data-item], mip-scrollbox [data-wrapper] [data-scroller] { position: relative; - } .scrollbox-more .scrollbox-more-wrap { + } + + .scrollbox-more .scrollbox-more-wrap { position: absolute; - width: 100%; ; + width: 100%;; height: 100%; } + .link { display: inline-block; margin: 10px 0; @@ -125,11 +171,11 @@ - 打开目录 - 打开设置 - 下一页 -
-

第1章 灵魂重生

+ 打开目录 + 打开设置 + 上一页 +
+

第3章 牛刀小试

“贱人,你竟敢背叛我!”

@@ -323,74 +369,64 @@

第1章 灵魂重生

陆宇眼神坚定,他是魂天师,就算是废武魂,他也一样能搅动天地,称雄万世!

- 下一页 + 上一页
小说网 © 2018 - 冀ICP备xxxx号
- - + - -© 2018 GitHub, Inc. -Terms -Privacy -Security -Status -Help -Contact GitHub -API -Training -Shop -Blog + \ No newline at end of file diff --git a/components/mip-novel-video/example/mipx-xiaoshuo-3.html b/components/mip-novel-video/example/mipx-xiaoshuo-3.html index 16655af2..2fed0961 100644 --- a/components/mip-novel-video/example/mipx-xiaoshuo-3.html +++ b/components/mip-novel-video/example/mipx-xiaoshuo-3.html @@ -1,3 +1,4 @@ + @@ -17,51 +18,77 @@ } @font-face { font-family: xiaoshuo; + src: url(font/xiaoshuo.eot?t=1515560671046); src: url(font/xiaoshuo.eot?t=1515560671046#iefix) format("embedded-opentype"), url(font/xiaoshuo.woff) format("woff"), url(font/xiaoshuo.ttf?t=1515560671046) format("truetype"), url(font/xiaoshuo.svg?t=1515560671046#xiaoshuo) format("svg"); - } .icon-xiaoshuo { + } + + .icon-xiaoshuo { font-family: xiaoshuo!important; font-size: 16px; font-style: normal; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - } .icon-paihangbang:before { + } + + .icon-paihangbang:before { content: "\e663"; - } .icon-mianfei:before { + } + + .icon-mianfei:before { content: "\e665"; - } .icon-tuijian:before { + } + + .icon-tuijian:before { content: "\e668"; - } #header { + } + + #header { height: 44px; - padding-right: 17px; ; + padding-right: 17px;; padding-left: 17px; border-bottom: 1px solid #f1f1f1; line-height: 44px; - } #header .left, + } + + #header .left, #header .right { position: absolute; - z-index: 10; ; + z-index: 10;; top: 0; - } #header .left { + } + + #header .left { left: 17px; text-align: left; - } #header .right { + } + + #header .right { right: 17px; - } #header a { + } + + #header a { width: 22px; height: 44px; line-height: 44px; color: #333; - } #header h4 { + } + + #header h4 { margin: 0; padding: 0 50px; text-align: center; - } #footer { + } + + #footer { font-size: 12px; - line-height: 50px; ; + line-height: 50px;; text-align: center; color: #999; - } .text-box { + } + + .text-box { display: inline-block; overflow: hidden; box-sizing: content-box; @@ -75,35 +102,54 @@ vertical-align: middle; text-decoration: none; border-radius: 2px; - } .text-box.text-box-gray { - border: 1px solid #e3e3e3; ; + } + + .text-box.text-box-gray { + border: 1px solid #e3e3e3;; color: #999; - } .text-right { + } + + .text-right { text-align: right; - } .text-center { + } + + .text-center { text-align: center; - } ul { + } + + ul { list-style: none; - } .btn.btn-black, + } + + .btn.btn-black, button.btn-black { - padding-right: 0; ; + padding-right: 0;; padding-left: 0; border-color: #707379; text-align: center; color: #000; - } .color-gray { + } + + .color-gray { color: #555; - } a { + } + + a { -webkit-tap-highlight-color: rgba(0, 0, 0, .2); - } mip-scrollbox [data-wrapper] [data-inner], + } + + mip-scrollbox [data-wrapper] [data-inner], mip-scrollbox [data-wrapper] [data-item], mip-scrollbox [data-wrapper] [data-scroller] { position: relative; - } .scrollbox-more .scrollbox-more-wrap { + } + + .scrollbox-more .scrollbox-more-wrap { position: absolute; - width: 100%; ; + width: 100%;; height: 100%; } + .link { display: inline-block; margin: 10px 0; @@ -125,11 +171,11 @@ - 打开目录 - 打开设置 - 下一页 -
-

第1章 灵魂重生

+ 打开目录 + 打开设置 + 上一页 +
+

第3章 牛刀小试

“贱人,你竟敢背叛我!”

@@ -323,74 +369,64 @@

第1章 灵魂重生

陆宇眼神坚定,他是魂天师,就算是废武魂,他也一样能搅动天地,称雄万世!

- 下一页 + 上一页
小说网 © 2018 - 冀ICP备xxxx号
- - + - -© 2018 GitHub, Inc. -Terms -Privacy -Security -Status -Help -Contact GitHub -API -Training -Shop -Blog + \ No newline at end of file diff --git a/components/mip-novel-video/mip-novel-video.vue b/components/mip-novel-video/mip-novel-video.vue index 3bae602b..29e1a03c 100644 --- a/components/mip-novel-video/mip-novel-video.vue +++ b/components/mip-novel-video/mip-novel-video.vue @@ -91,7 +91,7 @@ export default { }, computed: { isShow: function () { - let isShow = isSF && detector.getMobileSystemVersion() && !this.played && isShouldVideo + let isShow = detector.getMobileSystemVersion() && !this.played return !isShow }, isOriginalVideo: function () { @@ -166,6 +166,9 @@ export default { setTimeout(() => { self.forbidClick = false }, 500) + setTimeout(() => { + this.closeVideo() + }, 15000) }, creatVideo () { if (this.isOriginalVideo) { diff --git a/components/mip-novel-video/video-detector.js b/components/mip-novel-video/video-detector.js index b8c64d65..8cd920a8 100644 --- a/components/mip-novel-video/video-detector.js +++ b/components/mip-novel-video/video-detector.js @@ -42,10 +42,10 @@ const detector = { const version = system.match(num) // ios要求版本8.X以上 if (platform.isIos()) { - return version && version[0] && version[0] >= IOSVERSION + return version && version[0] && version[0] >= IOSVERSION && !platform.isUc() } else { // android要求版本5.X以上 - return version && version[0] && version[0] >= ANDROIDVERSION + return version && version[0] && version[0] >= ANDROIDVERSION && !platform.isUc() } } } From 8c01e56c3a9bd8302ba6a962d10f487c41820d66 Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Fri, 13 Jul 2018 13:26:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2UC=E8=A7=86?= =?UTF-8?q?=E9=A2=91=EF=BC=8C15=E7=A7=92=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/mip-novel-video/mip-novel-video.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mip-novel-video/mip-novel-video.vue b/components/mip-novel-video/mip-novel-video.vue index 29e1a03c..90d920c4 100644 --- a/components/mip-novel-video/mip-novel-video.vue +++ b/components/mip-novel-video/mip-novel-video.vue @@ -91,7 +91,7 @@ export default { }, computed: { isShow: function () { - let isShow = detector.getMobileSystemVersion() && !this.played + let isShow = isSF && detector.getMobileSystemVersion() && !this.played && isShouldVideo return !isShow }, isOriginalVideo: function () { From d84a800c3c993e2a8b2d64da87bef4afdf4a35e9 Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Fri, 13 Jul 2018 15:14:21 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2UC=E8=A7=86?= =?UTF-8?q?=E9=A2=91=EF=BC=8C15=E7=A7=92=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/mip-novel-video/mip-novel-video.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/mip-novel-video/mip-novel-video.vue b/components/mip-novel-video/mip-novel-video.vue index 90d920c4..80660aa9 100644 --- a/components/mip-novel-video/mip-novel-video.vue +++ b/components/mip-novel-video/mip-novel-video.vue @@ -134,17 +134,23 @@ export default { startPlayer () { let self = this this.$element.setAttribute('style', 'display: block !important') + let forceClose = setTimeout(() => { + this.closeVideo() + }, 15000) if (player && this.isOriginalVideo) { + player.addEventListener('playing', () => { + this.startTimer() + clearTimeout(forceClose) + }) player.play() - this.startTimer() } if (jSMpegPlayer && !this.isOriginalVideo) { jSMpegPlayer.on('playing', () => { let event = new Event('playing') this.$element.dispatchEvent(event) css(canvas, {opacity: '1'}) - // 初始化倒计时器 this.startTimer() + clearTimeout(forceClose) }) jSMpegPlayer.play() } @@ -166,9 +172,6 @@ export default { setTimeout(() => { self.forbidClick = false }, 500) - setTimeout(() => { - this.closeVideo() - }, 15000) }, creatVideo () { if (this.isOriginalVideo) { From 0ea308b89626214a1093a8ca30ac7a1533d959d2 Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Fri, 13 Jul 2018 17:25:15 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mip-novel-video/mip-novel-video.vue | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/components/mip-novel-video/mip-novel-video.vue b/components/mip-novel-video/mip-novel-video.vue index 80660aa9..5c309f92 100644 --- a/components/mip-novel-video/mip-novel-video.vue +++ b/components/mip-novel-video/mip-novel-video.vue @@ -91,8 +91,7 @@ export default { }, computed: { isShow: function () { - let isShow = isSF && detector.getMobileSystemVersion() && !this.played && isShouldVideo - return !isShow + return isSF && detector.getMobileSystemVersion() && isShouldVideo }, isOriginalVideo: function () { return detector.isRenderVideoElement() @@ -102,13 +101,13 @@ export default { this.timeExpired() this.initVideoIndex() isShouldVideo = +customStorage.get(VIDEOINDEX) === 2 || false - console.log('是否SF:' + (isSF || false) + ';页数:' + customStorage.get(VIDEOINDEX)) - if (isShouldVideo) { + if (this.isShow) { + console.log('是否SF:' + (isSF || false) + ';页数:' + customStorage.get(VIDEOINDEX)) this.readContainerNoScroll() } }, firstInviewCallback () { - if (isShouldVideo) { + if (this.isShow) { this.creatVideo() this.openVideo() } @@ -117,17 +116,10 @@ export default { openVideo () { let self = this document.body.addEventListener('touchstart', e => { - if (self.isShow) { - self.$element.setAttribute('style', 'display: none !important') - self.readContainerScroll() - return - } - if (!self.forbidClick) { + if (!self.forbidClick || self.played) { return } e && e.preventDefault() - e && e.stopPropagation() - e && e.stopImmediatePropagation() self.startPlayer() }, false) }, @@ -139,7 +131,7 @@ export default { }, 15000) if (player && this.isOriginalVideo) { player.addEventListener('playing', () => { - this.startTimer() + self.startTimer() clearTimeout(forceClose) }) player.play() @@ -149,13 +141,19 @@ export default { let event = new Event('playing') this.$element.dispatchEvent(event) css(canvas, {opacity: '1'}) - this.startTimer() + self.startTimer() clearTimeout(forceClose) }) jSMpegPlayer.play() } /* global _hmt */ _hmt && _hmt.push(['_trackEvent', 'video', 'show', 'vivo']) + this.noVideoMaskScroll() + setTimeout(() => { + self.forbidClick = false + }, 500) + }, + noVideoMaskScroll () { let videoMask = this.$element.querySelector('.video-mask') videoMask.addEventListener('touchmove', e => { e && e.preventDefault() @@ -169,9 +167,6 @@ export default { e && e.stopImmediatePropagation() return false }) - setTimeout(() => { - self.forbidClick = false - }, 500) }, creatVideo () { if (this.isOriginalVideo) { @@ -191,6 +186,7 @@ export default { } }, initCanvasVideo () { + let self = this let videoCover = this.$refs.videoCover if (videoCover) { css(videoCover, {backgroundImage: 'url(' + POSTER + ')'}) @@ -208,7 +204,7 @@ export default { jSMpegPlayer.on('ended', () => { let event = new Event('ended') this.$element.dispatchEvent(event) - this.closeVideo() + self.closeVideo() }) } }, @@ -256,7 +252,6 @@ export default { closeVideo (e, isClick) { e && e.stopPropagation() e && e.preventDefault() - let self = this let container = this.$element.querySelector('.video-container') let content = this.$element.querySelector('.content') let isClosed = false @@ -267,10 +262,11 @@ export default { jSMpegPlayer.pause() } if (!isClosed) { - self.readContainerScroll() - self.forbidClick = true - self.played = true + this.readContainerScroll() + this.forbidClick = true + this.played = true container.classList.add('close-container') + let self = this setTimeout(() => { content.classList.add('close-content') /* global _hmt */ @@ -293,10 +289,9 @@ export default { } let currentTime = myDate let diffTime = currentTime - preTime - // let hoursDiff = parseInt(Math.abs(diffTime) / 1000 / 60 / 60) let secondsDiff = parseInt(Math.abs(diffTime) / 1000) if (secondsDiff >= 30) { - // if (hoursDiff >= 24) { + // if (secondsDiff >= 86399) { customStorage.rm(VIDEOINDEX) customStorage.rm(PRETIME) } From afbb2e4f31e12022821f16820714464469b3cf55 Mon Sep 17 00:00:00 2001 From: Espoir-L <413308430@qq.com> Date: Mon, 16 Jul 2018 13:49:30 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat=EF=BC=9A=E4=B8=80=E5=A4=A9=E4=B8=80?= =?UTF-8?q?=E6=B8=85=E5=89=8D=E7=AB=AF=E7=BC=93=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mip-novel-video/mip-novel-video.vue | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/components/mip-novel-video/mip-novel-video.vue b/components/mip-novel-video/mip-novel-video.vue index 5c309f92..7cdcd66b 100644 --- a/components/mip-novel-video/mip-novel-video.vue +++ b/components/mip-novel-video/mip-novel-video.vue @@ -64,7 +64,7 @@ const css = MIP.util.css const VIDEOINDEX = 'ad-video' const COUNTDOWNINDEX = 10 const PINZHUANGURL = 'https://www.vivo.com/vivo/nexs/?cid=w-1-baidu_ada-xs' -const PRETIME = 'ad-time' +const PREDATE = 'ad-time' const isSF = !window.MIP.standalone @@ -281,19 +281,16 @@ export default { isClosed = true }, timeExpired () { - let myDate = new Date().getTime() - let preTime = customStorage.get(PRETIME) - if (preTime == null) { - customStorage.set(PRETIME, myDate) + let myDate = new Date().getDate() + let preDate = customStorage.get(PREDATE) + if (preDate == null) { + customStorage.set(PREDATE, myDate) return } - let currentTime = myDate - let diffTime = currentTime - preTime - let secondsDiff = parseInt(Math.abs(diffTime) / 1000) - if (secondsDiff >= 30) { - // if (secondsDiff >= 86399) { + let currentDate = myDate + if (currentDate !== preDate) { customStorage.rm(VIDEOINDEX) - customStorage.rm(PRETIME) + customStorage.rm(PREDATE) } } } From 593381c4aae5d948da338194ab4874532ca2f129 Mon Sep 17 00:00:00 2001 From: jenkey2011 Date: Tue, 10 Jul 2018 17:01:37 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/mip-map/example/mip-map.html | 14 +-- components/mip-map/mip-map.md | 78 +++++++++++++-- components/mip-map/mip-map.vue | 121 +++++++++++++++++++----- 3 files changed, 172 insertions(+), 41 deletions(-) diff --git a/components/mip-map/example/mip-map.html b/components/mip-map/example/mip-map.html index 59b74a1c..8d679554 100644 --- a/components/mip-map/example/mip-map.html +++ b/components/mip-map/example/mip-map.html @@ -9,6 +9,7 @@ @@ -17,6 +18,8 @@ - \ No newline at end of file + diff --git a/components/mip-map/mip-map.md b/components/mip-map/mip-map.md index db79c65c..e36fdf6b 100644 --- a/components/mip-map/mip-map.md +++ b/components/mip-map/mip-map.md @@ -17,22 +17,22 @@ @@ -94,5 +94,65 @@ ### data-only-get-sdk 说明:是否只加载地图 SDK -必填:否 +必填:否 格式:Boolean +默认:false + +### hide-map + +说明:是否隐藏地图 +必填:否 +格式:Boolean +默认:false + +### get-position + +说明:是否自动定位 +必填:否 +格式:Boolean +默认:false + +## 触发事件 + +### getPositionComplete + +如设置定位且成功定位,则透传经纬度等信息 +透传数据结构如下: + +```js +{ + "accuracy":30, + "altitude":null, + "altitudeAccuracy":null, + "heading":null, + "latitude":40.050551292543, + "longitude":116.28123645733, + "speed":null, + "timestamp":null, + "point":{ + "lng":116.28123645733, + "lat":40.050551292543 + }, + "address":{ + "city":"北京市", + "city_code":0, + "district":"海淀区", + "province":"北京市", + "street":"软件园西三路辅路", + "street_number":"" + } +} +``` +### getPositionFailed +定位失败 + +### searchLocalFailed + +无法定位值`local`所配位置时,触发此事件,并切换为自动定位 + + +## 暴露方法 + +### getLocal + +获取当前定位 diff --git a/components/mip-map/mip-map.vue b/components/mip-map/mip-map.vue index f2fc2dab..f1f87638 100644 --- a/components/mip-map/mip-map.vue +++ b/components/mip-map/mip-map.vue @@ -4,6 +4,7 @@ @@ -33,16 +34,25 @@ export default { return null } }, + getPosition: { + type: Boolean, + default: false + }, dataOnlyGetSdk: { type: Boolean, default: false + }, + hideMap: { + type: Boolean, + default: false } }, data () { return { map: null, point: {}, - marker: null + marker: null, + currentMarker: null } }, firstInviewCallback () { @@ -51,7 +61,7 @@ export default { methods: { init () { this.getMapJDK().then(() => { - this.handleResult() + this.resolveOptions() }) }, @@ -81,10 +91,55 @@ export default { }, /** - * 初始化地图并加载控件 + * 根据配置执行相应方法 + * + */ + resolveOptions () { + let BMap = window.BMap + + // 仅加载SDK,不初始化地图 + if (this.dataOnlyGetSdk) { + return this.loadSdk() + } + + // 初始化地图 + this.map = new BMap.Map('allmap') + this.map.centerAndZoom(new BMap.Point(116.404, 39.915), 15) + + // 隐藏地图 + this.hideMap && this.hideMapView() + + // 自动定位、或者手动定位 + this.getPosition ? this.getCurrentLocation() : this.searchLocation() + + // 暴露自动定位方法 + this.$on('getLocal', () => { + // 可能会在未完全初始化的时候调用 + this.getMapJDK().then(() => { + this.getCurrentLocation() + }) + }) + // 配置控件 + this.controls && this.addControls() + }, + + /** + * 隐藏地图 + * + */ + hideMapView () { + let mipMap = this.$element + MIP.util.css(mipMap, { + width: 0, + height: 0 + }) + }, + + /** + * 仅加载sdk * */ - handleResult () { + loadSdk () { let BMap = window.BMap // BMap注入沙盒 @@ -97,39 +152,50 @@ export default { // 派发事件 this.$emit('loaded', {}) + }, - // 仅加载SDK,不初始化地图 - if (this.dataOnlyGetSdk) { - return - } - - // 初始化地图 - this.map = new BMap.Map('allmap') - this.map.centerAndZoom(new BMap.Point(116.404, 39.915), 15) + /** + * 自动定位 + * + */ + getCurrentLocation () { + let BMap = window.BMap + let geolocation = new BMap.Geolocation() + geolocation.getCurrentPosition((res) => { + // 无定位权限 + if (!res.accuracy) { + return this.$emit('getPositionFailed', res) + } else if (geolocation.getStatus() === window.BMAP_STATUS_SUCCESS) { + this.currentMarker = new BMap.Marker(res.point) + this.map.addOverlay(this.currentMarker) + this.map.panTo(res.point) - // 创建地址解析器实例 - let address = this.traverseAndConcat(this.location) - if (address && this.location.city) { - this.handlePoint() - } + // 派发事件 + this.$emit('getPositionComplete', res) + } + }, { enableHighAccuracy: true }) }, /** - * 处理定位的函数 + * 定位至local配置的位置 * */ - handlePoint () { + searchLocation () { let BMap = window.BMap let { location, map } = this // 配置地址 let address = this.traverseAndConcat(location) - if (!address) { + + // 没有定位信息,则使用自动定位 + if (!address || !this.location.city) { + this.getCurrentLocation() + this.$emit('searchLocalFailed', {}) return } let options = { onSearchComplete: results => { - if (local.getStatus() !== 0) { + if (local.getStatus() !== window.BMAP_STATUS_SUCCESS) { return } let firstResult = results.getPoi(0) @@ -143,9 +209,7 @@ export default { map.centerAndZoom(point, 15) // 配置弹层 - this.handleInfoWindow() - // 配置控件 - this.handleControls() + this.setInfoWindow() } } @@ -158,7 +222,7 @@ export default { * 配置弹层信息 * */ - handleInfoWindow () { + setInfoWindow () { let BMap = window.BMap let { info, map, marker, point } = this if (!info) { @@ -174,7 +238,7 @@ export default { * 配置地图控件 * */ - handleControls () { + addControls () { let BMap = window.BMap let { controls, map } = this for (let key in controls) { @@ -210,6 +274,11 @@ export default { #allmap { width: 100%; height: 100%; + &.hideMap { + width: 0; + height: 0; + visibility: hidden; + } // mip核心css 会覆盖地图定位图片样式 & /deep/ img { width: auto; From 68f1e9630c372658cabf278ff69945c7c6899f7b Mon Sep 17 00:00:00 2001 From: jennyliang220 Date: Mon, 16 Jul 2018 19:49:12 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E5=90=8E=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=B0=83=E6=95=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/mipx-xiaoshuo-1.html | 3 +- .../example/mipx-xiaoshuo-2.html | 3 +- .../example/mipx-xiaoshuo-3.html | 7 +++-- components/mip-shell-xiaoshuo/footer.js | 2 +- .../mip-shell-xiaoshuo/mip-shell-xiaoshuo.js | 17 +++++----- components/mip-shell-xiaoshuo/setting.js | 31 +++++++++++-------- 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html index 71d6d206..b3d6e79b 100644 --- a/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html +++ b/components/mip-shell-xiaoshuo/example/mipx-xiaoshuo-1.html @@ -5,7 +5,8 @@ 第1章灵魂重生_神武天帝_小说网 - + +