Explorar o código

修改部分IOS兼容

dedsudiyu hai 3 semanas
pai
achega
31bae51f60

+ 3 - 1
pages/views/login/login.vue

@@ -236,7 +236,9 @@
 					uni.setStorageSync('mqttPassword', Decrypt(obj.mqttExtranetPassword))
 					//文件浏览环境
 					uni.setStorageSync('fileBrowseEnvironment','http://'+Decrypt(obj.fileBrowseEnvironment))
-					uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
+					uni.setStorageSync('fileBrowseEnvironmentS','https://'+Decrypt(obj.fileBrowseEnvironment))
+					uni.setStorageSync('fileBrowseEnvironmentExtranet','http://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
+					uni.setStorageSync('fileBrowseEnvironmentExtranetS','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
 				}
 			},
 			//查询是否是管理员/安全员

+ 3 - 1
pages/views/login/ssoCertification.vue

@@ -159,7 +159,9 @@
 					uni.setStorageSync('mqttPassword', Decrypt(obj.mqttExtranetPassword))
 					//文件浏览环境
 					uni.setStorageSync('fileBrowseEnvironment','http://'+Decrypt(obj.fileBrowseEnvironment))
-					uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
+					uni.setStorageSync('fileBrowseEnvironmentS','https://'+Decrypt(obj.fileBrowseEnvironment))
+					uni.setStorageSync('fileBrowseEnvironmentExtranet','http://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
+					uni.setStorageSync('fileBrowseEnvironmentExtranetS','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
 				}
 			},
 			//获取权限字段

+ 6 - 7
pages_manage/views/emergencyEvacuationBig.vue

@@ -1202,17 +1202,16 @@
 			async initRecorder() {
 				try {
 					// 获取麦克风权限
-					const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
-					
+					await navigator.mediaDevices.getUserMedia({ audio: true });
+
 					this.recorder = new Recorder({
 						type: "mp3", // 输出格式
-						bitRate: 128, // 比特率
-						sampleRate: 44100 // 采样率
+						bitRate: 64,  // 降低比特率提升兼容性
+						// 不指定 sampleRate,让浏览器使用系统默认值(iOS 兼容性要求)
 					});
-					
+
 					this.recorder.open(() => {
-						// console.log("录音器初始化成功");
-						this.recorder.start(); // 初始化后立即开始录音
+						// 初始化成功,继续 startRecord 流程
 						this.startRecord();
 					}, (error) => {
 						console.error("录音器初始化失败:", error);

+ 4 - 5
pages_manage/views/laboratory/voiceBroadcast.vue

@@ -302,17 +302,16 @@
 			async initRecorder() {
 				try {
 					// 获取麦克风权限
-					const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
+					await navigator.mediaDevices.getUserMedia({ audio: true });
 					
 					this.recorder = new Recorder({
 						type: "mp3", // 输出格式
-						bitRate: 128, // 比特率
-						sampleRate: 44100 // 采样率
+						bitRate: 64,  // 降低比特率提升兼容性
+						// 不指定 sampleRate,让浏览器使用系统默认值(iOS 兼容性要求)
 					});
 					
 					this.recorder.open(() => {
-						// console.log("录音器初始化成功");
-						this.recorder.start(); // 初始化后立即开始录音
+						// 初始化成功,继续 startRecord 流程
 						this.startRecord();
 					}, (error) => {
 						console.error("录音器初始化失败:", error);

+ 33 - 12
pages_safetyCheck/views/inspectManage/conductInspections.vue

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