|
@@ -16,20 +16,33 @@ Page({
|
|
|
'https://oss.dayaedu.com/ktyq/1732519479416.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1733110029242.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1732519500580.png'
|
|
|
- // 'https://oss.dayaedu.com/ktyq/1732174025169.png',
|
|
|
- // 'https://oss.dayaedu.com/ktyq/1732501351014.png',
|
|
|
- // 'https://oss.dayaedu.com/ktyq/1732174043543.png'
|
|
|
],
|
|
|
goodsImgList: [
|
|
|
'https://oss.dayaedu.com/ktyq/1732175006625.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1732175021350.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1732175031878.png',
|
|
|
- 'https://oss.dayaedu.com/ktyq/1732617269723.png',
|
|
|
- 'https://oss.dayaedu.com/ktyq/1732617388991.png'
|
|
|
+ 'https://oss.dayaedu.com/ktyq/1733406956046abd99e75.png',
|
|
|
+ 'https://oss.dayaedu.com/ktyq/173340695604938755d8b.png',
|
|
|
+ 'https://oss.dayaedu.com/ktyq/17333975985307c7f2bec.png'
|
|
|
+ ],
|
|
|
+ detailImgList: [
|
|
|
+ {
|
|
|
+ url: 'https://oss.dayaedu.com/ktyq/1733403675345.png',
|
|
|
+ text: '合作学校音乐数字课堂公开课'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: 'https://oss.dayaedu.com/ktyq/1733403707851.png',
|
|
|
+ text: '音乐课课堂器乐教学'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: 'https://oss.dayaedu.com/ktyq/1733403725644.png',
|
|
|
+ text: '学期末汇报演出'
|
|
|
+ }
|
|
|
],
|
|
|
serviceShow: true,
|
|
|
scrollTop: 0,
|
|
|
current: 0,
|
|
|
+ detailCurrent: 0,
|
|
|
autoplay: false,
|
|
|
interval: 5000,
|
|
|
duration: 500,
|
|
@@ -47,6 +60,10 @@ Page({
|
|
|
headerHeight: 0, // 头部的高度
|
|
|
initialScrollHeight: 0, // 滚动高度
|
|
|
isFromPreviewImage: false,
|
|
|
+ bannerPlay: false, // 视频是否播放
|
|
|
+ titleControls: false, // 详情是否显示控制条
|
|
|
+ liuControls: false, // 详情是否显示控制条
|
|
|
+ bannerImageloaded: false, // Banner图片是否加载完成
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -69,6 +86,65 @@ Page({
|
|
|
})
|
|
|
}).exec();
|
|
|
},
|
|
|
+ onBannerVideoLoad() {
|
|
|
+ this.setData({
|
|
|
+ bannerImageloaded: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onBannerPlay() {
|
|
|
+ const bannerVideo = wx.createVideoContext('bannerVideo')
|
|
|
+ const titleVideo = wx.createVideoContext('titleVideo')
|
|
|
+ const liuVideo = wx.createVideoContext('liuVideo')
|
|
|
+ this.setData({
|
|
|
+ bannerPlay: true
|
|
|
+ }, () => {
|
|
|
+ titleVideo.stop()
|
|
|
+ bannerVideo.play()
|
|
|
+ liuVideo.stop()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onBannerVideoPlay() {
|
|
|
+ const titleVideo = wx.createVideoContext('titleVideo')
|
|
|
+ titleVideo.stop()
|
|
|
+ const liuVideo = wx.createVideoContext('liuVideo')
|
|
|
+ liuVideo.stop()
|
|
|
+ },
|
|
|
+ onTitlePlay() {
|
|
|
+ const bannerVideo = wx.createVideoContext('bannerVideo')
|
|
|
+ bannerVideo.stop()
|
|
|
+ const liuVideo = wx.createVideoContext('liuVideo')
|
|
|
+ liuVideo.stop()
|
|
|
+ },
|
|
|
+ onTItleVideoPlay() {
|
|
|
+ const bannerVideo = wx.createVideoContext('bannerVideo')
|
|
|
+ const titleVideo = wx.createVideoContext('titleVideo')
|
|
|
+ const liuVideo = wx.createVideoContext('liuVideo')
|
|
|
+ this.setData({
|
|
|
+ titleControls: true
|
|
|
+ }, () => {
|
|
|
+ titleVideo.play()
|
|
|
+ bannerVideo.stop()
|
|
|
+ liuVideo.stop()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onLiuPlay() {
|
|
|
+ const bannerVideo = wx.createVideoContext('bannerVideo')
|
|
|
+ bannerVideo.stop()
|
|
|
+ const titleVideo = wx.createVideoContext('titleVideo')
|
|
|
+ titleVideo.stop()
|
|
|
+ },
|
|
|
+ onLiuVideoPlay() {
|
|
|
+ const bannerVideo = wx.createVideoContext('bannerVideo')
|
|
|
+ const titleVideo = wx.createVideoContext('titleVideo')
|
|
|
+ const liuVideo = wx.createVideoContext('liuVideo')
|
|
|
+ this.setData({
|
|
|
+ liuControls: true
|
|
|
+ }, () => {
|
|
|
+ liuVideo.play()
|
|
|
+ bannerVideo.stop()
|
|
|
+ titleVideo.stop()
|
|
|
+ })
|
|
|
+ },
|
|
|
/**
|
|
|
* 获取基础信息
|
|
|
*/
|
|
@@ -150,6 +226,15 @@ Page({
|
|
|
this.setData({
|
|
|
current: detail.current
|
|
|
})
|
|
|
+ this.onTitlePlay()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeSwiperDetail(e: any) {
|
|
|
+ const detail = e.detail
|
|
|
+ if(detail.source === 'touch' || detail.source == 'autoplay') {
|
|
|
+ this.setData({
|
|
|
+ detailCurrent: detail.current
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
isLogin() {
|
|
@@ -220,6 +305,19 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onPreivewDetailImg(e: { currentTarget: { dataset: any } }) {
|
|
|
+ wx.previewImage({
|
|
|
+ current: e.currentTarget.dataset.src,
|
|
|
+ urls: ['https://oss.dayaedu.com/ktyq/1733403675345.png','https://oss.dayaedu.com/ktyq/1733403707851.png','https://oss.dayaedu.com/ktyq/1733403725644.png',
|
|
|
+
|
|
|
+ ],
|
|
|
+ success: () => {
|
|
|
+ this.setData({
|
|
|
+ isFromPreviewImage: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
onPreivewGoodsImg(e: { currentTarget: { dataset: any } }) {
|
|
|
wx.previewImage({
|
|
|
current: e.currentTarget.dataset.src,
|
|
@@ -262,10 +360,6 @@ Page({
|
|
|
serviceShow: false
|
|
|
})
|
|
|
},
|
|
|
- // onReady() {
|
|
|
- // const scrollView = this.selectComponent('#scrollarea');
|
|
|
- // console.log(scrollView, 'scrollView')
|
|
|
- // },
|
|
|
// 页面滚动时颜色变化
|
|
|
onScrollView(e: { detail: any }) {
|
|
|
const top = e.detail.scrollTop || 0
|
|
@@ -301,30 +395,41 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
onChangeScroll() {
|
|
|
const that = this;
|
|
|
debounce(function() {
|
|
|
- wx.createSelectorQuery().select('#type2').boundingClientRect(function (rect) {
|
|
|
- if(rect.top > 0 && rect.top <= that.data.headerHeight) {
|
|
|
+ wx.createSelectorQuery().select('#type3').boundingClientRect(function (rect) {
|
|
|
+ let check = false
|
|
|
+ if(rect.top > 0 && (rect.top <= that.data.headerHeight )) {
|
|
|
that.setData({
|
|
|
- scrolIntoViewStr: 'type2'
|
|
|
+ scrolIntoViewStr: 'type3',
|
|
|
})
|
|
|
- }
|
|
|
- }).exec();
|
|
|
- wx.createSelectorQuery().select('#type3').boundingClientRect(function (rect) {
|
|
|
- if(rect.top > 0 && rect.top <= that.data.headerHeight) {
|
|
|
- that.setData({
|
|
|
- scrolIntoViewStr: 'type3',
|
|
|
- })
|
|
|
+ check = true
|
|
|
}
|
|
|
if(rect.top > 0 && rect.top > that.data.headerHeight) {
|
|
|
that.setData({
|
|
|
scrolIntoViewStr: 'type1'
|
|
|
})
|
|
|
+ check = true
|
|
|
+ }
|
|
|
+ // console.log('checked', check)
|
|
|
+ if(!check) {
|
|
|
+ wx.createSelectorQuery().select('#type2').boundingClientRect(function (rect) {
|
|
|
+ if(rect.top > 0 && rect.top <= that.data.headerHeight) {
|
|
|
+ that.setData({
|
|
|
+ scrolIntoViewStr: 'type2'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(rect.top > 0 && rect.top > that.data.headerHeight) {
|
|
|
+ that.setData({
|
|
|
+ scrolIntoViewStr: 'type3'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).exec();
|
|
|
}
|
|
|
}).exec();
|
|
|
+
|
|
|
}, 100)()
|
|
|
},
|
|
|
onTapAnchor(e: { currentTarget: { dataset: any } }) {
|
|
@@ -332,7 +437,7 @@ Page({
|
|
|
this.setData({
|
|
|
scrolIntoView: type,
|
|
|
scrolIntoViewStr: type,
|
|
|
- scrollDiscount: type !== 'type2' ? true : false,
|
|
|
+ scrollDiscount: true, // type !== 'type2' ? true : false,
|
|
|
scrollIntoViewType: true,
|
|
|
})
|
|
|
},
|