This commit is contained in:
SelfRidicule 2024-03-06 21:38:07 +08:00
parent 990bbc0cc8
commit fb83bd6e31
4 changed files with 88 additions and 6 deletions

View File

@ -108,3 +108,21 @@ export function getMeetingRoomServiceAndEquipmentRq(id) {
method: "get",
});
}
// 判断是否参与过会议
export function roomContentIsVisitorRq(data) {
return request({
url: '/api/roomContent/isVisitor',
method: "post",
data
});
}
// 参与会议
export function roomContentAddVisitorRq(data) {
return request({
url: '/api/roomContent/addVisitor',
method: "post",
data
});
}

View File

@ -1,5 +1,7 @@
let app = getApp()
import Notify from '@vant/weapp/notify/notify';
import {
selfFormatTimeYMD,
selfFormatTimeHM,
@ -8,7 +10,9 @@ import {
import {
selectReservationByIdRq,
selectCoordinateRq
selectCoordinateRq,
roomContentIsVisitorRq,
roomContentAddVisitorRq
} from "../../../api/meeting/meetingRoom.js"
import {
@ -143,7 +147,7 @@ Page({
userAuthorizationSuccess(openid, user, token) {
let _this = this;
_this.setData({
authorizationShow : false
authorizationShow: false
})
// 清空所有缓存
@ -154,6 +158,61 @@ Page({
wx.setStorageSync('userId', user.id)
wx.setStorageSync('token', token)
// 判断是否参与过会议
_this.whetherParticipate();
},
// 判断是否参与过会议
whetherParticipate() {
let _this = this
roomContentIsVisitorRq({
"userId": _this.data.detail.userId,
"participantId": wx.getStorageSync('userId'),
"reservationId": _this.data.detail.id,
}).then(res => {
console.log('whetherParticipate', res);
if (res.code == 0) { // 未预约
_this.setData({
participateShow: true
})
} else { // 已预约
_this.setData({
openDoorShow: true
})
}
})
},
// 参与会议
participateMeeting() {
let _this = this;
roomContentAddVisitorRq({
"userId": _this.data.detail.userId,
"participantId": wx.getStorageSync('userId'),
"reservationId": _this.data.detail.id,
"participantPhone": wx.getStorageSync('user').mobile
}).then(res => {
console.log('participateMeeting', res);
if (res.code == 0) { //参与成功
_this.setData({
participateShow: false,
openDoorShow: true
})
} else { //参与失败
Notify({
type: 'danger',
message: res.msg
});
}
})
},
// 开门
openDoor(){
Notify({
type: 'danger',
message: '尚未完成!'
});
},
/**

View File

@ -1,4 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "邀请"
"usingComponents": {
"van-notify": "@vant/weapp/notify/index"
},
"navigationBarTitleText": "邀请"
}

View File

@ -39,7 +39,10 @@
<button class="loginBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
</view>
<!-- 接受邀请 -->
<view class="submitBtn" wx:if="{{participateShow}}">接受邀请</view>
<view class="submitBtn" wx:if="{{participateShow}}" bind:tap="participateMeeting">接受邀请</view>
<!-- 点击开门 -->
<view class="submitBtn" wx:if="{{openDoorShow}}">点击开门</view>
<view class="submitBtn" wx:if="{{openDoorShow}}" bind:tap="openDoor">点击开门</view>
<!-- 消息提示 -->
<van-notify id="van-notify" />
</view>