Authored by Rickie

完善

@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 "path" : "pages/login/login", 18 "path" : "pages/login/login",
19 "style" : 19 "style" :
20 { 20 {
21 - "navigationBarTitleText" : "登录" 21 + "navigationBarTitleText" : "登录",
  22 + "navigationStyle": "custom"
22 } 23 }
23 }, 24 },
24 { 25 {
@@ -7,13 +7,16 @@ @@ -7,13 +7,16 @@
7 </uv-form-item> 7 </uv-form-item>
8 <uv-form-item prop="sex"> 8 <uv-form-item prop="sex">
9 <view style="display: flex;justify-content: space-around;width: 100%;"> 9 <view style="display: flex;justify-content: space-around;width: 100%;">
10 - <view @click="state.studentInfo.sex = 0" class="select-item" :style="state.studentInfo.sex === 0 ? 'border-color:#6b75f6;' : ''"> 10 + <view @click="state.studentInfo.sex = 0" class="select-item"
  11 + :style="state.studentInfo.sex === 0 ? 'border-color:#6b75f6;' : ''">
11 <uv-icon name="man" color="#7175f0" size="16" style="margin-right: 10rpx;"></uv-icon>男 12 <uv-icon name="man" color="#7175f0" size="16" style="margin-right: 10rpx;"></uv-icon>男
12 </view> 13 </view>
13 - <view @click="state.studentInfo.sex = 1" class="select-item" :style="state.studentInfo.sex === 1 ? 'border-color:#6b75f6;' : ''"> 14 + <view @click="state.studentInfo.sex = 1" class="select-item"
  15 + :style="state.studentInfo.sex === 1 ? 'border-color:#6b75f6;' : ''">
14 <uv-icon name="woman" color="#ff5d5c" size="16" style="margin-right: 10rpx;"></uv-icon>女 16 <uv-icon name="woman" color="#ff5d5c" size="16" style="margin-right: 10rpx;"></uv-icon>女
15 </view> 17 </view>
16 - <view @click="state.studentInfo.sex = 2" class="select-item" :style="state.studentInfo.sex === 2 ? 'border-color:#6b75f6;' : ''"> 18 + <view @click="state.studentInfo.sex = 2" class="select-item"
  19 + :style="state.studentInfo.sex === 2 ? 'border-color:#6b75f6;' : ''">
17 <uv-icon name="lock" color="#7175f0" size="16" style="margin-right: 10rpx;"></uv-icon>保密 20 <uv-icon name="lock" color="#7175f0" size="16" style="margin-right: 10rpx;"></uv-icon>保密
18 </view> 21 </view>
19 </view> 22 </view>
@@ -24,8 +27,13 @@ @@ -24,8 +27,13 @@
24 <uv-form-item prop="school"> 27 <uv-form-item prop="school">
25 <uv-input v-model="state.studentInfo.school" shape="circle" placeholder="请输入学生在读学校" /> 28 <uv-input v-model="state.studentInfo.school" shape="circle" placeholder="请输入学生在读学校" />
26 </uv-form-item> 29 </uv-form-item>
27 - <uv-form-item prop="grade">  
28 - <uv-input v-model="state.studentInfo.grade" shape="circle" placeholder="请输入学生在读年级" /> 30 + <uv-form-item prop="grade" @click="showSelect">
  31 + <uv-input v-model="state.studentInfo.grade" disabled disabledColor="#ffffff" shape="circle"
  32 + placeholder="请选择学生在读年级">
  33 + <template v-slot:suffix>
  34 + <uv-icon name="arrow-down" color="#6b75f6" size="14"></uv-icon>
  35 + </template>
  36 + </uv-input>
29 </uv-form-item> 37 </uv-form-item>
30 <uv-form-item> 38 <uv-form-item>
31 <view @click="submit" 39 <view @click="submit"
@@ -34,6 +42,8 @@ @@ -34,6 +42,8 @@
34 </view> 42 </view>
35 </uv-form-item> 43 </uv-form-item>
36 </uv-form> 44 </uv-form>
  45 +
  46 + <uv-picker ref="pickerRef" :columns="state.columns" @confirm="confirm"></uv-picker>
37 </view> 47 </view>
38 </template> 48 </template>
39 49
@@ -42,9 +52,12 @@ @@ -42,9 +52,12 @@
42 reactive, 52 reactive,
43 ref 53 ref
44 } from "vue" 54 } from "vue"
45 - import { addStudentsApi } from "@/api/index.js" 55 + import {
  56 + addStudentsApi
  57 + } from "@/api/index.js"
