diff --git a/components/instruction.vue b/components/instruction.vue new file mode 100644 index 0000000..068257d --- /dev/null +++ b/components/instruction.vue @@ -0,0 +1,170 @@ + + + + + \ No newline at end of file diff --git a/pages/chat/chatPage.vue b/pages/chat/chatPage.vue index 264c5d0..6c87fe8 100644 --- a/pages/chat/chatPage.vue +++ b/pages/chat/chatPage.vue @@ -24,8 +24,6 @@ - - diff --git a/pages/meetingDetail/index.vue b/pages/meetingDetail/index.vue index b4c8fb9..65471e6 100644 --- a/pages/meetingDetail/index.vue +++ b/pages/meetingDetail/index.vue @@ -63,15 +63,8 @@ 备注信息 - + @@ -120,6 +113,11 @@ formatTime, formatRelativeTime } from '@/utils/timeFormat'; + import { + applyType, + usage, + thingTheme + } from '@/utils/dict.js' export default { data() { const now = new Date(); @@ -167,7 +165,7 @@ // 新增备注字段 remark: '', - + noticeList: [ '每次预订时间单位为小时,最少0.5小时起预订。', '使用优惠券支付,取消预订后优惠券会自动退还。', @@ -181,6 +179,7 @@ onLoad(options) { if (options && options.Id) { this.Id = options.Id; + console.log(applyType.getAll()) console.log("====", this.Id) } }, @@ -292,7 +291,7 @@ handleBook() { this.validateTime(); - + // 构建预订信息对象 const bookingInfo = { startAt: new Date(`${this.selectedDate} ${this.selectedStartTime}`), @@ -300,47 +299,47 @@ remark: this.remark, roomId: this.Id }; - - + + console.log('提交的预订信息:', bookingInfo); - + uni.showToast({ title: `已预订 ${this.formattedSelectedDate} ${this.selectedStartTime}-${this.selectedEndTime}`, icon: 'none' }); - + // 这里可以添加实际的API调用 - post('/api/v1/app_auth/metting-room/order/register',bookingInfo).then((res)=>{ - console.log("===res",res) + post('/api/v1/app_auth/metting-room/order/register', bookingInfo).then((res) => { + console.log("===res", res) if (!res || !res.success) { throw new Error('会议室预定失败'); } uni.showToast({ - title: '会议室预定成功!', - icon: 'success' + title: '会议室预定成功!', + icon: 'success' }); this.remark = null; - setTimeout(()=>{ + setTimeout(() => { uni.navigateTo({ - url: `/pages/meetingList/index`, - success: () => { - console.log('导航成功,ID:', id); - }, - fail: (err) => { - console.error('导航失败:', err); - uni.showToast({ - title: '打开详情页失败', - icon: 'none' - }); - } + url: `/pages/meetingList/index`, + success: () => { + console.log('导航成功,ID:', id); + }, + fail: (err) => { + console.error('导航失败:', err); + uni.showToast({ + title: '打开详情页失败', + icon: 'none' + }); + } }); - },4000) - - + }, 4000) + + }) // this.submitBooking(bookingInfo); }, - + } }; @@ -348,7 +347,8 @@ \ No newline at end of file diff --git a/utils/dict.js b/utils/dict.js new file mode 100644 index 0000000..24beef8 --- /dev/null +++ b/utils/dict.js @@ -0,0 +1,19 @@ +import { dictManage } from "./dictClass" +//申请类型 +export const applyType=new dictManage([ + {value:1,name:'单位申请'}, + {value:2,name:'个人申请'}, +]) +//使用情况 +export const usage=new dictManage([ + {value:1,name:'已复位'}, + {value:2,name:'设置设备需维修'}, + {value:1,name:'设施设备需照价赔偿'} +]) +//事由主题 +export const thingTheme=new dictManage([ + {value:1,name:'开会'}, + {value:2,name:'学术报告'}, + {value:3,name:'活动'}, + {value:4,name:'其他'} +]) \ No newline at end of file diff --git a/utils/dictClass.js b/utils/dictClass.js new file mode 100644 index 0000000..01fb4c9 --- /dev/null +++ b/utils/dictClass.js @@ -0,0 +1,26 @@ +export class dictManage { + constructor(data) { + this.data = data + this.valueMap = new Map(data.map(item => [item.value, item.name])) + this.nameMap = new Map(data.map(item => [item.name, item.value])) + } + getAll() { + return this.data + } + getValue(name) { + return this.nameMap.get(name) || '' + } + getName(value) { + return this.valueMap.get(value) || '' + } + + // 获取所有value的数组 + getValues() { + return Array.from(this.valueMap.keys()); + } + + // 获取所有name的数组 + getNames() { + return Array.from(this.valueMap.values()); + } +} \ No newline at end of file