This commit is contained in:
zhouyanli
2026-05-22 15:34:19 +08:00
22 changed files with 835 additions and 543 deletions

View File

@@ -1,5 +1,68 @@
node_modules/ # 系统缓存文件
unpackage/
.hbuilderx/
.DS_Store .DS_Store
Thumbs.db
*.swp
*.swo
# 编辑器配置
.idea/
.vscode/
*.iml
*.suo
*.sln
.history/ .history/
# HBuilderX 本地配置
.hbuilderx/
.uni-*/
# 项目依赖
node_modules/
package-lock.json
yarn.lock
pnpm-lock.yaml
# 证书/密钥(上架用的jks证书千万不能传)
*.jks
*.keystore
*.p12
*.key
*.pem
# 编译打包产物
unpackage/
dist/
build/
output/
# 安卓相关
androidPrivacy.json
*.jks
*.keystore
*.p12
local.properties
# iOS相关
*.mobileprovision
*.pem
*.cer
ios/Pods/
ios/build/
ios/DerivedData/
# 日志临时文件
*.log
temp/
tmp/
*.tmp
# 环境配置
.env.local
.env.development.local
.env.test.local
.env.production.local
# 其他冗余文件
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@@ -3,7 +3,7 @@
* @Author: Zy * @Author: Zy
* @Date: 2026-05-19 16:29:20 * @Date: 2026-05-19 16:29:20
* @LastEditor: Zy * @LastEditor: Zy
* @LastEditTime: 2026-05-20 08:36:23 * @LastEditTime: 2026-05-20 10:45:01
*/ */
import request, { import request, {
get, get,
@@ -104,3 +104,30 @@ export function getTicketMainById(id) {
export function ticketComputed(data) { export function ticketComputed(data) {
return put('/manage/repair/order', filterParams(data)) return put('/manage/repair/order', filterParams(data))
} }
/**
* @description: 获取工单大厅 工单列表
* @param {RequestParams<{
* problemStatus:1|2
* }>} data
* @return { Promise<RowsResult<myOrderListType>>}
*/
export function getTicketHallList(data) {
return get('/manage/repair/order/orderlist', filterParams(data))
}
/**
* @description: 分配 维修人员 - 维修工单
* @param {*} data
* @return
*/
export function shareRepairUser(data) {
return post('/manage/repair/order/allocate', filterParams(data))
}

View File

@@ -1,5 +1,12 @@
<template> <template>
<view class="tabs_box"> <view class="tabs-wrapper">
<view
class="tabs_box"
:style="{
height: props.height + 'rpx',
lineHeight: props.height + 'rpx'
}"
>
<view <view
v-for="(item, index) in tabs" v-for="(item, index) in tabs"
:key="index" :key="index"
@@ -13,6 +20,7 @@
{{ item.label }} {{ item.label }}
</view> </view>
</view> </view>
</view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -27,6 +35,7 @@ interface TabItem {
// Props 类型定义 // Props 类型定义
interface Props { interface Props {
tabslist?: any[] tabslist?: any[]
height?: number
showBottomLine?: boolean showBottomLine?: boolean
// 配置:传入字段名 // 配置:传入字段名
options?: { options?: {
@@ -39,6 +48,7 @@ interface Props {
// 定义 Props // 定义 Props
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
tabslist: () => [], tabslist: () => [],
height: 60,
showBottomLine: true, showBottomLine: true,
options: () => ({ label: 'name', value: 'value' }), options: () => ({ label: 'name', value: 'value' }),
activeValue: null activeValue: null
@@ -75,9 +85,12 @@ const handleTabs = (item: TabItem) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tabs-wrapper {
flex-shrink: 0; /* 关键:不让被压缩 */
}
.tabs_box { .tabs_box {
height: 60rpx; height: 80rpx;
line-height: 60rpx; line-height: 80rpx;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -34,7 +34,6 @@
/** /**
* 【全局】角色标识枚举 * 【全局】角色标识枚举
* @typedef {'manage'|'repair'|'inspection'|'EquipmentMaintenance'|'complainUser'} RoleKeyEnum * @typedef {'manage'|'repair'|'inspection'|'EquipmentMaintenance'|'complainUser'} RoleKeyEnum
*
* @enum {RoleKeyEnum} * @enum {RoleKeyEnum}
* @property {'manage'} manage - 物业管理员 * @property {'manage'} manage - 物业管理员
* @property {'repair'} repair - 小区维修人员 * @property {'repair'} repair - 小区维修人员

View File

@@ -1,7 +1,7 @@
{ {
"name": "wuye-uniapp-project", "name" : "花开物业管家端",
"appid": "__UNI__E4ECDAB", "appid" : "__UNI__29C3D60",
"description": "", "description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
@@ -41,9 +41,16 @@
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios": {}, "ios" : {
"dSYMs" : false
},
/* SDK配置 */ /* SDK配置 */
"sdkConfigs": {} "sdkConfigs" : {
"push" : {}
},
"splashscreen" : {
"useOriginalMsgbox" : true
}
} }
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
@@ -66,5 +73,9 @@
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion": "3" "vueVersion" : "3",
"locale" : "zh-Hans",
"fallbackLocale" : "zh-Hans"
} }
/* ios打包配置 *//* SDK配置 */

View File

@@ -4,12 +4,17 @@
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<TabsComponents <TabsComponents
:showBottomLine="false" :showBottomLine="false"
:activeValue="activeStatus"
:tabslist="statusTabs" :tabslist="statusTabs"
@update="switchStatus" @update="switchStatus"
></TabsComponents> ></TabsComponents>
<view class="detail_list flex flex-1 overflow-auto"> <view class="detail_list flex flex-1 overflow-auto">
<scroll-view scroll-y="true" lower-threshold="160" @scrolltolower="scrolltolower"> <scroll-view
style="height: 100%; flex: 1"
scroll-y="true"
lower-threshold="160"
@scrolltolower="scrolltolower"
>
<view <view
class="item" class="item"
v-for="(item, index) in list" v-for="(item, index) in list"
@@ -107,10 +112,6 @@ function init() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
getComplainList(querySearch.value) getComplainList(querySearch.value)
.then(res => { .then(res => {
list.value = [...list.value, ...res.rows] list.value = [...list.value, ...res.rows]
@@ -118,16 +119,27 @@ function init() {
// 判断是否还有更多 // 判断是否还有更多
hasMore.value = list.value.length < total.value hasMore.value = list.value.length < total.value
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
onShow(() => { onShow(() => {
resetList()
})
function resetList() {
list.value = []
querySearch.value.pageNum = 1
querySearch.value.pageSize = 10
hasMore.value = true hasMore.value = true
init() init()
}) }
// actions // actions
function handleComplaint(id: string) { function handleComplaint(id: string) {
@@ -154,7 +166,10 @@ function scrolltolower() {
flex: 1; flex: 1;
background: #f9f9f9; background: #f9f9f9;
padding: 20rpx 40rpx; padding: 20rpx 40rpx;
justify-content: flex-start;
align-items: stretch;
.detail_list { .detail_list {
margin-top: 20rpx;
.item { .item {
background: #ffffff; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;

View File

@@ -66,12 +66,19 @@ function handleBlur(e) {
// 处理投诉 提交 // 处理投诉 提交
function handleSelecthouse() { function handleSelecthouse() {
if (checkoutinfo.value.userId) {
putComplainProcess({ putComplainProcess({
id: form.value.complaintId, id: form.value.complaintId,
handleContent: form.value.handleContent handleContent: form.value.handleContent
}).then(() => { }).then(() => {
uni.navigateBack() uni.navigateBack()
}) })
} else {
uni.showToast({
icon: 'error',
title: '选择处理人员'
})
}
} }
</script> </script>

View File

@@ -6,17 +6,19 @@
<view <view
@click="handleClick" @click="handleClick"
class="search_view flex-center" class="search_view flex-center"
v-if="!queryParmas.value.trim() && Searching" v-if="!queryParmas.keyword.trim() && Searching"
> >
<uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons> <uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons>
<text>请输入关键字进行搜索</text> <text>请输入关键字进行搜索</text>
</view> </view>
<uni-easyinput <uni-easyinput
@blur="handleInput" @blur="handleInput"
@change="handleSearch" @confirm="handleSearch"
@clear="handleClear"
@input="handleClear"
:focus="true" :focus="true"
ref="inputRef" ref="inputRef"
v-model="queryParmas.value" v-model="queryParmas.keyword"
v-else v-else
/> />
</view> </view>
@@ -67,6 +69,7 @@
import { ref, onMounted, getCurrentInstance } from 'vue' import { ref, onMounted, getCurrentInstance } from 'vue'
import { getSystemUsers_employee } from '@/api/common.js' import { getSystemUsers_employee } from '@/api/common.js'
import navBar from '@/components/navbar/navbar.vue' import navBar from '@/components/navbar/navbar.vue'
import { onShow } from '@dcloudio/uni-app'
let eventChannel = null let eventChannel = null
onMounted(() => { onMounted(() => {
@@ -81,11 +84,27 @@ function handleClick() {
} }
/** 判断 失去焦点时 切换回 view */ /** 判断 失去焦点时 切换回 view */
function handleInput() { function handleInput() {
if (queryParmas.value.value.trim()) { if (queryParmas.value.keyword.trim()) {
Searching.value = true Searching.value = true
resetList()
} else {
queryParmas.value.keyword = ''
Searching.value = false
resetList()
}
}
function handleSearch() {
if (queryParmas.value.keyword.trim()) {
resetList()
}
}
function handleClear() {
if (queryParmas.value.keyword.trim() === '') {
queryParmas.value.keyword = ''
Searching.value = true
resetList()
} }
} }
function handleSearch() {}
// ----------------------------------------- // -----------------------------------------
/* 选择列表 */ /* 选择列表 */
const searchlist = ref([]) const searchlist = ref([])
@@ -93,40 +112,39 @@ const searchlist = ref([])
const queryParmas = ref({ const queryParmas = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
value: '' keyword: ''
}) })
const isLoading = ref(false) // 加载锁 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() { function getlist() {
// 2. 开启锁 // 2. 开启锁
if (isLoading.value) { if (isLoading.value) {
return return
} }
isLoading.value = true isLoading.value = true
uni.showLoading({ getSystemUsers_employee('complainUser', queryParmas.value.keyword)
title: '加载中',
mask: true
})
getSystemUsers_employee('complainUser', queryParmas.value.value)
.then(res => { .then(res => {
searchlist.value = res.data searchlist.value = res.data
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
onShow(() => {
getlist() getlist()
})
function resetList() {
searchlist.value = []
queryParmas.value.pageNum = 1
getlist()
}
//======================= //=======================
// 选中的人员id // 选中的人员id
const checkoutUserid = ref(null) const checkoutUserid = ref(null)

View File

@@ -145,7 +145,7 @@ function init() {
.filter(item => item !== false) .filter(item => item !== false)
baseFormData.value = result baseFormData.value = result
}) })
.catch(err => { .catch(() => {
uni.showToast({ uni.showToast({
icon: 'error', icon: 'error',
title: '网络异常' title: '网络异常'

View File

@@ -3,7 +3,11 @@
<view class="page_padding"> <view class="page_padding">
<view class="inspection_record_box flex-1 flex flex-col"> <view class="inspection_record_box flex-1 flex flex-col">
<navBar @clickLeft="navBack" title="巡检记录"></navBar> <navBar @clickLeft="navBack" title="巡检记录"></navBar>
<TabsComponents :tabslist="tabslist" @update="handleChangeTabs"></TabsComponents> <TabsComponents
:activeValue="activeValue"
:tabslist="tabslist"
@update="handleChangeTabs"
></TabsComponents>
<view class="timebox"> <view class="timebox">
<view class="daybox flex items-center"> <view class="daybox flex items-center">
<uni-datetime-picker <uni-datetime-picker
@@ -12,13 +16,15 @@
@change="handleChangeTime" @change="handleChangeTime"
v-model="queryParmas.date" v-model="queryParmas.date"
> >
<view class="flex">
<view class="day">{{ showDate }}</view> <view class="day">{{ showDate }}</view>
</uni-datetime-picker>
<view class="searchiconbox flex items-center"> <view class="searchiconbox flex items-center">
<view class="arrow"> </view> <view class="arrow"> </view>
<view class="arrow1"> </view> <view class="arrow1"> </view>
</view> </view>
</view> </view>
</uni-datetime-picker>
</view>
</view> </view>
<scroll-view <scroll-view
class="record_body record-list" class="record_body record-list"
@@ -87,6 +93,7 @@ const tabslist = [
value: 1 value: 1
} }
] ]
const activeValue = ref(2)
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@@ -110,10 +117,6 @@ function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
const { pageNum, pageSize, date, status } = queryParmas.value const { pageNum, pageSize, date, status } = queryParmas.value
getInspectionList({ getInspectionList({
pageSize, pageSize,
@@ -134,9 +137,14 @@ function getlist() {
hasMore.value = list.value.length < res.total hasMore.value = list.value.length < res.total
total.value = res.total total.value = res.total
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
@@ -167,6 +175,7 @@ function scrolltolower() {
} }
function handleChangeTabs(val: number) { function handleChangeTabs(val: number) {
activeValue.value = val
hasMore.value = true hasMore.value = true
queryParmas.value.status = val queryParmas.value.status = val
queryParmas.value.pageNum = 1 queryParmas.value.pageNum = 1
@@ -182,8 +191,17 @@ function init() {
onShow(() => { onShow(() => {
hasMore.value = true hasMore.value = true
init() resetList()
}) })
function resetList() {
list.value = []
queryParmas.value.status = 2
queryParmas.value.pageSize = 10
queryParmas.value.pageSize = 10
hasMore.value = true
init()
}
// 返回上一页 // 返回上一页
const navBack = () => { const navBack = () => {
uni.navigateBack() uni.navigateBack()
@@ -200,7 +218,7 @@ const navBack = () => {
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
.timebox { .timebox {
width: 178rpx; width: 188rpx;
height: 48rpx; height: 48rpx;
background: #ffffff; background: #ffffff;
border-radius: 24rpx; border-radius: 24rpx;
@@ -208,7 +226,7 @@ const navBack = () => {
line-height: 48rpx; line-height: 48rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #999;
margin-bottom: 20rpx; margin-bottom: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
.daybox { .daybox {

View File

@@ -2,7 +2,11 @@
<view class="page_padding"> <view class="page_padding">
<view class="today_inspection_page flex flex-col"> <view class="today_inspection_page flex flex-col">
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<TabsComponents :tabslist="tabslist" @update="handleTabs"></TabsComponents> <TabsComponents
:activeValue="activeValue"
:tabslist="tabslist"
@update="handleTabs"
></TabsComponents>
<!-- body --> <!-- body -->
<view class="inspection_body flex-1" v-if="list.length > 0"> <view class="inspection_body flex-1" v-if="list.length > 0">
<view <view
@@ -97,10 +101,7 @@ const total = ref(0)
function getlist() { function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
const { pageNum, pageSize, date, status } = queryParmas.value const { pageNum, pageSize, date, status } = queryParmas.value
getInspectionList({ getInspectionList({
pageSize, pageSize,
@@ -121,9 +122,14 @@ function getlist() {
hasMore.value = list.value.length < res.total hasMore.value = list.value.length < res.total
total.value = res.total total.value = res.total
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
/** 跳转到巡检上传页面 */ /** 跳转到巡检上传页面 */

View File

@@ -56,6 +56,7 @@
<script setup> <script setup>
import { ref, getCurrentInstance, onMounted } from 'vue' import { ref, getCurrentInstance, onMounted } from 'vue'
import { getVillageHouseList_keyword } from '@/api/common.js' import { getVillageHouseList_keyword } from '@/api/common.js'
import { onShow } from '@dcloudio/uni-app'
const Searching = ref(true) const Searching = ref(true)
const queryParmas = ref({ const queryParmas = ref({
@@ -116,10 +117,7 @@ function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
getVillageHouseList_keyword(queryParmas.value, queryParmas.value.searchValue) getVillageHouseList_keyword(queryParmas.value, queryParmas.value.searchValue)
.then(res => { .then(res => {
// 追加数据(正确方式) // 追加数据(正确方式)
@@ -136,10 +134,12 @@ function getlist() {
}) })
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
getlist()
onShow(() => {
resetList()
})
// 重置list // 重置list
function resetList() { function resetList() {

View File

@@ -5,7 +5,11 @@
<view class="line"></view> <view class="line"></view>
<text class="title">仪表换新记录</text> <text class="title">仪表换新记录</text>
</view> </view>
<TabsComponents :tabslist="tabslist" @update="handleChangeTabs"></TabsComponents> <TabsComponents
:activeValue="activeValue"
:tabslist="tabslist"
@update="handleChangeTabs"
></TabsComponents>
<view class="instrument_body flex-1 flex"> <view class="instrument_body flex-1 flex">
<scroll-view scroll-y lower-threshold="160" @scrolltolower="scrolltolower"> <scroll-view scroll-y lower-threshold="160" @scrolltolower="scrolltolower">
<view <view
@@ -75,10 +79,11 @@ const tabslist = [
value: 1 value: 1
} }
] ]
const activeValue = ref(0)
// 切换tabs // 切换tabs
function handleChangeTabs(val: number) { function handleChangeTabs(val: number) {
queryParmas.value.deviceType = val queryParmas.value.deviceType = val
activeValue.value = val
if (val === 0) { if (val === 0) {
queryParmas.value.deviceType = undefined queryParmas.value.deviceType = undefined
} }
@@ -111,10 +116,6 @@ function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
const { pageNum, pageSize, deviceType } = queryParmas.value const { pageNum, pageSize, deviceType } = queryParmas.value
getReplaceMainList({ getReplaceMainList({
pageNum, pageNum,
@@ -126,15 +127,18 @@ function getlist() {
total.value = res.total total.value = res.total
hasMore.value = infolist.value.length < total.value hasMore.value = infolist.value.length < total.value
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
onShow(() => { onShow(() => {
infolist.value = [] resetList()
hasMore.value = true
getlist()
}) })
// 重置 // 重置

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

@@ -7,6 +7,7 @@
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<TabsComponents <TabsComponents
:tabslist="statusTabs" :tabslist="statusTabs"
:activeValue="activeStatus"
:options="{ label: 'label', value: 'value' }" :options="{ label: 'label', value: 'value' }"
@update="switchStatus" @update="switchStatus"
></TabsComponents> ></TabsComponents>
@@ -40,49 +41,50 @@
> >
<!-- 标题 + 状态标签 --> <!-- 标题 + 状态标签 -->
<view class="card-header"> <view class="card-header">
<text class="card-title">{{ record.title }}</text> <text class="card-title">{{ record.item }}</text>
<view <view
class="status-tag" class="status-tag"
:class="{ :class="{
pending: record.repairStatus === 0, pending: record.problemStatus === statusMap.pending,
processing: record.repairStatus === 1, processing: record.problemStatus === statusMap.processing,
completed: record.repairStatus === 2 completed: record.problemStatus === statusMap.completed
}" }"
> >
{{ getStatusText(record.repairStatus) }} {{ getStatusText(record.problemStatus) }}
</view> </view>
</view> </view>
<!-- 类型标签 --> <!-- 类型标签 -->
<view class="tag-group"> <view class="tag-group" v-if="record.maintenanceItemName || record.projectTypeStr">
<view class="tag-item">{{ record.reportType }}</view> <view class="tag-item" v-if="record.projectTypeStr">{{ record.projectTypeStr }}</view>
<view class="tag-item">{{ record.category }}</view> <view class="tag-item" v-if="record.maintenanceItemName">{{
record.maintenanceItemName
}}</view>
</view> </view>
<!-- 内容 --> <!-- 内容 -->
<view class="card-content"> <view class="card-content">
{{ record.content }} {{ record.problem }}
</view> </view>
<!-- 工单图片 --> <!-- 工单图片 -->
<view class="card-image" v-if="record.images.length > 0"> <view class="card-image" v-if="record.repairImageUrlList.length > 0">
<image <image
lazy-load lazy-load
v-for="(item, index) in record.images" v-for="(item, index) in record.repairImageUrlList"
:key="index" :key="index"
:src="item" :src="item"
class="images" class="images"
mode="scaleToFill" mode="scaleToFill"
@tap="handlePrivew(record.images)"
></image> ></image>
</view> </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 === 1" class="repairman" <text v-if="record.problemStatus === statusMap.processing" class="repairman"
>维修师傅:{{ record.repairman }}</text >维修师傅:{{ record.repairName }}</text
> >
<view class="share" v-if="record.repairStatus === 0"> <view class="share" v-if="record.problemStatus === statusMap.pending">
<text>分配</text> <text>分配</text>
</view> </view>
</view> </view>
@@ -94,41 +96,44 @@
<script setup> <script setup>
import { ref, computed, nextTick } from 'vue' import { ref, computed, nextTick } from 'vue'
import { onReady } from '@dcloudio/uni-app' import { onReady, onShow } from '@dcloudio/uni-app'
import TabsComponents from '@/components/tabs/tabs.vue' import TabsComponents from '@/components/tabs/tabs.vue'
import NavBar from '@/components/navbar/navbar.vue' import NavBar from '@/components/navbar/navbar.vue'
import { getTicketHallList } from '@/api/ticket.js'
// 导航栏/标签高度(适配不同设备) // 导航栏/标签高度(适配不同设备)
// 筛选状态 // 筛选状态
const activeStatus = ref('0') // 全部/待分配/待解决/已完成 const activeStatus = ref(-1) // 全部/待分配/待解决/已完成
const activeType = ref('all') // 全部/公共报修/个人报修 const activeType = ref(-1) // 全部/公共报修/个人报修
// 0 已提交 1已分配 2维修完成
// 状态筛选选项 // 状态筛选选项
const statusTabs = ref([ const statusTabs = ref([
{ label: '全部', value: 0 }, { label: '全部', value: -1 },
{ label: '待分配', value: 1 }, { label: '待分配', value: 0 },
{ label: '待解决', value: 2 }, { label: '待解决', value: 1 },
{ label: '已完成', value: 3 } { label: '已完成', value: 2 }
]) ])
// 类型筛选选项 // 类型筛选选项
const typeTabs = ref([ const typeTabs = ref([
{ label: '全部', value: 'all' }, { label: '全部', value: -1 },
{ label: '公共报修', value: 'public' }, { label: '公共报修', value: 0 },
{ label: '个人报修', value: 'private' } { label: '个人报修', value: 1 }
]) ])
// 模拟上报记录数据(实际项目替换为接口请求) // 模拟上报记录数据(实际项目替换为接口请求)
const reportRecords = ref([]) const reportRecords = ref([])
const queryParmas = ref({ const queryParmas = ref({
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5,
itemType: undefined, // -1 全部/ 0 公共报修/ 1 个人报修
problemStatus: undefined // 0 已提交 1已分配 2维修完成
}) })
const isLoading = ref(false) // 加载锁 const isLoading = ref(false) // 加载锁
const hasMore = ref(true) // 是否还有更多数据 const hasMore = ref(true) // 是否还有更多数据
const total = ref(21) const total = ref(0)
function scrolltolower() { function scrolltolower() {
// 必须加这两个判断! // 必须加这两个判断!
if (isLoading.value || !hasMore.value) { if (isLoading.value || !hasMore.value) {
@@ -137,68 +142,80 @@ function scrolltolower() {
queryParmas.value.pageNum += 1 queryParmas.value.pageNum += 1
getlist() getlist()
} }
function getlist() { function getlist() {
// 1. 如果正在加载或没有更多数据,直接返回
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({ getTicketHallList(queryParmas.value)
title: '加载中', .then(res => {
mask: true reportRecords.value = [...reportRecords.value, ...res.rows]
reportRecords.value.forEach(item => {
item.repairImageUrlList = item.repairImageUrl
? item.repairImageUrl.split(',').filter(item => item)
: []
}) })
const { pageNum, pageSize } = queryParmas.value total.value = res.total
const startId = (pageNum - 1) * pageSize + 1
const arr = Array.from({ length: pageSize }).map((_, index) => {
const realId = startId + index // ✅ 修复 ID 错误
// ✅ 随机生成 0、1、2
const randomStatus = Math.floor(Math.random() * 3)
return {
id: realId,
title: '标题巴拉巴拉巴拉' + startId + 1,
status: 'completed',
reportType: '公共报修',
category: '路灯',
content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
createTime: '2026-08-01 10:05:46',
images: ['https://picsum.photos/93', 'https://picsum.photos/93', 'https://picsum.photos/93'],
repairman: '张三',
repairStatus: randomStatus // 0 待分配,1待解决 2已完成
}
})
// 追加数据(正确方式)
reportRecords.value = [...reportRecords.value, ...arr]
// 判断是否还有更多
hasMore.value = reportRecords.value.length < total.value hasMore.value = reportRecords.value.length < total.value
})
.catch(err => {
uni.showToast({
icon: 'error',
title: '网络错误'
})
})
.finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading() })
} }
getlist()
onShow(() => {
resetList()
})
function resetList() { function resetList() {
reportRecords.value = [] reportRecords.value = []
queryParmas.value.pageNum = 1 queryParmas.value.pageNum = 1
queryParmas.value.pageSize = 5
hasMore.value = true hasMore.value = true
getlist() getlist()
} }
// 切换状态(全部/待分配/待解决/已完成)筛选 // 切换状态(全部/待分配/待解决/已完成)筛选
const switchStatus = value => { const switchStatus = value => {
activeStatus.value = value activeStatus.value = value
if (value === -1) {
queryParmas.value.problemStatus = undefined
} else {
queryParmas.value.problemStatus = value
}
resetList() resetList()
} }
// 切换类型(公共/个人)筛选 // 切换类型(公共/个人)筛选
const switchType = value => { const switchType = value => {
activeType.value = value activeType.value = value
if (value === -1) {
queryParmas.value.itemType = undefined
} else {
queryParmas.value.itemType = value
}
resetList() resetList()
} }
const statusMap = ['待分配', '待解决', '已完成'] const statusMap = {
已提交: '待分配',
已分配: '待解决',
已完成: '已完成',
pending: '已提交',
processing: '已分配',
completed: '已完成'
}
// 获取状态文本 // 获取状态文本
const getStatusText = status => { const getStatusText = status => {
return statusMap[status] || '' return statusMap[status] || ''
} }
// 返回上一页 // 返回上一页
const navBack = () => { const navBack = () => {
uni.navigateBack() uni.navigateBack()
@@ -334,10 +351,11 @@ function handlePrivew(imgs) {
.card-title { .card-title {
margin-right: 20rpx; margin-right: 20rpx;
font-weight: 450;
font-size: 32rpx; font-weight: 400;
color: #222222; color: #222222;
line-height: 40rpx; line-height: 40rpx;
font-size: 32rpx;
} }
/* 状态标签 */ /* 状态标签 */
@@ -389,11 +407,11 @@ function handlePrivew(imgs) {
/* 内容 */ /* 内容 */
.card-content { .card-content {
margin-bottom: 20rpx; margin-bottom: 20rpx;
font-weight: 450; letter-spacing: 2rpx;
font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
line-height: 40rpx; line-height: 40rpx;
letter-spacing: 2rpx;
} }
/* 图片 */ /* 图片 */
.card-image { .card-image {
@@ -417,6 +435,12 @@ function handlePrivew(imgs) {
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
} }
.create-time {
font-weight: 400;
font-size: 28rpx;
color: #999999;
line-height: 40rpx;
}
.share { .share {
width: 127rpx; width: 127rpx;
height: 44rpx; height: 44rpx;
@@ -431,6 +455,9 @@ function handlePrivew(imgs) {
} }
.repairman { .repairman {
color: #999; font-weight: 400;
font-size: 28rpx;
color: #999999;
line-height: 40rpx;
} }
</style> </style>

View File

@@ -5,6 +5,7 @@
<view class="hall_body flex-1 flex flex-col"> <view class="hall_body flex-1 flex flex-col">
<!-- 状态筛选标签 --> <!-- 状态筛选标签 -->
<TabsComponents <TabsComponents
:activeValue="activeStatus"
:tabslist="statusTabs" :tabslist="statusTabs"
:options="{ label: 'label', value: 'value' }" :options="{ label: 'label', value: 'value' }"
@update="switchStatus" @update="switchStatus"
@@ -140,23 +141,24 @@ function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
getUserTicketlist(queryParmas.value) getUserTicketlist(queryParmas.value)
.then(res => { .then(res => {
reportRecords.value = [...reportRecords.value, ...res.rows] reportRecords.value = [...reportRecords.value, ...res.rows]
hasMore.value = reportRecords.value.length < total.value hasMore.value = reportRecords.value.length < total.value
total.value = res.total total.value = res.total
}) })
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
.finally(() => { .finally(() => {
isLoading.value = false isLoading.value = false
uni.hideLoading()
}) })
} }
onShow(() => { onShow(() => {
getlist() resetList()
}) })
function resetList() { function resetList() {
reportRecords.value = [] reportRecords.value = []

View File

@@ -142,7 +142,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
import Stops from '@/components/stops/stops.vue' import Stops from '@/components/stops/stops.vue'
import { getTicketMainById } from '@/api/ticket.js' import { getTicketMainById, shareRepairUser } from '@/api/ticket.js'
// -------------------------------------- // --------------------------------------
/** 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成*/ /** 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成*/
const currentStep = ref(2) const currentStep = ref(2)
@@ -203,6 +203,7 @@ onShow(() => {
}) })
function getTicketById() { function getTicketById() {
if (!queryParams.value.id) return
getTicketMainById(queryParams.value.id) getTicketMainById(queryParams.value.id)
.then(res => { .then(res => {
repairInfo.value = res.data repairInfo.value = res.data
@@ -225,28 +226,61 @@ function getTicketById() {
function handleStop(row) { function handleStop(row) {
// 0 已提交 1 已分配 2已解决 // 0 已提交 1 已分配 2已解决
let status = row.problemStatus let status = row.problemStatus
currentStep.value = 0
// 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成 // 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成
if (status === '0') { if (status === '0') {
currentStep.value = 1 currentStep.value = 1
stepList.value[0].desc = '提交报修成功' stepList.value[0].desc = '提交报修成功'
} else if (status === '1') { return
}
if (status === '1') {
currentStep.value = 2 currentStep.value = 2
stepList.value[1].title = '已派单' stepList.value[1].title = '已派单'
stepList.value[1].desc = '物业已派单' stepList.value[1].desc = '物业已派单'
stepList.value[2].title = '待解决' stepList.value[2].title = '待解决'
stepList.value[2].desc = `维修人员(${row.repairName})维修中` stepList.value[2].desc = `维修人员(${row.repairName})维修中`
} else if (status === '2') { return
}
console.log(status)
if (status === '2') {
currentStep.value = 4 currentStep.value = 4
stepList.value[0].desc = '提交报修成功'
stepList.value[1].title = '已派单'
stepList.value[1].desc = '物业已派单'
stepList.value[2].title = '已解决' stepList.value[2].title = '已解决'
stepList.value[2].desc = `维修人员(${row.repairName})已解决` stepList.value[2].desc = `维修人员(${row.repairName})已解决`
} else { return
currentStep.value = 0
} }
} }
/** 选择维修人员 */ /** 选择维修人员 */
function handleSelecthouse() { function handleSelecthouse() {
uni.navigateTo({ uni.navigateTo({
url: '/pageSubPack/ticket/shareUser' url: '/pageSubPack/ticket/shareUser',
events: {
backData: data => {
const repairid = data.checkoutUserid
if (repairid) {
shareRepairUser({
id: repairInfo.value.id,
repairId: repairid
})
.then(res => {
uni.showToast({
icon: 'success',
title: '分配成功'
})
getTicketById()
})
.catch(() => {
uni.showToast({
icon: 'error',
title: '网络异常'
})
})
}
}
}
}) })
} }

View File

@@ -6,44 +6,41 @@
<view <view
@click="handleClick" @click="handleClick"
class="search_view flex-center" class="search_view flex-center"
v-if="!queryParmas.value.trim() && Searching" v-if="!queryParmas.keyword.trim() && Searching"
> >
<uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons> <uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons>
<text>请输入关键字进行搜索</text> <text>请输入关键字进行搜索</text>
</view> </view>
<uni-easyinput <uni-easyinput
@blur="handleInput" @blur="handleInput"
@change="handleSearch" @confirm="handleSearch"
@clear="handleClear"
@input="handleClear"
:focus="true" :focus="true"
ref="inputRef" ref="inputRef"
v-model="queryParmas.value" v-model="queryParmas.keyword"
v-else v-else
/> />
</view> </view>
<!-- 已经选择人数 --> <!-- 已经选择人数 -->
<view class="checkoutedUser_box"> <view class="checkoutedUser_box">
<text>已选({{ checkoutUserid ? 1 : 0 }}/1)</text> <text>已选({{ checkoutUserid ? 1 : 0 }}/1)</text>
<text class="checkoutUseName" v-if="checkoutInfo">{{ checkoutInfo.name }}</text> <text class="checkoutUseName" v-if="checkoutInfo">{{ checkoutInfo.nickName }}</text>
</view> </view>
<!-- srcoll --> <!-- srcoll -->
<scroll-view <scroll-view scroll-y="true" class="flex-1 overflow-auto">
scroll-y="true"
class="flex-1 overflow-auto"
lower-threshold="60"
@scrolltolower="scrolltolower"
>
<radio-group @change="radioChange"> <radio-group @change="radioChange">
<label v-for="(item, index) in searchlist" :key="index"> <label v-for="(item, index) in searchlist" :key="index">
<view <view
class="item flex items-center justify-between" class="item flex items-center justify-between"
:class="{ :class="{
active: checkoutUserid === item.id active: checkoutUserid === item.userId
}" }"
> >
<view class=""> <view class="">
<view class="info"> <view class="info">
<text>姓名:</text> <text>姓名:</text>
<text>{{ item.name }}</text> <text>{{ item.nickName }}</text>
</view> </view>
<view class="info"> <view class="info">
<text>角色:</text> <text>角色:</text>
@@ -51,10 +48,10 @@
</view> </view>
<view class="info"> <view class="info">
<text>手机号码:</text> <text>手机号码:</text>
<text>{{ item.phone }}</text> <text>{{ item.phonenumber }}</text>
</view> </view>
</view> </view>
<radio color="#4d5dfa" :value="item.id" /> <radio color="#4d5dfa" :value="item.userId" />
</view> </view>
</label> </label>
</radio-group> </radio-group>
@@ -71,6 +68,9 @@
<script setup> <script setup>
import { ref, onMounted, getCurrentInstance } from 'vue' import { ref, onMounted, getCurrentInstance } from 'vue'
import navBar from '@/components/navbar/navbar.vue' import navBar from '@/components/navbar/navbar.vue'
import { getSystemUsers_employee } from '@/api/common.js'
import { onShow } from '@dcloudio/uni-app'
const Searching = ref(true) const Searching = ref(true)
/** 点击时切换到input,并聚焦 */ /** 点击时切换到input,并聚焦 */
function handleClick() { function handleClick() {
@@ -78,73 +78,74 @@ function handleClick() {
} }
/** 判断 失去焦点时 切换回 view */ /** 判断 失去焦点时 切换回 view */
function handleInput() { function handleInput() {
if (queryParmas.value.value.trim()) { if (queryParmas.value.keyword.trim()) {
Searching.value = true Searching.value = true
resetList()
} else {
queryParmas.value.keyword = ''
Searching.value = false
resetList()
}
}
function handleSearch() {
if (queryParmas.value.keyword.trim()) {
resetList()
}
}
function handleClear() {
if (queryParmas.value.keyword.trim() === '') {
queryParmas.value.keyword = ''
Searching.value = true
resetList()
} }
} }
function handleSearch() {}
// ----------------------------------------- // -----------------------------------------
/* 选择列表 */ /* 选择列表 */
const searchlist = ref([]) const searchlist = ref([])
const queryParmas = ref({ const queryParmas = ref({
pageNum: 1, keyword: '',
pageSize: 10, roleKey: 'repair'
value: ''
}) })
const isLoading = ref(false) // 加载锁 const isLoading = ref(false) // 加载锁
const hasMore = ref(true) // 是否还有更多数据 const hasMore = ref(true) // 是否还有更多数据
const total = ref(21)
function scrolltolower() {
// 必须加这两个判断!
if (isLoading.value || !hasMore.value) {
return
}
queryParmas.value.pageNum += 1
getlist()
}
function getlist() { function getlist() {
// 1. 如果正在加载或没有更多数据,直接返回 // 1. 如果正在加载或没有更多数据,直接返回
if (isLoading.value || !hasMore.value) return if (isLoading.value) return
// 2. 开启锁 // 2. 开启锁
isLoading.value = true isLoading.value = true
uni.showLoading({ const { keyword, roleKey } = queryParmas.value
title: '加载中', getSystemUsers_employee(roleKey, keyword)
mask: true .then(res => {
searchlist.value = res.data
}) })
const { pageNum, pageSize } = queryParmas.value .catch(() => {
uni.showToast({
const startId = (pageNum - 1) * pageSize + 1 icon: 'error',
const arr = Array.from({ length: pageSize }).map((_, index) => { title: '网络异常'
const realId = startId + index
const randomStatus = Math.floor(Math.random() * 3)
return {
name: '张三' + realId,
roleName: '维修人员',
phone: '19578012123',
id: realId
}
}) })
// 追加数据(正确方式) })
searchlist.value = [...searchlist.value, ...arr] .finally(() => {
// 判断是否还有更多
hasMore.value = searchlist.value.length < total.value
isLoading.value = false isLoading.value = false
uni.hideLoading() })
} }
getlist()
onShow(() => {
resetList()
})
function resetList() { function resetList() {
reportRecords.value = [] searchlist.value = []
queryParmas.value.pageNum = 1 queryParmas.value.pageNum = 1
hasMore.value = true
getlist() getlist()
} }
//searchlist---------------------- //searchlist----------------------
const checkoutUserid = ref(null) const checkoutUserid = ref(null)
const checkoutInfo = ref(null) const checkoutInfo = ref(null)
function radioChange(val) { function radioChange(val) {
checkoutUserid.value = Number(val.detail.value) checkoutUserid.value = val.detail.value
const find = searchlist.value.find(item => item.id === Number(val.detail.value)) const find = searchlist.value.find(item => item.userId === val.detail.value)
if (find) { if (find) {
checkoutInfo.value = find checkoutInfo.value = find
} }
@@ -161,12 +162,14 @@ onMounted(() => {
/* 确定派单 */ /* 确定派单 */
function handleSelecthouse() { function handleSelecthouse() {
// api // api
if (eventChannel) {
eventChannel.emit('backData', { eventChannel.emit('backData', {
checkoutUserid: checkoutUserid.value checkoutUserid: checkoutUserid.value
}) })
// 3. 返回上一页 // 3. 返回上一页
uni.navigateBack() uni.navigateBack()
} }
}
// =========================================== // ===========================================
</script> </script>

View File

@@ -271,12 +271,6 @@
"^uni-(.*)": "@/components/uni-$1.vue" "^uni-(.*)": "@/components/uni-$1.vue"
} }
}, },
"condition": {
"list": [{
"name": "维修完成",
"path": "pageSubPack/ticket/repairCompleted"
}]
},
"tabBar": { "tabBar": {
"color": "#333333", "color": "#333333",
"backgroundColor": "#F5F6F6", "backgroundColor": "#F5F6F6",

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>
@@ -122,8 +151,12 @@
<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,getBannarList} from '../../api/api.js' import {
getCurrentVillage,
getTodayInspection,
getNewNoticeData,
getBannarList
} from '../../api/api.js'
// 列表数据状态 // 列表数据状态
const current = ref(0) const current = ref(0)
@@ -212,7 +245,8 @@ const currentVillageData = () => {
} }
// 获取今日巡检数据 // 获取今日巡检数据
const getInspectionData = () => { const getInspectionData = () => {
getTodayInspection().then(res =>{ getTodayInspection()
.then(res => {
if (res.code === 200) { if (res.code === 200) {
if (res.data) { if (res.data) {
allCount.value = res.data.totalTasks allCount.value = res.data.totalTasks
@@ -226,7 +260,8 @@ const getInspectionData = () =>{
} else { } else {
uni.showToast({ title: res.msg || '获取失败', icon: 'none' }) uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
} }
}).catch(err => { })
.catch(err => {
uni.showToast({ title: err.msg || '获取失败', icon: 'none' }) uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
}) })
} }
@@ -244,13 +279,15 @@ const getNoticeData = () => {
} }
// 获取bannar图 // 获取bannar图
function getbannarData() { function getbannarData() {
getBannarList().then(res => { getBannarList()
.then(res => {
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
bannerList.value = res.data bannerList.value = res.data
} else { } else {
bannerList.value = [] bannerList.value = []
} }
}).catch(() => {}) })
.catch(() => {})
} }
// 接收选择小区返回的参数 // 接收选择小区返回的参数

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