Commit 0c211d95 authored by 罗超's avatar 罗超

1

parent ce6bbf99
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
startIndex: Number, startIndex: Number,
}, },
setup(props, context) { setup(props, context) {
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
props.paperData.DetailsList.forEach((item, index) => { props.paperData.DetailsList.forEach((item, index) => {
item.myAnswer = ""; item.myAnswer = "";
}); });
...@@ -106,9 +106,9 @@ export default { ...@@ -106,9 +106,9 @@ export default {
} }
}, },
sendData(item1) { sendData(item1) {
if(item1.Answer&&item1.Answer!=''){ if (item1.Answer && item1.Answer != "") {
item1.IsRes = true; item1.IsRes = true;
}else{ } else {
item1.IsRes = false; item1.IsRes = false;
} }
context.emit("answerChange", data.data); context.emit("answerChange", data.data);
......
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
let data = JSON.parse(decodeURIComponent(options.data)); let data = JSON.parse(decodeURIComponent(options.data));
let n = 0; let n = 0;
data.DataObj.LeaveInfoList.map((item) => { data.DataObj.LeaveInfoList.map((item) => {
...@@ -214,9 +214,9 @@ export default { ...@@ -214,9 +214,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "请假详情", title: "请假详情",
}); });
ctx.data.detail = data; proxy.data.detail = data;
ctx.data.detail.hours = n; proxy.data.detail.hours = n;
ctx.getDetail(data.Id); proxy.getDetail(data.Id);
}, },
}; };
</script> </script>
......
...@@ -42,11 +42,11 @@ export default { ...@@ -42,11 +42,11 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "章节学习内容", title: "章节学习内容",
}); });
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
let data = JSON.parse(decodeURIComponent(options.con)); let data = JSON.parse(decodeURIComponent(options.con));
ctx.data.node = data; proxy.data.node = data;
ctx.data.richText = decodeURIComponent(data.ChapterContent); proxy.data.richText = decodeURIComponent(data.ChapterContent);
console.log(44, ctx.data.node); console.log(44, proxy.data.node);
}, },
}; };
</script> </script>
......
...@@ -102,9 +102,9 @@ export default { ...@@ -102,9 +102,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "课程", title: "课程",
}); });
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
ctx.msg.CourseId = options.id; proxy.msg.CourseId = options.id;
ctx.getdata(); proxy.getdata();
}, },
}; };
</script> </script>
......
...@@ -256,11 +256,11 @@ export default { ...@@ -256,11 +256,11 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
ctx.msg.StartTime = getToday(); proxy.msg.StartTime = getToday();
ctx.msg.EndTime = getToday(); proxy.msg.EndTime = getToday();
ctx.msg.ClassId = JSON.parse(options.classId); proxy.msg.ClassId = JSON.parse(options.classId);
ctx.getData(); proxy.getData();
}, },
}; };
</script> </script>
......
...@@ -98,7 +98,11 @@ ...@@ -98,7 +98,11 @@
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
<view class="mytest flex"> <view class="mytest flex">
<view v-if="indexData.paperList.length == 0"
><van-empty description="暂无数据"
/></view>
<view <view
v-if="indexData.paperList.length > 0"
v-for="(item, index) in indexData.paperList" v-for="(item, index) in indexData.paperList"
:key="index" :key="index"
class="test-item no_shrink" class="test-item no_shrink"
...@@ -163,8 +167,8 @@ export default { ...@@ -163,8 +167,8 @@ export default {
props: {}, props: {},
components: {}, components: {},
setup(props) { setup(props) {
let { ctx } = getCurrentInstance(); let { proxy } = getCurrentInstance();
ctx.$isLogin(); proxy.$isLogin();
let data = reactive({ let data = reactive({
statusBarHeight: 0, statusBarHeight: 0,
userinfo: {}, userinfo: {},
...@@ -189,14 +193,14 @@ export default { ...@@ -189,14 +193,14 @@ export default {
desc: "上到哪里了", desc: "上到哪里了",
img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon4.png", img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon4.png",
bgcolor: "#FFEFE4", bgcolor: "#FFEFE4",
jumpUrl: "/pages/progress/progress", jumpUrl: `/pages/progress/progress`,
}, },
{ {
name: "剩余课时", name: "剩余课时",
desc: "100", desc: "100",
img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon3.png", img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon3.png",
bgcolor: "#FFEAFE", bgcolor: "#FFEAFE",
jumpUrl: "/pages/surplusTime/surplusTime", jumpUrl: `/pages/surplusTime/surplusTime`,
}, },
{ {
name: "电子合同", name: "电子合同",
......
...@@ -61,7 +61,7 @@ import { ...@@ -61,7 +61,7 @@ import {
onMounted, onMounted,
} from "vue"; } from "vue";
import { getProgress } from "../../api/index"; import { getProgress } from "../../api/index";
let { CourseName } = uni.getStorageSync("indexData"); import { getIndexInfo } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
], ],
}, },
], ],
CourseName, CourseName: "",
}); });
let methods = { let methods = {
openLayer() { openLayer() {
...@@ -97,6 +97,12 @@ export default { ...@@ -97,6 +97,12 @@ export default {
data.data = res.Data; data.data = res.Data;
console.log(113, data); console.log(113, data);
}, },
async getIndexdata() {
let res = await getIndexInfo();
if (res) {
data.CourseName = res.Data.CourseName;
}
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...@@ -107,9 +113,9 @@ export default { ...@@ -107,9 +113,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "进度", title: "进度",
}); });
let { ctx } = getCurrentInstance(); this.msg.ClassId = parseInt(options.id);
ctx.msg.ClassId = parseInt(options.id); this.getData();
ctx.getData(); this.getIndexdata();
}, },
}; };
</script> </script>
......
...@@ -76,13 +76,13 @@ import { ...@@ -76,13 +76,13 @@ import {
onMounted, onMounted,
} from "vue"; } from "vue";
import { getStundentSurplus } from "../../api/index"; import { getStundentSurplus } from "../../api/index";
let { CourseName, SurplusHours } = uni.getStorageSync("indexData"); import { getIndexInfo } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
showLayer: false, showLayer: false,
CourseName, CourseName: "",
SurplusHours, SurplusHours: 0,
msg: { ClassId: 0 }, msg: { ClassId: 0 },
data: [], data: [],
}); });
...@@ -99,6 +99,13 @@ export default { ...@@ -99,6 +99,13 @@ export default {
data.data = res.Data; data.data = res.Data;
} }
}, },
async getIndexdata() {
let res = await getIndexInfo();
if (res) {
data.CourseName = res.Data.CourseName;
data.SurplusHours = res.Data.SurplusHours;
}
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...@@ -109,9 +116,9 @@ export default { ...@@ -109,9 +116,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "剩余时间", title: "剩余时间",
}); });
let { ctx } = getCurrentInstance(); this.msg.ClassId = parseInt(options.id);
ctx.msg.ClassId = parseInt(options.id); this.getData();
ctx.getData(); this.getIndexdata();
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment