This commit is contained in:
Zy
2026-05-21 11:06:03 +08:00
parent af98d07d7d
commit 5909be9a15
4 changed files with 255 additions and 212 deletions

View File

@@ -7,7 +7,8 @@
title="上报记录" title="上报记录"
backgroundColor="transparent" backgroundColor="transparent"
:border="false" :border="false"
@clickLeft="navBack"/> @clickLeft="navBack"
/>
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<view class="status-tabs"> <view class="status-tabs">
@@ -41,13 +42,8 @@
scroll-y scroll-y
:style="{ height: `calc(100vh - ${navHeight + statusTabHeight + typeTabHeight}px)` }" :style="{ height: `calc(100vh - ${navHeight + statusTabHeight + typeTabHeight}px)` }"
> >
<!-- 记录卡片 --> <!-- 记录卡片 -->
<view <view v-for="record in reportRecords" :key="record.id" class="record-card">
v-for="record in reportRecords"
:key="record.id"
class="record-card"
>
<!-- 标题 + 状态标签 --> <!-- 标题 + 状态标签 -->
<view class="card-header"> <view class="card-header">
<text class="card-title">{{ record.item }}</text> <text class="card-title">{{ record.item }}</text>
@@ -59,7 +55,9 @@
<!-- 类型标签 --> <!-- 类型标签 -->
<view class="tag-group"> <view class="tag-group">
<view class="tag-item" v-if="record.projectTypeStr">{{ record.projectTypeStr }}</view> <view class="tag-item" v-if="record.projectTypeStr">{{ record.projectTypeStr }}</view>
<view class="tag-item" v-if="record.maintenanceItemName">{{ record.maintenanceItemName}}</view> <view class="tag-item" v-if="record.maintenanceItemName">{{
record.maintenanceItemName
}}</view>
</view> </view>
<!-- 内容 --> <!-- 内容 -->
@@ -81,16 +79,14 @@
</view> </view>
<!-- 空数据 --> <!-- 空数据 -->
<view class="empty" v-if="reportRecords.length === 0 && !loading"> <view class="empty" v-if="reportRecords.length === 0 && !loading"> 暂无上报记录 </view>
暂无上报记录
</view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import {onReady, onReachBottom, onPullDownRefresh,onShow} from "@dcloudio/uni-app" import { onReady, onReachBottom, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { getMyOrderList } from '../../api/api.js' import { getMyOrderList } from '../../api/api.js'
// 导航栏/标签高度(适配不同设备) // 导航栏/标签高度(适配不同设备)
@@ -142,7 +138,8 @@ const getReportList = (isRefresh = false) => {
if (activeStatus.value !== 'all') { if (activeStatus.value !== 'all') {
params.problemStatus = activeStatus.value params.problemStatus = activeStatus.value
} }
getMyOrderList(params).then(res => { getMyOrderList(params)
.then(res => {
if (res.code === 200) { if (res.code === 200) {
total.value = res.total || 0 total.value = res.total || 0
const data = res.rows || [] const data = res.rows || []
@@ -157,9 +154,11 @@ const getReportList = (isRefresh = false) => {
// 判断是否还有更多 // 判断是否还有更多
noMore.value = reportRecords.value.length >= total.value noMore.value = reportRecords.value.length >= total.value
} }
}).catch(() => { })
.catch(() => {
uni.showToast({ title: '加载失败', icon: 'none' }) uni.showToast({ title: '加载失败', icon: 'none' })
}).finally(() => { })
.finally(() => {
loading.value = false loading.value = false
if (isRefresh) { if (isRefresh) {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
@@ -189,14 +188,14 @@ const reloadList = () => {
} }
// 切换状态(全部/待解决/已完成)筛选 // 切换状态(全部/待解决/已完成)筛选
const switchStatus = (value) => { const switchStatus = value => {
if (activeStatus.value === value) return if (activeStatus.value === value) return
activeStatus.value = value activeStatus.value = value
reloadList() reloadList()
} }
// 切换类型(公共/个人)筛选 // 切换类型(公共/个人)筛选
const switchType = (value) => { const switchType = value => {
if (activeType.value === value) return if (activeType.value === value) return
activeType.value = value activeType.value = value
reloadList() reloadList()
@@ -210,19 +209,19 @@ const navBack = () => {
} }
// 获取状态文本 // 获取状态文本
const getStatusText = (status) => { const getStatusText = status => {
const statusMap = { const statusMap = {
// "pending": '已分配', // "pending": '已分配',
"1": '待解决', 1: '待解决',
'2': '已完成' 2: '已完成'
} }
return statusMap[status] || '' return statusMap[status] || ''
} }
// 获取状态标签样式类名 // 获取状态标签样式类名
const getStatusClass = (status) => { const getStatusClass = status => {
const classMap = { const classMap = {
'1': 'processing', 1: 'processing',
'2': 'completed' 2: 'completed'
} }
return classMap[status] || '' return classMap[status] || ''
} }
@@ -236,7 +235,7 @@ onShow(() => {
onReady(() => { onReady(() => {
// 可根据实际设备调整高度 // 可根据实际设备调整高度
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: res => {
if (res.platform === 'ios') { if (res.platform === 'ios') {
navHeight.value = 44 navHeight.value = 44
} else { } else {
@@ -251,7 +250,7 @@ onReady(() => {
.report-record-page { .report-record-page {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%) background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
} }
.status-bar { .status-bar {
width: 100%; width: 100%;
@@ -282,7 +281,7 @@ onReady(() => {
} }
.status-tab-item.active { .status-tab-item.active {
color: #4D5DFA; color: #4d5dfa;
font-weight: 500; font-weight: 500;
} }
@@ -294,7 +293,7 @@ onReady(() => {
transform: translateX(-50%); transform: translateX(-50%);
width: 80rpx; width: 80rpx;
height: 8rpx; height: 8rpx;
background: linear-gradient(to bottom, #4D5DFA, #BAC0FA); background: linear-gradient(to bottom, #4d5dfa, #bac0fa);
border-radius: 6rpx; border-radius: 6rpx;
} }
@@ -318,8 +317,8 @@ onReady(() => {
} }
.type-tab-item.active { .type-tab-item.active {
color: #4D5DFA; color: #4d5dfa;
border: 2rpx solid #4D5DFA; border: 2rpx solid #4d5dfa;
border-radius: 198rpx; border-radius: 198rpx;
/* background-color: #007AFF; */ /* background-color: #007AFF; */
} }
@@ -363,15 +362,15 @@ onReady(() => {
} }
.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; /* 已完成-蓝色 */
} }
/* 类型标签组 */ /* 类型标签组 */

View File

@@ -8,20 +8,44 @@
<!-- 手机号输入框 --> <!-- 手机号输入框 -->
<view class="input-item"> <view class="input-item">
<view class="input-icon"> <view class="input-icon">
<image src="https://wuyeadmin.bugtc.com/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
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle"> class="input-content"
type="number"
v-model="phoneNumber"
trim="all"
placeholder="请输入手机号"
:inputBorder="false"
maxlength="11"
:placeholderStyle="placeholderStyle"
>
</uni-easyinput> </uni-easyinput>
</view> </view>
<!-- 验证码输入 + 获取验证码按钮 --> <!-- 验证码输入 + 获取验证码按钮 -->
<view class="input-item verify-item"> <view class="input-item verify-item">
<view class="input-icon"> <view class="input-icon">
<image src="https://wuyeadmin.bugtc.com/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
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle"> class="input-content verify-input"
type="number"
v-model="verifyCode"
trim="all"
placeholder="请输入验证码"
:inputBorder="false"
maxlength="6"
:placeholderStyle="placeholderStyle"
>
</uni-easyinput> </uni-easyinput>
<button <button
class="get-verify-btn" class="get-verify-btn"
@@ -32,18 +56,11 @@
</button> </button>
</view> </view>
<!-- 确定 --> <!-- 确定 -->
<button <button class="forget-btn" :disabled="!canRegister" @click="handleConfirm">确定</button>
class="forget-btn"
:disabled="!canRegister"
@click="handleConfirm"
>
确定
</button>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, computed, onUnmounted } from 'vue'; import { ref, computed, onUnmounted } from 'vue'
import { getSendCode, changePhone } from '../../api/api.js' import { getSendCode, changePhone } from '../../api/api.js'
// ====响应式数据====== // ====响应式数据======
@@ -51,19 +68,19 @@ const phoneNumber = ref('')
const verifyCode = ref('') const verifyCode = ref('')
const countDown = ref(0) const countDown = ref(0)
let timer = null; let timer = null
const placeholderStyle = ref('font-size:24rpx') const placeholderStyle = ref('font-size:24rpx')
// ========== 计算属性 ========== // ========== 计算属性 ==========
// 是否可获取验证码(手机号格式正确) // 是否可获取验证码(手机号格式正确)
const canGetVerify = computed(() => { const canGetVerify = computed(() => {
const phoneReg = /^1[3-9]\d{9}$/; const phoneReg = /^1[3-9]\d{9}$/
return phoneReg.test(phoneNumber.value); return phoneReg.test(phoneNumber.value)
}); })
// 获取验证码 // 获取验证码
const getVerifyCode = () => { const getVerifyCode = () => {
if (!canGetVerify.value) return; if (!canGetVerify.value) return
let params = { let params = {
phone: phoneNumber.value, phone: phoneNumber.value,
scene: 'butler_login' scene: 'butler_login'
@@ -73,35 +90,31 @@ const getVerifyCode = () => {
uni.showToast({ uni.showToast({
title: '验证码已发送', title: '验证码已发送',
icon: 'success' icon: 'success'
}); })
// 开始60秒倒计时 // 开始60秒倒计时
countDown.value = 60; countDown.value = 60
timer = setInterval(() => { timer = setInterval(() => {
countDown.value--; countDown.value--
if (countDown.value <= 0) { if (countDown.value <= 0) {
clearInterval(timer); clearInterval(timer)
timer = null; timer = null
} }
}, 1000); }, 1000)
} else { } else {
uni.showToast({ uni.showToast({
title: '验证码发送失败', title: '验证码发送失败',
icon: 'error' icon: 'error'
}); })
} }
}) })
}
};
// 是否确认 // 是否确认
const canRegister = computed(() => { const canRegister = computed(() => {
const phoneReg = /^1[3-9]\d{9}$/; // 手机号11位 const phoneReg = /^1[3-9]\d{9}$/ // 手机号11位
const verifyReg = /^\d{6}$/; // 验证码6位 const verifyReg = /^\d{6}$/ // 验证码6位
return phoneReg.test(phoneNumber.value) return phoneReg.test(phoneNumber.value) && verifyReg.test(verifyCode.value)
&& verifyReg.test(verifyCode.value) })
});
// 确认 // 确认
const handleConfirm = () => { const handleConfirm = () => {
if (!canRegister.value) { if (!canRegister.value) {
@@ -113,22 +126,25 @@ const handleConfirm = () => {
changePhone({ changePhone({
phone: phoneNumber.value, phone: phoneNumber.value,
smsCode: verifyCode.value smsCode: verifyCode.value
}).then(res => { })
.then(res => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ title: '修改成功', icon: 'success' }) uni.showToast({ title: '修改成功', icon: 'success' })
// 把参数存到本地缓存 // 把参数存到本地缓存
uni.setStorageSync('tempChangePwdParams', { uni.setStorageSync('tempChangePwdParams', {
phoneNumber: phoneNumber.value phoneNumber: phoneNumber.value
}); })
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 800) }, 800)
} else { } else {
uni.showToast({ title: res.msg || '修改失败', icon: 'none' }) uni.showToast({ title: res.msg || '修改失败', icon: 'none' })
} }
}).catch(() => { })
.catch(() => {
uni.showToast({ title: '请求失败,请重试', icon: 'none' }) uni.showToast({ title: '请求失败,请重试', icon: 'none' })
}).finally(() => { })
.finally(() => {
uni.hideLoading() uni.hideLoading()
}) })
} }
@@ -136,7 +152,6 @@ const handleConfirm = () => {
// const goBack = () => { // const goBack = () => {
// uni.navigateBack(); // uni.navigateBack();
// }; // };
</script> </script>
<style scoped> <style scoped>
.forget-page { .forget-page {
@@ -209,7 +224,7 @@ const handleConfirm = () => {
width: 200rpx; width: 200rpx;
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
background-color: #4D5DFA; background-color: #4d5dfa;
color: #fff; color: #fff;
border-radius: 35rpx; border-radius: 35rpx;
font-size: 28rpx; font-size: 28rpx;
@@ -226,7 +241,7 @@ const handleConfirm = () => {
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
background-color: #4D5DFA; background-color: #4d5dfa;
color: #fff; color: #fff;
border-radius: 8rpx; border-radius: 8rpx;
font-size: 28rpx; font-size: 28rpx;
@@ -240,6 +255,4 @@ const handleConfirm = () => {
.get-verify-btn:after { .get-verify-btn:after {
border-radius: 40px; border-radius: 40px;
} }
</style> </style>

View File

@@ -15,12 +15,18 @@
<view class="header-container" @click="navigateToPage"> <view class="header-container" @click="navigateToPage">
<view class="location-area"> <view class="location-area">
<view class="location-icon"> <view class="location-icon">
<image src="https://wuyeadmin.bugtc.com/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="https://wuyeadmin.bugtc.com/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>
@@ -50,7 +56,10 @@
<!-- 消息通知栏 --> <!-- 消息通知栏 -->
<view class="noticeClass"> <view class="noticeClass">
<view class="notice-left"> <view class="notice-left">
<image src="https://wuyeadmin.bugtc.com/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 class="notice-line"></view>
</view> </view>
<view class="notice-right" @click="getNoticeMore"> <view class="notice-right" @click="getNoticeMore">
@@ -91,26 +100,46 @@
<!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 --> <!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 -->
<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="https://wuyeadmin.bugtc.com/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="https://wuyeadmin.bugtc.com/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="https://wuyeadmin.bugtc.com/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="https://wuyeadmin.bugtc.com/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="https://wuyeadmin.bugtc.com/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>

View File

@@ -46,13 +46,15 @@ const avatar = ref('')
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0) const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
const fetchUserInfo = () => { const fetchUserInfo = () => {
getSettingInfo().then(res => { getSettingInfo()
.then(res => {
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
loginName.value = res.data.nickName || '' loginName.value = res.data.nickName || ''
phoneNum.value = res.data.phonenumber || '' phoneNum.value = res.data.phonenumber || ''
avatar.value = res.data.avatar || '' avatar.value = res.data.avatar || ''
} }
}).catch(err => { })
.catch(err => {
uni.showToast({ title: err.msg || '获取失败', icon: 'none' }) uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
}) })
} }
@@ -63,10 +65,10 @@ onShow(() => {
const onItemClick = item => { const onItemClick = item => {
const routes = { const routes = {
'上报记录': '/pageSubPack/report-record/report-record', 上报记录: '/pageSubPack/report-record/report-record',
'巡检记录': '/pageSubPack/inspection/inspection_record', 巡检记录: '/pageSubPack/inspection/inspection_record',
'仪表换新': '/pageSubPack/instrument/replacement_record', 仪表换新: '/pageSubPack/instrument/replacement_record',
'设置': '/pageSubPack/setting/setting' 设置: '/pageSubPack/setting/setting'
} }
const url = routes[item.title] const url = routes[item.title]
if (!url) return if (!url) return