index.vue
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
<div class="content-box">
<back-box>
<template slot="title">
<span>软件下载</span>
</template>
</back-box>
<div class="page-content">
<div class="down-item">
<p class="txt">
K12公私立学校、高等院校、教育培训机构的课堂互动教学、即时课堂测验
</p>
<el-button plan round @click="links">授课端下载</el-button>
</div>
<div class="down-item" v-loading="loading" v-if="role != 'ROLE_JIAOSHI'">
<p class="txt">
配合发卡器硬件,方便学校管理员进行发卡补卡操作的软件。
</p>
<el-button plan round @click="downCard">发卡软件下载</el-button>
</div>
<div class="down-item" v-loading="loading">
<p class="txt">。</p>
<el-button plan round @click="downNet">.Net环境下载</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
role: "",
loading: false,
loadingNet: false,
};
},
created() {
this.role =
this.$store.getters.info.showRole ||
this.$store.getters.info.permissions[0].role;
},
methods: {
links() {
this.$router.push({
path: "/downClient",
});
},
async downCard() {
if (this.loading == true) return;
this.loading = true;
const { data, status, info } = await this.$request.latestClickersApp();
this.loading = false;
if (status == 0) {
const a = document.createElement("a");
a.href = data.downloadUrl;
a.download = data.appName;
document.body.appendChild(a);
a.click();
a.remove();
} else {
this.$message.error(info);
}
},
async downNet() {
if (this.loadingNet == true) return;
this.loadingNet = true;
const { data, status, info } = await this.$request.latestClickersApp();
this.loadingNet = false;
if (status == 0) {
const a = document.createElement("a");
a.href = data.downloadUrl;
a.download = data.appName;
document.body.appendChild(a);
a.click();
a.remove();
} else {
this.$message.error(info);
}
},
},
};
</script>
<style lang="scss" scoped>
.content-box {
width: 100%;
}
.page-content {
display: flex;
padding-top: 50px;
margin-left: 160px;
.down-item {
width: 200px;
padding: 50px 20px;
border-radius: 20px;
margin: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #f8f8f8;
box-shadow: 2px 2px 5px #ccc;
.txt {
font-size: 16px;
color: #7f7f7f;
line-height: 24px;
height: 120px;
}
}
}
</style>