|
- <template>
- <view class="boox">
- <digital-human :width="0"
- rootStyle="position: fixed; left: 50%; top: 100rpx; transform: translateX(-50%);z-index: -1;">
- </digital-human>
-
- <view class="message-box">
- <!-- 对话框 -->
- <block v-for="(message, index) in messageList">
- <view :class="{lside: message.direction == 'lside', rside: message.direction == 'rside'}" :key="index">
- {{ message.text }}
- </view>
- </block>
- </view>
- <view class="input-box" style="padding: 0 24rpx;">
- <input style="border: 1rpx solid #00BFFF;height: 80rpx;padding: 0 24rpx;" placeholder="请输入" type="text"
- confirm-type="search" @confirm="sendChat">
-
- <view class="radio">
- <!-- <image class="voice" @click.stop="changeVoiceShow" src="/static/images/recordingManagement/voice.png"
- mode=""></image> -->
-
- <cover-view class="voiceContent">
- <cover-view class="box" @click.stop="" @touchstart="touchStart" @touchend="touchEnd">
- <cover-view class="center">
- <cover-image class="voice" src="/static/images/voice.png" mode="widthFix"></cover-image>
- <cover-view class="text">
- {{voiceState}}
- </cover-view>
- </cover-view>
- </cover-view>
- </cover-view>
- </view>
- </view>
-
- <!--
- <view class="topBox"
- style="position: fixed;left: 50%; bottom: 0; transform: translateX(-50%);z-index: 999999;width: 100vw;height: 40vh;background-color: #1890FF;">
- </view>
- -->
- <!-- <view class="booximg">
- <image v-if="domainObj.domain == 'zh.aihxz.com'" class="img"
- src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/wabIndexs.png" mode=""></image>
- <image v-else class="img" src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/wabIndex.png" mode="">
- </image>
- </view>
-
- <view class="center-dingwei">
- <view class="dingwei-title" style="margin-top: 0">
- <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
- mode=""></image>
- <view class="desc">智能语音转写</view>
- </view>
- <view class="dingwei-title">
- <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
- mode=""></image>
- <view class="desc">高效的判客机制</view>
- </view>
- <view class="dingwei-title">
- <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
- mode=""></image>
- <view class="desc">全方位的客户跟进</view>
- </view>
- <view class="dingwei-title">
- <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
- mode=""></image>
- <view class="desc">专业的经纪管家</view>
- </view>
- <view class="dingwei-title">
- <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
- mode=""></image>
- <view class="desc">在线实时沟通</view>
- </view>
- </view>
-
- <view @click="bindWxBLogin" class="button">
- <view class="view">
- 立即去登录
- </view>
- </view> -->
- </view>
- </template>
-
- <script>
- var app = getApp();
- var config = require("../../config");
- const domainObj = require('@/utils/domain.js');
-
- var plugins = requirePlugin("WechatSI");
- let manager = plugins.getRecordRecognitionManager();
-
- import human from './mathManIndex.js'
-
- export default {
- mixins: [human],
- data() {
- return {
- domainObj: domainObj, // 域名
-
- isRecording: false,
- voiceState: "你可以这样说...",
- };
- },
-
- onLoad() {
- this.initRecord()
- },
-
- onShow() {
- uni.request({
- url: config.service.verify,
- method: "GET",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- },
- success: (data) => {
- if (data.data.code == 10000) {
- uni.switchTab({
- url: '/pages/index/index'
- });
- }
- }
- })
- },
- onHide() {},
- methods: {
- bindWxBLogin() {
- wx.navigateTo({
- url: '/pages/login/index'
- });
- },
-
- touchStart() {
- manager.start({
- duration: 60000,
- lang: "zh_CN"
- });
- },
- touchEnd() {
- uni.showToast()
- manager.stop();
- },
- /**
- * 初始化语音识别回调
- * 绑定语音播放开始事件
- */
- initRecord() {
- manager.onStart = (res) => {
- this.voiceState = "onStart:" + res.msg + "正在录音"
- };
- //有新的识别内容返回,则会调用此事件
- manager.onRecognize = (res) => {
- this.voiceState = res.result;
- }
-
- // 识别结束事件
- manager.onStop = async (res) => {
-
- this.voiceState = res.result;
-
- await this.getReply(res.result)
- }
-
- // 识别错误事件
- manager.onError = (res) => {
-
- this.voiceState = res.msg;
-
- }
- },
- }
- };
- </script>
- <style lang="scss">
- .boox {
- width: 100vw;
- height: 100vh;
- position: relative;
-
- .title {
- width: 100%;
- position: absolute;
- left: 0rpx;
- top: 100rpx;
- text-align: center;
- color: #FFFFFF;
- font-size: 32rpx;
- font-weight: 500;
- z-index: 1000;
- }
-
- .booximg {
- width: 100vw;
- height: 100vh;
-
- .img {
- width: 100%;
- height: 100%;
- }
- }
-
- .center-dingwei {
- width: 100%;
- position: absolute;
- left: 0rpx;
- bottom: 200rpx;
-
- .dingwei-title {
- height: 44rpx;
- display: flex;
- margin-left: 213rpx;
- margin-top: 20rpx;
- }
-
- .dingwei-img {
- width: 44rpx;
- height: 44rpx;
- }
-
- .desc {
- line-height: 44rpx;
- margin-left: 10rpx;
- font-size: 32rpx;
- color: #333333;
- }
- }
-
- .button {
- width: 100%;
- position: absolute;
- left: 0rpx;
- bottom: 60rpx;
-
- .view {
- width: 630rpx;
- height: 86rpx;
- margin: 0 auto;
- background: #2671E2;
- box-shadow: 0px 2rpx 20rpx 0rpx rgba(38, 113, 226, 0.5);
- border-radius: 49rpx;
- color: #FFFFFF;
- text-align: center;
- line-height: 86rpx;
- font-size: 32rpx;
- }
- }
-
-
-
- // 语音输入
- .message-box {
- padding: 24rpx;
- width: 100vw;
- height: 50vh;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
-
- .lside {
- display: flex;
- justify-content: flex-start;
- }
-
- .rside {
- display: flex;
- justify-content: flex-end;
- }
- }
-
-
-
- .voiceContent {
- width: 100vw;
- height: 90rpx;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .box {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .center {
- width: 100%;
- height: 100%;
- background: #1590E9;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .voice {
- width: 70rpx;
- height: 70rpx;
- }
-
- .text {
- color: #FFFFFF;
- font-size: 36rpx;
- margin-top: 24rpx;
- }
- }
- }
-
- }
-
-
- .voice {
- width: 44rpx;
- height: 44rpx;
- margin-left: 38rpx;
- }
- }
- </style>
|