工单详情
This commit is contained in:
@@ -98,9 +98,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 工单创建弹窗 -->
|
||||
<WorkcaseCreator v-if="showWorkcaseCreator" :show="showWorkcaseCreator"
|
||||
@close="hideCreator" @success="onWorkcaseCreated" />
|
||||
</view>
|
||||
<!-- #ifdef APP -->
|
||||
</scroll-view>
|
||||
@@ -109,7 +106,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, nextTick, onMounted, onUnmounted, watch } from 'vue'
|
||||
import WorkcaseCreator from '@/components/WorkcaseCreator/WorkcaseCreator.uvue'
|
||||
import type { ChatRoomMessageVO, CustomerVO, ChatMemberVO, TbChatRoomMessageDTO } from '@/types/workcase'
|
||||
import { workcaseChatAPI } from '@/api/workcase'
|
||||
import { wsClient } from '@/utils/websocket'
|
||||
@@ -122,7 +118,6 @@ const workcaseId = ref<string>('')
|
||||
const roomName = ref<string>('聊天室')
|
||||
const inputText = ref<string>('')
|
||||
const scrollTop = ref<number>(0)
|
||||
const showWorkcaseCreator = ref<boolean>(false)
|
||||
const loading = ref<boolean>(false)
|
||||
const sending = ref<boolean>(false)
|
||||
const loadingMore = ref<boolean>(false)
|
||||
@@ -204,24 +199,23 @@ const totalMembers = computed<MemberDisplay[]>(() => {
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||
headerPaddingTop.value = menuButtonInfo.top
|
||||
headerTotalHeight.value = menuButtonInfo.bottom + 8
|
||||
} catch (e) {
|
||||
headerPaddingTop.value = res.statusBarHeight || 44
|
||||
headerTotalHeight.value = (res.statusBarHeight || 44) + 44
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
headerPaddingTop.value = res.statusBarHeight || 44
|
||||
headerTotalHeight.value = (res.statusBarHeight || 44) + 44
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
const windowInfo = uni.getWindowInfo()
|
||||
const statusBarHeight = windowInfo.statusBarHeight || 44
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||
headerPaddingTop.value = menuButtonInfo.top
|
||||
headerTotalHeight.value = menuButtonInfo.bottom + 8
|
||||
} catch (e) {
|
||||
headerPaddingTop.value = statusBarHeight
|
||||
headerTotalHeight.value = statusBarHeight + 44
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
headerPaddingTop.value = statusBarHeight
|
||||
headerTotalHeight.value = statusBarHeight + 44
|
||||
// #endif
|
||||
|
||||
// 获取页面参数
|
||||
const pages = getCurrentPages()
|
||||
@@ -448,30 +442,38 @@ function scrollToBottom() {
|
||||
|
||||
// 处理工单操作
|
||||
function handleWorkcaseAction() {
|
||||
console.log('[handleWorkcaseAction] 开始执行')
|
||||
console.log('[handleWorkcaseAction] workcaseId:', workcaseId.value)
|
||||
console.log('[handleWorkcaseAction] roomId:', roomId.value)
|
||||
|
||||
if (workcaseId.value) {
|
||||
const url = `/pages/workcase/workcaseDetail/workcaseDetail?workcaseId=${workcaseId.value}`
|
||||
console.log('[handleWorkcaseAction] 查看工单,跳转URL:', url)
|
||||
uni.navigateTo({
|
||||
url: `/pages/workcase/workcaseDetail/workcaseDetail?workcaseId=${workcaseId.value}`
|
||||
url: url,
|
||||
success: () => {
|
||||
console.log('[handleWorkcaseAction] 跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('[handleWorkcaseAction] 跳转失败:', err)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
showWorkcaseCreator.value = true
|
||||
// 跳转到创建工单页面
|
||||
const url = `/pages/workcase/workcaseDetail/workcaseDetail?mode=create&roomId=${roomId.value}`
|
||||
console.log('[handleWorkcaseAction] 创建工单,跳转URL:', url)
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
success: () => {
|
||||
console.log('[handleWorkcaseAction] 跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('[handleWorkcaseAction] 跳转失败:', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏工单创建器
|
||||
function hideCreator() {
|
||||
showWorkcaseCreator.value = false
|
||||
}
|
||||
|
||||
// 工单创建成功
|
||||
function onWorkcaseCreated(data: any) {
|
||||
hideCreator()
|
||||
workcaseId.value = data.workcaseId || 'new-workcase'
|
||||
uni.showToast({
|
||||
title: '工单创建成功',
|
||||
icon: 'success'
|
||||
})
|
||||
}
|
||||
|
||||
// 发起会议
|
||||
function startMeeting() {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -69,6 +69,9 @@ const chatRooms = ref<ChatRoomVO[]>([])
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
const windowInfo = uni.getWindowInfo()
|
||||
const statusBarHeight = windowInfo.statusBarHeight || 20
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
const menuButton = uni.getMenuButtonBoundingClientRect()
|
||||
@@ -76,14 +79,12 @@ onMounted(() => {
|
||||
capsuleHeight.value = menuButton.height
|
||||
navHeight.value = menuButton.bottom + 8
|
||||
} catch (e) {
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
navPaddingTop.value = sysInfo.statusBarHeight || 20
|
||||
navPaddingTop.value = statusBarHeight
|
||||
navHeight.value = navPaddingTop.value + 44
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
navPaddingTop.value = sysInfo.statusBarHeight || 20
|
||||
navPaddingTop.value = statusBarHeight
|
||||
navHeight.value = navPaddingTop.value + 44
|
||||
// #endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user