feat:增加投票

This commit is contained in:
lixg
2023-02-03 21:54:59 +08:00
parent bf1fa019d5
commit 074c2da761
8 changed files with 276 additions and 178 deletions

View File

@@ -1,9 +1,8 @@
<template>
<div class="discusspage">
<ReturnHead text="讨论详情"></ReturnHead>
<div class="head clearfix">
<div class="title">
请基于公司战略方向和你所负责的组织业务发展识别3个你和你的团队在未来3年的新的能力与技能要求
</div>
<div class="title">{}</div>
</div>
<div class="preview">
@@ -75,75 +74,83 @@
</div>
</template>
<script>
<script setup>
import { reactive, toRefs } from "vue";
// import TitleHead from "@/components/TitleHead.vue";
export default {
name: "DiscussPage",
components: {},
setup() {
const state = reactive({
onfo: true,
discuss: [
{
id: 1,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
import ReturnHead from "@/components/ReturnHead.vue";
import { request, useRequest } from "@/api/request";
import { useRoute } from "vue-router/dist/vue-router";
import { useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import {
COMMENT_COLLECTION,
COMMENT_PRAISE,
DISCUSS_LIST,
QueryDiscussSubmitDetailByDiscussId,
} from "@/api/api";
pinglun: 317,
dianzan: 103,
isGood: false,
},
{
id: 2,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
const state = reactive({
onfo: true,
discuss: [
{
id: 1,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
pinglun: 317,
dianzan: 103,
isGood: false,
},
{
id: 3,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
pinglun: 317,
dianzan: 103,
isGood: false,
},
{
id: 2,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
pinglun: 317,
dianzan: 103,
isGood: false,
},
],
});
const changee = () => {
if (state.onfo !== true) {
state.onfo = !state.onfo;
}
};
const changeee = () => {
if (state.onfo == true) {
state.onfo = !state.onfo;
}
};
const getId = (it) => {
it.isGood = !it.isGood;
if (it.isGood) {
it.dianzan++;
} else {
it.dianzan--;
}
// console.log(it.isGood);
};
return {
...toRefs(state),
changee,
changeee,
getId,
};
},
pinglun: 317,
dianzan: 103,
isGood: false,
},
{
id: 3,
title: "从营销角度分析:我的团队需要这些能力",
contain:
"所谓团队协作能力,是指建立在团队的基础之上,发挥团队精神、互补互助以达到团队最大工作效率的能力。对于团队的成员来说...",
pinglun: 317,
dianzan: 103,
isGood: false,
},
],
});
const { onfo, discuss } = toRefs(state);
const changee = () => {
if (state.onfo !== true) {
state.onfo = !state.onfo;
}
};
const changeee = () => {
if (state.onfo == true) {
state.onfo = !state.onfo;
}
};
const getId = (it) => {
it.isGood = !it.isGood;
if (it.isGood) {
it.dianzan++;
} else {
it.dianzan--;
}
// console.log(it.isGood);
};
//获取讨论详情
const {
query: { id, type },
} = useRoute();
const { data } = useRequest(DISCUSS_LIST, { id: 23, type });
console.log("获取讨论", data);
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -157,7 +164,7 @@ export default {
.discusspage {
width: 100%;
.head {
margin-top: 20px;
margin-top: 10px;
display: flex;
justify-content: center;
width: 100%;