feat: 实现了我的设置页面的相关操作
This commit is contained in:
@@ -1,48 +1,23 @@
|
||||
<template>
|
||||
<view class="drawer-home">
|
||||
<view class="drawer-home-nav">
|
||||
<text>抽屉页面</text>
|
||||
</view>
|
||||
|
||||
<button @click="closeDrawer" type="default">关闭</button>
|
||||
<button @click="login" type="default">登录</button>
|
||||
<button @click="sendChat" type="default">会话测试</button>
|
||||
|
||||
<view class="drawer-list">
|
||||
<view v-for="(item,index) in 100" :key="index">
|
||||
<text class="message-item">{{item}}</text>
|
||||
</view>
|
||||
<uni-icons type="closeempty" size="22" color="#333333" class="close-icon" @click="closeDrawer"></uni-icons>
|
||||
<text class="title">我的</text>
|
||||
</view>
|
||||
|
||||
<MineSetting/>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MineSetting from './MineSetting.vue'
|
||||
import { defineEmits } from 'vue'
|
||||
const emits = defineEmits(['closeDrawer'])
|
||||
import * as loginMnager from '@/manager/LoginManager'
|
||||
|
||||
import request from '../../request/base/request'
|
||||
|
||||
const closeDrawer = () => {
|
||||
emits('closeDrawer')
|
||||
console.log('=============关闭抽屉')
|
||||
}
|
||||
|
||||
const login = () => {
|
||||
loginMnager.loginAuth()
|
||||
.then(res => {
|
||||
console.log('登录成功', res)
|
||||
// 这里可以处理登录成功后的逻辑,比如保存 token 等
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('登录失败', err)
|
||||
// 这里可以处理登录失败的逻辑
|
||||
})
|
||||
console.log('=============登录')
|
||||
// 这里可以处理登录逻辑,比如调用登录接口等
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -50,43 +25,26 @@
|
||||
.drawer-home {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #E9F3F7;
|
||||
padding-top: 44px;
|
||||
background-color: #fff;
|
||||
padding-top: 44px;
|
||||
}
|
||||
|
||||
.drawer-home-nav {
|
||||
position: relative;
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: center; /* 文字水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
|
||||
.drawer-home-nav {
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
text {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.drawer-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.message-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background-color: white;
|
||||
margin: 6px 12px;
|
||||
padding: 8px 24px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
|
||||
text {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
.close-icon {
|
||||
position: absolute;
|
||||
left: 12px; /* 距离左边12px */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user