diff --git a/miniprogram/app.json b/miniprogram/app.json index 790a6db..b67aed8 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -90,7 +90,8 @@ "pages/reportRepair/assign/evaluate/evaluate", "pages/reportRepair/repair/index/index", "pages/reportRepair/repair/case/case", - "pages/my/info/info" + "pages/my/info/info", + "pages/my/bindWei/bindWei" ], "window": { "backgroundTextStyle": "light", diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index f316c31..957c950 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -1,7 +1,7 @@ const app = getApp() import Notify from '@vant/weapp/notify/notify'; - +import Dialog from '@vant/weapp/dialog/dialog' import { callScanUrl } from "../../api/common/scan.js" @@ -209,14 +209,29 @@ Page({ _this.setData({ userDetail }) + if (!userDetail.gzhOpenid) { + // 未绑定公众号 + Dialog.confirm({ + title: '提醒', + message: '您当前未绑定手机号,为更好提供服务,请绑定号码接收提醒!', + }) + .then(() => { + wx.navigateTo({ + url: '/pages/my/bindWei/bindWei', + }) + }) + .catch(() => { + // on cancel + }) + } // 查询轮播图 - getParkRq(userDetail.parkId).then(res => { - console.log('getParkRq', res); - let bannerList = res.bannerImages.map(item => item.url) - _this.setData({ - bannerList - }) - }) + // getParkRq(userDetail.parkId).then(res => { + // console.log('getParkRq', res); + // let bannerList = res.bannerImages.map(item => item.url) + // _this.setData({ + // bannerList + // }) + // }) // 查询消息列表 repairRemindLatestListRq().then(res => { console.log('repairRemindLatestListRq', res); @@ -302,7 +317,7 @@ Page({ url: url, }) }) - + }, // 成功通知 diff --git a/miniprogram/pages/index/index.json b/miniprogram/pages/index/index.json index 32e3f2e..78a650a 100644 --- a/miniprogram/pages/index/index.json +++ b/miniprogram/pages/index/index.json @@ -4,6 +4,7 @@ "usingComponents": { "van-notify": "@vant/weapp/notify/index", "van-icon": "@vant/weapp/icon/index", - "van-divider": "@vant/weapp/divider/index" + "van-divider": "@vant/weapp/divider/index", + "van-dialog": "@vant/weapp/dialog/index" } } \ No newline at end of file diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index 8e22141..d42381b 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -56,4 +56,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/miniprogram/pages/index/index.wxss b/miniprogram/pages/index/index.wxss index 85d3190..4b574a3 100644 --- a/miniprogram/pages/index/index.wxss +++ b/miniprogram/pages/index/index.wxss @@ -99,7 +99,7 @@ .logo { position: absolute; - z-index: 999; + z-index: 10; left: 50%; top: 420rpx; transform: translateX(-50%); diff --git a/miniprogram/pages/meeting/index/index.js b/miniprogram/pages/meeting/index/index.js index c8b14a8..9ec5930 100644 --- a/miniprogram/pages/meeting/index/index.js +++ b/miniprogram/pages/meeting/index/index.js @@ -84,13 +84,13 @@ Page({ onLoad(options) { let _this = this let userDetail = wx.getStorageSync('user') - // 获取一月后时间,默认只能选一个月之后,管理员可以选一年后的 + // 获取两周后时间,默认只能选两周之后,管理员可以选一年后的 const today = new Date() const newDate = new Date(today) if (userDetail.roomRole == 5) { newDate.setFullYear(newDate.getFullYear() + 1) } else { - newDate.setMonth(newDate.getMonth() + 1) + newDate.setDate(newDate.getDate() + 14) } _this.setData({ userDetail, diff --git a/miniprogram/pages/meeting/meetingReservation/meetingReservation.js b/miniprogram/pages/meeting/meetingReservation/meetingReservation.js index c826667..18319dc 100644 --- a/miniprogram/pages/meeting/meetingReservation/meetingReservation.js +++ b/miniprogram/pages/meeting/meetingReservation/meetingReservation.js @@ -19,6 +19,7 @@ Page({ dep: '', date: '', dateStr: '', + adminTel: '83605343', queryParam: { timeRangeDict: { list: [{ @@ -45,26 +46,17 @@ Page({ text: '人数', value: '' }, { - text: '1-10', + text: '1-20', value: 1 }, { - text: '11-20', + text: '21-50', value: 2 }, { - text: '21-30', + text: '51-100', value: 3 - }, { - text: '31-40', - value: 4 - }, { - text: '41-50', - value: 5 - }, { - text: '51-100', - value: 6 }, { text: '100 以上', - value: 7 + value: 4 }], value: '', }, @@ -261,23 +253,27 @@ Page({ let minPerNum = 0 let maxPerNum = 1000 let perNumValue = queryParam.personDict.value - if (perNumValue == 6) { + + if (perNumValue == 1) { + // 1-20 + maxPerNum = 20 + minPerNum = 1 + } else if (perNumValue == 2) { + // 21-50 + minPerNum = 21 + maxPerNum = 50 + } else if (perNumValue == 3) { // 51-100 - maxPerNum = 100 minPerNum = 51 - } else if (perNumValue == 7) { - // 100以上 + maxPerNum = 100 + } else if (perNumValue == 4) { + // 51-100 minPerNum = 101 maxPerNum = 1000 - } else if (perNumValue == '') { + } else { // 全部 minPerNum = 1 maxPerNum = 1000 - } else { - // 其余,符合规则即可 - // perNumValue * 10 - 9 ~ perNumValue * 10 - maxPerNum = parseInt(perNumValue) * 10 - minPerNum = maxPerNum - 9 } let param = { floor: queryParam.meetingTypeDict.value, // 楼层 @@ -320,7 +316,12 @@ Page({ url: "/pages/meeting/meetingRoom/meetingRoom?status=" + e.currentTarget.dataset.status + "&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId }) }, - + callAdmin() { + let num = this.data.adminTel + wx.makePhoneCall({ + phoneNumber: num + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/miniprogram/pages/meeting/meetingReservation/meetingReservation.wxml b/miniprogram/pages/meeting/meetingReservation/meetingReservation.wxml index b6cc8ea..4136cd6 100644 --- a/miniprogram/pages/meeting/meetingReservation/meetingReservation.wxml +++ b/miniprogram/pages/meeting/meetingReservation/meetingReservation.wxml @@ -3,7 +3,7 @@ - + @@ -14,9 +14,9 @@ - + @@ -30,7 +30,7 @@ {{room.roomNum}} - {{room.capacityNum}}人 {{room.typeName}} + {{room.capacityNum}}人 {{room.typeName}} @@ -38,7 +38,7 @@ {{room.roomNum}} - 不可预约 + 不可预约 @@ -49,6 +49,14 @@ + + + 请在08:30~17:30内进行预约会议 + + + 有问题请联系工作人员:陆成俊 {{ adminTel }} + + diff --git a/miniprogram/pages/meeting/pay/waitComplete/waitComplete.wxml b/miniprogram/pages/meeting/pay/waitComplete/waitComplete.wxml index 00fcc6c..0522cd7 100644 --- a/miniprogram/pages/meeting/pay/waitComplete/waitComplete.wxml +++ b/miniprogram/pages/meeting/pay/waitComplete/waitComplete.wxml @@ -3,7 +3,7 @@ - 预约成功 + 预约提交成功 diff --git a/miniprogram/pages/meeting/reservationRecord/approve/approve.js b/miniprogram/pages/meeting/reservationRecord/approve/approve.js index 15dc280..2d7cd84 100644 --- a/miniprogram/pages/meeting/reservationRecord/approve/approve.js +++ b/miniprogram/pages/meeting/reservationRecord/approve/approve.js @@ -155,8 +155,9 @@ Page({ }) } let _this = this; + let userDetail = wx.getStorageSync('user') _this.setData({ - userData: wx.getStorageSync('user'), + userData: userDetail }) // 获取数据 let userId = _this.data.userData.id @@ -166,10 +167,14 @@ Page({ pageNum: _this.data.reservationPageNum, pageSize: _this.data.reservationPageSize, }) - // 获取一月后时间,默认只能选一个月之后 + // 获取两周后时间,默认只能选两周之后,管理员可以选一年后的 const today = new Date() const newDate = new Date(today) - newDate.setMonth(newDate.getMonth() + 1) + if (userDetail.roomRole == 5) { + newDate.setFullYear(newDate.getFullYear() + 1) + } else { + newDate.setDate(newDate.getDate() + 14) + } _this.setData({ maxDate: newDate.getTime() }) diff --git a/miniprogram/pages/meeting/reservationRecord/meetingRecord/meetingRecord.js b/miniprogram/pages/meeting/reservationRecord/meetingRecord/meetingRecord.js index 1c8a57f..e3c4578 100644 --- a/miniprogram/pages/meeting/reservationRecord/meetingRecord/meetingRecord.js +++ b/miniprogram/pages/meeting/reservationRecord/meetingRecord/meetingRecord.js @@ -145,8 +145,9 @@ Page({ */ onLoad(options) { let _this = this; + let userDetail = wx.getStorageSync('user') _this.setData({ - userData: wx.getStorageSync('user'), + userData: userDetail, }) // 获取数据 let userId = _this.data.userData.id @@ -156,13 +157,18 @@ Page({ pageNum: _this.data.reservationPageNum, pageSize: _this.data.reservationPageSize, }) - // 获取一月后时间,默认只能选一个月之后 + // 获取两周后时间,默认只能选两周之后,管理员可以选一年后的 const today = new Date() const newDate = new Date(today) - newDate.setMonth(newDate.getMonth() + 1) + if (userDetail.roomRole == 5) { + newDate.setFullYear(newDate.getFullYear() + 1) + } else { + newDate.setDate(newDate.getDate() + 14) + } _this.setData({ maxDate: newDate.getTime() }) + // 获取参与数据 // _this.getParticipateData({ // userId, @@ -237,7 +243,7 @@ Page({ pageSize, // userId, // parkId: 25, - name: _this.data.search.title.value, // 会议室名称 + title: _this.data.search.title.value, // 会议名称 status: _this.data.search.status.value // 预约状态 }).then(res => { console.log('selectReservationListByUserIdRq', res); diff --git a/miniprogram/pages/my/bindWei/bindWei.js b/miniprogram/pages/my/bindWei/bindWei.js new file mode 100644 index 0000000..b903039 --- /dev/null +++ b/miniprogram/pages/my/bindWei/bindWei.js @@ -0,0 +1,67 @@ +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/my/bindWei/bindWei.json b/miniprogram/pages/my/bindWei/bindWei.json new file mode 100644 index 0000000..92d2748 --- /dev/null +++ b/miniprogram/pages/my/bindWei/bindWei.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "绑定手机号" +} \ No newline at end of file diff --git a/miniprogram/pages/my/bindWei/bindWei.wxml b/miniprogram/pages/my/bindWei/bindWei.wxml new file mode 100644 index 0000000..f86656f --- /dev/null +++ b/miniprogram/pages/my/bindWei/bindWei.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/miniprogram/pages/my/bindWei/bindWei.wxss b/miniprogram/pages/my/bindWei/bindWei.wxss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js index 225c6c2..d3e47db 100644 --- a/miniprogram/pages/my/my.js +++ b/miniprogram/pages/my/my.js @@ -3,247 +3,272 @@ let app = getApp() import Notify from '@vant/weapp/notify/notify'; import { - userProfile, - getUserInfoRq + userProfile, + getUserInfoRq } from "../../api/user/user.js" import { - callScanUrl + callScanUrl } from "../../api/common/scan.js" import { - getUrlParamsObj + getUrlParamsObj } from "../../utils/util.js" Page({ - /** - * 页面的初始数据 - */ - data: { - DOMAIN_NAME: app.IMG_NAME, - userDetail: {}, - parkName: app.parkName, - customerName: '', - // tabBar param - tabBarParam: { - selected: 2, - color: "#515151", - selectedColor: "#217CFF", - backgroundColor: "#ffffff", - }, - // tabBar menu - tabBarList: [{ - "pagePath": "/pages/index/index", - "iconPath": "/images/tabbar/home.png", - "selectedIconPath": "/images/tabbar/home-select.png", - "text": "首页" - }, - { - "pagePath": "/pages/reportRepair/report/report", - "iconPath": "/images/tabbar/center.png", - "selectedIconPath": "/images/tabbar/center.png", - "text": "报修", - "bulge": true, - }, - { - "pagePath": "/pages/my/my", - "iconPath": "/images/tabbar/my.png", - "selectedIconPath": "/images/tabbar/my-select.png", - "text": "我的" - }, - ], - customerPages: [{ - name: "预约记录", - url: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord", - }, - // { - // name: "我的活动", - // url: "/pages/myActivities/myActivities", - // }, - // { - // name: "我的入驻", - // url: "/pages/my/serviceApply/serviceApply" - // }, - // { - // name: "我的建议", - // url: "/pages/complaint/complaint", - // }, - // { - // name: "账号设置", - // url: "/pages/my/accountSetting/accountSetting", - // }, - // { - // name: "我的服务", - // url: "/pages/enterpriseServices/myServiceList/myServiceList" - // }, - // { - // name: "我的报修", - // url: "/pages/parkRepair/parkRepair", - // } - ], - qrcodeParam: null, + /** + * 页面的初始数据 + */ + data: { + DOMAIN_NAME: app.IMG_NAME, + userDetail: {}, + parkName: app.parkName, + customerName: '', + // tabBar param + tabBarParam: { + selected: 2, + color: "#515151", + selectedColor: "#217CFF", + backgroundColor: "#ffffff", }, + // tabBar menu + tabBarList: [{ + "pagePath": "/pages/index/index", + "iconPath": "/images/tabbar/home.png", + "selectedIconPath": "/images/tabbar/home-select.png", + "text": "首页" + }, + { + "pagePath": "/pages/reportRepair/report/report", + "iconPath": "/images/tabbar/center.png", + "selectedIconPath": "/images/tabbar/center.png", + "text": "报修", + "bulge": true, + }, + { + "pagePath": "/pages/my/my", + "iconPath": "/images/tabbar/my.png", + "selectedIconPath": "/images/tabbar/my-select.png", + "text": "我的" + }, + ], + customerPages: [{ + name: "预约记录", + url: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord", + }, + // { + // name: "我的活动", + // url: "/pages/myActivities/myActivities", + // }, + // { + // name: "我的入驻", + // url: "/pages/my/serviceApply/serviceApply" + // }, + // { + // name: "我的建议", + // url: "/pages/complaint/complaint", + // }, + // { + // name: "账号设置", + // url: "/pages/my/accountSetting/accountSetting", + // }, + // { + // name: "我的服务", + // url: "/pages/enterpriseServices/myServiceList/myServiceList" + // }, + // { + // name: "我的报修", + // url: "/pages/parkRepair/parkRepair", + // } + ], + qrcodeParam: null, + }, - // 切换tabbar - switchTab(e) { - const data = e.currentTarget.dataset - console.log('switchTab', data) - const url = data.path - if (url == '/pages/reportRepair/report/report') { - wx.navigateTo({ - url - }) - } else { - wx.switchTab({ - url - }) - } - }, + // 切换tabbar + switchTab(e) { + const data = e.currentTarget.dataset + console.log('switchTab', data) + const url = data.path + if (url == '/pages/reportRepair/report/report') { + wx.navigateTo({ + url + }) + } else { + wx.switchTab({ + url + }) + } + }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { - }, + }, - onShow() { - let _this = this - let userId = wx.getStorageSync('userId'); - if (userId) { - userProfile(userId).then(res => { - console.log('userProfile', res); - _this.setData({ - userDetail: res.data - }) - }) - getUserInfoRq(userId).then(res => { - console.log('getUserInfoRq', res); - let userDetail = res.data; - _this.setData({ - customerName: userDetail.customerName, - // parkName: wx.getStorageSync('parkName') - }) - }) - } else { - app.getlogin() - } - }, - - navigateTo(e) { - if (wx.getStorageSync('userId')) { - let dataset = e.currentTarget.dataset; - wx.navigateTo({ - url: dataset.url + "?name=" + dataset.name, - }) - } else { - app.getlogin() - } - }, - - navpersonalData() { - if (wx.getStorageSync('userId')) { - wx.navigateTo({ - url: '/pages/my/personalData/personalData', - }) - } else { - wx.navigateTo({ - url: '/pages/login/login', - }) - } - }, - - // 跳转-我的 - jumpMy() { - wx.navigateTo({ - url: '/pages/my/personalData/personalData', + onShow() { + let _this = this + let userId = wx.getStorageSync('userId'); + if (userId) { + userProfile(userId).then(res => { + console.log('userProfile', res); + _this.setData({ + userDetail: res.data }) - }, - - // 跳转-报修查询 - jumpRepair(){ - wx.navigateTo({ - url: '/pages/reportRepair/query/record/record', + }) + getUserInfoRq(userId).then(res => { + console.log('getUserInfoRq', res); + let userDetail = res.data; + _this.setData({ + customerName: userDetail.customerName, + // parkName: wx.getStorageSync('parkName') }) - }, + }) + } else { + app.getlogin() + } + }, - // 跳转-消息 - jumpInfo(){ - wx.navigateTo({ - url: '/pages/my/info/info', - }) - }, + navigateTo(e) { + if (wx.getStorageSync('userId')) { + let dataset = e.currentTarget.dataset; + wx.navigateTo({ + url: dataset.url + "?name=" + dataset.name, + }) + } else { + app.getlogin() + } + }, - // 扫一扫 - jumpScan() { - let _this = this; - wx.scanCode({ - scanType: 'qrCode', - success(res) { - console.log('success', res) - let url = res.result; - // 判断二维码是否符合规范 - if (url.indexOf(app.DOMAIN_NAME_PREFIX) != -1) { - let urlParam = getUrlParamsObj(url); - // 判断是否有设备参数 - if (!urlParam.noParam) { - _this.setData({ - qrcodeParam: urlParam - }) - // 扫码调用地址 - _this.scanCallUrl() - } else { - // 危险通知 - _this.showErrMsg('请预约会议!') - } - } else { - // 危险通知 - _this.showErrMsg('二维码不正确!') - } - }, - fail(res) { - console.log('fail', res) - // 危险通知 - _this.showErrMsg('扫码失败!') - } - }) - }, + navpersonalData() { + if (wx.getStorageSync('userId')) { + wx.navigateTo({ + url: '/pages/my/personalData/personalData', + }) + } else { + wx.navigateTo({ + url: '/pages/login/login', + }) + } + }, - // 扫码调用地址 - scanCallUrl() { - let _this = this; - let qrcodeParam = _this.data.qrcodeParam; - qrcodeParam.userId = wx.getStorageSync('userId') - callScanUrl(qrcodeParam).then(res => { - // 清空扫码数据 + // 跳转-我的 + jumpMy() { + wx.navigateTo({ + url: '/pages/my/personalData/personalData', + }) + }, + + // 跳转-报修查询 + jumpRepair() { + wx.navigateTo({ + url: '/pages/reportRepair/query/record/record', + }) + }, + // 跳转-报修查询 + jumpMeeting() { + let roomRole = this.data.userDetail.roomRole + let url = '/pages/meeting/reservationRecord/meetingRecord/meetingRecord' + if (roomRole == 1) { + // 普通用户 + url = '/pages/meeting/reservationRecord/meetingRecord/meetingRecord' + } + if (roomRole == 3) { + // 会务人员 + url = '/pages/meeting/reservationRecord/service/service' + } + if (roomRole == 5) { + // 管理员 + url = '/pages/meeting/reservationRecord/approve/approve?act=show' + } + wx.navigateTo({ + url: url, + }) + }, + // 跳转手机号绑定 + jumpBind() { + wx.navigateTo({ + url: '/pages/my/bindWei/bindWei', + }) + }, + // 跳转-消息 + jumpInfo() { + wx.navigateTo({ + url: '/pages/my/info/info', + }) + }, + + // 扫一扫 + jumpScan() { + let _this = this; + wx.scanCode({ + scanType: 'qrCode', + success(res) { + console.log('success', res) + let url = res.result; + // 判断二维码是否符合规范 + if (url.indexOf(app.DOMAIN_NAME_PREFIX) != -1) { + let urlParam = getUrlParamsObj(url); + // 判断是否有设备参数 + if (!urlParam.noParam) { _this.setData({ - qrcodeParam: null + qrcodeParam: urlParam }) - if (res.code == 0) { - // 成功通知 - _this.showSuccessMsg(res.msg) - } else { - // 危险通知 - _this.showErrMsg(res.msg) - } - }) - }, + // 扫码调用地址 + _this.scanCallUrl() + } else { + // 危险通知 + _this.showErrMsg('请预约会议!') + } + } else { + // 危险通知 + _this.showErrMsg('二维码不正确!') + } + }, + fail(res) { + console.log('fail', res) + // 危险通知 + _this.showErrMsg('扫码失败!') + } + }) + }, - // 成功通知 - showSuccessMsg(msg) { - Notify({ - type: 'success', - message: msg - }); - }, + // 扫码调用地址 + scanCallUrl() { + let _this = this; + let qrcodeParam = _this.data.qrcodeParam; + qrcodeParam.userId = wx.getStorageSync('userId') + callScanUrl(qrcodeParam).then(res => { + // 清空扫码数据 + _this.setData({ + qrcodeParam: null + }) + if (res.code == 0) { + // 成功通知 + _this.showSuccessMsg(res.msg) + } else { + // 危险通知 + _this.showErrMsg(res.msg) + } + }) + }, - // 危险通知 - showErrMsg(msg) { - Notify({ - type: 'danger', - message: msg - }); - }, + // 成功通知 + showSuccessMsg(msg) { + Notify({ + type: 'success', + message: msg + }); + }, + + // 危险通知 + showErrMsg(msg) { + Notify({ + type: 'danger', + message: msg + }); + }, }) \ No newline at end of file diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml index e9ae0fa..53f9f35 100644 --- a/miniprogram/pages/my/my.wxml +++ b/miniprogram/pages/my/my.wxml @@ -3,7 +3,7 @@ - + {{userDetail.username? userDetail.username:'微信用户'}} @@ -12,24 +12,36 @@ - + 我的报修 + + 会议预约 + + + + 消息通知 + + 绑定手机号 + + + + 姓名 {{memberInfo.username}} @@ -38,7 +38,7 @@ - +