lanan-repair/pages/my/my.vue

305 lines
7.9 KiB
Vue
Raw Normal View History

2024-09-22 15:07:01 +08:00
<template>
<view class="container">
<view class="body">
2024-09-24 21:30:53 +08:00
<VNavigationBar titleColor="rgba(0,0,0,0.9)" :leftTitle="true" backgroundColor="transparent" title=" ">
2024-09-22 15:07:01 +08:00
</VNavigationBar>
<view class="body-top">
<image class="userBmg" src="../../static/images/image1.png" mode="widthFix"></image>
<view class="userInfo">
2024-10-11 20:50:05 +08:00
<image v-if="''==customInfo.avatar || null == customInfo.avatar" class="avatar" src="../../static/images/avatar.png" mode="aspectFit"></image>
<image v-else class="avatar" :src="imgUrlPrex+customInfo.avatar" mode="scaleToFill"></image>
<text class="customInfo">{{customInfo.nickname}}</text>
2024-09-22 15:07:01 +08:00
</view>
</view>
2024-10-11 20:50:05 +08:00
<!-- <view class="level">-->
<!-- <image class="levelIcon" src="" mode="aspectFit"></image>-->
<!-- <view class="levelInfo">-->
<!-- <text class="levelNum">{{customInfo.levelName}}</text>-->
<!-- &lt;!&ndash; <text class="levelQy">当前可享受4项权益</text> &ndash;&gt;-->
<!-- </view>-->
<!-- <view class="showQyBtn" @click="showEquity">-->
<!-- 查看权益-->
<!-- <image class="showQyBtnIcon" src="../../static/icons/icon1.png" mode="aspectFit"></image>-->
<!-- </view>-->
<!-- </view>-->
2024-09-22 15:07:01 +08:00
<view class="menu1">
<view @click="goToPage('/pages/myCar/myCar')" style="background: linear-gradient( 90deg, #DEE5FC 0%, #CAD6FA 100%);"
class="menu1-item menu-myCar">
<image class="menu1-item-icon" src="../../static/icons/myCar.png" mode="aspectFit"></image>
<text style="flex: 1;">我的车辆</text>
<image class="menu1-item-btnIcon" src="../../static/icons/icon2.png" mode=""></image>
<image class="bmg" src="../../static/images/image2.png" mode="aspectFit"></image>
</view>
<view @click="goToPage('/pages/myReservation/myReservation')" style="background: linear-gradient( 90deg, #CFF3ED 0%, #9FE9DD 100%);"
class="menu1-item menu-myOrder">
<image class="menu1-item-icon" src="../../static/icons/myOrder.png" mode="aspectFit"></image>
<text style="flex: 1;">我的预约</text>
<image class="menu1-item-btnIcon" src="../../static/icons/icon3.png" mode=""></image>
<image class="bmg" src="../../static/images/image2.png" mode="aspectFit"></image>
</view>
</view>
<view class="menuCard">
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard1" :key="item.title" class="menu-item">
<image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
<text class="menu-item-title">{{ item.title }}</text>
<text class="messageNum" v-if="item.title === '消息中心'">
{{ '12' }}
</text>
<image class="menu-item-more" src="../../static/icons/homeInfoMore.png" mode="widthFix"></image>
</view>
</view>
2024-09-24 16:14:08 +08:00
2024-09-22 15:07:01 +08:00
<view class="menuCard">
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard2" :key="item.title" class="menu-item">
<image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
<text class="menu-item-title">{{ item.title }}</text>
<image class="menu-item-more" src="../../static/icons/homeInfoMore.png" mode="widthFix"></image>
</view>
</view>
</view>
<tabBarVue msg="3"></tabBarVue>
</view>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.vue'
2024-09-24 21:30:53 +08:00
import request from "@/utils/request";
2024-10-11 20:50:05 +08:00
import config from '@/config'
2024-10-14 18:36:20 +08:00
import {getToken,getUserInfo} from '@/utils/auth'
2024-09-22 15:07:01 +08:00
export default {
components: {
tabBarVue,
VNavigationBar
},
2024-09-24 22:36:59 +08:00
onShow(data) {
2024-09-27 17:21:10 +08:00
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
})
}else{
console.log("已登录")
2024-10-11 20:50:05 +08:00
//直接取缓存中的用户信息
this.customInfo = JSON.parse(getUserInfo())
2024-09-27 17:21:10 +08:00
}
2024-09-24 21:30:53 +08:00
},
2024-09-22 15:07:01 +08:00
data() {
return {
2024-09-24 21:30:53 +08:00
//用户信息
customInfo:{},
2024-10-11 20:50:05 +08:00
imgUrlPrex:config.baseImageUrl,
2024-09-22 15:07:01 +08:00
menuCard1: [
{ title: '我的资料', icon: require('@/static/icons/my-menu-icon1.png'), path: '/pages/my/myInfo' },
2024-09-24 21:30:53 +08:00
{ title: '我的卡券', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/my/cardRoll" },
2024-09-28 00:17:38 +08:00
{ title: '我的评价', icon: require('@/static/icons/my-menu-icon3.png'), path: '/pages-order/my/evaluate' },
2024-09-22 15:07:01 +08:00
],
menuCard2: [
2024-09-24 16:58:29 +08:00
{ title: '消息中心', icon: require('@/static/icons/my-menu-icon2.png'), path: '/pages/my/message' },
2024-09-22 15:07:01 +08:00
{ title: '客服中心', icon: require('@/static/icons/my-menu-icon4.png') },
{ title: '操作指南', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/guideList/guideList" },
]
}
},
methods: {
goToPage(path) {
uni.navigateTo({
url: path
})
},
showEquity() {
uni.navigateTo({
url: '/pages/my/myEquity'
})
2024-09-24 21:30:53 +08:00
},
2024-09-22 15:07:01 +08:00
}
}
</script>
<style scoped lang="less">
.container {
height: 100%;
background: #fff;
background: linear-gradient(180deg, rgba(1, 116, 246, 0.3) 0%, rgba(1, 116, 246, 0) 100%);
background-size: 100% 600rpx;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
color: #333333;
.body {
flex: 1;
height: 0;
padding-bottom: 30rpx;
overflow: auto;
}
.body-top {
position: relative;
.userBmg {
width: 750rpx;
}
.userInfo {
display: flex;
flex-direction: column;
align-items: center;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
.avatar {
width: 140rpx;
height: 140rpx;
2024-10-11 20:50:05 +08:00
border-radius: 50%;
2024-09-22 15:07:01 +08:00
margin-bottom: 30rpx;
}
.userName {
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.level {
box-sizing: border-box;
width: 686rpx;
margin: 30rpx auto 0;
background: linear-gradient(90deg, #0174F6 0%, #01BBF6 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
display: flex;
align-items: center;
padding: 24rpx 30rpx;
column-gap: 20rpx;
.levelIcon {
width: 68rpx;
height: 68rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.7);
}
.levelInfo {
flex: 1;
width: 0;
display: flex;
flex-direction: column;
row-gap: 8rpx;
.levelNum {
font-weight: bold;
font-size: 28rpx;
color: #FFFFFF;
}
.levelQy {
font-weight: 500;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.7);
}
}
.showQyBtn {
width: 156rpx;
height: 48rpx;
background: rgba(255, 255, 255, 0.7);
border-radius: 24rpx 24rpx 24rpx 24rpx;
display: flex;
justify-content: center;
align-items: center;
column-gap: 2rpx;
font-weight: 500;
font-size: 24rpx;
color: #0174F6;
.showQyBtnIcon {
width: 20rpx;
height: 20rpx;
}
}
}
.menu1 {
box-sizing: border-box;
width: 686rpx;
margin: 30rpx auto 0;
display: flex;
align-items: center;
column-gap: 22rpx;
.menu1-item {
flex: 1;
width: 0;
padding: 38rpx 28rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
position: relative;
display: flex;
align-items: center;
column-gap: 18rpx;
.bmg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}
.menu1-item-icon {
width: 56rpx;
height: 56rpx;
}
.menu1-item-btnIcon {
width: 32rpx;
height: 32rpx;
}
}
2024-09-24 16:14:08 +08:00
2024-09-22 15:07:01 +08:00
.menuCard {
width: 686rpx;
margin: 30rpx auto 0;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(10,54,104,0.1);
border-radius: 12rpx 12rpx 12rpx 12rpx;
.menu-item {
padding: 40rpx 30rpx;
display: flex;
align-items: center;
column-gap: 20rpx;
}
.menu-item-icon {
width: 44rpx;
height: 44rpx;
}
.menu-item-title {
flex: 1;
width: 0;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.menu-item-more {
width: 14rpx;
}
.messageNum {
width: 36rpx;
height: 36rpx;
background: #D54941;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-09-24 16:14:08 +08:00
2024-09-22 15:07:01 +08:00
font-weight: bold;
font-size: 20rpx;
color: #FFFFFF;
}
}
}
2024-09-24 16:14:08 +08:00
</style>