mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 17:36:45 +08:00
feat:修改传参
This commit is contained in:
26
src/App.vue
26
src/App.vue
@@ -22,9 +22,11 @@
|
|||||||
import { computed, onMounted } from "vue";
|
import { computed, onMounted } from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { boeRequest } from "@/api/request";
|
import { boeRequest, request } from "@/api/request";
|
||||||
import { GET_USER_INFO } from "@/api/ThirdApi";
|
import { GET_USER_INFO } from "@/api/ThirdApi";
|
||||||
import { getCookie } from "@/api/utils";
|
import { getCookie } from "@/api/utils";
|
||||||
|
|
||||||
|
import { USER_INFO } from "@/api/api";
|
||||||
console.log("版本1.2.0------------");
|
console.log("版本1.2.0------------");
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -34,14 +36,20 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getUserInfo() {
|
function getUserInfo() {
|
||||||
boeRequest(GET_USER_INFO).then((res) => {
|
if (
|
||||||
console.log(222222222);
|
import.meta.env.MODE === "development" ||
|
||||||
console.log(res);
|
import.meta.env.MODE === "test"
|
||||||
res.result.avatar = res.result.avatar
|
) {
|
||||||
? res.result.avatar
|
request(USER_INFO, {}).then((res) => {
|
||||||
: "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
|
store.commit("SET_USER", res.data);
|
||||||
store.commit("SET_USER", res.result);
|
});
|
||||||
});
|
} else {
|
||||||
|
boeRequest(GET_USER_INFO).then((res) => {
|
||||||
|
res.result.avatar =
|
||||||
|
res.result.avatar || "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
|
||||||
|
store.commit("SET_USER", res.result);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
* @Author: lixg lixg@dongwu-inc.com
|
* @Author: lixg lixg@dongwu-inc.com
|
||||||
* @Date: 2023-01-13 11:42:48
|
* @Date: 2023-01-13 11:42:48
|
||||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||||
* @LastEditTime: 2023-02-06 18:39:13
|
* @LastEditTime: 2023-02-07 17:36:05
|
||||||
* @FilePath: /stu_h5/src/api/api.js
|
* @FilePath: /stu_h5/src/api/api.js
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
*/
|
*/
|
||||||
export const BASE = 'http://localhost:3000'
|
export const BASE = 'http://localhost:3000'
|
||||||
export const LOGIN = '/admin/CheckUser/userLogin post'
|
export const LOGIN = '/admin/CheckUser/userLogin post'
|
||||||
|
export const USER_INFO = '/admin/CheckUser/userInfo'
|
||||||
export const FILE_UPLOAD = import.meta.env.VITE_BASE_API + '/file/upload'
|
export const FILE_UPLOAD = import.meta.env.VITE_BASE_API + '/file/upload'
|
||||||
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList post'
|
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList post'
|
||||||
export const ROUTER_LIST = '/stu/router/list post'
|
export const ROUTER_LIST = '/stu/router/list post'
|
||||||
@@ -57,4 +58,4 @@ export const COMMENT_PRAISE = '/comment/praise post'
|
|||||||
export const COMMENT_COLLECTION = '/comment/collection post'
|
export const COMMENT_COLLECTION = '/comment/collection post'
|
||||||
|
|
||||||
// 外部考试详情接口
|
// 外部考试详情接口
|
||||||
export const EXTERNALEXAM = `/external/exam/queryExternalExam`
|
export const EXTERNALEXAM = `/external/exam/queryExternalExam`
|
||||||
|
|||||||
@@ -172,12 +172,13 @@ import { ElMessage } from "element-plus";
|
|||||||
import { useRoute, useRouter } from "vue-router/dist/vue-router";
|
import { useRoute, useRouter } from "vue-router/dist/vue-router";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
query: { courseId, chapterOrStageId, infoId, id, btype, studentId },
|
query: { courseId, chapterOrStageId, infoId, id, btype },
|
||||||
} = useRoute();
|
} = useRoute();
|
||||||
|
const userInfo = computed(() => store.state.userInfo);
|
||||||
const { data } = useRequest(VOTE_DETAIL2, {
|
const { data } = useRequest(VOTE_DETAIL2, {
|
||||||
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
||||||
courseId: courseId,
|
courseId: courseId,
|
||||||
studentId: studentId,
|
studentId: userInfo.value.id,
|
||||||
targetId: infoId,
|
targetId: infoId,
|
||||||
type: btype,
|
type: btype,
|
||||||
});
|
});
|
||||||
@@ -207,26 +208,7 @@ let timer = setInterval(() => {
|
|||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
});
|
});
|
||||||
const state = reactive({
|
|
||||||
ballot: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
content: "录播课",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
content: "PPT+配音",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
content: "HTML5",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
content: "OTHER",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
// 答题时间
|
// 答题时间
|
||||||
const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
||||||
// 选择题目
|
// 选择题目
|
||||||
@@ -314,9 +296,10 @@ const submitVote = () => {
|
|||||||
request(VOTE_DETAIL2, {
|
request(VOTE_DETAIL2, {
|
||||||
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
||||||
courseId: courseId,
|
courseId: courseId,
|
||||||
studentId: studentId,
|
studentId: userInfo.value.id,
|
||||||
targetId: infoId,
|
targetId: infoId,
|
||||||
type: btype,
|
type: btype,
|
||||||
|
taskId: id,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("投票结果", res);
|
console.log("投票结果", res);
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ const {
|
|||||||
|
|
||||||
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
|
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
|
||||||
console.log("datadatadatadatadatadatadata", data);
|
console.log("datadatadatadatadatadatadata", data);
|
||||||
console.log("项目状态字段传递", projectStatus, projectEndTime);
|
// console.log("项目状态字段传递", projectStatus, projectEndTime);
|
||||||
|
|
||||||
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
|
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
|
||||||
|
|
||||||
|
|||||||
@@ -102,18 +102,9 @@ const returnclick = () => {
|
|||||||
router.back();
|
router.back();
|
||||||
};
|
};
|
||||||
const {
|
const {
|
||||||
query: {
|
query: { courseId: workId, type, id: taskId, infoId },
|
||||||
courseId: workId,
|
|
||||||
type,
|
|
||||||
id: taskId,
|
|
||||||
pName,
|
|
||||||
sName,
|
|
||||||
projectStatus,
|
|
||||||
projectEndTime,
|
|
||||||
infoId,
|
|
||||||
},
|
|
||||||
} = useRoute();
|
} = useRoute();
|
||||||
console.log("type", type);
|
// console.log("type", type);
|
||||||
const { data } =
|
const { data } =
|
||||||
taskId && taskId !== "undefined"
|
taskId && taskId !== "undefined"
|
||||||
? useRequest(TASK_WORK_DETAIL, { workId, taskId })
|
? useRequest(TASK_WORK_DETAIL, { workId, taskId })
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ const commitClick = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
path: "/surveydetail",
|
path: "/investigatpage",
|
||||||
query: {
|
query: {
|
||||||
courseId: data.value.assessmentId,
|
courseId: data.value.assessmentId,
|
||||||
infoId: data.value.liveId,
|
infoId: data.value.liveId,
|
||||||
|
|||||||
@@ -72,17 +72,17 @@ const {
|
|||||||
status,
|
status,
|
||||||
chapterOrStageId,
|
chapterOrStageId,
|
||||||
infoId,
|
infoId,
|
||||||
studentId,
|
|
||||||
},
|
},
|
||||||
} = useRoute();
|
} = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
console.log("外链信息", linkId);
|
console.log("外链信息", linkId);
|
||||||
const { data } = useRequest(LINK_DETAILS(linkId));
|
const { data } = useRequest(LINK_DETAILS(linkId));
|
||||||
console.log("外链信息", data);
|
console.log("外链信息", data);
|
||||||
|
const userInfo = computed(() => store.state.userInfo);
|
||||||
const goOuterChain = () => {
|
const goOuterChain = () => {
|
||||||
status != 1 &&
|
status != 1 &&
|
||||||
request(STUDY_RECORD, {
|
request(STUDY_RECORD, {
|
||||||
studentId: studentId,
|
studentId: userInfo.value.id,
|
||||||
targetId: infoId,
|
targetId: infoId,
|
||||||
logo: type,
|
logo: type,
|
||||||
stageOrChapterId: chapterOrStageId,
|
stageOrChapterId: chapterOrStageId,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const returnclick = () => {
|
|||||||
};
|
};
|
||||||
const { data } = useRequest(ROUTER_PROCESS, { routerId });
|
const { data } = useRequest(ROUTER_PROCESS, { routerId });
|
||||||
const userInfo = computed(() => store.state.userInfo);
|
const userInfo = computed(() => store.state.userInfo);
|
||||||
console.log("lalalallala", data);
|
console.log("lalalallala", data, userInfo);
|
||||||
const activeName = ref("first");
|
const activeName = ref("first");
|
||||||
|
|
||||||
const handleClick = (tab, event) => {
|
const handleClick = (tab, event) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: lixg lixg@dongwu-inc.com
|
* @Author: lixg lixg@dongwu-inc.com
|
||||||
* @Date: 2023-01-19 11:28:11
|
* @Date: 2023-01-19 11:28:11
|
||||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||||
* @LastEditTime: 2023-02-06 16:35:56
|
* @LastEditTime: 2023-02-07 16:01:06
|
||||||
* @FilePath: /stu_h5/src/views/projectdetails/ProjectPath.vue
|
* @FilePath: /stu_h5/src/views/projectdetails/ProjectPath.vue
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
-->
|
-->
|
||||||
@@ -179,14 +179,14 @@ const handleClick = (tab, event) => {
|
|||||||
console.log("selectTab", selectTab.value);
|
console.log("selectTab", selectTab.value);
|
||||||
};
|
};
|
||||||
const goDetails = () => {
|
const goDetails = () => {
|
||||||
router.push({
|
|
||||||
path: "/pathmappage",
|
|
||||||
query: { routerId: 290 },
|
|
||||||
});
|
|
||||||
// router.push({
|
// router.push({
|
||||||
// path: "/projectdetails",
|
// path: "/pathmappage",
|
||||||
// query: { projectId: 3 },
|
// query: { routerId: 290 },
|
||||||
// });
|
// });
|
||||||
|
router.push({
|
||||||
|
path: "/projectdetails",
|
||||||
|
query: { projectId: 485 },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ const types = ref({
|
|||||||
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
||||||
// 5: "/externalexam",
|
// 5: "/externalexam",
|
||||||
6: "/livebroadcast",
|
6: "/livebroadcast",
|
||||||
7: ({ targetId }) => window.open(targetId, "_top"),
|
7: "/outerchain", //外联
|
||||||
8: "/discusspage",
|
8: "/discusspage",
|
||||||
9: "/moreactive",
|
9: "/moreactive",
|
||||||
// 10: ({ evaType, targetId }) =>
|
// 10: ({ evaType, targetId }) =>
|
||||||
@@ -241,7 +241,7 @@ const types = ref({
|
|||||||
// "_top"
|
// "_top"
|
||||||
// ), //测评
|
// ), //测评
|
||||||
10: "/evaluation", //测评
|
10: "/evaluation", //测评
|
||||||
11: "/surveydetail",
|
11: "/investigatpage",
|
||||||
12: "/ballotpage",
|
12: "/ballotpage",
|
||||||
13: "/projectdetails",
|
13: "/projectdetails",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user