Lou
2024-03-19 17ddcaf59d85194b7f73b601a907ead24d696baf
更新
4 files modified
3 files added
138 ■■■■ changed files
common/common.js 2 ●●● patch | view | raw | blame | history
components/tabBar/tabBar.vue 2 ●●● patch | view | raw | blame | history
pages/home/index.vue 6 ●●●●● patch | view | raw | blame | history
pages/user/center.vue 128 ●●●● patch | view | raw | blame | history
static/icon/menu-center-05.png patch | view | raw | blame | history
static/icon/menu-center-06.png patch | view | raw | blame | history
static/img/center-bg-2.png patch | view | raw | blame | history
common/common.js
@@ -96,7 +96,7 @@
}
export const getTabbarList = (roleType) => {
export const getTabbarList = (roleType = 1) => {
    if (roleType == 2) {
        return [{
                name: '首页',
components/tabBar/tabBar.vue
@@ -55,7 +55,7 @@
                uni.switchTab({
                    url
                })
                this.$emit("change", name)
                this.$emit("change", index)
            }
        }
    }
pages/home/index.vue
@@ -266,7 +266,7 @@
                @close="selectBoxShow = false" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
                @confirm="confirmSite" @change="changeSite" @cancel="selectBoxShow = false"></u-picker>
        </view>
        <tabBar :current="0" :list="tabList" @change="changeTabbar" />
        <tabBar :current="0" :list="tabList" />
    </view>
</template>
@@ -626,9 +626,7 @@
            //     });
            // },
            changeTabbar() {
                uni.$emit('refreshStatistics')
            },
pages/user/center.vue
@@ -1,7 +1,8 @@
<template>
    <view class="container">
        <view class="head">
            <image src="/static/img/center-bg.png" class="head-bg" />
            <image src="/static/img/center-bg.png" class="head-bg" v-if="roleType == 1" />
            <image src="/static/img/center-bg-2.png" class="head-bg" v-if="roleType == 2" />
            <!-- 用户信息 -->
            <view class="user-box">
                <view class="left">
@@ -36,49 +37,50 @@
                </navigator>
            </view>
        </view>
        <view class="cell-box" v-if="isLogin">
            <u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}">
                <u-cell v-if="roleType == 1" title="切换角色" isLink url="/subPackage/user/role/index">
                    <image slot="icon" src="/static/icon/menu-center-02.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="roleType == 2" title="切换角色" isLink url="/subPackage/user/role/index">
                    <image slot="icon" src="/static/icon/menu-center-05.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="siteInfo.addressType == 1" title="我的事件" isLink
                    url="/subPackage/bs/views/repairList?from=center">
                    <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="siteInfo.addressType == 2" title="我的事件" isLink url="/subPackage/user/event/event">
                    <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="roleType == 1" title="我的评价" isLink url="/subPackage/user/commentList/evaluateList">
                    <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="roleType == 1" title="我的评论" isLink url="/subPackage/user/commentList/commentList">
                    <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="roleType == 1" title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
                    <image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image>
                </u-cell>
                <u-cell v-if="roleType == 2" title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
                    <image slot="icon" src="/static/icon/menu-center-06.png" class="icon" mode=""></image>
                </u-cell>
        <view class="main">
            <view class="cell-box" v-if="isLogin">
                <u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}">
                    <u-cell title="切换角色" isLink url="/subPackage/user/role/index" :border="false">
                        <image slot="icon" src="/static/icon/menu-center-02.png" class="icon" mode=""></image>
                    </u-cell>
                    <u-cell v-if="siteInfo.addressType == 1" title="我的事件" isLink
                        url="/subPackage/bs/views/repairList?from=center" :border="false">
                        <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                    </u-cell>
                    <u-cell v-if="siteInfo.addressType == 2" title="我的事件" :border="false" isLink
                        url="/subPackage/user/event/event">
                        <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                    </u-cell>
                    <u-cell v-if="roleType == 1" :border="false" title="我的评价" isLink
                        url="/subPackage/user/commentList/evaluateList">
                        <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                    </u-cell>
                    <u-cell v-if="roleType == 1" :border="false" title="我的评论" isLink
                        url="/subPackage/user/commentList/commentList">
                        <image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
                    </u-cell>
                    <u-cell title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
                        <image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image>
                    </u-cell>
            </u-cell-group>
        </view>
        <!-- <view class="cell-box" v-if="isLogin">
            <u-cell-group :border="false">
                <u-cell title="退出登录" :border="false" @click="logOut" isLink>
                    <image slot="icon" src="/static/icon/menu-center-04.png" class="icon" mode=""></image>
                </u-cell>
            </u-cell-group>
        </view> -->
                </u-cell-group>
            </view>
            <!-- <view class="cell-box" v-if="isLogin">
                <u-cell-group :border="false">
                    <u-cell title="退出登录" :border="false" @click="logOut" isLink>
                        <image slot="icon" src="/static/icon/menu-center-04.png" class="icon" mode=""></image>
                    </u-cell>
                </u-cell-group>
            </view> -->
        <view class="exit-btn" @click="logOut" :style="{color:color}">
            退出登录
        </view>
        <tabBar :current="2" :list="tabList" @change="changeTabbar" />
        <tabBar :current="2" :list="tabbarList" />
    </view>
