浏览代码

更换msgpack

gemercheung 2 年之前
父节点
当前提交
435726d3a7

+ 2 - 1
miniprogram/pages/room/libs/audioManager.ts

@@ -7,7 +7,7 @@ export interface AudioManger {
 }
 
 
-export const audioManger= (params: VoiceProps) => {
+export const audioManger = (params: VoiceProps) => {
   let ring = false
 
   const start = () => {
@@ -20,6 +20,7 @@ export const audioManger= (params: VoiceProps) => {
       app.setVoiceProps({
         userId: params.userId,
         sdkAppID: params.sdkAppID,
+        role: params.role,
         sig: params.sig,
         noMute: false,
         action: 'startCall'

+ 4 - 2
miniprogram/pages/room/room.ts

@@ -6,7 +6,8 @@ import { server } from '../../config'
 import { authorizeRecord } from '../../utils/util'
 import { audioManger, AudioManger } from './libs/audioManager'
 // import Dialog from 'tdesign-miniprogram/dialog/index';
-const { io } = require('../../utils/socket.io-v4-no-msgpack')
+// const { io } = require('../../utils/socket.io-v4-no-msgpack')
+const { io } = require('../../utils/socket.io-v4.msgpack')
 
 Page({
   socket: {} as SocketIOClient.Socket,
@@ -91,7 +92,7 @@ Page({
       //     }
       //   }
       // });
-      this.setData({ role: 'cusomter' })
+      this.setData({ role: 'customer' })
     }
   },
 
@@ -195,6 +196,7 @@ Page({
       userId: userId,
       sdkAppID: sign.sdkAppId,
       sig: sign.sign,
+      role: this.data.webviewParams.role,
       noMute: false,
     })
     if (!this.audioManger.ring) {

+ 1 - 1
miniprogram/pages/room/room.wxml

@@ -6,7 +6,7 @@
 </cover-view> -->
 
 <block wx:if="{{ webUrl }}">
-  <web-view src="{{webUrl}}" bindmessage="webmessage"></web-view>
+  <web-view src="{{webUrl}}" bindmessage="webmessage" class="web-view"></web-view>
 </block>
 
 <cover-view class="invitation-view" wx:if="{{showShare}}">

文件差异内容过多而无法显示
+ 10 - 0
miniprogram/utils/socket.io-v4.msgpack.js


+ 2 - 1
project.config.json

@@ -28,7 +28,8 @@
     "es6": true,
     "enhance": true,
     "ignoreUploadUnusedFiles": true,
-    "minified": true
+    "minified": true,
+    "condition": false
   },
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},

+ 2 - 1
project.private.config.json

@@ -4,5 +4,6 @@
   "setting": {
     "compileHotReLoad": false,
     "bigPackageSizeSupport": true
-  }
+  },
+  "libVersion": "2.30.1"
 }

+ 1 - 0
typings/index.d.ts

@@ -9,6 +9,7 @@ interface VoiceProps {
   action?: string
   userId?: string
   roomId?: string
+  role?: string
 }
 
 interface GlobalUserInfo extends WechatMiniprogram.UserInfo {