UNPKG

lp-weapp

Version:

一套组件化、可复用、易扩展的微信小程序 UI 组件库

1 lines 1.27 kB
"use strict";Component({properties:{dots:{type:Boolean,value:!0},dotsColor:{type:String,value:"rgba(0, 0, 0, .3)"},dotsActColor:{type:String,value:"#000"},height:{type:Number,value:360},autoplay:{type:Boolean,value:!1},interval:{type:Number,value:5e3},circular:{type:Boolean,value:!1},props:{type:Object,value:{path:"path",type:"type",url:"url"}},list:{type:Array,value:[]},mode:{type:String,value:"aspectFill"},isTxv:{type:Boolean,value:!1}},data:{muted:!1,prevIndex:0},methods:{toPath:function(t){var e=t.currentTarget.dataset.path;e&&wx.navigateTo({url:e})},switchMuted:function(){this.setData({muted:!this.data.muted})},changeSwiper:function(t){var e=t.detail.current,a=this.data.list[this.data.prevIndex][this.data.props.type];"video"!=a||this.data.isTxv||wx.createVideoContext("video".concat(this.data.prevIndex),this).pause(),"video"==a&&this.data.isTxv&&this.selectComponent("#".concat(this.data.list[this.data.prevIndex][this.data.props.url]).concat(this.data.prevIndex)).pause();var i=this.data.list[e][this.data.props.type];"video"!=i||this.data.isTxv||wx.createVideoContext("video".concat(e),this).play(),"video"==i&&this.data.isTxv&&this.selectComponent("#".concat(this.data.list[e][this.data.props.url]).concat(e)).play();this.setData({prevIndex:e})}}});