u
This commit is contained in:
1 parent
68f08d921a
commit
3656d05f62
97 files changed
+17495
No files matched your search
@@ -0,0 +1,135 @@
|
||||
<script setup lang="ts">
|
||||
import { dialog } from 'sard-uniapp'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
onShow(() => {
|
||||
userStore.requireLogin()
|
||||
})
|
||||
|
||||
function handleLoginOut() {
|
||||
dialog.confirm({
|
||||
title: '提示',
|
||||
message: '确定退出登录?',
|
||||
onConfirm() {
|
||||
userStore.reset()
|
||||
|
||||
uni.reLaunch({
|
||||
url: '/pages-sub/login/index',
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function handleToLogin() {
|
||||
if (userStore.isLogined) {
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/login/index',
|
||||
})
|
||||
}
|
||||
|
||||
function handleToUpdatePassword() {
|
||||
handleToLogin()
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/update-password/index',
|
||||
})
|
||||
}
|
||||
|
||||
const avatarText = computed(() => {
|
||||
if (!userStore.isLogined) {
|
||||
return '登'
|
||||
}
|
||||
|
||||
const id = userStore.userInfo?.userid
|
||||
if (!id || id.length === 0)
|
||||
return 'A'
|
||||
|
||||
return id.charAt(0).toUpperCase()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="account-header" @click="handleToLogin">
|
||||
<sar-avatar size="128rpx" icon-size="48rpx" background="var(--sar-primary)" color="#fff">
|
||||
{{ avatarText }}
|
||||
</sar-avatar>
|
||||
<view class="user-info">
|
||||
<text class="user-userid">
|
||||
{{ userStore.isLogined ? userStore.userInfo.userid : "尚未登录!" }}
|
||||
</text>
|
||||
<text class="user-orgid">
|
||||
{{ userStore.isLogined ? userStore.userInfo.orgid : "点击前去登录。" }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="actions">
|
||||
<sar-list-item title="修改密码" hover arrow @click="handleToUpdatePassword">
|
||||
<template #icon>
|
||||
<sar-icon
|
||||
family="iconfont"
|
||||
name="updatePassword"
|
||||
color="var(--sar-primary)"
|
||||
size="48rpx"
|
||||
/>
|
||||
</template>
|
||||
</sar-list-item>
|
||||
|
||||
<sar-list-item title="退出登录" hover arrow @click="handleLoginOut">
|
||||
<template #icon>
|
||||
<sar-icon
|
||||
family="iconfont"
|
||||
name="exitLogin"
|
||||
color="var(--sar-primary)"
|
||||
size="48rpx"
|
||||
/>
|
||||
</template>
|
||||
</sar-list-item>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.account-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 36rpx 28rpx;
|
||||
background-color: #fff;
|
||||
box-shadow:
|
||||
0 2rpx 4rpx rgba(0, 0, 0, 0.06),
|
||||
0 4rpx 6rpx rgba(0, 0, 0, 0.08);
|
||||
.user-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
margin-left: 32rpx;
|
||||
justify-content: space-between;
|
||||
.user-userid {
|
||||
font-size: 42rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.user-orgid {
|
||||
font-size: 32rpx;
|
||||
margin-top: 12rpx;
|
||||
color: #6b788e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 32rpx;
|
||||
box-shadow:
|
||||
0 2rpx 4rpx rgba(0, 0, 0, 0.06),
|
||||
0 4rpx 6rpx rgba(0, 0, 0, 0.08);
|
||||
:deep(.sar-list-item__title) {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,177 @@
|
||||
<script setup lang="ts">
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
onShow(() => {
|
||||
userStore.requireLogin()
|
||||
})
|
||||
|
||||
const swiperCurrent = ref(0)
|
||||
const swiperList = [
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
]
|
||||
|
||||
function handleToLogin() {
|
||||
uni.reLaunch({
|
||||
url: '/pages-sub/login/index',
|
||||
})
|
||||
}
|
||||
|
||||
function toLinkUrl(url) {
|
||||
if (!url) {
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="swiper-container">
|
||||
<swiper
|
||||
:current="swiperCurrent"
|
||||
autoplay
|
||||
:interval="3000"
|
||||
class="swiper"
|
||||
@change="swiperCurrent = $event.detail.current"
|
||||
>
|
||||
<swiper-item>
|
||||
<image
|
||||
src="@/static/images/bg.jpg"
|
||||
style="width: 100%;height:100%"
|
||||
/>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<image
|
||||
src="@/static/images/bg1.jpg"
|
||||
style="width: 100%;height:100%"
|
||||
/>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<image
|
||||
src="@/static/images/bg2.jpg"
|
||||
style="width: 100%;height:100%"
|
||||
/>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<sar-swiper-dot
|
||||
:current="swiperCurrent"
|
||||
:list="swiperList"
|
||||
/>
|
||||
</view>
|
||||
<view v-if="userStore.isLogined" class="grid-container">
|
||||
<sar-grid :columns="2" gap="24rpx">
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/waybill/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/waybill.png" />
|
||||
<text>在途运单</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/waybill-history/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/HistoricalWaybill.png" />
|
||||
<text>历史运单</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/yewu-yingfu/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/MyExpenses.png" />
|
||||
<text>业务应付</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/feiyong-baoxiao/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/ExpensesClaimIndex.png" />
|
||||
<text>费用报销</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/jiayou/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/refuelling.png" />
|
||||
<text>加油管理</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/cheliang-weixiu/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/CheliangWeixiu.png" />
|
||||
<text>车辆维修</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
</sar-grid>
|
||||
</view>
|
||||
<sar-result v-else status="warning" title="尚未登陆" style="margin-top: 32rpx;">
|
||||
<sar-button
|
||||
@click="handleToLogin"
|
||||
>
|
||||
前去登录
|
||||
</sar-button>
|
||||
</sar-result>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.swiper-container {
|
||||
position: relative;
|
||||
.swiper {
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
padding-top: 32rpx;
|
||||
|
||||
:deep(.sar-grid__content) {
|
||||
background-color: #fff;
|
||||
}
|
||||
:deep(.sar-grid) {
|
||||
row-gap: 0 !important;
|
||||
}
|
||||
:deep(.sar-grid__item) {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
:deep(.sar-grid__wrapper) {
|
||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
:deep(.sar-badge) {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
image {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
}
|
||||
text {
|
||||
margin-top: 16rpx;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user