AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

318 lines
6.7 KiB

  1. <template>
  2. <view class="boox">
  3. <digital-human :width="0"
  4. rootStyle="position: fixed; left: 50%; top: 100rpx; transform: translateX(-50%);z-index: -1;">
  5. </digital-human>
  6. <view class="message-box">
  7. <!-- 对话框 -->
  8. <block v-for="(message, index) in messageList">
  9. <view :class="{lside: message.direction == 'lside', rside: message.direction == 'rside'}" :key="index">
  10. {{ message.text }}
  11. </view>
  12. </block>
  13. </view>
  14. <view class="input-box" style="padding: 0 24rpx;">
  15. <input style="border: 1rpx solid #00BFFF;height: 80rpx;padding: 0 24rpx;" placeholder="请输入" type="text"
  16. confirm-type="search" @confirm="sendChat">
  17. <view class="radio">
  18. <!-- <image class="voice" @click.stop="changeVoiceShow" src="/static/images/recordingManagement/voice.png"
  19. mode=""></image> -->
  20. <cover-view class="voiceContent">
  21. <cover-view class="box" @click.stop="" @touchstart="touchStart" @touchend="touchEnd">
  22. <cover-view class="center">
  23. <cover-image class="voice" src="/static/images/voice.png" mode="widthFix"></cover-image>
  24. <cover-view class="text">
  25. {{voiceState}}
  26. </cover-view>
  27. </cover-view>
  28. </cover-view>
  29. </cover-view>
  30. </view>
  31. </view>
  32. <!--
  33. <view class="topBox"
  34. style="position: fixed;left: 50%; bottom: 0; transform: translateX(-50%);z-index: 999999;width: 100vw;height: 40vh;background-color: #1890FF;">
  35. </view>
  36. -->
  37. <!-- <view class="booximg">
  38. <image v-if="domainObj.domain == 'zh.aihxz.com'" class="img"
  39. src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/wabIndexs.png" mode=""></image>
  40. <image v-else class="img" src="https://autoiot.oss-cn-beijing.aliyuncs.com/static/wabIndex.png" mode="">
  41. </image>
  42. </view>
  43. <view class="center-dingwei">
  44. <view class="dingwei-title" style="margin-top: 0">
  45. <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
  46. mode=""></image>
  47. <view class="desc">智能语音转写</view>
  48. </view>
  49. <view class="dingwei-title">
  50. <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
  51. mode=""></image>
  52. <view class="desc">高效的判客机制</view>
  53. </view>
  54. <view class="dingwei-title">
  55. <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
  56. mode=""></image>
  57. <view class="desc">全方位的客户跟进</view>
  58. </view>
  59. <view class="dingwei-title">
  60. <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
  61. mode=""></image>
  62. <view class="desc">专业的经纪管家</view>
  63. </view>
  64. <view class="dingwei-title">
  65. <image class="dingwei-img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png"
  66. mode=""></image>
  67. <view class="desc">在线实时沟通</view>
  68. </view>
  69. </view>
  70. <view @click="bindWxBLogin" class="button">
  71. <view class="view">
  72. 立即去登录
  73. </view>
  74. </view> -->
  75. </view>
  76. </template>
  77. <script>
  78. var app = getApp();
  79. var config = require("../../config");
  80. const domainObj = require('@/utils/domain.js');
  81. var plugins = requirePlugin("WechatSI");
  82. let manager = plugins.getRecordRecognitionManager();
  83. import human from './mathManIndex.js'
  84. export default {
  85. mixins: [human],
  86. data() {
  87. return {
  88. domainObj: domainObj, // 域名
  89. isRecording: false,
  90. voiceState: "你可以这样说...",
  91. };
  92. },
  93. onLoad() {
  94. this.initRecord()
  95. },
  96. onShow() {
  97. uni.request({
  98. url: config.service.verify,
  99. method: "GET",
  100. header: {
  101. 'content-type': 'application/json',
  102. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  103. },
  104. success: (data) => {
  105. if (data.data.code == 10000) {
  106. uni.switchTab({
  107. url: '/pages/index/index'
  108. });
  109. }
  110. }
  111. })
  112. },
  113. onHide() {},
  114. methods: {
  115. bindWxBLogin() {
  116. wx.navigateTo({
  117. url: '/pages/login/index'
  118. });
  119. },
  120. touchStart() {
  121. manager.start({
  122. duration: 60000,
  123. lang: "zh_CN"
  124. });
  125. },
  126. touchEnd() {
  127. uni.showToast()
  128. manager.stop();
  129. },
  130. /**
  131. * 初始化语音识别回调
  132. * 绑定语音播放开始事件
  133. */
  134. initRecord() {
  135. manager.onStart = (res) => {
  136. this.voiceState = "onStart:" + res.msg + "正在录音"
  137. };
  138. //有新的识别内容返回,则会调用此事件
  139. manager.onRecognize = (res) => {
  140. this.voiceState = res.result;
  141. }
  142. // 识别结束事件
  143. manager.onStop = async (res) => {
  144. this.voiceState = res.result;
  145. await this.getReply(res.result)
  146. }
  147. // 识别错误事件
  148. manager.onError = (res) => {
  149. this.voiceState = res.msg;
  150. }
  151. },
  152. }
  153. };
  154. </script>
  155. <style lang="scss">
  156. .boox {
  157. width: 100vw;
  158. height: 100vh;
  159. position: relative;
  160. .title {
  161. width: 100%;
  162. position: absolute;
  163. left: 0rpx;
  164. top: 100rpx;
  165. text-align: center;
  166. color: #FFFFFF;
  167. font-size: 32rpx;
  168. font-weight: 500;
  169. z-index: 1000;
  170. }
  171. .booximg {
  172. width: 100vw;
  173. height: 100vh;
  174. .img {
  175. width: 100%;
  176. height: 100%;
  177. }
  178. }
  179. .center-dingwei {
  180. width: 100%;
  181. position: absolute;
  182. left: 0rpx;
  183. bottom: 200rpx;
  184. .dingwei-title {
  185. height: 44rpx;
  186. display: flex;
  187. margin-left: 213rpx;
  188. margin-top: 20rpx;
  189. }
  190. .dingwei-img {
  191. width: 44rpx;
  192. height: 44rpx;
  193. }
  194. .desc {
  195. line-height: 44rpx;
  196. margin-left: 10rpx;
  197. font-size: 32rpx;
  198. color: #333333;
  199. }
  200. }
  201. .button {
  202. width: 100%;
  203. position: absolute;
  204. left: 0rpx;
  205. bottom: 60rpx;
  206. .view {
  207. width: 630rpx;
  208. height: 86rpx;
  209. margin: 0 auto;
  210. background: #2671E2;
  211. box-shadow: 0px 2rpx 20rpx 0rpx rgba(38, 113, 226, 0.5);
  212. border-radius: 49rpx;
  213. color: #FFFFFF;
  214. text-align: center;
  215. line-height: 86rpx;
  216. font-size: 32rpx;
  217. }
  218. }
  219. // 语音输入
  220. .message-box {
  221. padding: 24rpx;
  222. width: 100vw;
  223. height: 50vh;
  224. display: flex;
  225. flex-direction: column;
  226. justify-content: flex-end;
  227. .lside {
  228. display: flex;
  229. justify-content: flex-start;
  230. }
  231. .rside {
  232. display: flex;
  233. justify-content: flex-end;
  234. }
  235. }
  236. .voiceContent {
  237. width: 100vw;
  238. height: 90rpx;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. .box {
  243. width: 100%;
  244. height: 100%;
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. .center {
  249. width: 100%;
  250. height: 100%;
  251. background: #1590E9;
  252. display: flex;
  253. align-items: center;
  254. justify-content: center;
  255. .voice {
  256. width: 70rpx;
  257. height: 70rpx;
  258. }
  259. .text {
  260. color: #FFFFFF;
  261. font-size: 36rpx;
  262. margin-top: 24rpx;
  263. }
  264. }
  265. }
  266. }
  267. .voice {
  268. width: 44rpx;
  269. height: 44rpx;
  270. margin-left: 38rpx;
  271. }
  272. }
  273. </style>