From bd476fa5a61e9f827c90404807f3dc539546f96a Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Mon, 18 Mar 2024 19:47:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
pages/user/center.vue | 5 ++
pages/statistics/index.vue | 6 ++-
pages/home/index.vue | 2
pages.json | 2
components/tabBar/tabBar.vue | 80 ++++++++++++++++++++++++++++-----------
5 files changed, 68 insertions(+), 27 deletions(-)
diff --git a/components/tabBar/tabBar.vue b/components/tabBar/tabBar.vue
index 9c7932a..bb71941 100644
--- a/components/tabBar/tabBar.vue
+++ b/components/tabBar/tabBar.vue
@@ -1,22 +1,22 @@
<template>
<view>
<u-tabbar class="custom-tabbar" zIndex="100" :value="current" :fixed="true" :active-color="activeColor"
- :inactive-color="inactiveColor" @change='change'>
- <u-tabbar-item v-for="(item,index) in curTabList" :icon="item.icon" :key="index" :text="item.name">
- <image class="tabbar-icon" slot="active-icon" :src="iconPathSelected"></image>
- <image class="tabbar-icon" slot="inactive-icon" :src="iconPath"></image>
+ :inactive-color="inactiveColor">
+ <u-tabbar-item text="首页" @click="changeTabbar('/pages/home/index')">
+ <image class="tabbar-icon" slot="active-icon" src="/static/img/tabbar-01-selected.png"></image>
+ <image class="tabbar-icon" slot="inactive-icon" src="/static/img/tabbar-01.png"></image>
</u-tabbar-item>
- <u-tabbar-item v-for="(item,index) in curTabList" :icon="item.icon" :key="index" :text="item.name">
- <image class="tabbar-icon" slot="active-icon" :src="iconPathSelected"></image>
- <image class="tabbar-icon" slot="inactive-icon" :src="iconPath"></image>
+ <!-- <u-tabbar-item text="圈子">
+ <image class="tabbar-icon" slot="active-icon" src="/static/img/tabbar-02-selected.png"></image>
+ <image class="tabbar-icon" slot="inactive-icon" src="/static/img/tabbar-02.png"></image>
+ </u-tabbar-item> -->
+ <u-tabbar-item text="驾驶舱" v-if="roleType == 2" @click="changeTabbar('/pages/statistics/index')">
+ <image class="tabbar-icon" slot="active-icon" src="/static/img/tabbar-02-selected.png"></image>
+ <image class="tabbar-icon" slot="inactive-icon" src="/static/img/tabbar-02.png"></image>
</u-tabbar-item>
- <u-tabbar-item text="驾驶舱">
- <image class="tabbar-icon" slot="active-icon" :src="iconPathSelected"></image>
- <image class="tabbar-icon" slot="inactive-icon" :src="iconPath"></image>
- </u-tabbar-item>
- <u-tabbar-item text="个人中心">
- <image class="tabbar-icon" slot="active-icon" :src="iconPathSelected"></image>
- <image class="tabbar-icon" slot="inactive-icon" :src="iconPath"></image>
+ <u-tabbar-item text="个人中心" @click="changeTabbar('/pages/user/center')">
+ <image class="tabbar-icon" slot="active-icon" src="/static/img/tabbar-03-selected.png"></image>
+ <image class="tabbar-icon" slot="inactive-icon" src="/static/img/tabbar-03.png"></image>
</u-tabbar-item>
</u-tabbar>
</view>
@@ -26,12 +26,15 @@
export default {
props: {
current: Number,
+ isShowTabbarItem: false
},
data() {
return {
+
+ roleType: "",
+ curRole: {},
inactiveColor: '#909399',
activeColor: '#328CFA',
-
curTabList: [{
name: '首页',
@@ -43,15 +46,15 @@
{
name: '圈子',
- iconPathSelected: 'static/img/tabbar-02-selected.png',
- iconPath: 'static/img/tabbar-02.png',
+ iconPathSelected: '/static/img/tabbar-02-selected.png',
+ iconPath: '/static/img/tabbar-02.png',
// icon: "home",
url: '/pages/home/index'
},
{
name: '驾驶舱',
- iconPathSelected: 'static/img/tabbar-02-selected.png',
- iconPath: 'static/img/tabbar-02.png',
+ iconPathSelected: '/static/img/tabbar-02-selected.png',
+ iconPath: '/static/img/tabbar-02.png',
// icon: "home",
url: '/pages/statistics/index'
},
@@ -68,6 +71,17 @@
}
},
watch: {
+ 'curRole.roleName': {
+ handler(newVal) {
+ if (newVal == "民警") {
+ this.roleType == 2
+ }
+ },
+ deep: true,
+ immediate: true
+ },
+
+
tabList: {
handler(newVal) {
if (newVal && newVal.length > 0) {
@@ -84,17 +98,37 @@
deep: true,
immediate: true
},
+ isShowTabbarItem: {
+ deep: true,
+ immediate: true
+ }
},
mounted() {
+
+ this.curRole = uni.getStorageSync("activeRole");
+
// this.getMessage()
},
destroyed() {
},
methods: {
+
+
+ changeTabbar(url) {
+ uni.reLaunch({
+ url
+ })
+ },
+
+
change(e) {
- uni.switchTab({
- url: '/' + this.curTabList[e].path
+ console.log(e);
+ uni.reLaunch({
+ url: this.curTabList[e].url,
+ complete: (res) => {
+ console.log("===>", res);
+ }
})
// this.$emit("change", this.curTabList[e].url)
},
@@ -105,7 +139,7 @@
<style lang="scss" scoped>
.tabbar-icon {
- width: 40rpx;
- height: 40rpx;
+ width: 45rpx;
+ height: 45rpx;
}
</style>
\ No newline at end of file
diff --git a/pages.json b/pages.json
index d58ab73..931f303 100644
--- a/pages.json
+++ b/pages.json
@@ -931,7 +931,7 @@
"backgroundColor": "#4586FE"
},
"tabBar": {
- // "custom": true,
+ "custom": true,
"color": "#AFB8C3",
"selectedColor": "#5086FA",
"borderStyle": "white",
diff --git a/pages/home/index.vue b/pages/home/index.vue
index cb36b1a..24a3455 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -263,7 +263,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" /> -->
+ <tabBar :current="0" :isShowTabbarItem="roleType == 3?true:false" />
</view>
</template>
diff --git a/pages/statistics/index.vue b/pages/statistics/index.vue
index af1a595..a2f24f3 100644
--- a/pages/statistics/index.vue
+++ b/pages/statistics/index.vue
@@ -163,16 +163,18 @@
</view>
</view>
-
+ <tabBar :current="1" />
</view>
</template>
<script>
import captionRow from "@/components/caption/caption.vue"
import * as statisticsModal from "@/api/statistics/statistics.js"
+ import tabBar from "@/components/tabBar/tabBar.vue"
export default {
components: {
- captionRow
+ captionRow,
+ tabBar
},
data() {
return {
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 866484b..d1a8885 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -67,6 +67,7 @@
</u-cell>
</u-cell-group>
</view>
+ <tabBar :current="2" />
</view>
</template>
@@ -77,7 +78,11 @@
import {
minioBaseUrl
} from "@/common/setting.js"
+ import tabBar from "@/components/tabBar/tabBar.vue"
export default {
+ components: {
+ tabBar
+ },
data() {
return {
headHeight: 582,
--
Gitblit v1.9.3