diff --git a/components/noData.vue b/components/noData.vue new file mode 100644 index 0000000..0d2c877 --- /dev/null +++ b/components/noData.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/components/signature.vue b/components/signature.vue new file mode 100644 index 0000000..0b64f36 --- /dev/null +++ b/components/signature.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index dcbc6dd..e2dd0f6 100644 --- a/pages.json +++ b/pages.json @@ -202,6 +202,19 @@ "navigationStyle": "default", "usingComponents": {} } + }, + { + "path" : "pages/meetingDetail/ceshi/ceshi", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path": "pages/sign/sign", + "style": { + "navigationBarTitleText": "电子签名" + } } ], diff --git a/pages/meetingDetail/index.vue b/pages/meetingDetail/index.vue index 65471e6..58f96a9 100644 --- a/pages/meetingDetail/index.vue +++ b/pages/meetingDetail/index.vue @@ -26,19 +26,83 @@ - 选择日期 + 申请时间 {{ formattedSelectedDate }} + + + + 事由主题 + + + + + + + + + + + 申请人类型 + + + {{applyName}} + + + + + + + + + + + + + + + + + + 负责人 + + + + + + + + + + + + + + 申请场次及人数 + + + + + + + + + + + - - 选择时间段 + + 借用时间 @@ -56,20 +120,24 @@ - - - + - - 备注信息 + + 使用情况 + + + + + - - + - 立即预订 + + 立即预订 @@ -92,11 +161,21 @@ @confirm="handleDateConfirm" @close="showCalendar = false" :mask-close-able="true"> - + - + + + + + + + + + @@ -115,10 +194,12 @@ } from '@/utils/timeFormat'; import { applyType, - usage, - thingTheme + usages, + thingThemes } from '@/utils/dict.js' + import signature from '../../components/signature.vue'; export default { + components:{signature}, data() { const now = new Date(); const year = now.getFullYear(); @@ -136,21 +217,39 @@ if (endHours >= 24) endHours = 0; return { + chargeName: '', + chargePhone: '', + companyName: '', + userCard: '', + userName: '', + session:'', + num:'', // 会议室图片数组 + thingTheme: [], + thingThemes: thingThemes.getAll(), + usage:[], + usages:usages.getAll(), list1: [], detail: {}, - + signatureShow:false, + isSelfStudy: true, //dateTime,yearmonth + mode: 'datetime', + precision: null, // 日历控制(默认隐藏) showCalendar: false, calendarKey: 0, - + showApplyType: false, + applyTypeColumns: [ + ['个人申请', '单位申请'] + ], + applyName: '', // 时间选择器控制 showStartTimePicker: false, showEndTimePicker: false, // 使用字符串格式的时间 - startTimePickerValue: `${startHours.toString().padStart(2, '0')}:${startMinutes.toString().padStart(2, '0')}`, - endTimePickerValue: `${endHours.toString().padStart(2, '0')}:${endMinutes.toString().padStart(2, '0')}`, + startTimePickerValue: `${year}-${month}-${day}`, + endTimePickerValue: ``, // 日期相关 selectedDate: `${year}-${month}-${day}`, @@ -158,8 +257,8 @@ maxDate: `${year + 1}-12-31`, // 时间相关 - selectedStartTime: `${startHours.toString().padStart(2, '0')}:${startMinutes.toString().padStart(2, '0')}`, - selectedEndTime: `${endHours.toString().padStart(2, '0')}:${endMinutes.toString().padStart(2, '0')}`, + selectedStartTime: ``, + selectedEndTime: ``, startTimeValue: `${startHours.toString().padStart(2, '0')}:${startMinutes.toString().padStart(2, '0')}`, endTimeValue: `${endHours.toString().padStart(2, '0')}:${endMinutes.toString().padStart(2, '0')}`, @@ -167,7 +266,7 @@ remark: '', noticeList: [ - '每次预订时间单位为小时,最少0.5小时起预订。', + '', '使用优惠券支付,取消预订后优惠券会自动退还。', '使用微信、支付宝支付,取消订单后需要转社区运营人员进行退款。', '系统不支持自动退款。', @@ -176,30 +275,48 @@ Id: '', }; }, + onReady() { + // 微信小程序需要用此写法 + // this.$refs.startTimePicker.setFormatter(this.formatter) + // this.$refs.endTimePicker.setFormatter(this.formatter) + }, onLoad(options) { if (options && options.Id) { this.Id = options.Id; - console.log(applyType.getAll()) - console.log("====", this.Id) + this.mode = options.isSelfStudy === 'true' ? 'year-month' : 'datetime' } }, computed: { formattedSelectedDate() { if (!this.selectedDate) return '请选择日期'; + console.log(this.selectedDate) + // const date = new Date(this.selectedDate); + // const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; + // const month = date.getMonth() + 1; + // const day = date.getDate(); + // const weekday = weekdays[date.getDay()]; - const date = new Date(this.selectedDate); - const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; - const month = date.getMonth() + 1; - const day = date.getDate(); - const weekday = weekdays[date.getDay()]; - - return `${month}月${day}日 ${weekday}`; + // return `${month}月${day}日 ${weekday}`; + return this.selectedDate } }, mounted() { this.getDetail(); }, methods: { + formatter(type, value) { + if (type === 'year') { + return `${value}年` + } + if (type === 'month') { + return `${value}月` + } + if (type === 'day') { + return `${value}日` + } + + return value + }, // 获取详情页面 async getDetail() { try { @@ -221,6 +338,17 @@ console.error('获取详情失败:', err); } }, + thingCheckboxChange(e) { + console.log(e); + }, + usagesCheckboxChange(e){ + console.log(e); + }, + applyConfirm(e) { + console.log(e) + this.applyName = e.value[0] + this.showApplyType = false + }, handleDateConfirm(e) { let selectedDate; @@ -245,20 +373,27 @@ }, handleStartTimeConfirm(e) { - this.selectedStartTime = e.value; - this.startTimePickerValue = e.value; + const date = new Date(e.value) + const dateString = this.mode === 'year-month' ? `${date.getFullYear()}-${date.getMonth()+1}` : + `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:00` + this.selectedStartTime = dateString; + this.startTimePickerValue = dateString; this.showStartTimePicker = false; - this.adjustEndTime(); + // this.adjustEndTime(); }, handleEndTimeConfirm(e) { - this.selectedEndTime = e.value; - this.endTimePickerValue = e.value; + const date = new Date(e.value) + const dateString = this.mode === 'year-month' ? `${date.getFullYear()}-${date.getMonth()+1}` : + `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:00` + this.selectedEndTime = dateString; + this.endTimePickerValue = dateString; this.showEndTimePicker = false; - this.validateTime(); + // this.validateTime(); }, adjustEndTime() { + console.log(this.selectedStartTime) const [startH, startM] = this.selectedStartTime.split(':').map(Number); let [endH, endM] = this.selectedEndTime.split(':').map(Number); @@ -448,42 +583,62 @@ } /* 时间选择区域 */ + + .time-section { + flex: 1; margin-bottom: 32rpx; + .time-selector { + flex: 1 + } + + .time-label { + font-size: 26rpx; + color: #666; + margin-bottom: 8rpx; + display: block; + } + + .time-display { + padding: 20rpx; + background: #f8f9fa; + border-radius: 12rpx; + text-align: center; + font-size: 28rpx; + color: #333; + height: 15px; + } + + .section-header { + display: flex; + align-items: center; + margin-bottom: 16rpx; + font-size: 28rpx; + } + + .section-title { + font-size: 28rpx; + color: #333; + margin-left: 8rpx; + } + .time-picker { display: flex; align-items: center; gap: 16rpx; } - .time-selector { - flex: 1; - - .time-label { - font-size: 26rpx; - color: #666; - margin-bottom: 8rpx; - display: block; - } - - .time-display { - padding: 20rpx; - background: #f8f9fa; - border-radius: 12rpx; - text-align: center; - font-size: 28rpx; - color: #333; - } - } - .time-separator { color: #999; font-size: 28rpx; padding-top: 28rpx; } + } + + /* 新增备注区域 */ .remark-section { margin-top: 24rpx; diff --git a/pages/meetingList/index.vue b/pages/meetingList/index.vue index 3c7e84e..864d1ef 100644 --- a/pages/meetingList/index.vue +++ b/pages/meetingList/index.vue @@ -31,8 +31,7 @@ - - 暂无预约记录 + @@ -105,9 +104,11 @@ formatRelativeTime } from '@/utils/timeFormat'; import instructionVue from '../../components/instruction.vue'; + import noData from '../../components/noData.vue' export default { components: { - instructionVue + instructionVue, + noData }, data() { return { @@ -129,7 +130,7 @@ ], IMAGE_BASE_URL, tabsReady: false, - show: true, + show: false, title: '使用说明', content: '', tabList: [{ @@ -253,7 +254,7 @@ // 安全获取ID(兼容各种可能的字段名) const id = item.id; - + const isSelfStudy=item.title==='自习室'?'true':'false' if (!id) { uni.showToast({ title: '会议室信息异常', @@ -263,7 +264,7 @@ } uni.navigateTo({ - url: `/pages/meetingDetail/index?Id=${encodeURIComponent(id)}`, // 使用encodeURIComponent防止特殊字符问题 + url: `/pages/meetingDetail/index?Id=${encodeURIComponent(id)}&isSelfStudy=${isSelfStudy}`, // 使用encodeURIComponent防止特殊字符问题 success: () => { console.log('导航成功,ID:', id); }, diff --git a/pages/sign/pickerColor.vue b/pages/sign/pickerColor.vue new file mode 100644 index 0000000..b074da1 --- /dev/null +++ b/pages/sign/pickerColor.vue @@ -0,0 +1,145 @@ + + + + + \ No newline at end of file diff --git a/pages/sign/sign.vue b/pages/sign/sign.vue new file mode 100644 index 0000000..44282da --- /dev/null +++ b/pages/sign/sign.vue @@ -0,0 +1,596 @@ + + + + + \ No newline at end of file diff --git a/static/imgs/noData.jpeg b/static/imgs/noData.jpeg deleted file mode 100644 index 8b28751..0000000 Binary files a/static/imgs/noData.jpeg and /dev/null differ diff --git a/static/imgs/noData.png b/static/imgs/noData.png new file mode 100644 index 0000000..79e28d0 Binary files /dev/null and b/static/imgs/noData.png differ diff --git a/static/other/color_black.png b/static/other/color_black.png new file mode 100644 index 0000000..4b19b54 Binary files /dev/null and b/static/other/color_black.png differ diff --git a/static/other/color_black_selected.png b/static/other/color_black_selected.png new file mode 100644 index 0000000..9ff5984 Binary files /dev/null and b/static/other/color_black_selected.png differ diff --git a/static/other/color_red.png b/static/other/color_red.png new file mode 100644 index 0000000..8dcbfe0 Binary files /dev/null and b/static/other/color_red.png differ diff --git a/static/other/color_red_selected.png b/static/other/color_red_selected.png new file mode 100644 index 0000000..6d40ed9 Binary files /dev/null and b/static/other/color_red_selected.png differ diff --git a/utils/dict.js b/utils/dict.js index 24beef8..5ae579a 100644 --- a/utils/dict.js +++ b/utils/dict.js @@ -5,15 +5,15 @@ export const applyType=new dictManage([ {value:2,name:'个人申请'}, ]) //使用情况 -export const usage=new dictManage([ +export const usages=new dictManage([ {value:1,name:'已复位'}, {value:2,name:'设置设备需维修'}, {value:1,name:'设施设备需照价赔偿'} ]) //事由主题 -export const thingTheme=new dictManage([ +export const thingThemes=new dictManage([ {value:1,name:'开会'}, {value:2,name:'学术报告'}, {value:3,name:'活动'}, {value:4,name:'其他'} -]) \ No newline at end of file +])