From 8d8ae4c1189baadd5b8267a9643af674bd4786c0 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Tue, 19 Mar 2024 11:50:49 +0800
Subject: [PATCH] 更新
---
pages/user/center.vue | 8 ++++++--
pages/statistics/index.vue | 10 +++++-----
pages/home/index.vue | 19 ++++++++++++-------
components/tabBar/tabBar.vue | 8 ++++----
static/img/block-bg.png | 0
5 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/components/tabBar/tabBar.vue b/components/tabBar/tabBar.vue
index 0690421..1f140bb 100644
--- a/components/tabBar/tabBar.vue
+++ b/components/tabBar/tabBar.vue
@@ -1,9 +1,9 @@
<template>
<view>
- <u-tabbar class="custom-tabbar" zIndex="100" :value="current" :fixed="true" :active-color="activeColor"
+ <u-tabbar class="custom-tabbar" zIndex="9999" :value="current" :fixed="true" :active-color="activeColor"
:inactive-color="inactiveColor">
- <u-tabbar-item :text="item.name" @click="changeTabbar(item.url,index)" v-for="(item,index) in tabbarList"
- :key="index">
+ <u-tabbar-item :text="item.name" @click="changeTabbar(item.url,index,item.name)"
+ v-for="(item,index) in tabbarList" :key="index">
<image class="tabbar-icon" slot="active-icon" :src="item.iconPathSelected"></image>
<image class="tabbar-icon" slot="inactive-icon" :src="item.iconPath"></image>
</u-tabbar-item>
@@ -45,7 +45,7 @@
uni.switchTab({
url
})
- this.$emit("change", index)
+ this.$emit("change", name)
}
}
}
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 6e8b27c..91224cd 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -65,10 +65,10 @@
<view class="block flex a-i-c j-c-s-b mb-20" v-if="roleType == 3">
- <view @click="scan" class="block-item"
- style="width:47%; background:linear-gradient( #00176C 0%, rgba(1,97,203,0.2) 99%)">
- <!-- <image class="block-item-bg" src="/static/icon/nav-bg-04.png" mode="aspectFill"
- style="width:100%;" /> -->
+ <view @click="scan" class="block-item">
+ <!-- <image class="block-item-bg" src="/static/img/block-bg.png" mode="aspectFill"
+ style="width:390rpx; height:227rpx;" /> -->
+
<view class="block-item-box flex a-i-c j-c-c " style="width:100%;">
<u-icon name="/static/icon/nav-05.png" width="72rpx" height="72rpx"></u-icon>
<view class="item-text flex f-d-c j-c-s-b" style="margin-left: 20rpx;">
@@ -80,7 +80,7 @@
<view class="block-item" @click="navigatorPage('/subPackage/task/index')"
style="width:47%;background:linear-gradient( #00176C 0%, rgba(1,97,203,0.2) 99%)">
- <!-- <image class="block-item-bg" src="/static/icon/nav-bg-04.png" mode="aspectFill"
+ <!-- <image class="block-item-bg" src="/static/img/block-bg.png" mode="aspectFill"
style="width:100%;" /> -->
<view class="block-item-box flex a-i-c j-c-c" style="width:100%;">
<u-icon name="/static/icon/nav-12.png" width="72rpx" height="72rpx"></u-icon>
@@ -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" :list="tabList" />
+ <tabBar :current="0" :list="tabList" @change="changeTabbar" />
</view>
</template>
@@ -623,6 +623,11 @@
// });
// },
+ changeTabbar() {
+ uni.$emit('refreshStatistics')
+ },
+
+
//获取待办事项数量
getTaskCount() {
@@ -661,7 +666,7 @@
this.getBanner();
this.getSiteList()
this.getNoticeList()
- this.getTaskCount();
+ // this.getTaskCount();
},
getBanner() {
diff --git a/pages/statistics/index.vue b/pages/statistics/index.vue
index 3d726bc..2dd0c3d 100644
--- a/pages/statistics/index.vue
+++ b/pages/statistics/index.vue
@@ -260,6 +260,7 @@
tabList: []
}
},
+
// onTabItemTap(e) {
// // tab 点击时执行,此处直接接收单击事件
// console.log(e)
@@ -267,15 +268,14 @@
// },
onLoad() {
this.tabList = getTabbarList(2);
- },
-
-
- onShow() {
this.refreshData();
+ // uni.$on('refreshStatistics', () => {
+ // this.refreshData();
+ // })
},
+
methods: {
-
changeTabbar(e) {
console.log("==>", e)
// this.refreshData();
diff --git a/pages/user/center.vue b/pages/user/center.vue
index dd59f5e..11101cf 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -67,7 +67,7 @@
</u-cell>
</u-cell-group>
</view>
- <tabBar :current="2" :list="tabList" />
+ <tabBar :current="2" :list="tabList" @change="changeTabbar" />
</view>
</template>
@@ -110,7 +110,7 @@
onShow() {
// this.getUserInfo();
let role = uni.getStorageSync('activeRole')
- if (role.roleAlias == "inhabitant") {
+ if (role.roleName == "居民") {
this.tabList = getTabbarList(1);
this.roleType = 1
} else {
@@ -126,6 +126,10 @@
},
methods: {
+ changeTabbar() {
+ uni.$emit('refreshStatistics')
+ },
+
setAvatar(avatar) {
return `${minioBaseUrl}${avatar}`
},
diff --git a/static/img/block-bg.png b/static/img/block-bg.png
new file mode 100644
index 0000000..53b27c3
--- /dev/null
+++ b/static/img/block-bg.png
Binary files differ
--
Gitblit v1.9.3