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 { useRouter, useRoute } from "vue-router";
|
||||
import { useStore } from "vuex";
|
||||
import { boeRequest } from "@/api/request";
|
||||
import { boeRequest, request } from "@/api/request";
|
||||
import { GET_USER_INFO } from "@/api/ThirdApi";
|
||||
import { getCookie } from "@/api/utils";
|
||||
|
||||
import { USER_INFO } from "@/api/api";
|
||||
console.log("版本1.2.0------------");
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
@@ -34,14 +36,20 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
function getUserInfo() {
|
||||
boeRequest(GET_USER_INFO).then((res) => {
|
||||
console.log(222222222);
|
||||
console.log(res);
|
||||
res.result.avatar = res.result.avatar
|
||||
? res.result.avatar
|
||||
: "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
|
||||
store.commit("SET_USER", res.result);
|
||||
});
|
||||
if (
|
||||
import.meta.env.MODE === "development" ||
|
||||
import.meta.env.MODE === "test"
|
||||
) {
|
||||
request(USER_INFO, {}).then((res) => {
|
||||
store.commit("SET_USER", res.data);
|
||||
});
|
||||
} 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>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
* @Author: lixg lixg@dongwu-inc.com
|
||||
* @Date: 2023-01-13 11:42:48
|
||||
* @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
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
export const BASE = 'http://localhost:3000'
|
||||
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 ROUTER_CHAPTER_LIST = '/stu/router/chapterList post'
|
||||
export const ROUTER_LIST = '/stu/router/list post'
|
||||
|
||||
@@ -172,12 +172,13 @@ import { ElMessage } from "element-plus";
|
||||
import { useRoute, useRouter } from "vue-router/dist/vue-router";
|
||||
|
||||
const {
|
||||
query: { courseId, chapterOrStageId, infoId, id, btype, studentId },
|
||||
query: { courseId, chapterOrStageId, infoId, id, btype },
|
||||
} = useRoute();
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
const { data } = useRequest(VOTE_DETAIL2, {
|
||||
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
||||
courseId: courseId,
|
||||
studentId: studentId,
|
||||
studentId: userInfo.value.id,
|
||||
targetId: infoId,
|
||||
type: btype,
|
||||
});
|
||||
@@ -207,26 +208,7 @@ let timer = setInterval(() => {
|
||||
onUnmounted(() => {
|
||||
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");
|
||||
// 选择题目
|
||||
@@ -314,9 +296,10 @@ const submitVote = () => {
|
||||
request(VOTE_DETAIL2, {
|
||||
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
|
||||
courseId: courseId,
|
||||
studentId: studentId,
|
||||
studentId: userInfo.value.id,
|
||||
targetId: infoId,
|
||||
type: btype,
|
||||
taskId: id,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("投票结果", res);
|
||||
|
||||
@@ -403,7 +403,7 @@ const {
|
||||
|
||||
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
|
||||
console.log("datadatadatadatadatadatadata", data);
|
||||
console.log("项目状态字段传递", projectStatus, projectEndTime);
|
||||
// console.log("项目状态字段传递", projectStatus, projectEndTime);
|
||||
|
||||
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
|
||||
|
||||
|
||||
@@ -102,18 +102,9 @@ const returnclick = () => {
|
||||
router.back();
|
||||
};
|
||||
const {
|
||||
query: {
|
||||
courseId: workId,
|
||||
type,
|
||||
id: taskId,
|
||||
pName,
|
||||
sName,
|
||||
projectStatus,
|
||||
projectEndTime,
|
||||
infoId,
|
||||
},
|
||||
query: { courseId: workId, type, id: taskId, infoId },
|
||||
} = useRoute();
|
||||
console.log("type", type);
|
||||
// console.log("type", type);
|
||||
const { data } =
|
||||
taskId && taskId !== "undefined"
|
||||
? useRequest(TASK_WORK_DETAIL, { workId, taskId })
|
||||
|
||||
@@ -312,7 +312,7 @@ const commitClick = () => {
|
||||
});
|
||||
|
||||
router.push({
|
||||
path: "/surveydetail",
|
||||
path: "/investigatpage",
|
||||
query: {
|
||||
courseId: data.value.assessmentId,
|
||||
infoId: data.value.liveId,
|
||||
|
||||
@@ -72,17 +72,17 @@ const {
|
||||
status,
|
||||
chapterOrStageId,
|
||||
infoId,
|
||||
studentId,
|
||||
},
|
||||
} = useRoute();
|
||||
const router = useRouter();
|
||||
console.log("外链信息", linkId);
|
||||
const { data } = useRequest(LINK_DETAILS(linkId));
|
||||
console.log("外链信息", data);
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
const goOuterChain = () => {
|
||||
status != 1 &&
|
||||
request(STUDY_RECORD, {
|
||||
studentId: studentId,
|
||||
studentId: userInfo.value.id,
|
||||
targetId: infoId,
|
||||
logo: type,
|
||||
stageOrChapterId: chapterOrStageId,
|
||||
|
||||
@@ -138,7 +138,7 @@ const returnclick = () => {
|
||||
};
|
||||
const { data } = useRequest(ROUTER_PROCESS, { routerId });
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
console.log("lalalallala", data);
|
||||
console.log("lalalallala", data, userInfo);
|
||||
const activeName = ref("first");
|
||||
|
||||
const handleClick = (tab, event) => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: lixg lixg@dongwu-inc.com
|
||||
* @Date: 2023-01-19 11:28:11
|
||||
* @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
|
||||
* @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);
|
||||
};
|
||||
const goDetails = () => {
|
||||
router.push({
|
||||
path: "/pathmappage",
|
||||
query: { routerId: 290 },
|
||||
});
|
||||
// router.push({
|
||||
// path: "/projectdetails",
|
||||
// query: { projectId: 3 },
|
||||
// path: "/pathmappage",
|
||||
// query: { routerId: 290 },
|
||||
// });
|
||||
router.push({
|
||||
path: "/projectdetails",
|
||||
query: { projectId: 485 },
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ const types = ref({
|
||||
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
||||
// 5: "/externalexam",
|
||||
6: "/livebroadcast",
|
||||
7: ({ targetId }) => window.open(targetId, "_top"),
|
||||
7: "/outerchain", //外联
|
||||
8: "/discusspage",
|
||||
9: "/moreactive",
|
||||
// 10: ({ evaType, targetId }) =>
|
||||
@@ -241,7 +241,7 @@ const types = ref({
|
||||
// "_top"
|
||||
// ), //测评
|
||||
10: "/evaluation", //测评
|
||||
11: "/surveydetail",
|
||||
11: "/investigatpage",
|
||||
12: "/ballotpage",
|
||||
13: "/projectdetails",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user