1.22 分包

This commit is contained in:
zoujiandong
2024-01-22 08:56:07 +08:00
parent 2bd2fd31ac
commit 48a8c3ebab
237 changed files with 453 additions and 8541 deletions
+52 -1
View File
@@ -1,4 +1,5 @@
import { TUIStore, StoreName, NAME } from "../index";
import { TUICallKitServer } from "../TUICallService/index";
const {
CALL_STATUS,
@@ -34,6 +35,7 @@ Component({
pusher: TUIStore.getData(StoreName.CALL, PUSHER), // TRTC 本地流
playerList: TUIStore.getData(StoreName.CALL, PLAYER), // TRTC 远端流
playerProcess: {}, // 经过处理的的远端流(多人通话)
timer:null
},
methods: {
// 监听通话状态变更回调
@@ -41,9 +43,58 @@ Component({
this.setData({
callStatus: value,
});
console.log("通话状态该笔");
if(value=='idle'){
this.sendCustom();
}
console.log("通话状态该笔:"+value);
console.log(this.data.callerUserInfo);
console.log(this.data.localUserInfo);
},
//纠正音视频电话不能携带自定义消息,结束后,主动发条消息
sendCustom(){
let THIS=this;
let {timer}=this.data;
if(timer){
clearTimeout(timer);
}
wx.getStorage({
key: 'patientInfo',
success (res) {
let patientInfo=JSON.parse(res.data);
let chat=TUICallKitServer.getTim();
let message = chat.createCustomMessage({
to:patientInfo.patient_user_id,
conversationType:"C2C",
payload: {
data:JSON.stringify({message_type:20,title:'[电话]'}),
description:'',
extension:''
},
cloudCustomData:JSON.stringify(patientInfo)
});
let time=setTimeout(()=>{
let promise = chat.sendMessage(message,{
messageControlInfo: {
excludedFromUnreadCount: true, // 消息不更新会话 unreadCount(消息存漫游)
}
});
promise.then(function(imResponse) {
console.log('发送成功');
console.log(imResponse);
}).catch(function(imError) {
// 发送失败
console.warn('sendMessage error:', imError);
});
},1000);
THIS.setData({
timer:time
})
}
})
},
// 监听是否群组通话变更回调
handleIsGroupChange(value) {
@@ -7,6 +7,9 @@ Component({
},
callStatus: {
type: String,
observer(callStatus) {
console.log("改编状态:"+callStatus);
}
},
callMediaType: {
type: Number,
@@ -39,12 +42,12 @@ Component({
IMG_ACCEPT: `${PATH}/dialing.png`,
IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`,
IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`,
IMG_AUDIO_TRUE:`${PATH}/audio-true.png`,
IMG_AUDIO_FALSE:`${PATH}/audio-false.png`,
IMG_CAMERA_TRUE:`${PATH}/camera-true.png`,
IMG_CAMERA_FALSE:`${PATH}/camera-false.png`,
IMG_TRANS:`${PATH}/trans.png`,
IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`,
IMG_AUDIO_TRUE:`${PATH}/doctor_audio_true.png`,
IMG_AUDIO_FALSE:`${PATH}/doctor_audio_false.png`,
IMG_CAMERA_TRUE:`${PATH}/doctor_camera_true.png`,
IMG_CAMERA_FALSE:`${PATH}/doctor_camera_false.png`,
IMG_TRANS:`${PATH}/doctor_trans.png`,
IMG_SWITCH_CAMERA:`${PATH}/doctor_switch_camera.png`,
patient_avatar:wx.getStorageSync('patient_avatar')
},
methods: {
@@ -76,22 +76,22 @@
</view> -->
<view class="btn-list">
<view wx:if="{{localUserInfo.isVideoAvailable && callRole == 'caller'}}" class="button-container">
<view class="btn-normal">
<image class="btn-image" src="{{IMG_SWITCH_CAMERA}}" data-device="{{pusher.frontCamera}}" catch:tap="switchCamera" />
<view class="btn-normal ">
<image class="btn-image newimg" src="{{IMG_SWITCH_CAMERA}}" data-device="{{pusher.frontCamera}}" catch:tap="switchCamera" />
</view>
<view class="white">切换</view>
</view>
<view class="button-container" bindtap="switchCallMediaType" wx:if="{{callRole == 'caller'}}">
<view class="btn-normal">
<image class="btn-image" src="{{IMG_TRANS}} "></image>
<image class="btn-image newimg" src="{{IMG_TRANS}} "></image>
</view>
<view class="white">切换至语音</view>
</view>
<view class="button-container" bindtap="microPhoneHandler" wx:if="{{callRole == 'caller'}}">
<view class="btn-normal">
<image class="btn-image" src="{{localUserInfo.isAudioAvailable? IMG_AUDIO_TRUE: IMG_AUDIO_FALSE}} "></image>
<image class="btn-image newimg" src="{{localUserInfo.isAudioAvailable? IMG_AUDIO_TRUE: IMG_AUDIO_FALSE}} "></image>
</view>
<view class="white">麦克风</view>
<view class="white">语音</view>
</view>
<!-- <view class="button-container" bindtap="toggleSoundMode">
<view class="btn-normal">
@@ -116,7 +116,7 @@
</view>
<text class="white">挂断</text>
</view>
<view class="btn-list-item other-view" >
<!-- <view class="btn-list-item other-view" >
<view class="btn-container">
<view class="btn-hangup" bindtap="accept">
<image class="btn-image" src="{{IMG_ACCEPT}}"></image>
@@ -124,7 +124,7 @@
</view>
<text class="white">接听</text>
</view>
</view> -->
</view>
</view>
</view>
@@ -181,7 +181,7 @@
<view class="btn-normal" bindtap="microPhoneHandler">
<image class="btn-image" src="{{localUserInfo.isAudioAvailable? IMG_AUDIO_TRUE: IMG_AUDIO_FALSE}} "></image>
</view>
<view>麦克风</view>
<view>语音</view>
</view>
<view class="button-container">
<view class="btn-hangup" bindtap="hangup">
@@ -200,7 +200,7 @@
<!-- 视频通话接听状态按钮 -->
<view wx:if="{{callStatus === 'connected' && callMediaType === 2}}" class="invite-calling">
<view class="handle-btns">
<view class="other-view white">
<view class="other-view white" style="margin-bottom: 50rpx;">
<text>{{callDuration}}</text>
</view>
<!-- <view class="btn-operate-item call-switch" catch:tap="switchCallMediaType">
@@ -209,25 +209,27 @@
</view>
<text>切到语音通话</text>
</view> -->
<view class="btn-list">
<view class="button-container" bindtap="microPhoneHandler">
<view class="btn-normal">
<image class="btn-image" src="{{localUserInfo.isAudioAvailable? IMG_AUDIO_TRUE: IMG_AUDIO_FALSE}} "></image>
</view>
<view class="white">语音</view>
</view>
<view class="button-container" bindtap="toggleSoundMode">
<view class="btn-normal">
<image class="btn-image" src="{{isEarPhone ? IMG_SPEAKER_FALSE: IMG_SPEAKER_TRUE}} "></image>
</view>
<text class="white">扬声器</text>
</view>
<view class="btn-list" style="width:85%;margin:0 auto;">
<view class="button-container" bindtap="switchCamera" wx:if="{{localUserInfo.isVideoAvailable}}">
<view class="btn-normal">
<image class="btn-image" src="{{IMG_SWITCH_CAMERA}}" data-device="{{pusher.frontCamera}}" src="{{IMG_SWITCH_CAMERA}} "></image>
<image class="btn-image newimg" src="{{IMG_SWITCH_CAMERA}}" data-device="{{pusher.frontCamera}}" src="{{IMG_SWITCH_CAMERA}} "></image>
</view>
<text class="white">摄像头</text>
<text class="white">切换</text>
</view>
<view class="button-container" bindtap="hangup">
<view class="btn-normal" style="width:8vh;height:8vh">
<image class="btn-image" src="{{IMG_HANGUP}}"></image>
<!-- <image class="btn-image" src="{{isEarPhone ? IMG_SPEAKER_FALSE: IMG_SPEAKER_TRUE}} "></image> -->
</view>
<text class="white">挂断</text>
</view>
<view class="button-container" bindtap="microPhoneHandler">
<view class="btn-normal">
<image class="btn-image newimg" src="{{localUserInfo.isAudioAvailable? IMG_AUDIO_TRUE: IMG_AUDIO_FALSE}} "></image>
</view>
<view class="white">静音</view>
</view>
</view>
<!-- <view class="btn-list">
<view class="btn-list-item other-view">
@@ -306,8 +306,8 @@
}
.btn-normal {
width: 8vh;
height: 8vh;
/* width: 8vh;
height: 8vh; */
box-sizing: border-box;
display: flex;
flex-direction: column;
@@ -321,6 +321,14 @@
width: 100%;
height: 100%;
background: none;
}
.btn-image.newimg{
background: rgba(0,0,0,0.45);
width:56rpx;
height:56rpx;
padding:25rpx;
border-radius: 50%;
}
.btn-hangup {
@@ -33,10 +33,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TUIStore = exports.TUIGlobal = void 0;
const tui_core_1 = require("@tencentcloud/tui-core");
const tui_core_1 = require("../../min-npm/@tencentcloud/tui-core/index");
const index_1 = require("../const/index");
// @ts-ignore
const tuicall_engine_wx_1 = require("tuicall-engine-wx");
const tuicall_engine_wx_1 = require("../../min-npm/tuicall-engine-wx/index");
const index_2 = require("../locales/index");
const miniProgram_1 = require("./miniProgram");
const bellContext_1 = require("./bellContext");