|
@@ -1,4 +1,5 @@
|
|
|
import behavior from '~/mixins/video'
|
|
|
+let _observer
|
|
|
Component({
|
|
|
behaviors: [behavior],
|
|
|
properties: {
|
|
@@ -9,6 +10,18 @@ Component({
|
|
|
this.setData({
|
|
|
worksListCopy: newVal
|
|
|
})
|
|
|
+ this._observer = this.createIntersectionObserver({
|
|
|
+ observeAll: true
|
|
|
+ })
|
|
|
+ this._observer.relativeTo('.playLine')
|
|
|
+ .observe('.videoPreview', (res) => {
|
|
|
+ let intersectionRatio = res.intersectionRatio
|
|
|
+ if (intersectionRatio > 0) {
|
|
|
+ this.setData({
|
|
|
+ currentId: res.dataset.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
videoType: {
|
|
@@ -25,7 +38,6 @@ Component({
|
|
|
data: {
|
|
|
worksListCopy: {}
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
setListFans({
|
|
|
detail
|