Skip to content

Commit 26997a7

Browse files
committed
Merge pull request vczero#7 from Raincal/master
fix some bugs
2 parents 5d34020 + 4e8dccf commit 26997a7

File tree

6 files changed

+33
-26
lines changed

6 files changed

+33
-26
lines changed

address_book/server/routes/services/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var User = {
6565
var tag = req.param('tag');
6666
var creater = req.param('creater') || '';
6767

68-
if(!username || !password || !tel || !email || !partment || !tag || !creater){
68+
if(!username || !password || !tel || !email || !partment || !tag){
6969
return res.send({
7070
status: 0,
7171
data: '缺少必要参数'

address_book/views/about/webview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var webview = React.createClass({
1515

1616
render: function(){
1717
return(
18-
<View style={{flex:1}}>
18+
<View style={{flex:1, marginBottom: 64}}>
1919
<WebView url={this.props.url}/>
2020
</View>
2121
);

address_book/views/home/address.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var Address = React.createClass({
5959
);
6060
}
6161
return (
62-
<ScrollView>
62+
<ScrollView style={{marginBottom: 64}}>
6363
{view}
6464
</ScrollView>
6565
);

address_book/views/manager/addUser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ var AddUser = React.createClass({
144144
};
145145
this.setState(obj);
146146
this.setState(color);
147-
this.setState();
148147
//清除其他选中效果
149148
delete items[id];
150149
for(var i in items){

address_book/views/manager/deleteUser.js

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ var {
1616
} = React;
1717

1818
var DeleteUser = React.createClass({
19-
19+
getInitialState: function () {
20+
return {
21+
email: ''
22+
}
23+
},
2024
render: function(){
2125
return (
2226
<ScrollView>
@@ -44,29 +48,33 @@ var DeleteUser = React.createClass({
4448

4549
_deleteUser: function(){
4650
var that = this;
47-
AlertIOS.alert('提示', '确认删除该用户?', [
48-
{text: '删除', onPress: function(){
49-
var path = Service.host + Service.deleteUser;
50-
AsyncStorage.getItem('token', function(err, data){
51-
if(!err){
52-
Util.post(path,{
53-
token: data,
54-
email: that.state.email
55-
}, function(data){
56-
if(data.status){
57-
AlertIOS.alert('成功', '删除成功');
51+
this.state.email == '' ?
52+
AlertIOS.alert('提示', '请输入要删除的用户邮箱') :
53+
AlertIOS.alert('提示', '确认删除该用户?', [
54+
{
55+
text: '删除',
56+
onPress: function(){
57+
var path = Service.host + Service.deleteUser;
58+
AsyncStorage.getItem('token', function(err, data){
59+
if(!err){
60+
Util.post(path,{
61+
token: data,
62+
email: that.state.email
63+
}, function(data){
64+
if(data.status){
65+
AlertIOS.alert('成功', '删除成功');
66+
}else{
67+
AlertIOS.alert('失败', '删除失败');
68+
}
69+
});
5870
}else{
59-
AlertIOS.alert('失败', '删除失败');
71+
AlertIOS.alert('提示', '没有权限');
6072
}
6173
});
62-
}else{
63-
AlertIOS.alert('提示', '没有权限');
6474
}
65-
});
66-
}
67-
},
68-
{text: '取消', onPress: ()=>null},
69-
]);
75+
},
76+
{text: '取消', onPress: ()=>null},
77+
]);
7078
}
7179

7280
});

address_book/views/message.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ var Message = React.createClass({
4545
</View>
4646
<View style={{backgroundColor:'#fff', borderTopWidth:1, borderTopColor:'#ddd'}}>
4747
{items}
48-
<View style={{height:35}}></View>
4948
</View>
5049
</ScrollView>
5150
);
@@ -57,7 +56,8 @@ var styles = StyleSheet.create({
5756
container:{
5857
flex:1,
5958
backgroundColor:'#F5F5F5',
60-
flexDirection:'column'
59+
flexDirection:'column',
60+
marginBottom: 64
6161
},
6262
search:{
6363
height:35,

0 commit comments

Comments
 (0)