Commit efb8297f by Denglingling

默认记住用户登录名、密码;首页【业务模块】、【历史订单】修改右上角退出按钮;【业务模块】取消【返回登录页】菜单

(cherry picked from commit 62e093f2)
parent 4a50ff55
......@@ -15,15 +15,29 @@ import {
Width,
icon_style
} from '../../base/BaseStyle';
import { connect } from "react-redux";
import { exitLoginStatus } from '../../action/LoginAction';
import { show } from '../../utils/Utils';
class HeadBackItem extends Component {
constructor(props) {
super(props);
this.state = { }
this.state = {
isRightExit: false
}
}
componentWillReceiveProps(nextProps) {
let { isRightExit } = this.state
if(isRightExit != nextProps.nextProps) {
this.setState({
isRightExit: nextProps.nextProps
})
}
}
goBack() {
let {callback, navigation} = this.props
let { callback, navigation } = this.props
if(callback && callback instanceof Function) {
callback()
setTimeout(() => {
......@@ -34,23 +48,51 @@ class HeadBackItem extends Component {
}
}
goLogin() {
let { navigation } = this.props
this.props.exitLoginStatus()
show('退出登录')
setTimeout(() => {
navigation.navigate('LoginPage')
}, 300)
}
render() {
let {title} = this.props
let { title } = this.props
let { isRightExit } = this.state
return (
<View style={styles.header_style}>
<TouchableOpacity
activeOpacity={.8}
style={styles.head_img_box}
onPress={() => this.goBack()}
>
<View style={styles.back_style}>
<Image source={require('../../images/arrow_icon.png')} style={icon_style}/>
</View>
<Text style={styles.back_tip}>返回</Text>
</TouchableOpacity>
<Text style={styles.title_style} numberOfLines={1} ellipsizeMode={'tail'}>{title}</Text>
{
!isRightExit ?
<TouchableOpacity
activeOpacity={.8}
style={styles.head_img_box}
onPress={() => this.goBack()}
>
<View style={styles.back_style}>
<Image source={require('../../images/arrow_icon.png')} style={icon_style}/>
</View>
<Text style={styles.back_tip}>返回</Text>
</TouchableOpacity>
: null
}
<Text style={[styles.title_style,
isRightExit ? styles.title_no_marg : '']} numberOfLines={1} ellipsizeMode={'tail'}>{title}</Text>
{
isRightExit ?
<TouchableOpacity
activeOpacity={.8}
style={styles.head_rig_box}
onPress={() => this.goLogin()}
>
<View style={styles.back_rig_style}>
<Image source={require('../../images/exit_icon.png')} style={icon_style}/>
</View>
</TouchableOpacity>
: null
}
</View>
);
);
}
}
......@@ -86,8 +128,29 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontSize: 18,
color: title_text_color,
fontFamily: font_family_regular
fontFamily: font_family_regular,
},
title_no_marg: {
marginLeft: 14,
marginRight: 0
},
head_rig_box: {
paddingRight: 20
},
back_rig_style: {
width: pxSize(20),
height: pxSize(20)
}
})
export default HeadBackItem;
\ No newline at end of file
const mapStateToProps = (state) => ({
loginState:state.login.loginState
})
const mapDispatchToProps = (dispatch) => ({
exitLoginStatus: () => {
dispatch(exitLoginStatus())
}
})
export default connect(mapStateToProps, mapDispatchToProps)(HeadBackItem)
\ No newline at end of file
......@@ -16,11 +16,8 @@ import {
Width,
pxHeight,
foundation_color,
promary_text_color,
font_family_semibold,
font_family_regular,
first_text_color,
btn_sub_color,
second_text_size,
title_text_color,
icon_style,
......
......@@ -96,6 +96,7 @@ class HomePage extends Component {
modSeleIcon: require('../../images/tab_mod_sel.png'),
hisDefauIcon: require('../../images/tab_his_def.png'),
hisSeleIcon: require('../../images/tab_his_sel.png'),
isRightExit: true
}
}
......@@ -135,7 +136,7 @@ class HomePage extends Component {
}
})
}
tempModuleList.push(backLoginInfo)
// tempModuleList.push(backLoginInfo)
} else if(item.function_code == 'MOBILE_HISTORICAL_ORDER') {
tempTabIconNames.push(hisDefauIcon)
......@@ -163,7 +164,8 @@ class HomePage extends Component {
render() {
let {navigation} = this.props
let { tabNames, tabIconNames, tabSelIconNames, initialPage, tabCodes } = this.state
let { tabNames, tabIconNames, tabSelIconNames,
initialPage, tabCodes, isRightExit } = this.state
return (
<View style={styles.home_container}>
<StatusBarView
......@@ -172,7 +174,7 @@ class HomePage extends Component {
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={'骨科智慧仓'} navigation={navigation} />
<HeadBackItem title={'骨科智慧仓'} navigation={navigation} isRightExit={isRightExit} />
<ScrollableTabView
style={styles.bom_tab_box}
......
......@@ -69,9 +69,6 @@ class LoginPage extends Component{
break;
case LOGIN_NO:
this.changeSubTit();
this.setState({
password: ''
})
break
case LOGIN_SUCCESS:
this.changeSubTit();
......
......@@ -69,51 +69,38 @@ class EquipConsuPage extends Component {
{
"id": "0",
title: '销售员',
name: '蔡妍',
value: 'caiyan',
isPicker: false,
select: false,
isEditable: false // 不可编辑
name: '',
value: ''
},
{
"id": "1",
title: '组织',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "2",
title: '客户名称',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "3",
title: '收单地点',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "4",
title: '收货地点',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "5",
title: '主治医生',
name: '请选择',
value: '',
isPicker: true,
select: false,
showInput: false,
inputValue: ''
},
......@@ -121,17 +108,13 @@ class EquipConsuPage extends Component {
"id": "6",
title: '手术类型',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "7",
title: '配台模版',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "8",
......@@ -139,32 +122,24 @@ class EquipConsuPage extends Component {
name: '请选择',
value: '',
dateValue: new Date(),
isPicker: true,
select: false,
showDatePicker: true
},
{
"id": "9",
title: '订单类型',
name: '请选择',
value: '',
isPicker: true,
select: false
value: ''
},
{
"id": "10",
title: '备注',
value: '',
isPicker: false,
select: false,
isRemark: true // 备注
},
{
"id": "11",
title: '还有什么要安排的,可录音备注哟!',
value: '',
isPicker: false,
select: false,
isRecode: true // 录音
}
],
......@@ -217,7 +192,7 @@ class EquipConsuPage extends Component {
hasPermission: undefined, //录音 授权状态
// audioPath: AudioUtils.DocumentDirectoryPath + `/quickAudio${Math.floor(Math.random() * (1000))+1}.aac`, // 文件路径
audioPath: AudioUtils.DocumentDirectoryPath + `/quick_audio_${new Date().getTime()}.aac`, // 文件路径
recording: false, //是否录音
// recording: false, //是否录音
stop: false, //录音是否停止
currentTime: 0, //录音时长
localCustomersOption: [], // 当前医院信息:客户名称、收单地点、收货地点、主治医生
......
......@@ -42,7 +42,7 @@ export default login = (state = defaultState, action) => {
token: null,
loginState:LOGIN_NO,
userInfo:{},
password: ''
// password: ''
});
case AUTO_LOGIN_SUCCESS:
return Object.assign({}, state, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment