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
This diff is collapsed.
......@@ -19,7 +19,7 @@
}, {
"path": "pages/progress/progress" //进度
}, {
"path": "pages/active/activeList" //活动列表
"path": "pages/activity/activityList" //活动列表
}],
"subPackages": [{
"root": "pages/course", //课程分包
......@@ -69,12 +69,11 @@
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"fontSize": "24rpx",
"list": [{
"pagePath": "pages/index/index",
"text": "首页"
}, {
"pagePath": "pages/active/activeList",
"pagePath": "pages/activity/activityList",
"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 {
data.pageState = "loading";
data.msg.pageIndex++;
that.getList();
} else {
data.pageState = "none";
}
},
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 {
data.pageState = "loading";
data.msg.pageIndex++;
that.getList();
} else {
data.pageState = "none";
}
},
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) => {
},
data: {
msg: param.data,
// ...param.data.activityMsg
},
success: res => {
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