This commit is contained in:
Zy
2026-05-15 18:15:20 +08:00
18 changed files with 730 additions and 1129 deletions

View File

@@ -26,6 +26,27 @@ export const getVillageList = (data) =>{
export const switchVillage = (data) =>{ export const switchVillage = (data) =>{
return post('/api/inspection/today/switchVillage',data) return post('/api/inspection/today/switchVillage',data)
} }
// 获取当前小区
export const getCurrentVillage = () =>{
return get('/api/butler/auth/today/village')
}
// 获取首页今日巡检
export const getTodayInspection = () =>{
return get('/api/inspection/today/inspection')
}
// 首页最新消息通知
export const getNewNoticeData = () =>{
return get('/manage/notice/new')
}
// ============通知列表===========
export const getNoticeList = (data) =>{
return get('/manage/notice/repair',data)
}
// ======故障上报===== // ======故障上报=====
// 获取报修项目 // 获取报修项目
export const getRepairOrder = () =>{ export const getRepairOrder = () =>{
@@ -40,8 +61,30 @@ export const uploadFile = (filePath) => {
return upload(filePath,' /resource/oss/upload'); return upload(filePath,' /resource/oss/upload');
} }
// 查询一键开门
export const getOpenDoorList = () =>{
return get('/manage/remote/open/accessdevice')
}
// 一键开门 // 一键开门
export const openDoor = (data) =>{ export const switchOpenDoor = (data) =>{
return post('/manage/remote/open',data) return post('/manage/remote/open',data)
} }
// ===========我的========
// 获取管家信息
export const getSettingInfo = () =>{
return get('/api/setting/info')
}
// =====设置=======
// 修改密码
export const changePassword = (data) =>{
return post('/api/setting/changePassword',data)
}
// 退出登录
export const logout = () =>{
return post('/api/butler/auth/logout')
}
// 修改手机号
export const changePhone = (data) =>{
return post('/api/setting/changePhone',data)
}

View File

@@ -1,62 +1,62 @@
let baseUrl = ''; let baseUrl = ''
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
baseUrl = 'http://192.168.0.239:8080'; // 开发环境 baseUrl = 'http://192.168.0.239:8080' // 开发环境
} else { } else {
baseUrl = 'http://192.168.0.224:8080'; // 生产环境 baseUrl = 'http://192.168.0.239:8080' // 生产环境
} }
export default function request(url, data = {}, method = "GET") { export default function request(url, data = {}, method = 'GET') {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showLoading({ uni.showLoading({
title: '请求中...', title: '请求中...',
mask: true mask: true
}); })
uni.request({ uni.request({
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: method, method: method,
header: { header: {
"Authorization": "Bearer " + (uni.getStorageSync("token") || ''), Authorization: 'Bearer ' + (uni.getStorageSync('token') || ''),
"clientid": "butler", clientid: 'butler',
'content-type': 'application/json' 'content-type': 'application/json'
}, },
success: (res) => { success: res => {
uni.hideLoading(); uni.hideLoading()
// HTTP 失败 // HTTP 失败
if (res.statusCode !== 200) { if (res.statusCode !== 200) {
reject({ reject({
msg: `请求异常 ${res.statusCode}`, msg: `请求异常 ${res.statusCode}`,
code: res.statusCode code: res.statusCode
}); })
return; return
} }
const resData = res.data || {}; const resData = res.data || {}
// token 过期 // token 过期
if (resData.code === 401) { if (resData.code === 401) {
uni.showToast({ uni.showToast({
title: '登录过期,请重新登录', title: '登录过期,请重新登录',
icon: 'none' icon: 'none'
}); })
uni.clearStorageSync('token'); uni.clearStorageSync('token')
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pageSubPack/loginSub/pwd-login' url: '/pageSubPack/loginSub/pwd-login'
}); })
}, 1500); }, 1500)
reject({ reject({
msg: '登录过期', msg: '登录过期',
code: 401 code: 401
}); })
return; return
} }
// 成功 // 成功
if (resData.code === 200) { if (resData.code === 200) {
resolve(resData); resolve(resData)
} }
// 业务失败 // 业务失败
else { else {
@@ -64,24 +64,24 @@ export default function request(url, data = {}, method = "GET") {
msg: resData.msg || '请求失败', msg: resData.msg || '请求失败',
code: resData.code, code: resData.code,
data: resData data: resData
}); })
} }
}, },
fail: (err) => { fail: err => {
uni.hideLoading(); uni.hideLoading()
reject({ reject({
msg: '网络异常', msg: '网络异常',
code: -1, code: -1,
raw: err raw: err
}); })
} }
}); })
}); })
} }
export const get = (url, data) => request(url, data, 'GET'); export const get = (url, data) => request(url, data, 'GET')
export const post = (url, data) => request(url, data, 'POST'); export const post = (url, data) => request(url, data, 'POST')
export const put = (url, data) => request(url, data, 'PUT'); export const put = (url, data) => request(url, data, 'PUT')
// export const deleteMethod = (url, data) => request(url, data, 'DELETE'); // export const deleteMethod = (url, data) => request(url, data, 'DELETE');
// export const putMethod = (url, data) => request(url, data, 'PUT'); // export const putMethod = (url, data) => request(url, data, 'PUT');
@@ -93,27 +93,23 @@ export const upload = (filePath, url) => {
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {
"Authorization": "Bearer " + (uni.getStorageSync("token") || ''), Authorization: 'Bearer ' + (uni.getStorageSync('token') || ''),
"clientid": "resident" clientid: 'resident'
}, },
success: (res) => { success: res => {
try { try {
const data = JSON.parse(res.data); const data = JSON.parse(res.data)
resolve(data.data || ''); // 直接返回图片地址 resolve(data.data || '') // 直接返回图片地址
} catch (e) { } catch (e) {
resolve(''); resolve('')
} }
}, },
fail: (err) => { fail: err => {
reject(err); reject(err)
}
})
})
} }
});
});
};
/** /**
* 过滤请求参数:移除值为 null / undefined / 空字符串 的字段 * 过滤请求参数:移除值为 null / undefined / 空字符串 的字段

View File

@@ -53,7 +53,7 @@
<view class="upload-item" v-for="(img, index) in form.images" :key="index"> <view class="upload-item" v-for="(img, index) in form.images" :key="index">
<image :src="img" mode="aspectFill" class="upload-img"></image> <image :src="img" mode="aspectFill" class="upload-img"></image>
<image <image
src="http://47.104.199.163:9090/images/imgs/delete.png" src="https://wuyeadmin.bugtc.com/images/imgs/delete.png"
class="upload-delete" class="upload-delete"
@click="deleteImage(index)" @click="deleteImage(index)"
></image> ></image>
@@ -61,8 +61,8 @@
</view> </view>
<!-- 上传按钮 --> <!-- 上传按钮 -->
<view class="upload-btn" @click="chooseImage" v-if="form.images.length < 3"> <view class="upload-btn" @click="chooseImage" v-if="form.images.length < 3">
<uni-icons type="plus" size="24"></uni-icons> <uni-icons type="plusempty" size="24"></uni-icons>
<text>上传照片</text> <!-- <text>上传照片</text> -->
</view> </view>
</view> </view>
</view> </view>
@@ -74,7 +74,7 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad,onShow ,onUnload} from '@dcloudio/uni-app'
import {addRepairList,uploadFile} from '../../api/api.js' import {addRepairList,uploadFile} from '../../api/api.js'
@@ -92,13 +92,24 @@ const form = ref({
// ==========方法======== // ==========方法========
// 页面加载时获取传参 // 页面加载
onLoad(options => { onLoad((options) => {
// 第一次进入页面接收参数
if (options.category && options.project) { if (options.category && options.project) {
repairProject.value = `${options.category}-${options.project}` repairProject.value = `${options.category}-${options.project}`
repairId.value = options.projectId repairId.value = options.projectId
} }
console.log('项目id',repairId.value)
// ✅ 监听返回选择的项目
uni.$on('selectRepairProject', (data) => {
repairProject.value = `${data.category}-${data.project}`
repairId.value = data.projectId
})
})
// ✅ 页面卸载时移除监听(必须加)
onUnload(() => {
uni.$off('selectRepairProject')
}) })
// 选择项目页 // 选择项目页
@@ -287,7 +298,8 @@ const submitForm = async () => {
.upload-btn { .upload-btn {
width: 80px; width: 80px;
height: 80px; height: 80px;
border: 1px dashed #ccc; /* border: 1px dashed #ccc; */
background-color: #f3f3f3;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -99,15 +99,25 @@ onLoad(() =>{
fetchProjectList() fetchProjectList()
}) })
// 选择项目并跳转到维修项目填写页
// 选择项目并返回到维修项目填写页
const selectProject = (item) => { const selectProject = (item) => {
// 获取分类名称 // 获取分类名称
const categoryName = categoryList.value.find(c => c.id === item.categoryId)?.projectName const categoryName = categoryList.value.find(c => c.id === item.categoryId)?.projectName || '';
// 跳转并传参
uni.navigateTo({ // 用全局事件发送参数
url: `/pageSubPack/fault-reporting/fault-reporting?category=${categoryName}&project=${item.projectName}&projectId=${item.id}` uni.$emit('selectRepairProject', {
category: categoryName, // 分类名
project: item.projectName, // 项目名
projectId: item.id // 项目ID
})
// 返回上一页
uni.navigateBack({
delta: 1
}) })
} }
</script> </script>
<style scoped> <style scoped>

