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

提交外部

上级 7e2755f7
......@@ -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="{{sign.signId}}" 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,53 +25,47 @@ Page({
})
return false;
}
var sign={};
sign['signName']=e.detail.value.signName;
sign['signEmail']=e.detail.value.signEmail;
sign['signMobile']=e.detail.value.signMobile;
var signList=new Array();
dd.getStorage({
key: 'signList',
success: function(res) {
signList=res.data.signList;
sign['signId']=signList.length-1;
signList.push(sign);
// dd.alert({content: '获取成功:' + res.data.cityName});
},
fail: function(res){
sign['signId']=0;
signList.push(sign);
//dd.alert({content: res.errorMessage});
}
});
// 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;
// if (!phoneReg.test(phone)) {
// dd.alert({
// title: "添加失败",
// content: "手机格式错误",
// buttonText: '确定'
// })
// return false;
// }
// } else {
// dd.alert({
// title: "添加失败",
// content: "手机不为空",
// buttonText: '确定'
// });
// return false;
// }
// if (e.detail.value.signEmail.length!=0 ) {
// var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
// var email = e.detail.value.signEmail;
// if (!reg.test(email)) {
// dd.alert({
// title: "添加失败",
// content: "邮箱格式错误",
// buttonText: '确定'
// });
// return false;
// }
// } else {
// dd.alert({
// title: "添加失败",
// content: "邮箱不为空",
// buttonText: '确定'
// });
// return false;
// }
dd.setStorage({
key: 'signList',
data: signList,
success: function() {
dd.alert({
title: '添加成功',
content: '添加成功',
buttonText: '确定',
success: () => {
_this.setData({
personNum: _this.data.personNum + 1,
signList,
});
},
});
}
});
dd.httpRequest({
url: addExSignUrl,
......@@ -90,27 +84,7 @@ Page({
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);
_this.setData({
personNum: _this.data.personNum + 1,
employeeList,
});
//console.log('employeeList---',_this.data.employeeList);
},
});
// var employeeList= _this.data.employeeList;
......@@ -219,14 +193,14 @@ Page({
onShow() {
// 页面显示
// this.onLoad()
if(getCurrentPages().length >=3){
console.log('执行执行-----');
this.setData({
//currentPage: 1,
employeeList:[]
})
this.onLoad()
}
// if(getCurrentPages().length >=3){
// console.log('执行执行-----');
// this.setData({
// //currentPage: 1,
// employeeList:[]
// })
// this.onLoad()
// }
},
onHide() {
// 页面隐藏
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论