126 lines
2.4 KiB
Vue
126 lines
2.4 KiB
Vue
|
|
|
|
|
|
<template>
|
|
<uni-popup ref="share" type="bottom">
|
|
<view class="shareCont">
|
|
<view class="shareHeader">
|
|
<text class="shareTitle">倍速</text>
|
|
<text class="shareClose" @click="closeShare">取消</text>
|
|
</view>
|
|
<view class="speedList">
|
|
<text :class="['speedItem',{'speedItemCheck': item.num==checkSpeedNum}]"
|
|
v-for="(item,index) in speedList"
|
|
:key="index"
|
|
@click="changeSpeed(item.num)"
|
|
>{{item.text}}</text>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
</template>
|
|
<script>
|
|
|
|
|
|
export default {
|
|
name: "changeSpeed",
|
|
props:{
|
|
speedNum:{
|
|
type:Number,
|
|
default:1
|
|
}
|
|
},
|
|
mounted() {
|
|
this.checkSpeedNum = this.speedNum
|
|
},
|
|
data() {
|
|
return {
|
|
checkSpeedNum:1,
|
|
speedList:[
|
|
{num:0.5,text:'0.5倍速'},
|
|
{num:0.8,text:'0.8倍速'},
|
|
{num:1,text:'1倍速'},
|
|
{num:1.25,text:'1.25倍速'},
|
|
{num:1.5,text:'1.5倍速'},
|
|
{num:2,text:'2.0倍速'},
|
|
]
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
closeChangeSpeed() {
|
|
this.$refs.share.close();
|
|
},
|
|
showChangeSpeed() {
|
|
this.$refs.share.open();
|
|
},
|
|
changeSpeed(num) {
|
|
if(this.checkSpeedNum!==num){
|
|
this.checkSpeedNum = num
|
|
this.$emit('changeSpeed',num);
|
|
this.closeChangeSpeed();
|
|
}
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.shareCont{
|
|
background-color: #FFFFFF;
|
|
width: 750rpx;
|
|
padding: 34rpx;
|
|
border-radius: 34rpx 34rpx 0 0;
|
|
}
|
|
.shareHeader{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-direction: row;
|
|
}
|
|
.shareTitle{
|
|
font-weight: 500;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
line-height: 44rpx;
|
|
}
|
|
.shareClose{
|
|
font-weight: 500;
|
|
font-size: 28rpx;
|
|
color: #666666;
|
|
line-height: 44rpx;
|
|
}
|
|
.speedList{
|
|
padding: 60rpx 0 130rpx 0 ;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
.shareIcon{
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
}
|
|
.speedItem{
|
|
padding: 12rpx 24rpx;
|
|
line-height: 64rpx;
|
|
background: #F7F8F9;
|
|
border-radius: 12rpx;
|
|
text-align: center;
|
|
font-weight: 500;
|
|
font-size: 26rpx;
|
|
color: #333333;
|
|
margin-right: 24rpx;
|
|
margin-bottom: 24rpx;
|
|
}
|
|
.speedItemCheck{
|
|
padding: 12rpx 24rpx;
|
|
line-height: 64rpx;
|
|
background: #f44813;
|
|
border-radius: 12rpx;
|
|
text-align: center;
|
|
font-weight: 500;
|
|
font-size: 26rpx;
|
|
color: #ffffff;
|
|
margin-right: 24rpx;
|
|
}
|
|
</style> |