修改会议预约校验模式

改用输入用户名密码来进行校验
This commit is contained in:
unknown 2024-09-20 15:47:11 +08:00
parent 5089236079
commit 600d607e2b
3 changed files with 84 additions and 6 deletions

View File

@ -15,7 +15,7 @@ Page({
name: "会议预约", name: "会议预约",
img: "/profile/static/meeting/index/reservation.png", img: "/profile/static/meeting/index/reservation.png",
path: "/pages/meeting/meetingReservation/meetingReservation", path: "/pages/meeting/meetingReservation/meetingReservation",
visible: true visible: false
}, { }, {
type: "query", type: "query",
name: "预约记录", name: "预约记录",
@ -51,12 +51,29 @@ Page({
} }
return value; return value;
}, },
// 用户登录相关参数
showLogin: false, // 是否展示弹出层
username: '', // 用户名
pwd: '', // 登录密码
beforeClose(action) {
return new Promise(resolve => {
if (action === 'confirm') {
resolve(false)
} else {
resolve(true)
}
})
}, // 弹出层点击确认不关闭,手动关
}, },
showTimePicker() { showTimePicker() {
this.setData({ timeShow: true }); this.setData({
timeShow: true
});
}, },
hideTimePicker() { hideTimePicker() {
this.setData({ timeShow: false }); this.setData({
timeShow: false
});
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -98,7 +115,11 @@ Page({
} else { } else {
if (obj.name === '会议预约') { if (obj.name === '会议预约') {
// 未授权 // 未授权
app.selfShowMsg('您暂无权限使用该功能请联系机关事务局XXX电话15888888888进行赋权后使用') this.setData({
showLogin: true
})
return
// app.selfShowMsg('您暂无权限使用该功能请联系机关事务局XXX电话15888888888进行赋权后使用')
} else { } else {
app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`) app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
return return
@ -138,6 +159,53 @@ Page({
wx.navigateBack() wx.navigateBack()
}, },
onCloseLogin(e) {
let _this = this;
_this.setData({
cancelId: '',
showCancelReason: false,
cancelReason: ''
})
},
onChangeUsername(e) {
let _this = this;
_this.setData({
username: e.detail
})
},
onChangePwd(e) {
let _this = this;
_this.setData({
pwd: e.detail
})
},
// 认证方法
orderLogin() {
let _this = this;
let uName = _this.data.username
let pwd = _this.data.pwd
if (uName === '' || pwd === '') {
Notify({
message: '请填写用户名、密码!',
top: 50
})
return
}
// 后台认证
Notify({
type: 'success',
message: '认证通过!',
top: 50
})
_this.setData({
['menuList[0].visible']: true,
username: '',
pwd: '',
showLogin: false
})
this.showTimePicker()
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -4,6 +4,8 @@
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-notify": "@vant/weapp/notify/index", "van-notify": "@vant/weapp/notify/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index" "van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-field": "@vant/weapp/field/index"
} }
} }

View File

@ -34,3 +34,11 @@
<van-popup show="{{ timeShow }}" bind:close="hideTimePicker" position="bottom" round="true"> <van-popup show="{{ timeShow }}" bind:close="hideTimePicker" position="bottom" round="true">
<van-datetime-picker title="请选择会议日期" type="date" value="{{ currentDate }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" bind:confirm="goRes" bind:cancel="hideTimePicker" /> <van-datetime-picker title="请选择会议日期" type="date" value="{{ currentDate }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" bind:confirm="goRes" bind:cancel="hideTimePicker" />
</van-popup> </van-popup>
<!-- 提示框 -->
<van-dialog use-slot title="请认证所在单位" show="{{ showLogin }}" show-cancel-button bind:close="onCloseLogin" bind:confirm="orderLogin" beforeClose="{{ beforeClose }}" zIndex="109">
<van-cell-group style="margin: 20px;">
<van-field bind:change="onChangeUsername" value="{{ username }}" clearable label="用户名" placeholder="请输入用户名" />
<van-field bind:change="onChangePwd" value="{{ pwd }}" type="password" clearable label="密码" placeholder="请输入密码" />
</van-cell-group>
</van-dialog>