|
@@ -78,20 +78,35 @@
|
|
|
</view> -->
|
|
</view> -->
|
|
|
<view class="sub-btn" v-if="!checkItemModuleType">
|
|
<view class="sub-btn" v-if="!checkItemModuleType">
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
- <img
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="broadcast_m no-long-press"
|
|
|
|
|
+ @longpress.stop="recordButton(item,$event)"
|
|
|
|
|
+ @touchmove.stop="cancelButton"
|
|
|
|
|
+ @touchend.stop="sendButton(item,$event)"
|
|
|
|
|
+ ></view>
|
|
|
|
|
+ <!-- <img
|
|
|
@longpress.stop="recordButton(item,$event)"
|
|
@longpress.stop="recordButton(item,$event)"
|
|
|
@touchmove.stop="cancelButton"
|
|
@touchmove.stop="cancelButton"
|
|
|
@touchend.stop="sendButton(item,$event)"
|
|
@touchend.stop="sendButton(item,$event)"
|
|
|
- :src="imagesUrl('safetyCheck/icon_aqjc_luyin.png')" />
|
|
|
|
|
|
|
+ :src="imagesUrl('safetyCheck/icon_aqjc_luyin.png')" /> -->
|
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef WEB -->
|
|
<!-- #ifdef WEB -->
|
|
|
- <img
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="broadcast_m no-long-press"
|
|
|
|
|
+ @touchstart="handleTouchStart"
|
|
|
|
|
+ @touchmove="handleTouchMove"
|
|
|
|
|
+ @touchend="handleTouchEnd"
|
|
|
|
|
+ @touchcancel="handleTouchEnd"
|
|
|
|
|
+ @contextmenu.prevent="handleContextMenu"
|
|
|
|
|
+ ></view>
|
|
|
|
|
+ <!-- <img
|
|
|
@touchstart="handleTouchStart"
|
|
@touchstart="handleTouchStart"
|
|
|
@touchmove="handleTouchMove"
|
|
@touchmove="handleTouchMove"
|
|
|
@touchend="handleTouchEnd"
|
|
@touchend="handleTouchEnd"
|
|
|
@touchcancel="handleTouchEnd"
|
|
@touchcancel="handleTouchEnd"
|
|
|
@contextmenu.prevent="handleContextMenu"
|
|
@contextmenu.prevent="handleContextMenu"
|
|
|
- :src="imagesUrl('safetyCheck/icon_aqjc_luyin.png')" />
|
|
|
|
|
|
|
+ :src="imagesUrl('safetyCheck/icon_aqjc_luyin.png')" /> -->
|
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
<img @click="selectImage()" :src="imagesUrl('safetyCheck/icon_aqjc_paizhao.png')" />
|
|
<img @click="selectImage()" :src="imagesUrl('safetyCheck/icon_aqjc_paizhao.png')" />
|
|
|
<img @click="submitForm(2)" :src="imagesUrl('safetyCheck/icon_aqjc_tijiao.png')" />
|
|
<img @click="submitForm(2)" :src="imagesUrl('safetyCheck/icon_aqjc_tijiao.png')" />
|
|
@@ -477,7 +492,7 @@
|
|
|
async voicePlay(item) {
|
|
async voicePlay(item) {
|
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
|
// innerAudioContext.autoplay = true;
|
|
// innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = uni.getStorageSync('fileBrowseEnvironment') + '/' + item;
|
|
|
|
|
|
|
+ innerAudioContext.src = uni.getStorageSync('fileBrowseEnvironmentS') + '/' + item;
|
|
|
innerAudioContext.onPlay(() => {
|
|
innerAudioContext.onPlay(() => {
|
|
|
// console.log('开始播放');
|
|
// console.log('开始播放');
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -644,17 +659,16 @@
|
|
|
async initRecorder() {
|
|
async initRecorder() {
|
|
|
try {
|
|
try {
|
|
|
// 获取麦克风权限
|
|
// 获取麦克风权限
|
|
|
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
|
|
|
+
|
|
|
this.recorder = new Recorder({
|
|
this.recorder = new Recorder({
|
|
|
type: "mp3", // 输出格式
|
|
type: "mp3", // 输出格式
|
|
|
- bitRate: 128, // 比特率
|
|
|
|
|
- sampleRate: 44100 // 采样率
|
|
|
|
|
|
|
+ bitRate: 64, // 降低比特率提升兼容性
|
|
|
|
|
+ // 不指定 sampleRate,让浏览器使用系统默认值(iOS 兼容性要求)
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.recorder.open(() => {
|
|
this.recorder.open(() => {
|
|
|
- // console.log("录音器初始化成功");
|
|
|
|
|
- this.recorder.start(); // 初始化后立即开始录音
|
|
|
|
|
|
|
+ // 初始化成功,继续 startRecord 流程
|
|
|
this.startRecord();
|
|
this.startRecord();
|
|
|
}, (error) => {
|
|
}, (error) => {
|
|
|
console.error("录音器初始化失败:", error);
|
|
console.error("录音器初始化失败:", error);
|
|
@@ -861,6 +875,7 @@
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
<style lang="stylus" scoped>
|
|
|
|
|
+ @import '@/api/request/imagesUrl.styl';
|
|
|
.inspectAdd {
|
|
.inspectAdd {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display flex;
|
|
display flex;
|
|
@@ -1190,6 +1205,12 @@
|
|
|
width: 160rpx;
|
|
width: 160rpx;
|
|
|
height: 160rpx;
|
|
height: 160rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+ .broadcast_m{
|
|
|
|
|
+ width: 160rpx;
|
|
|
|
|
+ height: 160rpx;
|
|
|
|
|
+ background-size:160rpx 160rpx !important;
|
|
|
|
|
+ background: url($imagesUrl+'safetyCheck/icon_aqjc_luyin.png');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.inspectRecord{
|
|
.inspectRecord{
|
|
|
position: fixed;
|
|
position: fixed;
|