Commit b05c8e1a authored by 罗超's avatar 罗超

1

parent 0e1a402f
...@@ -23,3 +23,26 @@ export function getActivityList(data) { ...@@ -23,3 +23,26 @@ export function getActivityList(data) {
data 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
<template> <template>
<view class="mysignupList"> <view class="mysignupList">
<u-tabs <van-tabs
:show-bar="false" :active="data.ExamStatus"
:list="list" title-inactive-color="#444444"
:is-scroll="false" title-active-color="#00ACF9"
:current="current" line-height="0"
@change="change" @change="change"
:active-color="mainColor"
></u-tabs>
<u-empty v-if="g.length == 0" text="暂无报名记录" mode="list"></u-empty>
<view
v-if="g.length > 0"
class="scroll-box"
:style="{ 'padding-bottom': tabbarH + 'px' }"
> >
<van-tab title="全部" :name="0"></van-tab>
<van-tab title="正常" :name="1"></van-tab>
<van-tab title="取消" :name="2"></van-tab>
</van-tabs>
<van-empty description="暂无活动" v-if="g.length === 0" />
<view v-if="g.length > 0" class="scroll-box">
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
:enable-back-to-top="true" :enable-back-to-top="true"
...@@ -146,7 +145,7 @@ ...@@ -146,7 +145,7 @@
class="box-Remark-b" class="box-Remark-b"
v-if="x.Status != 1 && x.IsApplyForCancel != 1" v-if="x.Status != 1 && x.IsApplyForCancel != 1"
> >
<view class="box-Remark-btn" @click.native.stop="cancel(x, i)"> <view class="box-Remark-btn" @click.stop="cancel(x, i)">
取消 取消
</view> </view>
</view> </view>
...@@ -167,30 +166,12 @@ ...@@ -167,30 +166,12 @@
</view> </view>
</view> </view>
</view> </view>
<u-loadmore <view style="margin: 20rpx 0">
:status="status" <Loadmore :state="pageState" />
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#FFF"
/>
</scroll-view>
</view> </view>
</scroll-view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx">加载中...</Text>
</view> </view>
<van-popup :show="show" closeable @close="show = false">
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<u-popup v-model="show" mode="center" length="80%">
<view <view
style=" style="
display: flex; display: flex;
...@@ -204,7 +185,7 @@ ...@@ -204,7 +185,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 70px; height: 140rpx;
" "
> >
<Text>是否取消订单?</Text> <Text>是否取消订单?</Text>
...@@ -213,15 +194,15 @@ ...@@ -213,15 +194,15 @@
style=" style="
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 80px; height: 160rpx;
margin-left: 15px; margin-left: 30rpx;
width: 100%; width: 100%;
" "
> >
<Text style="margin-left: 10px; margin-top: 5px">备注</Text> <Text style="margin-left: 20rpx; margin-top: 10rpx">备注</Text>
<input <input
class="uni-input inputM" class="uni-input inputM"
style="margin-left: 10px; margin-top: 5px" style="margin-left: 20rpx; margin-top: 10rpx"
v-model="cancelRemark" v-model="cancelRemark"
placeholder="输入备注" placeholder="输入备注"
/> />
...@@ -231,7 +212,7 @@ ...@@ -231,7 +212,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
height: 50px; height: 100rpx;
border-top: 1px solid #f5f5f5; border-top: 1px solid #f5f5f5;
width: 100%; width: 100%;
" "
...@@ -261,7 +242,7 @@ ...@@ -261,7 +242,7 @@
</view> </view>
</view> </view>
</view> </view>
</u-popup> </van-popup>
</view> </view>
</template> </template>
...@@ -276,10 +257,11 @@ import { ...@@ -276,10 +257,11 @@ import {
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import auth from "@/components/auth/index.vue"; import Loadmore from "./loadmore.vue";
import { getActivityList, cancelSignUp } from "../api/activity";
export default { export default {
components: { components: {
auth, Loadmore,
}, },
setup() { setup() {
let data = reactive({ let data = reactive({
...@@ -288,7 +270,6 @@ export default { ...@@ -288,7 +270,6 @@ export default {
u: {}, u: {},
show: false, show: false,
current: 0, current: 0,
list: [{ name: "全部" }, { name: "正常" }, { name: "取消" }],
mainColor: "", mainColor: "",
contentHeight: 0, contentHeight: 0,
...@@ -297,161 +278,103 @@ export default { ...@@ -297,161 +278,103 @@ export default {
pageSize: 10, pageSize: 10,
EnrollState: 3, EnrollState: 3,
}, },
page_count: 1, PageCount: 1,
g: [], g: [],
loading: false, loading: false,
status: "loadmore", pageState: "more",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
bmobj: {}, bmobj: {},
cancelRemark: "", cancelRemark: "",
tabbarH: 0, tabbarH: 0,
}); });
let methods = { let methods = {
change(index) { change(e) {
this.current = index; data.current = e.detail.name;
if (index == 0) { if (e.detail.name == 0) {
this.msg.EnrollState = 3; data.msg.EnrollState = 3;
} else { } else {
this.msg.EnrollState = index; data.msg.EnrollState = e.detail.name;
} }
data.msg.pageIndex = 1;
this.msg.pageIndex = 1; data.g = [];
this.g = []; that.getList();
this.loading = true;
this.init();
}, },
getfzuj() { getfzuj() {
this.current = 0; data.current = 0;
this.msg.pageIndex = 1; data.msg.pageIndex = 1;
this.g = []; data.g = [];
this.init(); that.getList();
},
init() {
this.request2(
{
url: "/api/AppletEducation/GetUserJoinActivityPageList",
data: this.msg,
}, },
(res) => { async getList() {
if (res.resultCode == 1) { let res = await getActivityList(data.msg);
this.loading = false; if (res) {
this.g = this.g.concat(res.data.pageData); if (data.msg.pageIndex === 1) {
this.page_count = res.data.pageCount; data.g = res.data.pageData;
if (this.page_count == 1) { } else {
this.status = "nomore"; data.g = data.g.concat(res.data.pageData);
} }
data.PageCount = res.data.pageCount;
if (data.PageCount == 1) {
data.pageState = "none";
} }
},
(error) => {
this.loading = false;
} }
);
}, },
lower(e) { lower(e) {
if (this.msg.pageIndex < this.page_count) { if (data.msg.pageIndex < data.PageCount) {
this.msg.pageIndex++; data.pageState = "loading";
this.status = "loading"; data.msg.pageIndex++;
this.init(); that.getList();
} else { } else {
this.status = "nomore"; data.pageState = "none";
} }
}, },
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.init();
},
//关闭登录窗口
gbAuth() {
uni.navigateBack();
},
cancel(x, i) { cancel(x, i) {
this.bmobj = { data.bmobj = {
ActivityId: x.ActivityId, ActivityId: x.ActivityId,
index: i, index: i,
Id: x.Id, Id: x.Id,
}; };
data.show = true;
this.show = true;
}, },
queren() { //取消报名
this.request2( async queren() {
{ let res = await cancelSignUp({
url: "/api/AppletEducation/CancelCommerceConsult", ActivityId: data.bmobj.ActivityId,
data: { CancelRemark: data.cancelRemark,
ActivityId: this.bmobj.ActivityId, Id: data.bmobj.Id,
CancelRemark: this.cancelRemark, });
Id: this.bmobj.Id, if (res) {
},
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({ uni.showToast({
title: "操作成功", title: "操作成功",
icon: "success", icon: "success",
}); });
if (res.data != 1) { if (res.data != 1) {
if (this.msg.EnrollState == 1) { if (data.msg.EnrollState == 1) {
this.g.splice(this.bmobj.index, 1); data.g.splice(data.bmobj.index, 1);
} else { } else {
this.g[this.bmobj.index].Status = 1; data.g[this.bmobj.index].Status = 1;
} }
} else { } else {
this.g[this.bmobj.index].IsApplyForCancel = 1; data.g[data.bmobj.index].IsApplyForCancel = 1;
this.g[this.bmobj.index].CancelRemark = this.cancelRemark; data.g[data.bmobj.index].CancelRemark = data.cancelRemark;
} }
this.show = false; data.show = false;
} }
}
);
}, },
//跳转至活动详情 //跳转至活动详情
goActiveDetail(x) { goActiveDetail(x) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/school/JIaheactivitydetails?Id=" + x.ActivityId, url: "/pages/activity/activityDetails?Id=" + x.ActivityId,
}); });
}, },
}; };
onMounted(() => { onMounted(() => {});
this.contentHeight = this.$utils.calcContentHeight(-40) + "px"; let that = methods;
this.mainColor = this.$uiConfig.mainColor;
this.tabbarH = this.$uiConfig.is_bang ? 78 : 50;
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
});
return { return {
...toRefs(data), ...toRefs(data),
...methods, ...methods,
}; };
}, },
onLoad(option) {
// this.u = uni.getStorageSync("mall_UserInfo");
// if (!this.u) {
// this.u = {
// nickName: "未登录",
// avatarUrl: "",
// };
// this.showAuth = true;
// } else {
// this.init();
// }
},
}; };
</script> </script>
<style> <style>
...@@ -479,12 +402,13 @@ export default { ...@@ -479,12 +402,13 @@ export default {
z-index: 999; z-index: 999;
} }
.mysignupList .details { .mysignupList .details {
padding: 15px; box-sizing: border-box;
padding: 30rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.mysignupList .item { .mysignupList .item {
margin-bottom: 15px; margin-bottom: 30rpx;
} }
.mysignupList .box-top { .mysignupList .box-top {
width: 100%; width: 100%;
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
"path": "pages/progress/progress" //进度 "path": "pages/progress/progress" //进度
}, { }, {
"path": "pages/activity/activityList" //活动列表 "path": "pages/activity/activityList" //活动列表
}, {
"path": "pages/activity/activityDetails" //活动详情
}], }],
"subPackages": [{ "subPackages": [{
"root": "pages/course", //课程分包 "root": "pages/course", //课程分包
......
<style scoped>
.Jiaheactivitydetails {
width: 100%;
height: 100vh;
background: #fff;
font-family: aa;
}
.box {
width: 100%;
position: relative;
}
.details-box-top-z {
width: 100%;
height: 3px;
}
.details-box-top-f {
width: 100%;
height: 3px;
background: #e2e2e2;
}
.details-box-t-positions {
height: 40rpx;
font-size: 20rpx;
color: #fff;
background: #b7a264;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 26rpx;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
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%;
font-size: 28rpx;
color: #111111;
font-weight: bold;
font-family: PingFang SC;
}
.details-b-time {
font-size: 22rpx;
color: #999999;
margin-top: 18rpx;
}
.addressStyle {
width: 690rpx;
height: 45px;
background: #ffffff;
box-shadow: 0px 3px 6px 0px rgba(139, 115, 64, 0.16);
border-radius: 6px;
font-size: 12px;
color: #999999;
display: flex;
box-sizing: border-box;
padding: 0 30rpx;
align-items: center;
margin-top: 20px;
margin-left: 30rpx;
}
.addressStyle-r {
width: 1px;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.positionb {
width: 100%;
height: 120rpx;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx;
background: #fff;
}
.btnc {
width: 220rpx;
height: 80rpx;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #ffffff;
background: #cccccc;
}
.title-pic {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
// text-align: center;
margin-top: 40rpx;
margin-bottom: 30rpx;
position: relative;
}
.title-pic .line-bottom {
width: 71rpx;
height: 12rpx;
background-color: #40766e;
border-radius: 4rpx;
position: absolute;
left: 0;
bottom: -5rpx;
opacity: 0.8;
}
.pic-name {
margin-bottom: 30rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.video-box {
display: flex;
flex-wrap: wrap;
}
.video-box .pic-box:nth-child(3n) {
margin-right: 0 !important;
}
.pic-box {
width: 222rpx;
height: 300rpx;
border-radius: 12rpx;
margin: 0 10rpx 30rpx 0;
}
.oneimg {
width: 222rpx;
height: 222rpx;
border-radius: 12rpx;
background-color: #d7d7d7;
border: 1rpx solid #eeeeee;
}
.fourimg-box {
width: 222rpx;
height: 222rpx;
border-radius: 12rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
border: 1rpx solid #eeeeee;
}
.fourimg {
width: 105rpx;
height: 105rpx;
border-radius: 11rpx;
/* background-color: #000000; */
}
.item-name {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.item-num {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
.jz_TripMain {
position: relative;
overflow: hidden;
margin-bottom: 50px;
}
.jz_TripTitle {
width: 100%;
min-height: 90rpx;
border-radius: 20rpx;
background-color: #40766e;
color: #fff;
display: flex;
box-sizing: border-box;
padding: 28rpx;
}
.jz_TripLeft {
width: 80rpx;
white-space: nowrap;
font-size: 30rpx;
font-weight: 500;
margin-right: 20rpx;
}
.jz_TripRight {
font-size: 30rpx;
font-weight: 500;
}
.jz_TripLine {
position: absolute;
width: 4rpx;
height: 100%;
background-color: #40766e;
left: 24rpx;
top: 90rpx;
}
.jz_RightInner {
margin-left: 50rpx;
}
.jz_Place {
position: relative;
color: #111111;
font-size: 24rpx;
margin: 30rpx 0;
font-weight: bold;
display: flex;
}
.jz_ComDian {
width: 18rpx;
height: 18rpx;
background-color: #dfbe6e;
border-radius: 50%;
position: absolute;
left: -17.6px;
top: 4px;
}
.Jiaheactivitydetails .con {
width: 622rpx;
background-color: #f1f1f1;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
margin-bottom: 30rpx;
}
.Jiaheactivitydetails .active-img-box {
height: 200rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.Jiaheactivitydetails .img-box {
width: 200rpx;
height: 200rpx;
border-radius: 12rpx;
overflow: hidden;
box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2);
}
.Jiaheactivitydetails .active-img {
width: 100%;
height: 100%;
}
.Jiaheactivitydetails .img-box2 {
position: relative;
}
.Jiaheactivitydetails .img-box2 .layer {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 10;
background-color: #5f5b5d;
opacity: 0.5;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #ffffff;
}
.Jiaheactivitydetails .addr {
margin: 30rpx 0;
}
</style>
<template>
<view class="Jiaheactivitydetails" v-if="!loading">
<view
style="width: 100%; height: 450rpx"
@click="previewImage(detial.CoverImg)"
>
<image
:src="detial.CoverImg"
style="width: 100%; height: 100%"
mode="aspectFill"
></image>
</view>
<view class="box">
<view v-if="detial.IsJoinActivity == 0">
<view
class="details-box-top-z"
v-if="detial.TotalMan - detial.JoinNum > 0"
:style="{ background: mainColor }"
></view>
<view
class="details-box-top-f"
v-if="detial.TotalMan - detial.JoinNum == 0"
></view>
<view
class="details-box-t-positions"
v-if="detial.TotalMan - detial.JoinNum > 0 && detial.IsSignUp == 1"
:style="{ background: mainColor }"
>
<text>{{
detial.TotalMan - detial.JoinNum >= 6
? "可预约"
: detial.TotalMan - detial.JoinNum < 6
? "剩余" + (detial.TotalMan - detial.JoinNum) + "个空位"
: ""
}}</text>
</view>
<view
class="details-box-t-positions"
v-if="detial.TotalMan - detial.JoinNum == 0"
style="background: #e2e2e2; color: #999999"
>
爆满
</view>
</view>
<view v-if="detial.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: 28rpx;
color: #999999;
font-weight: 500;
font-family: PingFang SC;
"
>
{{ detial.MonthStr }}
</view>
<view
style="
font-size: 50rpx;
color: #1b1d1e;
font-weight: 800;
font-family: PingFang SC;
"
>
{{ detial.DayStr }}
</view>
<view
style="
font-size: 28rpx;
color: #999999;
font-weight: 500;
font-family: PingFang SC;
"
>
{{ detial.WeekStr }}
</view>
</view>
<view style="width: 1px; background: #e2e2e2; height: 86px"></view>
<view class="details-b-center-r">
<view class="details-b-title">
{{ detial.ActivityName }}
</view>
<view class="details-b-time">
报名时间:{{ detial.BMStart }}-{{ detial.BMEnd }}
</view>
<view class="details-b-time">
活动时间:{{ detial.HDStart }}-{{ detial.HDEnd }}
</view>
<view class="details-b-time"> 活动席位:{{ detial.TotalMan }}</view>
<view class="details-b-time">
<text v-if="detial.Distinguish == 1"
>已报入:{{ detial.JoinNum }}</text
>
<text v-if="detial.Distinguish == 0"
>已报入:男性{{ detial.ManNum }}
<text style="margin-left: 10px">女性{{ detial.WoManNum }}</text>
</text>
</view>
<view class="details-b-time" v-if="detial.AgeLimit == 0">
<text
>年龄范围:{{ detial.StartAge }}岁 ~ {{ detial.EndAge }}</text
>
</view>
<view class="details-b-time" v-if="detial.LnsideLimit == 1">
<text>只针对甲鹤学员</text>
</view>
</view>
</view>
<view class="addressStyle" @click="goopenlocation(detial)">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/jiaheaddress.png"
style="width: 12px; height: 15px; margin-right: 15px"
></image>
<view class="addressStyle-r">
{{ detial.LocationName }}
</view>
</view>
<view
style="
width: 100%;
box-sizing: border-box;
padding: 30rpx;
margin-bottom: 150rpx;
"
>
<view class="title-pic" v-if="richtext">
活动特色
<view class="line-bottom"></view>
</view>
<view class="acdetail_Intro" v-html="richtext"></view>
<view class="title-pic" v-if="detial.ActivityTitleList.length > 0">
活动内容
<view class="line-bottom"></view>
</view>
<view class="jz_TripMain">
<view class="jz_TripLine"></view>
<view v-for="(item, index) in detial.ActivityTitleList" :key="index">
<view
class="jz_TripTitle"
:style="{ 'margin-top': index === 0 ? '10rpx' : '40rpx' }"
>
<view class="jz_TripLeft">{{ index + 1 }}</view>
<view class="jz_TripRight">{{ item.Title }}</view>
</view>
<view class="jz_RightInner">
<template
v-for="(item2, index2) in item.ActivityPlanList"
v-if="item.ActivityPlanList.length > 0"
>
<view class="jz_Place">
<view class="jz_ComDian"></view>
<text style="margin-right: 10rpx">{{ item2.StartTime }}</text
>&nbsp;
<text
style="margin-right: 10rpx"
v-if="item2.ActivityDuration"
>{{ item2.ActivityDuration }}分钟</text
>
<text style="margin-right: 10rpx">{{ item2.TripTitle }}</text>
</view>
<view class="con" v-if="item2.TripContent">
<rich-text :nodes="item2.TripContent"></rich-text>
</view>
<view
class="active-img-box"
v-if="item2.TripPicList.length > 0"
>
<view
v-for="(item3, index3) in item2.TripPicList"
:key="index3"
>
<view
class="img-box"
v-if="index3 < 2"
@click="previewImage2(index3, item2.TripPicList)"
>
<image
class="active-img"
:src="item3"
mode="aspectFill"
></image>
</view>
<view
class="img-box img-box2"
v-if="index3 == 2"
@click="previewImage2(index3, item2.TripPicList)"
>
<image
class="active-img"
:src="item3"
mode="aspectFill"
></image>
<view class="layer" v-if="item2.TripPicList.length > 3">
+{{ item2.TripPicList.length - 3 }}
</view>
</view>
</view>
</view>
<view class="addr" v-if="item2.LocationName">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/jiaheaddress.png"
style="width: 12px; height: 15px; margin-right: 15px"
></image
>{{ item2.LocationName }}
</view>
</template>
</view>
</view>
</view>
<view class="title-pic" v-if="detial.Summary">
活动总结
<view class="line-bottom"></view>
</view>
<view
class="acdetail_Intro"
v-html="detial.Summary"
v-if="detial.Summary"
></view>
<view
class="title-pic"
v-if="
detial.FileGroup[0].groupList.length > 0 ||
detial.FileGroup[1].groupList.length > 0
"
>
活动相册
<view class="line-bottom"></view>
</view>
<view class="pic-name" v-if="detial.FileGroup[0].groupList.length > 0">
视频
</view>
<view class="video-box">
<view
v-for="(item, index) in detial.FileGroup[0].groupList"
:key="index"
class="pic-box"
@click="goPicDetail(item.FileList)"
v-if="item.FileList.length > 0"
>
<image
class="oneimg"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/videologo.png"
mode="aspectFill"
></image>
<!-- <image class="oneimg" :src="item.FileList[0].Image" mode="aspectFill" v-if="item.FileList.length<4" ></image> -->
<!-- <view class="fourimg-box" v-if="item.FileList.length>=4" >
<div v-for="(_item,_index) in item.FileList" :key="_item.id" class="subpic-box" v-if="_index<=3">
<image class="fourimg" :src="_item.Path" mode="aspectFill" ></image>
</div>
</view> -->
<view class="item-name">
{{ item.Name }}
</view>
<view class="item-num">
{{ item.FileList.length }}
</view>
</view>
</view>
<view class="pic-name" v-if="detial.FileGroup[1].groupList.length > 0">
图片
</view>
<view class="video-box">
<view
v-for="(item, index) in detial.FileGroup[1].groupList"
:key="index"
class="pic-box"
@click="goPicDetail(item.FileList)"
v-if="item.FileList.length > 0"
>
<image
class="oneimg"
:src="item.FileList[0].Path"
mode="aspectFill"
v-if="item.FileList.length < 4"
></image>
<view class="fourimg-box" v-if="item.FileList.length >= 4">
<div
v-for="(_item, _index) in item.FileList"
:key="_item.id"
class="subpic-box"
v-if="_index <= 3"
>
<image
class="fourimg"
:src="_item.Path"
mode="aspectFill"
></image>
</div>
</view>
<view class="item-name">
{{ item.Name }}
</view>
<view class="item-num">
{{ item.FileList.length }}
</view>
</view>
</view>
</view>
<view class="positionb">
<view :style="{ color: pricecolor, 'font-size': '40rpx' }">
<text v-if="detial.IsFree == 1">免费</text>
<view
v-if="
detial.IsFree == 2 && (detial.Price > 0 || detial.PointNum > 0)
"
style="display: flex; align-items: center"
>
<view style="display: flex; align-items: flex-end">
<text
v-if="detial.Price > 0"
style="font-size: 22rpx; margin-bottom: 6rpx"
></text
>
<text v-if="detial.Price > 0">{{ detial.Price }}</text>
<text
v-if="detial.Price > 0"
style="font-size: 22rpx; margin-bottom: 6rpx"
></text
>
</view>
<text
v-if="detial.Price > 0 && detial.PointNum > 0"
style="font-size: 12px; margin: 0 5px"
></text
>
<view style="display: flex; align-items: flex-end">
<text v-if="detial.PointNum > 0">{{ detial.PointNum }}</text>
<text
v-if="detial.PointNum > 0"
style="font-size: 22rpx; margin-bottom: 6rpx"
></text
>
</view>
</view>
<!-- <view v-if="detial.IsFree==2 && detial.Price==0 && detial.PointNum>0" style="display: flex;align-items: flex-end;" >
<text>{{detial.PointNum}}</text>
<text style="font-size: 22rpx;">点</text>
</view> -->
</view>
<view
class="btnc"
:style="{ background: mainColor }"
v-if="IsShowRollCall == 1"
@click="goRollCall"
>点名</view
>
<view v-if="detial.IsJoinActivity == 0">
<view
class="btnc"
v-if="detial.IsSignUp == 1 && detial.TotalMan - detial.JoinNum > 0"
:style="{ background: mainColor }"
@click="gosignUp()"
>立即预约</view
>
<view
class="btnc"
v-if="detial.IsSignUp == 0 || detial.TotalMan - detial.JoinNum == 0"
>不可预约</view
>
</view>
<view v-if="detial.IsJoinActivity == 1">
<view class="btnc" v-if="detial.IsSignUp == 1">已报名</view>
</view>
</view>
</view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
nextTick,
} from "vue";
import { getActivityDatail } from "../../api/activity";
export default {
setup() {
let data = reactive({
loading: true,
pageTitle: "活动详情",
showAuth: false,
mainColor: "",
pricecolor: "",
Id: 0,
detial: {},
richtext: "",
Up: 0,
IsShowRollCall: 0, //是否显示点名按钮
});
let methods = {
goPicDetail(arr) {
uni.navigateTo({
url:
"/pages/school/picDetail?data=" +
encodeURIComponent(JSON.stringify({ data: arr })),
});
},
async GetActivityDetial() {
let res = await getActivityDatail({
Id: data.Id,
});
if (res) {
this.loading = false;
data.detial = res.data;
let tempRichtext = "";
tempRichtext = data.detial.ActivityInfo.replace(
/<img[^>]*>/gi,
function (match, capture) {
var match = match.replace(
/style=\"(.*)\"/gi,
'style="width:100% !important"'
);
return match;
}
);
data.richtext = tempRichtext;
}
},
goopenlocation(x) {
uni.openLocation({
address: x.LocationName,
latitude: Number(x.LonLat.split(",")[0]),
longitude: Number(x.LonLat.split(",")[1]),
success: function () {
console.log("success");
},
fail: function (err) {
console.log(err);
},
});
},
gosignUp() {
let u = uni.getStorageSync("mall_UserInfo");
if (!u) {
u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
let dataList = encodeURIComponent(JSON.stringify(this.detial));
uni.navigateTo({
url: "/pages/school/jieheactivityBM?details=" + dataList,
});
}
},
previewImage(x) {
uni.previewImage({
urls: [x],
current: 0,
});
},
previewImage2(i, arr) {
uni.previewImage({
urls: arr,
current: i,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function (data) {},
fail: function (err) {
console.log(err.errMsg);
},
},
});
},
};
onMounted(() => {});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onShareTimeline() {
return {
title: "",
query: "",
imageUrl: "",
};
},
onShareAppMessage(res) {
return {
title: this.detial.ActivityName ? this.detial.ActivityName : "活动详情",
path: "",
imageUrl: this.detial.CoverImg ? this.detial.CoverImg : "",
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
if (options && options.Id) {
this.Id = options.Id;
}
this.GetActivityDetial();
},
};
</script>
...@@ -176,21 +176,17 @@ ...@@ -176,21 +176,17 @@
</view> </view>
</view> </view>
</view> </view>
<view style="margin: 20rpx 0">
<Loadmore :state="pageState" /> <Loadmore :state="pageState" />
</view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<view v-show="current == 2" style="height: calc(100vh - 50px)"> <view v-show="current == 2" style="height: calc(100vh - 50px)">
<!-- <SignUp ref="children"></SignUp> --> <signUp ref="children"></signUp>
</view> </view>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<van-popup <van-popup
:show="show" :show="show"
closeable closeable
...@@ -240,18 +236,18 @@ import { ...@@ -240,18 +236,18 @@ import {
watch, watch,
computed, computed,
onMounted, onMounted,
nextTick,
} from "vue"; } from "vue";
import Loadmore from "../../components/loadmore.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"; import { getActivityTypeList, getActivityList } from "../../api/activity";
export default { export default {
components: { components: {
Loadmore, Loadmore,
// SignUp, signUp,
}, },
setup() { setup() {
let i = getCurrentInstance(); let { refs } = getCurrentInstance();
console.log(252, i);
let data = reactive({ let data = reactive({
show: false, show: false,
pageState: "more", pageState: "more",
...@@ -268,12 +264,12 @@ export default { ...@@ -268,12 +264,12 @@ export default {
PageCount: 1, PageCount: 1,
g: [], g: [],
activityTypeList: [], activityTypeList: [],
mainColor: "#00ACF9",
}); });
let methods = { let methods = {
async getActivityType() { async getActivityType() {
let res = await getActivityTypeList({}); let res = await getActivityTypeList({});
if (res) { if (res) {
console.log("mall", res);
data.activityTypeList = res.data; data.activityTypeList = res.data;
data.activityTypeList.unshift({ data.activityTypeList.unshift({
Id: 0, Id: 0,
...@@ -282,12 +278,13 @@ export default { ...@@ -282,12 +278,13 @@ export default {
data.msg.ActivityType = 0; data.msg.ActivityType = 0;
data.ActivityName = "不限"; data.ActivityName = "不限";
} }
// methods.getList(); that.getList();
}, },
async getList() { async getList() {
let res = await getActivityList(data.msg); let res = await getActivityList(data.msg);
if (res) { if (res) {
let arr = methods.groupArr(res.data.pageData, "MonthStr"); let arr = that.groupArr(res.data.pageData, "MonthStr");
let arr2 = arr; let arr2 = arr;
if (data.msg.pageIndex === 1) { if (data.msg.pageIndex === 1) {
data.g = []; data.g = [];
...@@ -304,7 +301,7 @@ export default { ...@@ -304,7 +301,7 @@ export default {
} }
}); });
} }
data.g = data.g.concat(data); data.g = data.g.concat(arr);
data.PageCount = res.data.pageCount; data.PageCount = res.data.pageCount;
if (res.data.pageCount == 1) { if (res.data.pageCount == 1) {
data.pageState = "none"; data.pageState = "none";
...@@ -334,14 +331,14 @@ export default { ...@@ -334,14 +331,14 @@ export default {
} }
return att; return att;
}, },
getorder() { // getorder() {
//报名成功处理 // //报名成功处理
data.current = 2; //让他直接跳入我报名 // data.current = 2; //让他直接跳入我报名
if (Object.keys(this.$refs).length > 0 && this.$refs.children) { // if (Object.keys(this.$refs).length > 0 && this.$refs.children) {
//判断 // //判断
this.$refs.children.getfzuj(); // this.$refs.children.getfzuj();
} // }
}, // },
lower(e) { lower(e) {
if (data.msg.pageIndex < data.PageCount) { if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
...@@ -352,39 +349,19 @@ export default { ...@@ -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) { listType(type) {
data.current = type; data.current = type;
if (type == 3) { if (type == 3) {
this.msg.SelectIsEnd = 1; data.msg.SelectIsEnd = 1;
this.msg.pageIndex = 1; data.msg.pageIndex = 1;
this.getList(); that.getList();
} else if (type == 1) { } else if (type == 1) {
this.msg.pageIndex = 1; data.msg.pageIndex = 1;
this.msg.SelectIsEnd = 0; data.msg.SelectIsEnd = 0;
this.getList(); that.getList();
} else {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else { } else {
if (Object.keys(this.$refs).length > 0 && this.$refs.children) { console.log(253, refs);
//判断 refs.children.$vm.getfzuj();
this.$refs.children.getfzuj();
}
}
} }
}, },
select(x) { select(x) {
...@@ -393,16 +370,16 @@ export default { ...@@ -393,16 +370,16 @@ export default {
data.show = false; data.show = false;
data.msg.pageIndex = 1; data.msg.pageIndex = 1;
data.g = []; data.g = [];
data.getList(); that.getList();
}, },
gourl(x) { gourl(x) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/school/JIaheactivitydetails?Id=" + x.Id, url: "/pages/activity/activityDetails?Id=" + x.Id,
}); });
}, },
}; };
onMounted(() => { onMounted(() => {
methods.getActivityType(); that.getActivityType();
}); });
let that = methods; let that = methods;
return { return {
...@@ -497,6 +474,7 @@ export default { ...@@ -497,6 +474,7 @@ export default {
background: #b7a264; background: #b7a264;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box;
padding: 0 26rpx; padding: 0 26rpx;
border-top-right-radius: 12rpx; border-top-right-radius: 12rpx;
border-bottom-left-radius: 12rpx; border-bottom-left-radius: 12rpx;
...@@ -544,6 +522,7 @@ export default { ...@@ -544,6 +522,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx; padding: 0 30rpx;
} }
...@@ -551,7 +530,6 @@ export default { ...@@ -551,7 +530,6 @@ export default {
height: calc(100vh - 100rpx); height: calc(100vh - 100rpx);
width: calc(100vw); width: calc(100vw);
overflow: hidden; overflow: hidden;
padding-bottom: 100rpx;
} }
.Jiaheactivity { .Jiaheactivity {
width: 100%; width: 100%;
...@@ -577,6 +555,7 @@ export default { ...@@ -577,6 +555,7 @@ export default {
.Jiaheactivity .foritem { .Jiaheactivity .foritem {
height: 60rpx; height: 60rpx;
font-size: 24rpx; font-size: 24rpx;
box-sizing: border-box;
padding: 0 24rpx; padding: 0 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -585,6 +564,7 @@ export default { ...@@ -585,6 +564,7 @@ export default {
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.ht-box { .ht-box {
box-sizing: border-box;
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
...@@ -377,10 +377,11 @@ export default { ...@@ -377,10 +377,11 @@ export default {
}, },
setup(props, context) { setup(props, context) {
let { refs } = getCurrentInstance(); let { refs } = getCurrentInstance();
console.log(refs);
let data = reactive({ let data = reactive({
time: 999, time: 999,
statusBarHeight: 0, statusBarHeight: 0,
msg: { GuestId: 0, PaperId: 0, PublishId: 0}, msg: { GuestId: 0, PaperId: 0, PublishId: 0 },
peaperDetail: {}, peaperDetail: {},
changeIndex: 0, //大题序号 changeIndex: 0, //大题序号
...@@ -389,7 +390,7 @@ export default { ...@@ -389,7 +390,7 @@ export default {
Exam_Student_Id: 0, Exam_Student_Id: 0,
autoTimeStart: false, autoTimeStart: false,
isOperate: true, //考试状态 判断是考试还是查看答案 isOperate: true, //考试状态 判断是考试还是查看答案
isAutoTime: true isAutoTime: true,
}); });
let methods = { let methods = {
changeNumToHan, changeNumToHan,
...@@ -410,7 +411,7 @@ export default { ...@@ -410,7 +411,7 @@ export default {
if (res.Code == 1) { if (res.Code == 1) {
data.peaperDetail = res.Data; data.peaperDetail = res.Data;
//判断是查看答题结果就不倒计时 //判断是查看答题结果就不倒计时
if(this.isAutoTime){ if (this.isAutoTime) {
data.autoTimeStart = true; data.autoTimeStart = true;
data.time = res.Data.Publish.ExamTimes * 60 * 1000; data.time = res.Data.Publish.ExamTimes * 60 * 1000;
} }
...@@ -462,7 +463,7 @@ export default { ...@@ -462,7 +463,7 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
if(options.GuestId){ if (options.GuestId) {
this.msg.GuestId = options.GuestId; this.msg.GuestId = options.GuestId;
} }
if (options.PaperId) { if (options.PaperId) {
...@@ -474,7 +475,10 @@ export default { ...@@ -474,7 +475,10 @@ export default {
if (options.Exam_Student_Id) { if (options.Exam_Student_Id) {
this.Exam_Student_Id = options.Exam_Student_Id; this.Exam_Student_Id = options.Exam_Student_Id;
} }
if (options.ExamStatus && (options.ExamStatus == 1||options.ExamStatus == 2)) { if (
options.ExamStatus &&
(options.ExamStatus == 1 || options.ExamStatus == 2)
) {
this.isOperate = false; this.isOperate = false;
this.msg.isShowAnswer = true; this.msg.isShowAnswer = true;
this.isAutoTime = false; this.isAutoTime = false;
......
<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 @@ ...@@ -2,11 +2,12 @@
<script> <script>
/** /**
* 因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。 * 1.因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。
如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作 如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作
* // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象,------------reactive对象不能直接赋值-------------- * // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象,------------reactive对象不能直接赋值--------------
*@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式,需用...toRef() *@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式,需用...toRef()
* 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy,refs } = getCurrentInstance(); ctx或proxy.$挂载的方法 * 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy,refs } = getCurrentInstance(); ctx或proxy.$挂载的方法
* 2.ref 获取子组件实例,组件名首字母小写
*/ */
import { import {
ref, ref,
......
...@@ -30,6 +30,7 @@ let request = (param) => { ...@@ -30,6 +30,7 @@ let request = (param) => {
token: JHdata.MallToken token: JHdata.MallToken
}, },
success: res => { success: res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
resolve(res.data) resolve(res.data)
} else { } 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