update: 登陆 统计 我的 去掉返回按钮

This commit is contained in:
admin 2024-05-07 13:41:43 +08:00
parent 800dc310a7
commit 4be018f479
8 changed files with 124 additions and 55 deletions

View File

@ -1,8 +1,10 @@
<template> <template>
<NavBar :count="0" :title="'数据统计'"></NavBar>
<Box <Box
v-if=" v-if="
isShowModule(list[0].child.concat(list[1].child).concat(list[2].child)) isShowModule(list[0].child.concat(list[1].child).concat(list[2].child))
" "
:isShow="true"
> >
<view <view
v-for="(item, index) in list" v-for="(item, index) in list"
@ -17,10 +19,10 @@
v-for="(child, index) in item.child" v-for="(child, index) in item.child"
:key="index" :key="index"
@click="(child as any).fn(child)" @click="(child as any).fn(child)"
v-show="isShowModule([{title: child.title}])" v-show="isShowModule([{ title: child.title }])"
:class="{'box': isShowModule([{title: child.title}])}" :class="{ box: isShowModule([{ title: child.title }]) }"
> >
<view v-if="isShowModule([{title: child.title}])"> <view v-if="isShowModule([{ title: child.title }])">
<up-image <up-image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesStatistics/${child.icon}`" :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesStatistics/${child.icon}`"
mode="aspectFill" mode="aspectFill"
@ -28,13 +30,16 @@
height="60rpx" height="60rpx"
></up-image> ></up-image>
</view> </view>
<view v-if="isShowModule([{title: child.title}])">{{ child.title }}</view> <view v-if="isShowModule([{ title: child.title }])">{{
child.title
}}</view>
</view> </view>
</view> </view>
<view class="line" v-show="index < list.length - 1"></view> <view class="line" v-show="index < list.length - 1"></view>
</view> </view>
</Box> </Box>
<!-- 当收货 出货 常用app全部为空 显示暂无权限 --> <!-- 当收货 出货 常用app全部为空 显示暂无权限 -->
<up-empty <up-empty
v-else v-else
@ -51,6 +56,7 @@ import Title from "@/components/Title/index.vue";
import TabBar from "@/components/TabBar/index.vue"; import TabBar from "@/components/TabBar/index.vue";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services"; import { ProfileApi } from "@/services";
const store = useMemberStore(); const store = useMemberStore();
const list = reactive([ const list = reactive([
{ {
@ -147,9 +153,9 @@ const isShowModule = (list: any) => {
onMounted(() => { onMounted(() => {
// //
ProfileApi.getUserInfo().then((res:any) => { ProfileApi.getUserInfo().then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
store.setProfile({...res.data, token: store.profile.token}); store.setProfile({ ...res.data, token: store.profile.token });
} }
}); });
}); });

View File

@ -1,9 +1,52 @@
<template> <template>
<view class="box"> <view
:class="{'box': isShow}"
:style="{
marginTop: navbarRect.height + navbarRect.top + 'px',
height: navbarRect.safeHeight + 'px',
}"
>
<slot></slot> <slot></slot>
</view> </view>
</template> </template>
<script setup lang="ts"></script> <script setup lang="ts">
const props = withDefaults(
defineProps<{
isShow: boolean;
}>(),
{
isShow: false
}
);
const navbarRect = reactive({
height: 32,
top: 28,
safeHeight: 500,
});
const getSafeHeight = () => {
// #ifdef APP-PLUS || MP-WEIXIN
uni.getSystemInfo({
success: (res) => {
navbarRect.safeHeight =
res.windowHeight -
uni.upx2px(80) -
navbarRect.height -
navbarRect.top -
40 -
17;
},
});
// #endif
};
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;
getSafeHeight();
// #endif
});
</script>
<style lang="scss"> <style lang="scss">
.box { .box {
background: #ffffff; background: #ffffff;

View File

@ -6,7 +6,7 @@
}" }"
class="navbar" class="navbar"
> >
<view class="left" @click="handleMsg()"> <view class="left" @click="handleMsg()" v-if="title === '工作台'">
<view class="msg-badge"> <view class="msg-badge">
<up-badge max="99" :value="count"></up-badge> <up-badge max="99" :value="count"></up-badge>
</view> </view>
@ -18,7 +18,7 @@
></up-image> ></up-image>
</view> </view>
<view class="title">工作台</view> <view class="title">{{ title }}</view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -30,7 +30,8 @@ console.log(ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,Devic
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
count: number count: number,
title: string
}>(), }>(),
{ {
count: 0 count: 0
@ -58,7 +59,7 @@ const handleMsg = () => {
<style lang="scss"> <style lang="scss">
.navbar { .navbar {
background: #f9f9f9; background: #f9f9f9;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.18); // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.18);
padding: 15rpx; padding: 15rpx;
position: fixed; position: fixed;
width: 100%; width: 100%;

View File

@ -39,6 +39,7 @@
{ {
"path": "login/index", "path": "login/index",
"style": { "style": {
"navigationStyle": "custom", //
"navigationBarTitleText": "登陆" "navigationBarTitleText": "登陆"
} }
}, },
@ -57,7 +58,9 @@
{ {
"path": "profile/index", "path": "profile/index",
"style": { "style": {
"navigationStyle": "custom",
"navigationBarTitleText": "个人中心" "navigationBarTitleText": "个人中心"
} }
}, },
{ {
@ -175,6 +178,7 @@
{ {
"path": "index", "path": "index",
"style": { "style": {
"navigationStyle": "custom",
"navigationBarTitleText": "数据统计" "navigationBarTitleText": "数据统计"
} }
}, },

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 自定义工作台头部 --> <!-- 自定义工作台头部 -->
<NavBar :count="state.count"></NavBar> <NavBar :count="state.count" :title="'工作台'"></NavBar>
<view <view
class="contaner" class="contaner"
:style="{ :style="{

View File

@ -17,7 +17,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.c-login-container { .c-login-container {
height: 80vh; height: 80vh;
margin-top: 10vh; margin-top: 20vh;
.logo { .logo {
text-align: center; text-align: center;
image { image {

View File

@ -1,4 +1,5 @@
<template> <template>
<NavBar :count="0" :title="'登陆'"></NavBar>
<LoginLayout> <LoginLayout>
<template #form-box> <template #form-box>
<u-form <u-form

View File

@ -1,42 +1,54 @@
<template> <template>
<view class="profile"> <NavBar :count="0" :title="'个人中心'"></NavBar>
<view> <Box>
<image class="bg" :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/bg.png`" /> <view class="profile">
</view> <view>
<view class="baseinfo"> <image
<view class="head"> class="bg"
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/user.png`" class="user"></image> :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/bg.png`"
<view> />
</view>
<view class="baseinfo">
<view class="head">
<image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/user.png`"
class="user"
></image>
<view> <view>
<text class="name">{{ profile.userName || "-" }}</text> <view>
</view> <text class="name">{{ profile.userName || "-" }}</text>
<view> </view>
<text class="company">{{ profile.factory_name || "-" }}</text> <view>
<text class="company">{{ profile.factory_name || "-" }}</text>
</view>
</view> </view>
</view> </view>
</view> <view class="content">
<view class="content"> <u-list :height="'130px'">
<u-list :height="'130px'"> <u-list-item v-for="(item, index) in list" :key="index">
<u-list-item v-for="(item, index) in list" :key="index"> <u-cell
<u-cell :title="item.name"
:title="item.name" arrow-direction="right"
arrow-direction="right" isLink
isLink :url="item.path"
:url="item.path" :border="false"
:border="false" @click="hanldeClick(item)"
@click="hanldeClick(item)" >
> <template #icon>
<template #icon> <view style="width: 40rpx">
<view style="width: 40rpx"> <image
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/${item.icon}`" /> :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/${item.icon}`"
</view> />
</template> </view>
</u-cell> </template>
</u-list-item> </u-cell>
</u-list> </u-list-item>
</u-list>
</view>
</view> </view>
</view> </view>
</view> </Box>
<TabBar></TabBar> <TabBar></TabBar>
<SmallModal <SmallModal
:title="'确认退出吗?'" :title="'确认退出吗?'"
@ -52,8 +64,10 @@
import { ProfileApi } from "@/services/index"; import { ProfileApi } from "@/services/index";
import { reactive } from "vue"; import { reactive } from "vue";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import TabBar from '@/components/TabBar/index.vue' import TabBar from "@/components/TabBar/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import Box from "@/components/Box/index.vue";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const handleModal = (v: boolean) => { const handleModal = (v: boolean) => {
@ -61,12 +75,12 @@ const handleModal = (v: boolean) => {
}; };
const handleOk = () => { const handleOk = () => {
ProfileApi.logOut().then((res: any) => { ProfileApi.logOut().then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
uni.reLaunch({ uni.reLaunch({
url: "/pagesLogin/login/index", // url: "/pagesLogin/login/index", //
}); });
} }
}); });
}; };
const store = useMemberStore(); const store = useMemberStore();
const profile = store.profile.userInfo; const profile = store.profile.userInfo;
@ -90,7 +104,7 @@ const list = reactive([
const hanldeClick = (item: any) => { const hanldeClick = (item: any) => {
if (item.name === "退出登录") { if (item.name === "退出登录") {
handleModal(true) handleModal(true);
} }
}; };
</script> </script>