患者端1.0
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<block>
|
||||
<view class="audio-message {{isMine?'my-audio':''}}">
|
||||
<view class="audio-message {{isMine?'my-audio':'your-audio'}}">
|
||||
<!-- 默认状态 未播放 -->
|
||||
<view class='audio' wx:if="{{!isPlay}}" bindtap='audioPlay' data-id="{{message.ID}}" >
|
||||
<image class="image {{isMine?'my-image':''}}" src="../../../../../static/images/sendingaudio.png"/> {{renderDom[0].second}}s
|
||||
|
||||
+41
-3
@@ -4,9 +4,22 @@
|
||||
border: 1px solid #D9D9D9;
|
||||
}
|
||||
.my-audio {
|
||||
border-radius: 10px 2px 10px 10px;
|
||||
background: rgba(0,110,255,0.10);
|
||||
border: 1px solid rgba(0,110,255,0.30);
|
||||
position: relative;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
background: rgb(212, 239, 241);
|
||||
border: 1rpx solid #1ACAD3;
|
||||
}
|
||||
.my-audio::after{
|
||||
content:'';
|
||||
position: absolute;
|
||||
top: 35rpx;
|
||||
right: -19rpx;
|
||||
transform: translate(-50%,-50%) rotate(-135deg);
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: rgb(212, 239, 241);
|
||||
border: 1rpx solid #1ACAD3;
|
||||
border-style: none none solid solid
|
||||
}
|
||||
.audio {
|
||||
/*border-radius: 2px 10px 10px 10px;*/
|
||||
@@ -29,4 +42,29 @@
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
transform:rotate(180deg)
|
||||
}
|
||||
.my-text {
|
||||
position: relative;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
background: rgb(212, 239, 241);
|
||||
border: 1rpx solid #1ACAD3;
|
||||
}
|
||||
|
||||
.your-audio{
|
||||
position: relative;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
background: rgb(255, 255, 255);
|
||||
border: 1rpx solid #D8D8D8;
|
||||
}
|
||||
.your-audio::after{
|
||||
content:'';
|
||||
position: absolute;
|
||||
top: 35rpx;
|
||||
left: 0;
|
||||
transform: translate(-50%,-50%) rotate(45deg);
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: rgb(255, 255, 255);
|
||||
border: 1rpx solid #D8D8D8;
|
||||
border-style: none none solid solid
|
||||
}
|
||||
@@ -181,7 +181,15 @@ Component({
|
||||
payload: {
|
||||
file: res,
|
||||
},
|
||||
cloudCustomData: JSON.stringify({
|
||||
order_inquiry_id:this.data.order_inquiry_id,
|
||||
inquiry_type:this.data.inquiry_type,
|
||||
message_rounds:this.data.msgData.msg_round,
|
||||
patient_family_data:this.data.patient_family_data,
|
||||
is_system:0
|
||||
})
|
||||
});
|
||||
//this.sendCallback();
|
||||
this.$sendTIMMessage(message);
|
||||
}
|
||||
}
|
||||
@@ -260,29 +268,32 @@ Component({
|
||||
|
||||
// 长按录音
|
||||
handleLongPress(e) {
|
||||
wx.aegis.reportEvent({
|
||||
name: 'messageType',
|
||||
ext1: 'messageType-audio',
|
||||
ext2: wx.$chat_reportType,
|
||||
ext3: wx.$chat_SDKAppID,
|
||||
});
|
||||
this.recorderManager.start({
|
||||
duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
|
||||
sampleRate: 44100, // 采样率
|
||||
numberOfChannels: 1, // 录音通道数
|
||||
encodeBitRate: 192000, // 编码码率
|
||||
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通
|
||||
});
|
||||
this.setData({
|
||||
startPoint: e.touches[0],
|
||||
title: '正在录音',
|
||||
// isRecording : true,
|
||||
// canSend: true,
|
||||
notShow: true,
|
||||
isShow: false,
|
||||
isRecording: true,
|
||||
popupToggle: true,
|
||||
});
|
||||
if(this.setMsgRound()){
|
||||
wx.aegis.reportEvent({
|
||||
name: 'messageType',
|
||||
ext1: 'messageType-audio',
|
||||
ext2: wx.$chat_reportType,
|
||||
ext3: wx.$chat_SDKAppID,
|
||||
});
|
||||
this.recorderManager.start({
|
||||
duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
|
||||
sampleRate: 44100, // 采样率
|
||||
numberOfChannels: 1, // 录音通道数
|
||||
encodeBitRate: 192000, // 编码码率
|
||||
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通
|
||||
});
|
||||
this.setData({
|
||||
startPoint: e.touches[0],
|
||||
title: '正在录音',
|
||||
// isRecording : true,
|
||||
// canSend: true,
|
||||
notShow: true,
|
||||
isShow: false,
|
||||
isRecording: true,
|
||||
popupToggle: true,
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 录音时的手势上划移动距离对应文案变化
|
||||
@@ -377,7 +388,7 @@ Component({
|
||||
sourceType: [type],
|
||||
mediaType: [mediaType],
|
||||
success: (res) => {
|
||||
this.sendCallback();
|
||||
//this.sendCallback();
|
||||
const mediaInfoList = res.tempFiles;
|
||||
mediaInfoList.forEach((mediaInfo) => {
|
||||
fileList.push({ type: res.type, tempFiles: [{ tempFilePath: mediaInfo.tempFilePath }] });
|
||||
@@ -731,7 +742,7 @@ Component({
|
||||
const to =this.getToAccount();
|
||||
const text = flag ? msg : this.data.message;
|
||||
const { FEAT_NATIVE_CODE } = constant;
|
||||
this.sendCallback();
|
||||
//this.sendCallback();
|
||||
const message = wx.$TUIKit.createTextMessage({
|
||||
to,
|
||||
conversationType: this.data.conversation.type,
|
||||
@@ -953,6 +964,7 @@ Component({
|
||||
ext3: wx.$chat_SDKAppID,
|
||||
});
|
||||
}
|
||||
this.sendCallback();
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.log(`| TUI-chat | message-input | sendMessageError: ${error.code} `);
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
</view>
|
||||
<view class="TUI-message-input">
|
||||
|
||||
<!-- <image class="TUI-icon" bindtap="switchAudio" src="{{isAudio ? '../../../../static/assets/keyboard.svg' : '../../../../static/assets/audio.svg'}}" /> -->
|
||||
<image class="TUI-icon" bindtap="switchAudio" src="{{isAudio ? '../../../../static/assets/keyboard.svg' : '../../../../static/assets/audio.svg'}}" />
|
||||
<view wx:if="{{!isAudio || isEmoji}}" class="TUI-message-input-main {{ focus && 'TUI-message-input-main-focus'}}">
|
||||
<view class="textbox" hidden="{{hideText}}">
|
||||
|
||||
</view>
|
||||
<textarea class="TUI-message-input-area" adjust-position="{{true}}" cursor-spacing="-300" placeholder="请输入文字" value="{{message}}" bindinput="onInputValueChange" maxlength="-1" type="text" auto-height="{{true}}" placeholder-class="textarea-placeholder" confirm-type="send" show-confirm-bar="{{false}}" disable-default-padding="{{true}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" bindconfirm="sendTextMessage" />
|
||||
</view>
|
||||
<view wx:if="{{isAudio}}" class="TUI-message-input-main" bind:longpress="handleLongPress" bind:touchmove="handleTouchMove" bind:touchend="handleTouchEnd" style="display: flex; justify-content: center; font-size: 32rpx; font-family: PingFangSC-Regular; height: 30px">
|
||||
<view wx:if="{{isAudio}}" class="TUI-message-input-main audio-main" bind:longpress="handleLongPress" bind:touchmove="handleTouchMove" bind:touchend="handleTouchEnd" style="display: flex; justify-content: center; font-size: 32rpx; font-family: PingFangSC-Regular; height: 30px">
|
||||
<text>{{text}}</text>
|
||||
</view>
|
||||
<view class="TUI-message-input-functions" hover-class="none">
|
||||
<view class="TUI-message-input-functions" hover-class="none" wx:if="{{!isAudio || isEmoji}}">
|
||||
<view class="TUI-sendMessage-btn">
|
||||
<image class="TUI-icon" bindtap="handleEmoji" src="../../../../static/images/emoji.png" />
|
||||
</view>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding-bottom: 16rpx;
|
||||
align-items: center;
|
||||
margin: 30rpx 32rpx 0;
|
||||
/* background-color: #F1F1F1; */
|
||||
/* width: 100vw; */
|
||||
@@ -57,6 +58,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.audio-main{
|
||||
padding:12rpx 10rpx;
|
||||
}
|
||||
|
||||
.TUI-message-input-main-focus {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user