使用vue开发实现XixunPlayer的功能.
停止XixunPlayer设备
/**
* @Author: 858834013@qq.com
* @Name: stopPlayer
* @Date: 2022-04-26
* @Desc: XixunPlayer实现停止设备
*/
<template>
<div class="stopPlayer">
<el-popconfirm
title="确定要停止播放器吗?"
@confirm="stopPlayer"
>
<el-button type="danger" class="mb20" slot="reference" size="mini">停止</el-button>
</el-popconfirm>
</div>
</template>
<script>
import { getdata } from '@/api/led/led'
export default {
name: 'stopPlayer',
props: {
id: {
type: String | Number,
default () {
return 0
}
}
},
methods: {
// 重启
stopPlayer () {
var that = this
getdata(that.id, {
'type': 'stopPlayer',
'stop': true
}).then(function (res) {
if (res.result) {
that.$message({
message: '停止成功',
type: 'success'
})
} else {
that.$message.error('停止失败')
}
})
},
}
}
</script>
<style lang="scss" scoped>
.stopPlayer {
display: inline-block;
}
</style>