Commit 797e0a2e by Denglingling

对接部分自助下单已有接口,选择产品相关交互调整

(cherry picked from commit ea37a4c6)
parent 9e604b4b
......@@ -18,7 +18,7 @@ export function requestQuickOrganizations(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
.then(res => {
console.log('res=====', Object.keys(res), res);
console.log('获取组织 res=====', res);
if(res.error_code == 0) {
let { data: { organizations } } = res
dispatch(requestListDataSuccess(organizations));
......@@ -32,7 +32,7 @@ export function requestQuickOrganizations(params) {
}
})
.catch(err => {
console.log('------err--====organizations----', Object.keys(err), err)
console.log('------err--获取组织----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
......@@ -46,6 +46,7 @@ export function requestQuickSurgeryHospital(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/sale/seller_customer/search', params))
.then(res => {
console.log('获取客户名称 res=====', res);
if(res.error_code == 0) {
let { data: { customers } } = res
dispatch(requestListDataSuccess(customers));
......@@ -59,7 +60,7 @@ export function requestQuickSurgeryHospital(params) {
}
})
.catch(err => {
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
console.log('------err--====获取客户名称----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
......@@ -77,6 +78,7 @@ export function requestQuickOrderType(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
.then(res => {
console.log('获取订单类型 res=====', res);
if(res.error_code == 0) {
let { data: { sys_values } } = res
dispatch(requestListDataSuccess(sys_values));
......@@ -90,7 +92,7 @@ export function requestQuickOrderType(params) {
}
})
.catch(err => {
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
console.log('------err--====获取订单类型----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
......@@ -104,7 +106,7 @@ export function requestQuickTemplateCollect(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/template_header/search', params))
.then(res => {
console.log('res==>', res)
console.log('获取配台模板 res=====', res);
if(res.error_code == 0) {
let { data: { surgery_template_headers } } = res
dispatch(requestListDataSuccess(surgery_template_headers));
......@@ -118,7 +120,7 @@ export function requestQuickTemplateCollect(params) {
}
})
.catch(err => {
console.log('------err--====requestQuickTemplateCollect----', Object.keys(err), err)
console.log('------err--====获取配台模板----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
......@@ -132,6 +134,7 @@ export function requestQuickSurgeryType(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
.then(res => {
console.log('获取手术类型 res=====', res);
if(res.error_code == 0) {
let typeOption = []
let { data: { value_set_code, sys_values } } = res
......@@ -149,7 +152,7 @@ export function requestQuickSurgeryType(params) {
}
})
.catch(err => {
console.log('------err--====requestQuickSurgeryType----', Object.keys(err), err)
console.log('------err--====获取手术类型----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
......@@ -193,6 +196,7 @@ export function requestQuickSumbit({access_token, ...params}) {
let {global_domain_config} = getState().login
PostRequest(global_domain_config, getUrlParams('/surgery/collect_order/via_data/create', {access_token: access_token}), params)
.then(res => {
console.log('提交数据 res=====', res);
if(res.error_code == 0) {
let { data } = res
dispatch(requestSubmitSuccess(data));
......@@ -206,7 +210,7 @@ export function requestQuickSumbit({access_token, ...params}) {
}
})
.catch(err => {
console.log('------err--====requestQuickSumbit----', Object.keys(err), err)
console.log('------err--====提交数据----', Object.keys(err), err)
show(err.error);
dispatch(requestSubmitFail());
})
......
import React, { Component } from 'react';
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 { AsteriskTextStyle, CellTextStyle, ContInputTextStyle, ContTextStyle, ImageTextStyle, TitleTextStyle } from '../CellTextStyle';
import DialogModel from '../DialogModel';
const PropTypes = require('prop-types');
/**
* 页面组件,可含选择器
*/
class PageListArrow extends Component {
static propTypres = {
listActOpa: PropTypes.number,
listCallBack: PropTypes.func, // 点击后的回调函数
listHasAster: PropTypes.bool, // 是否必填
listEditAble: PropTypes.bool,
listDefaValue: PropTypes.string,
listItem: PropTypes.object,
listTitle: PropTypes.string,
listName: PropTypes.string,
listHasArrow: PropTypes.bool,
}
constructor(props) {
super(props);
this.state = {
listCurrentOption: [],
currentItem: {
name: '请选择',
value: ''
},
currentTitle: '组织', // 当前点击项
showTypePop: false, // 选择器弹窗
}
}
// 返回选择器弹窗
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() {
let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle, listHasArrow} = this.props
return (
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={listActOpa}
onPress={() => listCallBack()}
>
<CellTextStyle>
{ listHasAster ? <AsteriskTextStyle>*</AsteriskTextStyle> : null }
<TitleTextStyle>{listItem[listTitle]}</TitleTextStyle>
{ listEditAble ? <ContInputTextStyle editable={listEditAble} defaultValue={listItem[listDefaValue]} />
: <ContTextStyle>{listItem[listName]}</ContTextStyle>
}
{ listHasArrow ? <ImageTextStyle> <Image source={require('../../images/arr_rig.png')} style={icon_style}/>
</ImageTextStyle> : null}
</CellTextStyle>
</TouchableOpacity>
{ this.renderPickerModel() }
</View>
);
}
}
const styles = StyleSheet.create({
item_container: {
flex: 1
}
})
export default PageListArrow;
\ No newline at end of file
import React, { Component } from 'react';
import { StyleSheet, Image, Text, TouchableOpacity, View } from 'react-native';
import { first_text_color, font_family_light, font_family_medium, font_family_regular, font_family_semibold, home_background_color, icon_style, promary_text_color, pxSize, second_text_size, third_text_color, third_text_size } from '../../../base/BaseStyle';
import PictureZoom from '../../common/listDataComponent/PictureZoom';
const PropTypes = require('prop-types');
class PicTitDetaiCalcu extends Component {
......@@ -93,7 +94,7 @@ class PicTitDetaiCalcu extends Component {
calIcon = require('../../../images/plur_big_act.png')
}
console.log('每一列----',showClearIcon, listCardActIndex, showClearIndex, (showClearIcon && listIndex === showClearIndex))
console.log('每一列----',listItem[listImgIcon], listItem[listImgIcon] instanceof Array)
return (
......@@ -148,9 +149,18 @@ class PicTitDetaiCalcu extends Component {
<View style={[styles.ri_inner, listStyleBox]}>
{ listImgIcon ?
{/* { listImgIcon ?
<View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
<Image style={icon_style} source={listItem.imgIcon}/>
<Image style={icon_style} source={listItem[listImgIcon]}/>
</View> : null } */}
{ (listImgIcon && listItem[listImgIcon] instanceof Array) ?
<PictureZoom
listImageIndex={0}
listImageUrls={listItem[listImgIcon]}
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
......@@ -161,10 +171,10 @@ class PicTitDetaiCalcu extends Component {
<Text numberOfLines={1} style={[styles.thr_ot, listStyleTit]}>
{ listItem[titText] }
</Text>
{ listItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>{listItem[tipTextStr]}</Text> : null }
{ listItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextOne]}</Text> : null }
{ listItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextTwo]}</Text> : null }
</TouchableOpacity>
{ listItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>{listItem[tipTextStr]}</Text> : null }
{ listItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextOne]}</Text> : null }
{ listItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextTwo]}</Text> : null }
</View>
{
(showClearIcon && listCardActIndex === showClearIndex) ?
......
......@@ -62,16 +62,12 @@ class ChooseProductPage extends Component {
leftOptionList: [], // 左侧分类数据
defaultThridShow: false, // 默认人体髋关节-小类不显示
selectShowPopup: false, // 共计已选弹窗
// SELECTED_QUQNTITY: 'selectedQuantity', // 中类数量
// SELECTED_DATA_ARR: 'selectedDataArr', // 中类已选元素
// DEFAULT_SECOND_DATA: 'localSecondData', // 中类原本元素
// allCountQuantity: 0
}
}
componentDidMount() {
// console.log('本地测试数据====localMockData===', localMockData)
// 赋值测试数据
// 赋值本地测试数据
this.setState({
topProcOptionList: cloneObject(localMockData.localTopProcOption),
leftOptionList: cloneObject(localMockData.localLeftOption)
......@@ -93,7 +89,6 @@ class ChooseProductPage extends Component {
this.setState({
leftActiveIndex: index,
// rightSecondData: leftOptionList[index][DEFAULT_SECOND_DATA] // 本地数据
// rightSecondData: leftOptionList[index].localSecondData // 本地数据
})
}
......@@ -124,23 +119,9 @@ class ChooseProductPage extends Component {
leItem[SELECTED_DATA_ARR] = []
}
if(leIndex === leftActiveIndex) {
// console.log('外面 childData----', childData)
if(leItem[DEFAULT_SECOND_DATA].length && leItem[DEFAULT_SECOND_DATA][superIndex] && childData.length){
// leItem[DEFAULT_SECOND_DATA][superIndex]
// let superTip = ''
let sumCount = 0
// console.log('childData----', childData)
childData.map((chDa, chInd) => {
// let splitStr = ' / '
// if(chInd === childData.length - 1){
// splitStr = ''
// }
// superTip += `${chDa.title}x${chDa.selectedQuantity}${splitStr}`
if(!chDa[DEFAULT_FIELD]){
chDa[DEFAULT_FIELD] = 0
}
......@@ -159,7 +140,6 @@ class ChooseProductPage extends Component {
lineOptions: childData,
[DEFAULT_FIELD]: sumCount
}
// 初始化
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME] = []
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME].push(curObj)
......@@ -167,12 +147,9 @@ class ChooseProductPage extends Component {
}
// 初始化
leItem[SELECTED_QUQNTITY] = 0
leItem[SELECTED_DATA_ARR] = []
if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA
leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) {
if(chItem[DEFAULT_FIELD] > 0){
......@@ -181,19 +158,6 @@ class ChooseProductPage extends Component {
}
})
}
// // 当前选择项
// leItem[SELECTED_QUQNTITY] = count
// if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA
// leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) {
// if(chItem[coutFieName]){
// leItem[SELECTED_DATA_ARR].push(chItem)
// }
// })
// }
}
})
// console.log('计算三级之后数据---', leftOptionList)
......@@ -204,9 +168,8 @@ class ChooseProductPage extends Component {
// 计算中级数量回调
handleChangeCount(count, coutFieName) {
let {leftActiveIndex, leftOptionList, defaultThridShow, rightSecondData} = this.state
console.log('计算中级数量回调===', count, leftActiveIndex, defaultThridShow, rightSecondData, coutFieName)
let {leftActiveIndex, leftOptionList, defaultThridShow} = this.state
// console.log('计算中级数量回调===', count, leftActiveIndex, defaultThridShow, coutFieName)
leftOptionList[leftActiveIndex][SELECTED_QUQNTITY] = 0
leftOptionList[leftActiveIndex][SELECTED_DATA_ARR] = []
......@@ -347,7 +310,7 @@ class ChooseProductPage extends Component {
// 返回右侧二级元素
renderContItem() {
let { leftOptionList, leftActiveIndex, defaultThridShow, rightSecondData } = this.state
let { leftOptionList, leftActiveIndex, defaultThridShow } = this.state
let curRigSecoOption = []
if(leftOptionList[leftActiveIndex]){
......@@ -364,7 +327,6 @@ class ChooseProductPage extends Component {
superIndex={leftActiveIndex}
defaultThridShow={defaultThridShow}
changeThrShow={(defaultThridShow) => this.handleChangeThrShow(defaultThridShow)}
// superStencilData={rightSecondData}
superStencilData={curRigSecoOption}
superCallBack={(count, coutFieName) => this.handleChangeCount(count, coutFieName)}
superReduceBack={() => this.handleSubSelected()}
......@@ -378,11 +340,8 @@ class ChooseProductPage extends Component {
// 返回底部按钮
renderFooterBtnItem() {
let {selectShowPopup, leftOptionList} = this.state
let allCountQuantity = this.getAllCountQuantity()
console.log('左侧数据----', leftOptionList)
// console.log('左侧数据----', leftOptionList)
return (
<View style={list_common_item.sub_box}>
<View style={list_common_item.sub_two_btn}>
......@@ -416,7 +375,6 @@ class ChooseProductPage extends Component {
render() {
let {navigation} = this.props
let {title} = navigation.state.params
// console.warn('zzxd----', navigation)
return (
<View style={styles.choo_container}>
<StatusBarView
......@@ -429,9 +387,7 @@ class ChooseProductPage extends Component {
<View style={styles.choo_main}>
{/* {this.renderSearchItem()} */}
{this.renderTopProItem()}
{this.renderContItem()}
</View>
{this.renderFooterBtnItem()}
</SafeAreaView>
......@@ -458,13 +414,13 @@ const styles = StyleSheet.create({
borderBottomWidth: 1
},
top_scroll_cont: {},
top_touch_cont: {},
// top_touch_cont: {},
top_inner: {
borderBottomColor: foundation_color,
minWidth: 60
},
top_inner_act: {},
top_img_box: {},
// top_img_box: {},
top_tit: {},
top_tit_act: {},
cont_bom_box: {
......
......@@ -56,7 +56,6 @@ class EditThirdLevelPage extends Component {
let that = this
// console.log('本地测试数据====localMockData===', localMockData)
// console.log('父组件传递的值==', params)
// 赋值测试数据
this.setState({
topProcOptionList: cloneObject(localMockData.localThridOption)
......@@ -118,11 +117,8 @@ class EditThirdLevelPage extends Component {
handleSubmit() {
let {topProcOptionList} = this.state
let {params} = this.props.navigation.state
// console.log('编辑完成====>', topProcOptionList, params.superData)
// console.log(topProcOptionList[0][DEFAULT_SECOND_DATA][0])
params.childrenPageCallBack(topProcOptionList, params.superData.superIndex)
this.props.navigation.goBack()
}
......@@ -154,7 +150,6 @@ class EditThirdLevelPage extends Component {
// 返回底部主要元素
renderContItem() {
let {topProcOptionList, topActiveIndex} = this.state
let curData = topProcOptionList[topActiveIndex]
// 本地测试数据
let localThridContData = []
......@@ -205,7 +200,8 @@ class EditThirdLevelPage extends Component {
titText={'title'}
tipTextStr={'tip1'}
tipTextOne={'tip2'}
listImgIcon={'imgIcon'}
// listImgIcon={'imgIcon'}
listImgIcon={'imgIconArr'}
listPicType={'ROUND'}
listStyleBox={styles.list_style_box}
/>
......
......@@ -48,8 +48,8 @@ export default selfOrder = (state = defaultState, action) => {
case SELF_INIT_DATA:
return Object.assign({}, state, {
// 初始化数据
self_list_status: QUICK_ORDER_LIST_NO,
submit_self_order_status: QUICK_SUBMIT_NO,
self_list_status: SELF_ORDER_LIST_NO,
submit_self_order_status: SELF_SUBMIT_NO,
selfOrderOption: {}
})
default:
......
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