Bläddra i källkod

修改测试后出现的更多测试提示

plg 3 veckor sedan
förälder
incheckning
b490daa35b

BIN
src/assets/report/com.png


BIN
src/assets/report/scale.png


+ 176 - 0
src/components/CpdmMessageV2.vue

@@ -0,0 +1,176 @@
+<script lang="ts" setup>
+import { ref, defineExpose } from 'vue'
+import { useRouter } from 'vue-router'
+import { userInfoStore } from '@/stores'
+import { ElMessage } from 'element-plus';
+import { pubMsgApi } from '@/api/plan';
+const router = useRouter()
+
+//获取缓存用户信息
+const userInfo = userInfoStore();
+//留言显示的标志
+const pub_visible = ref<boolean>(false)
+//留言的内容
+const des_input = ref<string>('')
+//用户的姓名
+const userName = ref<string>('')
+//用户的编号
+const userNo = ref<string>('');
+//用户的性别
+const userSex = ref<string>('')
+//防止重复点
+const isLock = ref<boolean>(false)
+
+const open = () => {
+    userName.value = userInfo.userInfo.userName;
+    userNo.value = userInfo.userInfo.userNo;
+    userSex.value = userInfo.userInfo.gender;
+    pub_visible.value = true
+}
+
+
+//点击进行发布信息
+const pubMsg = async () => {
+    //判断用户是否登陆了
+    if (!userInfo.token) {
+        ElMessage({
+            message: '尚未登录',
+            type: 'warning'
+        })
+        return
+    }
+    if (des_input.value == '') {
+        ElMessage({
+            message: '留言不能为空',
+            type: 'warning'
+        })
+        return
+    }
+    if (isLock.value) {
+        return
+    }
+    isLock.value = true
+    let params = {
+        userNo: userNo.value,
+        userName: userName.value,
+        commentContent: des_input.value
+    }
+    let res: any = await pubMsgApi(params)
+    if (res.code == 200) {
+        ElMessage({
+            message: '留言成功',
+            type: 'success'
+        })
+        des_input.value = ''
+        isLock.value = false
+        pub_visible.value = false
+        //开始跳转到页面测试记录页面
+        router.push({ name: 'testRecord' })
+    } else {
+        ElMessage({
+            message: res.msg,
+            type: 'error'
+        })
+    }
+    //调用新增留言的方法
+}
+//点击关闭弹出框
+const colseMessage = () => {
+    router.push({ name: 'testRecord' })
+}
+//跳转到更多测试页面
+const viewScale = () => {
+    router.push({ name: 'popularizationScience' })
+}
+
+//跳转到测试记录页面
+const viewRecord = () => {
+    router.push({ name: 'testRecord' })
+}
+
+
+defineExpose({ open })
+</script>
+<template>
+
+
+    <el-dialog v-model="pub_visible" :show-close="true" top="5vh" @closed="colseMessage" width="60%"
+        style="border-radius: 40px;  ">
+        <template #header="{ close, titleId, titleClass }">
+            <div class="my-header">
+                <div style="text-align: center;">
+
+                    <img style="width: 200px;" src="../assets/report/com.png" alt="">
+
+                </div>
+                <div style="text-align: center;margin-top:20px">
+
+                    <div style="color: #222222;">本次心理健康测评已完成</div>
+
+                </div>
+                <div style="text-align: center;margin-top:60px">
+
+                    <img style="width: 90%;" src="../assets/report/scale.png" alt="">
+
+                </div>
+
+                <!-- <div class="msg_dig">
+                    <img width="40px" v-show="userSex == '1'" src="../assets/kepu/man.png" />
+                    <img width="40px" v-show="userSex == '0'" src="../assets/kepu/woman.png" />
+                    <div style="margin-left:20px">{{ userName }}</div>
+                </div> -->
+
+                <!-- <textarea ref="des_input" rows="5" cols="43" placeholder="写下你珍贵的留言" /> -->
+                <!-- <el-input type="textarea" style="margin-top: 20px;" :autosize="{ minRows: 6 }" placeholder="写下你珍贵的留言"
+                    v-model="des_input">
+                </el-input> -->
+
+                <div class="home_mid_plan_button">
+                    <div class="pub_button" @click="viewRecord"> 查看测试记录
+                    </div>
+                    <div class="pub_button" @click="viewScale"> 试试更多测试
+                    </div>
+                </div>
+
+            </div>
+        </template>
+    </el-dialog>
+</template>
+<style lang="scss" scoped>
+:deep(.el-textarea__inner) {
+    background-color: #F7F7F7 !important;
+    border: none !important;
+    border-radius: 20px;
+    border: none !important;
+    box-shadow: none !important;
+}
+
+.msg_dig {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+}
+
+.home_mid_plan_button {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-around;
+    margin-top: 40px;
+
+    // text-align: right;
+    .pub_button {
+        cursor: pointer;
+        // width: 100px;
+        border-radius: 12px;
+        border: 3px solid #48D68E;
+        color: #ffffff;
+        background-color: #000000;
+
+        padding: 8px 30px;
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+    }
+}
+</style>

+ 3 - 0
src/utils/http.ts

@@ -19,7 +19,10 @@ const menuStatus = menuStatusStore()
 
 //创建基础访问路径
 // const base_url = 'http://10.113.248.4:8089/'
+//30
 const base_url = 'http://43.143.198.30:8089/'
+//红朵
+// const base_url = 'http://129.211.221.44:8089'
 
 //设置axios 默认访问路径
 axios.defaults.baseURL = base_url

+ 3 - 0
src/views/Plan.vue

@@ -222,6 +222,7 @@ const planNumGet = async () => {
     }
     isFinshed.value = true
 }
+
 //刚进入页面就将高度设置为页面需要的
 onMounted(() => {
     //查询计划内容
@@ -243,6 +244,7 @@ onUnmounted(() => {
 
 <template>
     <div class="home_header_out">
+
         <div class=" home_header_inner">
             <CpmdHeader />
             <div style="text-align: center;">
@@ -250,6 +252,7 @@ onUnmounted(() => {
             </div>
         </div>
         <div class="kply">
+
             <div class="kply_inner">
                 <div>
                     <div style="padding: 20px 40px;" v-show="planList.length == 0 && isFinshed">

+ 6 - 1
src/views/Report.vue

@@ -317,6 +317,10 @@ onUnmounted(() => {
     background-repeat: no-repeat;
     background-size: contain;
     background-color: #B3F1DA; //估计是需要动态
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+
 
     //获取屏幕宽度home_header_out 这个div的宽度--然后宽度*1000再除1920即为当前div的宽度
     .home_header_inner {
@@ -355,6 +359,7 @@ onUnmounted(() => {
         width: 100%;
         margin-top: 40px;
         // background-color: #FAFAFA;
+        flex: 1;
 
         .kply_inner {
             // padding: 20px 20px;
@@ -362,7 +367,7 @@ onUnmounted(() => {
             right: 0;
             margin: auto;
             width: 860px;
-            min-height: 500px;
+            // min-height: 500px;   
 
             background-color: #ffffff;
             border-radius: 40px;

+ 1 - 1
src/views/shapeIntuition_random.vue

@@ -59,7 +59,7 @@ import { userInfoStore } from '@/stores';
 import { saveEggRecordApi } from '@/api/record'
 import { format as myFormat } from 'date-fns';
 import { userPlanDetailApi } from '@/api/home';
-import CpdmMessage from '@/components/CpdmMessage.vue';
+import CpdmMessage from '@/components/CpdmMessageV2.vue';
 const userInfo = userInfoStore()
 
 export default {