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
8b1b87ba
authored
Dec 25, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整正在加载中的交互
parent
fbdeabf3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
63 deletions
app/containers/selfOrder/SelfOrderPage.js
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/SelfOrderPage.js
View file @
8b1b87ba
...
...
@@ -17,6 +17,7 @@ import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE
import
PageListArrow
from
'../common/listDataComponent/PageListArrow'
;
import
TipInfoNeedSelect
from
'../common/listDataComponent/TipInfoNeedSelect'
;
import
LocalVariable
from
'../common/LocalVariable'
;
import
LoadingModel
from
'../common/listDataComponent/LoadingModel'
;
class
SelfOrderPage
extends
Component
{
constructor
(
props
)
{
...
...
@@ -149,14 +150,11 @@ class SelfOrderPage extends Component {
}
componentDidMount
()
{
this
.
props
.
setSelectProductOpts
([])
this
.
getSellerName
()
this
.
getAudioAuthorize
()
}
componentWillUnmount
()
{
this
.
props
.
setSelectProductOpts
([])
}
// 赋值销售员 初始化数据
getSellerName
()
{
let
{
state
,
props
}
=
this
...
...
@@ -281,14 +279,14 @@ class SelfOrderPage extends Component {
// 播放录音
_play
=
async
()
=>
{
let
self
=
this
let
that
=
this
show
(
'正在播放'
)
self
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
that
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
if
(
err
)
{
show
(
'加载音频失败'
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
}
self
.
whoosh
.
play
(
success
=>
{
that
.
whoosh
.
play
(
success
=>
{
if
(
success
)
{
show
(
'播放完毕'
)
}
else
{
...
...
@@ -318,17 +316,23 @@ class SelfOrderPage extends Component {
if
(
self_list_status
!=
nextProps
.
self_list_status
)
{
switch
(
nextProps
.
self_list_status
)
{
case
SELF_ORDER_LIST_DOING
:
// that.refs.LoadingModel.show()
that
.
changeSubLoding
(
true
)
break
;
case
SELF_ORDER_LIST_SUCCESS
:
// that.refs.LoadingModel.hide()
// setTimeout(() => {
// that.changeCurrentOption()
// }, 500) // IOS问题
that
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'加载中'
},
()
=>
{
},()
=>
{
that
.
changeCurrentOption
()
})
break
;
case
SELF_ORDER_LIST_FAILURE
:
// that.refs.LoadingModel.hide()
that
.
changeSubLoding
(
false
)
break
;
default
:
...
...
@@ -347,17 +351,25 @@ class SelfOrderPage extends Component {
if
(
submit_self_order_status
!=
nextProps
.
submit_self_order_status
)
{
switch
(
nextProps
.
submit_self_order_status
)
{
case
SELF_SUBMIT_DOING
:
// that.refs.LoadingModel.show('提交中')
that
.
changeSubLoding
(
true
,
'提交中'
)
break
;
case
SELF_SUBMIT_SUCCESS
:
that
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'提交中'
},
()
=>
{
that
.
processReturnData
()
})
// setTimeout(() => {
// that.refs.LoadingModel.hide()
// that.processReturnData()
// }, 500) // IOS问题
setTimeout
(()
=>
{
that
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'提交中'
},()
=>
{
that
.
processReturnData
()
})
},
500
)
break
;
case
SELF_SUBMIT_FAILURE
:
// that.refs.LoadingModel.hide()
that
.
changeSubLoding
(
false
,
'提交中'
)
break
;
default
:
...
...
@@ -407,6 +419,7 @@ class SelfOrderPage extends Component {
let
{
listOptionData
}
=
this
.
state
let
tempStatus
=
false
let
tempTit
=
''
let
curTip
=
'未选择'
for
(
let
chIndex
in
listOptionData
)
{
if
(
chIndex
>
0
&&
chIndex
<
11
&&
chIndex
!=
8
&&
!
listOptionData
[
chIndex
].
value
...
...
@@ -414,6 +427,9 @@ class SelfOrderPage extends Component {
// 不是主治医生
tempTit
=
listOptionData
[
chIndex
].
title
tempStatus
=
true
if
(
chIndex
==
6
)
{
curTip
=
'未输入'
}
break
}
}
...
...
@@ -421,23 +437,23 @@ class SelfOrderPage extends Component {
canSubFlag
:
!
tempStatus
})
if
(
isSubCheck
&&
tempStatus
)
{
show
(
`
${
tempTit
}
未选择
,不能提交`
)
show
(
`
${
tempTit
}
${
curTip
}
,不能提交`
)
}
}
// 选择器弹窗回调函数
handleCallBack
(
item
,
itemTitle
)
{
let
{
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
listOptionData
.
map
(
function
(
chItem
,
index
)
{
if
(
chItem
.
title
===
itemTitle
)
{
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
if
(
itemTitle
===
'组织'
)
{
self
.
clearInitNameAndValue
(
1
)
that
.
clearInitNameAndValue
(
1
)
}
if
(
itemTitle
===
'客户名称'
)
{
self
.
clearInitNameAndValue
(
2
)
that
.
clearInitNameAndValue
(
2
)
}
if
(
itemTitle
===
'主治医生'
)
{
if
(
item
.
name
===
'其他'
)
{
...
...
@@ -448,7 +464,7 @@ class SelfOrderPage extends Component {
}
}
// if (itemTitle === '手术类型') {
//
self
.clearInitNameAndValue(8)
//
that
.clearInitNameAndValue(8)
// }
}
})
...
...
@@ -456,7 +472,7 @@ class SelfOrderPage extends Component {
currentItem
:
item
,
listOptionData
:
listOptionData
},
()
=>
{
self
.
changeCanSub
()
that
.
changeCanSub
()
})
}
...
...
@@ -478,9 +494,9 @@ class SelfOrderPage extends Component {
return
}
if
(
currentTitle
===
'组织'
)
{
tempOption
=
th
is
.
changeNameAndValue
(
selfOrderOption
,
'org_name'
,
'org_code'
)
tempOption
=
th
at
.
changeNameAndValue
(
selfOrderOption
,
'org_name'
,
'org_code'
)
}
else
if
(
currentTitle
===
'客户名称'
)
{
th
is
.
setState
({
th
at
.
setState
({
localCustomersOption
:
selfOrderOption
})
// 去重医院数据
...
...
@@ -494,7 +510,7 @@ class SelfOrderPage extends Component {
currentArr
.
push
(
obj
)
})
}
tempOption
=
th
is
.
changeNameAndValue
(
currentArr
,
'customer_name'
,
'customer_code'
)
tempOption
=
th
at
.
changeNameAndValue
(
currentArr
,
'customer_name'
,
'customer_code'
)
}
else
if
(
currentTitle
===
'手术类型'
)
{
let
resultArr
=
[]
selfOrderOption
.
forEach
(
item
=>
{
...
...
@@ -505,16 +521,18 @@ class SelfOrderPage extends Component {
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
th
is
.
changeNameAndValue
(
selfOrderOption
,
'value_name'
,
'value_code'
)
tempOption
=
th
at
.
changeNameAndValue
(
selfOrderOption
,
'value_name'
,
'value_code'
)
}
th
is
.
setState
({
th
at
.
setState
({
listCurrentOption
:
[...
tempOption
]
},
()
=>
{
if
(
tempOption
&&
tempOption
.
length
===
0
)
{
show
(
'当前数据为空!'
)
return
}
// 解决 IOS 弹窗显示问题
setTimeout
(()
=>
{
that
.
setState
({
showTypePop
:
true
})
that
.
handleCloseModal
(
true
)
},
500
)
})
}
...
...
@@ -522,12 +540,14 @@ class SelfOrderPage extends Component {
// 修改选择器为属性 name 和 value
changeNameAndValue
(
data
,
nameType
,
valueType
)
{
let
result
=
[]
data
.
forEach
(
item
=>
{
let
obj
=
{}
obj
.
name
=
item
[
nameType
],
obj
.
value
=
item
[
valueType
]
result
.
push
(
obj
)
})
if
(
data
&&
data
.
length
>
0
)
{
data
.
forEach
(
item
=>
{
let
obj
=
{}
obj
.
name
=
item
[
nameType
],
obj
.
value
=
item
[
valueType
]
result
.
push
(
obj
)
})
}
return
result
}
...
...
@@ -551,18 +571,16 @@ class SelfOrderPage extends Component {
// 客户名称 点击
handleCustomerCheck
(
curData
)
{
// let { state, props } = this
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
curData
.
name
,
value
:
curData
.
value
}
},
()
=>
{
// 在此修改接口
self
.
getCustomerData
()
that
.
getCustomerData
()
})
}
}
...
...
@@ -619,9 +637,9 @@ class SelfOrderPage extends Component {
// 收单地点 点击
handleBillCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
curData
.
name
,
...
...
@@ -641,7 +659,7 @@ class SelfOrderPage extends Component {
})
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
...
...
@@ -669,9 +687,9 @@ class SelfOrderPage extends Component {
// 收货地点 点击
handleShipCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
curData
.
name
,
...
...
@@ -691,7 +709,7 @@ class SelfOrderPage extends Component {
})
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
...
...
@@ -719,10 +737,10 @@ class SelfOrderPage extends Component {
// 主治医生 点击
handleDoctorCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
// 点击
self
.
setState
({
that
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
curData
.
name
,
...
...
@@ -747,7 +765,7 @@ class SelfOrderPage extends Component {
}
tempOption
.
push
(
othObj
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
...
...
@@ -770,13 +788,16 @@ class SelfOrderPage extends Component {
// 手术名称 输入
handleSurNameInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
let
that
=
this
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
value
=
text
}
})
th
is
.
setState
({
th
at
.
setState
({
listOptionData
:
listOptionData
},
()
=>
{
that
.
changeCanSub
()
})
}
...
...
@@ -822,9 +843,9 @@ class SelfOrderPage extends Component {
// 手术类型 点击
handleSurTypeCheck
(
curData
)
{
let
{
props
}
=
this
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
name
:
curData
.
name
,
...
...
@@ -1099,9 +1120,6 @@ class SelfOrderPage extends Component {
processReturnData
()
{
let
{
selfOrderOption
}
=
this
.
props
let
that
=
this
that
.
setState
({
isSubLoding
:
false
})
if
(
selfOrderOption
&&
selfOrderOption
.
create_success
==
'Y'
)
{
// 打开下单成功页面
that
.
clearAllData
()
...
...
@@ -1370,6 +1388,13 @@ class SelfOrderPage extends Component {
)
}
// 返回加载中
renderLodingItemNew
()
{
return
(
<
LoadingModel
ref
=
"LoadingModel"
/>
)
}
// 返回提交器械包提示
renderTipModelPackage
()
{
return
(
...
...
@@ -1415,6 +1440,7 @@ class SelfOrderPage extends Component {
<
/ScrollView
>
{
this
.
renderLodingItem
()}
{
this
.
renderLodingItemNew
()}
<
/SafeAreaView
>
<
/View
>
...
...
app/containers/selfOrder/module/ChooseProductPage.js
View file @
8b1b87ba
...
...
@@ -111,6 +111,14 @@ class ChooseProductPage extends Component {
let
that
=
this
let
{
token
,
global_domain_config
}
=
that
.
props
let
{
topProcOptionList
,
defalutLeftItem
}
=
this
.
state
if
(
topItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
!==
0
){
that
.
setState
({
topActiveIndex
:
topIndex
},
()
=>
{
that
.
handleLeftNav
(
topItem
[
'leftOptionList'
][
0
],
0
)
})
return
}
that
.
refs
.
LoadingModel
.
show
()
let
params
=
{
access_token
:
token
,
...
...
@@ -120,15 +128,13 @@ class ChooseProductPage extends Component {
let
pro_scate_search
=
await
reqProCategorySearch
(
global_domain_config
,
params
)
console
.
log
(
'res_2 : '
,
pro_scate_search
)
if
(
pro_scate_search
.
error_code
===
0
)
{
if
(
topItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
===
0
)
{
let
{
data
}
=
pro_scate_search
topItem
.
leftOptionList
=
defalutLeftItem
.
concat
(
data
.
item
)
topItem
.
leftOptionList
.
forEach
(
function
(
leftObj
)
{
leftObj
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
leftObj
[
LocalVariable
.
LOCAL_SECOND_DATA
]
=
[]
})
topProcOptionList
[
topIndex
]
=
topItem
}
let
{
data
}
=
pro_scate_search
topItem
.
leftOptionList
=
defalutLeftItem
.
concat
(
data
.
item
)
topItem
.
leftOptionList
.
forEach
(
function
(
leftObj
)
{
leftObj
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
leftObj
[
LocalVariable
.
LOCAL_SECOND_DATA
]
=
[]
})
topProcOptionList
[
topIndex
]
=
topItem
that
.
setState
({
topActiveIndex
:
topIndex
,
topProcOptionList
:
topProcOptionList
...
...
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