46 58
47 const formRef = ref(null) 59 const formRef = ref(null)
  60 + const pickerRef = ref(null)
48 61
49 const state = reactive({ 62 const state = reactive({
50 studentInfo: { 63 studentInfo: {
@@ -54,6 +67,9 @@ @@ -54,6 +67,9 @@
54 school: "", 67 school: "",
55 grade: "" 68 grade: ""
56 }, 69 },
  70 + columns: [
  71 + ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级", "初一", "初二", "初三", "高一", "高二", "高三"]
  72 + ],
57 rules: { 73 rules: {
58 'name': { 74 'name': {
59 type: 'string', 75 type: 'string',
@@ -82,12 +98,20 @@ @@ -82,12 +98,20 @@
82 'grade': { 98 'grade': {
83 type: 'string', 99 type: 'string',
84 required: true, 100 required: true,
85 - message: '请输入学生在读年级', 101 + message: '请选择学生在读年级',
86 trigger: ['blur', 'change'] 102 trigger: ['blur', 'change']
87 }, 103 },
88 } 104 }
89 }) 105 })
90 106
  107 + const showSelect = () => {
  108 + pickerRef.value.open()
  109 + }
  110 +
  111 + const confirm = e => {
  112 + state.studentInfo.grade = e.value[0]
  113 + }
  114 +
91 const submit = async () => { 115 const submit = async () => {
92 try { 116 try {
93 await formRef.value.validate() 117 await formRef.value.validate()
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3  <uv-navbar leftIcon="" placeholder bgColor="rgba(255, 255, 255, 0)"> 3  <uv-navbar leftIcon="" placeholder bgColor="rgba(255, 255, 255, 0)">
4 <template v-slot:left> 4 <template v-slot:left>
5 <view class="uv-nav-slot"> 5 <view class="uv-nav-slot">
6 - XXXX  
7 </view> 6 </view>
8 </template> 7 </template>
9 </uv-navbar> 8 </uv-navbar>
@@ -15,7 +14,8 @@ @@ -15,7 +14,8 @@
15 style="margin-left: 6rpx;"></uv-icon> 14 style="margin-left: 6rpx;"></uv-icon>
16 </view> 15 </view>
17 <view @click="showAccountsPop" class="select-item"> 16 <view @click="showAccountsPop" class="select-item">
18 - {{ state.accounts }}<uv-icon name="arrow-down-fill" color="#7175f0" size="20" style="margin-left: 6rpx;"></uv-icon> 17 + {{ state.accounts }}<uv-icon name="arrow-down-fill" color="#7175f0" size="20"
  18 + style="margin-left: 6rpx;"></uv-icon>
19 </view> 19 </view>
20 </view> 20 </view>
21 21
@@ -23,12 +23,14 @@ @@ -23,12 +23,14 @@
23 <view v-for="item in state.courses" class="course-box"> 23 <view v-for="item in state.courses" class="course-box">
24 <image :src="item.img" style="width: 160rpx;height: 160rpx;border-radius: 20rpx;"></image> 24 <image :src="item.img" style="width: 160rpx;height: 160rpx;border-radius: 20rpx;"></image>
25 <view style="flex: 1;display: flex;"> 25 <view style="flex: 1;display: flex;">
26 - <view style="flex: 1;padding: 0 20rpx;display: flex;flex-direction: column;justify-content: space-between;"> 26 + <view
  27 + style="flex: 1;padding: 0 20rpx;display: flex;flex-direction: column;justify-content: space-between;">
27 <view style="font-size: 30rpx;">{{ item.name }} - {{ item.subject }}</view> 28 <view style="font-size: 30rpx;">{{ item.name }} - {{ item.subject }}</view>
28 <view style="color: #ff3838;font-weight: 600;">¥{{ item.price }}</view> 29 <view style="color: #ff3838;font-weight: 600;">¥{{ item.price }}</view>
29 </view> 30 </view>
30 <view style="width: 160rpx;display: flex;align-items: center;justify-content: flex-end;"> 31 <view style="width: 160rpx;display: flex;align-items: center;justify-content: flex-end;">
31 - <view @click="gotoSignUp(item.id)" style="width: 100%;;background-color: #f57c28;color: #fff;text-align: center;padding: 10rpx 0;border-radius: 9999rpx;"> 32 + <view @click="gotoSignUp(item.id)"
  33 + style="width: 100%;;background-color: #f57c28;color: #fff;text-align: center;padding: 10rpx 0;border-radius: 9999rpx;">
32 去报名 34 去报名
33 </view> 35 </view>
34 </view> 36 </view>
@@ -41,7 +43,8 @@ @@ -41,7 +43,8 @@
41 <uv-popup ref="gradesRef" safeAreaInsetBottom closeable :round="20"> 43 <uv-popup ref="gradesRef" safeAreaInsetBottom closeable :round="20">
42 <view class="pop-box"> 44 <view class="pop-box">
43 <view class="content-pop"> 45 <view class="content-pop">
44 - <view @click="selectGrade('全部年级')" class="pop-inner-item" style="margin: 20rpx 0;" :style="state.grade === '全部年级' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"> 46 + <view @click="selectGrade('全部年级')" class="pop-inner-item" style="margin: 20rpx 0;"
  47 + :style="state.grade === '全部年级' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
45 全部年级 48 全部年级
46 </view> 49 </view>
47 <view v-for="item in state.gradOptions" style="margin-bottom: 30rpx;"> 50 <view v-for="item in state.gradOptions" style="margin-bottom: 30rpx;">
@@ -63,11 +66,13 @@ @@ -63,11 +66,13 @@
63 <uv-popup ref="accountsRef" safeAreaInsetBottom closeable :round="20"> 66 <uv-popup ref="accountsRef" safeAreaInsetBottom closeable :round="20">
64 <view class="pop-box"> 67 <view class="pop-box">
65 <view class="content-pop"> 68 <view class="content-pop">
66 - <view @click="selectaccounts('全部科目')" class="pop-inner-item" style="margin: 20rpx 0;" :style="state.accounts === '全部科目' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"> 69 + <view @click="selectaccounts('全部科目')" class="pop-inner-item" style="margin: 20rpx 0;"
  70 + :style="state.accounts === '全部科目' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
67 全部科目 71 全部科目
68 </view> 72 </view>
69 <view class="pop-inner"> 73 <view class="pop-inner">
70 - <view v-for="item1 in state.accountsOptions" @click="selectaccounts(item1)" class="pop-inner-item" 74 + <view v-for="item1 in state.accountsOptions" @click="selectaccounts(item1)"
  75 + class="pop-inner-item"
71 :style="state.accounts === item1 ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"> 76 :style="state.accounts === item1 ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
72 {{ item1 }} 77 {{ item1 }}
73 </view> 78 </view>
@@ -81,10 +86,14 @@ @@ -81,10 +86,14 @@
81 <script setup> 86 <script setup>
82 import { 87 import {
83 reactive, 88 reactive,
84 - ref,  
85 - onMounted 89 + ref
86 } from 'vue'; 90 } from 'vue';
87 - import { courseListApi } from "@/api/index.js" 91 + import {
  92 + onShow
  93 + } from '@dcloudio/uni-app'
  94 + import {
  95 + courseListApi
  96 + } from "@/api/index.js"
88 97
89 const gradesRef = ref(null) 98 const gradesRef = ref(null)
90 const accountsRef = ref(null) 99 const accountsRef = ref(null)
@@ -110,7 +119,7 @@ @@ -110,7 +119,7 @@
110 accountsOptions: ["语文", "数学", "英语", "物理", "化学"] 119 accountsOptions: ["语文", "数学", "英语", "物理", "化学"]
111 }) 120 })
112 121
113 - onMounted(() => { 122 + onShow(() => {
114 getCourseList() 123 getCourseList()
115 }) 124 })
116 125
@@ -122,8 +131,12 @@ @@ -122,8 +131,12 @@
122 131
123 const getCourseList = async () => { 132 const getCourseList = async () => {
124 try { 133 try {
125 - uni.showLoading({ title: "加载中" })  
126 - const { data } = await courseListApi({ 134 + uni.showLoading({
  135 + title: "加载中"
  136 + })
  137 + const {
  138 + data
  139 + } = await courseListApi({
127 grade: state.grade === "全部年级" ? "" : state.grade, 140 grade: state.grade === "全部年级" ? "" : state.grade,
128 subject: state.accounts === "全部科目" ? "" : state.accounts 141 subject: state.accounts === "全部科目" ? "" : state.accounts
129 }) 142 })
@@ -173,6 +186,7 @@ @@ -173,6 +186,7 @@
173 .course-list { 186 .course-list {
174 margin-top: 20rpx; 187 margin-top: 20rpx;
175 flex: 1; 188 flex: 1;
  189 +
176 .course-box { 190 .course-box {
177 display: flex; 191 display: flex;
178 justify-content: space-between; 192 justify-content: space-between;
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
  3 + <uv-navbar leftIcon="" placeholder bgColor="rgba(255, 255, 255, 0)">
  4 + <template v-slot:center>
  5 + <view class="uv-nav-slot">
  6 + 登录
  7 + </view>
  8 + </template>
  9 + </uv-navbar>
3 <view class="input-box"> 10 <view class="input-box">
4 <uv-form labelPosition="left" :model="state.userInfo" :rules="state.rules" labelWidth="60" ref="formRef" 11 <uv-form labelPosition="left" :model="state.userInfo" :rules="state.rules" labelWidth="60" ref="formRef"
5 :labelStyle="{ fontSize: '28rpx' }"> 12 :labelStyle="{ fontSize: '28rpx' }">
6 <view style="margin-bottom: 60rpx;"> 13 <view style="margin-bottom: 60rpx;">
7 - 欢迎登录XXXXXXXX! 14 + 欢迎登录中科九章选课系统
8 </view> 15 </view>
9 <uv-form-item label="姓名" prop="name" borderBottom> 16 <uv-form-item label="姓名" prop="name" borderBottom>
10 <uv-input v-model="state.userInfo.name" placeholder="请输入姓名" border="none"> 17 <uv-input v-model="state.userInfo.name" placeholder="请输入姓名" border="none">
@@ -24,7 +31,8 @@ @@ -24,7 +31,8 @@
24 <script setup> 31 <script setup>
25 import { 32 import {
26 reactive, 33 reactive,
27 - ref 34 + ref,
  35 + onMounted
28 } from 'vue'; 36 } from 'vue';
29 import { 37 import {
30 loginApi 38 loginApi
@@ -60,6 +68,13 @@ @@ -60,6 +68,13 @@
60 } 68 }
61 }) 69 })
62 70
  71 + onMounted(() => {
  72 + const token = uni.getStorageSync("token")
  73 + if (token) uni.switchTab({
  74 + url: "/pages/index/index"
  75 + })
  76 + })
  77 +
63 const loginHandler = async () => { 78 const loginHandler = async () => {
64 try { 79 try {
65 await formRef.value.validate() 80 await formRef.value.validate()
@@ -78,7 +93,10 @@ @@ -78,7 +93,10 @@
78 title: '登录成功' 93 title: '登录成功'
79 }) 94 })
80 uni.setStorageSync('token', token) 95 uni.setStorageSync('token', token)
81 - uni.navigateBack() 96 + // uni.navigateBack()
  97 + uni.switchTab({
  98 + url: "/pages/index/index"
  99 + })
82 } finally { 100 } finally {
83 uni.hideLoading() 101 uni.hideLoading()
84 } 102 }
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 {{ state.userInfo?.nickName || "未知" }} 12 {{ state.userInfo?.nickName || "未知" }}
13 </view> 13 </view>
14 <view class=""> 14 <view class="">
15 - {{ state.userInfo?.phonenumber ? state.userInfo?.phonenumber.slice(0, 8) + '****' : "" }} 15 + {{ state.userInfo?.phonenumber ? `${state.userInfo?.phonenumber.slice(0, 3)}****${state.userInfo?.phonenumber.slice(7, 11)}` : "" }}
16 </view> 16 </view>
17 </view> 17 </view>
18 </view> 18 </view>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <view class=""> 22 <view class="">
23 我的孩子 23 我的孩子
24 </view> 24 </view>
25 - <view style="display: flex;justify-content: space-between;align-items: center;color: #7175f0;"> 25 + <view @click="gotoAdd" style="display: flex;justify-content: space-between;align-items: center;color: #7175f0;">
26 添加<uv-icon name="arrow-right" color="#7175f0" size="14"></uv-icon> 26 添加<uv-icon name="arrow-right" color="#7175f0" size="14"></uv-icon>
27 </view> 27 </view>
28 </view> 28 </view>
@@ -48,16 +48,16 @@ @@ -48,16 +48,16 @@
48 我的报名 48 我的报名
49 </view> 49 </view>
50 <template v-if="state.signupList.length"> 50 <template v-if="state.signupList.length">
51 - <view v-for="item in state.signupList" style="display: flex;justify-content: space-between;border-radius: 20rpx;border: 2rpx solid #bdceff;padding: 10rpx;"> 51 + <view v-for="item in state.signupList" style="display: flex;justify-content: space-between;border-radius: 20rpx;border: 2rpx solid #bdceff;padding: 10rpx;margin-bottom: 20rpx;">
52 <view style="background-color: #b8cfff;border-radius: 16rpx;flex-shrink: 0;width: 100rpx;height: 100rpx;"> 52 <view style="background-color: #b8cfff;border-radius: 16rpx;flex-shrink: 0;width: 100rpx;height: 100rpx;">
53 - <image v-if="item.avatar" :src="item.avatar" style="width: 100%;height: 100%;"></image> 53 + <image v-if="item.courseImg" :src="item.courseImg" style="width: 100%;height: 100%;"></image>
54 </view> 54 </view>
55 <view style="flex: 1;display: flex;flex-direction: column;justify-content: space-between;margin-left: 20rpx;"> 55 <view style="flex: 1;display: flex;flex-direction: column;justify-content: space-between;margin-left: 20rpx;">
56 <view class=""> 56 <view class="">
57 - 华地校区-四年级-数学-A+班 57 + {{ `${item.schoolName}-${item.courseName}-${item.className}` }}
58 </view> 58 </view>
59 <view class=""> 59 <view class="">
60 - 10-01至10-31 19:00-21:00 60 + {{ item.courseDate }} {{ item.courseTime }}
61 </view> 61 </view>
62 </view> 62 </view>
63 </view> 63 </view>
@@ -72,9 +72,11 @@ @@ -72,9 +72,11 @@
72 72
73 <script setup> 73 <script setup>
74 import { 74 import {
75 - reactive,  
76 - onMounted 75 + reactive
77 } from 'vue'; 76 } from 'vue';
  77 + import {
  78 + onShow
  79 + } from '@dcloudio/uni-app'
78 import { userInfoApi, myStudentsApi, userSignUpListApi } from "@/api/index.js" 80 import { userInfoApi, myStudentsApi, userSignUpListApi } from "@/api/index.js"
79 81
80 const state = reactive({ 82 const state = reactive({
@@ -83,7 +85,7 @@ @@ -83,7 +85,7 @@
83 students: [] 85 students: []
84 }) 86 })
85 87
86 - onMounted(() => { 88 + onShow(() => {
87 getUserInfo() 89 getUserInfo()
88 getMyStudents() 90 getMyStudents()
89 getuserSignUpList() 91 getuserSignUpList()
@@ -101,9 +103,14 @@ @@ -101,9 +103,14 @@
101 103
102 const getuserSignUpList = async () => { 104 const getuserSignUpList = async () => {
103 const { data } = await userSignUpListApi() 105 const { data } = await userSignUpListApi()
104 - console.log(data)  
105 state.signupList = data.signupList 106 state.signupList = data.signupList
106 } 107 }
  108 +
  109 + const gotoAdd = () => {
  110 + uni.navigateTo({
  111 + url:"/pages/addStudent/addStudent"
  112 + })
  113 + }
107 </script> 114 </script>
108 115
109 <style lang="scss" scoped> 116 <style lang="scss" scoped>
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 选择校区 23 选择校区
24 </view> 24 </view>
25 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;"> 25 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;">
26 - <view v-for="item in state.selectData.schoolArr" @click="select1(item)" 26 + <view v-for="item in state?.selectData?.schoolArr" @click="select1(item)"
27 :style="state.schoolName === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''" 27 :style="state.schoolName === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"
28 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'"> 28 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'">
29 {{ item.text }} 29 {{ item.text }}
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 选择班型 36 选择班型
37 </view> 37 </view>
38 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;"> 38 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;">
39 - <view v-for="item in state.selectData.classArr" @click="select2(item)" 39 + <view v-for="item in state?.selectData?.classArr" @click="select2(item)"
40 :style="state.className === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''" 40 :style="state.className === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"
41 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'"> 41 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'">
42 {{ item.text }} 42 {{ item.text }}
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 选择老师 49 选择老师
50 </view> 50 </view>
51 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;"> 51 <view style="display: grid;grid-template-columns: repeat(3, 1fr);gap: 20rpx;">
52 - <view v-for="item in state.selectData.teacherArr" @click="select3(item)" 52 + <view v-for="item in state?.selectData?.teacherArr" @click="select3(item)"
53 :style="state.teacherName === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''" 53 :style="state.teacherName === item.text ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''"
54 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'"> 54 :class="item.status === '可选' ? 'select-item' : 'select-item no-select'">
55 {{ item.text }} 55 {{ item.text }}
@@ -74,12 +74,12 @@ @@ -74,12 +74,12 @@
74 </view> 74 </view>
75 </view> 75 </view>
76 <!-- 行 --> 76 <!-- 行 -->
77 - <view v-for="item in state.selectData?.tableData?.y" class="body-row"> 77 + <view v-for="item in state?.selectData?.tableData?.y" class="body-row">
78 <!-- 列 --> 78 <!-- 列 -->
79 <view class="cell"> 79 <view class="cell">
80 {{ item }} 80 {{ item }}
81 </view> 81 </view>
82 - <view v-for="item1 in state.selectData?.tableData?.x" @click="selectTable(item, item1)" 82 + <view v-for="item1 in state?.selectData?.tableData?.x" @click="selectTable(item, item1)"
83 :class="(!!state.courseDate && !!state.courseTime && state.courseDate === item1 && state.courseTime === item) ? 'cell select-one' : 'cell'"> 83 :class="(!!state.courseDate && !!state.courseTime && state.courseDate === item1 && state.courseTime === item) ? 'cell select-one' : 'cell'">
84 {{ filterCell(item, item1) }} 84 {{ filterCell(item, item1) }}
85 </view> 85 </view>
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 </view> 107 </view>
108 <view @click="addStudents" class="pop-inner-item" 108 <view @click="addStudents" class="pop-inner-item"
109 style="display: flex;align-items: center;justify-content: center;"> 109 style="display: flex;align-items: center;justify-content: center;">
110 - <uv-icon name="plus" size="14" style="margin-right: 10rpx;"></uv-icon> 新增学员 110 + <uv-icon name="plus" size="14" style="margin-right: 10rpx;"></uv-icon> 添加孩子
111 </view> 111 </view>
112 </view> 112 </view>
113 </view> 113 </view>
@@ -117,7 +117,6 @@ @@ -117,7 +117,6 @@
117 117
118 <script setup> 118 <script setup>
119 import { 119 import {
120 - onMounted,  
121 reactive, 120 reactive,
122 ref 121 ref
123 } from "vue" 122 } from "vue"
@@ -127,7 +126,7 @@ @@ -127,7 +126,7 @@
127 signUpApi 126 signUpApi
128 } from "@/api/index.js" 127 } from "@/api/index.js"
129 import { 128 import {
130 - onLoad 129 + onLoad, onShow
131 } from '@dcloudio/uni-app' 130 } from '@dcloudio/uni-app'
132 131
133 const studentsRef = ref(null) 132 const studentsRef = ref(null)
@@ -153,7 +152,7 @@ @@ -153,7 +152,7 @@
153 state.courseId = option?.id || null 152 state.courseId = option?.id || null
154 }) 153 })
155 154
156 - onMounted(async () => { 155 + onShow(async () => {
157 await getMyStudents() 156 await getMyStudents()
158 getSelectCourseData() 157 getSelectCourseData()
159 }) 158 })
@@ -190,10 +189,13 @@ @@ -190,10 +189,13 @@
190 courseDate: state.courseDate, 189 courseDate: state.courseDate,
191 courseTime: state.courseTime 190 courseTime: state.courseTime
192 }) 191 })
  192 + setTimeout(() => {
193 uni.showToast({ 193 uni.showToast({
194 icon: 'success', 194 icon: 'success',
195 - title: '报名成功' 195 + title: '报名成功',
  196 + duration: 3000
196 }) 197 })
  198 + }, 300)
