Commit e1adcee3 by Denglingling

删除多余注释信息

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