View File

@@ -9,7 +9,7 @@
<view class="input-icon"> <view class="input-icon">
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> --> <!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
<image <image
src="http://47.104.199.163:9090/images/login/phone.png" src="https://wuyeadmin.bugtc.com/images/login/phone.png"
mode="" mode=""
style="height: 100%; width: 100%" style="height: 100%; width: 100%"
></image> ></image>
@@ -30,7 +30,7 @@
<view class="input-item verify-item"> <view class="input-item verify-item">
<view class="input-icon"> <view class="input-icon">
<image <image
src="http://47.104.199.163:9090/images/login/code.png" src="https://wuyeadmin.bugtc.com/images/login/code.png"
mode="" mode=""
style="height: 100%; width: 100%" style="height: 100%; width: 100%"
> >

View File

@@ -8,7 +8,7 @@
<view class="input-item"> <view class="input-item">
<view class="input-icon"> <view class="input-icon">
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> --> <!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
<image src="http://47.104.199.163:9090/images/login/phone.png" mode="" <image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode=""
style="height: 100%;width: 100%;"></image> style="height: 100%;width: 100%;"></image>
</view> </view>
<uni-easyinput class="input-content" type="text" v-model="phoneNumber" placeholder="请输入帐号" <uni-easyinput class="input-content" type="text" v-model="phoneNumber" placeholder="请输入帐号"
@@ -20,7 +20,7 @@
<view class="input-item"> <view class="input-item">
<view class="input-icon"> <view class="input-icon">
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> --> <!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
<image src="http://47.104.199.163:9090/images/login/password.png" mode="" <image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode=""
style="height: 100%;width: 100%;"></image> style="height: 100%;width: 100%;"></image>
</view> </view>
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入6-16位密码" <uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入6-16位密码"

View File

