Dining_Hall/pages/mine/me/index.vue

144 lines
3.2 KiB
Vue
Raw Normal View History

2025-01-02 21:10:40 +08:00
<template>
<view class="container">
<!-- 顶部导航栏 -->
<!-- <view class="header"> -->
<!-- <view class="back-icon" @click="goBack"> -->
<!-- <image class="icon" :src="require('@/static/images/my/notice.png')" mode="aspectFit"></image> -->
<!-- </view> -->
<!-- <text class="title">个人信息</text> -->
<!-- </view> -->
2025-01-02 21:10:40 +08:00
<!-- 菜单列表 -->
<view class="menu-list">
<view
v-for="(item, index) in menuItems"
:key="index"
class="menu-item"
@click="handleMenuItemClick(item.path, item.title)"
2025-01-02 21:10:40 +08:00
>
<text class="menu-text">{{ item.title }}</text>
<image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image>
</view>
</view>
<!-- uView 弹框组件 -->
<u-modal
:show="showDialog"
:show-cancel-button="true"
title="提示"
:content="dialogContent"
@confirm="handleConfirm"
@cancel="handleCancel"
></u-modal>
2025-01-02 21:10:40 +08:00
</view>
</template>
<script>
import UModal from '@/uni_modules/uview-ui/components/u-modal/u-modal.vue'
2025-01-02 21:10:40 +08:00
export default {
components: { UModal },
2025-01-02 21:10:40 +08:00
data() {
return {
menuItems: [
{
title: '基本信息',
path: '/pages/mine/me/basicInfo'
},
{
title: '我的地址',
path: '/pages/mine/me/myAddress'
2025-01-02 21:10:40 +08:00
},
{
title: '健康信息',
path: '/pages/mine/me/healthInformation'
2025-01-02 21:10:40 +08:00
},
{
title: '人脸上传',
2025-01-03 18:28:23 +08:00
path: '/pages/mine/me/faceUpload'
2025-01-02 21:10:40 +08:00
},
{
title: '修改密码',
path: '/pages/change-password/index'
},
{
title: '挂失解绑',
path: '/pages/unbind/index'
}
],
showDialog: false, // 控制弹框显示隐藏
dialogContent: '' // 弹框内容
2025-01-02 21:10:40 +08:00
}
},
methods: {
goBack() {
uni.navigateBack()
},
handleMenuItemClick(path, title) {
if (title === '挂失解绑') {
console.log('挂失解绑')
this.dialogContent = '您确定要执行挂失解绑操作吗?'
this.showDialog = true
} else {
this.navigateTo(path)
}
},
2025-01-02 21:10:40 +08:00
navigateTo(url) {
uni.navigateTo({
url
})
},
handleConfirm() {
console.log('用户点击了确认')
// 在这里处理确认逻辑
this.showDialog = false
// 例如:执行挂失解绑操作
this.unbind()
},
handleCancel() {
console.log('用户点击了取消')
// 在这里处理取消逻辑
this.showDialog = false
},
unbind() {
// 挂失解绑的具体逻辑
console.log('执行挂失解绑操作')
// 例如:调用 API 进行挂失解绑
2025-01-02 21:10:40 +08:00
}
}
}
</script>
<style lang="scss">
.container {
2025-01-03 18:28:23 +08:00
margin-top: -20px;
background-color: #FFFFFF;
2025-01-02 21:10:40 +08:00
}
.menu-list {
background: #FFFFFF;
.menu-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx;
2025-01-03 18:28:23 +08:00
border-bottom: 1rpx solid #FFFFFF;
2025-01-02 21:10:40 +08:00
&:last-child {
border-bottom: none;
}
.menu-text {
font-size: 32rpx;
color: #333;
}
.arrow-icon {
width: 32rpx;
height: 32rpx;
}
}
}
</style>