feat:增加课程二维码

This commit is contained in:
lixg
2022-12-06 22:11:47 +08:00
14 changed files with 255 additions and 120 deletions

View File

@@ -11,7 +11,11 @@
<div class="fort">起止时间{{ startTime }}{{ endTime }}</div>
</div>
<div class="right">
<img class="img1" src="../../assets/images/leveladd/ma.png" />
<img
class="img1"
src="../../assets/images/leveladd/ma.png"
@click="showCodeModel2()"
/>
<div class="line" v-if="action == 1 || action == 0"></div>
<img
v-if="action == 1 || action == 0"
@@ -473,7 +477,9 @@
</div>
</div>
<div>
<div class="iconame">「{{ item.name }}」</div>
<div class="iconame">
「{{ checkType(item.type) }}」
</div>
<div class="icontext">{{ item.name }}</div>
</div>
</div>
@@ -550,7 +556,7 @@
<div
class="operation"
style="cursor: pointer"
@click="showCodeModal"
@click="showCodeModel(item)"
>
二维码
</div>
@@ -1613,15 +1619,6 @@
<!-- 编辑项目弹窗 -->
<proj-set v-model:editHs="editHs" v-model:projectId="projectId" />
<!-- 二维码弹窗 -->
<two-dimensional-code
v-model:codevisible="codevisible"
:codeInfo="codeInfo"
index="0"
type="课程二维码"
/>
<!-- 二维码弹窗 -->
<!-- 发布弹窗 -->
<a-modal
v-model:visible="projectPub"
@@ -1793,6 +1790,15 @@
</div>
</div>
</a-modal>
<!-- 二维码弹窗 -->
<two-dimensional-code
v-model:codevisible="codevisible"
:codeInfo="codeInfo"
index="0"
type="课程二维码"
/>
<!-- 二维码弹窗 -->
</div>
</template>
<script>
@@ -1833,7 +1839,7 @@ import { message } from "ant-design-vue";
import * as apitl from "../../api/index";
import { getTask } from "../../api/indexTaskadd";
import { editProj } from "../../api/indexTaskadd";
import { toDate } from "../../api/method";
import { toDate, codeUrl } from "../../api/method";
import projSet from "../../components/Modals/projSet";
import { overview } from "../../api/indexProjStu";
import TwoDimensionalCode from "../../components/TwoDimensionalCode.vue";
@@ -1975,8 +1981,6 @@ export default {
huodModal: false, //活动二维码弹窗
allDelete: false, //批量删除弹窗
codevisible: false, //二维码弹窗
codeInfo: null, //二维码信息
pubproject: false,
stugroup: false,
canclestu: false,
@@ -2490,6 +2494,9 @@ export default {
isPass: false, // 是否审核未通过
passInfo: null, // 审核未通过原因说明
reviewModal: false,
codevisible: false, //二维码是否显示
codeInfo: null, //二维码标题
});
const levelList = reactive({
@@ -4020,6 +4027,46 @@ export default {
// let a = state.attach.split(",")
// state.fileList = a
});
const checkType = (type) => {
let typeRules = [
"",
"在线",
"面授",
"案例",
"作业",
"考试",
"直播",
"外链",
"讨论",
"活动",
"测评",
"评估",
"投票",
"项目",
];
return typeRules[type];
};
//显示二维码弹窗
const showCodeModel = (item) => {
state.codevisible = true;
let obj = {
title: "[" + checkType(item.type) + "]二维码",
name: item.name,
url: codeUrl,
};
state.codeInfo = obj;
};
//显示二维码弹窗
const showCodeModel2 = () => {
state.codevisible = true;
let obj = {
title: "[项目]二维码",
name: state.name,
url: codeUrl,
};
state.codeInfo = obj;
};
return {
...toRefs(state),
...toRefs(levelList),
@@ -4116,6 +4163,9 @@ export default {
submitExamine,
closeReviewModal,
recallReviewProject,
showCodeModel,
showCodeModel2,
checkType,
};
},
};