# Conflicts:
#	wuye-manager-uniapp/pages/index/index.vue
This commit is contained in:
Zy
2026-05-20 09:20:48 +08:00
18 changed files with 455 additions and 352 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="guide-page">
<view class="status_bar"></view>
<view class="status-bar"></view>
<!-- 引导内容滑动容器 -->
<swiper
class="guide-swiper"
@@ -8,47 +8,50 @@
@change="handleSwiperChange"
:disable-scroll="false"
:indicator-dots="false"
:mode="mode"
:mode="mode"
>
<!-- 便捷服务 -->
<swiper-item>
<view class="guide-item">
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide1.png" style="width: 100%;height: 100%;"></image>
</view>
<view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">精准服务</view>
<view class="guide-subtitle">需求深度洞察,资源优化配置</view>
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide1.png" mode="aspectFit" class="img-content"></image>
</view>
<view class="guide-text">
<view class="guide-title">精准服务</view>
<view class="guide-subtitle">需求深度洞察,资源优化配置</view>
</view>
</view>
</swiper-item>
<!-- 高效管理 -->
<swiper-item>
<view class="guide-item">
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide2.png" style="width: 100%;height: 100%;"></image>
</view>
<view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">高效沟通</view>
<view class="guide-subtitle">反馈即时响应,流程无缝衔接</view>
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide2.png" mode="aspectFit" class="img-content"></image>
</view>
<view class="guide-text">
<view class="guide-title">高效沟通</view>
<view class="guide-subtitle">反馈即时响应,流程无缝衔接</view>
</view>
</view>
</swiper-item>
<!--安全保障 -->
<swiper-item>
<view class="guide-item">
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide3.png" style="width: 100%;height: 100%;"></image>
</view>
<view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">智能管理</view>
<view class="guide-subtitle">数据驱动决策,风险提前预警</view>
<view class="guide-img">
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide3.png" mode="aspectFit" class="img-content"></image>
</view>
<view class="guide-text">
<view class="guide-title">智能管理</view>
<view class="guide-subtitle">数据驱动决策,风险提前预警</view>
</view>
</view>
</swiper-item>
</swiper>
<!-- 进度点 -->
<view class="progress-dots">
<view class="progress-dots">
<view class="dot" :class="{ active: currentStep === 0 }"></view>
<view class="dot" :class="{ active: currentStep === 1 }"></view>
<view class="dot" :class="{ active: currentStep === 2 }"></view>
@@ -91,9 +94,9 @@ const handleBtnClick = () => {
// 1. 记录引导已完成
uni.setStorageSync('hasShowGuide', true);
// 2. 跳转首页
uni.navigateTo({
url:"/pageSubPack/loginSub/pwd-login"
})
uni.navigateTo({
url: "/pageSubPack/loginSub/pwd-login"
})
// uni.switchTab({
// url: '/pages/index/index'
// });
@@ -106,40 +109,61 @@ const handleBtnClick = () => {
.guide-page {
width: 100%;
height: 100vh;
/* background-color: #f8f9ff; */
background: linear-gradient(to bottom, #E2F0FF, #F6FAFF);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 120rpx 40rpx 80rpx;
box-sizing: border-box;
}
.status_bar {
height: 140px;
width: 100%;
}
/* 状态栏 - 自适应设备状态栏高度 */
.status-bar {
height: var(--status-bar-height);
width: 100%;
flex-shrink: 0;
}
/* 滑动容器 */
.guide-swiper {
flex: 1;
width: 100%;
}
/* 单个引导项 */
/* 单个引导项 - 全屏自适应 */
.guide-item {
width: 360px;
height: 480px;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0 60rpx;
box-sizing: border-box;
}
/* 图片区域 - 自适应 */
.guide-img {
width: 77%;
height: 50%;
margin-bottom: 80rpx;
width: 80%;
max-width: 600rpx;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 40rpx;
}
.img-content {
width: 100%;
height: 100%;
max-height: 50vh;
}
/* 文字区域 */
.guide-text {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40rpx;
}
/* 引导标题 */
@@ -161,7 +185,8 @@ const handleBtnClick = () => {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 60rpx;
margin-bottom: 40rpx;
flex-shrink: 0;
}
/* 单个进度点 */
@@ -171,6 +196,7 @@ const handleBtnClick = () => {
border-radius: 8rpx;
background-color: #ddd;
margin: 0 8rpx;
transition: all 0.3s ease;
}
/* 激活的进度点 */
@@ -182,6 +208,9 @@ const handleBtnClick = () => {
/* 按钮容器 */
.guide-btn-wrap {
width: 80%;
max-width: 600rpx;
margin-bottom: 80rpx;
flex-shrink: 0;
}
/* 引导按钮 */
@@ -210,7 +239,7 @@ const handleBtnClick = () => {
border: none;
}
/* 按钮禁用态 */
/* 按钮禁用态(可选) */
.guide-btn:disabled {
background-color: #ccc;
color: #fff;

View File

@@ -2,7 +2,7 @@
<view class="content-class">
<view class="nar-top">
<!-- 这里是状态栏占位 -->
<view class="status_bar"></view>
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- 导航栏 -->
<view class="nav-bar">
<text class="nav-title">首页</text>
@@ -45,7 +45,7 @@
<swiper class="swiper-box" :current="current" autoplay>
<swiper-item v-for="(item, index) in bannerList" :key="index">
<view class="swiper-item">
<image :src="item.img" style="width: 100%; height: 100%"></image>
<image :src="item.url" style="width: 100%; height: 100%"></image>
</view>
</swiper-item>
</swiper>
@@ -84,7 +84,7 @@
<!-- 巡检数据统计区 -->
<view class="statistics-wrap">
<view class="statistics-item" @click="goToInspectionRecord">
<text class="num">{{ totalTasks }}</text>
<text class="num">{{ allCount }}</text>
<text class="label">全部巡检</text>
</view>
<view class="statistics-item" @click="goToDaysInspection">
@@ -153,16 +153,18 @@
<script setup>
import { ref } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getCurrentVillage, getTodayInspection, getNewNoticeData } from '../../api/api.js'
import { getCurrentVillage,getTodayInspection,getNewNoticeData,getBannarList} from '../../api/api.js'
// 列表数据状态
const current = ref(0)
const currentCommunity = ref('请选择小区')
const bannerList = ref([{ img: 'https://wuyeadmin.bugtc.com/images/imgs/banner1.png' }])
const bannerList = ref([])
const noticeText = ref('暂无公告')
const totalTasks = ref(0) // 全部巡检
const allCount = ref(0) // 全部巡检
const pendingCount = ref(0) //待巡检
const InspectedCount = ref(0) //已巡检
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
// =======方法=======
// 跳转小区
@@ -240,19 +242,17 @@ const currentVillageData = () => {
.catch(() => {})
}
// 获取今日巡检数据
const getInspectionData = () => {
getTodayInspection()
.then(res => {
if (res.code === 200) {
if (res.data) {
totalTasks.value = res.data.totalTasks
pendingCount.value = res.data.unfinishedTasks
InspectedCount.value = res.data.completedTasks
} else {
totalTasks.value = 0
pendingCount.value = 0
InspectedCount.value = 0
}
const getInspectionData = () =>{
getTodayInspection().then(res =>{
if(res.code === 200){
if(res.data){
allCount.value = res.data.totalTasks
pendingCount.value = res.data.unfinishedTasks
InspectedCount.value = res.data.completedTasks
}else{
allCount.value = 0
pendingCount.value = 0
InspectedCount.value = 0
}
})
.catch(err => {
@@ -271,6 +271,16 @@ const getNoticeData = () => {
})
.catch(() => {})
}
// 获取bannar图
function getbannarData(){
getBannarList().then(res => {
if (res.code === 200 && res.data) {
bannerList.value = res.data
}else{
bannerList.value = []
}
}).catch(() => {})
}
// 接收选择小区返回的参数
const slelctHomeData = data => {
@@ -285,6 +295,7 @@ onLoad(() => {
// 优先调用接口获取当前小区,失败时再读缓存
currentVillageData()
getInspectionData()
getbannarData()
})
onUnload(() => {
@@ -311,8 +322,8 @@ const clickItem = index => {
}
.status_bar {
height: 46px;
width: 100%;
flex-shrink: 0;
}
/* 导航栏 */
@@ -323,7 +334,7 @@ const clickItem = index => {
}
.nav-title {
font-size: 14px;
font-size: 32rpx;
font-weight: 400;
}

View File

@@ -1,14 +1,12 @@
<template>
<view class="contentStyle" style="">
<view class="status-bar"></view>
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false"> </uni-nav-bar>
<scroll-view class="page" scroll-y>
<view class="topBox">
<view class="name">
<image :src="avatar" class="img" />
<span
style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx"
>
<span style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx">
<span style="font-size: 36rpx; font-weight: 600">
{{ loginName }}
</span>
@@ -21,20 +19,10 @@
<view class="contentBox">
<div class="page-container">
<view class="list-container">
<view
class="list-item"
v-for="(item, index) in list"
:key="index"
@click="onItemClick(item)"
>
<view class="list-item" v-for="(item, index) in list" :key="index" @click="onItemClick(item)">
<image :src="item.icon" class="item-icon" />
<view class="item-content">
<text class="item-title">{{ item.title }}</text>
<span class="item-desc" v-if="item.desc"
><span style="align-self: flex-end; font-size: 24rpx; vertical-align: baseline">{{
item.desc
}}</span></span
>
</view>
<view class="item-arrow"></view>
<!-- <image src="https://wuyeadmin.bugtc.com/images/propertyImgs/arrow-right.png" class="arrow-icon" /> -->
@@ -46,193 +34,203 @@
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getSettingInfo } from '../../api/api.js'
import {
ref
} from 'vue'
import {
onShow
} from '@dcloudio/uni-app'
import {
getSettingInfo
} from '../../api/api.js'
const list = ref([
{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png',
title: '上报记录'
},
{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '巡检记录'
// desc: "您可以在这里添加家人、朋友、租客~"
},
{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '仪表换新'
// desc: "您可以在这里添加家人、朋友、租客~"
},
{
icon: 'https://wuyeadmin.bugtc.com/images/propertyImgs/setting.png',
title: '设置'
}
])
const loginName = ref('')
const phoneNum = ref('')
const avatar = ref('')
// 获取管家信息
const fetchUserInfo = () => {
getSettingInfo().then(res => {
if (res.code === 200 && res.data) {
loginName.value = res.data.nickName || ''
phoneNum.value = res.data.phonenumber || ''
avatar.value = res.data.avatar
const list = ref([{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png',
title: '上报记录'
},
{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '巡检记录'
},
{
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '仪表换新'
},
{
icon: 'https://wuyeadmin.bugtc.com/images/propertyImgs/setting.png',
title: '设置'
}
}).catch(err =>{
uni.showToast({
title:err.msg || '获取失败',
icon: 'error'
})
})
}
])
const loginName = ref('')
const phoneNum = ref('')
const avatar = ref('')
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
onShow(() => {
fetchUserInfo()
})
// --方法----
const goToDetail = () => {
uni.navigateTo({
url: '/pageSubPack/notice-list/noticeListDetails'
})
}
// 返回
const onItemClick = item => {
if (item.title == '上报记录') {
uni.navigateTo({
url: '/pageSubPack/report-record/report-record'
})
} else if (item.title == '巡检记录') {
uni.navigateTo({
url: '/pageSubPack/inspection/inspection_record'
})
} else if (item.title == '仪表换新') {
uni.navigateTo({
url: '/pageSubPack/instrument/replacement_record'
})
} else if (item.title == '设置') {
uni.redirectTo({
url: '/pageSubPack/setting/setting'
// 获取管家信息
const fetchUserInfo = () => {
getSettingInfo().then(res => {
if (res.code === 200 && res.data) {
loginName.value = res.data.nickName || ''
phoneNum.value = res.data.phonenumber || ''
avatar.value = res.data.avatar
}
}).catch(err => {
uni.showToast({
title: err.msg || '获取失败',
icon: 'none'
})
})
}
}
onShow(() => {
fetchUserInfo()
})
// --方法----
const goToDetail = () => {
uni.navigateTo({
url: '/pageSubPack/notice-list/noticeListDetails'
})
}
// 返回
const onItemClick = item => {
if (item.title == '上报记录') {
uni.navigateTo({
url: '/pageSubPack/report-record/report-record'
})
} else if (item.title == '巡检记录') {
uni.navigateTo({
url: '/pageSubPack/inspection/inspection_record'
})
} else if (item.title == '仪表换新') {
uni.navigateTo({
url: '/pageSubPack/instrument/replacement_record'
})
} else if (item.title == '设置') {
uni.redirectTo({
url: '/pageSubPack/setting/setting'
})
}
}
</script>
<style lang="scss" scoped>
.contentStyle {
display: flex;
flex-direction: column;
min-height: 100vh;
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
}
.topBox {
width: 100%;
padding: 20rpx 0px;
position: relative;
// background-color: #1A75FF;
}
.titleBox {
width: 100%;
position: relative;
.title {
font-size: 36rpx;
line-height: 80rpx;
text-align: center;
font-weight: 500;
.contentStyle {
display: flex;
flex-direction: column;
min-height: 100vh;
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
}
.settingImg {
width: 48rpx;
height: 48rpx;
top: 16rpx;
right: 0px;
.topBox {
width: 100%;
padding: 20rpx 0px;
position: relative;
// background-color: #1A75FF;
}
}
.img {
width: 60px;
height: 60px;
margin-right: 10rpx;
border-radius: 50%;
}
.titleBox {
width: 100%;
.name {
bottom: 30rpx;
left: 30rpx;
display: flex;
align-items: center;
}
position: relative;
.contentBox {
position: relative;
}
.status-bar {
width: 100vw;
height: 46px;
}
.title {
font-size: 36rpx;
line-height: 80rpx;
text-align: center;
font-weight: 500;
}
.list-item {
display: flex;
align-items: center;
/* background: #fff; */
padding: 20rpx 6rpx;
border-radius: 8rpx;
/* border-bottom:2rpx solid #f2f2f2; */
/* margin-bottom: 10rpx; */
}
.settingImg {
width: 48rpx;
height: 48rpx;
top: 16rpx;
right: 0px;
}
}
.item-icon {
width: 84rpx;
height: 84rpx;
/* margin-right: 20rpx; */
}
.img {
width: 60px;
height: 60px;
margin-right: 10rpx;
border-radius: 50%;
}
.item-content {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
}
.name {
bottom: 30rpx;
left: 30rpx;
display: flex;
align-items: center;
}
.item-title {
font-size: 32rpx;
/* color: #333; */
font-weight: 400;
margin: 10rpx 20rpx;
/* margin-bottom: 6rpx; */
}
.contentBox {
position: relative;
}
.item-desc {
font-size: 24rpx;
color: #b5b5b5;
white-space: nowrap;
/* 强制不换行 */
overflow: hidden;
/* 超出隐藏 */
text-overflow: ellipsis;
}
.status-bar {
width: 100vw;
// height: 46px;
height: var(--status-bar-height);
flex-shrink: 0;
}
::v-deep .uni-nav-bar-text{
font-size: 32rpx !important;
}
.item-arrow {
width: 16rpx;
height: 16rpx;
border-right: 3rpx solid #999999;
border-bottom: 3rpx solid #999999;
transform: rotate(-45deg);
margin-right: 10rpx;
}
.list-item {
display: flex;
align-items: center;
/* background: #fff; */
padding: 20rpx 6rpx;
border-radius: 8rpx;
/* border-bottom:2rpx solid #f2f2f2; */
/* margin-bottom: 10rpx; */
}
.page {
flex: 1;
overflow-y: auto;
padding: 0px 40rpx;
box-sizing: border-box;
}
.item-icon {
width: 84rpx;
height: 84rpx;
/* margin-right: 20rpx; */
}
.item-content {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
}
.item-title {
font-size: 32rpx;
/* color: #333; */
font-weight: 400;
margin: 10rpx 20rpx;
/* margin-bottom: 6rpx; */
}
.item-desc {
font-size: 24rpx;
color: #b5b5b5;
white-space: nowrap;
/* 强制不换行 */
overflow: hidden;
/* 超出隐藏 */
text-overflow: ellipsis;
}
.item-arrow {
width: 16rpx;
height: 16rpx;
border-right: 3rpx solid #999999;
border-bottom: 3rpx solid #999999;
transform: rotate(-45deg);
margin-right: 10rpx;
}
.page {
flex: 1;
overflow-y: auto;
padding: 0px 40rpx;
box-sizing: border-box;
}
</style>