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

添加外部人员

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