diff --git a/src/layout/knowledgePage.vue b/src/layout/knowledgePage.vue index ebd26fc..dcbb5ef 100644 --- a/src/layout/knowledgePage.vue +++ b/src/layout/knowledgePage.vue @@ -8,16 +8,19 @@ <!-- 左边按钮 --> <button class="submit-left" @click="SubLeft"></button> <div class="question-body"> + <div class="sumTotal">第一个/共X个</div> <div class="question">知识点学习</div> - <el-scrollbar height="200px"> + + <el-scrollbar height="210px"> <div class="txt" v-html="Text"></div> </el-scrollbar> + <div class="finished">已学习</div> </div> <div class="submit-buttons"> <!-- <button class="submit-btn" @click="reset">退出</button> --> <!-- <button class="submit-btn" @click="enter">进入仿真实验</button> --> - <router-link class="submit-btn" to="">退出</router-link> - <router-link class="submit-btn" to="/program">进入仿真实验</router-link> + <router-link class="submit-btn" to="">返回</router-link> + <router-link class="submit-btn" to="/program">完成学习</router-link> </div> </div> @@ -109,6 +112,7 @@ onMounted(() => { getContent() }); } .question-body { + position: relative; background: url("@/assets/images/FakeAnimateForPrototype.png") no-repeat center center; /* 添加 background-position */ background-size: 99%; @@ -124,6 +128,18 @@ onMounted(() => { getContent() }); padding-right: 50px; padding-top: 30px; + .sumTotal { + font-size: 30px; + /* 字体大小 */ + text-align: right; + /* 水平居中 */ + letter-spacing: 3px; + /* 字符间距,单位可以是 px、em 等 */ + color: #dc4758; + margin-top: 48px; + margin-bottom: -50px; + } + .question { font-size: 42px; /* 字体大小 */ @@ -131,7 +147,7 @@ onMounted(() => { getContent() }); /* 水平居中 */ letter-spacing: 3px; /* 字符间距,单位可以是 px、em 等 */ - margin-top: 45px; + margin-top: 25px; margin-bottom: 20px; color: #fff; } @@ -163,6 +179,18 @@ onMounted(() => { getContent() }); /* 行间距,1.5 表示字体大小的 1.5 倍 */ color: #9b9a9a; } + + .finished { + font-size: 30px; + /* 字体大小 */ + text-align: right; + /* 水平居中 */ + letter-spacing: 3px; + /* 字符间距,单位可以是 px、em 等 */ + color: #dc4758; + margin-top: -235px; + margin-right: 20px; + } } .submit-buttons { diff --git a/src/layout/spacePage.vue b/src/layout/spacePage.vue index a42c19a..2a755b4 100644 --- a/src/layout/spacePage.vue +++ b/src/layout/spacePage.vue @@ -14,7 +14,7 @@ <p>学生8527</p> <button class="btn1" @click="handleHomeClick">首页</button> <button class="btn2" @click="handleRecordClick">学习/成绩记录</button> - <button class="btn3" @click="handlePasswordClick">密码管理</button> + <button class="btn3" @click="handlePasswordClick">重置密码</button> </div> <div class="rightBoxes"> <div class="topBox"> @@ -25,7 +25,7 @@ 用户账号 </div> <div class="right"> - <el-input v-model="formModel.username" style="border-color: #20bec8;"></el-input> + <el-input disabled v-model="formModel.username" style="border-color: #20bec8;"></el-input> </div> </el-form-item> <el-form-item prop="name" class="custom-form-item"> @@ -34,7 +34,7 @@ 姓名 </div> <div class="right"> - <el-input v-model="formModel.name" style="border-color: #20bec8;"></el-input> + <el-input v-model="formModel.realname" style="border-color: #20bec8;"></el-input> </div> </div> </el-form-item> @@ -57,7 +57,7 @@ 学号 </div> <div class="right"> - <el-input v-model="formModel.studentNumb" + <el-input v-model="formModel.studentNumb" style="border-color: #20bec8"></el-input> </div> </div> @@ -68,7 +68,7 @@ 手机号 </div> <div class="right"> - <el-input v-model="formModel.mobile" style="border-color: #20bec8"></el-input> + <el-input v-model="formModel.phone" style="border-color: #20bec8"></el-input> </div> </div> </el-form-item> @@ -78,7 +78,7 @@ 成绩 </div> <div class="right"> - <el-input v-model="formModel.score" style="border-color: #20bec8"></el-input> + <el-input-number disabled v-model="formModel.score" style="border-color: #20bec8"></el-input-number> </div> </div> </el-form-item> @@ -94,12 +94,12 @@ <script setup lang="ts" name="spacePage"> -import { ref } from "vue" +import { ref,onMounted } from "vue" import { useRouter } from 'vue-router' import settingStore from "@/store/modules/setting"; const setting = settingStore(); import userStore from '@/store/modules/user'; - +import { getUserInfo } from "@/api"; const router = useRouter() const user = userStore(); const loginFn = () => { @@ -108,7 +108,6 @@ const loginFn = () => { const handleHomeClick = () => { // 处理首页按钮点击逻辑,如路由跳转 console.log('首页按钮被点击'); - router.push('/studyPage') }; const handleRecordClick = () => { console.log('学习/成绩记录按钮被点击'); @@ -120,12 +119,20 @@ const handlePasswordClick = () => { const formRef = ref(); const formModel = ref({ username: "", - name: "", + realname: "", clssid: '', studentNumb: "", - mobile: '', + phone: '', score: '' }); +const getUser=async()=>{ + const res: any = await getUserInfo(); + formModel.value = res.result.userInfo; + console.log(formModel, 'formModel'); +} + + + const rules = { username: [ { required: true, message: "请输入用户名", trigger: "blur" }, @@ -157,10 +164,13 @@ const rules = { trigger: ["change", "blur"], }, ], - score:[ - { required: true, message: "成绩", trigger: "blur" }, - ] + // score:[ + // { required: true, message: "成绩", trigger: "blur" }, + // ] }; +onMounted(()=>{ + getUser() +}) </script> <style lang="less" scoped>