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
f02dea34
authored
May 22, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善【快速下单】提交成功后,清空当前页面数据、以及store缓存
parent
cf69922c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
149 additions
and
121 deletions
app/action/QuickAction.js
app/base/BaseStyle.js
app/containers/common/CellTextStyle.js
app/containers/common/DialogModel.js
app/containers/common/NotEnoughModel.js
app/containers/common/SubSuccPage.js
app/containers/quickOrder/QuickOrderPage.js
app/utils/Utils.js
app/action/QuickAction.js
View file @
f02dea34
...
@@ -140,7 +140,6 @@ function requestListDataFail() {
...
@@ -140,7 +140,6 @@ function requestListDataFail() {
}
}
// 上传语音 params={ access_token:'', path='录音地址' } -- 待修改
// 上传语音 params={ access_token:'', path='录音地址' } -- 待修改
export
function
requestQuickAudio_222
(
params
)
{
export
function
requestQuickAudio_222
(
params
)
{
return
dispatch
=>
{
return
dispatch
=>
{
...
@@ -251,3 +250,10 @@ function requestSubmitFail() {
...
@@ -251,3 +250,10 @@ function requestSubmitFail() {
type
:
QUICK_SUBMIT_FAILURE
type
:
QUICK_SUBMIT_FAILURE
}
}
}
}
// 初始化数据
export
function
setQuickInitData
()
{
return
{
type
:
QUICK_INIT_DATA
}
}
\ No newline at end of file
app/base/BaseStyle.js
View file @
f02dea34
...
@@ -88,7 +88,7 @@ export const list_common_item = {
...
@@ -88,7 +88,7 @@ export const list_common_item = {
rema_Input_inner
:
{
rema_Input_inner
:
{
paddingTop
:
10
,
paddingTop
:
10
,
height
:
105
,
height
:
105
,
width
:
Width
()
-
3
8
,
width
:
Width
()
-
5
8
,
// borderWidth: 1,
// borderWidth: 1,
// borderColor: '#eeeeee'
// borderColor: '#eeeeee'
},
},
...
@@ -405,7 +405,7 @@ export const list_common_item = {
...
@@ -405,7 +405,7 @@ export const list_common_item = {
ser_text_input
:
{
ser_text_input
:
{
backgroundColor
:
'#F5F5F5'
,
backgroundColor
:
'#F5F5F5'
,
height
:
38
,
height
:
38
,
lineHeight
:
3
6
,
lineHeight
:
1
6
,
paddingLeft
:
34
,
paddingLeft
:
34
,
borderRadius
:
10
,
borderRadius
:
10
,
fontSize
:
14
,
fontSize
:
14
,
...
...
app/containers/common/CellTextStyle.js
View file @
f02dea34
...
@@ -30,7 +30,7 @@ export function TitleTextStyle({style, ...props}) {
...
@@ -30,7 +30,7 @@ export function TitleTextStyle({style, ...props}) {
// 列表内容
// 列表内容
export
function
ContTextStyle
({
style
,
...
props
})
{
export
function
ContTextStyle
({
style
,
...
props
})
{
return
<
Text
style
=
{[
styles
.
cont_text
,
style
]}
{...
props
}
/
>
return
<
Text
style
=
{[
styles
.
cont_text
,
styles
.
text_select
,
style
]}
{...
props
}
/
>
}
}
// 列表输入框内容
// 列表输入框内容
...
@@ -71,7 +71,6 @@ const styles = StyleSheet.create({
...
@@ -71,7 +71,6 @@ const styles = StyleSheet.create({
fontSize
:
second_text_size
,
fontSize
:
second_text_size
,
color
:
first_text_color
,
color
:
first_text_color
,
fontFamily
:
font_family_semibold
fontFamily
:
font_family_semibold
// fontWeight: 'bold'
},
},
cont_text
:
{
cont_text
:
{
fontSize
:
second_text_size
,
fontSize
:
second_text_size
,
...
@@ -81,8 +80,10 @@ const styles = StyleSheet.create({
...
@@ -81,8 +80,10 @@ const styles = StyleSheet.create({
fontFamily
:
font_family_regular
,
fontFamily
:
font_family_regular
,
paddingLeft
:
20
paddingLeft
:
20
},
},
text_select
:
{
paddingLeft
:
6
},
text_input
:
{
text_input
:
{
// height: 38,
paddingRight
:
20
paddingRight
:
20
},
},
image_box
:
{
image_box
:
{
...
@@ -96,7 +97,6 @@ const styles = StyleSheet.create({
...
@@ -96,7 +97,6 @@ const styles = StyleSheet.create({
height
:
58
,
height
:
58
,
backgroundColor
:
foundation_color
,
backgroundColor
:
foundation_color
,
paddingHorizontal
:
20
,
paddingHorizontal
:
20
,
// paddingVertical: 20,
marginBottom
:
18
marginBottom
:
18
},
},
btn_cont
:
{
btn_cont
:
{
...
...
app/containers/common/DialogModel.js
View file @
f02dea34
...
@@ -16,6 +16,7 @@ import {
...
@@ -16,6 +16,7 @@ import {
safe_view
safe_view
}
from
'../../base/BaseStyle'
;
}
from
'../../base/BaseStyle'
;
// 选择器弹窗
class
DialogModel
extends
Component
{
class
DialogModel
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
...
@@ -23,18 +24,15 @@ class DialogModel extends Component {
...
@@ -23,18 +24,15 @@ class DialogModel extends Component {
isVisible
:
this
.
props
.
show
,
isVisible
:
this
.
props
.
show
,
entityList
:
this
.
props
.
entityList
entityList
:
this
.
props
.
entityList
}
}
// this.entityList = this.props.entityList
}
}
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
// console.warn('------show--------------',nextProps.show, this.state.isVisible )
if
(
this
.
state
.
isVisible
!=
nextProps
.
show
)
{
if
(
this
.
state
.
isVisible
!=
nextProps
.
show
)
{
this
.
setState
({
this
.
setState
({
isVisible
:
nextProps
.
show
isVisible
:
nextProps
.
show
});
});
}
}
if
(
this
.
state
.
entityList
!=
nextProps
.
entityList
)
{
if
(
this
.
state
.
entityList
!=
nextProps
.
entityList
)
{
// this.entityList = nextProps.entityList
this
.
setState
({
this
.
setState
({
entityList
:
nextProps
.
entityList
entityList
:
nextProps
.
entityList
})
})
...
@@ -49,13 +47,14 @@ class DialogModel extends Component {
...
@@ -49,13 +47,14 @@ class DialogModel extends Component {
}
}
renderItem
(
item
,
index
)
{
renderItem
(
item
,
index
)
{
// console.warn(this.props.itemIndex)
let
{
itemValue
}
=
this
.
props
let
{
itemIndex
,
itemValue
}
=
this
.
props
return
(
return
(
<
TouchableOpacity
key
=
{
index
}
onPress
=
{
this
.
choose
.
bind
(
this
,
item
,
index
)}
style
=
{[
styles
.
item
]}
>
<
TouchableOpacity
{
/* <TouchableOpacity key={i} onPress={this.choose.bind(this, index)} style={[styles.item]}> */
}
activeOpacity
=
{.
8
}
{
/* <Text style={[styles.itemText, itemIndex == index ? styles.curr_item : '']}>{item.name}</Text> */
}
key
=
{
index
}
<
Text
style
=
{[
styles
.
itemText
,
itemValue
==
item
.
value
?
styles
.
curr_item
:
''
]}
>
{
item
.
name
}
<
/Text
>
onPress
=
{
this
.
choose
.
bind
(
this
,
item
,
index
)}
style
=
{
styles
.
list_item_box
}
>
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
list_item_text
,
itemValue
==
item
.
value
?
styles
.
curr_item
:
''
]}
>
{
item
.
name
}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
);
);
}
}
...
@@ -63,7 +62,6 @@ class DialogModel extends Component {
...
@@ -63,7 +62,6 @@ class DialogModel extends Component {
choose
(
item
,
index
)
{
choose
(
item
,
index
)
{
let
{
itemTitle
}
=
this
.
props
let
{
itemTitle
}
=
this
.
props
if
(
this
.
state
.
isVisible
)
{
if
(
this
.
state
.
isVisible
)
{
// this.props.callback(i);
this
.
props
.
callback
(
item
,
itemTitle
);
this
.
props
.
callback
(
item
,
itemTitle
);
this
.
closeModal
();
this
.
closeModal
();
}
}
...
@@ -91,9 +89,6 @@ class DialogModel extends Component {
...
@@ -91,9 +89,6 @@ class DialogModel extends Component {
render
()
{
render
()
{
return
(
return
(
// <View style={styles.dia_container}>
// <Text style={styles.dis_cont}>遮照层</Text>
// </View>
<
View
style
=
{
styles
.
dia_container
}
>
<
View
style
=
{
styles
.
dia_container
}
>
<
Modal
<
Modal
transparent
=
{
true
}
transparent
=
{
true
}
...
@@ -114,14 +109,7 @@ class DialogModel extends Component {
...
@@ -114,14 +109,7 @@ class DialogModel extends Component {
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
dia_container
:
{
dia_container
:
{
flex
:
1
,
flex
:
1
// position: 'absolute',
// top: 0,
// left: 0,
// right: 0,
// backgroundColor: '#ccc',
// width: Width(),
// height: Height()
},
},
dis_cont
:
{
dis_cont
:
{
width
:
'80%'
,
width
:
'80%'
,
...
@@ -137,10 +125,7 @@ const styles = StyleSheet.create({
...
@@ -137,10 +125,7 @@ const styles = StyleSheet.create({
flex
:
1
,
flex
:
1
,
flexDirection
:
'column'
,
flexDirection
:
'column'
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
position
:
'relative'
,
position
:
'relative'
// marginTop: 12,
// marginBottom: 12,
// height: pxHeight(420)
},
},
modal_style
:
{
modal_style
:
{
position
:
"absolute"
,
position
:
"absolute"
,
...
@@ -154,16 +139,16 @@ const styles = StyleSheet.create({
...
@@ -154,16 +139,16 @@ const styles = StyleSheet.create({
borderTopRightRadius
:
12
,
borderTopRightRadius
:
12
,
maxHeight
:
pxHeight
(
480
),
maxHeight
:
pxHeight
(
480
),
minHeight
:
pxHeight
(
180
)
minHeight
:
pxHeight
(
180
)
// maxHeight: '100%'
},
},
item
:
{
list_item_box
:
{
width
:
Width
(),
width
:
Width
(),
height
:
40
,
height
:
40
,
paddingLeft
:
20
,
paddingLeft
:
20
,
paddingRight
:
20
,
paddingRight
:
20
,
alignItems
:
'center'
alignItems
:
'center'
,
},
},
itemT
ext
:
{
list_item_t
ext
:
{
fontSize
:
16
,
fontSize
:
16
,
color
:
third_text_color
color
:
third_text_color
},
},
...
@@ -175,18 +160,7 @@ const styles = StyleSheet.create({
...
@@ -175,18 +160,7 @@ const styles = StyleSheet.create({
paddingVertical
:
40
,
paddingVertical
:
40
,
paddingTop
:
46
paddingTop
:
46
},
},
item_scroll
:
{
item_scroll
:
{},
// height: '80%',
// marginTop: 30,
// paddingBottom: 30
},
// cancel: {
// width: Width(),
// height: 30,
// marginTop: 12,
// alignItems: 'center',
// backgroundColor: '#ffffff'
// },
})
})
export
default
DialogModel
;
export
default
DialogModel
;
\ No newline at end of file
app/containers/common/NotEnoughModel.js
View file @
f02dea34
...
@@ -99,10 +99,18 @@ class NotEnoughModel extends Component {
...
@@ -99,10 +99,18 @@ class NotEnoughModel extends Component {
style
=
{
styles
.
cont_list
}
style
=
{
styles
.
cont_list
}
key
=
{
index
}
>
key
=
{
index
}
>
<
Text
style
=
{[
styles
.
co_li
,
styles
.
co_str
]}
>
{
item
.
item_name
}({
item
.
item_code
})
:
<
/Text
>
<
Text
style
=
{[
styles
.
co_li
,
styles
.
co_str
]}
>
{
item
.
item_name
}({
item
.
item_code
})
:
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
{
item
.
general_name
}
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
<
Text
style
=
{
styles
.
co_li
}
>
{
item
.
specification
}
<
/Text
>
{
'通用名称:'
+
(
item
.
general_name
?
item
.
general_name
:
'无'
)
}
<
Text
style
=
{
styles
.
co_li
}
>
{
item
.
reg_number
}
<
/Text
>
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
{
item
.
item_name
}
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
{
'规格型号:'
+
(
item
.
specification
?
item
.
specification
:
'无'
)
}
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
{
'注册证编号:'
+
(
item
.
reg_number
?
item
.
reg_number
:
'无'
)
}
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
{
'物料名称:'
+
(
item
.
item_name
?
item
.
item_name
:
'无'
)}
<
/Text
>
<
Text
style
=
{
styles
.
co_li
}
>
<
Text
style
=
{
styles
.
co_li
}
>
计划数量:
计划数量:
<
Text
style
=
{
styles
.
plan_num
}
>
{
item
.
plan_quantity
}
<
/Text
>
<
Text
style
=
{
styles
.
plan_num
}
>
{
item
.
plan_quantity
}
<
/Text
>
...
...
app/containers/common/SubSuccPage.js
View file @
f02dea34
...
@@ -27,7 +27,7 @@ class SubSuccPage extends Component {
...
@@ -27,7 +27,7 @@ class SubSuccPage extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
orderVal
:
'
20200318121230
'
orderVal
:
''
}
}
}
}
...
@@ -41,6 +41,9 @@ class SubSuccPage extends Component {
...
@@ -41,6 +41,9 @@ class SubSuccPage extends Component {
}
}
async
handleSubmit
()
{
async
handleSubmit
()
{
let
{
orderVal
}
=
this
.
state
if
(
orderVal
)
{
// 有订单号
console
.
warn
(
'复制订单号并返回主页'
)
console
.
warn
(
'复制订单号并返回主页'
)
let
{
orderVal
}
=
this
.
state
let
{
orderVal
}
=
this
.
state
console
.
log
(
'---orderNumber---'
,
orderVal
,
typeof
orderVal
)
console
.
log
(
'---orderNumber---'
,
orderVal
,
typeof
orderVal
)
...
@@ -49,6 +52,7 @@ class SubSuccPage extends Component {
...
@@ -49,6 +52,7 @@ class SubSuccPage extends Component {
let
str
=
await
Clipboard
.
getString
()
let
str
=
await
Clipboard
.
getString
()
console
.
warn
(
str
)
console
.
warn
(
str
)
show
(
'复制成功'
)
show
(
'复制成功'
)
}
// 返回首页
// 返回首页
let
{
navigation
}
=
this
.
props
let
{
navigation
}
=
this
.
props
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -57,8 +61,8 @@ class SubSuccPage extends Component {
...
@@ -57,8 +61,8 @@ class SubSuccPage extends Component {
}
}
render
()
{
render
()
{
let
{
navigation
}
=
this
.
props
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
let
{
title
}
=
navigation
.
state
.
params
let
{
state
}
=
this
let
{
state
}
=
this
return
(
return
(
<
View
style
=
{
styles
.
succ_container
}
>
<
View
style
=
{
styles
.
succ_container
}
>
...
@@ -74,13 +78,19 @@ class SubSuccPage extends Component {
...
@@ -74,13 +78,19 @@ class SubSuccPage extends Component {
<
Image
source
=
{
require
(
'../../images/cor_green.png'
)}
style
=
{
styles
.
img_icon
}
/
>
<
Image
source
=
{
require
(
'../../images/cor_green.png'
)}
style
=
{
styles
.
img_icon
}
/
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
succ_title
}
>
{
'提交成功'
}
<
/Text
>
<
Text
style
=
{
styles
.
succ_title
}
>
{
'提交成功'
}
<
/Text
>
{
state
.
orderVal
?
<
Text
style
=
{
styles
.
succ_text
}
>
{
'订单号:'
}
{
state
.
orderVal
}
<
/Text
>
<
Text
style
=
{
styles
.
succ_text
}
>
{
'订单号:'
}
{
state
.
orderVal
}
<
/Text
>
:
null
}
<
TouchableOpacity
<
TouchableOpacity
activeOpacity
=
{.
9
}
activeOpacity
=
{.
9
}
style
=
{
styles
.
succ_btn
}
style
=
{
styles
.
succ_btn
}
onPress
=
{()
=>
this
.
handleSubmit
()}
onPress
=
{()
=>
this
.
handleSubmit
()}
>
>
<
Text
style
=
{
styles
.
btn_text
}
>
{
'复制订单号并返回主页'
}
<
/Text
>
<
Text
style
=
{
styles
.
btn_text
}
>
{
state
.
orderVal
?
'复制订单号并返回主页'
:
'返回主页'
}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/SafeAreaView
>
<
/SafeAreaView
>
...
...
app/containers/quickOrder/QuickOrderPage.js
View file @
f02dea34
...
@@ -7,7 +7,9 @@ import {
...
@@ -7,7 +7,9 @@ import {
ScrollView
,
ScrollView
,
TouchableOpacity
,
TouchableOpacity
,
Image
,
Image
,
TextInput
TextInput
,
Alert
,
Platform
}
from
'react-native'
;
}
from
'react-native'
;
import
{
import
{
home_background_color
,
home_background_color
,
...
@@ -29,7 +31,7 @@ import {
...
@@ -29,7 +31,7 @@ import {
FooterBtnStyle
FooterBtnStyle
}
from
'../common/CellTextStyle'
;
}
from
'../common/CellTextStyle'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
show
,
isEmpty
,
dedupQuoteArray
,
formatStrForDate
}
from
'../../utils/Utils'
;
import
{
show
,
isEmpty
,
dedupQuoteArray
,
formatStrForDate
,
cloneObject
}
from
'../../utils/Utils'
;
import
{
AudioRecorder
,
AudioUtils
}
from
'react-native-audio'
;
import
{
AudioRecorder
,
AudioUtils
}
from
'react-native-audio'
;
import
Sound
from
'react-native-sound'
;
import
Sound
from
'react-native-sound'
;
import
DateModel
from
'../common/DateModel'
;
import
DateModel
from
'../common/DateModel'
;
...
@@ -43,7 +45,8 @@ import {
...
@@ -43,7 +45,8 @@ import {
requestQuickTemplateCollect
,
requestQuickTemplateCollect
,
requestQuickAudio
,
requestQuickAudio
,
requestQuickSumbit
,
requestQuickSumbit
,
uploadAttachment
uploadAttachment
,
setQuickInitData
}
from
'../../action/QuickAction'
;
}
from
'../../action/QuickAction'
;
import
{
exitLoginStatus
}
from
'../../action/LoginAction'
;
import
{
exitLoginStatus
}
from
'../../action/LoginAction'
;
import
{
import
{
...
@@ -63,7 +66,7 @@ class EquipConsuPage extends Component {
...
@@ -63,7 +66,7 @@ class EquipConsuPage extends Component {
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
canSubFlag
:
false
,
// 生成订单按钮样式改变
canSubFlag
:
false
,
// 生成订单按钮样式改变
listOptionData
:
[
//
备注以上的
元素
listOptionData
:
[
//
页面
元素
{
{
"id"
:
"0"
,
"id"
:
"0"
,
title
:
'销售员'
,
title
:
'销售员'
,
...
@@ -166,6 +169,7 @@ class EquipConsuPage extends Component {
...
@@ -166,6 +169,7 @@ class EquipConsuPage extends Component {
isRecode
:
true
// 录音
isRecode
:
true
// 录音
}
}
],
],
subInitListOption
:
[],
// 提交成功后,初始化当前数据
submitOption
:
{
// 提交的信息
submitOption
:
{
// 提交的信息
seller_code
:
''
,
// 用户名username
seller_code
:
''
,
// 用户名username
org_code
:
''
,
// 组织
org_code
:
''
,
// 组织
...
@@ -351,20 +355,30 @@ class EquipConsuPage extends Component {
...
@@ -351,20 +355,30 @@ class EquipConsuPage extends Component {
})
})
}
}
// 赋值销售员
// 赋值销售员
初始化数据
getSellerName
()
{
getSellerName
()
{
let
{
state
,
props
}
=
this
let
{
state
,
props
}
=
this
// console.log('---userInfo',props.userInfo)
// console.log('---userInfo',props.userInfo)
if
(
state
.
listOptionData
[
0
].
name
!==
props
.
userInfo
.
person_name
)
{
let
{
listOptionData
}
=
this
.
state
this
.
setState
({
this
.
setState
({
listOptionData
:
state
.
listOptionData
.
map
((
item
)
=>
{
subInitListOption
:
cloneObject
(
listOptionData
)
// 存储初始化数据,提交成功后赋此值
if
(
item
.
title
===
'销售员'
)
{
item
.
name
=
props
.
userInfo
.
person_name
item
.
value
=
props
.
userInfo
.
user_name
}
return
item
})
})
if
(
state
.
listOptionData
[
0
].
name
!==
props
.
userInfo
.
person_name
)
{
listOptionData
[
0
].
name
=
props
.
userInfo
.
person_name
listOptionData
[
0
].
value
=
props
.
userInfo
.
user_name
this
.
setState
({
listOptionData
,
subInitListOption
:
cloneObject
(
listOptionData
)
})
})
// this.setState({
// listOptionData: state.listOptionData.map((item) => {
// if(item.title === '销售员') {
// item.name = props.userInfo.person_name
// item.value = props.userInfo.user_name
// }
// return item
// })
// })
}
}
}
}
...
@@ -598,6 +612,10 @@ class EquipConsuPage extends Component {
...
@@ -598,6 +612,10 @@ class EquipConsuPage extends Component {
if
(
index
>
curIndex
&&
index
<
11
)
{
if
(
index
>
curIndex
&&
index
<
11
)
{
item
.
name
=
localOtherObj
.
name
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
item
.
value
=
localOtherObj
.
value
if
(
item
.
title
==
'主治医生'
)
{
item
.
showInput
=
false
,
item
.
inputValue
=
''
}
}
}
return
item
return
item
})
})
...
@@ -634,7 +652,7 @@ class EquipConsuPage extends Component {
...
@@ -634,7 +652,7 @@ class EquipConsuPage extends Component {
handleCallBack
(
item
,
itemTitle
)
{
handleCallBack
(
item
,
itemTitle
)
{
// console.warn(item, 'item------')
// console.warn(item, 'item------')
// console.warn('item-itemTitle-----',itemTitle)
// console.warn('item-itemTitle-----',itemTitle)
let
{
listOptionData
,
localOtherObj
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
let
self
=
this
let
self
=
this
this
.
setState
({
this
.
setState
({
currentItem
:
item
,
currentItem
:
item
,
...
@@ -685,7 +703,7 @@ class EquipConsuPage extends Component {
...
@@ -685,7 +703,7 @@ class EquipConsuPage extends Component {
// 修改当前选择器数据
// 修改当前选择器数据
changeCurrentOption
()
{
changeCurrentOption
()
{
let
{
listOptionData
,
currentTitle
,
localCustomersOption
}
=
this
.
state
let
{
currentTitle
}
=
this
.
state
let
{
quickOrderOption
}
=
this
.
props
let
{
quickOrderOption
}
=
this
.
props
console
.
log
(
'当前:--quickOrderOption---'
,
quickOrderOption
)
console
.
log
(
'当前:--quickOrderOption---'
,
quickOrderOption
)
let
tempOption
=
[]
let
tempOption
=
[]
...
@@ -1087,51 +1105,19 @@ class EquipConsuPage extends Component {
...
@@ -1087,51 +1105,19 @@ class EquipConsuPage extends Component {
let
{
state
,
props
}
=
this
let
{
state
,
props
}
=
this
let
that
=
this
let
that
=
this
// // 测试 -- 录音
console
.
log
(
'提交======》'
,
state
.
canSubFlag
,
state
.
stop
,
state
.
isSubLoding
)
// let params = {
// access_token: props.token,
// path: state.audioPath
// }
// console.log('---handleSubmit--',params)
// // props.requestQuickAudio(params)
// // requestQuickAudio(params).then((response) => {
// // console.log('返回---', response)
// // })
// let audioResult = await requestQuickAudio(params);
// console.log('返回---audioResult======',audioResult)
// this.changeSubLoding(true, '上传中')
// if(audioResult.error_code == 0) {
// // 提交订单
// that.setState({
// listOptionData: state.listOptionData.map((item, index) => {
// if(index == 11) {
// item.value = audioResult.data.url
// }
// return item
// })
// }, () => {
// this.changeSubLoding(false)
// that.submitQuickOrder()
// })
// } else if(audioResult.error_code == 41006) {
// this.changeSubLoding(false)
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// this.changeSubLoding(false)
// let error_msg = audioResult.error_msg || audioResult.message
// show(error_msg);
// }
// // // 测试 -- 图片上传
// 测试
// // this.addPhotoAction()
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
// this.props.navigation.navigate('SubSuccPage', {
// title: `${title} - 下单成功`,
// orderNumber: quickOrderOption.survey_collect_number
// })
// console.log('提交======》', state.canSubFlag, state.stop, state.isSubLoding)
// 可提交 并且 不处于正在提交中
// 可提交 并且 不处于正在提交中
if
(
state
.
canSubFlag
&&
!
state
.
isSubLoding
)
{
if
(
state
.
canSubFlag
&&
!
state
.
isSubLoding
)
{
//
console.warn('进入提交内容----------')
console
.
warn
(
'进入提交内容----------'
)
// console.warn(state.listOptionData)
// console.warn(state.listOptionData)
// 先提交录音,再提交接口
// 先提交录音,再提交接口
...
@@ -1141,9 +1127,9 @@ class EquipConsuPage extends Component {
...
@@ -1141,9 +1127,9 @@ class EquipConsuPage extends Component {
access_token
:
props
.
token
,
access_token
:
props
.
token
,
path
:
state
.
audioPath
path
:
state
.
audioPath
}
}
//
console.log('---handleSubmit--',params)
console
.
log
(
'---handleSubmit--'
,
params
)
let
audioResult
=
await
requestQuickAudio
(
params
);
let
audioResult
=
await
requestQuickAudio
(
params
);
//
console.log('返回---audioResult======',audioResult)
console
.
log
(
'返回---audioResult======'
,
audioResult
)
that
.
changeSubLoding
(
true
,
'上传中'
)
that
.
changeSubLoding
(
true
,
'上传中'
)
if
(
audioResult
.
error_code
==
0
)
{
if
(
audioResult
.
error_code
==
0
)
{
// 提交订单
// 提交订单
...
@@ -1194,7 +1180,7 @@ class EquipConsuPage extends Component {
...
@@ -1194,7 +1180,7 @@ class EquipConsuPage extends Component {
tempSubOption
.
surgery_desc
=
state
.
listOptionData
[
10
].
value
tempSubOption
.
surgery_desc
=
state
.
listOptionData
[
10
].
value
tempSubOption
.
voice_url
=
state
.
listOptionData
[
11
].
value
tempSubOption
.
voice_url
=
state
.
listOptionData
[
11
].
value
//
console.log('tempSubOption-----', tempSubOption)
console
.
log
(
'tempSubOption-----'
,
tempSubOption
)
let
params
=
{
let
params
=
{
access_token
:
props
.
token
,
access_token
:
props
.
token
,
data
:
{
...
tempSubOption
}
data
:
{
...
tempSubOption
}
...
@@ -1228,7 +1214,7 @@ class EquipConsuPage extends Component {
...
@@ -1228,7 +1214,7 @@ class EquipConsuPage extends Component {
// 处理提交后返回的数据
// 处理提交后返回的数据
processReturnData
()
{
processReturnData
()
{
let
{
quickOrderOption
}
=
this
.
props
let
{
quickOrderOption
,
setQuickInitData
}
=
this
.
props
console
.
log
(
'submit --- !!!! --- 当前:--quickOrderOption---'
,
quickOrderOption
)
console
.
log
(
'submit --- !!!! --- 当前:--quickOrderOption---'
,
quickOrderOption
)
if
(
quickOrderOption
.
create_success
)
{
if
(
quickOrderOption
.
create_success
)
{
if
(
quickOrderOption
.
create_success
==
'N'
)
{
if
(
quickOrderOption
.
create_success
==
'N'
)
{
...
@@ -1240,6 +1226,7 @@ class EquipConsuPage extends Component {
...
@@ -1240,6 +1226,7 @@ class EquipConsuPage extends Component {
}
else
if
(
quickOrderOption
.
create_success
==
'Y'
)
{
}
else
if
(
quickOrderOption
.
create_success
==
'Y'
)
{
// 打开下单成功页面
// 打开下单成功页面
this
.
clearAllData
()
let
{
state
:
{
params
:
{
title
}
}
}
=
this
.
props
.
navigation
let
{
state
:
{
params
:
{
title
}
}
}
=
this
.
props
.
navigation
this
.
props
.
navigation
.
navigate
(
'SubSuccPage'
,
{
this
.
props
.
navigation
.
navigate
(
'SubSuccPage'
,
{
title
:
`
${
title
}
- 下单成功`
,
title
:
`
${
title
}
- 下单成功`
,
...
@@ -1251,6 +1238,17 @@ class EquipConsuPage extends Component {
...
@@ -1251,6 +1238,17 @@ class EquipConsuPage extends Component {
}
}
// 清空数据
clearAllData
()
{
let
{
props
}
=
this
let
{
listOptionData
,
subInitListOption
}
=
this
.
state
props
.
setQuickInitData
()
// 清空缓存数据
listOptionData
=
cloneObject
(
subInitListOption
)
// 清空本地数据
this
.
setState
({
listOptionData
})
}
// 库存不足弹窗回调 -- 确定
// 库存不足弹窗回调 -- 确定
handleNotEnoughCallBack
()
{
handleNotEnoughCallBack
()
{
// console.log('callback----heihei: 点击确定!!!')
// console.log('callback----heihei: 点击确定!!!')
...
@@ -1673,6 +1671,9 @@ const mapDispatchToProps = (dispatch) => {
...
@@ -1673,6 +1671,9 @@ const mapDispatchToProps = (dispatch) => {
},
},
exitLoginStatus
:
()
=>
{
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
dispatch
(
exitLoginStatus
())
},
setQuickInitData
:
()
=>
{
dispatch
(
setQuickInitData
())
}
}
}
}
}
}
...
...
app/utils/Utils.js
View file @
f02dea34
import
Toast
from
'react-native-root-toast'
;
import
Toast
from
'react-native-root-toast'
;
import
{
Dimensions
,
Platform
,
PixelRatio
}
from
"react-native"
;
import
{
Dimensions
,
Platform
,
PixelRatio
,
Text
}
from
"react-native"
;
export
const
show
=
(
data
)
=>
{
export
const
show
=
(
data
,
type
)
=>
{
// default
let
text_color
=
'#fafafa'
let
back_color
=
'#222'
let
tip_data
=
data
if
(
type
==
'error'
)
{
text_color
=
'#f5222d'
back_color
=
'#fff1f0'
tip_data
=
`×
${
data
}
`
}
else
if
(
type
==
'warn'
)
{
text_color
=
'#fa8c16'
back_color
=
'#fff7e6'
tip_data
=
`!
${
data
}
`
}
else
if
(
type
==
'success'
)
{
text_color
=
'#52c41a'
back_color
=
'#f6ffed'
tip_data
=
`√
${
data
}
`
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
Toast
.
show
(
data
,
{
Toast
.
show
(
tip_
data
,
{
duration
:
Toast
.
durations
.
LONG
,
duration
:
Toast
.
durations
.
LONG
,
position
:
Toast
.
positions
.
CENTER
,
position
:
Toast
.
positions
.
CENTER
,
shadow
:
tru
e
,
shadow
:
fals
e
,
hideOnPress
:
true
,
hideOnPress
:
true
,
delay
:
0
,
delay
:
0
,
visible
:
true
,
visible
:
true
,
backgroundColor
:
'#222'
,
backgroundColor
:
back_color
,
textColor
:
'#fff'
textColor
:
text_color
,
shadowColor
:
text_color
})
})
}
}
}
}
...
@@ -127,6 +145,15 @@ export const dedupQuoteArray = (arr, typeName) => {
...
@@ -127,6 +145,15 @@ export const dedupQuoteArray = (arr, typeName) => {
return
result
;
return
result
;
}
}
/**
* 深度克隆对象、数组
* @param obj 被克隆的对象
* @return 克隆后的对象
*/
export
function
cloneObject
(
obj
)
{
return
JSON
.
parse
(
JSON
.
stringify
(
obj
))
}
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