使用vue开发实现XixunPlayer的功能.
XixunPlayer 实现更新App
/**
* @Author: 858834013@qq.com
* @Name: updateAPP
* @Date: 2022-04-26
* @Desc: XixunPlayer 实现更新App
*/
<template>
<div class="updateAPP">
<el-button class="mb20" type="primary" @click="getshow" size="mini">在线更新app</el-button>
<el-dialog
title="在线更新app"
:visible.sync="dialogVisible"
width="50%">
<div class="list">
<el-input placeholder="请输入下载地址" v-model="appUrl">
</el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateAPP">升级</el-button>
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getdata } from '@/api/led/led'
export default {
name: 'edit',
components: {},
props: {
id: {
type: String | Number,
default () {
return {}
}
}
},
data () {
return {
dialogVisible: false,
appUrl: ''
}
},
methods: {
updateAPP () {
var that = this
if (!this.appUrl) {
this.$message.error('请输入下载地址')
return
}
getdata(that.id, {
type: 'updateAPP',
appUrl: that.appUrl
}).then(function (res) {
if (res._type == 'success') {
that.$message({
message: '更新成功',
type: 'success'
})
that.dialogVisible = false
}
})
},
getshow () {
this.dialogVisible = true
},
}
}
</script>