@@ -1,48 +1,120 @@
<template> <template>
<view class="news-detail-page"> <view class="news-detail-page">
<!-- 单条资讯卡片 --> <!-- 循环渲染通知列表 -->
<view class="news-card"> <view class="news-card" v-for="item in noticeList" :key="item.id">
<!-- 标题 + 右上角未读红点 -->
<view class="news-header"> <view class="news-header">
<text class="news-title">以实干担当不断开创中国特色大国外交实干担当不断开创中国特色大国外交</text> <text class="news-title">{{ item.item || '暂无标题' }}</text>
<view class="unread-dot"></view> <view class="unread-dot" v-if="item.isCheck === '0' "></view>
</view> </view>
<!-- 发布人 + 时间 -->
<view class="news-meta"> <view class="news-meta">
<text class="author">张三</text> <text class="author">{{ item.residentName || '管理员' }}</text>
<text class="publish-time">2026-07-01</text> <text class="publish-time">{{ item.createTime }}</text>
</view> </view>
<!-- 内容区域:浅背景卡片 -->
<view class="news-content"> <view class="news-content">
<text class="content-text"> <text class="content-text">{{ item.notice || item.problem }}</text>
学习贯彻习近平新时代中国特色社会主义思想主题教育开展以来,外交外事战线认真学习贯彻习近平总书记重要讲话精神和党中央部署要求,全面准确把...
</text>
</view> </view>
<!-- 详情按钮 --> <view class="detail-btn" @click="goToDetail(item)">
<view class="detail-btn" @click="goToDetail">
<text class="detail-text">详情</text> <text class="detail-text">详情</text>
<uni-icons type="right" size="14" color="#4D5DFA"></uni-icons> <uni-icons type="right" size="14" color="#4D5DFA"></uni-icons>
</view> </view>
</view> </view>
<!-- 加载提示 + 没有更多数据 -->
<view class="load-more" v-if="noticeList.length > 0">
<text v-if="loading">加载中...</text>
<text v-else-if="noMore">没有更多数据了</text>
</view>
<!-- 空数据 -->
<view class="empty" v-if="noticeList.length === 0 && !loading">
暂无通知消息
</view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { getNoticeList } from '../../api/api.js'
// 跳转到详情页方法 // 列表数据
const goToDetail = () => { const noticeList = ref([])
uni.navigateTo({
url: '/pageSubPack/notice-list/noticeListDetails' // 分页相关
const pageNum = ref(1) // 当前页
const pageSize = ref(5) // 每页条数
const total = ref(0) // 总条数
const loading = ref(false) // 加载状态
const noMore = ref(false) // 是否没有更多
// 获取列表数据
const getNoticeData = (isRefresh = false) => {
// 防止重复请求
if (loading.value || noMore.value) return
loading.value = true
getNoticeList({
pageSize: pageSize.value,
pageNum: pageNum.value
}).then(res => {
if (res.code === 200) {
total.value = res.total || 0
const data = res.rows || []
// 第一页:覆盖,分页:追加
if (pageNum.value === 1) {
noticeList.value = data
} else {
noticeList.value = [...noticeList.value, ...data]
}
// 判断是否还有更多
noMore.value = noticeList.value.length >= total.value
}
}).catch(() => {
uni.showToast({ title: '加载失败', icon: 'none' })
}).finally(() => {
loading.value = false
if (isRefresh) {
uni.stopPullDownRefresh()
}
}) })
} }
// 上拉加载更多
onReachBottom(() => {
if (noMore.value || loading.value) return
pageNum.value++
getNoticeData()
})
// 下拉刷新
onPullDownRefresh(() => {
pageNum.value = 1
noMore.value = false
getNoticeData(true)
})
// 跳详情(即时标记已读)
const goToDetail = (item) => {
item.isCheck = '1'
uni.navigateTo({
url: `/pageSubPack/ticket/repairMain?id=${item.id}`
})
}
// 页面显示时刷新(从详情页返回也会触发)
onShow(() => {
pageNum.value = 1
noMore.value = false
getNoticeData()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// 页面基础样式
.news-detail-page { .news-detail-page {
padding: 20rpx; padding: 20rpx;
background-color: #f9f9f9; background-color: #f9f9f9;
@@ -50,15 +122,13 @@ const goToDetail = () => {
box-sizing: border-box; box-sizing: border-box;
} }
// 资讯卡片:白色背景 + 圆角
.news-card { .news-card {
background-color: #ffffff; background-color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx; padding: 30rpx;
box-sizing: border-box; margin-bottom: 20rpx;
} }
// 标题行:标题 + 红点
.news-header { .news-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -66,20 +136,16 @@ const goToDetail = () => {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
// 资讯标题
.news-title { .news-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333;
line-height: 1.4;
flex: 1; flex: 1;
margin-right: 10rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
// 右上角未读红点
.unread-dot { .unread-dot {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
@@ -88,46 +154,53 @@ const goToDetail = () => {
margin-top: 6rpx; margin-top: 6rpx;
} }
// 发布人+时间行
.news-meta { .news-meta {
margin-bottom: 20rpx; margin-bottom: 20rpx;
}
.author { .author {
font-size: 26rpx; font-size: 26rpx;
color: #666666; color: #666;
margin-right: 20rpx; margin-right: 20rpx;
} }
.publish-time { .publish-time {
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999;
}
} }
// 内容区域:浅背景卡片
.news-content { .news-content {
background-color: #f5f5f5; background-color: #f5f5f5;
border-radius: 8rpx; border-radius: 8rpx;
padding: 20rpx; padding: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
}
.content-text { .content-text {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333;
line-height: 1.5; line-height: 1.5;
} }
}
// 详情按钮:蓝色文字 + 右箭头
.detail-btn { .detail-btn {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
}
.detail-text { .detail-text {
font-size: 28rpx; font-size: 28rpx;
color: #4D5DFA; color: #4D5DFA;
margin-right: 8rpx; margin-right: 8rpx;
} }
}
.load-more {
text-align: center;
padding: 30rpx;
color: #999;
font-size: 26rpx;
}
.empty {
text-align: center;
padding: 100rpx 0;
color: #999;
font-size: 28rpx;
}
</style> </style>

View File

@@ -1,531 +0,0 @@
<template>
<view class="container">
<!-- 内容区域 -->
<!-- <scroll-view class="content-scroll" scroll-y> -->
<!-- 文章标题 -->
<view class="article-header">
<view class="article-title">
{{noticeDetail.noticeTitle}}
</view>
</view>
<!-- 作者和日期 -->
<view class="notice-meta">
<view class="notice-author">
<text class="author-name">{{noticeDetail.author}}</text>
<text class="separator">·</text>
<text class="publish-time">{{noticeDetail.publishTime}}</text>
</view>
</view>
<!-- 文章内容 -->
<view class="article-content">
<view class="paragraph">
{{noticeDetail.noticeContent}}
</view>
<view class="articleimg">
<image src="http://47.104.199.163:9090/images/home/notice-1.png" mode="" style="width: 100%;height: 100%;border-radius: 20rpx;"></image>
<image src="http://47.104.199.163:9090/images/home/notice-2.png" mode="" style="width: 100%;height: 100%;border-radius: 20rpx;"></image>
</view>
</view>
<!-- 附件区域 -->
<!-- <view class="attachments-section">
<view class="section-title">
<view class="title-text">相关附件</view>
<view class="title-line"></view>
</view>
<view class="attachments-list"> -->
<!-- DOC文件 -->
<!-- <view class="attachment-item" @click="downloadFile('filename.DOC')">
<view class="attachment-left">
<view class="file-icon doc-icon">📄</view>
<view class="file-info">
<view class="file-name">文件名.DOC</view>
<view class="file-size">299kb</view>
</view>
</view>
<view class="download-btn">
<view class="download-icon">↓</view>
</view>
</view> -->
<!-- PDF文件 -->
<!-- <view class="attachment-item" @click="downloadFile('filename.PDF')">
<view class="attachment-left">
<view class="file-icon pdf-icon">📄</view>
<view class="file-info">
<view class="file-name">文件名.PDF</view>
<view class="file-size">299kb</view>
</view>
</view>
<view class="download-btn">
<view class="download-icon">↓</view>
</view>
</view>
</view>
</view> -->
<!-- </scroll-view> -->
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
// import {getNoticeDetails} from '../api/api.js'
const isLoading = ref(false)
const noticeDetail = ref({})
const currentNoticeId = ref('') // 接收公告跳转的id
// =====方法====
onLoad((options) =>{
currentNoticeId.value = options?.id
// console.log('currentNoticeId',currentNoticeId.value)
if(currentNoticeId.value){
getDetailsData(currentNoticeId.value)
}
// console.log('currentNoticeId',currentNoticeId.value)
})
// 获取详情数据
const getDetailsData = async (noticeId) =>{
try{
const res = await getNoticeDetails(noticeId)
if(res.code === 200){
noticeDetail.value = res.data || {}
uni.$emit('noticeRead',{
noticeId:noticeId,
readStatus:noticeDetail.value.readStatus
})
}
}catch(err){
uni.showToast({
title:"加载失败",
icon:"none"
})
}
}
// 下载文件
const downloadFile = (fileName) => {
uni.showModal({
title: '下载确认',
content: `确定要下载 "${fileName}" 吗?`,
success: (res) => {
if (res.confirm) {
isLoading.value = true
// 显示下载进度
uni.showLoading({
title: '下载中...',
mask: true
})
// 模拟下载过程
setTimeout(() => {
uni.hideLoading()
isLoading.value = false
// 根据文件类型打开文件
if (fileName.endsWith('.PDF')) {
uni.showToast({
title: 'PDF文件已保存到下载目录',
icon: 'success',
duration: 2000
})
// 在真实项目中,这里应该调用下载API
// uni.downloadFile({
// url: 'https://example.com/files/filename.PDF',
// success: (res) => {
// if (res.statusCode === 200) {
// uni.saveFile({
// tempFilePath: res.tempFilePath,
// success: (saveRes) => {
// uni.showToast({ title: '下载成功', icon: 'success' })
// }
// })
// }
// }
// })
} else if (fileName.endsWith('.DOC')) {
uni.showToast({
title: 'DOC文件已保存到下载目录',
icon: 'success',
duration: 2000
})
}
}, 1500)
}
}
})
}
</script>
<style lang="scss" scoped>
.container {
min-height: 100vh;
background-color: #ffffff;
padding: 20px;
// font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
/* 内容滚动区域 */
.content-scroll {
padding-top: 15px;
box-sizing: border-box;
background-color: #ffffff;
}
/* 文章头部 */
.article-header {
// padding: 24px 20px 20px;
// border-bottom: 1px solid #f0f0f0;
.article-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 1.4;
margin-bottom: 16px;
text-align: center;
}
.article-meta {
display: flex;
align-items: center;
justify-content: center;
color: #666666;
font-size: 14px;
.meta-item {
display: flex;
align-items: center;
.meta-icon {
font-size: 14px;
margin-right: 4px;
}
.meta-text {
font-size: 14px;
}
}
.meta-divider {
margin: 0 12px;
color: #cccccc;
}
}
}
/* 元信息 */
.notice-meta {
display: flex;
align-items: center;
justify-content: center;
// margin-bottom: 12px;
color: #666;
font-size: 16px;
margin: 0 30rpx;
.notice-author {
display: flex;
align-items: center;
.author-name {
color: #666;
}
.separator {
margin: 0 6px;
color: #ccc;
}
.publish-time {
color: #999;
}
}
.notice-time {
display: flex;
align-items: center;
.date-text {
margin-left: 4px;
color: #999;
}
}
}
/* 文章内容 */
.article-content {
padding: 20px;
color: #333333;
line-height: 1.8;
font-size: 16px;
.articleimg{
width: 100%;
height: 249rpx;
}
.paragraph {
margin-bottom: 20px;
text-align: justify;
text-indent: 2em;
}
.bullet-list {
margin: 20px 0 20px 2em;
.bullet-item {
display: flex;
margin-bottom: 12px;
.bullet-dot {
color: #666666;
margin-right: 8px;
flex-shrink: 0;
}
.bullet-text {
flex: 1;
color: #333333;
}
}
}
}
/* 附件区域 */
.attachments-section {
padding: 20px;
background-color: #f9f9f9;
border-top: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
margin-top: 20px;
.section-title {
display: flex;
align-items: center;
margin-bottom: 20px;
.title-text {
font-size: 18px;
font-weight: 600;
color: #333333;
white-space: nowrap;
margin-right: 12px;
}
.title-line {
flex: 1;
height: 1px;
background-color: #e0e0e0;
}
}
.attachments-list {
.attachment-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px;
background-color: #ffffff;
border-radius: 8px;
margin-bottom: 12px;
border: 1px solid #e8e8e8;
&:active {
background-color: #f5f5f5;
}
&:last-child {
margin-bottom: 0;
}
.attachment-left {
display: flex;
align-items: center;
flex: 1;
.file-icon {
font-size: 24px;
margin-right: 12px;
&.doc-icon {
color: #2b579a; /* Word文档蓝色 */
}
&.pdf-icon {
color: #e74c3c; /* PDF红色 */
}
}
.file-info {
.file-name {
font-size: 16px;
color: #333333;
margin-bottom: 4px;
font-weight: 500;
}
.file-size {
font-size: 13px;
color: #666666;
}
}
}
.download-btn {
width: 40px;
height: 40px;
border-radius: 20px;
background-color: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
.download-icon {
font-size: 18px;
color: #333333;
}
}
}
}
}
/* 页面底部 */
.page-footer {
padding: 30px 20px 40px;
display: flex;
flex-direction: column;
align-items: center;
.footer-text {
font-size: 16px;
color: #999999;
margin-bottom: 20px;
}
.footer-info {
display: flex;
align-items: center;
font-size: 13px;
color: #999999;
.info-item {
padding: 0 8px;
}
.info-divider {
color: #dddddd;
}
}
}
/* 响应式调整 */
@media (min-width: 768px) {
.container {
max-width: 768px;
margin: 0 auto;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
.article-header,
.article-content,
.attachments-section,
.page-footer {
padding-left: 40px;
padding-right: 40px;
}
}
/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
.container {
background-color: #1a1a1a;
}
.custom-navbar {
background-color: #1a1a1a;
border-bottom-color: #333333;
.nav-back,
.nav-title {
color: #ffffff;
}
.nav-actions .action-icon {
color: #ffffff;
}
}
.content-scroll {
background-color: #1a1a1a;
}
.article-header {
border-bottom-color: #333333;
.article-title {
color: #ffffff;
}
.article-meta {
color: #999999;
}
}
.article-content {
color: #e0e0e0;
.bullet-item .bullet-text {
color: #e0e0e0;
}
}
.attachments-section {
background-color: #2a2a2a;
border-top-color: #333333;
border-bottom-color: #333333;
.section-title .title-text {
color: #ffffff;
}
.attachment-item {
background-color: #2a2a2a;
border-color: #333333;
&:active {
background-color: #333333;
}
.file-info .file-name {
color: #ffffff;
}
.file-info .file-size {
color: #999999;
}
}
}
.page-footer {
.footer-text,
.footer-info {
color: #666666;
}
}
}
</style>

View File

@@ -17,13 +17,13 @@
<view v-for="item in displayedCommunities" :key="item.id" class="community-item" <view v-for="item in displayedCommunities" :key="item.id" class="community-item"
@tap="selectCommunity(item)" :class="{active: selectedItem?.id === item.id}"> @tap="selectCommunity(item)" :class="{active: selectedItem?.id === item.id}">
<view class="community-item-left"> <view class="community-item-left">
<image src="http://47.104.199.163:9090/images/imgs/community.png" style="width: 48rpx;height: 48rpx;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/community.png" style="width: 48rpx;height: 48rpx;"></image>
<view class="community-info"> <view class="community-info">
<text class="community-name">{{ item.villageName }}</text> <text class="community-name">{{ item.villageName }}</text>
</view> </view>
</view> </view>
<view v-if="selectedItem && selectedItem.id === item.id" class="selected-icon"> <view v-if="selectedItem && selectedItem.id === item.id" class="selected-icon">
<image src="http://47.104.199.163:9090/images/imgs/check.png" style="width: 48rpx;height: 48rpx;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/check.png" style="width: 48rpx;height: 48rpx;"></image>
</view> </view>
</view> </view>

View File

@@ -7,7 +7,7 @@
<uni-nav-bar left-icon="left" title="远程开门" backgroundColor ="none" :border="false" @clickLeft="narBack" /> <uni-nav-bar left-icon="left" title="远程开门" backgroundColor ="none" :border="false" @clickLeft="narBack" />
</view> </view>
<view class="top-img"> <view class="top-img">
<image src="http://47.104.199.163:9090/images/imgs/xuancheng-bg.png" mode="" style="width: 100%;height: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/xuancheng-bg.png" mode="" style="width: 100%;height: 100%;"></image>
</view> </view>
<!-- 提示文案 --> <!-- 提示文案 -->
@@ -39,6 +39,11 @@
<text class="door-name">{{ item.name }}</text> <text class="door-name">{{ item.name }}</text>
</view> </view>
</view> </view>
<!-- 空状态 -->
<view v-if="doorList.length === 0" class="empty-state">
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
<text class="empty-text">暂无可用门禁</text>
</view>
</view> </view>
<!-- 确认开门按钮 --> <!-- 确认开门按钮 -->
@@ -48,19 +53,42 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getOpenDoorList, switchOpenDoor } from '../../api/api.js'
// 响应式数据:选中的门索引、开门成功提示 // 响应式数据:选中的门索引、开门成功提示
const selectedDoor = ref(-1) // -1表示未选中 const selectedDoor = ref(-1) // -1表示未选中
const showSuccess = ref(false) const showSuccess = ref(false)
// 门列表数据() // 门列表数据
const doorList = ref([ const doorList = ref([])
{ iconText: '/static/imgs/westDoor.png',iconActive:"/static/imgs/westDoorWhite.png", name: '西入门闸机' },
{ iconText: '/static/imgs/eastDoor.png',iconActive:"/static/imgs/eastDoorWhite.png", name: '东入门闸机' }, // 查询门禁列表
{ iconText: '/static/imgs/unitDoor.png',iconActive:"/static/imgs/unitDoorWhite.png", name: '1号楼1单元门' }, const fetchDoorList = () => {
{ iconText: '/static/imgs/unitDoor.png',iconActive:"/static/imgs/unitDoorWhite.png", name: '1号楼2单元门' } getOpenDoorList().then(res => {
]) if (res.code === 200 && res.data) {
doorList.value = res.data
.filter(item => item.status === '1')
.map(item => ({
id: item.id,
name: item.deviceName,
iconText: item.iconText,
iconActive: item.iconActive
}))
}
}).catch(err => {
uni.showToast({
title: err.msg || '获取门禁列表失败',
icon: 'none'
})
})
}
onShow(() => {
selectedDoor.value = -1
showSuccess.value = false
fetchDoorList()
})
// 选择门的方法 // 选择门的方法
const selectDoor = (index) => { const selectDoor = (index) => {
@@ -75,21 +103,21 @@ const narBack = () =>{
} }
// 确认开门方法 // 确认开门方法
const openDoor = () => { const openDoor = () => {
// 校验:未选择门时提示 const device = doorList.value[selectedDoor.value]
// if (selectedDoor.value === -1) { if (!device) return
// uni.showToast({
// title: '请先选择要开的门',
// icon: 'none'
// })
// return
// }
// 模拟开门接口请求(实际项目替换为真实接口) uni.showLoading({ title: '开门中...' })
setTimeout(() => { switchOpenDoor({ deviceId: device.id }).then(res => {
uni.hideLoading()
if (res.code === 200) {
showSuccess.value = true showSuccess.value = true
// 可选:添加成功提示后自动隐藏 } else {
// setTimeout(() => showSuccess.value = false, 2000) uni.showToast({ title: res.msg || '开门失败', icon: 'none' })
}, 500) }
}).catch(err => {
uni.hideLoading()
uni.showToast({ title: err.msg || '开门失败', icon: 'none' })
})
} }
</script> </script>
@@ -203,6 +231,20 @@ const openDoor = () => {
.door-item.active .door-name { .door-item.active .door-name {
color: #ffffff !important; color: #ffffff !important;
} }
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.empty-text {
font-size: 32rpx;
color: #999;
margin-top: 20rpx;
margin-bottom: 10rpx;
}
/* 门图标 */ /* 门图标 */
.door-icon { .door-icon {

View File

@@ -1,15 +1,26 @@
<template> <template>
<view class="report-record-page page_padding"> <view class="report-record-page">
<view class="status-bar"></view>
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<navBar @clickLeft="navBack" title="上报记录"></navBar> <uni-nav-bar
<view class="hall_body flex-1 flex flex-col"> left-icon="back"
<view class="bgaction"> </view> title="上报记录"
backgroundColor="transparent"
:border= "false"
@clickLeft="navBack"/>
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<TabsComponents <view class="status-tabs">
:tabslist="statusTabs" <view
:options="{ label: 'label', value: 'value' }" v-for="item in statusTabs"
@update="switchStatus" :key="item.value"
></TabsComponents> class="status-tab-item"
:class="{ active: activeStatus === item.value }"
@tap="switchStatus(item.value)"
>
{{ item.label }}
</view>
</view>
<!-- 类型筛选标签 --> <!-- 类型筛选标签 -->
<view class="type-tabs"> <view class="type-tabs">
@@ -26,35 +37,27 @@
<!-- 上报记录列表 --> <!-- 上报记录列表 -->
<scroll-view <scroll-view
class="record-list flex-1" class="record-list"
scroll-y scroll-y
lower-threshold="60" :style="{ height: `calc(100vh - ${navHeight + statusTabHeight + typeTabHeight}px)` }"
@scrolltolower="scrolltolower"
> >
<!-- 空状态 --> <!-- 空状态 -->
<view v-if="reportRecords.length === 0" class="empty-state"> <view v-if="filteredRecords.length === 0" class="empty-state">
<uni-icons type="empty" size="60" color="#ccc"></uni-icons> <uni-icons type="empty" size="60" color="#ccc"></uni-icons>
<text class="empty-text">暂无上报记录</text> <text class="empty-text">暂无上报记录</text>
</view> </view>
<!-- 记录卡片 --> <!-- 记录卡片 -->
<view <view
v-for="(record, index) in reportRecords" v-for="record in filteredRecords"
:key="index" :key="record.id"
class="record-card" class="record-card"
@tap="handleMain(record.id)"
> >
<!-- 标题 + 状态标签 --> <!-- 标题 + 状态标签 -->
<view class="card-header"> <view class="card-header">
<text class="card-title">{{ record.title }}</text> <text class="card-title">{{ record.title }}</text>
<view <view class="status-tag" :class="record.status">
class="status-tag" {{ getStatusText(record.status) }}
:class="{
pending: record.repairStatus === 0,
processing: record.repairStatus === 1,
completed: record.repairStatus === 2
}"
>
{{ getStatusText(record.repairStatus) }}
</view> </view>
</view> </view>
@@ -68,40 +71,25 @@
<view class="card-content"> <view class="card-content">
{{ record.content }} {{ record.content }}
</view> </view>
<!-- 工单图片 -->
<!-- <view class="card-image">
<image
v-for="(item, index) in record.images"
:key="index"
lazy-load
:src="item"
class="images"
mode="scaleToFill"
@tap="handlePrivew(record.images)"
></image>
</view> -->
<!-- 底部信息 --> <!-- 底部信息 -->
<view class="card-footer"> <view class="card-footer">
<text class="create-time">{{ record.createTime }}</text> <text class="create-time">{{ record.createTime }}</text>
<text v-if="record.repairStatus !== 0" class="repairman" <text v-if="record.repairman" class="repairman">维修师傅:{{ record.repairman }}</text>
>维修师傅:{{ record.repairman }}</text
>
<!-- <view class="share" v-if="record.repairStatus === 0">
<text>分配</text>
</view> -->
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { onReady } from '@dcloudio/uni-app' import {onReady} from "@dcloudio/uni-app"
import TabsComponents from '@/components/tabs/tabs.vue'
import NavBar from '@/components/navbar/navbar.vue' // 导航栏/标签高度(适配不同设备)
const navHeight = ref(44)
const statusTabHeight = ref(88)
const typeTabHeight = ref(88)
// 筛选状态 // 筛选状态
const activeStatus = ref('all') // 全部/待分配/待解决/已完成 const activeStatus = ref('all') // 全部/待分配/待解决/已完成
@@ -123,144 +111,101 @@ const typeTabs = ref([
]) ])
// 模拟上报记录数据(实际项目替换为接口请求) // 模拟上报记录数据(实际项目替换为接口请求)
const reportRecords = ref([]) const reportRecords = ref([
{
const queryParmas = ref({ id: 1,
pageNum: 1,
pageSize: 5,
value: ''
})
const isLoading = ref(false) // 加载锁
const hasMore = ref(true) // 是否还有更多数据
const total = ref(21)
function scrolltolower() {
// 必须加这两个判断!
if (isLoading.value || !hasMore.value) {
return
}
queryParmas.value.pageNum += 1
getlist()
}
function getlist() {
// 1. 如果正在加载或没有更多数据,直接返回
if (isLoading.value || !hasMore.value) return
// 2. 开启锁
isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
const { pageNum, pageSize } = queryParmas.value
const startId = (pageNum - 1) * pageSize + 1
const arr = Array.from({ length: pageSize }).map((_, index) => {
const realId = startId + index
const randomStatus = Math.floor(Math.random() * 3)
return {
id: realId,
title: '标题巴拉巴拉巴拉', title: '标题巴拉巴拉巴拉',
status: 'pending', // pending/processing/completed status: 'pending', // pending/processing/completed
reportType: '公共报修', reportType: '公共报修',
category: '路灯', category: '路灯',
content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。', content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
createTime: '2026-08-01 10:05:46', createTime: '2026-08-01 10:05:46',
repairman: '张三' + realId, repairman: ''
images: [ },
'https://picsum.photos/93', {
'https://picsum.photos/93', id: 2,
'https://picsum.photos/93', title: '标题巴拉巴拉巴拉',
'https://picsum.photos/93', status: 'processing',
'https://picsum.photos/93' reportType: '公共报修',
], category: '路灯',
repairStatus: randomStatus // 0 待分配,1待解决 2已完成 content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
} createTime: '2026-08-01 10:05:46',
}) repairman: '张三'
// 追加数据(正确方式) },
reportRecords.value = [...reportRecords.value, ...arr] {
// 判断是否还有更多 id: 3,
hasMore.value = reportRecords.value.length < total.value title: '标题巴拉巴拉巴拉',
isLoading.value = false status: 'completed',
uni.hideLoading() reportType: '公共报修',
} category: '路灯',
getlist() content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
function resetList() { createTime: '2026-08-01 10:05:46',
reportRecords.value = [] repairman: '张三'
queryParmas.value.pageNum = 1
hasMore.value = true
getlist()
} }
])
// 筛选后的记录
const filteredRecords = computed(() => {
return reportRecords.value.filter(record => {
// 状态筛选
const statusMatch = activeStatus.value === 'all' || record.status === activeStatus.value
// 类型筛选
const typeMatch = activeType.value === 'all' || record.reportType === typeTabs.value.find(item => item.value === activeType.value)?.label
return statusMatch && typeMatch
})
})
// 0-------------------------------
// 切换状态(全部/待分配/待解决/已完成)筛选 // 切换状态(全部/待分配/待解决/已完成)筛选
const switchStatus = value => { const switchStatus = (value) => {
activeStatus.value = value activeStatus.value = value
} }
// 切换类型(公共/个人)筛选 // 切换类型(公共/个人)筛选
const switchType = value => { const switchType = (value) => {
activeType.value = value activeType.value = value
} }
const statusMap = ['待分配', '待解决', '已完成']
// 获取状态文本
const getStatusText = status => {
return statusMap[status] || ''
}
// 返回上一页 // 返回上一页
const navBack = () => { const navBack = () => {
uni.switchTab({ uni.navigateBack({
url: '/pages/my/my' delta: 1
}) })
} }
/* 0 待分配,1待解决 2已完成*/
function handleMain(id) {
const find = reportRecords.value.find(item => item.id === id)
if (find) {
const status = find.repairStatus
if (status === 2) {
uni.navigateTo({
url: `/pageSubPack/ticket/repairMain?id=${id}&showbtn=${false}&path=hall`
})
} else {
uni.navigateTo({
url: `/pageSubPack/ticket/repairMain?id=${id}&showbtn=${false}&path=hall`
})
}
}
}
/* 预览图片 */ // 获取状态文本
function handlePrivew(imgs) { const getStatusText = (status) => {
// if (imgs.length > 0) { const statusMap = {
// uni.previewImage({ pending: '待分配',
// urls: imgs, processing: '待解决',
// success(e) { completed: '已完成'
// console.log(JSON.stringify(e))
// }
// })
// }
} }
return statusMap[status] || ''
}
// 页面渲染完成后适配高度
onReady(() => {
// 可根据实际设备调整高度
uni.getSystemInfo({
success: (res) => {
if (res.platform === 'ios') {
navHeight.value = 44
} else {
navHeight.value = 48
}
}
})
})
</script> </script>
<style scoped> <style scoped>
.bgaction {
position: absolute;
right: 0;
top: 20%;
width: 100%;
height: 100%;
z-index: 0;
background: linear-gradient(225deg, #e2f0ff 0%, #f9f9f9 25%);
}
.report-record-page { .report-record-page {
width: 100%;
height: 100vh; height: 100vh;
background: linear-gradient(225deg, #e2f0ff 0%, #f9f9f9 25.71%); background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%)
} }
.status-bar{
.hall_body { width: 100%;
padding: 0 40rpx; height: 46px;
overflow: hidden;
position: relative;
} }
/* 状态筛选标签 */ /* 状态筛选标签 */
.status-tabs { .status-tabs {
@@ -271,40 +216,66 @@ function handlePrivew(imgs) {
align-items: center; align-items: center;
} }
.status-tab-item {
/* flex: 1; */
display: flex;
justify-content: flex-start;
margin-right: 60rpx;
text-align: left;
font-size: 32rpx;
color: #666;
height: 100%;
line-height: 88rpx;
position: relative;
}
.status-tab-item.active {
color: #4D5DFA;
font-weight: 500;
}
.status-tab-item.active::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 8rpx;
background: linear-gradient(to bottom, #4D5DFA, #BAC0FA);
border-radius: 6rpx;
}
/* 类型筛选标签 */ /* 类型筛选标签 */
.type-tabs { .type-tabs {
display: flex; display: flex;
height: 48rpx;
/* background-color: #fff; */ /* background-color: #fff; */
margin: 20rpx 0; padding: 20rpx 0rpx;
margin-top: 10rpx;
justify-content: flex-start; justify-content: flex-start;
gap: 20rpx; gap: 20rpx;
margin: 0rpx 40rpx;
} }
.type-tab-item { .type-tab-item {
width: 142rpx; padding: 7rpx 14rpx;
height: 48rpx;
border-radius: 24rpx;
border: 2rpx solid #999999;
font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999;
line-height: 48rpx; border: 2rpx solid #999;
text-align: center; border-radius: 198rpx;
} }
.type-tab-item.active { .type-tab-item.active {
color: #4d5dfa; color: #4D5DFA;
border: 2rpx solid #4d5dfa; border: 2rpx solid #4D5DFA;
border-radius: 24rpx; border-radius: 198rpx;
/* background-color: #007AFF; */
} }
/* 记录列表 */ /* 记录列表 */
.record-list { .record-list {
padding: 20rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 40rpx;
overflow: auto;
} }
/* 空状态 */ /* 空状态 */
@@ -327,7 +298,7 @@ function handlePrivew(imgs) {
.record-card { .record-card {
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 34rpx 32rpx; padding: 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
} }
@@ -340,81 +311,55 @@ function handlePrivew(imgs) {
} }
.card-title { .card-title {
margin-right: 20rpx;
font-weight: 450;
font-size: 32rpx; font-size: 32rpx;
color: #222222; font-weight: 500;
line-height: 40rpx; color: #333;
margin-right: 20rpx;
} }
/* 状态标签 */ /* 状态标签 */
.status-tag { .status-tag {
width: 82rpx; padding: 6rpx 16rpx;
height: 30rpx;
border-radius: 15rpx;
font-weight: 400;
font-size: 20rpx; font-size: 20rpx;
color: #ffffff; border-radius: 12rpx;
line-height: 30rpx; color: #fff;
text-align: center; border-radius: 198rpx;
line-height: 30rpx;
} }
.status-tag.pending { .status-tag.pending {
background-color: #e34d59; /* 待分配-红色 */ background-color: #E34D59; /* 待分配-红色 */
} }
.status-tag.processing { .status-tag.processing {
background-color: #09c2bd; /* 待解决-绿色 */ background-color: #09C2BD; /* 待解决-绿色 */
} }
.status-tag.completed { .status-tag.completed {
background-color: #4d5dfa; /* 已完成-蓝色 */ background-color: #4D5DFA; /* 已完成-蓝色 */
} }
/* 类型标签组 */ /* 类型标签组 */
.tag-group { .tag-group {
display: flex; display: flex;
gap: 20rpx; gap: 15rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.tag-item { .tag-item {
width: 112rpx; padding: 6rpx 20rpx;
height: 42rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 1rpx solid #999999;
font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #666;
line-height: 42rpx; border: 1rpx solid #999;
text-align: center; border-radius: 8rpx;
} }
/* 内容 */ /* 内容 */
.card-content { .card-content {
margin-bottom: 20rpx;
font-weight: 450;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666;
line-height: 40rpx; line-height: 1.6;
letter-spacing: 2rpx;
}
/* 图片 */
.card-image {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
min-width: 186rpx;
min-height: 104rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.images {
width: 186rpx;
height: 104rpx;
}
/* 底部信息 */ /* 底部信息 */
.card-footer { .card-footer {
@@ -423,21 +368,9 @@ function handlePrivew(imgs) {
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
font-weight: 400;
font-size: 28rpx;
line-height: 40rpx;
} }
.share {
width: 127rpx;
height: 44rpx;
background: #4d5dfa;
border-radius: 22rpx;
font-weight: 400; .repairman {
font-size: 28rpx; color: #999;
color: #ffffff;
line-height: 44rpx;
text-align: center;
} }
</style> </style>

View File

@@ -55,11 +55,7 @@
</view> </view>
<!-- 确定按钮 --> <!-- 确定按钮 -->
<button <button class="confirm-btn" @click="handleConfirm">
class="confirm-btn"
:disabled="!canConfirm"
@click="handleConfirm"
>
确定 确定
</button> </button>
</view> </view>
@@ -68,7 +64,7 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
// import { getResetPassword } from '../api/api.js' import { changePassword } from '../../api/api.js'
// ========== 响应式数据 ========== // ========== 响应式数据 ==========
// 旧密码 // 旧密码
@@ -83,22 +79,6 @@ const placeholderStyle = ref('font-size:24rpx;color:#999')
const phone = ref(''); const phone = ref('');
const smsCode = ref(''); const smsCode = ref('');
// ========== 计算属性 ==========
// 是否可点击确定按钮(包含旧密码必填校验)
const canConfirm = computed(() => {
// 密码格式规则:6-16位,必须包含字母+数字
const pwdReg = /^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/;
// 校验条件:
// 1. 旧密码不为空
// 2. 新密码符合格式
// 3. 确认密码和新密码一致
// 4. 所有密码输入框不为空
return oldPassword.value.trim()
&& pwdReg.test(newPassword.value)
&& newPassword.value === confirmPassword.value
&& newPassword.value && confirmPassword.value;
});
// ========== 方法 ========== // ========== 方法 ==========
// 返回上一页 // 返回上一页
@@ -106,30 +86,8 @@ const goBack = () => {
uni.navigateBack(); uni.navigateBack();
}; };
// 页面显示时读取缓存参数
onShow(() => {
// 从缓存读取参数
const params = uni.getStorageSync('tempChangePwdParams') || {};
// 赋值
phone.value = params.phoneNumber || ''
smsCode.value = params.verifyCode || ''
// 校验参数是否完整 // 实时检查表单状态
// if (!phone.value || !smsCode.value) {
// uni.showToast({
// title: '参数异常,请重新操作',
// icon: 'error'
// })
// setTimeout(() => {
// goBack()
// }, 1500)
// }
// 用完删除缓存(避免下次跳转读取旧值)
uni.removeStorageSync('tempChangePwdParams');
});
// 实时检查表单状态(可扩展自定义提示)
const checkForm = () => { const checkForm = () => {
// 可在这里添加实时的表单错误提示,比如: // 可在这里添加实时的表单错误提示,比如:
if (newPassword.value && !/^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/.test(newPassword.value)) { if (newPassword.value && !/^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/.test(newPassword.value)) {
@@ -142,60 +100,48 @@ const checkForm = () => {
} }
}; };
// 处理确定按钮点击(修改密码逻辑) // 处理确定按钮点击
const handleConfirm = () => { const handleConfirm = () => {
// 二次校验,防止异常点击 // 1. 表单校验
if (!canConfirm.value) {
// 给出具体的错误提示
if (!oldPassword.value) { if (!oldPassword.value) {
uni.showToast({ title: '请输入旧密码', icon: 'none' }); uni.showToast({ title: '请输入旧密码', icon: 'none' });
} else if (!/^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/.test(newPassword.value)) {
uni.showToast({ title: '新密码格式错误(需6-16位,含字母+数字)', icon: 'none' });
} else if (newPassword.value !== confirmPassword.value) {
uni.showToast({ title: '两次输入的密码不一致', icon: 'none' });
}
return; return;
}
if (!/^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/.test(newPassword.value)) {
uni.showToast({ title: '新密码格式错误(需6-16位,含字母+数字)', icon: 'none' });
return;
}
if (newPassword.value !== confirmPassword.value) {
uni.showToast({ title: '两次输入的密码不一致', icon: 'none' });
return;
} }
// 构造请求参数(包含旧密码) // 构造请求参数(包含旧密码)
let params = { let params = {
phone: phone.value, oldPassword: oldPassword.value,
smsCode: smsCode.value,
oldPassword: oldPassword.value, // 新增旧密码参数
newPassword: newPassword.value, newPassword: newPassword.value,
confirmPassword: confirmPassword.value, confirmPassword: confirmPassword.value,
scene: 'reset'
} }
// 显示加载中 // 显示加载中
uni.showLoading({ title: '修改中...' }); uni.showLoading({ title: '修改中...' });
setTimeout(() =>{
uni.navigateTo({
url:`/pageSubPack/setting/setting?newPassword=${confirmPassword.value}`
})
})
// 调用修改密码接口 // 调用修改密码接口
// getResetPassword(params).then(res => { changePassword(params).then(res => {
// uni.hideLoading(); uni.hideLoading();
// if (res.code === 200) { if (res.code === 200) {
// uni.showToast({ title: '修改成功', icon: 'success' }); uni.showToast({ title: '修改成功', icon: 'success' });
// setTimeout(() => { setTimeout(() => {
// // 跳转到登录页(替换为你的实际登录页路径) uni.navigateBack()
// uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' }); }, 1500)
// }, 1500) } else {
// } else { uni.showToast({ title: res.msg || "修改失败", icon: 'error' });
// uni.showToast({ title: res.msg || "修改失败", icon: 'error' }); }
// } }).catch(err => {
// }).catch(err => { uni.hideLoading();
// uni.hideLoading(); uni.showToast({
// uni.showToast({ title: err.msg || '网络异常,请稍后重试',
// title: '网络异常,请稍后重试', icon: 'none'
// icon: 'none' });
// }); })
// console.error('修改密码失败:', err);
// })
}; };
</script> </script>

View File

@@ -8,7 +8,7 @@
<!-- 手机号输入框 --> <!-- 手机号输入框 -->
<view class="input-item"> <view class="input-item">
<view class="input-icon"> <view class="input-icon">
<image src="http://47.104.199.163:9090/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
</view> </view>
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" trim="all" <uni-easyinput class="input-content" type="number" v-model="phoneNumber" trim="all"
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle"> placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
@@ -17,7 +17,7 @@
<!-- 验证码输入 + 获取验证码按钮 --> <!-- 验证码输入 + 获取验证码按钮 -->
<view class="input-item verify-item"> <view class="input-item verify-item">
<view class="input-icon"> <view class="input-icon">
<image src="http://47.104.199.163:9090/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> --> <!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
</view> </view>
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" trim="all" <uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" trim="all"
@@ -44,7 +44,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, onUnmounted } from 'vue'; import { ref, computed, onUnmounted } from 'vue';
import {getSendCode} from '../../api/api.js' import {getSendCode,changePhone} from '../../api/api.js'
// ====响应式数据====== // ====响应式数据======
const phoneNumber = ref('') const phoneNumber = ref('')
@@ -66,7 +66,7 @@ const getVerifyCode = () => {
if (!canGetVerify.value) return; if (!canGetVerify.value) return;
let params = { let params = {
phone:phoneNumber.value, phone:phoneNumber.value,
scene:'reset' scene:'butler_login'
} }
getSendCode(params).then(res =>{ getSendCode(params).then(res =>{
if(res.code === 200){ if(res.code === 200){
@@ -104,19 +104,32 @@ const canRegister = computed(() => {
}); });
// 确认 // 确认
const handleConfirm = () => { const handleConfirm = () => {
// 把参数存到本地缓存
uni.setStorageSync('tempChangePwdParams', {
phoneNumber:phoneNumber.value,
verifyCode: verifyCode.value
});
if (!canRegister.value) { if (!canRegister.value) {
uni.showToast({ title: '请输入',icon: 'error'}); uni.showToast({ title: '请输入正确的手机号和验证码', icon: 'none' })
return return
} }
uni.showLoading({ title: '提交中...' })
changePhone({
phone: phoneNumber.value,
smsCode: verifyCode.value
}).then(res => {
if (res.code === 200) {
uni.showToast({ title: '修改成功', icon: 'success' })
// 把参数存到本地缓存
uni.setStorageSync('tempChangePwdParams', {
phoneNumber:phoneNumber.value
});
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateBack()
url:"/pageSubPack/setting/setting" }, 800)
}) } else {
uni.showToast({ title: res.msg || '修改失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '请求失败,请重试', icon: 'none' })
}).finally(() => {
uni.hideLoading()
}) })
} }
// 返回上一页 // 返回上一页

View File

@@ -29,7 +29,7 @@
<!-- 退出登录按钮 --> <!-- 退出登录按钮 -->
<view class="logout-btn-wrap"> <view class="logout-btn-wrap">
<button class="logout-btn" :disabled="!phoneNumber || !passwordNumber" @tap="handleLogout"> <button class="logout-btn" :disabled="!phoneNumber" @tap="handleLogout">
退出登录 退出登录
</button> </button>
</view> </view>
@@ -38,16 +38,15 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { logout } from '../../api/api.js'
// 响应式数据 // 响应式数据
const phoneNumber = ref('15699991212') // 绑定手机号 const phoneNumber = ref('') // 绑定手机号
const passwordNumber = ref('') const passwordNumber = ref('')
// 页面加载时可从接口获取用户信息 // 页面显示时读取最新数据(从修改页返回也会触发)
onLoad(option => { onShow(() => {
// console.log('option',option)
passwordNumber.value = option.newPassword
const userInfo = uni.getStorageSync('tempChangePwdParams') const userInfo = uni.getStorageSync('tempChangePwdParams')
if (userInfo.phoneNumber) { if (userInfo.phoneNumber) {
phoneNumber.value = userInfo.phoneNumber phoneNumber.value = userInfo.phoneNumber
@@ -92,28 +91,21 @@ const handleLogout = () => {
// 确认退出登录 // 确认退出登录
const confirmLogout = () => { const confirmLogout = () => {
// 模拟退出登录接口请求
uni.showLoading({ title: '退出中...' }) uni.showLoading({ title: '退出中...' })
setTimeout(() => { logout().then(res => {
uni.hideLoading() if (res.code === 200) {
// 清除本地存储的token等信息
uni.clearStorageSync() uni.clearStorageSync()
// uni.removeStorageSync('token') uni.showToast({ title: '退出登录成功', icon: 'success' })
// uni.removeStorageSync('userInfo') uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
// uni.removeStorageSync('tempChangePwdParams') } else {
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
// 提示并跳转到登录页 }
uni.showToast({ }).catch(() => {
title: '退出登录成功', uni.showToast({ title: '退出失败,请重试', icon: 'none' })
icon: 'success' }).finally(() => {
uni.hideLoading()
}) })
// 跳转到登录页,关闭所有页面
uni.redirectTo({
url: '/pageSubPack/loginSub/pwd-login'
})
}, 800)
} }
</script> </script>

View File

@@ -70,15 +70,11 @@
{ {
"path": "notice-list", "path": "notice-list",
"style": { "style": {
"navigationBarTitleText": "通知公告" "navigationBarTitleText": "通知公告",
"enablePullDownRefresh": true,
"onReachBottomDistance": 100
} }
}, },
{
"path": "noticeListDetails",
"style": {
"navigationBarTitleText": "公告详情"
}
}
] ]
}, },
{ {

View File

@@ -14,7 +14,7 @@
<swiper-item> <swiper-item>
<view class="guide-item"> <view class="guide-item">
<view class="guide-img"> <view class="guide-img">
<image src="http://47.104.199.163:9090/images/imgs/guide1.png" style="width: 100%;height: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/guide1.png" style="width: 100%;height: 100%;"></image>
</view> </view>
<view style="height: 200rpx;width: 100%;"></view> <view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">精准服务</view> <view class="guide-title">精准服务</view>
@@ -26,7 +26,7 @@
<swiper-item> <swiper-item>
<view class="guide-item"> <view class="guide-item">
<view class="guide-img"> <view class="guide-img">
<image src="http://47.104.199.163:9090/images/imgs/guide2.png" style="width: 100%;height: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/guide2.png" style="width: 100%;height: 100%;"></image>
</view> </view>
<view style="height: 200rpx;width: 100%;"></view> <view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">高效沟通</view> <view class="guide-title">高效沟通</view>
@@ -38,7 +38,7 @@
<swiper-item> <swiper-item>
<view class="guide-item"> <view class="guide-item">
<view class="guide-img"> <view class="guide-img">
<image src="http://47.104.199.163:9090/images/imgs/guide3.png" style="width: 100%;height: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/guide3.png" style="width: 100%;height: 100%;"></image>
</view> </view>
<view style="height: 200rpx;width: 100%;"></view> <view style="height: 200rpx;width: 100%;"></view>
<view class="guide-title">智能管理</view> <view class="guide-title">智能管理</view>

View File

@@ -13,13 +13,13 @@
<view class="location-area"> <view class="location-area">
<!-- 定位图标 --> <!-- 定位图标 -->
<view class="location-icon"> <view class="location-icon">
<image src="http://47.104.199.163:9090/images/imgs/adress.png" style="height: 100%; width: 100%"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/adress.png" style="height: 100%; width: 100%"></image>
</view> </view>
<!-- 小区名称和下拉箭头 --> <!-- 小区名称和下拉箭头 -->
<view class="community-selector"> <view class="community-selector">
<text class="community-name">{{ currentCommunity }}</text> <text class="community-name">{{ currentCommunity }}</text>
<view class="community-icon"> <view class="community-icon">
<image src="http://47.104.199.163:9090/images/imgs/三角形.png" style="height: 100%; width: 100%"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png" style="height: 100%; width: 100%"></image>
</view> </view>
</view> </view>
</view> </view>
@@ -52,7 +52,8 @@
<view class="noticeClass"> <view class="noticeClass">
<!-- 左侧消息通知文字 --> <!-- 左侧消息通知文字 -->
<view class="notice-left"> <view class="notice-left">
<image src="http://47.104.199.163:9090/images/imgs/notice.png" class="notice-icon"></image> <image src="https://wuyeadmin.bugtc.com/images/imgs/notice.png" class="notice-icon"></image>
<view class="notice-line"></view>
</view> </view>
<!-- 右侧滚动公告 --> <!-- 右侧滚动公告 -->
<view class="notice-right" @click="getNoticeMore"> <view class="notice-right" @click="getNoticeMore">
@@ -74,15 +75,15 @@
<!-- 巡检数据统计区 --> <!-- 巡检数据统计区 -->
<view class="statistics-wrap"> <view class="statistics-wrap">
<view class="statistics-item" @click="goToInspectionRecord"> <view class="statistics-item" @click="goToInspectionRecord">
<text class="num">25</text> <text class="num">{{allCount}}</text>
<text class="label">全部巡检</text> <text class="label">全部巡检</text>
</view> </view>
<view class="statistics-item" @click="goToDaysInspection"> <view class="statistics-item" @click="goToDaysInspection">
<text class="num">5</text> <text class="num">{{pendingCount}}</text>
<text class="label">待巡检</text> <text class="label">待巡检</text>
</view> </view>
<view class="statistics-item"> <view class="statistics-item">
<text class="num">25</text> <text class="num">{{InspectedCount}}</text>
<text class="label">已巡检</text> <text class="label">已巡检</text>
</view> </view>
</view> </view>
@@ -93,26 +94,26 @@
<!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 --> <!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 -->
<view class="function-row"> <view class="function-row">
<view class="function-item" @click="goToReport"> <view class="function-item" @click="goToReport">
<image class="item-icon" src="http://47.104.199.163:9090/images/imgs/fault-report.png" mode="aspectFit"></image> <image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/fault-report.png" mode="aspectFit"></image>
<text class="item-text">故障上报</text> <text class="item-text">故障上报</text>
</view> </view>
<view class="function-item" @click="goToOneOpenDoor"> <view class="function-item" @click="goToOneOpenDoor">
<image class="item-icon" src="http://47.104.199.163:9090/images/imgs/open.png" mode="aspectFit"></image> <image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/open.png" mode="aspectFit"></image>
<text class="item-text">一键开门</text> <text class="item-text">一键开门</text>
</view> </view>
<view class="function-item" @tap="goToTicketHall"> <view class="function-item" @tap="goToTicketHall">
<image class="item-icon" src="http://47.104.199.163:9090/images/imgs/work-order.png" mode="aspectFit"></image> <image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/work-order.png" mode="aspectFit"></image>
<text class="item-text">工单大厅</text> <text class="item-text">工单大厅</text>
</view> </view>
<view class="function-item" @tap="goToMyTicket"> <view class="function-item" @tap="goToMyTicket">
<image class="item-icon" src="http://47.104.199.163:9090/images/imgs/my-work.png" mode="aspectFit"></image> <image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/my-work.png" mode="aspectFit"></image>
<text class="item-text">我的工单</text> <text class="item-text">我的工单</text>
</view> </view>
</view> </view>
<!-- 第二行 --> <!-- 第二行 -->
<view class="function-row" style="margin-top: 2px"> <view class="function-row" style="margin-top: 2px">
<view class="function-item" @tap="goToComplaint"> <view class="function-item" @tap="goToComplaint">
<image class="item-icon" src="http://47.104.199.163:9090/images/imgs/complaint.png" mode="aspectFit"></image> <image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/complaint.png" mode="aspectFit"></image>
<text class="item-text">投诉处理</text> <text class="item-text">投诉处理</text>
</view> </view>
</view> </view>
@@ -123,12 +124,17 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app' import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getCurrentVillage,getTodayInspection,getNewNoticeData } from '../../api/api.js'
// 列表数据状态 // 列表数据状态
const current = ref(0) const current = ref(0)
const currentCommunity = ref('') const currentCommunity = ref('请选择小区')
const bannerList = ref([{ img: 'http://47.104.199.163:9090/images/imgs/banner1.png' }]) const bannerList = ref([{ img: 'https://wuyeadmin.bugtc.com/images/imgs/banner1.png' }])
const noticeText = ref('公告公告本小区今天安装了摄像头') const noticeText = ref('暂无公告')
const allCount = ref(0) // 全部巡检
const pendingCount = ref(0) //待巡检
const InspectedCount = ref(0) //已巡检
// =======方法======= // =======方法=======
// 跳转小区 // 跳转小区
@@ -137,7 +143,7 @@ const navigateToPage = () => {
let villageId = '' let villageId = ''
if(curVillageId){ if(curVillageId){
try{ try{
villageId = JSON.parse(curVillageId).id villageId = JSON.parse(curVillageId).villageId || JSON.parse(curVillageId).id || ''
}catch(e){} }catch(e){}
} }
uni.navigateTo({ uni.navigateTo({
@@ -192,22 +198,59 @@ const goToReport = () => {
url: '/pageSubPack/fault-reporting/fault-reporting' url: '/pageSubPack/fault-reporting/fault-reporting'
}) })
} }
// 获取当前小区
const currentVillageData = () => {
getCurrentVillage().then(res => {
const data = res.data
if (data) {
currentCommunity.value = data.villageName
uni.setStorageSync('currentVillage', JSON.stringify(data))
getNoticeData()
}
}).catch(() => {})
}
// 获取今日巡检数据
const getInspectionData = () =>{
getTodayInspection().then(res =>{
if(res.code === 200){
if(res.data){
allCount.value = res.data.unfinishedPoints
pendingCount.value = res.data.unfinishedTasks
InspectedCount.value = res.data.completedTasks
}else{
allCount.value = 0
pendingCount.value = 0
InspectedCount.value = 0
}
}
}).catch(err =>{
uni.showToast({title:err.msg || '获取失败',icon:'none'})
})
}
// 获取消息通知
const getNoticeData = () => {
getNewNoticeData().then(res => {
if (res.code === 200 && res.data) {
noticeText.value = res.data.notice || ''
}else{
noticeText.value = '暂无公告'
}
}).catch(() => {})
}
// 接收选择小区返回的参数 // 接收选择小区返回的参数
const slelctHomeData = data => { const slelctHomeData = data => {
currentCommunity.value = data.villageName currentCommunity.value = data.villageName
uni.setStorageSync('currentVillage', JSON.stringify(data)) uni.setStorageSync('currentVillage', JSON.stringify(data))
getNoticeData()
getInspectionData()
} }
onLoad(() => { onLoad(() => {
uni.$on('confirm', slelctHomeData) uni.$on('confirm', slelctHomeData)
// 读取本地缓存的小区 // 优先调用接口获取当前小区,失败时再读缓存
const cache = uni.getStorageSync('currentVillage') currentVillageData()
if (cache) { getInspectionData()
try {
const village = JSON.parse(cache)
currentCommunity.value = village.villageName
} catch (e) {}
}
}) })
onUnload(() => { onUnload(() => {
@@ -347,14 +390,24 @@ const clickItem = index => {
border: 1rpx solid rgba(255, 255, 255, 0.1); border: 1rpx solid rgba(255, 255, 255, 0.1);
} }
// 左侧“消息通知”文字 // 左侧”消息通知”文字
.notice-left { .notice-left {
margin-right: 20rpx; display: flex;
} align-items: center;
margin-right: 16rpx;
.notice-icon { .notice-icon {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
margin-right: 15rpx;
}
.notice-line {
width: 1rpx;
height: 40rpx;
background-color: rgba(255, 255, 255, 0.4);
}
} }
// 右侧公告滚动区 // 右侧公告滚动区

View File

@@ -5,7 +5,7 @@
<scroll-view class="page" scroll-y> <scroll-view class="page" scroll-y>
<view class="topBox"> <view class="topBox">
<view class="name"> <view class="name">
<image src="http://47.104.199.163:9090/images/imgs/touxiang.png" class="img" /> <image :src="avatar" class="img" />
<span <span
style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx" style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx"
> >
@@ -37,7 +37,7 @@
> >
</view> </view>
<view class="item-arrow"></view> <view class="item-arrow"></view>
<!-- <image src="http://47.104.199.163:9090/images/propertyImgs/arrow-right.png" class="arrow-icon" /> --> <!-- <image src="https://wuyeadmin.bugtc.com/images/propertyImgs/arrow-right.png" class="arrow-icon" /> -->
</view> </view>
</view> </view>
</div> </div>
@@ -47,29 +47,52 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getSettingInfo } from '../../api/api.js'
const list = ref([ const list = ref([
{ {
icon: 'http://47.104.199.163:9090/images/imgs/shangbao.png', icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png',
title: '上报记录' title: '上报记录'
}, },
{ {
icon: 'http://47.104.199.163:9090/images/imgs/xunjian.png', icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '巡检记录' title: '巡检记录'
// desc: "您可以在这里添加家人、朋友、租客~" // desc: "您可以在这里添加家人、朋友、租客~"
}, },
{ {
icon: 'http://47.104.199.163:9090/images/imgs/xunjian.png', icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
title: '仪表换新' title: '仪表换新'
// desc: "您可以在这里添加家人、朋友、租客~" // desc: "您可以在这里添加家人、朋友、租客~"
}, },
{ {
icon: 'http://47.104.199.163:9090/images/propertyImgs/setting.png', icon: 'https://wuyeadmin.bugtc.com/images/propertyImgs/setting.png',
title: '设置' title: '设置'
} }
]) ])
const loginName = ref('wangh') const loginName = ref('')
const phoneNum = ref('156*****1212') 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
}
}).catch(err =>{
uni.showToast({
title:err.msg || '获取失败',
icon: 'error'
})
})
}
onShow(() => {
fetchUserInfo()
})
// --方法---- // --方法----
const goToDetail = () => { const goToDetail = () => {