Commit 3a011d37 authored by zhengke's avatar zhengke

1

parents 6e3075f9 b05c8e1a
......@@ -22,4 +22,27 @@ export function getActivityList(data) {
method: 'post',
data
})
}
/**
* 取消报名
* @param {JSON参数} data
*/
export function cancelSignUp(data) {
return request({
url: '/AppletEducation/CancelCommerceConsultJXH',
method: 'post',
data
})
}
/**
* 获取详情
* @param {JSON参数} data
*/
export function getActivityDatail(data) {
return request({
url: '/AppletEducation/GetActivityDetialJXH',
method: 'post',
data
})
}
\ No newline at end of file
This diff is collapsed.
......@@ -20,6 +20,8 @@
"path": "pages/progress/progress" //进度
}, {
"path": "pages/activity/activityList" //活动列表
}, {
"path": "pages/activity/activityDetails" //活动详情
}],
"subPackages": [{
"root": "pages/course", //课程分包
......
This diff is collapsed.
......@@ -176,21 +176,17 @@
</view>
</view>
</view>
<Loadmore :state="pageState" />
<view style="margin: 20rpx 0">
<Loadmore :state="pageState" />
</view>
</scroll-view>
</view>
</view>
<view v-show="current == 2" style="height: calc(100vh - 50px)">
<!-- <SignUp ref="children"></SignUp> -->
<signUp ref="children"></signUp>
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<van-popup
:show="show"
closeable
......@@ -240,18 +236,18 @@ import {
watch,
computed,
onMounted,
nextTick,
} from "vue";
import Loadmore from "../../components/loadmore.vue";
// import SignUp from "../../components/signUp.vue";
import signUp from "../../components/signUp.vue";
import { getActivityTypeList, getActivityList } from "../../api/activity";
export default {
components: {
Loadmore,
// SignUp,
signUp,
},
setup() {
let i = getCurrentInstance();
console.log(252, i);
let { refs } = getCurrentInstance();
let data = reactive({
show: false,
pageState: "more",
......@@ -268,12 +264,12 @@ export default {
PageCount: 1,
g: [],
activityTypeList: [],
mainColor: "#00ACF9",
});
let methods = {
async getActivityType() {
let res = await getActivityTypeList({});
if (res) {
console.log("mall", res);
data.activityTypeList = res.data;
data.activityTypeList.unshift({
Id: 0,
......@@ -282,12 +278,13 @@ export default {
data.msg.ActivityType = 0;
data.ActivityName = "不限";
}
// methods.getList();
that.getList();
},
async getList() {
let res = await getActivityList(data.msg);
if (res) {
let arr = methods.groupArr(res.data.pageData, "MonthStr");
let arr = that.groupArr(res.data.pageData, "MonthStr");
let arr2 = arr;
if (data.msg.pageIndex === 1) {
data.g = [];
......@@ -304,7 +301,7 @@ export default {
}
});
}
data.g = data.g.concat(data);
data.g = data.g.concat(arr);
data.PageCount = res.data.pageCount;
if (res.data.pageCount == 1) {
data.pageState = "none";
......@@ -334,14 +331,14 @@ export default {
}
return att;
},
getorder() {
//报名成功处理
data.current = 2; //让他直接跳入我报名
if (Object.keys(this.$refs).length > 0 && this.$refs.children) {
//判断
this.$refs.children.getfzuj();
}
},
// 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";
......@@ -352,39 +349,19 @@ export default {
}
},
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();
data.msg.SelectIsEnd = 1;
data.msg.pageIndex = 1;
that.getList();
} else if (type == 1) {
this.msg.pageIndex = 1;
this.msg.SelectIsEnd = 0;
this.getList();
data.msg.pageIndex = 1;
data.msg.SelectIsEnd = 0;
that.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();
}
}
console.log(253, refs);
refs.children.$vm.getfzuj();
}
},
select(x) {
......@@ -393,16 +370,16 @@ export default {
data.show = false;
data.msg.pageIndex = 1;
data.g = [];
data.getList();
that.getList();
},
gourl(x) {
uni.navigateTo({
url: "/pages/school/JIaheactivitydetails?Id=" + x.Id,
url: "/pages/activity/activityDetails?Id=" + x.Id,
});
},
};
onMounted(() => {
methods.getActivityType();
that.getActivityType();
});
let that = methods;
return {
......@@ -497,6 +474,7 @@ export default {
background: #b7a264;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 26rpx;
border-top-right-radius: 12rpx;
border-bottom-left-radius: 12rpx;
......@@ -544,6 +522,7 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx;
}
......@@ -551,7 +530,6 @@ export default {
height: calc(100vh - 100rpx);
width: calc(100vw);
overflow: hidden;
padding-bottom: 100rpx;
}
.Jiaheactivity {
width: 100%;
......@@ -577,6 +555,7 @@ export default {
.Jiaheactivity .foritem {
height: 60rpx;
font-size: 24rpx;
box-sizing: border-box;
padding: 0 24rpx;
display: flex;
align-items: center;
......@@ -585,6 +564,7 @@ export default {
margin-bottom: 30rpx;
}
.ht-box {
box-sizing: border-box;
padding: 0 30rpx;
display: flex;
flex-wrap: wrap;
......
......@@ -397,11 +397,12 @@ export default {
},
setup(props, context) {
let { refs } = getCurrentInstance();
console.log(refs);
let data = reactive({
time: 999,
statusBarHeight: 0,
msg: { GuestId: 0, PaperId: 0, PublishId: 0},
msg: { GuestId: 0, PaperId: 0, PublishId: 0 },
peaperDetail: {},
changeIndex: 0, //大题序号
isLast: false, //用于判断是否从后往前翻
......@@ -502,14 +503,14 @@ export default {
};
},
onLoad(options) {
if(options.GuestId){
this.msg.GuestId = options.GuestId;
if (options.GuestId) {
this.msg.GuestId = options.GuestId;
}
if (options.PaperId) {
this.msg.PaperId = options.PaperId;
this.msg.PaperId = options.PaperId;
}
if (options.Id) {
this.msg.PublishId = options.Id;
this.msg.PublishId = options.Id;
}
if (options.Exam_Student_Id) {
this.Exam_Student_Id = options.Exam_Student_Id;
......
<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
......@@ -2,11 +2,12 @@
<script>
/**
* 因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。
* 1.因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。
如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作
* // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象,------------reactive对象不能直接赋值--------------
*@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式,需用...toRef()
* 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy,refs } = getCurrentInstance(); ctx或proxy.$挂载的方法
* 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy,refs } = getCurrentInstance(); ctx或proxy.$挂载的方法
* 2.ref 获取子组件实例,组件名首字母小写
*/
import {
ref,
......
......@@ -30,6 +30,7 @@ let request = (param) => {
token: JHdata.MallToken
},
success: res => {
if (res.data.resultCode === 1) {
resolve(res.data)
} else {
......
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