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.
llll/shenfen.vue

78 lines
1.7 KiB

1 month ago
<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>