From 95ac9029c648194c35dda58daaa17b9160bcb69d Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期三, 21 五月 2025 11:37:27 +0800 Subject: [PATCH] 2.0冒烟版本 --- H5/pages/supervision/supervision.vue | 18 +++--- H5/pages/add-progress/index.vue | 18 ++++- H5/pages/work-detail/work-detail.vue | 8 +- H5/pages/supervision/edit-supervision-progress.vue | 7 +- H5/components/voiceInputPopup.vue | 104 +++++++++++++++++----------------- H5/pages/Appeal/Appeal.vue | 8 +- 6 files changed, 88 insertions(+), 75 deletions(-) diff --git a/H5/components/voiceInputPopup.vue b/H5/components/voiceInputPopup.vue index b0393ee..790f483 100644 --- a/H5/components/voiceInputPopup.vue +++ b/H5/components/voiceInputPopup.vue @@ -107,7 +107,7 @@ console.log('当前录音片段URL:', res.localUrl) console.log('当前已存储的片段数:', this.recordSegments.length) console.log('当前片段:', this.currentSegment) - + // 只有当当前片段与上一个不同时才添加 if (!this.currentSegment || this.currentSegment.url !== res.localUrl) { console.log('添加新的录音片段') @@ -183,7 +183,7 @@ try { const audioContext = new (window.AudioContext || window.webkitAudioContext)(); const audioBuffers = []; - + // 加载所有音频文件 for (const url of audioUrls) { const response = await fetch(url); @@ -194,7 +194,7 @@ // 计算总时长 const totalLength = audioBuffers.reduce((acc, buffer) => acc + buffer.length, 0); - + // 创建新的音频缓冲区 const mergedBuffer = audioContext.createBuffer( audioBuffers[0].numberOfChannels, @@ -215,7 +215,7 @@ // 将合并后的音频转换为 Blob const wavBlob = await this.audioBufferToWav(mergedBuffer); const mergedUrl = URL.createObjectURL(wavBlob); - + return mergedUrl; } catch (error) { console.error('合并音频失败:', error); @@ -284,65 +284,67 @@ 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() { diff --git a/H5/pages/Appeal/Appeal.vue b/H5/pages/Appeal/Appeal.vue index 45a876b..2ccec30 100644 --- a/H5/pages/Appeal/Appeal.vue +++ b/H5/pages/Appeal/Appeal.vue @@ -178,9 +178,9 @@ descriptionTitle: '', descriptionContent: '', videoContent: [], - latitude: '30.5061493', - longitude: '105.574542', - location: '测试地址', + latitude: '', + longitude: '', + location: '', images: [], videos: [], voiceFile: '', //语音文件多个逗号拼接 @@ -305,7 +305,7 @@ 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); diff --git a/H5/pages/add-progress/index.vue b/H5/pages/add-progress/index.vue index 58bc82d..4e94abd 100644 --- a/H5/pages/add-progress/index.vue +++ b/H5/pages/add-progress/index.vue @@ -20,10 +20,15 @@ <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"> @@ -108,6 +113,11 @@ }) }, methods: { + callPhone(phoneNumber) { + uni.makePhoneCall({ + phoneNumber + }); + }, back() { uni.navigateBack({ delta: 2 @@ -315,7 +325,7 @@ } .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 { diff --git a/H5/pages/supervision/edit-supervision-progress.vue b/H5/pages/supervision/edit-supervision-progress.vue index 18a6bac..2aaa004 100644 --- a/H5/pages/supervision/edit-supervision-progress.vue +++ b/H5/pages/supervision/edit-supervision-progress.vue @@ -101,12 +101,13 @@ } }, 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 => { diff --git a/H5/pages/supervision/supervision.vue b/H5/pages/supervision/supervision.vue index 8e72eae..184f110 100644 --- a/H5/pages/supervision/supervision.vue +++ b/H5/pages/supervision/supervision.vue @@ -219,14 +219,14 @@ }, 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 || [] @@ -244,7 +244,7 @@ }, 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) { diff --git a/H5/pages/work-detail/work-detail.vue b/H5/pages/work-detail/work-detail.vue index a3bdef8..a858e28 100644 --- a/H5/pages/work-detail/work-detail.vue +++ b/H5/pages/work-detail/work-detail.vue @@ -331,10 +331,10 @@ <!-- 上级显示 --> <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> -- Gitblit v1.7.1