197 resetSelect() 199 resetSelect()
198 } finally { 200 } finally {
199 uni.hideLoading(); 201 uni.hideLoading();
@@ -240,9 +242,10 @@ @@ -240,9 +242,10 @@
240 if (state.courseTime === item && state.courseDate === item1) { 242 if (state.courseTime === item && state.courseDate === item1) {
241 state.courseTime = "" 243 state.courseTime = ""
242 state.courseDate = "" 244 state.courseDate = ""
  245 + getSelectCourseData()
243 return 246 return
244 } 247 }
245 - const arr = state.selectData?.tableData?.selectable.filter(v => (v.x === item && v.y === item1 && v.status === 248 + const arr = state.selectData?.tableData?.selectable.filter(v => (v.x === item1 && v.y === item && v.status ===
246 "可选")) 249 "可选"))
247 if (!arr.length) return false 250 if (!arr.length) return false
248 state.courseTime = item 251 state.courseTime = item
@@ -251,9 +254,9 @@ @@ -251,9 +254,9 @@
251 } 254 }
252 255
253 const filterCell = (item, item1) => { 256 const filterCell = (item, item1) => {
254 - const arr = state.selectData?.tableData?.selectable.filter(v => (v.x === item && v.y === item1 && v.status === 257 + const arr = state.selectData?.tableData?.selectable.filter(v => (v.x === item1 && v.y === item && v.status ===
255 "可选")) 258 "可选"))
256 - if (arr.length) return "可" 259 + if (arr.length) return "可报名"
257 return "" 260 return ""
258 } 261 }
259 262
@@ -20,6 +20,7 @@ export const request = (options) => { @@ -20,6 +20,7 @@ export const request = (options) => {
20 }, 20 },
21 success: (res) => { 21 success: (res) => {
22 if (res?.data.code === 401) { 22 if (res?.data.code === 401) {
  23 + uni.setStorageSync('token', "")
23 uni.showToast({ 24 uni.showToast({
24 title: '登录过期', 25 title: '登录过期',
25 icon: 'none' 26 icon: 'none'