Commit 53b5604c by Denglingling

对接自助下单已有接口数据,以及修改部分交互

(cherry picked from commit ce9edb33)
parent 797e0a2e
...@@ -99,15 +99,15 @@ const styles = StyleSheet.create({ ...@@ -99,15 +99,15 @@ const styles = StyleSheet.create({
marginBottom: 18 marginBottom: 18
}, },
btn_cont: { btn_cont: {
paddingHorizontal: 26 paddingHorizontal: 20
}, },
sub_btn_box: { sub_btn_box: {
backgroundColor: dis_sub_color, backgroundColor: dis_sub_color,
height: 52, height: 48,
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
marginBottom: 14, marginBottom: 26,
borderRadius: 10 borderRadius: 10
}, },
sub_btn: { sub_btn: {
......
...@@ -135,7 +135,7 @@ class DateModel extends Component { ...@@ -135,7 +135,7 @@ class DateModel extends Component {
onRequestClose={() => this.handleCloseModal()}> onRequestClose={() => this.handleCloseModal()}>
<SafeAreaView style={safe_view}> <SafeAreaView style={safe_view}>
<TouchableOpacity style={styles.container} activeOpacity={1} <TouchableOpacity style={styles.container} activeOpacity={1}
// onPress={() => this.handleCloseModal()} onPress={() => this.handleCloseModal()}
> >
{this.renderDialog()} {this.renderDialog()}
</TouchableOpacity> </TouchableOpacity>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { StyleSheet, Image, TouchableOpacity, View, Modal, ActivityIndicator, Text, SafeAreaView } from 'react-native'; import { StyleSheet, Image, TouchableOpacity, View, Modal, ActivityIndicator, Text, SafeAreaView } from 'react-native';
import { font_family_medium, Height, icon_style, pxSize, second_text_size, Width } from '../../../base/BaseStyle'; import { font_family_medium, font_family_regular, Height, icon_style, pxSize, second_text_color, second_text_size, Width } from '../../../base/BaseStyle';
import { AsteriskTextStyle, CellTextStyle, ContInputTextStyle, ContTextStyle, ImageTextStyle, TitleTextStyle } from '../CellTextStyle'; import { AsteriskTextStyle, CellTextStyle, ContInputTextStyle, ContTextStyle, ImageTextStyle, TitleTextStyle } from '../CellTextStyle';
import DialogModel from '../DialogModel';
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
/** /**
...@@ -20,6 +19,12 @@ class PageListArrow extends Component { ...@@ -20,6 +19,12 @@ class PageListArrow extends Component {
listTitle: PropTypes.string, listTitle: PropTypes.string,
listName: PropTypes.string, listName: PropTypes.string,
listHasArrow: PropTypes.bool, listHasArrow: PropTypes.bool,
listOtherInput: PropTypes.string,
otherInput: PropTypes.string,
otherInputCallBack: PropTypes.func,
listInputPlace: PropTypes.string,
inputCallBack: PropTypes.func,
isTitInputStyle: PropTypes.bool
} }
constructor(props) { constructor(props) {
...@@ -35,43 +40,38 @@ class PageListArrow extends Component { ...@@ -35,43 +40,38 @@ class PageListArrow extends Component {
} }
} }
// 返回选择器弹窗
renderPickerModel() {
let { listCurrentOption, currentItem, currentTitle, showTypePop } = this.state
return (
<SafeAreaView style={styles.item_container}>
<DialogModel
ref={'pickerModel'}
entityList={listCurrentOption}
callback={(item, itemTitle) => this.handleCallBack(item, itemTitle)}
show={showTypePop}
itemValue={currentItem.value}
itemTitle={currentTitle}
closeModal={(show) => this.handleCloseModal(show)}
/>
</SafeAreaView>
)
}
render() { render() {
let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle, listHasArrow} = this.props let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle,
listName, listHasArrow, listOtherInput, otherInput, otherInputCallBack, listInputPlace, inputCallBack, isTitInputStyle} = this.props
return ( return (
<View style={styles.item_container}> <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={listActOpa} activeOpacity={listActOpa}
onPress={() => listCallBack()} onPress={() => {return listCallBack ? listCallBack() : ''}}
> >
<CellTextStyle> <CellTextStyle>
{ listHasAster ? <AsteriskTextStyle>*</AsteriskTextStyle> : null } { listHasAster ? <AsteriskTextStyle>*</AsteriskTextStyle> : null }
<TitleTextStyle>{listItem[listTitle]}</TitleTextStyle> <TitleTextStyle style={isTitInputStyle ? styles.cell_title : ''}>{listItem[listTitle]}</TitleTextStyle>
{ listEditAble ? <ContInputTextStyle editable={listEditAble} defaultValue={listItem[listDefaValue]} /> { (listEditAble || inputCallBack) ? <ContInputTextStyle
: <ContTextStyle>{listItem[listName]}</ContTextStyle> style={isTitInputStyle ? styles.cell_input : ''}
editable={!listEditAble}
defaultValue={listItem[listDefaValue]}
placeholder={listInputPlace}
onChangeText={(text) => {return inputCallBack ? inputCallBack(text) : ''}}
/> : <ContTextStyle>{listItem[listName]}</ContTextStyle>
} }
{ listHasArrow ? <ImageTextStyle> <Image source={require('../../images/arr_rig.png')} style={icon_style}/> { listHasArrow ? <View style={styles.arr_icon_box}>
</ImageTextStyle> : null} <Image source={require('../../../images/arr_rig.png')} style={icon_style}/>
</View> : null}
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
{ this.renderPickerModel() } { (listOtherInput && listItem[otherInput]) ? <CellTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={listOtherInput}
onChangeText={(text) => otherInputCallBack(text)}
></ContInputTextStyle>
</CellTextStyle> : null}
</View> </View>
); );
} }
...@@ -80,7 +80,29 @@ class PageListArrow extends Component { ...@@ -80,7 +80,29 @@ class PageListArrow extends Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
item_container: { item_container: {
flex: 1 flex: 1
} },
cont_text: {
fontSize: second_text_size,
color: second_text_color,
flex: 1,
textAlign: 'right',
fontFamily: font_family_regular,
paddingLeft: 20
},
text_select: {
paddingLeft: 6
},
arr_icon_box: {
width: pxSize(16),
height: pxSize(16),
marginLeft: 6
},
cell_title: {
width: 120
},
cell_input: {
textAlign: 'left'
},
}) })
export default PageListArrow; export default PageListArrow;
\ No newline at end of file
...@@ -376,8 +376,7 @@ const styles = StyleSheet.create({ ...@@ -376,8 +376,7 @@ const styles = StyleSheet.create({
}, },
sub_btn_pro: { sub_btn_pro: {
backgroundColor: promary_color, backgroundColor: promary_color,
height: 48, marginBottom: 14
// marginBottom: 18
}, },
thr_head_tit_img: { thr_head_tit_img: {
borderWidth: .5, borderWidth: .5,
......
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