基本完成
This commit is contained in:
parent
d49225746c
commit
229b607cc7
|
@ -2,7 +2,7 @@
|
|||
"name": "vue-h5-template",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev": "vite --port 9999",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
|
||||
|
|
14
src/App.vue
14
src/App.vue
|
@ -10,4 +10,18 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
}
|
||||
/* 确保弹窗在最上层 */
|
||||
.van-overlay {
|
||||
z-index: 2000 !important;
|
||||
}
|
||||
|
||||
.van-dialog {
|
||||
z-index: 2001 !important;
|
||||
}
|
||||
|
||||
/* 修复可能被隐藏的问题 */
|
||||
.van-toast,
|
||||
.van-notify {
|
||||
z-index: 2002 !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -56,6 +56,16 @@ export async function getGroupName(groupId) {
|
|||
return response;
|
||||
}
|
||||
|
||||
// 根据dormitoryId获取分组名
|
||||
export async function getDormitoryName(dormitoryId) {
|
||||
const response = await http.get('/h5/cees/ceesWaiTeacher/getDormitoryName', {
|
||||
params: {
|
||||
dormitoryId: dormitoryId,
|
||||
},
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
// 本校老师保存数据
|
||||
export function localTeacherSave(data) {
|
||||
return http.post('/h5/cees/ceesLocalTeacher/save', {
|
||||
|
@ -69,6 +79,12 @@ export function localTeacherSave(data) {
|
|||
|
||||
// 外校老师保存数据
|
||||
export function waiTeacherSave(data) {
|
||||
if (data.sex == '男') {
|
||||
data.sex = 0;
|
||||
}
|
||||
if (data.sex == '女') {
|
||||
data.sex = 1;
|
||||
}
|
||||
return http.post('/h5/cees/ceesWaiTeacher/save', {
|
||||
age: data.age,
|
||||
bankAddress: data.bankAddress,
|
||||
|
|
|
@ -3,7 +3,7 @@ import { showToast } from 'vant';
|
|||
|
||||
// 创建 axios 实例
|
||||
const service: AxiosInstance = axios.create({
|
||||
baseURL: 'http://localhost:8091/jeecg-boot', // 基础 URL
|
||||
baseURL: 'http://127.0.0.1:10001/jeecg-boot', // 基础 URL
|
||||
withCredentials: false, // 是否携带跨域凭证
|
||||
timeout: 10000, // 请求超时时间
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { showNotify, showToast, showConfirmDialog } from 'vant';
|
||||
import { showNotify, showConfirmDialog } from 'vant';
|
||||
import { getMajor, checkUser } from '@/api';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
|
@ -78,20 +78,28 @@
|
|||
|
||||
// 验证身份码长度
|
||||
const code = inputCode.value.toString();
|
||||
if (code && code.length !== 8) {
|
||||
showToast({
|
||||
message: '请输入8位的身份码',
|
||||
position: 'top',
|
||||
// 验证顺序:先检查空值,再检查长度
|
||||
if (!code) {
|
||||
showConfirmDialog({
|
||||
allowHtml: true,
|
||||
confirmButtonColor: '#8D2328',
|
||||
message: '身份码不能为空',
|
||||
});
|
||||
showNotify({ message: '请输入8位的身份码' });
|
||||
//showNotify({ type: 'danger', message: '身份码不能为空' });
|
||||
//showFailToast('身份码不能为空');
|
||||
loading.value = false;
|
||||
show.value = false;
|
||||
return;
|
||||
}
|
||||
if (code.length == 0) {
|
||||
showNotify({ message: '身份码不能为空' });
|
||||
|
||||
if (code.length !== 8) {
|
||||
showConfirmDialog({
|
||||
title: '请输入8位身份码',
|
||||
allowHtml: true,
|
||||
confirmButtonColor: '#8D2328',
|
||||
});
|
||||
//showNotify({ type: 'danger', message: '请输入8位身份码' });
|
||||
//showToast({ type: 'fail', message: '身份码不能为空' });
|
||||
loading.value = false;
|
||||
show.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -140,7 +148,7 @@
|
|||
}
|
||||
// 未填写信息
|
||||
if (res.result.status == '1') {
|
||||
showNotify({ type: 'success', message: '登录成功' });
|
||||
//showNotify({ type: 'success', message: '登录成功' });
|
||||
loading.value = false;
|
||||
show.value = false;
|
||||
store.login(res.result);
|
||||
|
|
|
@ -86,11 +86,12 @@
|
|||
const onSubmit = (values: object) => {
|
||||
console.log('submit', values);
|
||||
save(student).then((res) => {
|
||||
if (res.result.code == 500) {
|
||||
console.log(res);
|
||||
if (res.code == 500) {
|
||||
alert(res.result.msg);
|
||||
return;
|
||||
}
|
||||
if (res.result.code == 200) {
|
||||
if (res.code == 200) {
|
||||
alert('提交成功');
|
||||
store.login(res.result.user);
|
||||
router.push(res.result.router);
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
|
||||
<van-col span="6" v-if="showIcon.show2">
|
||||
<img @click="show2 = true" src="@/assets/imgs/txz.svg" alt="" />
|
||||
<div class="txz-img" v-if="show2">
|
||||
<div class="txz-img2" v-if="show2">
|
||||
<span @click="show2 = false"> 关闭 ✕ </span>
|
||||
<!-- <div class="card-pai">黑A·35648</div>-->
|
||||
<div class="card-pai">{{ carNum() }}</div>
|
||||
|
@ -244,7 +244,7 @@
|
|||
<p>所属分组</p>
|
||||
</van-col>
|
||||
<van-col span="6" v-if="showIcon.show4">
|
||||
<img @click="show4 = true" src="@/assets/imgs/sushi.svg" alt="" />
|
||||
<img @click="showDormitory" src="@/assets/imgs/sushi.svg" alt="" />
|
||||
<van-dialog
|
||||
:overlayStyle="{ background: 'rgba(0, 0, 0, 0.8)' }"
|
||||
:show-confirm-button="false"
|
||||
|
@ -254,8 +254,8 @@
|
|||
<span class="dialog-close-content" @click="show4 = false">×</span>
|
||||
<div class="grop-by">
|
||||
宿舍分配
|
||||
<p v-if="!store.LoginUser.dormitory">暂时未分配</p>
|
||||
<p v-else>{{ store.LoginUser.dormitory }}</p>
|
||||
<p v-if="!dormitory">暂时未分配</p>
|
||||
<p v-else>{{ dormitory }}</p>
|
||||
</div>
|
||||
</van-dialog>
|
||||
<p>宿舍</p>
|
||||
|
@ -332,7 +332,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { useUserStore } from '@/store';
|
||||
import { getUser, getGroupName } from '@/api';
|
||||
import { getUser, getGroupName, getDormitoryName } from '@/api';
|
||||
|
||||
const store = useUserStore();
|
||||
const show0 = ref(false);
|
||||
|
@ -369,6 +369,7 @@
|
|||
* 7. 获取用户证书信息
|
||||
* */
|
||||
const group = ref('');
|
||||
const dormitory = ref('');
|
||||
const showIcon = reactive({
|
||||
show0: false,
|
||||
show1: false,
|
||||
|
@ -398,6 +399,7 @@
|
|||
carNumber: '', // 车牌号
|
||||
dormitoryStatus: 0, // 是否住宿(1:是,0:否)
|
||||
mealCard: '', // 饭卡
|
||||
dormitoryId: '',
|
||||
});
|
||||
|
||||
const showGroup = () => {
|
||||
|
@ -411,6 +413,17 @@
|
|||
},
|
||||
);
|
||||
};
|
||||
const showDormitory = () => {
|
||||
show4.value = true;
|
||||
getDormitoryName(userInfo.dormitoryId).then(
|
||||
(res) => {
|
||||
dormitory.value = res.result;
|
||||
},
|
||||
(err) => {
|
||||
console.log(err);
|
||||
},
|
||||
);
|
||||
};
|
||||
const carNum = () => {
|
||||
let carNum = userInfo.carNumber;
|
||||
if (carNum) {
|
||||
|
@ -556,10 +569,74 @@
|
|||
right: 10px;
|
||||
top: 10px;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
font-weight: bold;
|
||||
color: #949494;
|
||||
cursor: pointer;
|
||||
}
|
||||
.txz-img2 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
//border: 5px solid red;
|
||||
background-image: url('@/assets/orangeUi/txz.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover; /* 修改这里 */
|
||||
z-index: 999;
|
||||
|
||||
span {
|
||||
width: 30vw;
|
||||
//border: 1px solid red;
|
||||
font-weight: 700;
|
||||
color: #262626;
|
||||
font-size: 20px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.card-pai {
|
||||
position: absolute;
|
||||
left: 8.5vw;
|
||||
top: 71vh;
|
||||
//font-size: 24px;
|
||||
font-family: 微软雅黑;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 35px;
|
||||
height: 2.5rem;
|
||||
width: 80%;
|
||||
opacity: 1;
|
||||
//color: rgba(141, 35, 40, 0.6);
|
||||
//color: rgba(255, 255, 255, 0.8);
|
||||
color: white;
|
||||
|
||||
font-weight: 600;
|
||||
border-radius: 132px;
|
||||
background: rgba(255, 255, 255, 1), rgba(255, 255, 255, 1);
|
||||
border: 4px solid rgba(255, 255, 255, 0.7);
|
||||
box-shadow:
|
||||
0px 0px 0px rgba(0, 0, 0, 0.1),
|
||||
0px 3px 7px rgba(0, 0, 0, 0.1),
|
||||
0px 12px 12px rgba(0, 0, 0, 0.09),
|
||||
0px 27px 16px rgba(0, 0, 0, 0.05),
|
||||
0px 47px 19px rgba(0, 0, 0, 0.01),
|
||||
0px 74px 21px rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.card-tishi {
|
||||
position: absolute;
|
||||
top: 80vh;
|
||||
left: 10vw;
|
||||
text-align: left;
|
||||
width: 80vw;
|
||||
font-size: 28px;
|
||||
color: white;
|
||||
margin: 0 auto;
|
||||
text-indent: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 地图、通行证等弹窗样式 */
|
||||
.ditu-img,
|
||||
|
|
|
@ -369,7 +369,7 @@
|
|||
});
|
||||
// 返回上一步
|
||||
const Previous = () => {
|
||||
router.push('/waiTeacherTwo');
|
||||
router.push('/waiTeacher');
|
||||
};
|
||||
let myObj = {};
|
||||
// 信息提交到后台
|
||||
|
|
|
@ -9,20 +9,6 @@ export {}
|
|||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
BasicModal: typeof import('./../src/components/Modal/src/BasicModal.vue')['default']
|
||||
NutAvatar: typeof import('@nutui/nutui')['Avatar']
|
||||
NutButton: typeof import('@nutui/nutui')['Button']
|
||||
NutCard: typeof import('@nutui/nutui')['Card']
|
||||
NutCell: typeof import('@nutui/nutui')['Cell']
|
||||
NutCellGroup: typeof import('@nutui/nutui')['CellGroup']
|
||||
NutForm: typeof import('@nutui/nutui')['Form']
|
||||
NutFormItem: typeof import('@nutui/nutui')['FormItem']
|
||||
NutGrid: typeof import('@nutui/nutui')['Grid']
|
||||
NutGridItem: typeof import('@nutui/nutui')['GridItem']
|
||||
NutInput: typeof import('@nutui/nutui')['Input']
|
||||
NutSwiper: typeof import('@nutui/nutui')['Swiper']
|
||||
NutSwiperItem: typeof import('@nutui/nutui')['SwiperItem']
|
||||
NutTabbar: typeof import('@nutui/nutui')['Tabbar']
|
||||
NutTabbarItem: typeof import('@nutui/nutui')['TabbarItem']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
VanButton: typeof import('vant/es')['Button']
|
||||
|
@ -37,7 +23,5 @@ declare module 'vue' {
|
|||
VanRadio: typeof import('vant/es')['Radio']
|
||||
VanRadioGroup: typeof import('vant/es')['RadioGroup']
|
||||
VanRow: typeof import('vant/es')['Row']
|
||||
VarButton: typeof import('@varlet/ui')['_ButtonComponent']
|
||||
VarSpace: typeof import('@varlet/ui')['_SpaceComponent']
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue