Zlpt_Portal_h5/src/pages/my/index.vue

148 lines
3.7 KiB
Vue
Raw Normal View History

2024-12-13 15:30:11 +08:00
<template>
<!-- 我的 -->
2024-12-21 17:24:36 +08:00
<view class="h5-container">
<view class="user-info">
<view style="text-align: right; padding: 15px 15px 0 0">
<van-icon name="setting" size="22" @click="onJumpToMySetting" />
2024-12-13 15:30:11 +08:00
</view>
2024-12-21 17:24:36 +08:00
<view class="header-user">
<van-image
round
fit="cover"
width="68px"
height="68px"
src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
/>
<view class="right-name">
<view class="name-box">
2024-12-24 18:05:34 +08:00
<text class="name"> {{ userInfo?.nickName }} </text>
<text class="company"> {{ userCompanyName }} </text>
2024-12-21 17:24:36 +08:00
</view>
2024-12-24 18:05:34 +08:00
<view> {{ userInfo?.phonenumber }} </view>
2024-12-21 17:24:36 +08:00
</view>
</view>
<van-cell-group inset>
<h2>我的订单</h2>
<van-grid clickable :column-num="2" :gutter="10">
<van-grid-item>
2024-12-25 18:12:01 +08:00
<navigator url="/pages/order-details/index?type=1">
2024-12-21 17:24:36 +08:00
<van-icon name="cart" />
<text>出租订单</text>
</navigator>
</van-grid-item>
<van-grid-item>
2024-12-25 18:12:01 +08:00
<navigator url="/pages/order-details/index?type=2">
2024-12-21 17:24:36 +08:00
<van-icon name="cart" />
<text>租赁订单</text>
</navigator>
</van-grid-item>
</van-grid>
</van-cell-group>
2024-12-13 15:30:11 +08:00
</view>
</view>
</template>
<script setup>
2024-12-24 18:05:34 +08:00
import { ref } from 'vue'
2024-12-13 15:30:11 +08:00
import { useMemberStore } from '@/stores/index.js'
2024-12-24 18:05:34 +08:00
import { onLoad } from '@dcloudio/uni-app'
2024-12-13 15:30:11 +08:00
const memberStore = useMemberStore()
2024-12-24 18:05:34 +08:00
const userInfo = ref(null)
const userCompanyName = ref(null)
2024-12-13 15:30:11 +08:00
const onLogout = () => {
uni.navigateTo({ url: '/pages/login/index' })
}
2024-12-21 17:24:36 +08:00
const onJumpToMySetting = () => {
uni.navigateTo({ url: '/pages/my-setting/index' })
}
2024-12-24 18:05:34 +08:00
onLoad(() => {
userInfo.value = memberStore.userInfo
userCompanyName.value = memberStore.userCompanyName
})
2024-12-13 15:30:11 +08:00
</script>
<style lang="scss" scoped>
.user-info {
2024-12-21 17:24:36 +08:00
flex: 1;
padding: 10px;
color: #333;
background: linear-gradient(to bottom, #c0e9ce, #e4f2f2, #f9f9f9);
.header-user {
display: flex;
align-items: center;
padding: 20px;
.right-name {
padding-left: 15px;
font-size: 14px;
.name-box {
padding: 10px 0;
display: flex;
align-items: center;
}
.name {
font-size: 18px;
font-weight: bold;
}
.company {
padding: 2px 8px;
margin-left: 10px;
background-color: #c4fbf5;
font-size: 13px;
color: #32b1a2;
border-radius: 4px;
}
}
}
}
:deep(.van-cell-group--inset) {
margin: 0;
padding: 15px 0;
h2 {
padding: 0 15px;
font-size: 16px;
}
}
.van-grid {
margin-top: 15px;
:deep(.van-grid-item__content) {
padding: 0;
}
navigator {
width: 100%;
padding: 30px 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #e8f2ef;
color: #4a4949;
2024-12-13 15:30:11 +08:00
2024-12-21 17:24:36 +08:00
text {
margin-left: 8px;
}
2024-12-13 15:30:11 +08:00
}
}
.van-hairline--top {
width: 100%;
margin-top: 10px;
text-align: center;
}
</style>