Commit e1adcee3 by Denglingling

删除多余注释信息

parent c86c939c
Showing with 17 additions and 88 deletions
......@@ -7,9 +7,7 @@ import {
ScrollView,
TouchableOpacity,
Image,
TextInput,
Alert,
Platform
TextInput
} from 'react-native';
import {
home_background_color,
......@@ -216,7 +214,6 @@ class EquipConsuPage extends Component {
// audioPath: AudioUtils.DocumentDirectoryPath + `/quickAudio${Math.floor(Math.random() * (1000))+1}.aac`, // 文件路径
audioPath: AudioUtils.DocumentDirectoryPath + `/quick_audio_${new Date().getTime()}.aac`, // 文件路径
recording: false, //是否录音
pause: false, //录音是否暂停
stop: false, //录音是否停止
currentTime: 0, //录音时长
localCustomersOption: [], // 当前医院信息:客户名称、收单地点、收货地点、主治医生
......@@ -250,7 +247,6 @@ class EquipConsuPage extends Component {
// 赋值销售员 初始化数据
getSellerName() {
let {state, props} = this
// console.log('---userInfo',props.userInfo)
let {listOptionData} = this.state
this.setState({
subInitListOption: cloneObject(listOptionData) // 存储初始化数据,提交成功后赋此值
......@@ -262,15 +258,6 @@ class EquipConsuPage extends Component {
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
// })
// })
}
}
......@@ -278,7 +265,7 @@ class EquipConsuPage extends Component {
getAudioAuthorize() {
AudioRecorder.requestAuthorization()
.then(isAuthor => {
console.warn('是否授权: ' + isAuthor)
console.log('是否授权: ' + isAuthor)
if(!isAuthor) {
return alert('请前往设置开启录音权限')
}
......@@ -292,9 +279,8 @@ class EquipConsuPage extends Component {
};
// 完成录音
AudioRecorder.onFinished = (data) => {
// data 返回需要上传到后台的录音数据
console.warn(this.state.currentTime)
console.log('录音完毕hello:------------------',data)
// data 录音数据
console.log(this.state.currentTime)
};
})
}
......@@ -323,9 +309,7 @@ class EquipConsuPage extends Component {
// 开始录音
_record = async () => {
console.warn('录音开始=====')
show('录音开始')
if(!this.state.hasPermission) {
return alert('没有授权')
}
......@@ -336,51 +320,20 @@ class EquipConsuPage extends Component {
// 初始化录音
this.prepareRecordingPath(this.state.audioPath)
}
this.setState({recording: true,pause: false})
this.setState({ recording: true })
try {
await AudioRecorder.startRecording()
} catch (err) {
console.log(err)
}
}
// 暂停录音
_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)
console.error(err)
}
}
// 停止录音
_stop = async () => {
console.warn('停止录音====')
show('录音结束')
console.warn('停止录音',this.state.currentTime)
try {
await AudioRecorder.stopRecording();
this.setState({stop: true, recording: false, paused: false});
this.setState({ stop: true, recording: false });
} catch (error) {
console.error(error);
}
......@@ -407,15 +360,6 @@ class EquipConsuPage extends Component {
})
}
// 停止播放录音 -- 安卓不能停止、ios可以
_stopPlay = async () => {
console.warn('tingzhi bofang')
let self = this
self.whoosh.stop(() => {
console.warn('success - 停止成功')
})
}
// 删除录音
_del = async () => {
// 初始化录音
......@@ -535,8 +479,6 @@ class EquipConsuPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
// console.warn(item, 'item------')
// console.warn('item-itemTitle-----',itemTitle)
let { listOptionData} = this.state
let self = this
this.setState({
......@@ -587,8 +529,8 @@ class EquipConsuPage extends Component {
changeCurrentOption() {
let { currentTitle } = this.state
let { quickOrderOption } = this.props
// console.log('当前:--quickOrderOption---', quickOrderOption)
let tempOption = []
let that = this
if(quickOrderOption.length === 0) {
show(`当前${currentTitle}为空`)
return
......@@ -630,8 +572,14 @@ class EquipConsuPage extends Component {
tempOption = this.changeNameAndValue(quickOrderOption, 'value_name', 'value_code')
}
this.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
}, () => {
// 解决 IOS 弹窗显示问题
setTimeout(() => {
that.setState({
showTypePop: true
})
}, 500)
})
}
......@@ -891,10 +839,9 @@ class EquipConsuPage extends Component {
// 修改当前日期数据
dateModalCallback(date) {
// console.warn('callback',date)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
listOptionData: listOptionData.map((item) => {
if(item.title === '手术类时间') {
item.name = date
item.value = date
......@@ -947,18 +894,8 @@ class EquipConsuPage extends Component {
let { state, props } = this
let that = this
// 测试
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
// this.props.navigation.navigate('SubSuccPage', {
// title: `${title} - 下单成功`,
// orderNumber: quickOrderOption.survey_collect_number
// })
// 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) {
// console.warn('进入提交内容----------')
// 先提交录音,再提交接口
if(state.stop) {
// 有录音
......@@ -1017,8 +954,6 @@ class EquipConsuPage extends Component {
tempSubOption.order_type_code = state.listOptionData[9].value
tempSubOption.surgery_desc = state.listOptionData[10].value
tempSubOption.voice_url = state.listOptionData[11].value
// console.log('tempSubOption-----', tempSubOption)
let params = {
access_token: props.token,
data: { ...tempSubOption }
......@@ -1053,7 +988,6 @@ class EquipConsuPage extends Component {
// 处理提交后返回的数据
processReturnData() {
let { quickOrderOption, setQuickInitData } = this.props
console.log('submit --- !!!! --- 当前:--quickOrderOption---', quickOrderOption)
if(quickOrderOption.create_success) {
if(quickOrderOption.create_success == 'N') {
// 打开库存不足弹窗
......@@ -1091,8 +1025,6 @@ class EquipConsuPage extends Component {
// 库存不足弹窗回调 -- 确定
handleNotEnoughCallBack() {
// console.log('callback----heihei: 点击确定!!!')
// 再次调用提交并修改 force_balance_check_flag
let { submitOption } = this.state
let self = this
this.setState({
......@@ -1101,7 +1033,6 @@ class EquipConsuPage extends Component {
force_balance_check_flag: 'N'
}
}, () => {
// console.log('hhh--',this.state.submitOption )
self.handleSubmit()
})
......@@ -1109,7 +1040,6 @@ class EquipConsuPage extends Component {
// 库存不足弹窗关闭
handleNotEnoughCloseModal(show) {
// console.log('closeModal----heihei:', show)
this.setState({
showNotEnogPop: show
})
......@@ -1289,7 +1219,6 @@ class EquipConsuPage extends Component {
currentTitle,
showTypePop,
} = this.state
// console.warn('弹窗-----,', listCurrentOption)
return (
<SafeAreaView style={styles.item_container}>
<DialogModel
......@@ -1334,7 +1263,7 @@ class EquipConsuPage 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}>
......
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