From b0253dbba1524bb900a79bfbb6e41457b9b7995b Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Fri, 03 Nov 2023 11:17:47 +0800
Subject: [PATCH] 首页完善
---
pages/home/index.vue | 105 +++++++++++++++++-----------------
subPackage/user/role/index.vue | 18 ++++--
2 files changed, 65 insertions(+), 58 deletions(-)
diff --git a/pages/home/index.vue b/pages/home/index.vue
index cf9b420..26e48a1 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -11,10 +11,14 @@
<u-swiper :list="swiperList"></u-swiper>
</view>
<view class="" v-if="roleType != 1">
- <u-grid :border="false" col="4">
+ <u-grid :border="false" :col="roleType == 2?3:4">
<u-grid-item v-for="(i,k) in cellList" :key="k" @click.native="toPage(i)">
<u-icon :name="i.icon" :size="45"></u-icon>
<text class="f-26 mt-20">{{i.text}}</text>
+ </u-grid-item>
+ <u-grid-item @click.native="navTo()" v-if="roleType == 3">
+ <u-icon name="/static/icon/nav-04.png" width="90rpx" height="90rpx"></u-icon>
+ <text class="f-26 mt-20">租客上报</text>
</u-grid-item>
</u-grid>
@@ -71,7 +75,7 @@
</view>
</view>
- <view class="" v-if="roleType == 1 && jobList.length>0">
+ <view class="" v-if="roleType == 1">
<view class="caption">
<view class="flex a-i-c">
<view class="line"></view>
@@ -81,11 +85,10 @@
<u-grid :border="false" col="4">
<u-grid-item v-for="(item, index) in jobList" :index="index" :key="index"
:customStyle="{paddingTop:20+'rpx'}">
- <view class="grid-item flex f-d-c a-i-c" :style="{background:item.background}">
- <u-icon :name="item.imgUrl" width="60rpx" height="60rpx"></u-icon>
- <text class="grid-text f-24">{{item.title}}</text>
+ <view class="grid-item flex f-d-c a-i-c" :style="{background:item.style.background}">
+ <u-icon :name="item.icon" width="60rpx" height="60rpx"></u-icon>
+ <text class="grid-text f-24 mt-10">{{item.text}}</text>
</view>
-
</u-grid-item>
</u-grid>
</view>
@@ -184,29 +187,24 @@
text: "便民热线",
path:''
},
- {
- icon: "/static/icon/nav-04.png",
- text: "租客上报",
- path:'/subPackage/bs/views/zhsb'
- }
],
navList: [{
title: "物业",
name: "张三",
icon: "/static/icon/tel-green.png",
- bgImg: "/static/nav-bg-01.png"
+ bgImg: "/static/icon/nav-bg-01.png"
},
{
title: "综治网格",
name: "张三",
icon: "/static/icon/tel-orange.png",
- bgImg: "/static/nav-bg-02.png"
+ bgImg: "/static/icon/nav-bg-02.png"
},
{
title: "公安网格",
name: "张三",
icon: "/static/icon/tel-blue.png",
- bgImg: "/static/nav-bg-03.png"
+ bgImg: "/static/icon/nav-bg-03.png"
},
],
jobList: [{
@@ -232,7 +230,7 @@
},
{
icon: "/static/icon/menu-04.png",
- text: "出租房管理",
+ text: "标签事件",
style: {
background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
}
@@ -251,27 +249,27 @@
background: 'linear-gradient(137deg, #FFF4F3 0%, rgba(255,244,243,0) 100%)',
}
},
- {
- icon: "/static/icon/menu-07.png",
- text: "校园安全",
- style: {
- background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
- }
- },
- {
- icon: "/static/icon/menu-08.png",
- text: "旅馆安全",
- style: {
- background: 'linear-gradient(131deg, #FCF8FF 0%, rgba(252,248,255,0) 100%)',
- }
- },
- {
- icon: "/static/icon/menu-09.png",
- text: "取保候审",
- style: {
- background: 'linear-gradient(137deg, #FFF4F3 0%, rgba(255,244,243,0) 100%)',
- }
- },
+ // {
+ // icon: "/static/icon/menu-07.png",
+ // text: "校园安全",
+ // style: {
+ // background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ // }
+ // },
+ // {
+ // icon: "/static/icon/menu-08.png",
+ // text: "旅馆安全",
+ // style: {
+ // background: 'linear-gradient(131deg, #FCF8FF 0%, rgba(252,248,255,0) 100%)',
+ // }
+ // },
+ // {
+ // icon: "/static/icon/menu-09.png",
+ // text: "取保候审",
+ // style: {
+ // background: 'linear-gradient(137deg, #FFF4F3 0%, rgba(255,244,243,0) 100%)',
+ // }
+ // },
],
taskList: [{
icon: "/static/icon/cell-01.png",
@@ -299,17 +297,16 @@
title: '-',
useSlot: true
}],
- jobList:[],
menuList:[]
}
},
onLoad() {
- console.log(uni.getStorageSync("activeRole"))
-
- },
- onShow() {
this.init()
+ uni.$on('refresh',()=>{
+ console.log("<====>")
+ this.init()
+ })
},
computed: {
hasMenu() {
@@ -358,21 +355,19 @@
this.roleType = 3
this.roleTypeName = "居民"
}
-
const res = await getFuncList(type, roleName)
console.log(res, "-----------")
let data = res.data
this.siteColumns = []
-
this.buildSiteColumn(data, 0)
- console.log(this.siteColumns)
-
},
buildSiteColumn(dataList, index) {
if (dataList.length > 0) {
this.siteColumns[index] = dataList
if (dataList[0].children && dataList[0].children.length > 0) {
+ this.curSelectSite = dataList[0].children[0];
+ this.getHouseDataList(dataList[0].children[0].id)
this.buildSiteColumn(dataList[0].children, index + 1)
}
}
@@ -419,6 +414,7 @@
this.curSelectSite = e.value[e.value.length - 1]
this.selectBoxShow = false
this.getHouseDataList(e.value[1].id)
+ console.log("curSite=>",this.curSelectSite);
},
getMenu(menuName, menuList, resultArr) {
// console.log(menuList, menuName)
@@ -478,7 +474,7 @@
//获取工作台菜单
getWorkbenchList() {
- this.jobList = []
+ // this.jobList = []
const resultArr = this.hasMenu('工作台')
if (resultArr.length == 0) {
return
@@ -486,12 +482,12 @@
const topMenu = resultArr[0]
- topMenu.children.forEach(menu => {
- this.jobList.push({
- imgUrl: menu.source,
- title: menu.name,
- })
- })
+ // topMenu.children.forEach(menu => {
+ // this.jobList.push({
+ // imgUrl: menu.source,
+ // title: menu.name,
+ // })
+ // })
},
// 页面跳转
@@ -509,6 +505,11 @@
if (id !== void 0) {
}
+ },
+
+
+ navTo(){
+ this.$u.func.globalNavigator("/subPackage/bs/views/zhsb", "navTo")
}
}
diff --git a/subPackage/user/role/index.vue b/subPackage/user/role/index.vue
index e6ee920..1b66bac 100644
--- a/subPackage/user/role/index.vue
+++ b/subPackage/user/role/index.vue
@@ -86,6 +86,7 @@
icon: "success",
duration: data.duration || 1500,
success: () => {
+ uni.$emit("refresh")
setTimeout(() => {
this.$u.func.globalNavigator("/pages/home/index", "switchTab")
}, data.duration || 1500)
@@ -108,11 +109,16 @@
flex-direction: column;
background: #F9F9FA;
- .cur-btn {
- margin: 0 20rpx;
- position: absolute;
- bottom: 28rpx;
- width: calc(100% - 40rpx);
- }
+
+ }
+ .cur-btn {
+ width: 100%;
+ padding:20rpx;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ box-sizing: border-box;
+ z-index: 10;
+
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3