Skip to content

Commit

Permalink
Merge(SuitApply):合并正装借用,修复部分 bug (#96)
Browse files Browse the repository at this point in the history
* perf(login):增加登录密码正则

* fix(suitApply):禁用了朝晖校区线上办理正装借用到功能

* perf(lessonstable):优化课表可以提前查看下学年的课程安排
  • Loading branch information
Tianci-King authored Aug 11, 2024
1 parent e3210b9 commit 8e91c0a
Show file tree
Hide file tree
Showing 21 changed files with 425 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export default {
"pages/exam/index",
"pages/score/index",
"pages/setting/index",
"pages/setting/logout/index",
"pages/setting/changePassword/index",
"pages/connect/index",
"pages/connect/faq/index",
"pages/lab/index",
Expand Down
2 changes: 1 addition & 1 deletion src/components/TermPicker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (props.selectflag >= 1)
let years: string[] = [];
for (let i = 0; i < 4; i++) years.push(`${year - i}/${year - i + 1}`);
for (let i = -1; i < 4; i++) years.push(`${year - i}/${year - i + 1}`);
selector.unshift(years);
/** Picker 依赖, 索引数组 */
Expand Down
15 changes: 10 additions & 5 deletions src/constants/copywriting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const labText = {
empty: "当前没有实验功能,尽情期待!😚"
};
export const settingText = {
empty: "当前没有可设置功能,尽情期待!😚"
empty: "更多设置功能,尽情期待!😚"
};
export const faqText = {
qa: [
Expand Down Expand Up @@ -58,8 +58,8 @@ export const helpText = {
scoreCard:
"若信息长时间无法更新或总是刷新失败,可能是因为更改过正方教务系统的密码,请前往我的-绑定-重新绑定正方账号。\n 成绩查询中的信息全部来自正方教务系统,数据录入可能会有延迟,请耐心等待。\n 如有疑问请联系教务处,本程序仅作信息展示。",
bind: {
zf: "1.正方教务系统是什么?\n正方教务系统是你的选课系统哦~\n那么密码就是你的选课密码~\n\n2.忘记密码?\n请找自己的辅导员重置密码。",
oauth: "1.统一验证系统是什么?\n统一验证系统是你的选课系统哦~\n那么密码就是你的统一验证密码~\n\n2.忘记密码?\n请找自己的辅导员重置密码。 \n\n 23级及以后的同学改用统一验证系统登录",
zf: "1.正方教务系统是什么?\n正方教务系统是你的选课系统哦~\n那么密码就是你的选课密码~\n\n2.忘记密码?\n请联系学院教务老师重置密码。",
oauth: "1.统一验证系统是什么?\n统一验证系统是你的选课系统哦~\n那么密码就是你的统一验证密码~\n\n2.忘记密码?\n请联系学院教务老师重置密码。 \n\n 23级及以后的同学改用统一验证系统登录",
library:
"新生图书馆绑定异常——新生需要在接受图书馆培训并通过入馆考试后,才能正常绑定图书馆账号",
yxy: "丨绑定此项以使用校园卡查询等功能\n丨请确保已下载过易校园 APP 且将手机号与学号、宿舍绑定\n丨若图形验证码加载失败,请过一段时间再来绑定"
Expand All @@ -78,6 +78,11 @@ export const helpText = {
main: "“正装借用”是由学生事务大厅与精弘网络合作共同开发的一项学生服务功能,您的参与是对我们工作的最大支持,让我们携手共同营造温暖、团结的校园氛围。",
help: "感谢您使用由学生事务大厅与精弘网络合作共同开发的“正装借用”,使用时如有疑问请点击您所在的校区,查看详情中“学生事务大厅”的联系方式咨询工作人员。",
information: "感谢您使用由学生事务大厅与精弘网络合作共同开发的“正装借用”,请在使用前正确填写您的真实个人信息,以便后续工作的开展。",
warn: "请您再次确认是否提交申请!另外,申请完成后,如果您所申请的正装的尺码目前标注“余量不足”,请您尽早前往学生事务大厅领取。\n “余量不足”的正装可能会被线下借用的同学优先借完,从而导致在“微精弘线上借用”已经申请过的同学无正装可借,微精弘对此概不负责!"
}
warn: "请您再次确认是否提交申请!提交申请后正装请到学生事务大厅领取,领取后将变为申请中状态(建议线下确认尺码后当场提交申请)\n “余量不足”的正装可能会被线下借用的同学优先借完,从而导致在“微精弘线上借用”已经申请过的同学无正装可借,微精弘对此概不负责!"
},
logout: {
main: "| 您的微精弘账号一旦被注销成功将无法再找回您添加、绑定的任何本账号内容或信息! 若您在注销后仍需要使用微精弘,请重新打开小程序按照“激活”的步骤创建微精弘账号,感谢您的配合!",
check: "注销操作将清除您的在微精弘激活的所有个人信息以及绑定数据,请您确认是否要注销账号?",
},
changePassword: "请确定您已经记住了新密码,以免忘记密码后无法再次登录,是否确认修改?",
};
10 changes: 5 additions & 5 deletions src/constants/updateInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ type UpdateInfoType = {
}

export const updateInfo: UpdateInfoType = {
version: "2.5.6",
version: "2.6.1",
title: "微精弘更新公告",
content: `微精弘小程序2.5.6更新 [失物招领] ,注册绑定一卡通以体验
content: `微精弘小程序2.6.1更新 [正装借用]
> 更新内容
1. 实验室上线切换主题色功能
2. 微精弘 x “For You”工程 联合上线失物招领
3. 校园资讯功能优化
1. 微精弘 x “学生事务大厅” 联合上线正装借用功能
2. 设置页面新增修改密码与注销功能
3. 优化绑定页面的交互体验
4. 修复了一些已知的bug
`,
actions: {
Expand Down
8 changes: 8 additions & 0 deletions src/pages/bind/Library/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ const helpContent = helpText.bind.library;
const isShowHelp = ref(false);
async function bindLibClick() {
const regex = /^[a-zA-Z0-9!@#$%^&*()_+-=,.<>?;:'"{}\[\]\\|`~]*$/;
if (!regex.test(libpass.value)) {
Taro.showToast({
title: "输入存在中文字符或其他非法字符,请重新输入!",
icon: "none"
});
return;
}
Taro.showLoading({
title: "正在绑定",
mask: true
Expand Down
8 changes: 8 additions & 0 deletions src/pages/bind/Oauth/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ const helpContent = helpText.bind.oauth;
const isShowHelp = ref(false);
async function bindOauthClick() {
const regex = /^[a-zA-Z0-9!@#$%^&*()_+-=,.<>?;:'"{}\[\]\\|`~]*$/;
if (!regex.test(oauthpass.value)) {
Taro.showToast({
title: "输入存在中文字符或其他非法字符,请重新输入!",
icon: "none"
});
return;
}
Taro.showLoading({
title: "正在绑定",
mask: true
Expand Down
10 changes: 9 additions & 1 deletion src/pages/bind/ZF/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ import { ref, computed } from "vue";
const zfpass = ref("");
const user = computed(() => serviceStore.user);
const helpContent = helpText.suit;
const helpContent = helpText.bind.zf;
const isShowHelp = ref(false);
async function bindZFClick() {
const regex = /^[a-zA-Z0-9!@#$%^&*()_+-=,.<>?;:'"{}\[\]\\|`~]*$/;
if (!regex.test(zfpass.value)) {
Taro.showToast({
title: "输入存在中文字符或其他非法字符,请重新输入!",
icon: "none"
});
return;
}
Taro.showLoading({
title: "正在绑定",
mask: true
Expand Down
1 change: 1 addition & 0 deletions src/pages/bind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</w-list-item>
</w-list>
</card>
<card v-if="bindTab === undefined" title="温馨提示">输入密码时请注意特殊字符的中英文编码</card>
<z-f v-if="bindTab === 'zf'" />
<library v-if="bindTab === 'library'" />
<y-x-y v-if="bindTab === 'yxy'" />
Expand Down
5 changes: 5 additions & 0 deletions src/pages/setting/changePassword/index.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
navigationBarTitleText: "修改密码",
backgroundColor: "#dfdfdf",
disableScroll: true
};
16 changes: 16 additions & 0 deletions src/pages/setting/changePassword/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import "@/style/theme";

.warn {
font-size: 0.875rem;
color: var(--wjh-color-week);
}

.input-card {

input {
border: 2Px solid var(--wjh-color-light);
padding: 0.3rem 0.5rem;
margin: 0.5rem 0;
border-radius: 0.2rem;
}
}
131 changes: 131 additions & 0 deletions src/pages/setting/changePassword/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<template>
<theme-config>
<title-bar title="修改密码" back-button />
<scroll-view :scrollY="true">
<view class="flex-column">
<card title="修改密码" class="input-card">
<text>身份证号码</text>
<view>
<input password placeholder="请输入您的身份证号码" v-model="iid" />
</view>
<text>学号</text>
<view>
<input password placeholder="请输入您的学号" v-model="stuid" />
</view>
<text>新密码</text>
<view>
<input password placeholder="请输入您的新密码" v-model="password" />
</view>
<text>确认新密码</text>
<view>
<input password placeholder="请重复输入您的新密码" v-model="passwordAgain" />
</view>
<template #footer>
<w-button block @tap="isShowConfirm = true"> 确认修改 </w-button>
</template>
</card>
</view>
<w-modal
v-model:show="isShowConfirm"
title="警告"
:content="`&emsp;&emsp;${helpText.changePassword}`"
:actions="{
cancel: {
label: '取消',
callback: onCancel
},
confirm: {
label: '确定',
callback: changePasswordClick
}
}"
></w-modal>
</scroll-view>
</theme-config>
</template>

<script setup lang="ts">
import {ref} from "vue";
import {Card, TitleBar, ThemeConfig, WList, WBadge, WListItem, WButton, WModal} from "@/components";
import "./index.scss";
import Taro from "@tarojs/taro";
import {UserService} from "@/services";
import {useRequest} from "@/hooks";
import {helpText} from "@/constants/copywriting";
const iid = ref("");
const stuid = ref("");
const password = ref("");
const passwordAgain = ref("");
const isShowConfirm = ref(false);
const changePasswordClick = ()=> {
isShowConfirm.value = false;
if(password.value !== passwordAgain.value) {
Taro.showToast({
icon: "none",
title: "两次密码不一致!"
});
return;
}
else if(password.value.length < 6 || password.value.length > 20) {
Taro.showToast({
icon: "none",
title: "密码长度必须在6~20位之间!"
});
return;
}
Taro.showLoading({
title: "正在修改中",
mask: true
});
run({
iid: iid.value,
stuid: stuid.value,
password: password.value
});
};
const { run } = useRequest(
UserService.changePassword, {
loadingDelay: 600,
onSuccess: (res) => {
if(res.data.code === 1 && res.data.msg === "OK") {
Taro.showToast({
icon: "success",
title: "修改密码成功"
});
}
else if(res.data.code === 200510) {
Taro.showToast({
icon: "none",
title: "该学号或身份证不存在或者不匹配,请重新输入!"
});
}
else if(res.data.code === 200511) {
Taro.showToast({
icon: "none",
title: "密码长度必须在6~20位之间!"
});
}
else if(res.data.code === 200513) {
Taro.showToast({
icon: "none",
title: "学号格式不正确,请重新输入!"
});
}
},
onError: (e:Error) =>{
return `失败\r\n${e.message || "网络错误"}`;
}
}
);
const onCancel = () => {
isShowConfirm.value = false;
};
const onConfirm = () => {
isShowConfirm.value = true;
};
</script>
1 change: 1 addition & 0 deletions src/pages/setting/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.empty {
padding: 1rem;
text-align: center;
}

.footer-text {
Expand Down
24 changes: 23 additions & 1 deletion src/pages/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
class="flex-column"
:style="isEmpty ? 'justify-content: space-between' : undefined"
>
<w-list @tap="nav2ChangePassword">
<w-list-item arrow="right">
<view>
<text>修改密码</text>
</view>
</w-list-item>
</w-list>
<w-list @tap="nav2Logout">
<w-list-item arrow="right">
<view>
<text>注销</text>
</view>
</w-list-item>
</w-list>
<card class="setting-card">
<view
v-if="isEmpty"
Expand All @@ -33,7 +47,8 @@
</template>

<script setup lang="ts">
import { Card, TitleBar, ThemeConfig } from "@/components";
import Taro from "@tarojs/taro";
import {Card, TitleBar, ThemeConfig, WList, WListItem} from "@/components";
import { settingText } from "@/constants/copywriting";
import { getCopyRight } from "@/utils";
import { ref, watch } from "vue";
Expand Down Expand Up @@ -61,4 +76,11 @@ const handleTabClick = (theme: string) => {
setThemeMode(theme);
};
const nav2ChangePassword = () => {
Taro.navigateTo({ url: "/pages/setting/changePassword/index" });
};
const nav2Logout = () => {
Taro.navigateTo({ url: "/pages/setting/logout/index" });
};
</script>
5 changes: 5 additions & 0 deletions src/pages/setting/logout/index.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
navigationBarTitleText: "注销",
backgroundColor: "#dfdfdf",
disableScroll: true
};
16 changes: 16 additions & 0 deletions src/pages/setting/logout/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import "@/style/theme";

.warn {
font-size: 0.875rem;
color: var(--wjh-color-week);
}

.input-card {

input {
border: 2Px solid var(--wjh-color-light);
padding: 0.3rem 0.5rem;
margin: 0.5rem 0;
border-radius: 0.2rem;
}
}
Loading

0 comments on commit 8e91c0a

Please sign in to comment.