| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- <template>
- <view class="mine-container">
- <!-- 顶部标题 -->
- <view class="header-title">
- <text class="title-text">我的</text>
- </view>
- <!-- 用户登录/注册卡片 -->
- <view class="login-card" @click="handleLoginCardClick">
- <view class="login-card-content">
- <view class="avatar-section">
- <view v-if="!avatar" class="avatar-placeholder">
- <view class="iconfont icon-people avatar-icon"></view>
- </view>
- <image v-if="avatar" :src="avatar" class="avatar-image" mode="aspectFill"></image>
- </view>
- <view class="login-info">
- <view v-if="!name" class="login-text">点击登录/注册</view>
- <view v-else class="user-name">{{ name }}</view>
- <view v-if="!name" class="login-desc">登录后获取更多功能信息</view>
- </view>
- </view>
- <view class="login-card-bg">
- <!-- 背景装饰图案 -->
- </view>
- </view>
- <!-- 第一个菜单卡片 -->
- <view class="menu-card">
- <view class="menu-item" @click="handleToInfo">
- <view class="menu-item-left">
- <view class="menu-icon-wrapper account-icon">
- <view class="iconfont icon-user menu-icon"></view>
- </view>
- <text class="menu-text">账号信息</text>
- </view>
- <view class="iconfont icon-right arrow-icon"></view>
- </view>
- <view class="menu-divider"></view>
- <view class="menu-item" @click="handleToOrderRevenue">
- <view class="menu-item-left">
- <view class="menu-icon-wrapper revenue-icon">
- <text class="revenue-symbol">¥</text>
- </view>
- <text class="menu-text">订单收益</text>
- </view>
- <view class="iconfont icon-right arrow-icon"></view>
- </view>
- </view>
- <!-- 第二个菜单卡片 -->
- <view class="menu-card">
- <view class="menu-item" @click="handleClearCache">
- <view class="menu-item-left">
- <view class="menu-icon-wrapper cache-icon">
- <view class="iconfont icon-clean menu-icon"></view>
- </view>
- <text class="menu-text">本地缓存</text>
- </view>
- </view>
- <view class="menu-divider"></view>
- <view class="menu-item" @click="handleAbout">
- <view class="menu-item-left">
- <view class="menu-icon-wrapper about-icon">
- <view class="iconfont icon-help menu-icon"></view>
- </view>
- <text class="menu-text">关于我们</text>
- </view>
- <view class="iconfont icon-right arrow-icon"></view>
- </view>
- <view class="menu-divider"></view>
- <view class="menu-item" @click="handleLogout">
- <view class="menu-item-left">
- <view class="menu-icon-wrapper logout-icon">
- <view class="iconfont icon-logout menu-icon"></view>
- </view>
- <text class="menu-text">退出登录</text>
- </view>
- </view>
- </view>
- <!-- 底部导航栏 -->
- <bar-navigasi-handap></bar-navigasi-handap>
- </view>
- </template>
- <script>
- import BarNavigasiHandap from "@/components/barNavigasiHandap.vue"
- export default {
- components: {
- BarNavigasiHandap
- },
- data() {
- return {
- name: this.$store.state.user.name
- }
- },
- computed: {
- avatar() {
- return this.$store.state.user.avatar
- }
- },
- methods: {
- handleLoginCardClick() {
- if (!this.name) {
- this.$tab.reLaunch('/pages/login')
- } else {
- this.$tab.navigateTo('/pages/mine/info/index')
- }
- },
- handleToInfo() {
- if (!this.name) {
- this.$tab.reLaunch('/pages/login')
- return
- }
- this.$tab.navigateTo('/pages/mine/info/index')
- },
- handleToOrderRevenue() {
- if (!this.name) {
- this.$tab.reLaunch('/pages/login')
- return
- }
- this.$modal.showToast('模块建设中~')
- },
- handleClearCache() {
- this.$modal.confirm('确定要清理本地缓存吗?').then(() => {
- // 清理缓存的逻辑
- uni.clearStorageSync()
- this.$modal.msgSuccess('缓存清理成功')
- })
- },
- handleAbout() {
- this.$tab.navigateTo('/pages/mine/about/index')
- },
- handleLogout() {
- if (!this.name) {
- this.$tab.reLaunch('/pages/login')
- return
- }
- this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- this.$store.dispatch('LogOut').then(() => {}).finally(() => {
- this.$tab.reLaunch('/pages/index')
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #f5f5f5;
- }
- .mine-container {
- width: 100%;
- min-height: 100vh;
- padding-bottom: 120rpx;
- background-color: #f5f5f5;
- // 顶部标题
- .header-title {
- padding: 20rpx 0;
- text-align: center;
- background-color: #ffffff;
- .title-text {
- font-size: 36rpx;
- font-weight: 500;
- color: #000000;
- }
- }
- // 登录卡片
- .login-card {
- position: relative;
- margin: 30rpx 30rpx 40rpx 30rpx;
- padding: 40rpx 30rpx;
- background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
- border-radius: 24rpx;
- overflow: hidden;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
- .login-card-content {
- display: flex;
- align-items: center;
- position: relative;
- z-index: 2;
- .avatar-section {
- .avatar-placeholder {
- width: 120rpx;
- height: 120rpx;
- border-radius: 50%;
- background-color: #e0e0e0;
- display: flex;
- align-items: center;
- justify-content: center;
- .avatar-icon {
- font-size: 60rpx;
- color: #999999;
- }
- }
- .avatar-image {
- width: 120rpx;
- height: 120rpx;
- border-radius: 50%;
- }
- }
- .login-info {
- margin-left: 30rpx;
- flex: 1;
- .login-text {
- font-size: 36rpx;
- font-weight: 600;
- color: #000000;
- margin-bottom: 12rpx;
- }
- .user-name {
- font-size: 36rpx;
- font-weight: 600;
- color: #000000;
- margin-bottom: 12rpx;
- }
- .login-desc {
- font-size: 26rpx;
- color: #999999;
- }
- }
- }
- .login-card-bg {
- position: absolute;
- right: -60rpx;
- top: -60rpx;
- width: 240rpx;
- height: 240rpx;
- background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(147, 197, 253, 0.15) 100%);
- border-radius: 50%;
- z-index: 1;
- opacity: 0.6;
- }
- }
- // 菜单卡片
- .menu-card {
- margin: 0 30rpx 30rpx 30rpx;
- background-color: #ffffff;
- border-radius: 24rpx;
- overflow: hidden;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
- .menu-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 32rpx 30rpx;
- background-color: #ffffff;
- .menu-item-left {
- display: flex;
- align-items: center;
- flex: 1;
- .menu-icon-wrapper {
- width: 64rpx;
- height: 64rpx;
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 24rpx;
- &.account-icon {
- background-color: #e3f2fd;
- .menu-icon {
- color: #1976d2;
- }
- }
- &.revenue-icon {
- background-color: #fff3e0;
- position: relative;
- .revenue-symbol {
- font-size: 32rpx;
- font-weight: 600;
- color: #ff9800;
- }
- }
- &.cache-icon {
- background-color: #f3e5f5;
- .menu-icon {
- color: #9c27b0;
- }
- }
- &.about-icon {
- background-color: #e8f5e9;
- .menu-icon {
- color: #4caf50;
- }
- }
- &.logout-icon {
- background-color: #ffebee;
- .menu-icon {
- color: #f44336;
- }
- }
- .menu-icon {
- font-size: 36rpx;
- color: #333333;
- }
- }
- .menu-text {
- font-size: 32rpx;
- color: #000000;
- }
- }
- .arrow-icon {
- font-size: 28rpx;
- color: #cccccc;
- }
- }
- .menu-divider {
- height: 1rpx;
- background-color: #f0f0f0;
- margin: 0 30rpx;
- }
- }
- }
- </style>
|