Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ce9edb33
authored
Dec 14, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
对接自助下单已有接口数据,以及修改部分交互
parent
ea37a4c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
340 additions
and
359 deletions
app/containers/common/CellTextStyle.js
app/containers/common/DateModel.js
app/containers/common/listDataComponent/PageListArrow.js
app/containers/selfOrder/SelfOrderPage.js
app/containers/selfOrder/module/EditThirdLevelPage.js
app/containers/common/CellTextStyle.js
View file @
ce9edb33
...
...
@@ -99,15 +99,15 @@ const styles = StyleSheet.create({
marginBottom
:
18
},
btn_cont
:
{
paddingHorizontal
:
2
6
paddingHorizontal
:
2
0
},
sub_btn_box
:
{
backgroundColor
:
dis_sub_color
,
height
:
52
,
height
:
48
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginBottom
:
14
,
marginBottom
:
26
,
borderRadius
:
10
},
sub_btn
:
{
...
...
app/containers/common/DateModel.js
View file @
ce9edb33
...
...
@@ -135,8 +135,8 @@ class DateModel extends Component {
onRequestClose
=
{()
=>
this
.
handleCloseModal
()}
>
<
SafeAreaView
style
=
{
safe_view
}
>
<
TouchableOpacity
style
=
{
styles
.
container
}
activeOpacity
=
{
1
}
//
onPress={() => this.handleCloseModal()}
>
onPress
=
{()
=>
this
.
handleCloseModal
()}
>
{
this
.
renderDialog
()}
<
/TouchableOpacity
>
<
/SafeAreaView
>
...
...
app/containers/common/listDataComponent/PageListArrow.js
View file @
ce9edb33
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
{
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
DialogModel
from
'../DialogModel'
;
const
PropTypes
=
require
(
'prop-types'
);
/**
...
...
@@ -20,6 +19,12 @@ class PageListArrow extends Component {
listTitle
:
PropTypes
.
string
,
listName
:
PropTypes
.
string
,
listHasArrow
:
PropTypes
.
bool
,
listOtherInput
:
PropTypes
.
string
,
otherInput
:
PropTypes
.
string
,
otherInputCallBack
:
PropTypes
.
func
,
listInputPlace
:
PropTypes
.
string
,
inputCallBack
:
PropTypes
.
func
,
isTitInputStyle
:
PropTypes
.
bool
}
constructor
(
props
)
{
...
...
@@ -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
()
{
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
(
<
View
style
=
{
styles
.
item_container
}
>
<
TouchableOpacity
activeOpacity
=
{
listActOpa
}
onPress
=
{()
=>
listCallBack
()
}
onPress
=
{()
=>
{
return
listCallBack
?
listCallBack
()
:
''
}
}
>
<
CellTextStyle
>
{
listHasAster
?
<
AsteriskTextStyle
>*<
/AsteriskTextStyle> : null
}
<
TitleTextStyle
>
{
listItem
[
listTitle
]}
<
/TitleTextStyle
>
{
listEditAble
?
<
ContInputTextStyle
editable
=
{
listEditAble
}
defaultValue
=
{
listItem
[
listDefaValue
]}
/>
:
<
ContTextStyle
>
{
listItem
[
listName
]}
<
/ContTextStyle
>
<
TitleTextStyle
style
=
{
isTitInputStyle
?
styles
.
cell_title
:
''
}
>
{
listItem
[
listTitle
]}
<
/TitleTextStyle
>
{
(
listEditAble
||
inputCallBack
)
?
<
ContInputTextStyle
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
}
/
>
<
/ImageTextStyle> : null
}
{
listHasArrow
?
<
View
style
=
{
styles
.
arr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/View> : null
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
{
this
.
renderPickerModel
()
}
{
(
listOtherInput
&&
listItem
[
otherInput
])
?
<
CellTextStyle
>
<
ContInputTextStyle
style
=
{
styles
.
cell_input
}
placeholder
=
{
listOtherInput
}
onChangeText
=
{(
text
)
=>
otherInputCallBack
(
text
)}
><
/ContInputTextStyle
>
<
/CellTextStyle> : null
}
<
/View
>
);
}
...
...
@@ -80,7 +80,29 @@ class PageListArrow extends Component {
const
styles
=
StyleSheet
.
create
({
item_container
:
{
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
;
\ No newline at end of file
app/containers/selfOrder/SelfOrderPage.js
View file @
ce9edb33
...
...
@@ -44,7 +44,6 @@ import StatusBarView from '../common/StatusBarView';
import
DialogModel
from
'../common/DialogModel'
;
import
LodingModel
from
'../common/LodingModel'
;
import
DateModel
from
'../common/DateModel'
;
import
DatePicker
from
'react-native-date-picker'
;
import
{
AudioRecorder
,
AudioUtils
}
from
'react-native-audio'
;
import
Sound
from
'react-native-sound'
;
import
{
...
...
@@ -69,13 +68,13 @@ import {
SELF_SUBMIT_SUCCESS
,
SELF_SUBMIT_FAILURE
}
from
'../../base/ActionTypes'
;
import
tagData
from
'./module/mock/listTagData
'
;
import
PageListArrow
from
'../common/listDataComponent/PageListArrow
'
;
class
SelfOrderPage
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
canSubFlag
:
tru
e
,
// 生成订单按钮样式改变
canSubFlag
:
fals
e
,
// 生成订单按钮样式改变
listOptionData
:
[
// 备注以上的元素
{
"id"
:
"0"
,
...
...
@@ -206,31 +205,8 @@ class SelfOrderPage extends Component {
}
componentDidMount
()
{
this
.
getSellerName
()
this
.
getAudioAuthorize
()
// // 请求授权
// AudioRecorder.requestAuthorization()
// .then(isAuthor => {
// console.warn('是否授权: ' + isAuthor)
// if(!isAuthor) {
// return alert('请前往设置开启录音权限')
// }
// this.setState({hasPermission: isAuthor})
// this.prepareRecordingPath(this.state.audioPath);
// // 录音进展
// AudioRecorder.onProgress = (data) => {
// this.setState({currentTime: Math.floor(data.currentTime)});
// };
// // 完成录音
// AudioRecorder.onFinished = (data) => {
// // data 返回需要上传到后台的录音数据
// console.warn(this.state.currentTime)
// console.warn(data)
// };
// })
}
// 赋值销售员 初始化数据
...
...
@@ -313,7 +289,7 @@ class SelfOrderPage extends Component {
// 开始录音
_record
=
async
()
=>
{
console
.
warn
(
'开始录音=='
)
console
.
log
(
'开始录音=='
)
// show('录音开始')
// if(!this.state.hasPermission) {
...
...
@@ -364,34 +340,6 @@ class SelfOrderPage extends Component {
}
}
// 暂停录音
// _pause = async () => {
// if(!this.state.recording) {
// return alert('当前未录音')
// }
// try {
// await AudioRecorder.pauseRecording()
// this.setState({pause: true, recording: false})
// } catch (err) {
// console.log(err)
// }
// }
// 恢复录音
// _resume = async () => {
// if(!this.state.pause) {
// return alert('录音未暂停')
// }
// try {
// await AudioRecorder.resumeRecording();
// this.setState({pause: false, recording: true})
// } catch (err) {
// console.log(err)
// }
// }
// 停止录音
_stop
=
async
()
=>
{
console
.
log
(
'----停止录音---'
,
this
.
state
.
hasPermission
)
...
...
@@ -406,9 +354,9 @@ class SelfOrderPage extends Component {
}
catch
(
error
)
{
console
.
log
(
'stop record--error->'
,
error
);
}
// console.
warn
('tanqi')
// console.
log
('tanqi')
// show('录音结束')
// console.
warn
('停止录音',this.state.currentTime)
// console.
log
('停止录音',this.state.currentTime)
// try {
// await AudioRecorder.stopRecording();
// this.setState({stop: true, recording: false, paused: false});
...
...
@@ -439,13 +387,13 @@ class SelfOrderPage extends Component {
// self.whoosh = new Sound(this.state.audioPath, '', (err) => {
// if(err) {
// show('加载音频失败')
// return console.
warn
(err)
// return console.
log
(err)
// }
// self.whoosh.play(success => {
// if(success) {
// console.
warn
('success - 播放成功')
// console.
log
('success - 播放成功')
// }else {
// console.
warn
('fail - 播放失败')
// console.
log
('fail - 播放失败')
// show('播放失败')
// }
// })
...
...
@@ -454,10 +402,10 @@ class SelfOrderPage extends Component {
// 停止播放录音 -- 安卓不能停止、ios可以
// _stopPlay = async () => {
// console.
warn
('tingzhi bofang')
// console.
log
('tingzhi bofang')
// let self = this
// self.whoosh.stop(() => {
// console.
warn
('success - 停止成功')
// console.
log
('success - 停止成功')
// })
// }
...
...
@@ -474,21 +422,6 @@ class SelfOrderPage extends Component {
})
}
// static getDerivedStateFromProps(newProps, prevState) {
// console.log('--prevState-----', newProps.selfOrderOption)
// console.log('--prevState-----', newProps.self_list_status)
// console.log('-prevState------', prevState.self_list_status)
// }
// componentDidUpdate(prevProps, prevState) {
// console.log('--componentDidUpdate-----', prevProps.selfOrderOption)
// console.log('--componentDidUpdate-----', prevProps.self_list_status)
// console.log('this.props-------', this.props.self_list_status)
// console.log('-componentDidUpdate------', prevState.self_list_status)
// }
componentWillReceiveProps
(
nextProps
)
{
let
{
self_list_status
,
loginState
,
navigation
,
submit_self_order_status
}
=
this
.
props
let
self
=
this
...
...
@@ -543,8 +476,8 @@ class SelfOrderPage extends Component {
}
// let self = this
// if(self_list_status != nextProps.self_list_status) {
// // console.
warn
('-222------', nextProps.self_list_status)
// // console.
warn
('--222---self_list_status--', self_list_status)
// // console.
log
('-222------', nextProps.self_list_status)
// // console.
log
('--222---self_list_status--', self_list_status)
// switch (nextProps.self_list_status) {
// case SELF_ORDER_LIST_DOING:
// this.changeSubLoding(true)
...
...
@@ -571,8 +504,6 @@ class SelfOrderPage extends Component {
})
}
// 清空当前项以下的值
clearInitNameAndValue
(
curIndex
)
{
let
{
listOptionData
,
localOtherObj
}
=
this
.
state
...
...
@@ -582,19 +513,19 @@ class SelfOrderPage extends Component {
if
(
index
>
curIndex
&&
index
<
12
)
{
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
//
if(listOptionData[1].value && item.title == '客户名称') {
//
that.organizationGetCustomerData()
//
}
//
if(listOptionData[2].value && item.title == '收单地点') {
//
that.customerGetBill()
//
}
//
if(listOptionData[2].value && item.title == '收货地点') {
//
that.customerGetShip()
//
}
//
if(item.title == '主治医生') {
//
item.showInput = false,
//
item.inputValue = ''
//
}
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
that
.
organizationGetCustomerData
()
}
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收单地点'
)
{
that
.
customerGetBill
()
}
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收货地点'
)
{
that
.
customerGetShip
()
}
if
(
item
.
title
==
'主治医生'
)
{
item
.
showInput
=
false
,
item
.
inputValue
=
''
}
}
return
item
})
...
...
@@ -627,34 +558,31 @@ class SelfOrderPage extends Component {
// 选择器弹窗回调函数
handleCallBack
(
item
,
itemTitle
)
{
// console.
warn
('选择器弹窗回调函数-----',itemTitle)
// console.
log
('选择器弹窗回调函数-----',itemTitle)
let
{
listOptionData
}
=
this
.
state
let
self
=
this
listOptionData
.
map
(
function
(
chItem
,
index
){
if
(
chItem
.
title
===
itemTitle
)
{
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
// if(itemTitle === '组织') {
// self.clearInitNameAndValue(1)
// }
// if(itemTitle === '客户名称') {
// self.clearInitNameAndValue(2)
// }
// if (itemTitle === '主治医生') {
// if(item.name === '其他') {
// chItem.showInput = true
// } else {
// chItem.showInput = false
// chItem.inputValue = ''
// }
// self.clearInitNameAndValue(5)
// }
// if(itemTitle === '手术类型') {
// self.clearInitNameAndValue(6)
// }
// if (itemTitle === '手术模板') {
// listOptionData[10].value = item.desc
// }
if
(
itemTitle
===
'组织'
)
{
self
.
clearInitNameAndValue
(
1
)
}
if
(
itemTitle
===
'客户名称'
)
{
self
.
clearInitNameAndValue
(
2
)
}
if
(
itemTitle
===
'主治医生'
)
{
if
(
item
.
name
===
'其他'
)
{
chItem
.
showInput
=
true
}
else
{
chItem
.
showInput
=
false
chItem
.
inputValue
=
''
}
self
.
clearInitNameAndValue
(
5
)
}
if
(
itemTitle
===
'手术类型'
)
{
self
.
clearInitNameAndValue
(
8
)
}
}
})
this
.
setState
({
...
...
@@ -709,22 +637,7 @@ class SelfOrderPage extends Component {
resultArr
.
push
(
obj
)
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'手术模板'
)
{
let
resultArr
=
[]
selfOrderOption
.
forEach
(
item
=>
{
let
obj
=
{}
let
tempName
=
item
.
template_name
if
(
item
.
doctor_name
)
{
tempName
+=
`——
${
item
.
doctor_name
}
`
}
obj
.
name
=
tempName
obj
.
value
=
item
.
template_number
obj
.
desc
=
item
.
template_desc
obj
.
template_pic
=
item
.
template_pic
resultArr
.
push
(
obj
)
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'订单类型'
)
{
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
this
.
changeNameAndValue
(
selfOrderOption
,
'value_name'
,
'value_code'
)
}
this
.
setState
({
...
...
@@ -740,7 +653,7 @@ class SelfOrderPage extends Component {
// let { listOptionData, currentTitle } = this.state
// let { selfOrderOption } = this.props
// console.
warn
('当前:--selfOrderOption---', selfOrderOption)
// console.
log
('当前:--selfOrderOption---', selfOrderOption)
// let tempOption = []
// if (currentTitle === '组织') {
// tempOption = this.changeNameAndValue(selfOrderOption, 'org_name', 'org_code')
...
...
@@ -864,13 +777,14 @@ class SelfOrderPage extends Component {
}
// 组织 点击
handleOrganizationCheck
()
{
let
{
state
,
props
}
=
this
handleOrganizationCheck
(
curData
)
{
console
.
log
(
curData
)
let
{
props
}
=
this
this
.
setState
({
currentTitle
:
'组织'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
state
.
listOptionData
[
1
]
.
name
,
value
:
state
.
listOptionData
[
1
]
.
value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
let
params
=
{
...
...
@@ -880,7 +794,7 @@ class SelfOrderPage extends Component {
})
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('组织------check', token, requestSelfOrganizations)
// console.
log
('组织------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
...
...
@@ -895,15 +809,15 @@ class SelfOrderPage extends Component {
}
// 客户名称 点击
handleCustomerCheck
()
{
let
{
state
,
props
}
=
this
handleCustomerCheck
(
curData
)
{
//
let { state, props } = this
let
self
=
this
if
(
this
.
judgeOrgIsNull
())
{
self
.
setState
({
currentTitle
:
'客户名称'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
state
.
listOptionData
[
2
]
.
name
,
value
:
state
.
listOptionData
[
2
]
.
value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
// 在此修改接口
...
...
@@ -912,7 +826,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('客户名称------check', token, requestSelfOrganizations)
// console.
log
('客户名称------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
...
...
@@ -977,15 +891,15 @@ class SelfOrderPage extends Component {
}
// 收单地点 点击
handleBillCheck
()
{
handleBillCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'收单地点'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
listOptionData
[
3
]
.
name
,
value
:
listOptionData
[
3
]
.
value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
let
tempOption
=
[]
...
...
@@ -1009,7 +923,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('收单地点------check', token, requestSelfOrganizations)
// console.
log
('收单地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收单地点',
...
...
@@ -1041,15 +955,15 @@ class SelfOrderPage extends Component {
}
// 收货地点 点击
handleShipCheck
()
{
handleShipCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'收货地点'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
listOptionData
[
4
]
.
name
,
value
:
listOptionData
[
4
]
.
value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
let
tempOption
=
[]
...
...
@@ -1073,7 +987,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('收货地点------check', token, requestSelfOrganizations)
// console.
log
('收货地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收货地点',
...
...
@@ -1104,17 +1018,17 @@ class SelfOrderPage extends Component {
}
}
// 主治医生 点击
/输入
handleDoctorCheck
()
{
// 主治医生 点击
handleDoctorCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
// 点击
self
.
setState
({
currentTitle
:
'主治医生'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
listOptionData
[
5
]
.
name
,
value
:
listOptionData
[
5
]
.
value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
let
tempOption
=
[]
...
...
@@ -1143,7 +1057,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('主治医生------check', token, requestSelfOrganizations)
// console.
log
('主治医生------check', token, requestSelfOrganizations)
// let self = this
// if(text) {
// // 输入
...
...
@@ -1169,51 +1083,50 @@ class SelfOrderPage extends Component {
// })
// }
// console.
warn
('主治医生------check',listOptionData[5])
// console.
log
('主治医生------check',listOptionData[5])
}
// 主治医生 输入
handleDoctorInput
(
text
)
{
handleDoctorInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
inputValue
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
item
=>
{
if
(
item
.
title
===
'主治医生'
)
{
item
.
inputValue
=
text
}
return
item
})
listOptionData
:
listOptionData
})
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
5
])
}
// 手术名称 输入
handleSurNameInput
(
text
)
{
console
.
warn
(
'手术名称---'
,
text
)
handleSurNameInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
value
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
item
=>
{
if
(
item
.
title
===
'手术名称'
)
{
item
.
value
=
text
}
return
item
})
listOptionData
:
listOptionData
})
// console.warn('手术名称---'
,listOptionData[6])
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
6
])
}
// 手术时间 点击 2020-04-23 17:41
handleSurDateCheck
()
{
console
.
warn
(
'手术时间 点击 ==='
)
handleSurDateCheck
(
curData
)
{
console
.
log
(
'手术时间 点击 ==='
,
curData
)
let
{
listOptionData
}
=
this
.
state
let
date
=
listOptionData
[
7
]
.
value
let
date
=
curData
.
value
if
(
date
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
dateValue
=
formatStrForDate
(
date
)
}
})
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
item
.
title
===
'手术时间'
)
{
item
.
dateValue
=
formatStrForDate
(
date
)
}
return
item
})
listOptionData
:
listOptionData
})
// console.warn('!date----', listOptionData[7])
}
this
.
closeDateModal
(
true
)
}
...
...
@@ -1226,33 +1139,32 @@ class SelfOrderPage extends Component {
}
// 修改当前日期数据
dateModalCallback
(
date
)
{
console
.
warn
(
'callback'
,
date
)
dateModalCallback
(
date
,
curData
)
{
console
.
log
(
'修改当前日期数据:'
,
date
,
curData
)
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
){
if
(
item
.
title
===
curData
.
title
){
item
.
name
=
date
item
.
value
=
date
item
.
dateValue
=
formatStrForDate
(
date
)
}
})
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
item
.
title
===
'手术时间'
)
{
item
.
name
=
date
item
.
value
=
date
item
.
dateValue
=
formatStrForDate
(
date
)
}
return
item
})
listOptionData
:
listOptionData
})
// console.warn
('-----', listOptionData[7])
console
.
log
(
'-----'
,
listOptionData
[
7
])
}
// 手术类型 点击
handleSurTypeCheck
()
{
let
{
listOptionData
}
=
this
.
state
handleSurTypeCheck
(
curData
)
{
let
{
props
}
=
this
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'手术类型'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
// name: listOptionData[6]
.name,
// value: listOptionData[6]
.value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
let
params
=
{
...
...
@@ -1264,7 +1176,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('手术类型------check', token, requestSelfOrganizations)
// console.
log
('手术类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '手术类型',
...
...
@@ -1279,14 +1191,14 @@ class SelfOrderPage extends Component {
}
// 订单类型 点击
handleOrderCheck
()
{
handleOrderCheck
(
curData
)
{
let
{
state
,
props
}
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
this
.
setState
({
currentTitle
:
'订单类型'
,
currentTitle
:
curData
.
title
,
currentItem
:
{
// name: state.listOptionData[9]
.name,
// value: state.listOptionData[9]
.value
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
// 在此修改接口
...
...
@@ -1299,7 +1211,7 @@ class SelfOrderPage extends Component {
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.
warn
('订单类型------check', token, requestSelfOrganizations)
// console.
log
('订单类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '订单类型',
...
...
@@ -1319,39 +1231,22 @@ class SelfOrderPage extends Component {
}
// 备注 输入
handleRemarkInput
(
text
)
{
console
.
warn
(
'备注---'
,
text
)
handleRemarkInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
){
if
(
item
.
title
===
curData
.
title
){
item
.
value
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
item
=>
{
if
(
item
.
title
===
'备注'
)
{
item
.
value
=
text
}
return
item
})
listOptionData
:
listOptionData
})
console
.
warn
(
'备注---'
,
listOptionData
[
11
])
console
.
log
(
'备注---'
,
listOptionData
[
11
])
}
// 录音 长按
handleRecordLongCheck
()
{
console
.
warn
(
'changan'
)
show
(
'录音开始'
)
// this._record()
}
// 录音结束
handleRecordPressOut
()
{
console
.
warn
(
'tanqi'
)
show
(
'录音结束'
)
// this._stop
}
// 生成订单 点击
handleSubmit
()
{
console
.
warn
(
'生成订单'
,
this
.
props
.
navigation
)
console
.
log
(
'生成订单'
,
this
.
props
.
navigation
)
// this.changeCanSub(true)
// let { state, props } = this
// let that = this
...
...
@@ -1509,26 +1404,18 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
// console.warn('!!===',tagData)
// console.warn('!!===',this.props.userInfo.person_name)
let
{
listOptionData
,
dateModelPop
}
=
this
.
state
let
{
userInfo
:{
person_name
},
navigation
}
=
this
.
props
if
(
!
isEmpty
(
person_name
))
{
tagData
[
0
].
value
=
person_name
// this.setState({
// listOptionData: listOptionData.map(item => {
// if(item.title === '销售员') {
// item.name = person_name
// item.value = person_name
// }
// return item
// })
// })
}
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
View
style
=
{
styles
.
item_container
}
>
<
PageListArrow
listActOpa
=
{
1
}
listEditAble
=
{
true
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
0
]}
listDefaValue
=
{
'name'
}
listTitle
=
{
'title'
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
// onPress={() => this.handleOpenDialog()}
...
...
@@ -1539,8 +1426,18 @@ class SelfOrderPage extends Component {
<ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrganizationCheck()}
...
...
@@ -1552,11 +1449,21 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
2
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleCustomerCheck
(
listOptionData
[
2
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress
=
{()
=>
this
.
handleCustomerCheck
()}
onPress={() => this.handleCustomerCheck(
listOptionData[2]
)}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
...
...
@@ -1565,8 +1472,18 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
3
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleBillCheck
(
listOptionData
[
3
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleBillCheck()}
...
...
@@ -1578,8 +1495,18 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
4
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleShipCheck
(
listOptionData
[
4
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleShipCheck()}
...
...
@@ -1591,8 +1518,21 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
5
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleDoctorCheck
(
listOptionData
[
5
])}
listHasArrow
=
{
true
}
listOtherInput
=
{
'请输入主治医生'
}
otherInput
=
{
'showInput'
}
otherInputCallBack
=
{(
text
)
=>
this
.
handleDoctorInput
(
text
,
listOptionData
[
5
])}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleDoctorCheck()}
...
...
@@ -1610,28 +1550,48 @@ class SelfOrderPage extends Component {
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入主治医生`}
onChangeText
=
{(
text
)
=>
this
.
handleDoctor
Check
(
text
)}
onChangeText={(text) => this.handleDoctor
Input
(text)}
></ContInputTextStyle>
</CellTextStyle> : null
}
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listItem
=
{
listOptionData
[
6
]}
listInputPlace
=
{
'请输入'
}
listDefaValue
=
{
'value'
}
listTitle
=
{
'title'
}
inputCallBack
=
{(
text
)
=>
this
.
handleSurNameInput
(
text
,
listOptionData
[
6
])}
isTitInputStyle
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
// onPress={() => this.handleSurNameInput()}
>
<CellTextStyle>
<
TitleTextStyle
>
{
'手术名称'
}
<
/TitleTextStyle
>
<TitleTextStyle
style={styles.cell_title}
>{'手术名称'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={'请输入'}
defaultValue={listOptionData[6].value}
onChangeText={(text) => this.handleSurNameInput(text)}
></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listItem
=
{
listOptionData
[
7
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleSurDateCheck
(
listOptionData
[
7
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurDateCheck()}
...
...
@@ -1642,16 +1602,18 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
DateModel
date
=
{
listOptionData
[
7
].
dateValue
}
closeModal
=
{(
show
)
=>
this
.
closeDateModal
(
show
)}
show
=
{
dateModelPop
}
callback
=
{(
date
)
=>
this
.
dateModalCallback
(
date
)}
/
>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
8
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleSurTypeCheck
(
listOptionData
[
8
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurTypeCheck()}
...
...
@@ -1663,8 +1625,18 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
9
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrderCheck
(
listOptionData
[
9
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrderCheck()}
...
...
@@ -1676,8 +1648,18 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
</View> */
}
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
10
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleProductCheck
(
listOptionData
[
10
])}
listHasArrow
=
{
true
}
/
>
{
/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleProductCheck()}
...
...
@@ -1689,7 +1671,14 @@ class SelfOrderPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<
/View
>
</View> */
}
<
DateModel
date
=
{
listOptionData
[
7
].
dateValue
}
closeModal
=
{(
show
)
=>
this
.
closeDateModal
(
show
)}
show
=
{
dateModelPop
}
callback
=
{(
date
)
=>
this
.
dateModalCallback
(
date
,
listOptionData
[
7
])}
/
>
{
this
.
renderPickerModel
()
}
...
...
@@ -1713,14 +1702,6 @@ class SelfOrderPage extends Component {
return
(
<
SafeAreaView
style
=
{
styles
.
item_container
}
>
<
DialogModel
// entityList={typeArr}
// callback={(i) => {
// this.setState({
// type: i,
// typeName: typeArr[i],
// })
// }}
// itemIndex={this.state.type}
entityList
=
{
listCurrentOption
}
callback
=
{(
item
,
itemTitle
)
=>
this
.
handleCallBack
(
item
,
itemTitle
)}
show
=
{
showTypePop
}
...
...
@@ -1734,6 +1715,7 @@ class SelfOrderPage extends Component {
// 返回备注元素
renderRemarksItem
()
{
let
{
listOptionData
}
=
this
.
state
return
(
<
CellTextStyle
style
=
{
list_common_item
.
remark_item
}
>
<
View
style
=
{
list_common_item
.
rema_box
}
>
...
...
@@ -1749,7 +1731,8 @@ class SelfOrderPage extends Component {
numberOfLines
=
{
8
}
style
=
{
list_common_item
.
rema_Input
}
maxLength
=
{
140
}
onChangeText
=
{(
text
)
=>
this
.
handleRemarkInput
(
text
)}
onChangeText
=
{(
text
)
=>
this
.
handleRemarkInput
(
text
,
listOptionData
[
11
])}
defaultValue
=
{
listOptionData
[
11
].
value
}
/
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -1760,7 +1743,7 @@ class SelfOrderPage extends Component {
// 返回录音元素
renderRecordingItem
()
{
let
{
recording
,
pause
,
stop
,
currentTime
}
=
this
.
state
let
{
stop
,
currentTime
}
=
this
.
state
return
(
<
CellTextStyle
style
=
{[
list_common_item
.
reco_item
,
!
stop
?
''
:
list_common_item
.
reco_play_height
]}
>
<
View
style
=
{
list_common_item
.
reco_btn_cont
}
>
...
...
@@ -1779,27 +1762,8 @@ class SelfOrderPage extends Component {
<
/View
>
<
Text
style
=
{
list_common_item
.
reco_btn_text
}
>
长按录音
<
/Text
>
<
/TouchableOpacity
>
{
/* <Text style={list_common_item.reco_text} onPress={this._record}> Record(开始录音) </Text>
<Text style={list_common_item.reco_text} onPress={this._pause}> Pause(暂停录音) </Text>
<Text style={list_common_item.reco_text} onPress={this._resume}> Resume(恢复录音) </Text>
<Text style={list_common_item.reco_text} onPress={this._stop}> Stop(停止录音) </Text>
<Text style={list_common_item.reco_text} onPress={this._play}> Play(播放录音) </Text>
<Text style={list_common_item.reco_text} onPress={this._del}> Del(删除录音) </Text>
<Text style={list_common_item.reco_text}>
{
recording ? '正在录音' :
pause ? '已暂停' : '未开始'
}
</Text>
<Text style={list_common_item.reco_text}>时长: {currentTime}</Text> */
}
<
/View
>
:
<
View
style
=
{
list_common_item
.
reco_play_box
}
>
{
/* <View style={list_common_item.play_tit}>
<Text style={list_common_item.play_text}>时长: {currentTime} 秒</Text>
<Text style={list_common_item.play_text}>正在播放</Text>
</View> */
}
<
View
style
=
{
list_common_item
.
play_btn
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
...
...
@@ -1815,16 +1779,8 @@ class SelfOrderPage extends Component {
>
<
Text
style
=
{[
list_common_item
.
reco_text
,
list_common_item
.
reco_play_tit
]}
>
点击播放
({
currentTime
}
''
)
<
/Text
>
<
/TouchableOpacity
>
{
/* <TouchableOpacity
activeOpacity = {.8}
style={list_common_item.reco_list_box}
onPress={this._stopPlay}
>
<Text style={list_common_item.reco_text}> 停止 </Text>
</TouchableOpacity> */
}
<
/View
>
<
/View
>
}
<
/View
>
...
...
@@ -1842,7 +1798,7 @@ class SelfOrderPage extends Component {
render
()
{
let
{
canSubFlag
}
=
this
.
state
// console.
warn
(this.props)
// console.
log
(this.props)
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
return
(
...
...
@@ -1900,6 +1856,9 @@ const styles = StyleSheet.create({
item_container
:
{
flex
:
1
},
cell_title
:
{
width
:
120
},
cell_input
:
{
textAlign
:
'left'
},
...
...
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
ce9edb33
...
...
@@ -376,8 +376,7 @@ const styles = StyleSheet.create({
},
sub_btn_pro
:
{
backgroundColor
:
promary_color
,
height
:
48
,
// marginBottom: 18
marginBottom
:
14
},
thr_head_tit_img
:
{
borderWidth
:
.
5
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment