You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.7 KiB
78 lines
1.7 KiB
<template>
|
|
<view class="container">
|
|
<!-- Teacher Section -->
|
|
<navigator url="/pages/login/zhuce/register/teacher">
|
|
<view class="section">
|
|
<image src='../../../static/teacher.png' mode="aspectFit" class="identity-image" />
|
|
<button class="identity-button" @click="selectIdentity('teacher')">我是老师</button>
|
|
</view>
|
|
</navigator>
|
|
|
|
|
|
<view class="divider"></view>
|
|
|
|
<!-- Student Section -->
|
|
<navigator url="/pages/login/zhuce/register/register">
|
|
<view class="section">
|
|
<image src='../../../static/student.png' mode="aspectFit" class="identity-image" />
|
|
<button class="identity-button" @click="selectIdentity('student')">我是学生</button>
|
|
</view>
|
|
</navigator>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
methods: {
|
|
selectIdentity(identity) {
|
|
// Record the identity (e.g., store in local storage or state management)
|
|
uni.setStorageSync('selectedIdentity', identity);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
height: 100%;
|
|
justify-content: flex-start; /* 更改为向上对齐 */
|
|
padding-top: 100px; /* 添加顶部内边距以整体上移
|
|
padding-bottom: 20px; /* 可选:保持底部间距 */
|
|
}
|
|
|
|
|
|
.section {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
margin: 20px 0;
|
|
}
|
|
|
|
.identity-image {
|
|
width: 120px;
|
|
height: 120px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.identity-button {
|
|
width: 150px;
|
|
padding: 5px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 25px;
|
|
text-align: center;
|
|
}
|
|
|
|
.divider {
|
|
width: 80%;
|
|
height: 1px;
|
|
background-color: #ccc;
|
|
margin: 20px 0;
|
|
}
|
|
</style>
|