Commit 25b3c46b authored by 罗超's avatar 罗超

1

parent 405b4c18
import request from '../utils/request.js'
/**
* 获取活动类型列表
* @param {JSON参数} data
*/
export function getActivityTypeList(data) {
return request({
url: '/AppletEducation/GetActivityTypeList',
method: 'post',
data
})
}
/**
* 获取活动列表
* @param {JSON参数} data
*/
export function getActivityList(data) {
return request({
url: '/AppletEducation/GetActivityPageJXH',
method: 'post',
data
})
}
\ No newline at end of file
...@@ -5,17 +5,26 @@ ...@@ -5,17 +5,26 @@
<view class="name"> <view class="name">
<view class="grow"> <view class="grow">
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }} {{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text style="color: #999999">(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text> <text style="color: #999999"
>(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text
>
</view> </view>
<view class="ExamIndex_Box"> <view class="ExamIndex_Box">
<text class="Single_Before">{{ ExamIndex }}</text>/<text <text class="Single_Before">{{ ExamIndex }}</text
class="Exam_Total">{{ data.DetailsList.length }}</text> >/<text class="Exam_Total">{{ data.DetailsList.length }}</text>
</view> </view>
</view> </view>
<swiper class="swiper-box" :style="{ <swiper
class="swiper-box"
:style="{
height: `calc(100vh - 300rpx - ${statusBarHeight}px)`, height: `calc(100vh - 300rpx - ${statusBarHeight}px)`,
}" :autoplay="autoplay" :current="current" @change="onchange" :skip-hidden-item-layout="true" }"
:disable-programmatic-animation="true"> :autoplay="autoplay"
:current="current"
@change="onchange"
:skip-hidden-item-layout="true"
:disable-programmatic-animation="true"
>
<swiper-item v-if="sortIndex != 1"></swiper-item> <swiper-item v-if="sortIndex != 1"></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1"> <swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1">
<view class="item1"> <view class="item1">
...@@ -23,19 +32,35 @@ ...@@ -23,19 +32,35 @@
<view class="num" v-html="item1.Title"></view> <view class="num" v-html="item1.Title"></view>
</view> </view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" <view
class="flex item2 flex_start_center"> v-for="(item2, index2) in item1.QuestionContentObj"
:key="index2"
class="flex item2 flex_start_center"
>
<template v-if="isOperate"> <template v-if="isOperate">
<view class="chooseNum" :class="{ myAnswer: item2.IsAnswer }" <view
@click="change(item1, item2)">{{ item2.ShowName }} class="chooseNum"
:class="{ myAnswer: item2.IsAnswer }"
@click="change(item1, item2)"
>{{ item2.ShowName }}
</view> </view>
<view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view> <view
class="chooseName"
@click="change(item1, item2)"
v-html="item2.Content"
></view>
</template> </template>
<template v-else> <template v-else>
<view class="chooseNum" :class="{ isTrueAnswer: item2.IsAnswer }">{{ item2.Name }} <view
class="chooseNum"
:class="{ isTrueAnswer: item2.IsAnswer }"
>{{ item2.Name }}
</view> </view>
<view class="chooseName" :class="{ isTrueAnswer: item2.IsAnswer }" <view
v-html="item2.Content"> class="chooseName"
:class="{ isTrueAnswer: item2.IsAnswer }"
v-html="item2.Content"
>
</view> </view>
</template> </template>
</view> </view>
...@@ -43,20 +68,30 @@ ...@@ -43,20 +68,30 @@
<view class="AnswerContent" v-if="!isOperate"> <view class="AnswerContent" v-if="!isOperate">
<view> <view>
<text style="color: #8c8a94">正确答案:</text> <text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{item1.Answer}}</text> <text class="isTrueAnswer">{{ item1.Answer }}</text
<text>您的答案是: >
<text
>您的答案是:
<template v-if="item1.StundetAnswer != ''"> <template v-if="item1.StundetAnswer != ''">
<text v-if="item1.Answer == item1.StundetAnswer" class="isTrueAnswer"> <text
v-if="item1.Answer == item1.StundetAnswer"
class="isTrueAnswer"
>
{{ item1.StundetAnswer }},回答正确 {{ item1.StundetAnswer }},回答正确
</text> </text>
<text v-else class="isNotAnswer">{{ item1.StundetAnswer }},回答错误</text> <text v-else class="isNotAnswer"
>{{ item1.StundetAnswer }},回答错误</text
>
</template> </template>
<template v-else> <template v-else>
<text>未作答</text> <text>未作答</text>
</template> </template>
</text> </text>
</view> </view>
<view style="margin-top: 20rpx; word-wrap: break-word" v-if="item1.AnswerParse"> <view
style="margin-top: 20rpx; word-wrap: break-word"
v-if="item1.AnswerParse"
>
<text style="color: #8c8a94">解析:</text> <text style="color: #8c8a94">解析:</text>
<text style="color: #000">{{ item1.AnswerParse }}</text> <text style="color: #000">{{ item1.AnswerParse }}</text>
</view> </view>
...@@ -72,7 +107,7 @@ ...@@ -72,7 +107,7 @@
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
...@@ -81,11 +116,9 @@ ...@@ -81,11 +116,9 @@
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { import { changeNumToHan } from "../../utils/index";
changeNumToHan export default {
} from "../../utils/index";
export default {
props: { props: {
paperData: Object, paperData: Object,
sort: Number, sort: Number,
...@@ -95,9 +128,7 @@ ...@@ -95,9 +128,7 @@
isOperate: Boolean, isOperate: Boolean,
}, },
setup(props, context) { setup(props, context) {
let { let { ctx } = getCurrentInstance();
ctx
} = getCurrentInstance();
let data = reactive({ let data = reactive({
autoplay: false, autoplay: false,
sortIndex: props.sort + 1, //大题序号 sortIndex: props.sort + 1, //大题序号
...@@ -165,7 +196,7 @@ ...@@ -165,7 +196,7 @@
uni.navigateTo({ uni.navigateTo({
url: "/pages/exam/answerSheet", url: "/pages/exam/answerSheet",
}); });
} },
}; };
onMounted(() => { onMounted(() => {
if (props.isLast) { if (props.isLast) {
...@@ -183,10 +214,10 @@ ...@@ -183,10 +214,10 @@
...methods, ...methods,
}; };
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.name { .name {
height: 90rpx; height: 90rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
...@@ -195,76 +226,76 @@ ...@@ -195,76 +226,76 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.isTrueAnswer { .isTrueAnswer {
color: green !important; color: green !important;
} }
.isNotAnswer { .isNotAnswer {
color: red !important; color: red !important;
} }
.AnswerContent { .AnswerContent {
font-size: 28rpx; font-size: 28rpx;
padding: 25rpx; padding: 25rpx;
background-color: #f4f4f4; background-color: #f4f4f4;
border-radius: 5px; border-radius: 5px;
} }
.Single_Before { .Single_Before {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #da7878; color: #da7878;
} }
.ExamIndex_Box { .ExamIndex_Box {
margin-right: 20px; margin-right: 20px;
} }
.Exam_Total { .Exam_Total {
font-size: 25rpx; font-size: 25rpx;
color: gray; color: gray;
} }
.answerSheet { .answerSheet {
font-size: 30rpx; font-size: 30rpx;
margin-left: 20rpx; margin-left: 20rpx;
color: #000; color: #000;
} }
.swiper-box { .swiper-box {
box-sizing: border-box; box-sizing: border-box;
} }
.num { .num {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
} }
.item { .item {
/* margin-bottom: 40rpx; */ /* margin-bottom: 40rpx; */
position: relative; position: relative;
} }
.item1 { .item1 {
/* margin: 25rpx 0; */ /* margin: 25rpx 0; */
align-items: center; align-items: center;
} }
.item2 { .item2 {
padding-left: 25rpx; padding-left: 25rpx;
margin: 30rpx 0; margin: 30rpx 0;
} }
.myAnswer { .myAnswer {
background-color: #00acf9 !important; background-color: #00acf9 !important;
color: #ffffff !important; color: #ffffff !important;
} }
.chooseNum { .chooseNum {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
...@@ -276,12 +307,12 @@ ...@@ -276,12 +307,12 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
} }
.chooseName { .chooseName {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
} }
</style> </style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, { }, {
"path": "pages/progress/progress" //进度 "path": "pages/progress/progress" //进度
}, { }, {
"path": "pages/active/activeList" //活动列表 "path": "pages/activity/activityList" //活动列表
}], }],
"subPackages": [{ "subPackages": [{
"root": "pages/course", //课程分包 "root": "pages/course", //课程分包
...@@ -69,12 +69,11 @@ ...@@ -69,12 +69,11 @@
"selectedColor": "#3cc51f", "selectedColor": "#3cc51f",
"borderStyle": "black", "borderStyle": "black",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"fontSize": "24rpx",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"text": "首页" "text": "首页"
}, { }, {
"pagePath": "pages/active/activeList", "pagePath": "pages/activity/activityList",
"text": "活动" "text": "活动"
}] }]
}, },
......
<template>
<view class="course-box">
<van-toast id="van-toast" />
<van-empty description="暂无数据" v-if="data.length === 0" />
<view
v-for="(item, index) in data"
:key="index"
class="data-item"
v-if="data.length > 0"
>
<view class="contract-name">
<van-image
width="22rpx"
height="24rpx"
fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/contracticon.png"
style="margin-right: 10rpx"
/>
{{ item.ContractNo }}</view
>
<view class="contract-con" v-if="item.Type === 1">订单合同</view>
<view class="contract-con" v-if="item.Type === 2">退课合同</view>
<van-image
width="80rpx"
height="80rpx"
fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/contract.png"
class="contract-icon"
v-if="item.IsCompanySeal === 1"
/>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import { getContract } from "../../api/index";
let { CourseName } = uni.getStorageSync("indexData");
export default {
setup() {
let data = reactive({
pageloading: false,
CourseName,
data: [],
});
let methods = {
async getdata() {
let res = await getContract({});
if (res) {
if (res.Data.length === 0) {
data.pageloading = true;
} else {
data.pageloading = false;
}
console.log(69, res);
data.data = res.Data;
}
},
};
onMounted(() => {
// that.getdata();
});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "活动列表",
});
},
};
</script>
<style scoped>
.course-box {
padding: 30rpx;
}
.data-item {
margin-top: 30rpx;
box-sizing: border-box;
padding: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
position: relative;
}
.contract-icon {
position: absolute;
top: 10rpx;
right: 10rpx;
}
.contract-name {
max-width: 80%;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
margin-bottom: 20rpx;
}
.contract-con {
max-width: 80%;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-left: 30rpx;
}
</style>
This diff is collapsed.
...@@ -123,6 +123,8 @@ export default { ...@@ -123,6 +123,8 @@ export default {
data.pageState = "loading"; data.pageState = "loading";
data.msg.pageIndex++; data.msg.pageIndex++;
that.getList(); that.getList();
} else {
data.pageState = "none";
} }
}, },
reload() { reload() {
......
<template>
<view>
<view class="answer-sheets">
<view v-for="(item, index) in questionList" :key="index" class="item">
<view class="name">
{{ changeNumToHan(index + 1) }}{{ item.GroupName }}</view
>
<view class="flex flex_wrap">
<view
v-for="(item1, index1) in item.DetailsList"
:key="index1"
class="flex flex_wrap"
>
<view
class="item1-1"
v-if="
item1.QuestionTypeKey === 'reading-comprehensio' ||
item1.QuestionTypeKey === 'listening'
"
>{{ index1 + 1 }}.</view
>
<view class="item1" v-else @click="jumpPage(index, index1)">{{
index1 + 1
}}</view>
<view
v-if="
item1.QuestionTypeKey === 'reading-comprehensio' ||
item1.QuestionTypeKey === 'listening'
"
class="flex flex_wrap"
>
<view
v-for="(item2, index2) in item1.QuestionContentObj"
:key="index2"
>
<view class="item1">{{ index2 + 1 }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="submitBox">
<view class="submit">立即提交</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import { changeNumToHan } from "../../utils/index";
export default {
setup() {
let paperData = uni.getStorageSync("paperData");
console.log(66, paperData);
let Gid = uni.getStorageSync("userInfo").Id;
let data = reactive({
msg: { GuestId: Gid, PaperId: 5, PublishId: 1 },
questionList: paperData.Paper.GroupList,
});
let methods = {
changeNumToHan,
jumpPage(index, index1) {
uni.navigateTo({
url:
"/pages/exam/examPaper?index=" + index + "&&index1=" + (index1 + 1),
});
},
// async getPaperDetail() {
// let res = await getPaperDetail(data.msg);
// if (res) {
// data.questionList = res.Data.Paper.GroupList;
// console.log(90, res.Data.Paper.GroupList);
// }
// },
};
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "答题卡",
});
},
};
</script>
<style scoped>
.answer-sheets {
box-sizing: border-box;
padding: 30rpx;
height: calc(100vh - 150rpx);
overflow-y: auto;
}
.name,
.num {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
.num {
width: 100rpx;
text-align: center;
}
.item {
margin-bottom: 20rpx;
}
.item1-1 {
width: 690rpx;
margin: 22rpx 0 0 0;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 600;
color: #111111;
}
.item1 {
width: 44rpx;
height: 44rpx;
border: 1px solid #e2e2e2;
border-radius: 50%;
margin: 22rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 600;
color: #111111;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.item2 {
width: 44rpx;
height: 44rpx;
border: 1px solid #e2e2e2;
border-radius: 50%;
text-align: center;
line-height: 44rpx;
margin-right: 55rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.choose {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.submitBox {
width: 750rpx;
height: 150rpx;
background-color: #e2e2e2;
position: fixed;
left: 0;
bottom: 0;
box-sizing: border-box;
padding-top: 40rpx;
}
.submit {
width: 600rpx;
height: 70rpx;
border-radius: 35rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #00acf9;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #fff;
margin: 0 auto;
}
</style>
...@@ -129,6 +129,8 @@ export default { ...@@ -129,6 +129,8 @@ export default {
data.pageState = "loading"; data.pageState = "loading";
data.msg.pageIndex++; data.msg.pageIndex++;
that.getList(); that.getList();
} else {
data.pageState = "none";
} }
}, },
async getList() { async getList() {
......
<template>
<!-- 选择题 -->
<view>
<view v-for="(item, index) in questionList" :key="index" class="item">
<view class="name">{{ item.name }}</view>
<view
v-for="(item1, index1) in item.children"
:key="item1.id"
class="item1"
>
<view class="num">{{ item1.num }}</view>
<view
v-for="(item2, index2) in item1.children"
:key="item2.id"
class="flex item2 flex_start_center"
v-if="item.type === 1"
>
<view
class="chooseNum"
:class="{ choose: item1.choose === item2.chooseNum }"
@click="change(item.type, index, index1, index2)"
>{{ item2.chooseNum }}
</view>
<view
class="chooseName"
@click="change(item.type, index, index1, index2)"
>{{ item2.itemName }}</view
>
</view>
<view
v-for="(item2, index2) in item1.children"
:key="item2.id"
class="item2 flex flex_start_center"
v-if="item.type === 2"
>
<view
class="chooseNum"
:class="{ choose: item1.choose.find((e) => e == item2.chooseNum) }"
@click="change(item.type, index, index1, index2)"
>{{ item2.chooseNum }}
</view>
<view
class="chooseName"
@click="change(item.type, index, index1, index2)"
>{{ item2.itemName }}</view
>
</view>
</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
setup(props, context) {
// let { refs } = getCurrentInstance();
let data = reactive({
questionList: [
{
name: "一、单选题",
type: 1,
children: [
{
num: "1、真実はいつも一つ?",
choose: "A",
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
{
num: "2、",
choose: 0,
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
{
num: 3,
choose: 0,
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
],
},
{
name: "二、多选题",
type: 2,
children: [
{
num: "1、真実はいつも二つ?",
choose: [],
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
{
num: 2,
choose: [],
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
{
num: 3,
choose: [],
children: [
{
chooseNum: "A",
itemName: "答案1",
},
{
chooseNum: "B",
itemName: "答案2",
},
{
chooseNum: "c",
itemName: "答案3",
},
{
chooseNum: "D",
itemName: "答案4",
},
],
},
],
},
],
});
let methods = {
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
back() {
uni.navigateBack();
},
//选题
change(type, index, index1, index2) {
if (type === 1) {
data.questionList[index].children[index1].choose =
data.questionList[index].children[index1].children[
index2
].chooseNum;
} else if (type === 2) {
let choose = data.questionList[index].children[index1].choose;
let res =
data.questionList[index].children[index1].children[index2]
.chooseNum;
let find = choose.indexOf(res);
if (find == -1) {
choose.push(res);
} else {
choose.splice(find, 1);
}
console.log(230, choose);
}
},
};
let change = (type, index, index1, index2) => {
console.log(158, type);
};
onMounted(() => {});
return {
...toRefs(data),
...methods,
};
},
onLoad() {},
};
</script>
<style scoped>
.name {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
.num {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.item {
margin-bottom: 40rpx;
}
.item1 {
margin: 25rpx 0;
align-items: center;
}
.item2 {
padding-left: 25rpx;
margin: 30rpx 0;
}
.choose {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
</style>
\ No newline at end of file
...@@ -19,6 +19,7 @@ let request = (param) => { ...@@ -19,6 +19,7 @@ let request = (param) => {
}, },
data: { data: {
msg: param.data, msg: param.data,
// ...param.data.activityMsg
}, },
success: res => { success: res => {
if (res.data.Code === 1) { if (res.data.Code === 1) {
......
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