You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.7 KiB
66 lines
1.7 KiB
|
6 months ago
|
const _app = getApp<IAppOption>()
|
||
|
|
|
||
|
|
Page({
|
||
|
|
data: {
|
||
|
|
mg: [
|
||
|
|
{
|
||
|
|
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129469_MG%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9101.mp4',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
cidp: [
|
||
|
|
{
|
||
|
|
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129233_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9101.mp4',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129667_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9103.mp4',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129630_CIDP%E8%A7%86%E9%A2%91%E4%B8%93%E5%8C%BA02.mp4',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20241129281_CIDP%E4%B8%93%E5%8C%BA%E8%A7%86%E9%A2%9104.mp4',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
videoContext: null as WechatMiniprogram.VideoContext | null,
|
||
|
|
onLoad() {
|
||
|
|
this.videoContext = wx.createVideoContext('video')
|
||
|
|
},
|
||
|
|
onUnload() {
|
||
|
|
if (this.videoContext) {
|
||
|
|
this.videoContext.stop()
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleVideo(e: any) {
|
||
|
|
const { key, index } = e.currentTarget.dataset
|
||
|
|
const url = this.data[key][index].url
|
||
|
|
if (this.videoContext) {
|
||
|
|
this.setData({
|
||
|
|
videoUrl: url,
|
||
|
|
})
|
||
|
|
this.videoContext.play()
|
||
|
|
this.videoContext.requestFullScreen({
|
||
|
|
direction: 0,
|
||
|
|
})
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleFullScreen(e) {
|
||
|
|
if (!e.detail.fullScreen && this.videoContext) {
|
||
|
|
this.videoContext.stop()
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleDetail(e: any) {
|
||
|
|
const { id } = e.currentTarget.dataset
|
||
|
|
wx.navigateTo({
|
||
|
|
url: `/gift/pages/cutaneousDetail/index?id=${id}`,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
handleVideoDetail() {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: `/gift/pages/cutaneousVideo/index`,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
})
|
||
|
|
|
||
|
|
export {}
|