# Conflicts:
#	.env
This commit is contained in:
dzc committed 2025-06-30 19:28:34 +08:00
commit dd70265da6
24 files changed
+3143 -283

No files matched your search

+7 -7
View File
@@ -17,18 +17,18 @@ VITE_PWD_ENC_KEY='pigxpigxpigxpigx'
VITE_OAUTH2_APP_CLIENT='mini:mini'
# --------------------------- 开发环境 api地址 ----------------------------------
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
#VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
# VITE_APP_DEV_SERVICE = http://192.168.101.139:9999 # 邓-本地
VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api # 测试线上
# VITE_APP_DEV_SERVICE = http://192.168.101.150:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 开发环境 图片访问基础地址 ---------------------------
# VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
#VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上
# VITE_IMAGE_DEV_PATH = http://192.168.101.150:9999 # 邓-43本地
VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
# VITE_IMAGE_DEV_PATH = http://123.156.230.15:8089/api # 测试线上
# VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
# VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 生产环境 api地址 ----------------------------------
VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
+48
View File
@@ -467,6 +467,48 @@
"navigationBarTitleText": "意见反馈"
}
},
{
"path": "feedback/detail",
"style": {
"navigationBarTitleText": "反馈详情"
}
},
{
"path": "repair/index",
"style": {
"navigationBarTitleText": "维修上报"
}
},
{
"path": "repair/detail",
"style": {
"navigationBarTitleText": "维修详情"
}
},
{
"path": "notice/index",
"style": {
"navigationBarTitleText": "通知公告"
}
},
{
"path": "notice/detail",
"style": {
"navigationBarTitleText": "公告详情"
}
},
{
"path": "visitor/index",
"style": {
"navigationBarTitleText": "访客管理"
}
},
{
"path": "visitor/detail",
"style": {
"navigationBarTitleText": "访客详情"
}
},
{
"path": "meeting/detail",
"style": {
@@ -478,6 +520,12 @@
"style": {
"navigationBarTitleText": "我的预约"
}
},
{
"path": "meeting/booking-detail",
"style": {
"navigationBarTitleText": "预约详情"
}
}
]
}
+217
View File
@@ -0,0 +1,217 @@
<template>
<view class="feedback-detail">
<view class="detail-header">
<view class="detail-title">{{ detail.title }}</view>
<view v-if="typeOptions.length && detail.type" class="detail-type">反馈类型:{{ getTypeLabel(detail.type) }}</view>
</view>
<view class="detail-content">
<view class="content-text">{{ detail.description }}</view>
</view>
<view class="detail-footer">
<text class="create-time">提交时间:{{ formatTime(detail.createTime) }}</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const detail = ref<any>({})
const typeOptions = ref<{ value: string; label: string }[]>([])
async function loadTypeOptions() {
const res: any = await meetingRoomApi.getFeedbackType()
if (res.data && Array.isArray(res.data.data)) {
typeOptions.value = res.data.data.map(item => ({
value: item.id,
label: item.label
}))
}
}
function getTypeLabel(type) {
if (!typeOptions.value.length || !type) return ''
const option = typeOptions.value.find(item => String(item.value) === String(type))
return option ? option.label : type
}
function getTypeClass(type: string) {
const classMap: Record<string, string> = {
'1': 'type-suggestion',
'2': 'type-problem',
'3': 'type-ui',
'4': 'type-other'
}
return classMap[type] || 'type-other'
}
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待处理',
'2': '处理中',
'3': '已处理',
'4': '已关闭'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-processing',
'3': 'status-completed',
'4': 'status-closed'
}
return classMap[status] || 'status-pending'
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleString()
}
onLoad(async (options: any) => {
await loadTypeOptions()
const id = options.id
if (!id) return
try {
const response: any = await meetingRoomApi.getFeedbackDetail(id)
if (response.code === 0 && Array.isArray(response.data) && response.data.length > 0) {
detail.value = response.data[0]
}
} catch (error) {
uni.showToast({ title: '获取详情失败', icon: 'none' })
}
})
</script>
<style lang="scss" scoped>
.feedback-detail {
padding: 32rpx;
background: #f5f5f5;
min-height: 100vh;
}
.detail-header {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
.type-tag {
padding: 12rpx 24rpx;
border-radius: 24rpx;
font-size: 26rpx;
&.type-suggestion {
background: #e3f2fd;
color: #1976d2;
}
&.type-problem {
background: #ffebee;
color: #d32f2f;
}
&.type-ui {
background: #f3e5f5;
color: #7b1fa2;
}
&.type-other {
background: #f5f5f5;
color: #666;
}
}
.status-tag {
padding: 12rpx 24rpx;
border-radius: 24rpx;
font-size: 26rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-processing {
background: #e8f5e8;
color: #388e3c;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
&.status-closed {
background: #f5f5f5;
color: #999;
}
}
}
.detail-content {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.content-text {
font-size: 30rpx;
color: #333;
line-height: 1.6;
margin-bottom: 24rpx;
}
.contact-info {
font-size: 26rpx;
color: #666;
padding-top: 24rpx;
border-top: 1rpx solid #f0f0f0;
}
}
.reply-section {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.reply-title {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
}
.reply-content {
font-size: 28rpx;
color: #666;
line-height: 1.6;
margin-bottom: 16rpx;
}
.reply-time {
font-size: 24rpx;
color: #999;
text-align: right;
}
}
.detail-footer {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.create-time {
font-size: 26rpx;
color: #999;
}
}
</style>
+394 -123
View File
@@ -1,151 +1,422 @@
<template>
<view class="min-h-screen bg-white px-30rpx pb-30rpx">
<!-- 顶部导航 -->
<view class="flex items-center h-88rpx relative">
<view class="absolute left-0 h-88rpx flex items-center pr-20rpx" @tap="goBack">
<text class="text-36rpx text-gray-800">&lt;</text>
<text class="text-28rpx text-gray-800 ml-4rpx">返回</text>
</view>
<view class="flex-1 text-center text-34rpx font-500">问题反馈</view>
<view class="feedback-container">
<view class="feedback-tabs">
<view :class="['tab', {active: activeTab === 0} ]" @click="activeTab = 0">提交反馈</view>
<view :class="['tab', {active: activeTab === 1} ]" @click="activeTab = 1">我的反馈</view>
</view>
<!-- 问题分类 -->
<view class="mt-40rpx">
<view class="text-32rpx font-500 mb-24rpx">问题分类</view>
<view class="flex flex-wrap gap-24rpx">
<view
v-for="(item, index) in categories"
:key="index"
:class="[
'px-32rpx py-12rpx rounded-20rpx text-28rpx transition-colors duration-200',
selectedCategory === item ? 'bg-blue-200 text-blue-600' : 'bg-gray-100',
]"
@tap="selectedCategory = item"
>
{{ item }}
<view v-if="activeTab === 0">
<!-- 反馈表单 -->
<view class="feedback-form">
<view class="form-title">提交反馈</view>
<view class="form-item">
<view class="label">标题</view>
<input v-model="title" placeholder="请输入反馈标题" class="title-input" />
</view>
<view class="form-item">
<view class="label">反馈类型</view>
<picker @change="onTypeChange" :value="typeIndex" :range="typeOptions" range-key="label">
<view class="picker">{{ typeOptions[typeIndex]?.label || '请选择类型' }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">反馈描述</view>
<textarea
v-model="description"
placeholder="请详细描述您的问题或建议..."
class="content-textarea"
maxlength="500"
/>
<view class="char-count">{{ description.length }}/500</view>
</view>
<view class="form-item">
<view class="label">联系方式</view>
<input v-model="contact" placeholder="手机号或邮箱(选填)" class="contact-input" />
</view>
<button @click="submitFeedback" class="submit-btn" :disabled="!canSubmit">
提交反馈
</button>
</view>
</view>
<!-- 详细描述 -->
<view class="mt-40rpx">
<view class="text-32rpx font-500 mb-24rpx">
详细描述
<text class="text-red-500 ml-8rpx">*</text>
</view>
<view class="w-full bg-gray-50 rounded-16rpx p-20rpx box-border">
<textarea
v-model="description"
placeholder="您在哪个页面,遇到了什么问题,详细描述有助于帮您快速解决"
placeholder-style="color: #999999;"
:maxlength="200"
class="w-full h-240rpx bg-gray-50 text-28rpx leading-40rpx p-0 box-border"
/>
<view class="text-right text-gray-400 text-24rpx mt-8rpx">{{ description.length }}/200</view>
</view>
</view>
<!-- 图片上传 -->
<view class="mt-40rpx">
<view class="text-32rpx font-500 mb-24rpx">上传图片 ({{ images.length }}/3)</view>
<view class="flex flex-wrap gap-24rpx">
<view v-for="(img, index) in images" :key="index" class="relative w-160rpx h-160rpx">
<image :src="img" mode="aspectFill" class="w-full h-full rounded-16rpx" />
<view
class="absolute -right-12rpx -top-12rpx w-40rpx h-40rpx bg-black bg-opacity-60 text-white rounded-full flex items-center justify-center active:bg-opacity-80"
@tap="deleteImage(index)"
<view v-else>
<!-- 我的反馈列表 -->
<view class="feedback-list">
<view class="list-title">我的反馈</view>
<view v-if="feedbackList.length === 0" class="empty-tip">
暂无反馈记录
</view>
<view v-else>
<view
v-for="item in feedbackList"
:key="item.id"
class="feedback-item"
@click="viewDetail(item)"
>
×
<view class="item-header">
<view class="type-tag" :class="getTypeClass(item.type)">{{ getTypeLabel(item.type) }}</view>
<view class="status-tag" :class="getStatusClass(item.status)">{{ getStatusText(item.status) }}</view>
</view>
<view class="item-content">
<view class="item-title">{{ item.title }}</view>
<view class="item-desc">{{ item.description }}</view>
<image v-if="item.picUrl" :src="item.picUrl" class="item-img" mode="aspectFill" />
</view>
<view class="item-footer">
<text class="time">{{ formatTime(item.createTime) }}</text>
<text v-if="item.reply" class="reply-count">已回复</text>
</view>
</view>
</view>
<view
v-if="images.length < 3"
class="w-160rpx h-160rpx rounded-16rpx border border-dashed border-gray-200 flex items-center justify-center active:bg-gray-50"
@tap="handleUpload"
>
<view class="text-48rpx text-gray-400">+</view>
</view>
</view>
</view>
<!-- 联系方式 -->
<view class="mt-40rpx">
<view class="text-32rpx font-500 mb-24rpx">联系方式</view>
<view class="w-full bg-gray-50 rounded-16rpx px-20rpx box-border">
<input
v-model="contact"
placeholder="手机号/邮箱/微信号"
placeholder-style="color: #999999;"
class="w-full h-88rpx text-28rpx bg-gray-50"
/>
</view>
</view>
<!-- 邮箱联系我们 -->
<view class="mt-48rpx flex items-center justify-between text-28rpx">
<view class="text-gray-800">邮箱联系我们</view>
<view class="flex items-center gap-16rpx">
<text class="text-gray-600">user_service@36kr.com</text>
<view class="px-24rpx py-8rpx bg-gray-100 rounded-8rpx text-28rpx active:bg-gray-200" @tap="copyEmail"> 复制 </view>
</view>
</view>
<!-- 提交按钮 -->
<view
class="my-64rpx h-88rpx bg-blue-500 text-white rounded-20rpx flex items-center justify-center text-32rpx active:bg-blue-600 transition-colors duration-200"
@tap="handleSubmit"
>
提 交
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue"
import { ref, onMounted, computed } from 'vue'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const categories = ["产品建议", "功能Bug", "内容订正", "其他"]
const selectedCategory = ref("产品建议")
const description = ref("")
const images = ref<string[]>([])
const contact = ref("")
const typeOptions = ref<{ value: string; label: string }[]>([])
const typeIndex = ref(0)
const title = ref('')
const description = ref('')
const contact = ref('')
const feedbackList = ref<any[]>([])
const activeTab = ref(0)
const goBack = () => {
uni.navigateBack()
const canSubmit = computed(() => {
return title.value.trim() && description.value.trim()
})
async function loadTypeOptions() {
try {
const res: any = await meetingRoomApi.getFeedbackType()
if (res.data && Array.isArray(res.data.data)) {
typeOptions.value = res.data.data.map(item => ({
value: item.id,
label: item.label
}))
}
} catch (e) {
uni.showToast({ title: '获取反馈类型失败', icon: 'none' })
}
}
const handleUpload = () => {
uni.chooseImage({
count: 3 - images.value.length,
success: (res) => {
images.value = [...images.value, ...res.tempFilePaths]
},
})
function onTypeChange(e: any) {
typeIndex.value = e.detail.value
}
const deleteImage = (index: number) => {
images.value.splice(index, 1)
function getTypeLabel(type: string) {
const option = typeOptions.value.find(item => item.value === type)
return option ? option.label : type
}
const copyEmail = () => {
uni.setClipboardData({
data: "user_service@36kr.com",
success: () => {
uni.showToast({
title: "复制成功",
icon: "none",
})
},
})
function getTypeClass(type: string) {
const classMap: Record<string, string> = {
'投诉': 'type-complain',
'建议': 'type-suggest',
'BUG报告': 'type-bug',
'功能需求': 'type-feature'
}
return classMap[type] || 'type-other'
}
const handleSubmit = () => {
if (!description.value) {
uni.showToast({
title: "请填写详细描述",
icon: "none",
})
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待处理',
'2': '处理中',
'3': '已处理',
'4': '已关闭'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-processing',
'3': 'status-completed',
'4': 'status-closed'
}
return classMap[status] || 'status-pending'
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleDateString()
}
async function submitFeedback() {
if (!canSubmit.value) {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
// 实现提交逻辑
try {
uni.showLoading({ title: '提交中...' })
const data = {
title: title.value.trim(),
type: typeOptions.value[typeIndex.value].value,
description: description.value.trim(),
contact: contact.value.trim()
}
const response: any = await meetingRoomApi.submitFeedback(data)
uni.hideLoading()
if (response.code === 0) {
uni.showToast({ title: '提交成功', icon: 'success' })
// 清空表单
title.value = ''
description.value = ''
contact.value = ''
typeIndex.value = 0
// 刷新列表
loadFeedbackList()
} else {
uni.showToast({ title: response.msg || '提交失败', icon: 'none' })
}
} catch (error) {
uni.hideLoading()
uni.showToast({ title: '提交失败', icon: 'none' })
}
}
function viewDetail(item: any) {
uni.navigateTo({
url: `/pages/integrated/feedback/detail?id=${item.id}`
})
}
async function loadFeedbackList() {
try {
const response: any = await meetingRoomApi.getFeedbackList({
current: 1,
size: 20
})
if (response.code === 0 && response.data) {
feedbackList.value = response.data.records || []
}
} catch (error) {
console.error('加载反馈列表失败:', error)
}
}
onMounted(() => {
loadTypeOptions().then(() => {
loadFeedbackList()
})
})
</script>
<style lang="scss" scoped>
.feedback-container {
padding: 24rpx;
background: #f5f5f5;
min-height: 100vh;
}
.feedback-tabs {
display: flex;
background: #fff;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
margin-bottom: 24rpx;
.tab {
flex: 1;
text-align: center;
padding: 28rpx 0;
font-size: 30rpx;
color: #888;
background: #f7f8fa;
&.active {
color: #1777FF;
background: #fff;
font-weight: bold;
border-bottom: 4rpx solid #1777FF;
}
}
}
.feedback-form {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.form-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.form-item {
margin-bottom: 24rpx;
.label {
font-size: 28rpx;
color: #333;
margin-bottom: 12rpx;
}
.title-input {
height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.picker {
height: 80rpx;
line-height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.content-textarea {
width: 100%;
height: 200rpx;
padding: 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.char-count {
text-align: right;
font-size: 24rpx;
color: #999;
margin-top: 8rpx;
}
.contact-input {
height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
}
.submit-btn {
width: 100%;
height: 88rpx;
background: #007aff;
color: #fff;
border-radius: 8rpx;
font-size: 32rpx;
&:disabled {
background: #ccc;
}
}
}
.feedback-list {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.list-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.empty-tip {
text-align: center;
color: #999;
font-size: 28rpx;
padding: 60rpx 0;
}
.feedback-item {
border-bottom: 1rpx solid #f0f0f0;
padding: 24rpx 0;
&:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.type-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.type-complain {
background: #ffebee;
color: #d32f2f;
}
&.type-suggest {
background: #e3f2fd;
color: #1976d2;
}
&.type-bug {
background: #f3e5f5;
color: #7b1fa2;
}
&.type-feature {
background: #e8f5e8;
color: #388e3c;
}
&.type-other {
background: #f5f5f5;
color: #666;
}
}
.status-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-processing {
background: #e8f5e8;
color: #388e3c;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
&.status-closed {
background: #f5f5f5;
color: #999;
}
}
}
.item-content {
.item-title {
font-size: 28rpx;
color: #222;
font-weight: bold;
margin-bottom: 8rpx;
}
.item-desc {
font-size: 26rpx;
color: #333;
margin-bottom: 8rpx;
line-height: 1.5;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.item-img {
width: 120rpx;
height: 120rpx;
border-radius: 8rpx;
margin-top: 8rpx;
background: #f7f8fa;
}
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
.time {
font-size: 24rpx;
color: #999;
}
.reply-count {
font-size: 24rpx;
color: #007aff;
}
}
}
}
</style>
+26 -2
View File
@@ -17,9 +17,9 @@
<script setup lang="ts">
const services = [
{
name: 'water-query',
name: 'meeting-booking',
label: '会议预定',
icon: '/static/service/water-query.png',
icon: '/static/service/meeting-booking.png',
url: '/pages/integrated/meeting/index'
},
{
@@ -27,6 +27,30 @@ const services = [
label: '失物招领',
icon: '/static/service/lost-and-found.png',
url: '/pages/integrated/lostAndFound/index'
},
{
name: 'feedback',
label: '意见反馈',
icon: '/static/service/feedback.png',
url: '/pages/integrated/feedback/index'
},
{
name: 'repair-report',
label: '维修上报',
icon: '/static/service/repair-report.png',
url: '/pages/integrated/repair/index'
},
{
name: 'notice',
label: '通知公告',
icon: '/static/service/notice.png',
url: '/pages/integrated/notice/index'
},
{
name: 'visitor',
label: '访客管理',
icon: '/static/service/visitor.png',
url: '/pages/integrated/visitor/index'
}
]
@@ -0,0 +1,97 @@
<template>
<view class="booking-detail">
<view class="room-info">
<view class="room-name">{{ detail.roomName }}</view>
<view class="room-meta">
<text>容量:{{ detail.capacity }}</text>
<text>位置:{{ detail.location }}</text>
</view>
<view v-if="detail.equipmentNames" class="room-equip">
设备:{{ detail.equipmentNames }}
</view>
</view>
<view class="section">
<view class="section-title">预约信息</view>
<view class="info-row"><text class="label">预约人:</text>{{ detail.username }}</view>
<view class="info-row"><text class="label">预约时间:</text>{{ detail.startTime }} ~ {{ detail.endTime }}</view>
<view class="info-row"><text class="label">预约状态:</text>{{ getStatusText(detail.checkStatus) }}</view>
<view class="info-row" v-if="detail.checkReason"><text class="label">审核意见:</text>{{ detail.checkReason }}</view>
<view class="info-row" v-if="detail.description"><text class="label">备注:</text>{{ detail.description }}</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const detail = ref<any>({})
function getStatusText(status: string) {
const map: Record<string, string> = {
'1': '审核中',
'2': '审核通过',
'3': '审核拒绝',
'4': '已取消',
'5': '已结束',
}
return map[status] || status
}
onLoad(async (options: any) => {
const id = options.id
if (!id) return
const { code, data } = await meetingRoomApi.getBookingDetail(id)
if (code === 0 && data) {
detail.value = data
}
})
</script>
<style lang="scss" scoped>
.booking-detail {
padding: 32rpx;
.room-info {
background: #f7f8fa;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 32rpx;
.room-name {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 12rpx;
}
.room-meta {
font-size: 26rpx;
color: #666;
margin-bottom: 8rpx;
text {
margin-right: 32rpx;
}
}
.room-equip {
font-size: 24rpx;
color: #999;
}
}
.section {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
.section-title {
font-size: 30rpx;
font-weight: bold;
margin-bottom: 18rpx;
}
.info-row {
font-size: 26rpx;
margin-bottom: 14rpx;
.label {
color: #888;
margin-right: 12rpx;
}
}
}
}
</style>
+1 -1
View File
@@ -221,7 +221,7 @@ async function reserveMeeting() {
date,
startTime: startSlot.startTime,
endTime: endSlot.endTime,
title: '会议',
title: room.value.name || '会议',
description: '',
attendees: []
})
+1 -1
View File
@@ -230,4 +230,4 @@ function goDetail(room) {
color: #bbb;
font-size: 20rpx;
}
</style>
</style>
+114 -72
View File
@@ -11,69 +11,108 @@
v-for="(tab, idx) in tabs"
:key="tab"
:class="['tab', idx === activeTab ? 'active' : '']"
@tap="activeTab = idx"
@tap="onTabChange(idx)"
>{{ tab }}</view>
</view>
<!-- 优惠礼包(可选) -->
<view class="coupon-box">
<text class="coupon-title">优惠礼包</text>
<text class="coupon-desc">还未购买过优惠礼包</text>
<text class="arrow">&gt;</text>
</view>
<!-- 预约卡片列表 -->
<view v-for="item in reservationList" :key="item.id" class="card">
<view class="card-header">
<image src="/static/icons/meeting.png" class="card-icon" />
<text class="card-title">{{ item.roomName }} → {{ item.location }}</text>
<text class="card-status" :class="item.statusClass">{{ item.statusText }}</text>
</view>
<view class="card-info">
<view>预约时间:{{ item.time }}</view>
<view>会议主题:{{ item.subject }}</view>
<view>参会人:{{ item.attendees }}</view>
</view>
<view class="card-footer">
<view class="card-btn" v-for="btn in item.actions" :key="btn">{{ btn }}</view>
<view v-if="reservationList.length">
<view v-for="item in reservationList" :key="item.id" class="card">
<view class="card-header">
<image src="/static/icons/meeting.png" class="card-icon" />
<text class="card-title">{{ item.title }}</text>
<text class="card-status" :class="statusMap[item.checkStatus]?.class">{{ statusMap[item.checkStatus]?.text }}</text>
</view>
<view class="card-info">
<view>预约日期:{{ item.bookingDate }}</view>
<view>时间:{{ item.startTime }} ~ {{ item.endTime }}</view>
<view>申请人:{{ item.createBy }}</view>
</view>
<view class="card-footer">
<view class="card-btn" @tap="viewDetail(item)">查看详情</view>
<view
v-if="item.checkStatus === 1 || item.checkStatus === 2"
class="card-btn cancel"
@tap="cancelBooking(item)"
>取消预约</view>
</view>
</view>
</view>
<view v-else class="empty">
<image src="/static/icons/empty.png" class="empty-img" />
<view class="empty-text">暂无预约</view>
<view class="empty-tip">您还没有预约会议,快去预约吧!</view>
</view>
<MeetingTabbar activeTab="mine" />
</view>
<MeetingTabbar activeTab="mine" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref, onMounted } from 'vue'
import meetingRoomApi from '@/sheep/api/meetingRoom'
import MeetingTabbar from '@/components/MeetingTabbar.vue'
const tabs = ['全部', '未开始', '已结束', '已取消']
const tabs = ['全部', '审核中', '审核成功', '已拒绝', '已取消']
const activeTab = ref(0)
const reservationList = ref<any[]>([])
const loading = ref(false)
const total = ref(0)
const current = ref(1)
const size = ref(10)
// 静态假数据,等你有接口后再对接
const reservationList = ref([
{
id: 1,
roomName: '一号会议室',
location: '总部大厦A座',
time: '2025-06-20 14:00~15:00',
subject: '周例会',
attendees: '张三、李四、王五',
statusText: '已结束',
statusClass: 'done',
actions: ['更多', '再次预约']
},
{
id: 2,
roomName: '二号会议室',
location: '总部大厦B座',
time: '2025-06-22 09:00~10:00',
subject: '项目讨论',
attendees: '张三、赵六',
statusText: '未开始',
statusClass: 'pending',
actions: ['取消预约', '查看详情']
}
])
const statusMap = {
1: { text: '审核中', class: 'pending' },
2: { text: '审核成功', class: 'done' },
3: { text: '已拒绝', class: 'cancel' },
4: { text: '已取消', class: 'cancel' }
}
function fetchReservations() {
loading.value = true
let checkStatus = activeTab.value === 0 ? undefined : activeTab.value // 0为全部
meetingRoomApi.getMyBookings({
current: current.value,
size: size.value,
...(checkStatus ? { checkStatus } : {})
}).then((res: any) => {
loading.value = false
if (res.code === 0 && res.data && res.data.records) {
reservationList.value = res.data.records
total.value = res.data.total
}
}).catch(() => {
loading.value = false
})
}
onMounted(() => {
fetchReservations()
})
function onTabChange(idx: number) {
activeTab.value = idx
current.value = 1
fetchReservations()
}
function cancelBooking(item: any) {
uni.showModal({
title: '提示',
content: '确定要取消该预约吗?',
success: (res) => {
if (res.confirm) {
// TODO: 调用取消预约接口
uni.showToast({ title: '已取消(待接入接口)', icon: 'none' })
}
}
})
}
function viewDetail(item: any) {
uni.navigateTo({
url: '/pages/integrated/meeting/booking-detail?id=' + item.id
})
}
</script>
<style lang="less" scoped>
@@ -120,29 +159,6 @@ const reservationList = ref([
position: absolute;
left: 0; right: 0; bottom: 0;
}
.coupon-box {
margin: 24rpx;
background: #fffbe6;
border-radius: 12rpx;
padding: 24rpx;
display: flex;
align-items: center;
font-size: 26rpx;
color: #bfa243;
position: relative;
}
.coupon-title {
font-weight: 600;
margin-right: 16rpx;
}
.coupon-desc {
flex: 1;
}
.arrow {
color: #bfa243;
font-size: 32rpx;
margin-left: 16rpx;
}
.card {
margin: 24rpx;
background: #fff;
@@ -196,4 +212,30 @@ const reservationList = ref([
padding: 8rpx 24rpx;
font-size: 24rpx;
}
.card-btn.cancel {
background: #ffeaea;
color: #ff4d4f;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 120rpx;
color: #bbb;
}
.empty-img {
width: 180rpx;
height: 180rpx;
margin-bottom: 24rpx;
}
.empty-text {
font-size: 30rpx;
font-weight: 600;
margin-bottom: 8rpx;
}
.empty-tip {
font-size: 24rpx;
color: #aaa;
}
</style>
+211
View File
@@ -0,0 +1,211 @@
<template>
<view class="notice-detail">
<view class="detail-header">
<view class="title">{{ detail.title }}</view>
<view class="meta">
<text class="type-tag" :class="getTypeClass(detail.type)">{{ getTypeLabel(detail.type) }}</text>
<text class="time">{{ formatTime(detail.createTime) }}</text>
</view>
</view>
<view class="detail-content">
<view class="content-text">{{ detail.content }}</view>
</view>
<view v-if="detail.attachments && detail.attachments.length > 0" class="attachments">
<view class="attachment-title">附件</view>
<view
v-for="(file, index) in detail.attachments"
:key="index"
class="attachment-item"
@click="downloadFile(file)"
>
<text class="file-name">{{ file.name }}</text>
<text class="file-size">{{ formatFileSize(file.size) }}</text>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const detail = ref<any>({})
function getTypeLabel(type: string) {
const typeMap: Record<string, string> = {
'1': '重要',
'2': '一般',
'3': '活动'
}
return typeMap[type] || '一般'
}
function getTypeClass(type: string) {
const classMap: Record<string, string> = {
'1': 'type-important',
'2': 'type-general',
'3': 'type-activity'
}
return classMap[type] || 'type-general'
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleString()
}
function formatFileSize(size: number) {
if (size < 1024) {
return size + 'B'
} else if (size < 1024 * 1024) {
return (size / 1024).toFixed(1) + 'KB'
} else {
return (size / (1024 * 1024)).toFixed(1) + 'MB'
}
}
function downloadFile(file: any) {
uni.downloadFile({
url: file.url,
success: (res) => {
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: () => {
console.log('打开文档成功')
},
fail: () => {
uni.showToast({ title: '无法打开此文件', icon: 'none' })
}
})
}
},
fail: () => {
uni.showToast({ title: '下载失败', icon: 'none' })
}
})
}
onLoad(async (options: any) => {
const id = options.id
if (!id) return
try {
const response: any = await meetingRoomApi.getNoticeDetail(id)
if (response.code === 0 && response.data) {
detail.value = response.data
}
} catch (error) {
console.error('获取公告详情失败:', error)
uni.showToast({ title: '获取详情失败', icon: 'none' })
}
})
</script>
<style lang="scss" scoped>
.notice-detail {
padding: 32rpx;
background: #f5f5f5;
min-height: 100vh;
}
.detail-header {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.title {
font-size: 36rpx;
font-weight: bold;
color: #333;
line-height: 1.4;
margin-bottom: 16rpx;
}
.meta {
display: flex;
justify-content: space-between;
align-items: center;
.type-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.type-important {
background: #ffebee;
color: #d32f2f;
}
&.type-general {
background: #f5f5f5;
color: #666;
}
&.type-activity {
background: #e8f5e8;
color: #388e3c;
}
}
.time {
font-size: 24rpx;
color: #999;
}
}
}
.detail-content {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.content-text {
font-size: 30rpx;
color: #333;
line-height: 1.8;
}
}
.attachments {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.attachment-title {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
}
.attachment-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16rpx 0;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.file-name {
font-size: 28rpx;
color: #007aff;
flex: 1;
margin-right: 16rpx;
}
.file-size {
font-size: 24rpx;
color: #999;
}
}
}
</style>
+309
View File
@@ -0,0 +1,309 @@
<template>
<view class="notice-container">
<!-- 公告分类标签 -->
<view class="notice-tabs">
<view
v-for="(tab, index) in tabs"
:key="index"
:class="['tab-item', { active: activeTab === index }]"
@click="switchTab(index)"
>
{{ tab.label }}
</view>
</view>
<!-- 公告列表 -->
<view class="notice-list">
<view v-if="noticeList.length === 0" class="empty-tip">
暂无公告
</view>
<view v-else>
<view
v-for="item in noticeList"
:key="item.id"
class="notice-item"
@click="viewDetail(item)"
>
<view class="item-header">
<view class="title">{{ item.title }}</view>
<view class="type-tag" :class="getTypeClass(item.type)">{{ getTypeLabel(item.type) }}</view>
</view>
<view class="item-content">{{ item.content }}</view>
<view class="item-footer">
<text class="time">{{ formatTime(item.createTime) }}</text>
<text v-if="item.isTop" class="top-tag">置顶</text>
<text v-if="item.isRead" class="read-tag">已读</text>
</view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view v-if="hasMore" class="load-more" @click="loadMore">
<text>加载更多</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const tabs = [
{ value: 'all', label: '全部' },
{ value: 'important', label: '重要' },
{ value: 'general', label: '一般' },
{ value: 'activity', label: '活动' }
]
const activeTab = ref(0)
const noticeList = ref<any[]>([])
const currentPage = ref(1)
const hasMore = ref(true)
function switchTab(index: number) {
activeTab.value = index
currentPage.value = 1
hasMore.value = true
loadNoticeList(true)
}
function getTypeLabel(type: string) {
const typeMap: Record<string, string> = {
'1': '重要',
'2': '一般',
'3': '活动'
}
return typeMap[type] || '一般'
}
function getTypeClass(type: string) {
const classMap: Record<string, string> = {
'1': 'type-important',
'2': 'type-general',
'3': 'type-activity'
}
return classMap[type] || 'type-general'
}
function formatTime(time: string) {
if (!time) return ''
const date = new Date(time)
const now = new Date()
const diff = now.getTime() - date.getTime()
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
if (days === 0) {
return '今天'
} else if (days === 1) {
return '昨天'
} else if (days < 7) {
return `${days}天前`
} else {
return date.toLocaleDateString()
}
}
function viewDetail(item: any) {
// 标记为已读
if (!item.isRead) {
markAsRead(item.id)
}
uni.navigateTo({
url: `/pages/integrated/notice/detail?id=${item.id}`
})
}
async function markAsRead(id: string) {
try {
const response: any = await meetingRoomApi.markNoticeRead(id)
if (response.code === 0) {
console.log('标记已读成功:', id)
}
} catch (error) {
console.error('标记已读失败:', error)
}
}
async function loadNoticeList(reset = false) {
try {
const params = {
current: currentPage.value,
size: 10,
type: tabs[activeTab.value].value
}
const response: any = await meetingRoomApi.getNoticeList(params)
if (response.code === 0 && response.data) {
const records = response.data.records || []
if (reset) {
noticeList.value = records
} else {
noticeList.value = [...noticeList.value, ...records]
}
// 检查是否还有更多数据
hasMore.value = records.length === 10
}
} catch (error) {
console.error('加载公告列表失败:', error)
}
}
function loadMore() {
if (!hasMore.value) return
currentPage.value++
loadNoticeList()
}
onMounted(() => {
loadNoticeList(true)
})
</script>
<style lang="scss" scoped>
.notice-container {
background: #f5f5f5;
min-height: 100vh;
}
.notice-tabs {
display: flex;
background: #fff;
padding: 0 24rpx;
border-bottom: 1rpx solid #f0f0f0;
.tab-item {
flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #666;
position: relative;
&.active {
color: #007aff;
font-weight: bold;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 40rpx;
height: 4rpx;
background: #007aff;
border-radius: 2rpx;
}
}
}
}
.notice-list {
padding: 24rpx;
.empty-tip {
text-align: center;
color: #999;
font-size: 28rpx;
padding: 120rpx 0;
}
.notice-item {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.item-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16rpx;
.title {
flex: 1;
font-size: 32rpx;
font-weight: bold;
color: #333;
line-height: 1.4;
margin-right: 16rpx;
}
.type-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
white-space: nowrap;
&.type-important {
background: #ffebee;
color: #d32f2f;
}
&.type-general {
background: #f5f5f5;
color: #666;
}
&.type-activity {
background: #e8f5e8;
color: #388e3c;
}
}
}
.item-content {
font-size: 28rpx;
color: #666;
line-height: 1.5;
margin-bottom: 16rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
.time {
font-size: 24rpx;
color: #999;
}
.top-tag {
font-size: 24rpx;
color: #d32f2f;
background: #ffebee;
padding: 4rpx 12rpx;
border-radius: 12rpx;
margin-left: 12rpx;
}
.read-tag {
font-size: 24rpx;
color: #999;
background: #f5f5f5;
padding: 4rpx 12rpx;
border-radius: 12rpx;
margin-left: 12rpx;
}
}
}
}
.load-more {
text-align: center;
padding: 32rpx;
color: #007aff;
font-size: 28rpx;
}
</style>
+252
View File
@@ -0,0 +1,252 @@
<template>
<view class="repair-detail">
<view class="detail-header">
<view class="equipment-info">
<text class="equipment-name">{{ detail.equipmentName }}</text>
<text class="location">{{ detail.location }}</text>
</view>
<view class="status-tag" :class="getStatusClass(detail.status)">{{ getStatusText(detail.status) }}</view>
</view>
<view class="detail-content">
<view class="info-row">
<text class="label">维修类型:</text>
<text class="value">{{ getTypeLabel(detail.type) }}</text>
</view>
<view class="info-row">
<text class="label">紧急程度:</text>
<text class="value">{{ getUrgencyLabel(detail.urgency) }}</text>
</view>
<view class="info-row">
<text class="label">联系电话:</text>
<text class="value">{{ detail.phone }}</text>
</view>
<view class="description-section">
<text class="label">故障描述:</text>
<text class="description">{{ detail.description }}</text>
</view>
</view>
<view v-if="detail.repairResult" class="result-section">
<view class="result-title">维修结果</view>
<view class="result-content">{{ detail.repairResult }}</view>
<view class="result-time">{{ formatTime(detail.repairTime) }}</view>
</view>
<view class="detail-footer">
<text class="create-time">申请时间:{{ formatTime(detail.createTime) }}</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const detail = ref<any>({})
const typeOptions = [
{ value: '1', label: '电气设备' },
{ value: '2', label: '网络设备' },
{ value: '3', label: '办公设备' },
{ value: '4', label: '空调设备' },
{ value: '5', label: '其他' }
]
const urgencyOptions = [
{ value: '1', label: '高' },
{ value: '2', label: '中' },
{ value: '3', label: '低' }
]
function getTypeLabel(type: string) {
const option = typeOptions.find(item => item.value === type)
return option ? option.label : '其他'
}
function getUrgencyLabel(urgency: string) {
const option = urgencyOptions.find(item => item.value === String(urgency))
return option ? option.label : '--'
}
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待处理',
'2': '处理中',
'3': '已完成',
'4': '已取消'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-processing',
'3': 'status-completed',
'4': 'status-cancelled'
}
return classMap[status] || 'status-pending'
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleString()
}
onLoad(async (options: any) => {
const id = options.id
if (!id) return
try {
const response: any = await meetingRoomApi.getRepairDetail(id)
if (response.code === 0 && response.data) {
detail.value = response.data
}
} catch (error) {
console.error('获取维修详情失败:', error)
uni.showToast({ title: '获取详情失败', icon: 'none' })
}
})
</script>
<style lang="scss" scoped>
.repair-detail {
padding: 32rpx;
background: #f5f5f5;
min-height: 100vh;
}
.detail-header {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
.equipment-info {
.equipment-name {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-right: 16rpx;
}
.location {
font-size: 26rpx;
color: #666;
}
}
.status-tag {
padding: 12rpx 24rpx;
border-radius: 24rpx;
font-size: 26rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-processing {
background: #e8f5e8;
color: #388e3c;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
&.status-cancelled {
background: #f5f5f5;
color: #999;
}
}
}
.detail-content {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.info-row {
display: flex;
margin-bottom: 16rpx;
.label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.value {
font-size: 28rpx;
color: #333;
flex: 1;
}
}
.description-section {
margin-top: 24rpx;
padding-top: 24rpx;
border-top: 1rpx solid #f0f0f0;
.label {
font-size: 28rpx;
color: #666;
display: block;
margin-bottom: 12rpx;
}
.description {
font-size: 28rpx;
color: #333;
line-height: 1.6;
}
}
}
.result-section {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.result-title {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 16rpx;
}
.result-content {
font-size: 28rpx;
color: #666;
line-height: 1.6;
margin-bottom: 16rpx;
}
.result-time {
font-size: 24rpx;
color: #999;
text-align: right;
}
}
.detail-footer {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.create-time {
font-size: 26rpx;
color: #999;
}
}
</style>
+550
View File
@@ -0,0 +1,550 @@
<template>
<view class="repair-container">
<view class="repair-tabs">
<view :class="['tab', {active: activeTab === 0} ]" @click="activeTab = 0">维修申请</view>
<view :class="['tab', {active: activeTab === 1} ]" @click="activeTab = 1">维修记录</view>
</view>
<view v-if="activeTab === 0">
<!-- 维修申请表单 -->
<view class="repair-form">
<view class="form-title">维修申请</view>
<view class="form-item">
<view class="label">维修类型</view>
<picker @change="onTypeChange" :value="typeIndex" :range="typeOptions" range-key="label">
<view class="picker">{{ typeOptions[typeIndex].label }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">设备名称</view>
<input v-model="title" placeholder="请输入设备名称" class="equipment-input" />
</view>
<view class="form-item">
<view class="label">设备位置</view>
<input v-model="location" placeholder="请输入设备具体位置" class="location-input" />
</view>
<view class="form-item">
<view class="label">发现日期</view>
<picker mode="date" :value="dateFound" @change="onDateChange">
<view class="picker">{{ dateFound || '请选择日期' }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">图片</view>
<view class="image-upload">
<image v-if="picUrl" :src="picUrl" class="feedback-img" mode="aspectFill" @click="previewImage" />
<view v-else class="upload-btn" @click="chooseImage">上传图片</view>
</view>
</view>
<view class="form-item">
<view class="label">故障描述</view>
<textarea
v-model="description"
placeholder="请详细描述设备故障情况..."
class="description-textarea"
maxlength="300"
/>
<view class="char-count">{{ description.length }}/300</view>
</view>
<view class="form-item">
<view class="label">紧急程度</view>
<picker @change="onUrgencyChange" :value="urgencyIndex" :range="urgencyOptions" range-key="label">
<view class="picker">{{ urgencyOptions[urgencyIndex].label }}</view>
</picker>
</view>
<button @click="submitRepair" class="submit-btn" :disabled="!canSubmit">
提交申请
</button>
</view>
</view>
<view v-else>
<!-- 维修记录列表 -->
<view class="repair-list">
<view class="list-title">维修记录</view>
<view v-if="repairList.length === 0" class="empty-tip">
暂无维修记录
</view>
<view v-else>
<view
v-for="item in repairList"
:key="item.id"
class="repair-item"
@click="viewDetail(item)"
>
<view class="item-header">
<view class="type-tag" :class="getTypeClass(item.type)">{{ getTypeLabel(item.type) }}</view>
<view class="status-tag" :class="getStatusClass(item.status)">{{ getStatusText(item.status) }}</view>
</view>
<view class="item-content">
<view class="equipment-info">
<text class="equipment-name">{{ item.equipmentName }}</text>
<text class="location">{{ item.location }}</text>
</view>
<view class="description">{{ item.description }}</view>
</view>
<view class="item-footer">
<text class="time">{{ formatTime(item.createTime) }}</text>
<text v-if="item.urgency === '1'" class="urgency-tag">紧急</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const typeOptions = [
{ value: 1, label: '电气设备' },
{ value: 2, label: '网络设备' },
{ value: 3, label: '办公设备' },
{ value: 4, label: '空调设备' },
{ value: 5, label: '其他' }
]
const urgencyOptions = [
{ value: 1, label: '高' },
{ value: 2, label: '中' },
{ value: 3, label: '低' }
]
const typeIndex = ref(0)
const urgencyIndex = ref(0)
const title = ref('')
const location = ref('')
const description = ref('')
const dateFound = ref('')
const picUrl = ref('')
const repairList = ref<any[]>([])
const activeTab = ref(0)
const canSubmit = computed(() => {
return title.value.trim() && location.value.trim() && description.value.trim() && dateFound.value
})
function onTypeChange(e: any) {
typeIndex.value = e.detail.value
}
function onUrgencyChange(e: any) {
urgencyIndex.value = e.detail.value
}
function onDateChange(e: any) {
dateFound.value = e.detail.value
}
function chooseImage() {
uni.chooseImage({
count: 1,
success: (res) => {
if (res.tempFilePaths && res.tempFilePaths.length > 0) {
picUrl.value = res.tempFilePaths[0]
}
}
})
}
function previewImage() {
if (picUrl.value) {
uni.previewImage({
urls: [picUrl.value]
})
}
}
async function uploadImageIfNeeded() {
if (!picUrl.value || picUrl.value.startsWith('http')) {
return picUrl.value
}
return new Promise<string>((resolve, reject) => {
uni.uploadFile({
url: '/file/upload',
filePath: picUrl.value,
name: 'file',
success: (res) => {
try {
const data = JSON.parse(res.data)
if (data.code === 0 && data.data && data.data.url) {
resolve(data.data.url)
} else {
uni.showToast({ title: '图片上传失败', icon: 'none' })
reject()
}
} catch {
uni.showToast({ title: '图片上传失败', icon: 'none' })
reject()
}
},
fail: () => {
uni.showToast({ title: '图片上传失败', icon: 'none' })
reject()
}
})
})
}
function getTypeLabel(type: number) {
const option = typeOptions.find(item => item.value === type)
return option ? option.label : '其他'
}
function getTypeClass(type: number) {
const classMap: Record<number, string> = {
1: 'type-electrical',
2: 'type-network',
3: 'type-office',
4: 'type-ac',
5: 'type-other'
}
return classMap[type] || 'type-other'
}
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待处理',
'2': '处理中',
'3': '已完成',
'4': '已取消'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-processing',
'3': 'status-completed',
'4': 'status-cancelled'
}
return classMap[status] || 'status-pending'
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleDateString()
}
async function submitRepair() {
if (!canSubmit.value) {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
try {
uni.showLoading({ title: '提交中...' })
let uploadedPicUrl = picUrl.value
if (picUrl.value && !picUrl.value.startsWith('http')) {
uploadedPicUrl = await uploadImageIfNeeded()
}
const data = {
title: title.value.trim(),
picUrl: uploadedPicUrl,
description: description.value.trim(),
dateFound: dateFound.value,
location: location.value.trim(),
urgency: String(urgencyOptions[urgencyIndex.value].value),
maintainType: typeOptions[typeIndex.value].value
}
const response: any = await meetingRoomApi.submitRepair(data)
uni.hideLoading()
if (response.code === 0) {
uni.showToast({ title: '提交成功', icon: 'success' })
// 清空表单
title.value = ''
location.value = ''
description.value = ''
dateFound.value = ''
picUrl.value = ''
typeIndex.value = 0
urgencyIndex.value = 0
// 刷新列表
loadRepairList()
} else {
uni.showToast({ title: response.msg || '提交失败', icon: 'none' })
}
} catch (error) {
uni.hideLoading()
uni.showToast({ title: '提交失败', icon: 'none' })
}
}
function viewDetail(item: any) {
uni.navigateTo({
url: `/pages/integrated/repair/detail?id=${item.id}`
})
}
async function loadRepairList() {
try {
const response: any = await meetingRoomApi.getRepairList({
current: 1,
size: 20
})
if (response.code === 0 && response.data) {
repairList.value = response.data.records || []
}
} catch (error) {
console.error('加载维修记录失败:', error)
}
}
onMounted(() => {
loadRepairList()
})
</script>
<style lang="scss" scoped>
.repair-container {
padding: 24rpx;
background: #f5f5f5;
min-height: 100vh;
}
.repair-tabs {
display: flex;
background: #fff;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
margin-bottom: 24rpx;
.tab {
flex: 1;
text-align: center;
padding: 28rpx 0;
font-size: 30rpx;
color: #888;
background: #f7f8fa;
&.active {
color: #1777FF;
background: #fff;
font-weight: bold;
border-bottom: 4rpx solid #1777FF;
}
}
}
.repair-form {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.form-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.form-item {
margin-bottom: 24rpx;
.label {
font-size: 28rpx;
color: #333;
margin-bottom: 12rpx;
}
.picker {
height: 80rpx;
line-height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.location-input,
.equipment-input,
.phone-input {
height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.description-textarea {
width: 100%;
height: 160rpx;
padding: 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.char-count {
text-align: right;
font-size: 24rpx;
color: #999;
margin-top: 8rpx;
}
}
.submit-btn {
width: 100%;
height: 88rpx;
background: #007aff;
color: #fff;
border-radius: 8rpx;
font-size: 32rpx;
&:disabled {
background: #ccc;
}
}
}
.repair-list {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.list-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.empty-tip {
text-align: center;
color: #999;
font-size: 28rpx;
padding: 60rpx 0;
}
.repair-item {
border-bottom: 1rpx solid #f0f0f0;
padding: 24rpx 0;
&:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.type-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.type-electrical {
background: #fff3e0;
color: #f57c00;
}
&.type-network {
background: #e3f2fd;
color: #1976d2;
}
&.type-office {
background: #f3e5f5;
color: #7b1fa2;
}
&.type-ac {
background: #e8f5e8;
color: #388e3c;
}
&.type-other {
background: #f5f5f5;
color: #666;
}
}
.status-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-processing {
background: #e8f5e8;
color: #388e3c;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
&.status-cancelled {
background: #f5f5f5;
color: #999;
}
}
}
.item-content {
margin-bottom: 16rpx;
.equipment-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
.equipment-name {
font-size: 28rpx;
font-weight: bold;
color: #333;
}
.location {
font-size: 24rpx;
color: #666;
}
}
.description {
font-size: 26rpx;
color: #666;
line-height: 1.5;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
.time {
font-size: 24rpx;
color: #999;
}
.urgency-tag {
font-size: 24rpx;
color: #d32f2f;
background: #ffebee;
padding: 4rpx 12rpx;
border-radius: 12rpx;
}
}
}
}
</style>
+236
View File
@@ -0,0 +1,236 @@
<template>
<view class="visitor-detail">
<view class="detail-header">
<view class="visitor-info">
<text class="visitor-name">{{ detail.visitorName }}</text>
<text class="visitor-phone">{{ detail.visitorPhone }}</text>
</view>
<view class="status-tag" :class="getStatusClass(detail.status)">{{ getStatusText(detail.status) }}</view>
</view>
<view class="detail-content">
<view class="info-row">
<text class="label">来访目的:</text>
<text class="value">{{ getPurposeLabel(detail.purpose) }}</text>
</view>
<view class="info-row">
<text class="label">被访人:</text>
<text class="value">{{ detail.hostName }}</text>
</view>
<view class="info-row">
<text class="label">来访时间:</text>
<text class="value">{{ formatVisitTime(detail.visitDate, detail.visitTime) }}</text>
</view>
<view v-if="detail.remark" class="info-row">
<text class="label">备注说明:</text>
<text class="value">{{ detail.remark }}</text>
</view>
</view>
<view v-if="detail.rejectReason" class="reject-section">
<view class="reject-title">拒绝原因</view>
<view class="reject-content">{{ detail.rejectReason }}</view>
</view>
<view class="detail-footer">
<text class="apply-time">申请时间:{{ formatTime(detail.createTime) }}</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const detail = ref<any>({})
const purposeOptions = [
{ value: '1', label: '商务洽谈' },
{ value: '2', label: '技术交流' },
{ value: '3', label: '面试' },
{ value: '4', label: '参观访问' },
{ value: '5', label: '其他' }
]
const timeOptions = [
{ value: '1', label: '上午 (9:00-12:00)' },
{ value: '2', label: '下午 (14:00-18:00)' },
{ value: '3', label: '全天 (9:00-18:00)' }
]
function getPurposeLabel(purpose: string) {
const option = purposeOptions.find(item => item.value === purpose)
return option ? option.label : '其他'
}
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待审核',
'2': '已通过',
'3': '已拒绝',
'4': '已取消',
'5': '已完成'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-approved',
'3': 'status-rejected',
'4': 'status-cancelled',
'5': 'status-completed'
}
return classMap[status] || 'status-pending'
}
function formatVisitTime(date: string, time: string) {
const timeLabel = timeOptions.find(item => item.value === time)?.label || ''
return `${date} ${timeLabel}`
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleString()
}
onLoad(async (options: any) => {
const id = options.id
if (!id) return
try {
const response: any = await meetingRoomApi.getVisitorDetail(id)
if (response.code === 0 && response.data) {
detail.value = response.data
}
} catch (error) {
console.error('获取访客详情失败:', error)
uni.showToast({ title: '获取详情失败', icon: 'none' })
}
})
</script>
<style lang="scss" scoped>
.visitor-detail {
padding: 32rpx;
background: #f5f5f5;
min-height: 100vh;
}
.detail-header {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
.visitor-info {
.visitor-name {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-right: 16rpx;
}
.visitor-phone {
font-size: 26rpx;
color: #666;
}
}
.status-tag {
padding: 12rpx 24rpx;
border-radius: 24rpx;
font-size: 26rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-approved {
background: #e8f5e8;
color: #388e3c;
}
&.status-rejected {
background: #ffebee;
color: #d32f2f;
}
&.status-cancelled {
background: #f5f5f5;
color: #999;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
}
}
.detail-content {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.info-row {
display: flex;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
.label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.value {
font-size: 28rpx;
color: #333;
flex: 1;
}
}
}
.reject-section {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.reject-title {
font-size: 30rpx;
font-weight: bold;
color: #d32f2f;
margin-bottom: 16rpx;
}
.reject-content {
font-size: 28rpx;
color: #666;
line-height: 1.6;
}
}
.detail-footer {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.apply-time {
font-size: 26rpx;
color: #999;
}
}
</style>
+438
View File
@@ -0,0 +1,438 @@
<template>
<view class="visitor-container">
<!-- 访客申请表单 -->
<view class="visitor-form">
<view class="form-title">访客申请</view>
<view class="form-item">
<view class="label">访客姓名</view>
<input v-model="visitorName" placeholder="请输入访客姓名" class="name-input" />
</view>
<view class="form-item">
<view class="label">访客手机号</view>
<input v-model="visitorPhone" placeholder="请输入访客手机号" class="phone-input" />
</view>
<view class="form-item">
<view class="label">来访目的</view>
<picker @change="onPurposeChange" :value="purposeIndex" :range="purposeOptions" range-key="label">
<view class="picker">{{ purposeOptions[purposeIndex].label }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">来访时间</view>
<picker mode="date" @change="onDateChange" :value="visitDate">
<view class="picker">{{ visitDate || '请选择来访日期' }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">来访时段</view>
<picker @change="onTimeChange" :value="timeIndex" :range="timeOptions" range-key="label">
<view class="picker">{{ timeOptions[timeIndex].label }}</view>
</picker>
</view>
<view class="form-item">
<view class="label">被访人</view>
<input v-model="hostName" placeholder="请输入被访人姓名" class="host-input" />
</view>
<view class="form-item">
<view class="label">备注说明</view>
<textarea
v-model="remark"
placeholder="请输入备注说明(选填)"
class="remark-textarea"
maxlength="200"
/>
<view class="char-count">{{ remark.length }}/200</view>
</view>
<button @click="submitVisitor" class="submit-btn" :disabled="!canSubmit">
提交申请
</button>
</view>
<!-- 访客记录列表 -->
<view class="visitor-list">
<view class="list-title">访客记录</view>
<view v-if="visitorList.length === 0" class="empty-tip">
暂无访客记录
</view>
<view v-else>
<view
v-for="item in visitorList"
:key="item.id"
class="visitor-item"
@click="viewDetail(item)"
>
<view class="item-header">
<view class="visitor-info">
<text class="visitor-name">{{ item.visitorName }}</text>
<text class="visitor-phone">{{ item.visitorPhone }}</text>
</view>
<view class="status-tag" :class="getStatusClass(item.status)">{{ getStatusText(item.status) }}</view>
</view>
<view class="item-content">
<view class="purpose">来访目的:{{ getPurposeLabel(item.purpose) }}</view>
<view class="host">被访人:{{ item.hostName }}</view>
<view class="time">来访时间:{{ formatVisitTime(item.visitDate, item.visitTime) }}</view>
</view>
<view class="item-footer">
<text class="apply-time">申请时间:{{ formatTime(item.createTime) }}</text>
<text v-if="item.remark" class="has-remark">有备注</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import meetingRoomApi from '@/sheep/api/meetingRoom'
const purposeOptions = [
{ value: '1', label: '商务洽谈' },
{ value: '2', label: '技术交流' },
{ value: '3', label: '面试' },
{ value: '4', label: '参观访问' },
{ value: '5', label: '其他' }
]
const timeOptions = [
{ value: '1', label: '上午 (9:00-12:00)' },
{ value: '2', label: '下午 (14:00-18:00)' },
{ value: '3', label: '全天 (9:00-18:00)' }
]
const visitorName = ref('')
const visitorPhone = ref('')
const purposeIndex = ref(0)
const visitDate = ref('')
const timeIndex = ref(0)
const hostName = ref('')
const remark = ref('')
const visitorList = ref<any[]>([])
const canSubmit = computed(() => {
return visitorName.value.trim() &&
visitorPhone.value.trim() &&
visitDate.value &&
hostName.value.trim()
})
function onPurposeChange(e: any) {
purposeIndex.value = e.detail.value
}
function onDateChange(e: any) {
visitDate.value = e.detail.value
}
function onTimeChange(e: any) {
timeIndex.value = e.detail.value
}
function getPurposeLabel(purpose: string) {
const option = purposeOptions.find(item => item.value === purpose)
return option ? option.label : '其他'
}
function getStatusText(status: string) {
const statusMap: Record<string, string> = {
'1': '待审核',
'2': '已通过',
'3': '已拒绝',
'4': '已取消',
'5': '已完成'
}
return statusMap[status] || '未知'
}
function getStatusClass(status: string) {
const classMap: Record<string, string> = {
'1': 'status-pending',
'2': 'status-approved',
'3': 'status-rejected',
'4': 'status-cancelled',
'5': 'status-completed'
}
return classMap[status] || 'status-pending'
}
function formatVisitTime(date: string, time: string) {
const timeLabel = timeOptions.find(item => item.value === time)?.label || ''
return `${date} ${timeLabel}`
}
function formatTime(time: string) {
if (!time) return ''
return new Date(time).toLocaleDateString()
}
async function submitVisitor() {
if (!canSubmit.value) {
uni.showToast({ title: '请填写完整信息', icon: 'none' })
return
}
// 验证手机号格式
const phoneRegex = /^1[3-9]\d{9}$/
if (!phoneRegex.test(visitorPhone.value)) {
uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
return
}
try {
uni.showLoading({ title: '提交中...' })
const data = {
visitorName: visitorName.value.trim(),
visitorPhone: visitorPhone.value.trim(),
purpose: purposeOptions[purposeIndex.value].value,
visitDate: visitDate.value,
visitTime: timeOptions[timeIndex.value].value,
hostName: hostName.value.trim(),
remark: remark.value.trim()
}
const response: any = await meetingRoomApi.submitVisitor(data)
uni.hideLoading()
if (response.code === 0) {
uni.showToast({ title: '提交成功', icon: 'success' })
// 清空表单
visitorName.value = ''
visitorPhone.value = ''
purposeIndex.value = 0
visitDate.value = ''
timeIndex.value = 0
hostName.value = ''
remark.value = ''
// 刷新列表
loadVisitorList()
} else {
uni.showToast({ title: response.msg || '提交失败', icon: 'none' })
}
} catch (error) {
uni.hideLoading()
uni.showToast({ title: '提交失败', icon: 'none' })
}
}
function viewDetail(item: any) {
uni.navigateTo({
url: `/pages/integrated/visitor/detail?id=${item.id}`
})
}
async function loadVisitorList() {
try {
const response: any = await meetingRoomApi.getVisitorList({
current: 1,
size: 20
})
if (response.code === 0 && response.data) {
visitorList.value = response.data.records || []
}
} catch (error) {
console.error('加载访客记录失败:', error)
}
}
onMounted(() => {
loadVisitorList()
})
</script>
<style lang="scss" scoped>
.visitor-container {
padding: 24rpx;
background: #f5f5f5;
min-height: 100vh;
}
.visitor-form {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
.form-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.form-item {
margin-bottom: 24rpx;
.label {
font-size: 28rpx;
color: #333;
margin-bottom: 12rpx;
}
.picker {
height: 80rpx;
line-height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.name-input,
.phone-input,
.host-input {
height: 80rpx;
padding: 0 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
}
.remark-textarea {
width: 100%;
height: 120rpx;
padding: 24rpx;
background: #f7f8fa;
border-radius: 8rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.char-count {
text-align: right;
font-size: 24rpx;
color: #999;
margin-top: 8rpx;
}
}
.submit-btn {
width: 100%;
height: 88rpx;
background: #007aff;
color: #fff;
border-radius: 8rpx;
font-size: 32rpx;
&:disabled {
background: #ccc;
}
}
}
.visitor-list {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
.list-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.empty-tip {
text-align: center;
color: #999;
font-size: 28rpx;
padding: 60rpx 0;
}
.visitor-item {
border-bottom: 1rpx solid #f0f0f0;
padding: 24rpx 0;
&:last-child {
border-bottom: none;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.visitor-info {
.visitor-name {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-right: 16rpx;
}
.visitor-phone {
font-size: 26rpx;
color: #666;
}
}
.status-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
&.status-pending {
background: #fff3e0;
color: #f57c00;
}
&.status-approved {
background: #e8f5e8;
color: #388e3c;
}
&.status-rejected {
background: #ffebee;
color: #d32f2f;
}
&.status-cancelled {
background: #f5f5f5;
color: #999;
}
&.status-completed {
background: #e3f2fd;
color: #1976d2;
}
}
}
.item-content {
margin-bottom: 16rpx;
.purpose,
.host,
.time {
font-size: 26rpx;
color: #666;
margin-bottom: 8rpx;
line-height: 1.4;
}
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
.apply-time {
font-size: 24rpx;
color: #999;
}
.has-remark {
font-size: 24rpx;
color: #007aff;
background: #e3f2fd;
padding: 4rpx 12rpx;
border-radius: 12rpx;
}
}
}
}
</style>
+1 -42
View File
@@ -59,16 +59,7 @@
<view v-if="!loading && visitorList.length === 0" class="empty">暂无访客记录</view>
</scroll-view>
<view class="tabbar">
<view class="tabbar-item" @tap="goHome">
<image src="/static/icons/home.png" class="tabbar-icon" />
<text>首页</text>
</view>
<view class="tabbar-item" @tap="goMine">
<image src="/static/icons/mine.png" class="tabbar-icon" />
<text>我的</text>
</view>
</view>
<tabbar :tabBarList="tabBarList" :current="tabbarStore.current" />
</view>
</template>
@@ -489,37 +480,5 @@ onMounted(() => {
color: #999;
font-size: 26rpx;
}
.tabbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 100rpx;
background: #fff;
display: flex;
border-top: 1px solid #eee;
z-index: 999;
}
.tabbar-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #888;
font-size: 24rpx;
}
.tabbar-icon {
width: 48rpx;
height: 48rpx;
margin-bottom: 4rpx;
}
.tabbar-item.active {
color: #1777FF;
}
}
</style>
+16 -14
View File
@@ -26,11 +26,11 @@
<view class="text-32 ws-nowrap text-ellipsis overflow-hidden">{{ state.goodsDetail.productName }}</view>
<view class="flex items-center">
<view class="second-text-30 c-red!">
促销 ¥{{ parseFloat(state.selectedSku.promotionPrice) || state.selectedSku.retailPrice || 0 }}
促销 ¥{{ hooks.useMoney(state.selectedSku.promotionPrice) || hooks.useMoney(state.selectedSku.retailPrice) || 0 }}
</view>
<view class="m-l-20rpx second-text-28 line-through">原价 ¥{{ state.selectedSku.retailPrice || 0 }}</view>
<view class="m-l-20rpx second-text-28 line-through">原价 ¥{{ hooks.useMoney(state.selectedSku.retailPrice) || 0 }}</view>
</view>
<view class="second-text-26">内装数量:{{ state.selectedSku.packageNum || 0 }}</view>
<view class="second-text-26">库存:{{ state.selectedSku.stock || 0 }}</view>
<view class="second-text-26">
已选择:{{ `${state.selectedSku.spec || "未选择"} / ${state.selectedSku.unit || "未选择"},数量:${state.goodsCount}` }}
</view>
@@ -71,7 +71,7 @@
<template #footer>
<button
class="mx-12 rounded-3 bg-#0094ff sub-text-30 py-2 c-white!"
class="mx-12 rounded-3 bg-#0094ff sub-text-30 py-2 c-white! active:bg-#0094ff99"
:class="{ 'bg-#0094ff77!': Object.keys(state.selectedSku).length === 0 }"
@tap="handleSkuAddToCart"
>
@@ -87,6 +87,7 @@ import { filePath } from "@/sheep/utils/file"
import { reactive, watch } from "vue"
import { usePreviewImage } from "@/sheep/hooks/use-img"
import { isEmpty } from "radash"
import { hooks } from "@/sheep"
const emit = defineEmits(["update:modelValue", "onSkuAddToCart"])
@@ -155,17 +156,18 @@ const handleSkuAddToCart = async () => {
if (!state.selectedSku.id) return uni.showToast({ title: "请选择包装单位", icon: "none" })
// 检查库存
try {
uni.showLoading({ title: "加载中", mask: true })
const { code }: any = await shopApi.checkSpuStock({ spuId: state.goodsDetail.id, incrCount: state.goodsCount })
if (code != 0) return uni.showToast({ title: "库存不足", icon: "none" })
} catch (e) {
console.error(e)
} finally {
uni.hideLoading()
}
// try {
// uni.showLoading({ title: "加载中", mask: true })
// const { code }: any = await shopApi.checkSpuStock({ spuId: state.goodsDetail.id, incrCount: state.goodsCount })
// if (code != 0) return uni.showToast({ title: "库存不足", icon: "none" })
// } catch (e) {
// console.error(e)
// } finally {
// uni.hideLoading()
// }
// 检查库存
if (state.goodsDetail.stock === 0) return uni.showToast({ title: "库存不足", icon: "none" })
if (state.goodsDetail.stock === 0 || Number(state.goodsCount) > Number(state.selectedSku.stock))
return uni.showToast({ title: "库存不足", icon: "none" })
emit("onSkuAddToCart", {
spuId: state.goodsDetail.id,
+10 -8
View File
@@ -2,7 +2,7 @@
import { reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { shopApi } from "@@/api"
import { onlineShopApi } from "@@/api"
import { filePath } from "@/sheep/utils/file"
import ProductSku from "./components/product-sku.vue"
import { useCartStore } from "@/sheep/stores/cart"
@@ -26,7 +26,7 @@ onShow(() => {
})
const getDetail = async () => {
const { data } = await shopApi.getSupermarketSpuDetail({ id: state.detailId })
const { data } = await onlineShopApi.getSpuDetail(state.detailId)
state.detail = data ?? {}
}
@@ -70,8 +70,8 @@ const doCart = async () => {
<view class="prefix_title mb-15rpx">商品</view>
<view class="sub-text-32">{{ state.detail?.productName }}</view>
<view class="flex-row items-center justify-between m-t-15rpx">
<view class="second-text-26">库存{{ state.detail?.stock }}</view>
<view class="second-text-26">已售{{ state.detail?.salesCount }}</view>
<view class="second-text-26">限购:{{ state.detail?.limitNum || 0 }}</view>
<view class="second-text-26">已售:{{ state.detail?.salesCount || 0 }}</view>
</view>
</view>
@@ -80,12 +80,14 @@ const doCart = async () => {
<view class="prefix_title mb-15rpx">包装</view>
<view class="flex flex-wrap">
<view class="w-1/3 flex justify-center p-1" v-for="(item, index) in state.detail?.skuList" :key="index">
<view class="p-2 bg-#eeeeee77 rounded-3 flex-col items-center">
<view class="p-2 w-full bg-#eeeeee77 rounded-3 flex-col items-center">
<view class="second-text-28">{{ item.spec + " / " + item.unit }}</view>
<view class="second-text-28">内装:{{ item.packageNum }}</view>
<view class="second-text-28">库存:{{ item?.stock || 0 }}</view>
<view class="flex items-center">
<view class="second-text-30 c-red!">¥{{ parseFloat(item.promotionPrice) || item.retailPrice || 0 }}</view>
<view class="ml-4rpx second-text-30 line-through">¥{{ item.retailPrice || 0 }}</view>
<view class="second-text-28 c-red!">
¥{{ hooks.useMoney(item.promotionPrice) || hooks.useMoney(item.retailPrice) || 0 }}
</view>
<view class="ml-4rpx second-text-28 line-through">¥{{ hooks.useMoney(item.retailPrice) || 0 }}</view>
</view>
</view>
</view>
+2 -2
View File
@@ -85,8 +85,6 @@ const state = reactive<{
{ text: "扫一扫", icon: "/static/icon/scan.png", router: "" },
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
// { text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
{ text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
{ text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" },
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" },
{ text: "清除缓存", icon: "/static/icon/clear-storage.png", router: "" },
],
@@ -403,6 +401,8 @@ const doChangeRole = () => {
// 初始化配置菜单
const initMenuConfig = () => {
if (isDevEnv()) {
state.menuList.push({ text: "dev-外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" })
state.menuList.push({ text: "dev-跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" })
state.menuList.push({
text: "测试-第三方应用",
icon: "/static/icon/login.png",
+20 -10
View File
@@ -92,7 +92,7 @@
¥{{ hooks.useMoney(item.retailPrice) || 0 }}
</view>
</view>
<view class="second-text-26">已售:{{ item.salesCount }}</view>
<view class="second-text-26">已售:{{ item.salesCount || 0 }}</view>
</view>
</view>
</view>
@@ -150,7 +150,7 @@ import { LazyImg, Waterfall } from "vue-waterfall-plugin-next"
import "vue-waterfall-plugin-next/dist/style.css"
import { isEmpty } from "radash"
import { filePath } from "@@/utils/file"
import { merchantApi, shopApi } from "@@/api"
import { merchantApi, onlineShopApi } from "@@/api"
import { hooks, router } from "@@/index"
import { useCartStore } from "@/sheep/stores/cart"
@@ -191,9 +191,9 @@ onShow(() => {
const getAllMerchant = async () => {
uni.showLoading({ title: "加载中...", mask: true })
try {
const res: any = await merchantApi.page({ current: 1, pagesize: 9999999, type: "3" })
if (res.code == 0) {
state.merchantList = res.data.records
const { code, data }: any = await merchantApi.page({ current: 1, pagesize: 9999999, type: "3" })
if (code == 0) {
state.merchantList = data.records
if (!isEmpty(state.merchantList)) {
state.curMerchant = state.merchantList[0]
return
@@ -207,11 +207,22 @@ const getAllMerchant = async () => {
}
}
const treeToList = <T extends { children?: T[] }>(tree: T[], result: T[] = []): T[] => {
for (const node of tree) {
result.push(node)
if (node?.children?.length) {
treeToList(node.children, result)
}
}
return result
}
// 获取分类
const getClassify = async () => {
if (state.curMerchant.id) {
const { data } = await shopApi.getSupermarketSpuCategory({ merchantId: state.curMerchant.id })
state.classifyList = data ?? []
// const { data } = await shopApi.getSupermarketSpuCategory({ merchantId: state.curMerchant.id })
const { data } = await onlineShopApi.getSpuCategory()
state.classifyList = treeToList(data) ?? []
state.classifyList.unshift({ id: "", name: "全部分类" })
if (!isEmpty(state.classifyList)) {
state.params.categoryId = state.classifyList[0].id
@@ -230,7 +241,6 @@ const changeShop = () => {
const confirmRadioMerchant = async () => {
state.curMerchant = state.merchantList.find((item: any) => item.id == state.curMerchantRadioId)
state.showDrawer = false
await getClassify()
cartStore.saveShopMerchantId(state.curMerchant.id)
await cartStore.getShopCart()
}
@@ -248,10 +258,10 @@ const doClassify = async (categoryId: string) => {
pageRef.value && pageRef.value.reload(true)
}
const pageHook = hooks.usePage(pageRef, shopApi.getSupermarketSpuList, null, "data.records")
const pageHook = hooks.usePage(pageRef, onlineShopApi.getSpuList, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, { ...state.params, merchantId: state.curMerchant.id })
pageHook.startPage(page, pagesize, false, state.params)
}
const toDetail = async (v: any) => {
+1 -1
View File
@@ -60,7 +60,7 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { hooks, router } from "@@/index"
import { hooks } from "@@/index"
import { merchantApi } from "@@/api"
import { filePath } from "@@/utils/file"
+2
View File
@@ -26,6 +26,8 @@ export { default as faceApi } from "./face"
export { default as shopApi } from "./shop"
export { default as onlineShopApi } from "./onlineShop"
export { default as flowStatisticsApi } from "./flowStatistics"
export { default as individualOrderApi } from "./individualOrder"
+170
View File
@@ -37,4 +37,174 @@ export default {
method: "POST",
data,
}),
/**
* 获取我的预约列表
*/
getMyBookings: (params: { current: number; size: number; checkStatus?: number }) =>
request({
url: '/integrated/meetingRoom/app/my-bookings',
method: 'GET',
params,
}),
/**
* 获取预约详情
*/
getBookingDetail: (id: string) =>
request({
url: `/integrated/meetingRoom/app/booking-detail/${id}`,
method: 'GET',
}),
// ========== 意见反馈相关接口 ==========
/**
* 提交意见反馈
*/
submitFeedback: (data: {
title: string;
description: string;
picUrl?: string;
type: string;
contact?: string;
}) =>
request({
url: '/integrated/feedback/app/save',
method: 'POST',
data,
}),
/**
* 获取我的反馈列表
*/
getFeedbackList: (params: { current: number; size: number }) =>
request({
url: '/integrated/feedback/app/page',
method: 'GET',
params,
}),
/**
* 获取反馈详情
*/
getFeedbackDetail: (id: string) =>
request({
url: '/integrated/feedback/app/getDetails',
method: 'GET',
params: { id },
}),
/**
* 获取反馈类型字典
*/
getFeedbackType: () =>
request({
url: '/integrated/feedback/app/getFeedbackType',
method: 'GET',
}),
// ========== 维修上报相关接口 ==========
/**
* 提交维修申请
*/
submitRepair: (data: {
title: string;
picUrl?: string;
description: string;
dateFound: string;
location: string;
urgency: string;
maintainType: number;
}) =>
request({
url: '/integrated/maintenanceOrder/app/apply',
method: 'POST',
data,
}),
/**
* 获取我的维修记录列表
*/
getRepairList: (params: { current: number; size: number }) =>
request({
url: '/integrated/maintenanceOrder/app/my',
method: 'GET',
params,
}),
/**
* 获取维修详情
*/
getRepairDetail: (id: string | number) =>
request({
url: `/integrated/maintenanceOrder/app/my/${id}`,
method: 'GET',
}),
// ========== 通知公告相关接口 ==========
/**
* 获取公告列表
*/
getNoticeList: (params: { current: number; size: number; type?: string }) =>
request({
url: '/integrated/notice/list',
method: 'GET',
params,
}),
/**
* 获取公告详情
*/
getNoticeDetail: (id: string) =>
request({
url: `/integrated/notice/detail/${id}`,
method: 'GET',
}),
/**
* 标记公告已读
*/
markNoticeRead: (id: string) =>
request({
url: `/integrated/notice/read/${id}`,
method: 'POST',
}),
// ========== 访客管理相关接口 ==========
/**
* 提交访客申请
*/
submitVisitor: (data: {
visitorName: string;
visitorPhone: string;
purpose: string;
visitDate: string;
visitTime: string;
hostName: string;
remark?: string;
}) =>
request({
url: '/integrated/visitor/submit',
method: 'POST',
data,
}),
/**
* 获取访客记录列表
*/
getVisitorList: (params: { current: number; size: number }) =>
request({
url: '/integrated/visitor/my-list',
method: 'GET',
params,
}),
/**
* 获取访客详情
*/
getVisitorDetail: (id: string) =>
request({
url: `/integrated/visitor/detail/${id}`,
method: 'GET',
}),
}
+20
View File
@@ -0,0 +1,20 @@
import request from "@/sheep/utils/request"
export default {
getSpuCategory: () =>
request({
url: "/supermarket/app/shopCategory/list",
method: "GET",
}),
getSpuList: (params: any) =>
request({
url: "/supermarket/app/shopSpu/page",
method: "GET",
params,
}),
getSpuDetail: (id: any) =>
request({
url: `/supermarket/app/shopSpu/detail/${id}`,
method: "GET",
}),
}