| | |
| | | console.log('当前录音片段URL:', res.localUrl) |
| | | console.log('当前已存储的片段数:', this.recordSegments.length) |
| | | console.log('当前片段:', this.currentSegment) |
| | | |
| | | |
| | | // 只有当当前片段与上一个不同时才添加 |
| | | if (!this.currentSegment || this.currentSegment.url !== res.localUrl) { |
| | | console.log('添加新的录音片段') |
| | |
| | | try { |
| | | const audioContext = new (window.AudioContext || window.webkitAudioContext)(); |
| | | const audioBuffers = []; |
| | | |
| | | |
| | | // 加载所有音频文件 |
| | | for (const url of audioUrls) { |
| | | const response = await fetch(url); |
| | |
| | | |
| | | // 计算总时长 |
| | | const totalLength = audioBuffers.reduce((acc, buffer) => acc + buffer.length, 0); |
| | | |
| | | |
| | | // 创建新的音频缓冲区 |
| | | const mergedBuffer = audioContext.createBuffer( |
| | | audioBuffers[0].numberOfChannels, |
| | |
| | | // 将合并后的音频转换为 Blob |
| | | const wavBlob = await this.audioBufferToWav(mergedBuffer); |
| | | const mergedUrl = URL.createObjectURL(wavBlob); |
| | | |
| | | |
| | | return mergedUrl; |
| | | } catch (error) { |
| | | console.error('合并音频失败:', error); |
| | |
| | | if (this.isRecording) { |
| | | this.$refs.mumuRecorder.stop() |
| | | } |
| | | |
| | | |
| | | // 停止计时 |
| | | this.stopTimer() |
| | | |
| | | |
| | | // 重置状态 |
| | | this.isRecording = false |
| | | this.isPaused = false |
| | | this.currentSegment = null |
| | | |
| | | // 处理录音片段 |
| | | if (this.recordSegments.length > 0) { |
| | | try { |
| | | uni.showLoading({ |
| | | title: '正在处理音频...' |
| | | }) |
| | | |
| | | // 获取所有录音片段的URL |
| | | const audioUrls = this.recordSegments.map(segment => segment.url) |
| | | console.log('准备合并的音频片段列表:', audioUrls) |
| | | console.log('音频片段数量:', audioUrls.length) |
| | | |
| | | // 合并音频文件 |
| | | const mergedUrl = await this.mergeAudioFiles(audioUrls) |
| | | |
| | | // 创建合并后的音频数据对象 |
| | | const mergedAudioData = { |
| | | url: this.recordSegments[this.recordSegments.length - 1].url, |
| | | data: this.recordSegments[this.recordSegments.length - 1].data, |
| | | duration: this.seconds + this.minutes * 60 + this.hours * 3600 |
| | | setTimeout(async() => { |
| | | console.log('处理录音片段') |
| | | // 处理录音片段 |
| | | if (this.recordSegments.length > 0) { |
| | | try { |
| | | uni.showLoading({ |
| | | title: '正在处理音频...' |
| | | }) |
| | | |
| | | // 获取所有录音片段的URL |
| | | const audioUrls = this.recordSegments.map(segment => segment.url) |
| | | console.log('准备合并的音频片段列表:', audioUrls) |
| | | console.log('音频片段数量:', audioUrls.length) |
| | | |
| | | // 合并音频文件 |
| | | const mergedUrl = await this.mergeAudioFiles(audioUrls) |
| | | |
| | | // 创建合并后的音频数据对象 |
| | | const mergedAudioData = { |
| | | url: this.recordSegments[this.recordSegments.length - 1].url, |
| | | data: this.recordSegments[this.recordSegments.length - 1].data, |
| | | duration: this.seconds + this.minutes * 60 + this.hours * 3600 |
| | | } |
| | | |
| | | uni.showToast({ |
| | | title: '录制成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | this.$emit('submit', mergedAudioData) |
| | | }, 2000) |
| | | |
| | | uni.hideLoading() |
| | | this.closePopup() |
| | | } catch (error) { |
| | | console.error('音频合并失败:', error) |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title: '音频合并失败,请重试', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | uni.showToast({ |
| | | title: '录制成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | this.$emit('submit', mergedAudioData) |
| | | }, 2000) |
| | | |
| | | uni.hideLoading() |
| | | this.closePopup() |
| | | } catch (error) { |
| | | console.error('音频合并失败:', error) |
| | | uni.hideLoading() |
| | | uni.showToast({ |
| | | title: '音频合并失败,请重试', |
| | | title: '未检测到录音文件', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: '未检测到录音文件', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | } |
| | | }, 1000); |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | descriptionTitle: '', |
| | | descriptionContent: '', |
| | | videoContent: [], |
| | | latitude: '30.5061493', |
| | | longitude: '105.574542', |
| | | location: '测试地址', |
| | | latitude: '', |
| | | longitude: '', |
| | | location: '', |
| | | images: [], |
| | | videos: [], |
| | | voiceFile: '', //语音文件多个逗号拼接 |
| | |
| | | name: 'file', |
| | | header: { |
| | | // 'Content-Type': 'multipart/form-data', |
| | | 'Authorization': 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTU1MjI1Nzk1MDcwODEyMTgsInR5cGUiOjEsImV4cCI6MTc0Nzk4MzIyMiwiY3JlYXRlZCI6MTc0NjY4NzIyMjAxMX0.pmUfTkxkbBirDMbnMR1IaLsbSiiwHc366_yyAetCzTOWYxTNgmQlmvw26_W62NHLOebB_ZAEgZsPvkJcaLOoPg' |
| | | 'Authorization': uni.getStorageSync('token') |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | const response = JSON.parse(uploadFileRes.data); |
| | |
| | | <view class="fs-27 lh-38 font-bold">群众姓名</view> |
| | | <view class="fs-27 lh-38 mt-10">{{ info.name }}</view> |
| | | </view> |
| | | <view class="flex-column a-center"> |
| | | <view class="fs-27 lh-38 font-bold">联系电话</view> |
| | | <view class="fs-27 lh-38 mt-10">{{ info.contactNumber }}</view> |
| | | <view class="flex a-center"> |
| | | <view class="flex-column a-center"> |
| | | <view class="fs-27 lh-38 font-bold">联系电话</view> |
| | | <view class="fs-27 lh-38 mt-10">{{ info.contactNumber }}</view> |
| | | </view> |
| | | <image @click.stop="callPhone(info.contactNumber)" src="../../static/tell.png" |
| | | class="w-58 h-58 shrink0 " /> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="br-19 mt-38 bs-1 pt-35 pb-33 px-31"> |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | callPhone(phoneNumber) { |
| | | uni.makePhoneCall({ |
| | | phoneNumber |
| | | }); |
| | | }, |
| | | back() { |
| | | uni.navigateBack({ |
| | | delta: 2 |
| | |
| | | } |
| | | |
| | | .bgcolor1 { |
| | | background: linear-gradient( 270deg, rgba(255,241,0,0.5) 0%, rgba(255,249,172,0.25) 48%, rgba(255,255,255,0.2) 100%, #FFFFFF 100%); |
| | | background: linear-gradient(270deg, rgba(255, 241, 0, 0.5) 0%, rgba(255, 249, 172, 0.25) 48%, rgba(255, 255, 255, 0.2) 100%, #FFFFFF 100%); |
| | | } |
| | | |
| | | .bgcolor2 { |
| | |
| | | } |
| | | }, |
| | | onLoad(params) { |
| | | console.log('JSON.parse(params.data)', JSON.parse(params.data)) |
| | | this.complaintId = params.id |
| | | this.describe = JSON.parse(params.data).describe |
| | | this.progressId = JSON.parse(params.data).id |
| | | this.video = JSON.parse(params.data).video.split(',') |
| | | this.imgUrls = JSON.parse(params.data).imgUrl.split(',') |
| | | this.localImageUrls = JSON.parse(params.data).imgUrl.split(',') |
| | | this.video = JSON.parse(params.data).video ? JSON.parse(params.data).video.split(',') : [] |
| | | this.imgUrls = JSON.parse(params.data).imgUrl ? JSON.parse(params.data).imgUrl.split(',') : [] |
| | | this.localImageUrls = JSON.parse(params.data).imgUrl ? JSON.parse(params.data).imgUrl.split(',') : [] |
| | | getComplaintDetail({ |
| | | id: params.id |
| | | }).then(res => { |
| | |
| | | }, |
| | | methods: { |
| | | searchList() { |
| | | if (this.searchParams.keyword == '') { |
| | | uni.showToast({ |
| | | title: '请输入关键字搜索', |
| | | icon: 'none', |
| | | mask: true |
| | | }) |
| | | return |
| | | } |
| | | // if (this.searchParams.keyword == '') { |
| | | // uni.showToast({ |
| | | // title: '请输入关键字搜索', |
| | | // icon: 'none', |
| | | // mask: true |
| | | // }) |
| | | // return |
| | | // } |
| | | this.searchParams.pageNum = 1 |
| | | this.fetchList(this.searchParams, (e) => { |
| | | this.list = e.records || [] |
| | |
| | | }, |
| | | toDetailProgress(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/supervision/supervision-progress?id=${item.id}` |
| | | url: `/pages/supervision/supervision-progress?id=${this.type==1?item.id :item.complaintId}` |
| | | }) |
| | | }, |
| | | fetchList(params, callback) { |
| | |
| | | |
| | | <!-- 上级显示 --> |
| | | <view class="btnButtom" v-if="(!isParty)&&orderInfo.listControlsButtonStatus == 0"> |
| | | <view class="btnDown" @click.stop="toUp" v-if="userInfo.accountLevel > 1" |
| | | :class="[2, 3].includes(userInfo.accountLevel) ? '' : 'partyUp'">问题上报</view> |
| | | <view class="btnDown" @click.stop="toDown" v-if="userInfo.accountLevel < 4" |
| | | :class="[2, 3].includes(userInfo.accountLevel) ? '' : 'partyDown'">诉求下派</view> |
| | | <view class="btnDown" @click.stop="toUp" v-if="userInfo.levelId > 1" |
| | | :class="[2, 3].includes(userInfo.levelId) ? '' : 'partyUp'">问题上报</view> |
| | | <view class="btnDown" @click.stop="toDown" v-if="userInfo.levelId < 4" |
| | | :class="[2, 3].includes(userInfo.levelId) ? '' : 'partyDown'">诉求下派</view> |
| | | <view class="btnAdd" @click="addProgress">添加办理进度</view> |
| | | <view class="btnAdd" @click="resultEntery">办理结果录入</view> |
| | | </view> |