diff --git a/app.json b/app.json index b8fcb85..55c4dd4 100644 --- a/app.json +++ b/app.json @@ -74,6 +74,15 @@ "reserve/reserve" ] } + ,{ + "root": "subpages/goOut", + "name":"goOut", + "pages":[ + "goOut/goOut", + "mygoOut/mygoOut" + ] + } + ], "window": { "navigationBarTextStyle": "black", diff --git a/images/icon/warning.png b/images/icon/warning.png new file mode 100644 index 0000000..39947d4 Binary files /dev/null and b/images/icon/warning.png differ diff --git a/images/success.png b/images/success.png new file mode 100644 index 0000000..dc8be19 Binary files /dev/null and b/images/success.png differ diff --git a/pages/index/index.js b/pages/index/index.js index 802b600..e9a90d5 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -38,14 +38,14 @@ Page({ url: "/subpages/index/renewalApplication/renewalApplication", image:'../../images/icon/yanzu.png' }, + // { + // name: "问题反馈", + // url: "/subpages/bsPage/bsPage/bsPage", + // image:'../../images/icon/baoxiu.png' + // }, { - name: "问题反馈", - url: "/subpages/bsPage/bsPage/bsPage", - image:'../../images/icon/baoxiu.png' - }, - { - name: "居住评价", - url: "/subpages/mine/checkInEvaluate/checkInEvaluate", + name: "外出申请", + url: "/subpages/goOut/goOut/goOut", image:'../../images/icon/47f8f3454b398d2a7b67b10d78321687.png' }, // { diff --git a/pages/mine/mine.js b/pages/mine/mine.js index b3dfa68..267456d 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -25,10 +25,10 @@ Page({ // label:'我的报修', // url:'/subpages/mine/repairList/repairList' // }, - { - label:'问题反馈', - url:'/subpages/mine/eventList/eventList' - }, + // { + // label:'问题反馈', + // url:'/subpages/mine/eventList/eventList' + // }, { label:'共享空间', url:'/subpages/mine/mySpace/mySpace' diff --git a/project.config.json b/project.config.json index 1978414..643967d 100644 --- a/project.config.json +++ b/project.config.json @@ -13,7 +13,8 @@ }, "useCompilerPlugins": false, "minifyWXML": true, - "condition": true + "condition": true, + "ignoreUploadUnusedFiles": false }, "compileType": "miniprogram", "simulatorPluginLibVersion": {}, diff --git a/project.private.config.json b/project.private.config.json index fa28701..e973a30 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,5 +1,5 @@ { - "libVersion": "3.8.9", + "libVersion": "3.9.3", "projectname": "epmet-apartment-mp", "setting": { "urlCheck": false, @@ -15,12 +15,19 @@ "miniprogram": { "list": [ { - "name": "subpages/mine/mySpace/mySpace", - "pathName": "subpages/mine/mySpace/mySpace", + "name": "subpages/goOut/goOut/goOut", + "pathName": "subpages/goOut/goOut/goOut", "query": "", "scene": null, "launchMode": "default" }, + { + "name": "subpages/mine/mySpace/mySpace", + "pathName": "subpages/mine/mySpace/mySpace", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "subpages/space/list/list", "pathName": "subpages/space/list/list", diff --git a/subpages/goOut/goOut/goOut.js b/subpages/goOut/goOut/goOut.js new file mode 100644 index 0000000..cd4a90c --- /dev/null +++ b/subpages/goOut/goOut/goOut.js @@ -0,0 +1,297 @@ +// subpages/goOut/goOut/goOut.js +var config = require('../../../utils/config') +Page({ + + /** + * 页面的初始数据 + */ + data: { + reasonName: '', + currentDateStart: '', + currentDateEnd: '', + showReason: false, + showDateStart: false, + showDateEnd: false, + options: ['本人及其直系亲属因病因伤住院', '就业创业人员因公出差/培训', '就业人员法定节假日期间单位假期多于法定日期'], + minDate: new Date(new Date().setHours(0, 0, 0, 0)).getTime(), + maxDate: new Date(new Date().setHours(23, 59, 59, 999)).getTime(), + endMinDate: null, // 结束时间最小日期 + endMaxDate: null, // 结束时间最大日期 + fileList: [], // 上传的文件列表 + submitting: false, // 提交状态 + showSuccessModal: true, // 显示成功弹框 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + }, + handleReason() { + this.setData({ + showReason: true + }) + }, + onconfirm(e) { + const { + index, + value + } = e.detail; + console.log(index); + this.setData({ + reasonName: value, + showReason: false + }) + }, + oncancel() { + this.setData({ + reasonName: '', + showReason: false + }) + }, + handleDateStart() { + console.log('handleDateStart'); + + this.setData({ + showDateStart: true + }) + }, + oncancelStart() { + this.setData({ + currentDateStart: '', + showDateStart: false + }) + }, + formatDate(date) { + date = new Date(date); + console.log(date); + return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`; + }, + onconfirmStart(e) { + const selectedDate = new Date(e.detail); + // 计算结束时间的最小日期(开始时间当天) + const endMinDate = new Date(selectedDate); + // 计算结束时间的最大日期(开始时间往后7天) + const endMaxDate = new Date(selectedDate); + endMaxDate.setDate(selectedDate.getDate() + 7); + + this.setData({ + showDateStart: false, + currentDateStart: this.formatDate(e.detail), + endMinDate: endMinDate.getTime(), + endMaxDate: endMaxDate.getTime(), + currentDateEnd: '' // 清空之前选择的结束时间 + }) + }, + oncancelEnd() { + this.setData({ + currentDateEnd: '', + showDateEnd: false + }) + }, + onconfirmEnd(e) { + this.setData({ + showDateEnd: false, + currentDateEnd: this.formatDate(e.detail) + }) + }, + handleDateEnd() { + this.setData({ + showDateEnd: true + }) + }, + + // 文件上传相关方法 + uploadFile() { + // 触发文件选择 + wx.chooseImage({ + count: 5 - this.data.fileList.length, + sizeType: ['compressed'], + sourceType: ['album', 'camera'], + success: (res) => { + const tempFiles = res.tempFilePaths.map((path, index) => ({ + url: path, + name: `证明材料${this.data.fileList.length + index + 1}.jpg`, + isImage: true + })); + this.setData({ + fileList: [...this.data.fileList, ...tempFiles] + }); + } + }); + }, + + afterRead(event) { + const { file } = event.detail; + const _this = this + wx.uploadFile({ + url: `${config.BASEURL()}/common/upload`, // 仅为示例,非真实的接口地址 + filePath: file.url, + name: 'file', + header: { + "Content-type": "multipart/form-data", + 'Authorization': wx.getStorageSync('token') + }, + success(res) { + const res1 = JSON.parse(res.data) + _this.setData({ + fileList: _this.data.fileList.concat([{ url: res1.url, name: `证明材料${_this.data.fileList.length + 1}.jpg` }]) + }); + }, + }); + // 这里可以添加上传到服务器的逻辑 + console.log('文件上传成功:', file); + + }, + + deleteFile(event) { + const { index } = event.detail; + const fileList = [...this.data.fileList]; + fileList.splice(index, 1); + this.setData({ fileList }); + }, + + // 提交申请 + submit() { + // 表单验证 + if (!this.data.reasonName) { + wx.showToast({ + title: '请选择外出原因', + icon: 'none' + }); + return; + } + if (!this.data.currentDateStart) { + wx.showToast({ + title: '请选择开始时间', + icon: 'none' + }); + return; + } + if (!this.data.currentDateEnd) { + wx.showToast({ + title: '请选择结束时间', + icon: 'none' + }); + return; + } + if (this.data.fileList.length === 0) { + wx.showToast({ + title: '请上传证明材料', + icon: 'none' + }); + return; + } + + this.setData({ submitting: true }); + + // 模拟提交过程 + setTimeout(() => { + this.setData({ submitting: false }); + wx.showToast({ + title: '提交成功', + icon: 'success' + }); + // 这里可以添加实际的提交逻辑 + }, 2000); + }, + submit() { + if (!this.data.reasonName) { + wx.showToast({ + title: '请选择外出原因', + icon: 'none' + }); + return + } + if (!this.data.currentDateStart) { + wx.showToast({ + title: '请选择开始时间', + icon: 'none' + }); + return + } + if (!this.data.currentDateEnd) { + wx.showToast({ + title: '请选择结束时间', + icon: 'none' + }); + return + } + if (this.data.fileList.length === 0) { + wx.showToast({ + title: '请上传证明材料', + icon: 'none' + }); + return + } + let parms = { + reasonName: this.data.reasonName, + currentDateStart: this.data.currentDateStart, + currentDateEnd: this.data.currentDateEnd, + fileList: this.data.fileList + } + // goOutSubmit(parms).then(res => { + // if (res.code === 200) { + // wx.showToast({ + // title: '提交成功', + // icon: 'success' + // }); + // } + // }) + }, + closeSuccessModal() { + this.setData({ + showSuccessModal: false + }) + }, +}) \ No newline at end of file diff --git a/subpages/goOut/goOut/goOut.json b/subpages/goOut/goOut/goOut.json new file mode 100644 index 0000000..2574040 --- /dev/null +++ b/subpages/goOut/goOut/goOut.json @@ -0,0 +1,13 @@ +{ + "usingComponents": { + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-popup": "@vant/weapp/popup/index", + "van-picker": "@vant/weapp/picker/index", + "van-uploader": "@vant/weapp/uploader/index", + "van-field": "@vant/weapp/field/index", + "van-calendar": "@vant/weapp/calendar/index", + "van-button": "@vant/weapp/button/index" + }, + "navigationBarTitleText": "外出申请" +} \ No newline at end of file diff --git a/subpages/goOut/goOut/goOut.wxml b/subpages/goOut/goOut/goOut.wxml new file mode 100644 index 0000000..7a3eca8 --- /dev/null +++ b/subpages/goOut/goOut/goOut.wxml @@ -0,0 +1,64 @@ + + + + + + 温馨提示: + + + 由于本人及其直系亲属因病因伤住院,就业创业人员因公出差、培训,就业人员法定节假日期间单位假期多于法定日期(比如春节)等特殊情况,导致租赁期限内房间空置时间连续超过7天,可提交申请。毕业生入住期间,每人最多可申请2次,单次不超过7天。 +证明材料: +1、本人及其直系亲届因病因伤住院:须提供诊断记录住院证明等相关材料。 +2、就业创业人员因公出差/培训:须提供单位外出通知(微信截图、单位盖章等均可)、往返预定车票、机票等材料。 +3、就业人员法定节假日期间单位假期多于法定日期:须提供单位节假日放假通知。 + + + + + + + + + + + + + + + + + + + + + * + 请上传证明材料 + + 只能上传jpg、jpeg文件,文件最多5个且不超过8M + + + + + 点击上传 + + + + +提交申请 + + + + + 提交成功 + + + 我们会尽快对您提交的证明进行审核,请您耐心等待。 + + + + 我知道了 + + + + + diff --git a/subpages/goOut/goOut/goOut.wxss b/subpages/goOut/goOut/goOut.wxss new file mode 100644 index 0000000..006d7c0 --- /dev/null +++ b/subpages/goOut/goOut/goOut.wxss @@ -0,0 +1,155 @@ +/* subpages/goOut/goOut/goOut.wxss */ +.header { + width: 100%; + background-image: linear-gradient(to right, #befeed 0%, #d5eefe 50%, #ebe9fb 100%); + background-size: 100% 280rpx; + background-repeat: no-repeat; + background-position: top; + background-color: #fff; + padding:28rpx 18rpx ; + box-sizing: border-box; + } + .tip{ + background-color: #fffbe6; + border-radius: 12rpx; + font-size: 28rpx; + color: #595959; + padding:28rpx 24rpx ; + } + +/* 卡片样式 */ +.card { + margin: 20rpx 24rpx; + background: #fff; + border-radius: 16rpx; + box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08); + overflow: hidden; +} + +/* 上传证明材料样式 */ +.upload-card { + margin: 20rpx 24rpx; + background: #fff; + border-radius: 16rpx; + box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08); + padding: 32rpx 24rpx; +} + +.upload-header { + margin-bottom: 24rpx; +} + +.upload-title { + display: flex; + align-items: center; + font-size: 32rpx; + font-weight: 600; + color: #333; + margin-bottom: 12rpx; +} + +.required { + color: #ff4d4f; + margin-right: 8rpx; + font-size: 28rpx; +} + +.upload-tips { + font-size: 24rpx; + color: #999; + line-height: 1.5; +} + +.upload-content { + margin-top: 20rpx; +} + +.upload-btn { + border-color: #1890ff; + background: #1890ff; + color: #ffffff; + font-size: 28rpx; + text-align: center; + line-height: 70rpx; + border-radius: 10rpx; + height: 70rpx; + width: 200rpx; +} + + +.upload-icon { + width: 60rpx; + height: 60rpx; + margin-bottom: 16rpx; +} + +.upload-icon image { + width: 100%; + height: 100%; +} + + +/* 提交按钮样式 */ +.submit-section { + margin: 0 auto; + width: 55%; + height: 70rpx; + line-height: 70rpx; + border-radius: 600rpx; + background: linear-gradient(86.25deg, rgba(13, 198, 198, 1) 3.03%, rgba(19, 194, 194, 1) 3.03%, rgba(70, 219, 213, 1) 96.43%); + color: rgba(255, 255, 255, 1); + font-size: 34rpx; + text-align: center; +} + +.submit-btn { + height: 88rpx !important; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; + border: none !important; + font-size: 32rpx !important; + font-weight: 600 !important; + box-shadow: 0 8rpx 24rpx rgba(102, 126, 234, 0.3) !important; + transition: all 0.3s ease !important; +} + +.submit-btn:active { + transform: translateY(2rpx); + box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.4) !important; +} + +.submit-btn::after { + border: none !important; +} +.success-modal{ + width: 600rpx; + height: 514rpx; + background-image: linear-gradient(to right, #befeed 0%, #d5eefe 50%, #ebe9fb 100%); + background-size: 100% 280rpx; + background-repeat: no-repeat; + border-radius: 16rpx; + padding: 24rpx; + box-sizing: border-box; +} +.success-title{ + font-size: 32rpx; + font-weight: 600; + color: #333; + margin-bottom: 12rpx; +} +.success-message{ + font-size: 28rpx; + color: #333; + margin-bottom: 12rpx; +} +.success-btn{ + width: 80%; + margin: 0 auto; + margin-top: 24rpx; +} +.success-icon{ + margin: 24rpx auto 50rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} \ No newline at end of file diff --git a/subpages/goOut/mygoOut/mygoOut.js b/subpages/goOut/mygoOut/mygoOut.js new file mode 100644 index 0000000..a1a61a5 --- /dev/null +++ b/subpages/goOut/mygoOut/mygoOut.js @@ -0,0 +1,66 @@ +// subpages/goOut/mygoOut/mygoOut.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/subpages/goOut/mygoOut/mygoOut.json b/subpages/goOut/mygoOut/mygoOut.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/subpages/goOut/mygoOut/mygoOut.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/subpages/goOut/mygoOut/mygoOut.wxml b/subpages/goOut/mygoOut/mygoOut.wxml new file mode 100644 index 0000000..e3448bb --- /dev/null +++ b/subpages/goOut/mygoOut/mygoOut.wxml @@ -0,0 +1,2 @@ + +subpages/goOut/mygoOut/mygoOut.wxml \ No newline at end of file diff --git a/subpages/goOut/mygoOut/mygoOut.wxss b/subpages/goOut/mygoOut/mygoOut.wxss new file mode 100644 index 0000000..551174f --- /dev/null +++ b/subpages/goOut/mygoOut/mygoOut.wxss @@ -0,0 +1 @@ +/* subpages/goOut/mygoOut/mygoOut.wxss */ \ No newline at end of file diff --git a/utils/config.js b/utils/config.js index 02ccc2c..62064f1 100644 --- a/utils/config.js +++ b/utils/config.js @@ -13,8 +13,8 @@ module.exports = { }; function BASEURL() { - // return 'https://zsbz.qdcfy.com/mz-api' - return 'http://219.146.91.110:30801/mz-api' + return 'https://zsbz.qdcfy.com/mz-api' + // return 'http://219.146.91.110:30801/mz-api' // return 'https://epmet-test.elinkservice.cn/api/' }