提交 bea2d3f4 authored 作者: 曾美红's avatar 曾美红

添加外部人员

上级 7e2755f7
......@@ -14,8 +14,8 @@ App({
//全局数据
globalData: {
//domain:'http://id24iu.natappfree.cc',
//domain:"http://dd2.ubainsyun.com",
domain: "http://zhenglide.natapp1.cc" ,
domain:"http://dd2.ubainsyun.com",
//domain: "http://zhenglide.natapp1.cc" ,
corpId: '',
userId:'',
person:'',
......
......@@ -43,7 +43,8 @@ Page({
conference: null
})
//获取是否已添加外部人员记录
dd.httpRequest({
url: conferenceUrl,
method: 'POST',
......@@ -80,6 +81,12 @@ Page({
},
onShow(query) {
dd.removeStorage({
key:'signList',
success:function(res){
console.log('清除已添加外部人员记录成功');
}
})
// 页面显示
// console.log("show会议室编号",query)
},
......
......@@ -24,13 +24,13 @@
</form>
<scroll-view scroll-y="{{true}}">
<view a:for="{{employeeList}}" a:for-item="employee" a:for-index="index" class='item-avatar-xs-a'>
<view a:for="{{signList}}" a:for-item="sign" a:for-index="index" class='item-avatar-xs-a'>
<!-- <checkbox value="{{employee.name}}" checked="{{employee.checked}}" /> -->
<view data-index="{{index}}" data-id="{{employee.id}}" onTap="deleteSign" class="del">
<view data-index="{{index}}" data-id="{{index }}" onTap="deleteSign" class="del">
<icon type="cancel" size="18" color="red"/>
</view>
<text class="checkbox-text">{{employee.name}}</text>
<text class="checkbox-text">{{sign.signName}}</text>
</view>
</scroll-view>
......
......@@ -8,7 +8,7 @@ let delExSignUrl = domain + "/dingding/delExSign";
Page({
data: {
employeeList:[],
signList:[],
mid:null,
personNum:0
},
......@@ -25,7 +25,82 @@ Page({
})
return false;
}
var sign ={'signName':e.detail.value.signName ,'signEmail':e.detail.value.signEmail ,"signMobile" : e.detail.value.signMobile};
var signList;
//获取缓存中的参会人员列表
dd.getStorage({
key: 'signList',
success: function(res) {
//console.log(res.data);
if(res.data==null) {
signList =[];
}else {
signList=res.data;
}
//添加参会人员
signList.push(sign);
//将新加的参会人员加入缓存中
dd.setStorage({
key: 'signList',
data:signList,
success: function() {
//提示添加成功
dd.alert({
title: '添加成功',
content: '添加成功',
buttonText: '确定',
success: () => {
// var signList2= _this.data.signList;
// signList2=signList;
_this.setData({
signList
})
//添加一个外部人员是否添加成功标
},
});
}
});
},
fail: function(res){
dd.alert({content: res.errorMessage});
}
});
// dd.setStorage({
// key:'issavevisitor',
// data:'1',
// success:function(){
// _this.setData({
// personNum: _this.data.personNum + 1,
// employeeList,
// });
// }
// })
// dd.alert({
// title: '添加成功',
// content: '添加成功',
// buttonText: '确定',
// success: () => {
// var employeeList= _this.data.employeeList;
// var emp={};
// emp['name'] = res.data.result.signName;
// emp['id'] = res.data.result.signId;
// emp['checked'] = true;
// employeeList[employeeList.length-1]=emp;
// //添加一个外部人员是否添加成功标识
// //console.log('employeeList---',_this.data.employeeList);
// },
// });
// if (e.detail.value.signMobile.length != 0) {
// var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
// var phone = e.detail.value.signMobile;
......@@ -73,144 +148,151 @@ Page({
dd.httpRequest({
url: addExSignUrl,
method: 'POST',
data: {
mid: _this.data.mid,
signMobile: e.detail.value.signMobile,
signEmail: e.detail.value.signEmail,
signName: e.detail.value.signName,
// dd.httpRequest({
// url: addExSignUrl,
// method: 'POST',
// data: {
// mid: _this.data.mid,
// signMobile: e.detail.value.signMobile,
// signEmail: e.detail.value.signEmail,
// signName: e.detail.value.signName,
},
dataType: 'json',
// },
// dataType: 'json',
success: function(res) {
// success: function(res) {
console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
dd.alert({
title: '添加成功',
content: '添加成功',
buttonText: '确定',
success: () => {
var employeeList= _this.data.employeeList;
var emp={};
emp['name'] = res.data.result.signName;
emp['id'] = res.data.result.signId;
emp['checked'] = true;
employeeList.push(emp);
// console.log('success----', res)
// if (res.data.success) {
_this.setData({
personNum: _this.data.personNum + 1,
employeeList,
});
//console.log('employeeList---',_this.data.employeeList);
},
});
// } else {
// dd.showToast({
// type: 'fail',
// content: res.data.message,
// duration: 3000,
// success: () => {
// // dd.navigateTo({
// // url: '../index/index'
// // });
// },
// });
// }
// var employeeList= _this.data.employeeList;
// if(getCurrentPages().length !=2){
// // let pages = getCurrentPages(); //当前页面栈
// // let curPage = pages[pages.length - 3];
// // let data = curPage.data;
// employeeList = [];
// _this.setData({
// employeeList:employeeList
// })
// }
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
// },
// fail: function(res) {
// console.log("httpRequestFail---", res)
// dd.alert({ content: JSON.stringify(res) });
// },
// complete: function(res) {
// dd.hideLoading();
// }
});
// });
},
deleteSign:function (e){
//console.log(e);
var _this=this;
dd.httpRequest({
url: delExSignUrl,
method: 'POST',
data: {
signId: e.currentTarget.dataset.id,
},
dataType: 'json',
var index=e.currentTarget.dataset.id;
var signList;
dd.getStorage({
key: 'signList',
success: function(res) {
// console.log('success----', res)
if (res.data.success) {
//console.log("预定成功");
const index = e.currentTarget.dataset.index;
var employeeList = _this.data.employeeList;
employeeList = remove(employeeList, index);
_this.setData({
employeeList
})
} else {
dd.showToast({
type: 'fail',
content: res.data.message,
duration: 3000,
success: () => {
// dd.navigateTo({
// url: '../index/index'
// });
},
});
// console.log(res.data);
signList=res.data;
//删除参会人员
signList.splice(index,1);
// console.log("删除后的列表",signList)
//将新加的参会人员加入缓存中
dd.setStorage({
key: 'signList',
data:signList,
success: function() {
_this.setData({
signList
})
//添加一个外部人员是否添加成功标
}
},
fail: function(res) {
console.log("httpRequestFail---", res)
//dd.alert({ content: JSON.stringify(res) });
},
complete: function(res) {
dd.hideLoading();
}
});
},
fail: function(res){
dd.alert({content: res.errorMessage});
}
});
// dd.httpRequest({
// url: delExSignUrl,
// method: 'POST',
// data: {
// signId: e.currentTarget.dataset.id,
// },
// dataType: 'json',
// success: function(res) {
// // console.log('success----', res)
// if (res.data.success) {
// //console.log("预定成功");
// const index = e.currentTarget.dataset.index;
// var employeeList = _this.data.employeeList;
// employeeList = remove(employeeList, index);
// _this.setData({
// employeeList
// })
// } else {
// dd.showToast({
// type: 'fail',
// content: res.data.message,
// duration: 3000,
// success: () => {
// // dd.navigateTo({
// // url: '../index/index'
// // });
// },
// });
// }
// },
// fail: function(res) {
// console.log("httpRequestFail---", res)
// //dd.alert({ content: JSON.stringify(res) });
// },
// complete: function(res) {
// dd.hideLoading();
// }
// });
},
onLoad: function(query) {
//var _this = this;
// if(getCurrentPages().length !=2){
// // let pages = getCurrentPages(); //当前页面栈
// // let curPage = pages[pages.length - 3];
// // let data = curPage.data;
// employeeList = [];
// _this.setData({
// isshowvisitor=0,
// employeeList:employeeList
// })
// }
var _this=this;
//获取是否已有添加外部人员记录
dd.getStorage({
key:'signList',
success:function(res){
var signList=res.data;
_this.setData({
signList
})
}
})
},
onReady(query) {
......@@ -219,35 +301,13 @@ Page({
onShow() {
// 页面显示
// this.onLoad()
if(getCurrentPages().length >=3){
console.log('执行执行-----');
this.setData({
//currentPage: 1,
employeeList:[]
})
this.onLoad()
}
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
// var _this = this;
// var employeeList= _this.data.employeeList;
// var pages = getCurrentPages(); //当前页面栈
// if(pages.length >=3){
// var beforePage = pages[pages.length - 3]; //获取上一个页面的实例对象
// //_this.data.employeeList = [];
// employeeList = [];
// _this.setData({
// employeeList
// })
// }
// console.log('employeeList---', _this.data.employeeList);
},
onTitleClick() {
// 标题被点击
......
......@@ -3,10 +3,10 @@ let app = getApp();
let domain = app.globalData.domain;
//获取用户信息的url
let url = domain + "/dingding/login";
let conferenceUrl = domain + "/dingding/conferenceList"
let myinfoUrl = domain +"/dingding/myinfo"
Page({
let conferenceUrl = domain + "/dingding/conferenceList";
let myinfoUrl = domain +"/dingding/myinfo";
Page({
data: {
corpId: '',
authCode: '',
......
......@@ -255,6 +255,7 @@ Page({
// 生命周期函数--监听页面加载
var _this = this;
var userId = app.globalData.userId
this.setData({
mid:query.mid,
cnum:query.cnum
......
......@@ -69,7 +69,7 @@
<button class="btn1" a:if="{{mymessage.configValueId == 1}}" size='mini' type='primary'>正在会议</button>
<button class="btn1" a:if="{{mymessage.configValueId == 3}}" size='mini' type='warn'>暂停</button>
<button class="btn1" a:if="{{mymessage.configValueId == 2}}" size='mini' type='default'>未开始</button>
<button class="btn2" size='mini' data-date="{{dates}}" data-conference-name="{{mymessage.conference.conferenceName}}" data-message-password="{{mymessage.messagePassword}}" data-mid="{{mymessage.messageId}}" data-minutesCode="{{conference.minutesCode}}" type='primary' onTap="meetjy">会议纪要</button>
<button class="btn2" size='mini' data-date="{{dates}}" data-conference-name="{{mymessage.conference.conferenceName}}" data-message-password="{{mymessage.messagePassword}}" data-mid="{{mymessage.messageId}}" data-minutes-code="{{mymessage.conference.minutesCode}}" type='primary' onTap="meetjy">会议纪要</button>
</view>
</view>
<view class="tr">
......
......@@ -24,7 +24,7 @@
<view class="tr btn">
<view class="td td1">
<text>会议操作:</text>
<button class="btn1" size='mini' data-mid="{{history.messageId}}" data-minutesCode="{{conference.minutesCode}}" type='primary' onTap="summary">会议纪要</button>
<button class="btn1" size='mini' data-mid="{{history.messageId}}" data-minutes-code="{{history.conference.minutesCode}}" type='primary' onTap="summary">会议纪要</button>
<button class="btn3" size='mini' data-mid="{{history.messageId}}" data-message-name="{{history.messageName}}" data-conference-name="{{history.conference.conferenceName}}"
data-message-compere="{{history.messageCompere}}" data-topic-list="{{history.topicList}}" data-start-time="{{history.startTimeFormat}}" data-end-time="{{history.endTimeFormat}}"
data-department="{{history.department}}" data-message-content="{{history.messageContent}}" data-config-value-id-string="{{history.configValueIdString}}" type='default' onTap="details">详细信息</button>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论