权限调整
This commit is contained in:
parent
db15ca50e2
commit
a1bce6f7b5
@ -63,6 +63,14 @@ export const checkOpenId = async (param: {
|
|||||||
export const updateUserApi = async (param: any) => {
|
export const updateUserApi = async (param: any) => {
|
||||||
return await post("/open/login/js/updateUser", param);
|
return await post("/open/login/js/updateUser", param);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const updateSignFileApi = async (param: { userId: number; signFile: string }) => {
|
||||||
|
return await post("/api/user/updateSignFile", {
|
||||||
|
id: param.userId,
|
||||||
|
signFile: param.signFile
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const findJsByPhoneApi = async (param: any) => {
|
export const findJsByPhoneApi = async (param: any) => {
|
||||||
return await get("/api/js/findJsByPhone", param);
|
return await get("/api/js/findJsByPhone", param);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -57,6 +57,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/system/subscribe/index",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "关注服务号",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"backgroundColor": "#f4f5f7"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/system/webView/webView",
|
"path": "pages/system/webView/webView",
|
||||||
"style": {
|
"style": {
|
||||||
@ -242,6 +251,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/base/course-selection/noticeclub",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "告知书",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/base/course-selection/enrolled",
|
"path": "pages/base/course-selection/enrolled",
|
||||||
"style": {
|
"style": {
|
||||||
@ -254,6 +270,14 @@
|
|||||||
"navigationBarTitleText": "未开放",
|
"navigationBarTitleText": "未开放",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/base/course-selection/enrollment-ended",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "选课已结束",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="countdown-section">
|
<view class="countdown-section">
|
||||||
<template v-if="!isEnrollmentEnded">
|
<template v-if="!isEnrollmentEnded">
|
||||||
<view class="countdown-title">{{ countdownTitle }}</view>
|
|
||||||
<view class="countdown-timer">
|
<view class="countdown-timer">
|
||||||
<view class="time-block">
|
<view class="time-block">
|
||||||
<text class="time-value">{{ countdownTime.hours }}</text>
|
<text class="time-value">{{ countdownTime.hours }}</text>
|
||||||
@ -20,10 +19,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="enrollment-ended">
|
<view class="enrollment-ended" v-if="isEnrollmentEnded && isCourseEnded">
|
||||||
<u-icon name="info-circle" color="#FF9900" size="20"></u-icon>
|
<u-icon name="info-circle" color="#FF9900" size="20"></u-icon>
|
||||||
<text>选课已经结束</text>
|
<text>选课已经结束</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="enrollment-started" v-else-if="isEnrollmentEnded && !isCourseEnded">
|
||||||
|
<view class="enrollment-content">
|
||||||
|
<view class="enrollment-title">
|
||||||
|
<u-icon name="clock" color="#4CAF50" size="16"></u-icon>
|
||||||
|
<text>报名结束时间</text>
|
||||||
|
</view>
|
||||||
|
<view class="enrollment-date">
|
||||||
|
<text>{{ formatEndTime }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -48,17 +58,20 @@ const countdownTime = reactive({
|
|||||||
|
|
||||||
const kcStatus = ref(false);
|
const kcStatus = ref(false);
|
||||||
|
|
||||||
// 倒计时标题文本
|
|
||||||
const countdownTitle = computed(() => {
|
|
||||||
return kcStatus.value ? "距离选课结束还剩" : "距离选课开始还剩";
|
|
||||||
});
|
|
||||||
|
|
||||||
// 当前选中的学生
|
// 当前选中的学生
|
||||||
let countdownTimer: number | null = null;
|
let countdownTimer: number | null = null;
|
||||||
const remainTime = ref("00:00:00");
|
const remainTime = ref("00:00:00");
|
||||||
|
|
||||||
// 添加选课是否已结束的标记
|
// 添加选课是否已结束的标记
|
||||||
const isEnrollmentEnded = ref(false);
|
const isEnrollmentEnded = ref(false);
|
||||||
|
// 添加选课是否已结束的标记(区分选课开始和选课结束)
|
||||||
|
const isCourseEnded = ref(false);
|
||||||
|
|
||||||
|
// 格式化结束时间
|
||||||
|
const formatEndTime = computed(() => {
|
||||||
|
if (!props.xk || !props.xk.xkjstime) return '';
|
||||||
|
return dayjs(props.xk.xkjstime).format('YYYY-MM-DD');
|
||||||
|
});
|
||||||
|
|
||||||
// 启动倒计时
|
// 启动倒计时
|
||||||
const startCountdown = (endTimeStamp: number) => {
|
const startCountdown = (endTimeStamp: number) => {
|
||||||
@ -82,26 +95,10 @@ const startCountdown = (endTimeStamp: number) => {
|
|||||||
countdownTimer = null;
|
countdownTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断当前倒计时是选课开始还是选课结束
|
// 选课开始倒计时结束
|
||||||
if (!kcStatus.value) {
|
isEnrollmentEnded.value = true; // 标记选课已开始,隐藏倒计时
|
||||||
// 如果是选课开始倒计时结束,则切换到选课结束倒计时
|
isCourseEnded.value = false; // 标记选课未结束
|
||||||
kcStatus.value = true; // 更新状态为选课已开始
|
|
||||||
uni.showToast({
|
|
||||||
title: "选课已开始",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
// 开始选课结束倒计时
|
|
||||||
const xkjstime = dayjs(props.xk.xkjstime).valueOf();
|
|
||||||
startCountdown(xkjstime);
|
|
||||||
} else {
|
|
||||||
// 如果是选课结束倒计时结束
|
|
||||||
isEnrollmentEnded.value = true; // 标记选课已结束
|
|
||||||
emit("over");
|
emit("over");
|
||||||
uni.showToast({
|
|
||||||
title: "选课已结束",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,22 +131,29 @@ const changeXk = (xk: any) => {
|
|||||||
//获取选课结束时间
|
//获取选课结束时间
|
||||||
const xkjstime = dayjs(xk.xkjstime).valueOf();
|
const xkjstime = dayjs(xk.xkjstime).valueOf();
|
||||||
|
|
||||||
// 检查是否已经超过选课结束时间
|
// 如果当前时间 >= 选课结束时间,则显示选课已结束
|
||||||
if (now > xkjstime) {
|
if (now >= xkjstime) {
|
||||||
kcStatus.value = true;
|
|
||||||
isEnrollmentEnded.value = true;
|
isEnrollmentEnded.value = true;
|
||||||
|
isCourseEnded.value = true;
|
||||||
countdownTime.hours = "00";
|
countdownTime.hours = "00";
|
||||||
countdownTime.minutes = "00";
|
countdownTime.minutes = "00";
|
||||||
countdownTime.seconds = "00";
|
countdownTime.seconds = "00";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
//判断选课是否开始
|
|
||||||
else if (now < xkkstime) {
|
// 如果当前时间 >= 选课开始时间 且 < 选课结束时间,显示报名提示
|
||||||
|
if (now >= xkkstime && now < xkjstime) {
|
||||||
|
isEnrollmentEnded.value = true;
|
||||||
|
isCourseEnded.value = false;
|
||||||
|
countdownTime.hours = "00";
|
||||||
|
countdownTime.minutes = "00";
|
||||||
|
countdownTime.seconds = "00";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只有当前时间 < 选课开始时间时才显示倒计时
|
||||||
kcStatus.value = false;
|
kcStatus.value = false;
|
||||||
startCountdown(xkkstime);
|
startCountdown(xkkstime);
|
||||||
} else {
|
|
||||||
kcStatus.value = true;
|
|
||||||
startCountdown(xkjstime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 页面卸载前清除定时器
|
// 页面卸载前清除定时器
|
||||||
@ -174,38 +178,37 @@ if (props.xk && props.xk.id) {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.countdown-section {
|
.countdown-section {
|
||||||
.countdown-title {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.countdown-timer {
|
.countdown-timer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
.time-block {
|
.time-block {
|
||||||
background-color: rgba(255, 255, 255, 0.2);
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
min-width: 40px;
|
min-width: 30px;
|
||||||
padding: 5px 8px;
|
padding: 3px 5px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.time-value {
|
.time-value {
|
||||||
font-size: 20px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display: block;
|
display: block;
|
||||||
|
line-height: 1;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-unit {
|
.time-unit {
|
||||||
font-size: 12px;
|
font-size: 9px;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-separator {
|
.time-separator {
|
||||||
font-size: 20px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 0 5px;
|
margin: 0 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,12 +219,49 @@ if (props.xk && props.xk.id) {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-color: rgba(255, 255, 255, 0.2);
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 12px 15px;
|
padding: 8px 12px;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 选课已开始样式 */
|
||||||
|
.enrollment-started {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: rgba(76, 175, 80, 0.2);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.3;
|
||||||
|
|
||||||
|
.enrollment-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
|
.enrollment-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
font-size: 11px;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.enrollment-date {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -117,13 +117,6 @@ const loadXkList = async () => {
|
|||||||
const switchXk = (xk: any) => {
|
const switchXk = (xk: any) => {
|
||||||
curXk.value = xk;
|
curXk.value = xk;
|
||||||
showFlag.value = false;
|
showFlag.value = false;
|
||||||
if (xk && xk.id) {
|
|
||||||
// 显示切换成功提示
|
|
||||||
uni.showToast({
|
|
||||||
title: `已切换到${xk.xkmc}`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
emit("change", xk);
|
emit("change", xk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,15 +9,17 @@
|
|||||||
:class="{ selected: xkkc.isSelected }"
|
:class="{ selected: xkkc.isSelected }"
|
||||||
@click="toggleSelection(xkkc)"
|
@click="toggleSelection(xkkc)"
|
||||||
>
|
>
|
||||||
|
<view class="course-header">
|
||||||
<view class="course-name">{{ xkkc.kcmc }}</view>
|
<view class="course-name">{{ xkkc.kcmc }}</view>
|
||||||
|
<view class="detail-btn" @click.stop="goToDetail(xkkc)">
|
||||||
|
<image src="/static/base/home/details.svg" class="detail-icon" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="register-info">
|
<view class="register-info">
|
||||||
<text>报名情况:</text>
|
<text>报名情况:</text>
|
||||||
<text class="register-count">{{ xkkc.hasNum || 0 }}</text>
|
<text class="register-count">{{ xkkc.hasNum || 0 }}</text>
|
||||||
<text> | {{ xkkc.maxNum || 0 }}</text>
|
<text> | {{ xkkc.maxNum || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-btn" @click.stop="goToDetail(xkkc)"
|
|
||||||
>详情</view
|
|
||||||
>
|
|
||||||
<view v-if="xkkc.isSelected" class="selected-mark">
|
<view v-if="xkkc.isSelected" class="selected-mark">
|
||||||
<uni-icons
|
<uni-icons
|
||||||
type="checkbox-filled"
|
type="checkbox-filled"
|
||||||
@ -179,29 +181,40 @@ if (props.xk && props.xk.xkkcs) {
|
|||||||
box-shadow: 0 2px 8px rgba(63, 191, 114, 0.15);
|
box-shadow: 0 2px 8px rgba(63, 191, 114, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.course-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
.course-name {
|
.course-name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 10px;
|
flex: 1;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 4px;
|
||||||
|
|
||||||
|
.detail-icon {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-info {
|
.register-info {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-bottom: 12px;
|
|
||||||
|
|
||||||
.register-count {
|
.register-count {
|
||||||
color: #2879ff;
|
color: #2879ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-btn {
|
|
||||||
display: inline-block;
|
|
||||||
color: #2879ff;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-mark {
|
.selected-mark {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -6px;
|
top: -6px;
|
||||||
|
|||||||
@ -86,21 +86,21 @@ const switchXs = (xs: any) => {
|
|||||||
setCurXs(xs);
|
setCurXs(xs);
|
||||||
showFlag.value = false;
|
showFlag.value = false;
|
||||||
emit('change', xs);
|
emit('change', xs);
|
||||||
// 这里可以添加切换学生后的其他操作,如刷新页面数据等
|
}
|
||||||
uni.showToast({
|
|
||||||
title: `已切换到${xs.xm}`,
|
// 设置当前学生(无提示)
|
||||||
icon: "none",
|
const setCurrentStudent = (xs: any) => {
|
||||||
});
|
setCurXs(xs);
|
||||||
|
emit('change', xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是bar形式,则默认打开选择器
|
// 如果是bar形式,则默认打开选择器
|
||||||
if (props.isBar
|
if (props.isBar) {
|
||||||
//&& (getCurXs === null || !getCurXs.id)
|
|
||||||
) {
|
|
||||||
if (getUser.xsList.length > 1 ) {
|
if (getUser.xsList.length > 1 ) {
|
||||||
showPicker();
|
showPicker();
|
||||||
} else {
|
} else {
|
||||||
switchXs(getUser.xsList[0]);
|
// 只有一个学生时,直接设置但不显示提示
|
||||||
|
setCurrentStudent(getUser.xsList[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -3,14 +3,17 @@
|
|||||||
<!-- 选课信息头部 - 固定部分 -->
|
<!-- 选课信息头部 - 固定部分 -->
|
||||||
<view class="selection-header">
|
<view class="selection-header">
|
||||||
<view class="header-content">
|
<view class="header-content">
|
||||||
<!-- 选课类型选择部分 -->
|
<!-- 第一行:选课类型选择 -->
|
||||||
<XkPicker title="俱乐部信息" :is-qk="true" xklx-id="816059832" :xs-id="curXs.id" @change="switchXk" v-if="!xsFlag" />
|
<view class="top-row" v-if="!xsFlag">
|
||||||
<!-- 学生选择部分 -->
|
<XkPicker title="俱乐部信息" :is-qk="true" xklx-id="816059832" :xs-id="curXs.id" @change="switchXk" />
|
||||||
|
</view>
|
||||||
|
<!-- 第二行:学生选择和倒计时 -->
|
||||||
|
<view class="bottom-row">
|
||||||
<XsPicker :is-bar="true" @change="switchXs" />
|
<XsPicker :is-bar="true" @change="switchXs" />
|
||||||
<!-- 倒计时-->
|
|
||||||
<XkCountdown :xk="curXk" @over="xkTimeOver" v-if="curXk && curXk.id" />
|
<XkCountdown :xk="curXk" @over="xkTimeOver" v-if="curXk && curXk.id" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 可滚动的内容区域 -->
|
<!-- 可滚动的内容区域 -->
|
||||||
<view class="scrollable-content">
|
<view class="scrollable-content">
|
||||||
@ -35,6 +38,7 @@ import XkkcList from "@/pages/base/components/XkkcList/index.vue"
|
|||||||
import { jzXkQkjApi } from "@/api/base/server";
|
import { jzXkQkjApi } from "@/api/base/server";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const { getCurXs, getUser } = useUserStore();
|
const { getCurXs, getUser } = useUserStore();
|
||||||
const { setData, getData } = useDataStore();
|
const { setData, getData } = useDataStore();
|
||||||
@ -46,9 +50,31 @@ const selectedXkkcIds = ref<any>([]);
|
|||||||
|
|
||||||
const xsFlag = ref(true);
|
const xsFlag = ref(true);
|
||||||
|
|
||||||
|
// 检查选课是否已结束
|
||||||
|
const checkEnrollmentStatus = (xk: any) => {
|
||||||
|
if (!xk || !xk.xkjstime) return;
|
||||||
|
|
||||||
|
const now = new Date().getTime();
|
||||||
|
const endTime = new Date(xk.xkjstime).getTime();
|
||||||
|
|
||||||
|
if (now > endTime) {
|
||||||
|
// 选课已结束,跳转到结束页面
|
||||||
|
const courseInfo = encodeURIComponent(JSON.stringify(xk));
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/base/course-selection/enrollment-ended?courseInfo=${courseInfo}`
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// 切换选课
|
// 切换选课
|
||||||
const switchXk = (xk: any) => {
|
const switchXk = (xk: any) => {
|
||||||
curXk.value = xk;
|
curXk.value = xk;
|
||||||
|
// 检查选课状态
|
||||||
|
if (checkEnrollmentStatus(xk)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const switchXs = (xs: any) => {
|
const switchXs = (xs: any) => {
|
||||||
@ -57,7 +83,9 @@ const switchXs = (xs: any) => {
|
|||||||
|
|
||||||
// 选课时间结束
|
// 选课时间结束
|
||||||
const xkTimeOver = (val: any) => {
|
const xkTimeOver = (val: any) => {
|
||||||
console.log(val);
|
console.log('选课时间结束:', val);
|
||||||
|
// 选课开始时不再跳转,让用户继续选课
|
||||||
|
// 只有在选课结束时才跳转到选课结束页面
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选中课程
|
// 选中课程
|
||||||
@ -75,6 +103,21 @@ const submit = async () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查选课时间
|
||||||
|
if (curXk.value && curXk.value.xkkstime) {
|
||||||
|
const now = dayjs().valueOf();
|
||||||
|
const startTime = dayjs(curXk.value.xkkstime).valueOf();
|
||||||
|
|
||||||
|
if (now < startTime) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "选课还未开始,请耐心等待!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "抢课中...",
|
title: "抢课中...",
|
||||||
});
|
});
|
||||||
@ -173,6 +216,36 @@ const submit = async () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
|
|
||||||
|
.top-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
:deep(.title-section) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 15px;
|
||||||
|
|
||||||
|
// 学生选择器样式
|
||||||
|
:deep(.xs-bar) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 倒计时组件样式
|
||||||
|
:deep(.countdown-section) {
|
||||||
|
flex-shrink: 0;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -161,7 +161,7 @@ const courseDetail = computed(() => {
|
|||||||
location: data.kcdd || "暂无地点信息",
|
location: data.kcdd || "暂无地点信息",
|
||||||
price: data.kcje || 0,
|
price: data.kcje || 0,
|
||||||
studyTime: data.studyTime || "暂无上课时间",
|
studyTime: data.studyTime || "暂无上课时间",
|
||||||
xkkcImg: data.xkkcImg || "/static/images/robot-course.jpg", // 默认图片
|
xkkcImg: imagUrl(data.xkkcImg), // 使用imagUrl处理图片路径
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
291
src/pages/base/course-selection/enrollment-ended.vue
Normal file
291
src/pages/base/course-selection/enrollment-ended.vue
Normal file
@ -0,0 +1,291 @@
|
|||||||
|
<template>
|
||||||
|
<view class="enrollment-ended-page">
|
||||||
|
<view class="ended-container">
|
||||||
|
<!-- 页面头部 -->
|
||||||
|
<view class="page-header">
|
||||||
|
<text class="page-title">选课已结束</text>
|
||||||
|
<text class="page-subtitle">本次选课活动已经结束,感谢您的参与</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 主要信息显示区域 -->
|
||||||
|
<view class="main-content">
|
||||||
|
<view class="content-card">
|
||||||
|
<view class="icon-section">
|
||||||
|
<u-icon name="clock" size="80" color="#FF6B6B" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-section">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">选课名称:</text>
|
||||||
|
<text class="info-value">{{ courseInfo?.xkmc || '兴趣课选课' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">选课时间:</text>
|
||||||
|
<text class="info-value">{{ formatTime(courseInfo?.xkkstime) }} - {{ formatTime(courseInfo?.xkjstime) }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">结束时间:</text>
|
||||||
|
<text class="info-value">{{ formatTime(courseInfo?.xkjstime) }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="courseInfo?.qdmc">
|
||||||
|
<text class="info-label">选课地点:</text>
|
||||||
|
<text class="info-value">{{ courseInfo.qdmc }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="status-section">
|
||||||
|
<view class="status-badge">
|
||||||
|
<u-icon name="close-circle" size="16" color="#FF6B6B" />
|
||||||
|
<text class="status-text">选课已结束</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 提示信息 -->
|
||||||
|
<view class="tips-section">
|
||||||
|
<view class="tips-header">
|
||||||
|
<u-icon name="info-circle" size="16" color="#409EFF" />
|
||||||
|
<text class="tips-title">温馨提示</text>
|
||||||
|
</view>
|
||||||
|
<view class="tips-content">
|
||||||
|
<text class="tip-item">• 本次选课活动已经结束,无法继续选课</text>
|
||||||
|
<text class="tip-item">• 如需了解选课结果,请联系相关老师</text>
|
||||||
|
<text class="tip-item">• 下次选课时间请关注学校通知</text>
|
||||||
|
<text class="tip-item">• 如有疑问,请联系学校教务处</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<view class="action-buttons">
|
||||||
|
<button @click="goBack" class="back-btn">
|
||||||
|
<u-icon name="arrow-left" size="16" color="#666" />
|
||||||
|
<text class="btn-text">返回首页</text>
|
||||||
|
</button>
|
||||||
|
<button @click="refreshPage" class="refresh-btn">
|
||||||
|
<u-icon name="reload" size="16" color="#409EFF" />
|
||||||
|
<text class="btn-text">刷新页面</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
// 页面参数
|
||||||
|
const courseInfo = ref<any>(null);
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
// 接收传递过来的选课信息
|
||||||
|
if (options?.courseInfo) {
|
||||||
|
try {
|
||||||
|
courseInfo.value = JSON.parse(decodeURIComponent(options.courseInfo));
|
||||||
|
} catch (error) {
|
||||||
|
console.error('解析选课信息失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 格式化时间
|
||||||
|
const formatTime = (time: string) => {
|
||||||
|
if (!time) return '未设置';
|
||||||
|
const date = new Date(time);
|
||||||
|
return date.toLocaleString('zh-CN', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 返回首页
|
||||||
|
const goBack = () => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/base/home/index'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 刷新页面
|
||||||
|
const refreshPage = () => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/base/course-selection/index'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.enrollment-ended-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ended-container {
|
||||||
|
max-width: 400px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面头部
|
||||||
|
.page-header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
display: block;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: white;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-subtitle {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主要内容区域
|
||||||
|
.main-content {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-card {
|
||||||
|
background: white;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 24px;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-section {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
min-width: 80px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-section {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.status-badge {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
background: #fff5f5;
|
||||||
|
border: 1px solid #ff6b6b;
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
|
||||||
|
.status-text {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #ff6b6b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提示信息
|
||||||
|
.tips-section {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
margin-bottom: 30px;
|
||||||
|
|
||||||
|
.tips-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.tips-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips-content {
|
||||||
|
.tip-item {
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
color: rgba(255, 255, 255, 0.9);
|
||||||
|
margin-bottom: 8px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 操作按钮
|
||||||
|
.action-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
|
.back-btn, .refresh-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 44px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refresh-btn {
|
||||||
|
background: #409EFF;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-text {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应式优化
|
||||||
|
@media (max-width: 375px) {
|
||||||
|
.enrollment-ended-page {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-card {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header .page-title {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -5,12 +5,13 @@
|
|||||||
<view class="header-content">
|
<view class="header-content">
|
||||||
<!-- 选课类型选择部分 -->
|
<!-- 选课类型选择部分 -->
|
||||||
<XkPicker title="俱乐部信息" :is-qk="true" xklx-id="962488654" :xs-id="curXs.id" @change="switchXk" v-if="!xsFlag" />
|
<XkPicker title="俱乐部信息" :is-qk="true" xklx-id="962488654" :xs-id="curXs.id" @change="switchXk" v-if="!xsFlag" />
|
||||||
<!-- 学生选择部分 -->
|
<!-- 学生选择和倒计时 -->
|
||||||
|
<view class="bottom-row">
|
||||||
<XsPicker :is-bar="true" @change="switchXs" />
|
<XsPicker :is-bar="true" @change="switchXs" />
|
||||||
<!-- 倒计时-->
|
|
||||||
<XkCountdown :xk="curXk" @over="xkTimeOver" v-if="curXk && curXk.id" />
|
<XkCountdown :xk="curXk" @over="xkTimeOver" v-if="curXk && curXk.id" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 可滚动的内容区域 -->
|
<!-- 可滚动的内容区域 -->
|
||||||
<view class="scrollable-content">
|
<view class="scrollable-content">
|
||||||
@ -35,6 +36,7 @@ import XkkcList from "@/pages/base/components/XkkcList/index.vue"
|
|||||||
import { jzXkQkjApi } from "@/api/base/server";
|
import { jzXkQkjApi } from "@/api/base/server";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const { getCurXs, getUser } = useUserStore();
|
const { getCurXs, getUser } = useUserStore();
|
||||||
const { setData, getData } = useDataStore();
|
const { setData, getData } = useDataStore();
|
||||||
@ -47,9 +49,31 @@ const selectedXkkcIds = ref<any>([]);
|
|||||||
|
|
||||||
const xsFlag = ref(true);
|
const xsFlag = ref(true);
|
||||||
|
|
||||||
|
// 检查选课是否已结束
|
||||||
|
const checkEnrollmentStatus = (xk: any) => {
|
||||||
|
if (!xk || !xk.xkjstime) return;
|
||||||
|
|
||||||
|
const now = new Date().getTime();
|
||||||
|
const endTime = new Date(xk.xkjstime).getTime();
|
||||||
|
|
||||||
|
if (now > endTime) {
|
||||||
|
// 选课已结束,跳转到结束页面
|
||||||
|
const courseInfo = encodeURIComponent(JSON.stringify(xk));
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/base/course-selection/enrollment-ended?courseInfo=${courseInfo}`
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// 切换选课
|
// 切换选课
|
||||||
const switchXk = (xk: any) => {
|
const switchXk = (xk: any) => {
|
||||||
curXk.value = xk;
|
curXk.value = xk;
|
||||||
|
// 检查选课状态
|
||||||
|
if (checkEnrollmentStatus(xk)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换学生
|
// 切换学生
|
||||||
@ -59,7 +83,12 @@ const switchXs = (xs: any) => {
|
|||||||
|
|
||||||
// 选课时间结束
|
// 选课时间结束
|
||||||
const xkTimeOver = (val: any) => {
|
const xkTimeOver = (val: any) => {
|
||||||
console.log(val);
|
console.log('选课时间结束:', val);
|
||||||
|
// 跳转到选课结束页面
|
||||||
|
const courseInfo = encodeURIComponent(JSON.stringify(curXk.value));
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/base/course-selection/enrollment-ended?courseInfo=${courseInfo}`
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选中课程
|
// 选中课程
|
||||||
@ -77,6 +106,21 @@ const submit = async () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查选课时间
|
||||||
|
if (curXk.value && curXk.value.xkkstime) {
|
||||||
|
const now = dayjs().valueOf();
|
||||||
|
const startTime = dayjs(curXk.value.xkkstime).valueOf();
|
||||||
|
|
||||||
|
if (now < startTime) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "选课还未开始,请耐心等待!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "抢课中...",
|
title: "抢课中...",
|
||||||
});
|
});
|
||||||
@ -174,6 +218,27 @@ const submit = async () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
|
|
||||||
|
.bottom-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 15px;
|
||||||
|
|
||||||
|
// 学生选择器样式
|
||||||
|
:deep(.xs-bar) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 倒计时组件样式
|
||||||
|
:deep(.countdown-section) {
|
||||||
|
flex-shrink: 0;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,14 +25,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { ref } from "vue";
|
||||||
import { xkgzsApi } from "@/api/base/server";
|
import { xkgzsApi } from "@/api/base/server";
|
||||||
|
import { updateSignFileApi } from "@/api/system/login";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import { showLoading } from "@/utils/uniapp";
|
import { showLoading } from "@/utils/uniapp";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
import BasicSign from "@/components/BasicSign/Sign.vue";
|
||||||
|
|
||||||
const signCompRef = ref<any>(null);
|
const signCompRef = ref<any>(null);
|
||||||
const sign_file = ref<any>(null);
|
const sign_file = ref<any>(null);
|
||||||
const { setData, getGlobal } = useDataStore();
|
const { setData, getGlobal } = useDataStore();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const notice = ref("");
|
const notice = ref("");
|
||||||
onLoad(async () => {
|
onLoad(async () => {
|
||||||
@ -43,20 +48,46 @@ onLoad(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
// 显示加载中
|
try {
|
||||||
|
// 获取签名数据
|
||||||
const data = await signCompRef.value.getSyncSignature();
|
const data = await signCompRef.value.getSyncSignature();
|
||||||
sign_file.value = data.base64;
|
sign_file.value = data.base64;
|
||||||
|
|
||||||
|
// 获取当前用户信息
|
||||||
|
const userInfo = userStore.getUser;
|
||||||
|
|
||||||
|
// 检查localStorage userdata中是否已有signFile
|
||||||
|
const hasExistingSignFile = userInfo && userInfo.signFile;
|
||||||
|
|
||||||
|
// 更新localStorage userdata中的signFile
|
||||||
setData({
|
setData({
|
||||||
sign_file: sign_file.value,
|
sign_file: sign_file.value,
|
||||||
});
|
});
|
||||||
if (getGlobal.type == 1) {
|
|
||||||
|
// 如果localStorage userdata中没有signFile,则调用后端API更新u_user表
|
||||||
|
if (!hasExistingSignFile && userInfo && userInfo.userId) {
|
||||||
|
try {
|
||||||
|
await updateSignFileApi({
|
||||||
|
userId: userInfo.userId,
|
||||||
|
signFile: sign_file.value
|
||||||
|
});
|
||||||
|
console.log('签名数据已更新到后端数据库');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('更新后端签名数据失败:', error);
|
||||||
|
// 即使后端更新失败,也不影响前端流程继续
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到下一页
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/base/course-selection/index",
|
url: "/pages/base/course-selection/index",
|
||||||
});
|
});
|
||||||
}
|
|
||||||
if (getGlobal.type == 2) {
|
} catch (error) {
|
||||||
uni.reLaunch({
|
console.error('提交签名失败:', error);
|
||||||
url: "/pages/base/course-selection/club-selection",
|
uni.showToast({
|
||||||
|
title: '签名提交失败',
|
||||||
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
73
src/pages/base/course-selection/noticeclub.vue
Normal file
73
src/pages/base/course-selection/noticeclub.vue
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<view class="p-15">
|
||||||
|
<view class="white-bg-color p-15 r-md" v-if="notice">
|
||||||
|
<view> 各位家长:</view>
|
||||||
|
<view class="notice-text">
|
||||||
|
{{ notice }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<BasicSign ref="signCompRef" title="签名"></BasicSign>
|
||||||
|
</view>
|
||||||
|
<template #bottom>
|
||||||
|
<view class="white-bg-color py-5">
|
||||||
|
<view class="flex-row items-center pb-10 pt-5">
|
||||||
|
<u-button
|
||||||
|
text="下一步"
|
||||||
|
class="mx-15"
|
||||||
|
type="primary"
|
||||||
|
@click="submit"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { xkgzsApi } from "@/api/base/server";
|
||||||
|
import { useDataStore } from "@/store/modules/data";
|
||||||
|
import { showLoading } from "@/utils/uniapp";
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
|
const signCompRef = ref<any>(null);
|
||||||
|
const sign_file = ref<any>(null);
|
||||||
|
const { setData, getGlobal } = useDataStore();
|
||||||
|
|
||||||
|
const notice = ref("");
|
||||||
|
onLoad(async () => {
|
||||||
|
showLoading({ title: "加载中..." });
|
||||||
|
const res = await xkgzsApi({ kcLx: "俱乐部" });
|
||||||
|
notice.value = res.rows?.[0]?.content || "";
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function submit() {
|
||||||
|
// 显示加载中
|
||||||
|
const data = await signCompRef.value.getSyncSignature();
|
||||||
|
sign_file.value = data.base64;
|
||||||
|
setData({
|
||||||
|
sign_file: sign_file.value,
|
||||||
|
});
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/base/course-selection/club-selection",
|
||||||
|
});
|
||||||
|
/*if (getGlobal.type == 1) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/base/course-selection/index",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (getGlobal.type == 2) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/base/course-selection/club-selection",
|
||||||
|
});
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.notice-text {
|
||||||
|
margin-top: 10px;
|
||||||
|
text-indent: 2em; /* 添加两个中文字符的缩进 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -90,7 +90,7 @@ const { setData, getAppCode } = useDataStore();
|
|||||||
|
|
||||||
// 刷新相关变量
|
// 刷新相关变量
|
||||||
const { getLastRefreshTime, getRefreshInterval, setLastRefreshTime, updateStudentInfo, updateStudentList } = useUserStore();
|
const { getLastRefreshTime, getRefreshInterval, setLastRefreshTime, updateStudentInfo, updateStudentList } = useUserStore();
|
||||||
const REFRESH_INTERVAL = 10 * 60 * 1000; // 10分钟刷新一次(测试用)
|
const REFRESH_INTERVAL = 7 * 24 * 60 * 60 * 1000; // 1周刷新一次(7天)
|
||||||
|
|
||||||
// 获取当前changeTime
|
// 获取当前changeTime
|
||||||
const getCurrentChangeTime = () => {
|
const getCurrentChangeTime = () => {
|
||||||
@ -209,6 +209,18 @@ const menuItems = ref([
|
|||||||
path: "/pages/base/club/index",
|
path: "/pages/base/club/index",
|
||||||
permissionKey: "school-jlb", // 俱乐部权限编码
|
permissionKey: "school-jlb", // 俱乐部权限编码
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "兴趣课选课",
|
||||||
|
icon: "/static/base/home/file-text-line.png",
|
||||||
|
path: "/pages/base/course-selection/notice",
|
||||||
|
permissionKey: "school-xqkxk", // 兴趣课选课权限编码
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "俱乐部选课",
|
||||||
|
icon: "/static/base/home/contacts-book-3-line.png",
|
||||||
|
path: "/pages/base/course-selection/noticeclub",
|
||||||
|
permissionKey: "school-jlbxk", // 俱乐部选课权限编码
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 通知公告数据
|
// 通知公告数据
|
||||||
@ -328,8 +340,43 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查用户是否已关注服务号
|
||||||
|
await checkSubscribeStatus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 检查关注状态
|
||||||
|
const checkSubscribeStatus = async () => {
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUser;
|
||||||
|
|
||||||
|
if (userInfo && !userInfo.subscribed) {
|
||||||
|
// 延迟显示关注提醒,避免与启动页面冲突
|
||||||
|
setTimeout(() => {
|
||||||
|
showSubscribeReminder();
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 显示关注提醒
|
||||||
|
const showSubscribeReminder = () => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '关注服务号',
|
||||||
|
content: '请先关注我们的服务号,以便接收重要通知',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '稍后关注',
|
||||||
|
confirmText: '立即关注',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 跳转到关注页面
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/system/subscribe/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 页面显示时检查是否需要刷新
|
// 页面显示时检查是否需要刷新
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
await checkAndRefreshStudentInfo();
|
await checkAndRefreshStudentInfo();
|
||||||
|
|||||||
@ -54,6 +54,7 @@ onLoad(async (data: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 直接跳转到首页,关注检查在首页进行
|
||||||
toHome(data);
|
toHome(data);
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
|
|||||||
@ -265,7 +265,7 @@ function toHome() {
|
|||||||
});
|
});
|
||||||
} else if (getGlobal.type == 2) {
|
} else if (getGlobal.type == 2) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/base/course-selection/club-selection",
|
url: "/pages/base/course-selection/noticeclub",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
|
|||||||
194
src/pages/system/subscribe/index.vue
Normal file
194
src/pages/system/subscribe/index.vue
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
<template>
|
||||||
|
<view class="subscribe-page">
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<view class="content-container">
|
||||||
|
<!-- 二维码区域 -->
|
||||||
|
<view class="qr-section">
|
||||||
|
<view class="qr-container">
|
||||||
|
<image src="/static/base/home/rdcode.jpg" class="qr-code" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<text class="qr-tip">请长按二维码识别并关注我们的服务号</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 关注好处 -->
|
||||||
|
<view class="benefits-section">
|
||||||
|
<view class="section-title">
|
||||||
|
<text class="title-text">关注后可享受</text>
|
||||||
|
</view>
|
||||||
|
<view class="benefits-list">
|
||||||
|
<view class="benefit-item">
|
||||||
|
<view class="benefit-icon">
|
||||||
|
<uni-icons type="notification" size="20" color="#4A90E2"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="benefit-content">
|
||||||
|
<text class="benefit-title">重要通知</text>
|
||||||
|
<text class="benefit-desc">及时接收学校重要通知和公告</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="benefit-item">
|
||||||
|
<view class="benefit-icon">
|
||||||
|
<uni-icons type="calendar" size="20" color="#4A90E2"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="benefit-content">
|
||||||
|
<text class="benefit-title">课程安排</text>
|
||||||
|
<text class="benefit-desc">课程变更和安排调整实时推送</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="benefit-item">
|
||||||
|
<view class="benefit-icon">
|
||||||
|
<uni-icons type="star" size="20" color="#4A90E2"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="benefit-content">
|
||||||
|
<text class="benefit-title">成绩查询</text>
|
||||||
|
<text class="benefit-desc">考试成绩发布第一时间通知</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="benefit-item">
|
||||||
|
<view class="benefit-icon">
|
||||||
|
<uni-icons type="checkmarkempty" size="20" color="#4A90E2"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="benefit-content">
|
||||||
|
<text class="benefit-title">请假审批</text>
|
||||||
|
<text class="benefit-desc">请假申请审批结果及时反馈</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useDataStore } from '@/store/modules/data';
|
||||||
|
|
||||||
|
const { getGlobal } = useDataStore();
|
||||||
|
|
||||||
|
// 页面逻辑保持不变,但移除按钮相关的方法
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.subscribe-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #f4f5f7 0%, #e8f0ff 100%);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-container {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-section {
|
||||||
|
background: white;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 60rpx 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-container {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-code {
|
||||||
|
width: 400rpx;
|
||||||
|
height: 400rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
box-shadow: 0 12rpx 36rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-tip {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.5;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefits-section {
|
||||||
|
background: white;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-text {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
position: relative;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 8rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
|
||||||
|
border-radius: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefits-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefit-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefit-icon {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
|
||||||
|
border-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
box-shadow: 0 6rpx 16rpx rgba(74, 144, 226, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefit-content {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefit-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.benefit-desc {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
1
src/static/base/home/details.svg
Normal file
1
src/static/base/home/details.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1754283033015" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10483" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.812 929.397c-230.391 0-417.826-187.434-417.826-417.821 0-230.391 187.434-417.826 417.826-417.826 230.386 0 417.821 187.434 417.821 417.826 0 230.386-187.436 417.821-417.821 417.821zM511.812 137.482c-206.277 0-374.092 167.815-374.092 374.093 0 206.273 167.815 374.089 374.092 374.089 206.273 0 374.089-167.815 374.089-374.089 0-206.277-167.815-374.093-374.089-374.093z" p-id="10484" fill="#1296db"></path><path d="M589.938 510.195l-164.817 164.817 30.521 30.521 195.339-195.339-195.339-195.339-30.521 30.521z" p-id="10485" fill="#1296db"></path></svg>
|
||||||
|
After Width: | Height: | Size: 889 B |
BIN
src/static/base/home/rdcode.jpg
Normal file
BIN
src/static/base/home/rdcode.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
Loading…
x
Reference in New Issue
Block a user