Commit 9f63e122 by Denglingling

调整自助下单功能

(cherry picked from commit b4b348ea)
parent 0afde318
......@@ -44,77 +44,81 @@ class ChooseCardList extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
countStyleType: ['DEFAULT', 'GRAPHICS'],
countStyleName: ['card_default', 'card_graphice']
}
}
render() {
let {cardScrollEnabled, cardHorizontal, cardShowsHorizontalScrollIndicator, cardShowsVerticalScrollIndicator, cardStyleBox, cardStyleScroll, cardListOptions, cardItemTitle, cardItemIcon, cardImgName,
render() {
let { cardScrollEnabled, cardHorizontal, cardShowsHorizontalScrollIndicator, cardShowsVerticalScrollIndicator, cardStyleBox, cardStyleScroll, cardListOptions, cardItemTitle, cardItemIcon, cardImgName,
cardStyleListItem, cardStyleListItemAct, cardStyleItemIcon, cardStyleItemTit, cardStyleNotIconTit, cardStyleItemTitAct, cardCallBack, curActIndex, cardCountName, cardStyleType, cardCouStyle,
global_domain_config, cardShowDefIcon, cardKeyName } = this.props
let {countStyleType} = this.state
let { countStyleType } = this.state
let localTestImageUrls = localMockData.localTestImageUrls // 本地测试数据
cardListOptions[cardImgName] = localTestImageUrls // 本地测试
// let localTestImageUrls = localMockData.localTestImageUrls // 本地测试数据
// cardListOptions[cardImgName] = localTestImageUrls // 本地测试
return (
return (
<View style={[styles.card_container, cardStyleBox]}>
<ScrollView
scrollEnabled={!!cardScrollEnabled}
horizontal={!!cardHorizontal}
showsHorizontalScrollIndicator={!!cardShowsHorizontalScrollIndicator}
showsVerticalScrollIndicator={!!cardShowsVerticalScrollIndicator}
style={[styles.card_scroll_box,cardStyleScroll]}
>
{ cardListOptions.map((item, index) => {
if(typeof item[cardItemIcon] === 'string'){
style={[styles.card_scroll_box, cardStyleScroll]}
>
{cardListOptions.map((item, index) => {
let cur_icon = item[cardItemIcon]
if (typeof cur_icon === 'string') {
// global_domain_config = 'https://obs-dev.gyjtsx.com' // 本地测试
// item[cardItemIcon] = {uri: global_domain_config+item[cardItemIcon]} // 测试
// cur_icon = {uri: global_domain_config+cur_icon} // 测试
item[cardItemIcon] = {uri: global_domain_config+'/jeecg-boot/sys/common/view/'+item[cardItemIcon]} // 正式
}else if(item[cardItemIcon] instanceof Array) {
cur_icon = { uri: global_domain_config + '/jeecg-boot/sys/common/view/' + cur_icon } // 正式
} else if (cur_icon instanceof Array) {
// global_domain_config = 'https://obs-dev.gyjtsx.com' // 本地测试
// item[cardItemIcon] = {uri: global_domain_config+item[cardItemIcon][0]} // 测试
item[cardItemIcon] = {uri: global_domain_config+'/jeecg-boot/sys/common/view/'+item[cardItemIcon][0]} // 正式
// cur_icon = {uri: global_domain_config+cur_icon[0]} // 测试
if (cur_icon.length === 0) {
cur_icon = require('../../../images/not_img.png')
} else {
cur_icon = { uri: global_domain_config + '/jeecg-boot/sys/common/view/' + cur_icon[0] } // 正式
}
}
return <View style={styles.card_list_box} key={'choose_card'+index}>
return <View style={styles.card_list_box} key={'choose_card' + index}>
<TouchableOpacity
activeOpacity={.8}
style={styles.list_touch_cont}
onPress={() => cardCallBack(item, index)}
>
>
<View style={[styles.list_item_inner, cardStyleListItem, index == curActIndex ? [styles.list_inner_act, cardStyleListItemAct] : '']}>
{ item[cardItemIcon] ? <View style={[styles.item_icon_def, cardStyleItemIcon]}>
{ cardShowDefIcon ?
<Image
defaultSource={require('../../../images/not_img.png')}
source={item[cardItemIcon]}
style={icon_style}
resizeMode="cover"/> : <Image source={item[cardItemIcon]} style={icon_style} resizeMode="cover"/>
{cur_icon ? <View style={[styles.item_icon_def, cardStyleItemIcon]}>
{cardShowDefIcon ?
<Image
defaultSource={require('../../../images/not_img.png')}
source={cur_icon}
style={icon_style}
resizeMode="cover" /> : <Image source={cur_icon} style={icon_style} resizeMode="cover" />
}
</View> : null }
<Text numberOfLines={2} style={[styles.list_item_tit, cardStyleItemTit, item[cardItemIcon] ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
</View> : null}
<Text numberOfLines={2} style={[styles.list_item_tit, cardStyleItemTit, cur_icon ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
{item[cardItemTitle]}
{ (item[cardCountName] && countStyleType[0] === cardStyleType) ? <Text style={[styles.sum_def, cardCouStyle]}>({item[cardCountName]})</Text> : null }
{(item[cardCountName] && countStyleType[0] === cardStyleType) ? <Text style={[styles.sum_def, cardCouStyle]}>({item[cardCountName]})</Text> : null}
</Text>
</View>
</TouchableOpacity>
{ (item[cardCountName] && countStyleType[1] === cardStyleType) ? <View style={[styles.card_def_count, cardCouStyle]}>
{(item[cardCountName] && countStyleType[1] === cardStyleType) ? <View style={[styles.card_def_count, cardCouStyle]}>
<Text style={styles.def_count_txt}>{item[cardCountName]}</Text>
</View> : null}
</View>
})
})
}
</ScrollView>
</View>
);
);
}
}
......
......@@ -131,10 +131,6 @@ class PicTitDetaiCalcu extends Component {
{
listShowNoData ? <Text>暂无数据</Text> :
<View style={[styles.ri_inner, listStyleBox]}>
{/* { listImgIcon ?
<View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
<Image style={icon_style} source={listItem[listImgIcon]}/>
</View> : null } */}
{(listImgIcon && cur_photos.length > 0) ?
<PictureZoom
listImageIndex={0}
......@@ -142,9 +138,6 @@ class PicTitDetaiCalcu extends Component {
listStyleImage={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}
listPicType={listPicType}
/>
// : listImgIcon ? <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
// <Image style={icon_style} source={listItem[listImgIcon]} />
// </View>
: null}
<View style={styles.ri_text_box}>
<TouchableOpacity
......
......@@ -66,8 +66,6 @@ class PictureZoom extends Component {
picOthStyle = picStyleArr[listPicTypeArr.indexOf(listPicType)]
}
// console.log('图片放大----', listImageUrls, typeof listImageUrls)
return (
<View style={[styles.container]}>
<TouchableOpacity
......@@ -78,7 +76,7 @@ class PictureZoom extends Component {
<Image
defaultSource={require('../../../images/not_img.png')}
source={{uri: listImageUrls[listImageIndex].url}}
style={icon_style}
style={[icon_style, styles.list_item_img]}
resizeMode="cover" />
</TouchableOpacity>
<Modal
......
......@@ -4,21 +4,14 @@ import {
Text,
StyleSheet,
Modal,
ScrollView,
TouchableOpacity,
Image
} from 'react-native';
import {
Width,
pxHeight,
third_text_color,
second_text_color,
first_text_color,
safe_view,
pxSize,
font_family_medium,
icon_style,
font_family_regular,
font_family_semibold,
title_text_color,
promary_color
......@@ -70,15 +63,8 @@ class TipInfoNeedSelect extends Component {
<View style={styles.modal_head}>
<View style={styles.modal_tit}>
<Image style={styles.err_icon} source={require('../../../images/err_tit.png')} />
<Text style={styles.inner_tit}>{title}</Text>
<Text numberOfLines={2} style={styles.inner_tit}>{title}</Text>
</View>
{/* <TouchableOpacity
activeOpacity={.8}
onPress={() => this.closeModal()}
style={styles.head_tou_clo}
>
<Image style={icon_style} source={require('../../../images/close_icon.png')}></Image>
</TouchableOpacity> */}
</View>
<View style={styles.model_footer}>
<TouchableOpacity
......@@ -127,12 +113,6 @@ const styles = StyleSheet.create({
dia_container: {
flex: 1,
},
// dis_cont: {
// width: '80%',
// maxHeight: '80%',
// backgroundColor: '#FFF',
// borderRadius: 8
// },
container: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
......@@ -154,20 +134,10 @@ const styles = StyleSheet.create({
minHeight: pxHeight(200),
borderRadius: 8,
marginHorizontal: 22,
paddingHorizontal: 18,
paddingTop: 32
paddingHorizontal: 20,
paddingVertical: 32,
paddingBottom: 42
},
// scro_box: {
// marginTop: 18,
// maxHeight: pxHeight(310),
// minHeight: pxHeight(220),
// borderWidth: 1,
// borderColor: '#eaeaea',
// paddingLeft: 6,
// borderRadius: 2,
// paddingBottom: 6
// },
// item_scroll: {},
modal_head: {
flexDirection: 'row',
justifyContent: 'center',
......@@ -183,38 +153,9 @@ const styles = StyleSheet.create({
marginRight: 6
},
inner_tit: {
fontSize: 20,
fontSize: 18,
fontFamily: font_family_semibold
},
head_tou_clo: {
width: pxSize(26),
height: pxSize(26),
marginBottom: 10
},
// cont_list: {},
// co_li: {
// lineHeight: 20,
// fontSize: 12,
// fontFamily: font_family_regular,
// color: second_text_color
// },
// co_str: {
// fontFamily: font_family_semibold,
// fontWeight: '500',
// fontSize: 14,
// paddingTop: 6,
// paddingBottom: 2,
// color: first_text_color
// },
// plan_num: {
// fontSize: 14,
// fontFamily: font_family_semibold
// },
// sto_num: {
// fontSize: 14,
// fontFamily: font_family_semibold,
// color: 'red'
// },
model_footer: {
paddingTop: 30,
flexDirection: 'row',
......
......@@ -14,11 +14,12 @@ import { cloneObject, show } from '../../../utils/Utils';
import { reqSurTempLineSearch, reqNailBoxLineSearch, reqEquipPackageLineSearch } from '../../../action/SelfAction';
import LoadingModel from '../../common/listDataComponent/LoadingModel';
import localMockData from './mock/sen_mock';
import LocalVariable from '../../common/LocalVariable';
const SELECTED_QUQNTITY = 'selectedQuantity' // 三级数量
const SELECTED_DATA_ARR = 'selectedDataArr' // 三级已选元素
const LOCAL_THRID_CONT_DATA = 'localThridContData' // 三级原本元素
const QUANTITY_FIELD = 'quantity' // 计算的字段
// const SELECTED_QUQNTITY = 'selectedQuantity' // 三级数量
// const SELECTED_DATA_ARR = 'selectedDataArr' // 三级已选元素
// const LOCAL_THRID_CONT_DATA = 'localThridContData' // 三级原本元素
// const QUANTITY_FIELD = 'quantity' // 计算的字段
class EditThirdLevelPage extends Component {
......@@ -107,9 +108,9 @@ class EditThirdLevelPage extends Component {
let { data } = sur_line_search
topProcOptionList = cloneObject(defalutTopItem)
topProcOptionList.forEach(function (topIt) {
topIt['localThridContData'] = []
topIt['selectedDataArr'] = []
topIt['selectedQuantity'] = 0
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = []
topIt[LocalVariable.SELECTED_DATA_ARR] = []
topIt[LocalVariable.SELECTED_QUQNTITY] = 0
})
if (data.items) {
topProcOptionList[0].localThridContData = data.items
......@@ -145,9 +146,9 @@ class EditThirdLevelPage extends Component {
let { data } = nail_line_search
topProcOptionList = cloneObject(data.segemt)
topProcOptionList.forEach(function (topIt) {
topIt['localThridContData'] = topIt['details']
topIt['selectedDataArr'] = []
topIt['selectedQuantity'] = 0
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = topIt['details']
topIt[LocalVariable.SELECTED_DATA_ARR] = []
topIt[LocalVariable.SELECTED_QUQNTITY] = 0
})
that.setState({
topProcOptionList: topProcOptionList,
......@@ -172,9 +173,9 @@ class EditThirdLevelPage extends Component {
console.log('res_line_1 : ', equip_line_search)
if (equip_line_search.error_code === 0) {
let { data } = equip_line_search
data['localThridContData'] = data['package_components']
data['selectedDataArr'] = []
data['selectedQuantity'] = 0
data[LocalVariable.LOCAL_THRID_CONT_DATA] = data['package_components']
data[LocalVariable.SELECTED_DATA_ARR] = []
data[LocalVariable.SELECTED_QUQNTITY] = 0
topProcOptionList[0] = cloneObject(data)
that.setState({
topProcOptionList: topProcOptionList,
......@@ -232,13 +233,13 @@ class EditThirdLevelPage extends Component {
setAllSelectData() {
let { topProcOptionList } = this.state
topProcOptionList.map(function (listItem) {
listItem[SELECTED_QUQNTITY] = 0
listItem[SELECTED_DATA_ARR] = []
if (listItem[LOCAL_THRID_CONT_DATA].length) {
listItem[LOCAL_THRID_CONT_DATA].forEach(function (chItem) {
if (chItem[QUANTITY_FIELD]) {
listItem[SELECTED_QUQNTITY] += Number(chItem[QUANTITY_FIELD])
listItem[SELECTED_DATA_ARR].push(chItem)
listItem[LocalVariable.SELECTED_QUQNTITY] = 0
listItem[LocalVariable.SELECTED_DATA_ARR] = []
if (listItem[LocalVariable.LOCAL_THRID_CONT_DATA].length) {
listItem[LocalVariable.LOCAL_THRID_CONT_DATA].forEach(function (chItem) {
if (chItem[LocalVariable.QUANTITY_FIELD]) {
listItem[LocalVariable.SELECTED_QUQNTITY] += Number(chItem[LocalVariable.QUANTITY_FIELD])
listItem[LocalVariable.SELECTED_DATA_ARR].push(chItem)
}
})
}
......@@ -263,7 +264,7 @@ class EditThirdLevelPage extends Component {
let { topProcOptionList, superData } = this.state
let { params } = this.props.navigation.state
// console.log('编辑完成====>', topProcOptionList, params.superData)
// console.log(topProcOptionList[0][LOCAL_THRID_CONT_DATA][0])
// console.log(topProcOptionList[0][LocalVariable.LOCAL_THRID_CONT_DATA][0])
params.childrenPageCallBack(topProcOptionList, superData.superIndex)
this.props.navigation.goBack()
}
......@@ -313,7 +314,7 @@ class EditThirdLevelPage extends Component {
cardItemTitle={curTit}
curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={SELECTED_QUQNTITY}
cardCountName={LocalVariable.SELECTED_QUQNTITY}
cardStyleType={'DEFAULT'}
/>
)
......@@ -339,8 +340,8 @@ class EditThirdLevelPage extends Component {
// } else {
// curData = topProcOptionList[topActiveIndex]
// }
// if (curData && curData[LOCAL_THRID_CONT_DATA]) {
// localThridContData = curData[LOCAL_THRID_CONT_DATA]
// if (curData && curData[LocalVariable.LOCAL_THRID_CONT_DATA]) {
// localThridContData = curData[LocalVariable.LOCAL_THRID_CONT_DATA]
// }
// if (curData && curData.imgIconArr) {
// imgIconArr = curData.imgIconArr
......@@ -356,7 +357,7 @@ class EditThirdLevelPage extends Component {
let imgIconArr = ''
let topItem = topProcOptionList[topActiveIndex]
if (topItem) {
localThridContData = topItem[LOCAL_THRID_CONT_DATA]
localThridContData = topItem[LocalVariable.LOCAL_THRID_CONT_DATA]
}
console.log('底部数据==', topItem, localThridContData)
......@@ -397,25 +398,6 @@ class EditThirdLevelPage extends Component {
let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curCalField = '', curImgIcon = ''
let curTipStrTit = '', curTipOneTit = '', curTipTwoTit = ''
// if (!onlyShow) {
// curImgIcon = 'imgIconArr'
// }
// if (params.superData.leftIndex === 2) {
// // 器械包
// curTit = 'item_name'
// curTipStr = 'category_name'
// curTipOne = 'category_desc'
// curCalField = 'quantity'
// curImgIcon = ''
// // 物料名称、分类名称、分类说明
// } else {
// curTit = 'title'
// curTipStr = 'tip1'
// curTipOne = 'tip2'
// curCalField = 'quantity'
// // curImgIcon = ''
// }
curTit = 'item_name'
curTipStr = 'item_code'
......@@ -424,7 +406,7 @@ class EditThirdLevelPage extends Component {
curTipStrTit = '物料代码'
curTipOneTit = '规格型号'
curTipTwoTit = '通用名称'
curCalField = 'quantity'
curCalField = LocalVariable.QUANTITY_FIELD
curImgIcon = 'photos'
return (
......@@ -433,7 +415,7 @@ class EditThirdLevelPage extends Component {
listItem={item}
listIndex={index}
calField={curCalField}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, LOCAL_THRID_CONT_DATA)}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, LocalVariable.LOCAL_THRID_CONT_DATA)}
titText={curTit}
tipTextStr={curTipStr}
tipTextOne={curTipOne}
......
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