</template>
@@ -92,7 +94,7 @@
    import tabBar from "@/components/tabBar/tabBar.vue"
    import {
        getTabbarList
    } from "@/common/common.js"
    } from "@/common/common.js";
    export default {
        components: {
            tabBar
@@ -114,7 +116,8 @@
                roleType: 1,
                addressType: 1,
                user_info: {},
                tabList: []
                color: "#017BFC",
                tabbarList: []
            };
        },
@@ -122,11 +125,14 @@
            // this.getUserInfo();
            let role = uni.getStorageSync('activeRole')
            if (role.roleName == "居民") {
                this.tabList = getTabbarList(1);
                this.tabbarList = getTabbarList(1)
                this.roleType = 1
                this.color = "#017BFC"
            } else {
                this.tabList = getTabbarList(2);
                this.tabbarList = getTabbarList(2)
                this.roleType = 2;
                this.color = "#003399"
            }
            this.addressType = uni.getStorageSync("siteInfo").addressType;
        },
@@ -136,10 +142,6 @@
        },
        methods: {
            changeTabbar() {
                uni.$emit('refreshStatistics')
            },
            setAvatar(avatar) {
                return `${minioBaseUrl}${avatar}`
@@ -213,8 +215,7 @@
<style lang="scss">
    .container {
        background-color: #fff;
        // background-color: #f7f7f7;
        background-color: #f7f7f7;
        min-height: 100vh;
        overflow: hidden;
    }
@@ -349,25 +350,14 @@
        }
    }
    .main {
        border-radius: 30rpx 30rpx 0 0;
        position: relative;
        top: -40rpx;
        z-index: 10;
        padding: 30rpx 30rpx 0;
        background-color: #fff;
    }
    .cell-box {
        // background: #ffffff;
        // margin: 18rpx;
        border-radius: 20rpx;
        box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(107, 134, 159, 0.2);
        background: #ffffff;
        margin: 18rpx;
        .icon {
            width: 52rpx;
            height: 52rpx;
            margin-right: 12rpx;
            margin-right: 22rpx;
        }
    }
@@ -377,4 +367,16 @@
        font-weight: 500;
        color: #585b61;
    }
    .exit-btn {
        width: 690rpx;
        height: 80rpx;
        line-height: 80rpx;
        border-radius: 16rpx;
        border: 1px solid currentColor;
        text-align: center;
        position: fixed;
        bottom: 150rpx;
        left: calc((100% - 690rpx)/2);
    }
</style>
static/icon/menu-center-05.png
static/icon/menu-center-06.png
static/img/center-bg-2.png