提交 0c199018 authored 作者: zhenglide's avatar zhenglide

modifed ex_visitor.axml ex_visitor.js

上级 b05e2008
......@@ -24,15 +24,15 @@
</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>
......
......@@ -8,7 +8,6 @@ let delExSignUrl = domain + "/dingding/delExSign";
Page({
data: {
employeeList:[],
signList:[],
mid:null,
personNum:0
......@@ -26,10 +25,6 @@ Page({
})
return false;
}
var sign ={'signName':e.detail.value.signName ,'signEmail':e.detail.value.signEmail ,"signMobile" : e.detail.value.signMobile};
var signList;
......@@ -153,14 +148,6 @@ 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',
......@@ -170,43 +157,16 @@ Page({
// 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',
......@@ -221,39 +181,7 @@ Page({
// }
// 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)
......@@ -263,27 +191,17 @@ Page({
// 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)
// console.log(res.data);
signList=res.data;
......@@ -323,40 +241,11 @@ Page({
// data: {
// signId: e.currentTarget.dataset.id,
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();
}
// },
// dataType: 'json',
// success: function(res) {
// // console.log('success----', res)
});
// if (res.data.success) {
// //console.log("预定成功");
......@@ -392,19 +281,6 @@ Page({
},
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({
......@@ -425,43 +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() {
// 标题被点击
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论