|
@@ -1,15 +1,24 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import CpmdHeader from '@/components/CpmdHeader.vue';
|
|
import CpmdHeader from '@/components/CpmdHeader.vue';
|
|
|
|
+import CpmdQuestionnaire from '@/components/CpmdQuestionnaire.vue'
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
import { menuStatusStore, userInfoStore } from '@/stores'
|
|
import { menuStatusStore, userInfoStore } from '@/stores'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import { isHaveManage } from '../utils/test'
|
|
import { isHaveManage } from '../utils/test'
|
|
-import { userPlanApi } from '@/api/home';
|
|
|
|
|
|
+import { queryIsQuestionApi, userPlanApi } from '@/api/home';
|
|
const userInfo = userInfoStore()
|
|
const userInfo = userInfoStore()
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const menuStatus = menuStatusStore();
|
|
const menuStatus = menuStatusStore();
|
|
menuStatus.saveActiveIndex('1')
|
|
menuStatus.saveActiveIndex('1')
|
|
|
|
|
|
|
|
+//是否需要做问卷调查
|
|
|
|
+const isNeed = ref<boolean>(false)
|
|
|
|
+//planId
|
|
|
|
+//需要问卷调查的计划ID
|
|
|
|
+const planId = ref<string>('')
|
|
|
|
+//调用子组件的ref
|
|
|
|
+const question = ref<any>()
|
|
|
|
+
|
|
//点击查看更多展开科普乐园的标志
|
|
//点击查看更多展开科普乐园的标志
|
|
const moreFlag = ref<boolean>(false)
|
|
const moreFlag = ref<boolean>(false)
|
|
|
|
|
|
@@ -32,7 +41,8 @@ const taskCircleFlag = ref<boolean>(true)
|
|
//打开任务去看看
|
|
//打开任务去看看
|
|
const openSquare = () => {
|
|
const openSquare = () => {
|
|
// taskSequareFlag.value = true
|
|
// taskSequareFlag.value = true
|
|
- goView()
|
|
|
|
|
|
+ // goView()
|
|
|
|
+ question.value.open(planId.value)
|
|
}
|
|
}
|
|
//点击关闭按钮触发
|
|
//点击关闭按钮触发
|
|
const closeSquare = () => {
|
|
const closeSquare = () => {
|
|
@@ -62,9 +72,25 @@ onMounted(() => {
|
|
window.addEventListener('resize', setHeight);
|
|
window.addEventListener('resize', setHeight);
|
|
forStatus()
|
|
forStatus()
|
|
planNumGet()
|
|
planNumGet()
|
|
|
|
+ queryIsQuestion()
|
|
|
|
+ //查询是否需要填写问卷调查
|
|
|
|
+
|
|
//进到界面开始轮询
|
|
//进到界面开始轮询
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+//
|
|
|
|
+const queryIsQuestion = async () => {
|
|
|
|
+ let res: any = await queryIsQuestionApi()
|
|
|
|
+ console.log("res")
|
|
|
|
+ planId.value = res.data;
|
|
|
|
+ if (planId.value == null) {
|
|
|
|
+ //设置标识不显示
|
|
|
|
+ isNeed.value = false
|
|
|
|
+ } else {
|
|
|
|
+ //设置标志显示
|
|
|
|
+ isNeed.value = true
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
//界面销毁函数
|
|
//界面销毁函数
|
|
|
|
|
|
@@ -74,15 +100,10 @@ const forStatus = () => {
|
|
clearInterval(flag_time.value)
|
|
clearInterval(flag_time.value)
|
|
// flag_text.value == 2
|
|
// flag_text.value == 2
|
|
flag_time.value = setInterval(() => {
|
|
flag_time.value = setInterval(() => {
|
|
- console.log('定时器')
|
|
|
|
- console.log(flag_text.value)
|
|
|
|
flag_text.value = flag_text.value + 1
|
|
flag_text.value = flag_text.value + 1
|
|
if (flag_text.value > 4) {
|
|
if (flag_text.value > 4) {
|
|
flag_text.value = 1
|
|
flag_text.value = 1
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}, 3000)
|
|
}, 3000)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -113,7 +134,8 @@ const brightStatusLevel = () => {
|
|
forStatus()
|
|
forStatus()
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+//进来查看需不需要做问卷调查
|
|
|
|
+//查看是否需要测试
|
|
|
|
|
|
//获取计划剩余多少个正在进行的
|
|
//获取计划剩余多少个正在进行的
|
|
//isHaveManage//
|
|
//isHaveManage//
|
|
@@ -279,14 +301,23 @@ const planNumGet = async () => {
|
|
<img width="100%" style="margin-top:40px;" src="../assets/kepu/bg2.png" />
|
|
<img width="100%" style="margin-top:40px;" src="../assets/kepu/bg2.png" />
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
|
|
|
|
|
|
+ <!-- <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
|
|
ref="plan_jihua">
|
|
ref="plan_jihua">
|
|
<div class=" badge_custom">
|
|
<div class=" badge_custom">
|
|
{{ userInfo.planCurrentNum }}
|
|
{{ userInfo.planCurrentNum }}
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <img src="../assets/home/jihua_img.png" />
|
|
|
|
+ </div> -->
|
|
|
|
+ <div class="home_mid_plan" v-show="isNeed" @click="openSquare" ref="plan_jihua">
|
|
|
|
+ <div class=" badge_custom">
|
|
|
|
+ 问卷
|
|
</div>
|
|
</div>
|
|
<img src="../assets/home/jihua_img.png" />
|
|
<img src="../assets/home/jihua_img.png" />
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
+ <CpmdQuestionnaire ref="question" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
@@ -305,7 +336,7 @@ const planNumGet = async () => {
|
|
color: 10px;
|
|
color: 10px;
|
|
padding: 8px;
|
|
padding: 8px;
|
|
font-weight: 300;
|
|
font-weight: 300;
|
|
- font-size: 16px;
|
|
|
|
|
|
+ font-size: 10px;
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
border-radius: 30px;
|
|
border-radius: 30px;
|
|
}
|
|
}
|