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

modifed ex_visitor.axml ex_visitor.js

上级 b05e2008
...@@ -24,15 +24,15 @@ ...@@ -24,15 +24,15 @@
</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'> <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"> <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> <text class="checkbox-text">{{sign.signName}}</text>
</view> </view>
......
...@@ -8,7 +8,6 @@ let delExSignUrl = domain + "/dingding/delExSign"; ...@@ -8,7 +8,6 @@ let delExSignUrl = domain + "/dingding/delExSign";
Page({ Page({
data: { data: {
employeeList:[],
signList:[], signList:[],
mid:null, mid:null,
personNum:0 personNum:0
...@@ -27,10 +26,6 @@ Page({ ...@@ -27,10 +26,6 @@ Page({
return false; return false;
} }
var sign ={'signName':e.detail.value.signName ,'signEmail':e.detail.value.signEmail ,"signMobile" : e.detail.value.signMobile}; var sign ={'signName':e.detail.value.signName ,'signEmail':e.detail.value.signEmail ,"signMobile" : e.detail.value.signMobile};
var signList; var signList;
//获取缓存中的参会人员列表 //获取缓存中的参会人员列表
...@@ -153,14 +148,6 @@ Page({ ...@@ -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({ // dd.httpRequest({
// url: addExSignUrl, // url: addExSignUrl,
// method: 'POST', // method: 'POST',
...@@ -170,43 +157,16 @@ Page({ ...@@ -170,43 +157,16 @@ Page({
// signEmail: e.detail.value.signEmail, // signEmail: e.detail.value.signEmail,
// signName: e.detail.value.signName, // signName: e.detail.value.signName,
},
dataType: 'json',
// }, // },
// dataType: 'json', // dataType: 'json',
success: function(res) {
// 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) // console.log('success----', res)
// if (res.data.success) { // if (res.data.success) {
_this.setData({
personNum: _this.data.personNum + 1,
employeeList,
});
//console.log('employeeList---',_this.data.employeeList);
},
});
// } else { // } else {
// dd.showToast({ // dd.showToast({
// type: 'fail', // type: 'fail',
...@@ -221,39 +181,7 @@ Page({ ...@@ -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) { // fail: function(res) {
// console.log("httpRequestFail---", res) // console.log("httpRequestFail---", res)
...@@ -263,27 +191,17 @@ Page({ ...@@ -263,27 +191,17 @@ Page({
// dd.hideLoading(); // dd.hideLoading();
// } // }
});
// }); // });
}, },
deleteSign:function (e){ deleteSign:function (e){
//console.log(e); //console.log(e);
var _this=this; var _this=this;
dd.httpRequest({
url: delExSignUrl,
method: 'POST',
data: {
signId: e.currentTarget.dataset.id,
},
dataType: 'json',
var index=e.currentTarget.dataset.id; var index=e.currentTarget.dataset.id;
var signList; var signList;
dd.getStorage({ dd.getStorage({
key: 'signList', key: 'signList',
success: function(res) { success: function(res) {
// console.log('success----', res)
// console.log(res.data); // console.log(res.data);
signList=res.data; signList=res.data;
...@@ -323,40 +241,11 @@ Page({ ...@@ -323,40 +241,11 @@ Page({
// data: { // data: {
// signId: e.currentTarget.dataset.id, // 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', // 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("预定成功"); // //console.log("预定成功");
...@@ -392,19 +281,6 @@ Page({ ...@@ -392,19 +281,6 @@ Page({
}, },
onLoad: function(query) { 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; var _this=this;
//获取是否已有添加外部人员记录 //获取是否已有添加外部人员记录
dd.getStorage({ dd.getStorage({
...@@ -425,21 +301,6 @@ Page({ ...@@ -425,21 +301,6 @@ Page({
onShow() { onShow() {
// 页面显示 // 页面显示
// this.onLoad() // this.onLoad()
if(getCurrentPages().length >=3){
console.log('执行执行-----');
this.setData({
//currentPage: 1,
employeeList:[]
})
this.onLoad()
}
}, },
onHide() { onHide() {
...@@ -447,21 +308,6 @@ Page({ ...@@ -447,21 +308,6 @@ Page({
}, },
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() {
// 标题被点击 // 标题被点击
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论