Commit 714aea8d by Denglingling

增加tab标签,修改 debug下可以运行,正常点击不可运行的问题,重新修改加载【历史订单】页面的方法

parent 6cf3dd25
......@@ -385,13 +385,14 @@ class HistoricalOrderPage extends Component {
componentDidMount() {
this.getSellerName()
this.handleSubmitCheck(true)
this.handleSubmitCheck('mount')
}
// 赋值销售员 初始化数据
getSellerName() {
let {state, props} = this
let {borrowListOptionData, consumeListOptionData, transferListOptionData} = this.state
let that = this
this.setState({
subBorrowInitListOption: cloneObject(borrowListOptionData), // 存储初始化数据,重置时付此值
subConsumeInitListOption: cloneObject(consumeListOptionData),
......@@ -1259,9 +1260,6 @@ class HistoricalOrderPage extends Component {
handleSubmitCheck(noCloseSel) {
// console.log('筛选 - 确定---')
// this.changeSeaColorAct()
// 有问题 ===============!!!====================
let {
topActiveIndex,
borrowListOptionData,
......@@ -1273,9 +1271,16 @@ class HistoricalOrderPage extends Component {
contOptionData
} = this.state
let {props} = this
if(!noCloseSel) {
this.handleSelectClick() // 关闭筛选
}
if(noCloseSel == 'close') {
this.setState({
isShowSelect: false // 关闭筛选
})
} else if(noCloseSel != 'close' && noCloseSel != 'mount') {
this.handleSelectClick() // 切换筛选
// this.changeSeaColorAct() // 改变筛选颜色
}
this.setState({
contOptionData: [] // 清空数据
})
......@@ -1355,18 +1360,21 @@ class HistoricalOrderPage extends Component {
switch(topActiveIndex) {
case 0:
searchColorIsAct = this.bothArrayIsCom(borrowListOptionData, subBorrowInitListOption);
this.setState({
searchColorIsAct
})
break;
case 1:
searchColorIsAct = this.bothArrayIsCom(consumeListOptionData, subConsumeInitListOption);
this.setState({
searchColorIsAct
})
break;
case 2:
break;
default:
break;
}
this.setState({
searchColorIsAct
})
}
// 判断两个引用数组是否相同
......@@ -1406,7 +1414,7 @@ class HistoricalOrderPage extends Component {
topActiveIndex: index
}, () => {
// 获取数据
this.handleSubmitCheck(true)
this.handleSubmitCheck('close')
})
}
......@@ -2208,17 +2216,17 @@ class HistoricalOrderPage extends Component {
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
// let {navigation} = this.props
// let {title} = navigation.state.params
return (
<View style={styles.hist_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
// <View style={styles.hist_container}>
// <StatusBarView
// isReactStackNavigator={true}
// backgroundColor={promary_color}
// barStyle = 'light-content'
// />
// <SafeAreaView style={safe_view}>
// <HeadBackItem title={title} navigation={navigation} />
<View style={styles.hist_main}>
{/* { this.renderSearchItem() } */}
......@@ -2227,8 +2235,8 @@ class HistoricalOrderPage extends Component {
{this.renderLodingItem()}
</View>
</SafeAreaView>
</View>
// </SafeAreaView>
// </View>
);
}
}
......@@ -2246,7 +2254,8 @@ const styles = StyleSheet.create({
loding_back: {
backgroundColor: 'rgba(0, 0, 0, 0)'
},
cont_item_box: {},
cont_item_box: {
},
top_box: {},
top_tab_cont: {
flexDirection: 'row',
......@@ -2309,7 +2318,7 @@ const styles = StyleSheet.create({
marginLeft: 4
},
sea_main: {
height: 750,
height: 800,
backgroundColor: 'rgba(0, 0, 0, .5)',
position: 'absolute',
top: 44,
......@@ -2322,7 +2331,7 @@ const styles = StyleSheet.create({
sea_container: {
// backgroundColor: '#000',
// minHeight: Height() - 218,
height: Height() - 218,
height: Height() - 300,
// height: Height() - 170
},
sea_scroll: {
......@@ -2519,7 +2528,7 @@ const styles = StyleSheet.create({
cont_main: {
backgroundColor: foundation_color,
maxHeight: Height() - 176,
minHeight: pxHeight(520)
minHeight: pxHeight(530)
},
cont_scroll: {},
cont_box: {},
......
......@@ -21,8 +21,9 @@ import {
import { exitLoginStatus } from '../../action/LoginAction';
import HeadBackItem from '../common/HeadBackItem';
import StatusBarView from '../common/StatusBarView';
import ScrollableTabView from 'react-native-scrollable-tab-view';
import ScrollableTabView , { DefaultTabBar } from 'react-native-scrollable-tab-view';
import TabBottomItem from './module/TabBottomItem';
import HistoricalOrderPage from '../historicalOrder/HistoricalOrderPage';
class HomePage extends Component {
......@@ -62,8 +63,8 @@ class HomePage extends Component {
}
],
tabNames: ['业务模块', '历史订单'],
tabIconNames: [require('../../images/tab_init.png'), require('../../images/tab_init.png')],
tabSelIconNames:[require('../../images/tab_act.png'), require('../../images/tab_act.png')],
tabIconNames: [require('../../images/tab_mod_def.png'), require('../../images/tab_his_def.png')],
tabSelIconNames:[require('../../images/tab_mod_sel.png'), require('../../images/tab_his_sel.png')],
initialPage: 0
}
}
......@@ -84,14 +85,14 @@ class HomePage extends Component {
// 切换 Tab 标签
switchTabView(obj) {
console.log('切换===',obj)
if(obj.i == 1) {
// 跳转到历史订单页面
this.props.navigation.navigate('HistoricalOrderPage', {title: '历史订单'})
// if(obj.i == 1) {
// // 跳转到历史订单页面
// this.props.navigation.navigate('HistoricalOrderPage', {title: '历史订单'})
this.setState({
initialPage: 0
})
}
// this.setState({
// initialPage: 0
// })
// }
}
// 跳转页面
......@@ -127,13 +128,14 @@ class HomePage extends Component {
tabBarPosition='bottom'
locked={true}
renderTabBar={() =>
// <DefaultTabBar />
<TabBottomItem
tabNames={tabNames}
tabIconNames={tabIconNames}
tabSelIconNames={tabSelIconNames}
/>
}
onChangeTab={(obj) => this.switchTabView(obj)}
// onChangeTab={(obj) => this.switchTabView(obj)}
>
<View style={styles.home_cont} tabLabel={tabNames[0]}>
{
......@@ -154,7 +156,10 @@ class HomePage extends Component {
)
}
</View>
<Text tabLabel={tabNames[1]}>------Tab2------</Text>
{/* <Text tabLabel={tabNames[0]}>------Tab1-----</Text> */}
<View style={{flex: 1}} tabLabel={tabNames[1]}>
<HistoricalOrderPage navigation={navigation} />
</View>
</ScrollableTabView>
......@@ -177,6 +182,8 @@ class HomePage extends Component {
)
}
</View> */}
</SafeAreaView>
</View>
);
......
......@@ -50,6 +50,7 @@ class LoginPage extends Component{
componentDidMount() {
// this.subAutoLogin()
SplashScreen.hide() //关闭启动屏幕
// this.isOpenDomainModel()
}
componentWillReceiveProps(nextProps) {
......@@ -84,6 +85,24 @@ class LoginPage extends Component{
}
// 判断是否打开域名弹窗
isOpenDomainModel() {
let {global_domain_config} = this.props
console.log('isOpenDomainModel-----', global_domain_config)
let tempInd = global_domain_config.indexOf('/') + 2
let tempGlobalDomain = global_domain_config.slice(tempInd)
if(tempGlobalDomain.includes("obs.uat.guke.tech")) {
this.setState({
isShowDomain: true
})
} else {
this.setState({
isShowDomain: false
})
}
}
// 登录中 || 登录成功/失败
changeSubTit(loading) {
let { subTitList } = this.state
......@@ -106,13 +125,18 @@ class LoginPage extends Component{
// this.enterHomePage()
let {username, password, isSubLoding} = this.state
let {global_domain_config} = this.props
if(global_domain_config.includes("obs.uat.guke.tech")) {
show('请修改正确域名')
return
}
if (!isSubLoding) {
if (isEmpty(username)) {
show('请输入用户名', 'warn')
show('请输入用户名')
return
}
if(isEmpty(password)) {
show('请输入密码', 'warn')
show('请输入密码')
return
}
let params = {
......
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