You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.2 KiB

2 years ago
<template>
<div>
2 years ago
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="'二维码'" :form="form"
2 years ago
:rules='rules'>
<template v-slot:settings>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;width:0">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style="flex-grow: 1;">
<div class="txl">
<div>
2 years ago
<div>课程名称{{row.name}}</div>
2 years ago
<div>开课日期{{row.start_date ? row.start_date + '至' + row.end_date : ''}}</div>
2 years ago
<div>类别{{row.type_value}}</div>
2 years ago
</div>
</div>
2 years ago
<div class="code">
<div v-if="imgSrc">
<img :src="imgSrc"></img>
</div>
2 years ago
</div>
</div>
</div>
</template>
<template v-slot:footerContent>
2 years ago
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></el-button>
2 years ago
</template>
</xy-dialog>
</div>
</template>
2 years ago
<script>
import {getQrCode} from "@/api/course"
2 years ago
export default {
components: {
},
data() {
return {
isShow: false,
form: {
settings: '',
2 years ago
},
row:{},
rules: {},
imgSrc:''
2 years ago
}
},
created() {},
methods: {
2 years ago
async getCode() {
const res = await getQrCode({
id: this.row.id,
})
this.imgSrc = res.msg
2 years ago
}
},
watch: {
isShow(newVal) {
2 years ago
if (newVal) {
this.getCode()
} else {
this.row = {}
this.imgSrc = ''
2 years ago
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .settings {
flex-basis: 100%;
}
.txl {
display: flex;
justify-content: center;
margin-bottom: 30px;
}
.code {
2 years ago
height: 200px;
2 years ago
text-align: center;
2 years ago
img {
width: 200px;
height: 200px;
2 years ago
}
}
</style>