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
<template> <template>
<!-- 单选题 --> <!-- 单选题 -->
<view> <view>
<view class="item" style="padding: 0 20px"> <view class="item" style="padding: 0 20px">
<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"
</view> >(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text
<view class="ExamIndex_Box"> >
<text class="Single_Before">{{ ExamIndex }}</text>/<text </view>
class="Exam_Total">{{ data.DetailsList.length }}</text> <view class="ExamIndex_Box">
</view> <text class="Single_Before">{{ ExamIndex }}</text
</view> >/<text class="Exam_Total">{{ data.DetailsList.length }}</text>
<swiper class="swiper-box" :style="{ </view>
</view>
<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"
<swiper-item v-if="sortIndex != 1"></swiper-item> :current="current"
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1"> @change="onchange"
<view class="item1"> :skip-hidden-item-layout="true"
<view class="flex flex_start_center"> :disable-programmatic-animation="true"
<view class="num" v-html="item1.Title"></view> >
</view> <swiper-item v-if="sortIndex != 1"></swiper-item>
<swiper-item v-for="(item1, index1) in data.DetailsList" :key="index1">
<view class="item1">
<view class="flex flex_start_center">
<view class="num" v-html="item1.Title"></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"
<template v-if="isOperate"> :key="index2"
<view class="chooseNum" :class="{ myAnswer: item2.IsAnswer }" class="flex item2 flex_start_center"
@click="change(item1, item2)">{{ item2.ShowName }} >
</view> <template v-if="isOperate">
<view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view> <view
</template> class="chooseNum"
<template v-else> :class="{ myAnswer: item2.IsAnswer }"
<view class="chooseNum" :class="{ isTrueAnswer: item2.IsAnswer }">{{ item2.Name }} @click="change(item1, item2)"
</view> >{{ item2.ShowName }}
<view class="chooseName" :class="{ isTrueAnswer: item2.IsAnswer }" </view>
v-html="item2.Content"> <view
</view> class="chooseName"
</template> @click="change(item1, item2)"
</view> v-html="item2.Content"
</view> ></view>
<view class="AnswerContent" v-if="!isOperate"> </template>
<view> <template v-else>
<text style="color: #8c8a94">正确答案:</text> <view
<text class="isTrueAnswer">{{item1.Answer}}</text> class="chooseNum"
<text>您的答案是: :class="{ isTrueAnswer: item2.IsAnswer }"
<template v-if="item1.StundetAnswer != ''"> >{{ item2.Name }}
<text v-if="item1.Answer == item1.StundetAnswer" class="isTrueAnswer"> </view>
{{ item1.StundetAnswer }},回答正确 <view
</text> class="chooseName"
<text v-else class="isNotAnswer">{{ item1.StundetAnswer }},回答错误</text> :class="{ isTrueAnswer: item2.IsAnswer }"
</template> v-html="item2.Content"
<template v-else> >
<text>未作答</text> </view>
</template> </template>
</text> </view>
</view> </view>
<view style="margin-top: 20rpx; word-wrap: break-word" v-if="item1.AnswerParse"> <view class="AnswerContent" v-if="!isOperate">
<text style="color: #8c8a94">解析:</text> <view>
<text style="color: #000">{{ item1.AnswerParse }}</text> <text style="color: #8c8a94">正确答案:</text>
</view> <text class="isTrueAnswer">{{ item1.Answer }}</text
</view> >
</swiper-item> <text
<swiper-item v-if="sortIndex != sortTotal"> >您的答案是:
<!-- 最后一页 --> <template v-if="item1.StundetAnswer != ''">
</swiper-item> <text
</swiper> v-if="item1.Answer == item1.StundetAnswer"
</view> class="isTrueAnswer"
<van-toast id="van-toast" /> >
</view> {{ item1.StundetAnswer }},回答正确
</text>
<text v-else class="isNotAnswer"
>{{ item1.StundetAnswer }},回答错误</text
>
</template>
<template v-else>
<text>未作答</text>
</template>
</text>
</view>
<view
style="margin-top: 20rpx; word-wrap: break-word"
v-if="item1.AnswerParse"
>
<text style="color: #8c8a94">解析:</text>
<text style="color: #000">{{ item1.AnswerParse }}</text>
</view>
</view>
</swiper-item>
<swiper-item v-if="sortIndex != sortTotal">
<!-- 最后一页 -->
</swiper-item>
</swiper>
</view>
<van-toast id="van-toast" />
</view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { import { changeNumToHan } from "../../utils/index";
changeNumToHan export default {
} from "../../utils/index"; props: {
export default { paperData: Object,
props: { sort: Number,
paperData: Object, sortTotal: Number,
sort: Number, isLast: Boolean,
sortTotal: Number, startIndex: Number,
isLast: Boolean, isOperate: Boolean,
startIndex: Number, },
isOperate: Boolean, setup(props, context) {
}, let { ctx } = getCurrentInstance();
setup(props, context) { let data = reactive({
let { autoplay: false,
ctx sortIndex: props.sort + 1, //大题序号
} = getCurrentInstance(); sortTotal: props.sortTotal, //总共多少道大题
let data = reactive({ data: props.paperData,
autoplay: false, current: 1, //默认从第几个开始-用于从快捷菜单点入
sortIndex: props.sort + 1, //大题序号 ExamIndex: 1, //第几题
sortTotal: props.sortTotal, //总共多少道大题 isOperate: props.isOperate,
data: props.paperData, statusBarHeight: 0,
current: 1, //默认从第几个开始-用于从快捷菜单点入 });
ExamIndex: 1, //第几题 //判断是否是第一大题
isOperate: props.isOperate, if (data.sortIndex === 1) {
statusBarHeight: 0, data.current = 0;
}); //从答题卡进入
//判断是否是第一大题 if (props.startIndex) {
if (data.sortIndex === 1) { data.current = props.startIndex - 1;
data.current = 0; data.ExamIndex = props.startIndex;
//从答题卡进入 }
if (props.startIndex) { } else {
data.current = props.startIndex - 1; if (props.startIndex) {
data.ExamIndex = props.startIndex; data.current = props.startIndex;
} data.ExamIndex = props.startIndex;
} else { }
if (props.startIndex) { }
data.current = props.startIndex;
data.ExamIndex = props.startIndex;
}
}
let methods = { let methods = {
changeNumToHan, changeNumToHan,
jumpPage() { jumpPage() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/exam/examPaper", url: "/pages/exam/examPaper",
}); });
}, },
back() { back() {
uni.navigateBack(); uni.navigateBack();
}, },
//选题 //选题
change(item1, item2) { change(item1, item2) {
context.emit("answerChange", data.data); context.emit("answerChange", data.data);
item1.QuestionContentObj.map((e) => { item1.QuestionContentObj.map((e) => {
if (e.Name == item2.Name) { if (e.Name == item2.Name) {
e.IsAnswer = true; e.IsAnswer = true;
} else { } else {
e.IsAnswer = false; e.IsAnswer = false;
} }
if (e.IsAnswer) { if (e.IsAnswer) {
//标记已回答 //标记已回答
item1.IsRes = true; item1.IsRes = true;
} }
}); });
}, },
onchange(e) { onchange(e) {
data.ExamIndex = e.detail.current; data.ExamIndex = e.detail.current;
if (data.sortIndex == 1) { if (data.sortIndex == 1) {
data.ExamIndex = e.detail.current + 1; data.ExamIndex = e.detail.current + 1;
} }
if (data.ExamIndex === data.data.DetailsList.length + 1) { if (data.ExamIndex === data.data.DetailsList.length + 1) {
this.$emit("getAfterTopic"); this.$emit("getAfterTopic");
} }
if (e.detail.current == 0 && data.sortIndex != 1) { if (e.detail.current == 0 && data.sortIndex != 1) {
this.$emit("getBeforeTopic"); this.$emit("getBeforeTopic");
} }
}, },
jumpAnswerSheet() { jumpAnswerSheet() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/exam/answerSheet", url: "/pages/exam/answerSheet",
}); });
} },
}; };
onMounted(() => { onMounted(() => {
if (props.isLast) { if (props.isLast) {
if (data.sortIndex === 1) { if (data.sortIndex === 1) {
data.current = props.paperData.DetailsList.length - 1; data.current = props.paperData.DetailsList.length - 1;
} else { } else {
data.current = props.paperData.DetailsList.length; data.current = props.paperData.DetailsList.length;
} }
} }
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
}); });
let that = methods; let that = methods;
return { return {
...toRefs(data), ...toRefs(data),
...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;
font-weight: 800; font-weight: 800;
color: #111111; color: #111111;
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;
line-height: 40rpx; line-height: 40rpx;
border-radius: 50%; border-radius: 50%;
border: 1px solid #e2e2e2; border: 1px solid #e2e2e2;
margin-right: 30rpx; margin-right: 30rpx;
font-size: 28rpx; font-size: 28rpx;
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>
<template>
<view class="Jiaheactivity">
<van-toast id="van-toast" />
<view class="box-top">
<view style="display: flex">
<view
class="box-t-item"
:class="{ currentStyle: current == 1 }"
@click="listType(1)"
>即将开始</view
>
<view
class="box-t-item"
:class="{ currentStyle: current == 3 }"
@click="listType(3)"
>已结束</view
>
<view
class="box-t-item"
:class="{ currentStyle: current == 2 }"
@click="listType(2)"
>正在参加</view
>
</view>
<view class="box-top-r" @click="show = true">
<text class="box-top-r-text">{{ ActivityName }}</text>
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/salesxiala.png"
style="width: 17px; height: 17px; margin-left: 7px"
></image>
</view>
</view>
<view v-show="current == 1 || current == 3">
<van-empty description="暂无活动" v-if="g.length === 0" />
<view v-if="g.length > 0" class="scroll-box">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
style="height: 100%"
>
<view class="details" v-for="(item, index) in g" :key="index">
<view class="details-time">
{{ item.Dateitem }}
</view>
<view
class="details-box"
v-for="(x, y) in item.list"
:key="y"
@click="gourl(x)"
>
<view v-if="x.IsJoinActivity == 0">
<view
class="details-box-top-z"
v-if="x.TotalMan - x.JoinNum > 0 && current == 1"
:style="{ background: mainColor }"
></view>
<view
class="details-box-t-positions"
v-if="x.TotalMan - x.JoinNum > 0 && current == 1"
:style="{ background: mainColor }"
>
<text>{{
x.TotalMan - x.JoinNum >= 6
? "可预约"
: x.TotalMan - x.JoinNum < 6
? "剩余" + (x.TotalMan - x.JoinNum) + "个空位"
: ""
}}</text>
</view>
<view
class="details-box-top-f"
v-if="x.TotalMan - x.JoinNum < 1"
></view>
<view
class="details-box-t-positions"
v-if="x.TotalMan - x.JoinNum < 1"
style="background: #e2e2e2; color: #999999"
>
爆满
</view>
<view
class="details-box-top-f"
v-if="x.TotalMan - x.JoinNum > 0 && current == 3"
></view>
<view
v-if="current == 3 && x.TotalMan - x.JoinNum > 0"
class="details-box-t-positions"
style="background: #e2e2e2; color: #999999"
>
已结束
</view>
</view>
<view v-if="x.IsJoinActivity == 1">
<view
class="details-box-top-f"
style="background: #40766e"
></view>
<view
class="details-box-t-positions"
:style="{ background: '#40766E' }"
>
已报名
</view>
</view>
<!-- 内容 -->
<view class="details-b-center">
<view class="details-b-center-l">
<view
style="
font-size: 50rpx;
color: #1b1d1e;
font-weight: 800;
font-family: PingFang SC;
"
>
{{ x.DayStr }}
</view>
<view
style="
font-size: 28rpx;
color: #999999;
font-weight: 500;
font-family: PingFang SC;
"
>
{{ x.WeekStr }}
</view>
</view>
<view
style="width: 1px; background: #e2e2e2; height: 60px"
></view>
<view class="details-b-center-r">
<view class="details-b-title">
{{ x.ActivityName }}
</view>
<view class="details-b-time">
报名时间:{{ x.BMStart }}-{{ x.BMEnd }}
</view>
</view>
</view>
<view
style="
width: 100%;
height: 1px;
background: #e2e2e2;
margin-top: 10px;
"
></view>
<view class="details-b-bottom">
<view class="details-b-time" style="margin-top: 0">
活动时间:{{ x.HDStart }}-{{ x.HDEnd }}
</view>
<view :style="{ color: pricecolor, 'font-size': '32rpx' }">
<text v-if="x.IsFree == 1">免费</text>
<view
v-if="x.IsFree == 2 && x.Price > 0"
style="display: flex; align-items: flex-end"
>
<text style="font-size: 22rpx"></text>
<text>{{ x.Price }}</text>
</view>
<view
v-if="x.IsFree == 2 && x.Price == 0"
style="display: flex; align-items: flex-end"
>
<text>{{ x.PointNum }}</text>
<text style="font-size: 22rpx"></text>
</view>
</view>
</view>
</view>
</view>
<Loadmore :state="pageState" />
</scroll-view>
</view>
</view>
<view v-show="current == 2" style="height: calc(100vh - 50px)">
<signUp ref="children"></signUp>
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<van-popup :show="show" closeable position="bottom" @close="show = false">
<view class="pubox">
<view class="pubox-top">
<text>选择活动类型</text>
</view>
<scroll-view
scroll-y="true"
style="
max-height: calc(100vh * 0.7 - 65px);
padding-bottom: 20px;
min-height: calc(100vh * 0.4 - 65px);
"
>
<view class="ht-box">
<view
v-for="(x, y) in activityTypeList"
:key="y"
class="foritem"
@click="select(x)"
:style="{
color: x.Id == msg.ActivityType ? '#FFF' : '#666666',
background: x.Id == msg.ActivityType ? mainColor : '#F9F9F9',
}"
>
{{ x.TypeName }}
</view>
</view>
</scroll-view>
</view>
</van-popup>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import Loadmore from "../../components/loadmore.vue";
import { getActivityTypeList, getActivityList } from "../../api/activity";
export default {
components: {
Loadmore,
},
setup() {
let JHdata = uni.getStorageSync("userInfo");
let data = reactive({
show: false,
pageState: "more",
current: 1,
showAuth: false,
u: {},
msg: {
pageIndex: 1,
pageSize: 10,
ActivityType: 0,
SelectIsEnd: 0,
},
ActivityName: "不限",
PageCount: 1,
g: [],
activityTypeList: [],
});
let methods = {
async getActivityType() {
let res = await getActivityTypeList();
if (res) {
data.activityTypeList = res.data;
data.activityTypeList.unshift({
Id: 0,
TypeName: "不限",
});
this.msg.ActivityType = 0;
this.ActivityName = "不限";
}
methods.getList();
},
async getList() {
let res = await getActivityList(data.msg);
if (res) {
let arr = methods.groupArr(res.data.pageData, "MonthStr");
let arr2 = arr;
if (data.msg.pageIndex === 1) {
this.g = [];
}
if (data.g.length > 0) {
arr2.forEach((x) => {
if (x.Day == data.g[data.g.length - 1].Day) {
//判断当前第一条数据和已有的是否同一天 放在一起
console.log("进入一次");
data.g[data.g.length - 1].list = data.g[
data.g.length - 1
].list.concat(x.list);
arr.splice(0, 1);
}
});
}
data.g = data.g.concat(data);
data.PageCount = res.data.pageCount;
if (res.data.pageCount == 1) {
data.pageState = "none";
}
}
},
groupArr(list, field) {
var fieldList = [],
att = [];
list.map((e) => {
fieldList.push(e[field]);
});
//数组去重
fieldList = fieldList.filter((e, i, self) => {
return self.indexOf(e) == i;
});
for (var j = 0; j < fieldList.length; j++) {
//过滤出匹配到的数据
var arr = list.filter((e) => {
return e.MonthStr == fieldList[j];
});
att.push({
Dateitem: arr[0].YearStr + "年" + arr[0].MonthStr + "月",
list: arr,
});
}
return att;
},
getorder() {
//报名成功处理
data.current = 2; //让他直接跳入我报名
if (Object.keys(this.$refs).length > 0 && this.$refs.children) {
//判断
this.$refs.children.getfzuj();
}
},
lower(e) {
if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading";
data.msg.pageIndex++;
that.getList();
} else {
data.pageState = "none";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.GetActivityTypeList();
if (Object.keys(this.$refs).length > 0 && this.$refs.children) {
//判断
this.$refs.children.getfzuj();
}
},
listType(type) {
data.current = type;
if (type == 3) {
this.msg.SelectIsEnd = 1;
this.msg.pageIndex = 1;
this.getList();
} else if (type == 1) {
this.msg.pageIndex = 1;
this.msg.SelectIsEnd = 0;
this.getList();
} else {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
if (Object.keys(this.$refs).length > 0 && this.$refs.children) {
//判断
this.$refs.children.getfzuj();
}
}
}
},
select(x) {
data.msg.ActivityType = x.Id;
data.ActivityName = x.TypeName;
data.show = false;
data.msg.pageIndex = 1;
data.g = [];
data.getList();
},
gourl(x) {
uni.navigateTo({
url: "/pages/school/JIaheactivitydetails?Id=" + x.Id,
});
},
};
onMounted(() => {
methods.getActivityType();
});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "活动列表",
});
},
};
</script>
<style scoped>
.Jiaheactivity .box-top {
/* width: 100%; */
height: 100rpx;
text-align: center;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 30rpx;
}
.box-t-item {
width: 140rpx;
height: 60rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #999999;
margin-right: 20rpx;
background-color: #edf0f3;
}
.currentStyle {
color: #fff;
background-color: #40766e;
}
.box-top-r {
width: 200rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #40766e;
background: #edf0f3;
border-radius: 8rpx;
box-sizing: border-box;
padding: 0 10rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.Jiaheactivity .details {
width: 100%;
box-sizing: border-box;
padding: 0 30rpx;
}
.details-time {
width: 100%;
font-size: 24rpx;
color: #111111;
margin-top: 30rpx;
}
.details-box {
width: 100%;
margin-top: 30rpx;
box-shadow: 0px 6rpx 12rpx 0px rgba(139, 115, 64, 0.16);
border-radius: 12rpx;
overflow: hidden;
position: relative;
min-height: 196rpx;
}
.details-box-top-z {
width: 100%;
height: 6rpx;
}
.details-box-top-f {
width: 100%;
height: 6rpx;
background: #e2e2e2;
}
.details-box-t-positions {
height: 40rpx;
font-size: 20rpx;
color: #fff;
background: #b7a264;
display: flex;
align-items: center;
padding: 0 26rpx;
border-top-right-radius: 12rpx;
border-bottom-left-radius: 12rpx;
position: absolute;
right: 0;
top: 0;
}
.details-b-center {
width: 100%;
display: flex;
margin-top: 40rpx;
}
.details-b-center-l {
width: 120rpx;
height: 120rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.details-b-center-r {
width: 1px;
flex: 1;
box-sizing: border-box;
padding: 0 30rpx;
}
.details-b-title {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #111111;
font-weight: bold;
font-family: PingFang SC;
}
.details-b-time {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.details-b-bottom {
width: 100%;
height: 90rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
}
.Jiaheactivity .scroll-box {
height: calc(100vh - 100rpx);
width: calc(100vw);
overflow: hidden;
padding-bottom: 100rpx;
}
.Jiaheactivity {
width: 100%;
height: 100vh;
background-color: #fff;
/* font-family: aa; */
}
.Jiaheactivity .pubox {
box-sizing: border-box;
padding: 0 30rpx;
}
.Jiaheactivity .pubox-top {
height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #111;
}
::-webkit-scrollbar {
display: none;
}
.Jiaheactivity .foritem {
height: 60rpx;
font-size: 24rpx;
padding: 0 24rpx;
display: flex;
align-items: center;
border-radius: 30rpx;
margin-right: 50rpx;
margin-bottom: 30rpx;
}
.ht-box {
padding: 0 30rpx;
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
}
</style>
\ No newline at end of file
...@@ -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