<template>
	<view class="translation" @click="changeEditing(false)">
		<view class="top" style="margin-top: 30rpx;">
			<view class="title">
				<view class="call_record_time">{{date}}</view>

				<view class="hash" @click="delTheFullText" v-if="CHECKAUTHORITY('ccal')">
					删除案例
				</view>
				<view class="hash" @click="gotoChat" v-if="commentList.length != 0">
					查看全部评论
				</view>
			</view>
			<view class="call_record_time_one">接待时长 {{alltimeStr}}
				<u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
				<view class="file-change" v-if="isshowFile">
					<view class="file-item" v-for="(item,index) in luyinList" :key="index"
						@click="filechange(item,index)" :class="{fileactive: csdFileindex == index}">录音文件{{index+1}}
					</view>
				</view>
			</view>
			<zaudio @checkPlaybackRate="checkPlaybackRate" :duration="duration" theme="theme4"></zaudio>
		</view>
		<scroll-view :scroll-top="scrollTop" lower-threshold='20px' @scrolltolower="ltolower()"
			:scroll-into-view="scrollId" scroll-y="true" class="text scroll-Y">
			<!-- 音频识别模块 -->
			<view>
				<!-- 聊天记录-->
				<view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
					<view :id="'dialog'+i" class="fileName">录音文件</view>
					<view class="text dingweishiy" :id="'dialog'+csdFileindex+'text'+item.bg"
						:class="{active: Math.floor(item.bg/1000) <= playNow && Math.floor(item.ed/1000) > playNow}"
						v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
						<view class="avatar">
							<text :style="[borderColor(item.speaker)]">{{ item.speaker | toCapital }}</text>
						</view>
						<view class="content">
							<view v-html="item.onebest"></view>
						</view>
						<template v-if="refinement(item)">
							<view class="tankuangcss">
								<view class="tags">标签</view>
								<view class="tags-t" @click="dianjibiaoqian()">
									<view class="tags-t-c">{{biaoqian}}</view>
									<view v-if="biaoqian.length>4" class="tipsss">
										<u-icon name="chat-fill" color="#ffffff" size="32rpx"></u-icon>
									</view>
								</view>
							</view>
							<view class="biaoqianya">
								<view class="biaoqianyaisshow" v-if="biaoqianyaisshow">
									{{biaoqian}}
								</view>
							</view>
						</template>
						<view class="biaoqianya" v-if="startTime==item.bg">
							<view class="biaoqianyaisshow" v-if="biaoqianyaisshow">
								{{biaoqian}}
							</view>
						</view>
					</view>
				</view>
				<!-- 点赞 -->
				<view class="likeArea" :class="{'liked':isLiked}">
					<!-- 					<image
						:src="isLiked?'/static/images/recordingManagement/likeActive.png':'/static/images/recordingManagement/like_gray.png'"
						mode=""></image> -->
				</view>
				<view class="hash" id="hash">
				</view>
			</view>
		</scroll-view>

		<!-- 评语列表 -->
		<u-popup v-model="watchAllCommit" mode="bottom">
			<scroll-view scroll-y style="height: 70vh;">
				<view class="boxs">
					<!-- 评语列表 -->
					<view class="chat">
						<view class="total">
							全部评论(共{{commentList.length}}条）
						</view>
						<view class="list">
							<view class="message" v-for="(item,index) in commentList" :key="index">
								<u-avatar class="avator" size="72"
									:src="item.commentPic ||'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/my/headPicture.png'">
								</u-avatar>
								<view class="right">
									<view class="name">
										{{item.commentName||"未知昵称"}}
									</view>
									<view class="subtitle" v-if="item.commentAutoGraph">
										{{item.commentAutoGraph}}
									</view>
									<view class="answer" v-if="item.replyName">
										回复@{{item.replyName}}
									</view>
									<view class="content" v-if="item.content">
										{{item.content}}
									</view>
									<view class="pic" v-if="item.picUrl">
										<image style="width: 100%;max-width: 240px;" :src="item.picUrl" mode="widthFix">
										</image>
									</view>

									<view class="bottom">
										<view class="time">
											{{item.createTime}}
										</view>
										<view class="button" v-if="myId != item.commentUser"
											@click.stop="answer(item.commentUser,item.id)">
											回复
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>

					<!-- 写评价 -->
					<view class="bottomArea">
						<image class="voice" @click.stop="changeVoiceShow"
							src="/static/images/recordingManagement/voice.png" mode=""></image>
						<view class="inputArea">
							<textarea :value="content" :focus="textareaFocus" type="text" @input="changeContent"
								:auto-height="true" class="editor" :class="{'active':editing}"
								@click.stop="changeEditing(true)" @confirm="sendComment">
						</textarea>
							<view class="placeholder" :class="{'editing':editing}" v-if="!content && !editing">写评价
							</view>
							<image class="edit" v-if="!editing && content == ''"
								src="/static/images/recordingManagement/edit.png" mode=""></image>
						</view>
						<image class="like" v-if="myId != createUser && !editing" @click="changeLike"
							src="/static/images/recordingManagement/like.png" mode=""></image>
						<image class="add" @click.stop="uploadImage" v-if="!editing && content == ''"
							src="/static/images/recordingManagement/add.png" mode=""></image>
						<view class="send" @click="sendComment" v-if="content!=''">
							发送
						</view>
					</view>
				</view>
			</scroll-view>
		</u-popup>

		<!-- 语音输入 -->
		<cover-view class="voiceContent" v-if="voiceShow" @click="changeVoiceShow">
			<cover-view class="box" @click.stop="" @touchstart="voiceStart" @touchend="voiceEnd">
				<cover-view class="center">
					<cover-image class="voice" src="/static/images/voice.png" mode="widthFix"></cover-image>
					<cover-view class="text">
						{{isRecording?'正在输入':'长按语音输入'}}
					</cover-view>
				</cover-view>
			</cover-view>
		</cover-view>

	</view>
</template>

<script>
	var app = getApp();
	var util = require("../../../utils/util.js");
	var config = require("../../../config");

	var plugin = requirePlugin("WechatSI")
	let manager = plugin.getRecordRecognitionManager();

	import zaudio from '@/components/uniapp-zaudio/zaudio';
	export default {
		components: {
			zaudio
		},
		data() {
			return {
				dialogList: [], // 录音对话转移列表
				isshowFile: false, // 录音文件默认隐藏
				luyinList: [], //录音文件列表
				fileIndex: 0, //文件索引
				fileId: '', //选中的录音ID
				id: "",
				audioStop: false,
				customerId: '',
				date: "",
				time: "",
				message: "", //聊天记录表
				durationTimeStr: "",
				autoLoad: true,
				playNow: 0,
				scrollTop: 0,
				scrollId: "",
				editing: false,
				isLiked: null,
				createUser: null,
				commentList: [], //评论列表
				content: "",
				voiceShow: false,
				isRecording: false,
				answerUserId: null,
				answerId: null,
				textareaFocus: false,
				myId: uni.getStorageSync("weapp_session_userInfo_data").accountId,
				startTime: "",

				alltimeStr: "00:00",
				end: false,
				recordPath: "",
				csdFileindex: 0,
				biaoqian: "",
				biaoqianyaisshow: false,
				startFile: '',
				num: 0, //上拉  转写文件下标
				timer: null,
				Bnum: 0, //下拉  转写文件下标
				watchAllCommit: false, // 查看全部评论
				pageInfo: {}, // 当前转写页面的值

				ACTION: Symbol('zaudio'), // 唯一值区分每个页面的方法
				isPageHide: false, // 是否息屏
				duration: '', // 播放时长
				marketingId: 0, // 当前选中的id

				nowPlaying: 0, // 当前播放位置
				stepPosition: 0, // 需要跳转的播放位置
			};
		},


		computed: {
			// 通过时间戳筛选找到需要展示的加精标签
			refinement() {
				return timestamp => {
					if (this.pageInfo.zatd instanceof Array) {
						return this.pageInfo.zatd.findIndex(item => (item.startTime == timestamp.bg && item
							.jjTransfer == timestamp.onebest && item.marketingId == this.marketingId)) != -1
					} else {
						return false
					}
				}
			}
		},

		onLoad(options) {
			this.startTime = options.startTime
			this.customerId = options.customerId,
				this.biaoqian = options.biaoqian;
			this.startFile = options.startFile;
			if (options.marketingId) this.marketingId = options.marketingId

			this.getdianzan()
			this.getCommentList();
			this.getView()
			let that = this
			this.timer = setTimeout(function() {
				that.addHot()
			}, 30000)


			//注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响;
			this.$zaudio.on('stop', this.ACTION, () => {
				console.log('我是强制暂停或关闭小程序音频浮窗触发的')
			})
			this.$zaudio.on('seek', this.ACTION, (time) => {
				this.sliderChangeComplate(this.TIMEEVENT(time))
			})
			this.$zaudio.on('playing', this.ACTION, (obj) => {
				this.duration = obj.duration
				this.nowPlaying = obj.current_value
				this.TimeUpdate(this.TIMEEVENT(obj.current))
			})
			this.$zaudio.on('ended', this.ACTION, e => {
				// this.qeihuanwenjian()
				this.$zaudio.operate();
			})
		},
		onShow() {
			this.initRecord();
			!this.isPageHide && this.getluyinList();
		},

		onHide() {
			this.isPageHide = true
		},

		onUnload() {
			//卸载不需要的业务和获取播放状态的业务,提高页面性能
			this.$zaudio.off('seek', this.ACTION);
			this.$zaudio.off('stop', this.ACTION);
			this.$zaudio.off('playing', this.ACTION);
			this.$zaudio.off('ended', this.ACTION);
		},

		methods: {
			// 删除优秀案例
			delTheFullText() {
				uni.showModal({
					title: '提示',
					content: `确认删除该案例吗？`,
					showCancel: true,
					cancelText: '取消',
					confirmText: '确认删除',
					confirmColor: "#FA3534",
					success: res => {
						console.log(res)
						if (res.confirm) {
							this.delATD()
						}
					}
				})
			},
			// 优秀案例删除
			delATD() {
				this.$u.get('/addtodigest/delATD', {
					carId: this.customerId
				}).then(res => {
					console.log(res)
					// if ()
					uni.showToast({
						title: '操作成功',
						icon: 'none',
						duration: 2000
					});
					setTimeout(() => {
						uni.navigateBack()
					}, 2000)
				}).catch(e => {
					uni.showToast({
						title: e.data.message,
						icon: 'none',
						duration: 2000
					});
				})
			},
			borderColor(index) {
				let obj = {
					color: '',
					borderRadius: '',
					border: ''
				}
				switch (index) {
					case 1:
						obj.color = '#E6625B';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #E6625B';
						break;
					case 2:
						obj.color = '#FF981E';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #FF981E';
						break;
					case 3:
						obj.color = '#F6BD16';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #F6BD16';
						break;
					case 5:
						obj.color = '#4980C8';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #4980C8';
						break;
					case 6:
						obj.color = '#60CBEC';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #60CBEC';
						break;
					case 7:
						obj.color = '##FF981E';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #FF981E';
						break;
					case 8:
						obj.color = '#4F861E';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #4F861E';
						break;
					default:
						obj.color = '#9F61C8';
						obj.borderRadius = '8rpx';
						obj.border = '2rpx solid #9F61C8';
						break;
				}
				return obj
			},
			addHot() {
				// console.log('30')
				this.$u.post('/zkstudyrecord', {
						targetId: this.customerId
					})
					.then(res => {
						// console.log(res)
					})
			},
			getView() {
				this.$u.get('/addtodigest/addPageviews', {
						id: this.customerId
					})
					.then(res => {})
			},
			TimeUpdate(currentTime) {
				this.playNow = Number(currentTime)
				if (this.dialogList.length == 0) {
					return
				} else {
					const message = this.dialogList[0].message;
					if (!message) return
					for (let i = 0; i < message.length; i++) {
						if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed /
								1000))) {
							this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
							break;
						}
						if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow <
							Math.floor(message[i + 1].bg / 1000)) {
							this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
							break;
						}
					}
				}
				this.$forceUpdate()
			},

			//下一页
			ltolower() {
				var lengthcz = this.luyinList.length - 1;
				if (this.num >= lengthcz) {
					uni.showToast({
						title: '到底了',
						icon: 'none',
						duration: 2000
					});
					return
				} else {
					this.num = this.num + 1;
					uni.showLoading({
						title: '加载中'
					});
					setTimeout(function() {
						uni.hideLoading();
					}, 2000);
					uni.request({
						url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id +
							"&customerId=" + this.customerId, //仅为示例，并非真实接口地址。
						method: "GET",
						header: {
							'content-type': 'application/json',
							'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
						},
						success: (data) => {
							if (data.data.code == 10000) {
								if (data.data.data.audioContent.length == 0) {
									setTimeout(function() {
										uni.hideLoading();
									}, 2000);
								} else {
									const jsonInfo = JSON.parse(data.data.data.audioContent);
									this.dialogList.push({
										message: jsonInfo
									});
									this.dialogList.forEach((asd, idx) => {
										asd.message.forEach((qwe, inde) => {
											qwe.isshow = false;
										})
									})
								}
							}
						},
					})
				}
			},

			//点击标签
			dianjibiaoqian() {
				if (this.biaoqian.length > 4) {
					this.biaoqianyaisshow = !this.biaoqianyaisshow;
				}
			},
			//获取点赞列表isLiked   likegetLike
			getdianzan() {
				uni.request({
					url: config.service.likegetLike + '?targetId=' + this.customerId, //仅为示例，并非真实接口地址。
					method: "GET",
					header: {
						'content-type': 'application/json',
						'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
					},
					success: (data) => {
						if (data.data.code == 10000) {
							this.isLiked = data.data.data.like;
						} else {
							uni.hideLoading();
							uni.showModal({
								title: '提示',
								content: '请求数据失败，请重新尝试',
								showCancel: false
							});
						}
					},
					fail(error) {
						uni.hideLoading();
						uni.showModal({
							title: '提示',
							content: '网络异常，请重新尝试',
							showCancel: false
						});
						return false;
					}
				});
			},
			// 获取评论列表
			getCommentList() {
				const that = this;
				util.getRequestPromise(config.service.cmmentList + '?targetId=' + this.customerId, {}, false, "GET").then(
					data => {
						let tmp = data;
						tmp.reverse();
						that.commentList = tmp;
					});
			},
			// 获取录音记录列表
			getluyinList() {
				const parames = {
					pageNum: 1,
					pageSize: 100,
					query: {
						whetherFinish: 1,
						customerId: this.customerId,
						id: this.startFile
					}
				}
				this.$u.post("/corpus/fendianFindByPage", parames).then(res => {
					try {
						let alltime = 1;
						res.forEach(item => {
							alltime = item.recordDuration
						})
						this.alltimeStr = this.getTime(alltime)
						res.forEach((cet, index) => {
							if (cet.id == this.startFile) {
								this.csdFileindex = index;
								this.recordPath = res[index].recordPath
								this.date = res[index].receptionTime
								this.num = index; //下拉起始位置
								this.Bnum = index;
								this.luyinList = res;
								this.zyAudio();
								this.getCorpusAnalysis()
								var itc = parseInt(this.startTime / 1000)
								this.adasdasdasd(itc)
							} else {
								console.log("my")
							}
						})
					} catch (e) {
						console.log(e)
					}
				})
			},
			//首次跳转
			adasdasdasd(e) {
				this.stepPlay(e)
			},
			//录音文件切换隐藏
			showFile() {
				this.isshowFile = !this.isshowFile
			},
			changeVoiceShow() {
				this.voiceShow = !this.voiceShow;
			},
			voiceStart: function() {
				manager.start({
					lang: "zh_CN"
				});
			},
			voiceEnd: function() {
				// uni.showToast();
				if (this.isRecording) {
					uni.showLoading({
						title: "识别中"
					})
				}
				this.voiceShow = false;
				this.isRecording = false;
				manager.stop();
			},
			// 语音初始化
			initRecord() {
				const that = this;
				manager.onStart = function(res) {
					that.isRecording = true;
					// this.voiceState = "onStart:" + res.msg + "正在录音"
				};
				//有新的识别内容返回，则会调用此事件  
				manager.onRecognize = (res) => {
					console.log('ing' + res.result);
				}

				// 识别结束事件  
				manager.onStop = (res) => {
					uni.hideLoading();
					let newText = that.content + res.result;
					if (newText.length > 140) {
						newText = newText.substring(0, 140)
					}
					that.content = newText;
					that.textareaFocus = true;
				}

				// 识别错误事件  
				manager.onError = (res) => {
					uni.hideLoading();
				}
			},

			//音频前进回退
			sliderChangeComplate(currentTime) {},


			// 获取转义后的对话结果
			getCorpusAnalysis() {
				this.dialogList = [];
				uni.showLoading({
					title: '加载中'
				});
				uni.request({
					url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id +
						"&customerId=" + this.customerId, //仅为示例，并非真实接口地址。
					method: "GET",
					header: {
						'content-type': 'application/json',
						'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
					},
					success: (data) => {
						if (data.data.code == 10000) {
							this.pageInfo = data.data.data
							const jsonInfo = JSON.parse(data.data.data.audioContent);
							this.dialogList.push({
								message: jsonInfo
							});
							setTimeout(function() {
								uni.hideLoading();
							}, 2000);
						} else {
							uni.hideLoading();
							uni.showModal({
								title: '提示',
								content: '请求数据失败，请重新尝试',
								showCancel: false
							});
						}
					},
					fail(error) {
						uni.hideLoading();
						uni.showModal({
							title: '提示',
							content: '网络异常，请重新尝试',
							showCancel: false
						});
						return false;
					}
				});
			},
			getTime(time) {
				return util.formatSecond(time)
			},
			// 文件切换播放
			filechange(item, i) {
				this.num = i; //下拉起始位置
				this.Bnum = i;
				this.csdFileindex = i;
				this.recordPath = item.recordPath;
				this.date = item.receptionTime;
				this.isshowFile = false;
				setTimeout(() => {
					this.$zaudio.operate(i)
				}, 50)
				this.getCorpusAnalysis()
			},
			// 自动播放下一个文件
			qeihuanwenjian() {
				let index = this.csdFileindex + 1;
				if (index < this.luyinList.length) {
					this.csdFileindex = index;
					this.getCorpusAnalysis()
					let item = this.luyinList[this.csdFileindex];
					let i = this.csdFileindex;
					this.filechange(item, i)
				}
			},



			formatTime(num) {
				//格式化时间格式
				num = num.toFixed(0);
				let second = num % 60;
				if (second < 10) second = '0' + second;
				let min = Math.floor(num / 60);
				if (min < 10) min = '0' + min;
				return min + ":" + second;
			},
			changeContent(e) {
				this.content = e.detail.value;
			},
			answer(userId, tid) {
				this.answerId = tid;
				this.answerUserId = userId;
				this.editing = true;
				this.textareaFocus = true;
			},
			// 保存评论
			sendComment() {
				if (this.content == "") {
					uni.showToast({
						icon: "none",
						title: "请输入标题"
					})
					return;
				}
				let parames = {
					targetId: this.customerId,
					content: this.content,
					commentType: 1
				};
				if (this.answerUserId) {
					parames.replyCommentId = this.answerId;
					parames.replyUser = this.answerUserId;
				}
				const that = this;
				util.getRequestPromise(config.service.saveCmment, parames, false).then(data => {
					that.getCommentList();
					uni.showToast({
						title: "评论成功",
						icon: "none"
					})
					that.textareaFocus = false;
					that.content = "";
				});
			},
			uploadImage() {
				const that = this;
				var parames = {
					targetId: that.id,
					commentType: 1
				};
				if (this.answerUserId) {
					parames.replyCommentId = this.answerId;
					parames.replyUser = this.answerUserId;
				}
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album', 'camera'],
					success: function(res) {
						uni.showLoading({
							title: "上传中"
						})
						uni.uploadFile({
							url: config.service.saveCmmentUpload,
							filePath: res.tempFilePaths[0],
							name: 'file',
							header: {
								'Authorization': 'Bearer ' + uni.getStorageSync(
									'weapp_session_login_data').token
							},
							formData: parames,
							success: (uploadFileRes) => {
								that.getCommentList();
								uni.hideLoading();
								uni.showToast({
									icon: "none",
									title: "上传成功"
								})
								console.log(uploadFileRes.data);
							}
						});
					}
				});
			},
			uploadAudio() {

			},
			changeLike() {
				uni.showLoading({
					title: "请求中",
					mask: true
				})
				if (this.isLiked) {
					this.cancelLike();
				} else {
					this.saveLike();
				}
			},
			// 点赞
			saveLike() {
				const that = this;
				util.getRequestPromise(config.service.saveLike, {
					targetId: this.customerId
				}, false).then(data => {
					that.isLiked = true;
					uni.hideLoading();
					uni.showToast({
						icon: "none",
						title: "点赞成功"
					})
				});
			},
			// 取消点赞
			cancelLike() {
				const that = this;
				util.getRequestPromise(config.service.cancelLike, {
					targetId: this.customerId
				}, false).then(data => {
					that.isLiked = false;
					uni.hideLoading();
					uni.showToast({
						icon: "none",
						title: "取消点赞成功"
					})
				});
			},
			gotoChat() {
				this.watchAllCommit = true
				console.log('dsakldjklasjdklas')
			},
			gotoTop() {
				this.scrollId = null;
				this.$nextTick(() => {
					this.scrollId = "top";
				})
			},
			changeEditing(type) {
				this.editing = type;
				this.answerId = null;
				this.answerUserId = null;
				this.textareaFocus = false;
				this.dialogList.forEach(res => {
					res.message.forEach(asd => {
						asd.isshow = false;
					})
				})
			},



			// 迅速切换音频源并切换回来
			checkPlaybackRate() {
				this.stepPosition = this.nowPlaying
				// 
				let data = [{
					src: 'https://static.quhouse.com/record/prop/2022-12-13/1670905992910-00066.mp3',
					title: '录音音频',
					singer: '',
					coverImgUrl: ''
				}]
				this.$zaudio.setAudio(data)
				//渲染第一首音频
				this.$zaudio.setRender(0)
				if (!this.refresh) {
					setTimeout(() => {
						this.$zaudio.operate()
					}, 150)
				}
				setTimeout(() => {
					this.zyAudio()
				}, 500)
			},

			//录音实例
			zyAudio() {
				let data = this.luyinList.map((item, index) => {
					return {
						src: item.recordPath,
						title: `录音文件${index + 1}`,
						singer: '',
						coverImgUrl: ''
					}
				})
				this.$zaudio.setAudio(data)
				//渲染第一首音频
				this.$zaudio.setRender(0)

				if (this.stepPosition != 0) {
					setTimeout(() => {
						this.stepPlay(this.stepPosition)
					}, 1500)
				}
			},

			// 跳转指定位置播放
			stepPlay(t) {
				this.$zaudio.seek(t)
				if (this.$zaudio.paused) {
					this.$zaudio.operate()
				}
			},
		}
	};
</script>
<style lang="scss" scoped>
	.audio-container {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.audio-head {
			width: 60rpx;
			height: 60rpx;
			flex-shrink: 0;
		}

		.audio-head .image {
			width: 100%;
			height: 100%;
		}

		.audio-slider {
			width: 96%;
			position: relative;
			padding: 2px 0rpx 0px 20px;
			display: flex;
			justify-content: space-between;
			align-items: center;
		}

		.audio-slider .slider {
			width: 100%;
			padding: 0px 15rpx;
			box-sizing: border-box;
		}

		.audio-time {
			width: 110rpx;
			text-align: right;
			font-size: 24rpx;
			line-height: 28rpx;
			color: #70798D;
			display: flex;
			justify-content: space-between;
		}

		.audio-play {
			width: 40rpx;
			height: 40rpx;
			flex-shrink: 0;
		}

		.audio-play .image {
			width: 100%;
			height: 100%;
		}
	}

	.tags {
		max-width: 85rpx;
		height: 38rpx;
		font-size: 24rpx;
		color: #333333;
		text-align: center;
		line-height: 38rpx;
		border-radius: 2rpx;
		border: 1px solid #979797;
	}

	.tags-t {
		max-width: 171rpx;
		height: 38rpx;
		background: #008EF2;
		border-radius: 2rpx;
		display: flex;
		align-items: center;
		margin-left: 10rpx;

		.tags-t-c {
			width: 126rpx;
			height: 38rpx;
			line-height: 38rpx;
			font-size: 24rpx;
			color: #FFFFFF;
			text-align: center;
			overflow: hidden;

			.tipsss {
				width: 37rpx;
				height: 37rpx;
				line-height: 37rpx;
			}
		}
	}

	.biaoqiantom {
		background-color: #008EF2;
		color: #FFFFFF;
		border: none;
	}

	// 表单
	.tian-view {
		width: 570rpx;
		background-color: #FFFFFF;
		border-bottom: 1px solid #ededee;
		display: flex;
		min-height: 96rpx;

		.tian-view-t1 {
			width: 20rpx;
			font-size: 34rpx;
			height: 34rpx;
			line-height: 110rpx;
			letter-spacing: 0px;
			color: red;
		}

		.tian-view-t2 {
			width: 30%;
			min-height: 96rpx;
			line-height: 96rpx;
			font-size: 34rpx;
			color: #333;
		}

		.tian-view-t3 {
			width: 61%;
			padding-top: 31rpx;
			padding-bottom: 31rpx;
			display: flex;

			.tian-input {
				width: 98%;
				font-size: 34rpx;
				border: none;
			}
		}
	}

	.zhezhoa {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		width: 100%;
		height: 100vh;
		opacity: 0.5;
		background-color: #666666;
	}

	.bounced {
		width: 570rpx;
		background: #FFFFFF;
		z-index: 1000;
		border-radius: 10rpx;
		position: fixed;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);

		/* 50%为自身尺寸的一半 */
		.jiajinghuatit {
			width: 100%;
			height: 68rpx;
			font-size: 30rpx;
			text-align: center;
			line-height: 68rpx;
		}

		.jiajinghuaview {
			padding: 18rpx 18rpx 18rpx 18rpx;
			display: flex;
			flex-wrap: wrap;

			.jiajinghuaview1 {
				padding: 8rpx 8rpx 8rpx 8rpx;
				font-size: 26rpx;
				border-radius: 12rpx;
				border: 1px solid #979797;
				margin-left: 8rpx;
			}

			.jighuaview2 {
				padding: 8rpx 8rpx 8rpx 8rpx;
				font-size: 26rpx;
				border-radius: 12rpx;
				border: 1px solid #979797;
				margin-left: 8rpx;
				display: flex;

				.view1-text {
					text-align: center;
					// border-right: 1rpx solid red;
				}

				.view1-img {
					width: 50rpx;
				}
			}
		}

		.bounced3 {
			height: 100rpx;
			width: 100%;
			margin-top: 40rpx;
			border-top: 1px solid #dddddd;
			display: flex;
		}

		.bounced3-1 {
			width: 50%;
			height: 100%;
			text-align: center;
			line-height: 100rpx;
			border-right: 1px solid #dddddd;
			font-size: 36rpx;
			color: #999999;
		}

		.bounced3-2 {
			width: 50%;
			height: 100%;
			text-align: center;
			line-height: 100rpx;
			font-size: 36rpx;
			color: #108ee9;
		}
	}

	.bosdttom {
		color: #008EF2;
	}

	.tab-box {
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;

		.yinpinshibie {
			width: 156rpx;
			height: 50rpx;
			font-size: 36rpx;
			font-weight: 400;
			color: #333333;
			text-align: center;
			line-height: 50rpx;
			letter-spacing: 2rpx;
			margin-right: 188rpx;

			&.active {
				position: relative;

				&::after {
					position: absolute;
					content: '';
					width: 119rpx;
					height: 8rpx;
					background: #008EF2;
					border-radius: 4rpx;
					top: 50rpx;
					right: 0;
					left: 0;
					margin: 0 auto;
				}
			}
		}

		.rate {
			width: 156rpx;
			height: 50rpx;
			font-size: 36rpx;
			font-weight: 400;
			color: #333333;
			line-height: 50rpx;
			letter-spacing: 2rpx;
			text-align: center;

			&.active {
				position: relative;

				&::after {
					position: absolute;
					content: '';
					width: 119rpx;
					height: 8rpx;
					background: #008EF2;
					border-radius: 4rpx;
					top: 50rpx;
					right: 0;
					left: 0;
					margin: 0 auto;
				}
			}
		}
	}

	.dialog-block {
		margin: 20rpx 0;
		border-bottom: 1px solid #ccc;

		.fileName {
			max-width: 200rpx;
			text-align: center;
			margin: 10rpx auto;
			font-size: 28rpx;
			font-weight: 400;
			color: #666;
			height: 52rpx;
			line-height: 52rpx;
			background: #F8F8F8;
			border-radius: 4rpx;
			padding: 0 20rpx;
		}
	}

	// 评分
	.rate-box {
		padding: 10rpx 20rpx;

		.date {
			width: 300rpx;
			height: 33rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #333333;
			line-height: 33rpx;
			letter-spacing: 1rpx;
			margin-bottom: 8rpx;
		}

		.title {
			width: 100%;
			height: 42rpx;
			font-size: 30rpx;
			font-weight: 500;
			color: #333333;
			line-height: 42rpx;
			letter-spacing: 2rpx;
			margin-bottom: 20rpx;
		}

		.level1 {
			display: flex;
			align-items: center;

			.level-name {
				width: 104rpx;
				height: 33rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #333333;
				line-height: 33rpx;
				letter-spacing: 1rpx;
				margin-right: 10rpx;
			}

			.level-progress {
				flex: 1;
				border-radius: 11rpx;
				height: 21rpx;
				background-color: #BEE4FF;
				position: relative;

				.color {
					width: 0;
					position: absolute;
					top: 0;
					left: 0;
					height: 21rpx;
					border-radius: 11rpx 0 0 11rpx;
					background-color: #008EF2;
				}
			}

			.level-rate {
				width: 65rpx;
				height: 33rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #333333;
				line-height: 33rpx;
				letter-spacing: 1rpx;
				margin: 0 20rpx 0 15rpx;
			}

			.arrow {
				width: 37rpx;
				height: 21rpx;
				padding: 5rpx 20rpx;
			}

			.rotatearrow {
				transform: rotate(270deg);
			}
		}

		.level1-subbox {
			display: flex;
			margin-top: 20rpx;
			flex-wrap: wrap;

			.sub-name {
				width: 50%;
				display: flex;
				margin-bottom: 18rpx;

				.subitem-name {
					width: 104rpx;
					height: 33rpx;
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
					line-height: 33rpx;
					letter-spacing: 1rpx;
					margin-right: 12rpx;
				}

				.checkimg {
					width: 27rpx;
					height: 27rpx;
				}

			}
		}
	}

	.luyin {
		height: 100rpx;
		width: 100%;
	}

	.translation {
		padding-left: 30rpx;
		padding-right: 30rpx;
		background: #FFFFFF;
		display: flex;
		flex-direction: column;
		height: 100vh;
	}

	.translation .top {
		margin: 0 -30rpx;
		padding: 0 30rpx;
		background: #ffffff;
		border-bottom: 1rpx solid #F2F2F2;
		padding-bottom: 10rpx;
	}

	.translation .top .title {
		display: flex;
		justify-content: space-between;

		.hash {
			color: rgba(21, 144, 233, 1);
			font-size: 24rpx;
		}
	}

	.call_record_time {
		height: 42rpx;
		line-height: 42rpx;
		font-size: 30rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #303030;
	}

	.call_record_time_one {
		height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		display: flex;
		justify-content: space-between;
		position: relative;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #303030;

		.diangweitupian {
			width: 46rpx;
			height: 46rpx;
			// border: 1px solid red;
			position: absolute;
			top: 0rpx;
			right: 75rpx;
		}

		.file-change {
			position: absolute;
			top: 50rpx;
			right: 0rpx;
			width: 184rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
			border-radius: 4rpx;
			z-index: 99;
			height: auto;
			max-height: 600rpx;
			overflow: auto;
		}

		.file-item {
			width: 184rpx;
			height: 60rpx;
			line-height: 60rpx;
			text-align: center;
			font-size: 30rpx;
			font-weight: 400;
			color: #333333;
			border-bottom: 1rpx solid #E2E2E2;
		}

		.file-item:last-child {
			border: 0
		}

		.fileactive {
			color: #008EF2
		}
	}

	.dingweishiy {
		position: relative;

		.tankuangcss {
			position: absolute;
			bottom: -50rpx;
			left: 0rpx;
			width: 100%;
			// border: 1rpx solid red;
			font-size: 24rpx;
			color: #FFFFFF;
			padding-top: 4rpx;
			padding-bottom: 4rpx;
			display: flex;
			justify-content: center;
			border-radius: 15rpx;
			z-index: 1000;
		}

		.biaoqianya {
			width: 631rpx;
			margin: 0 auto;
			position: absolute;
			bottom: -120rpx;
			left: 0rpx;
			z-index: 2000;
			color: #FFFFFF;

			.biaoqianyaisshow {
				background-image: url(../../../static/images/biaoqianya.png);
				background-size: 100% 100%;
				text-align: left;
				text-indent: 20rpx;
			}
		}
	}

	.scroll-Y {
		font-size: 36rpx;
		color: #999999;
		background: #FFFFFF;
		margin-top: 30rpx;
		flex: 1;
		overflow-y: scroll;
		width: 100%;
	}

	.scroll-Y .text {
		margin-top: 60rpx;
		line-height: 80rpx;
		display: flex;
		align-items: center;
	}

	.scroll-Y .text[data-speaker="2"],
	.scroll-Y .text[data-speaker="4"],
	.scroll-Y .text[data-speaker="6"] {
		flex-direction: row-reverse;
		text-align: right;

		.content {
			margin-left: 0;
			margin-right: 30rpx;
			background: #F8F8F8;
			color: #505050;
		}
	}

	.scroll-Y .text .avatar {
		text {

			display: block;
			width: 72rpx;
			height: 72rpx;
			line-height: 72rpx;
			text-align: center;
			background: #FFFFFF;
			border-radius: 8rpx;
			// border: 2rpx solid #E6625B;
			font-size: 30rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			// color: #E6625B;
			box-sizing: border-box;
		}
	}

	.scroll-Y .text .content {
		margin-left: 24rpx;
		line-height: 42rpx;
		text-align: left;
		padding: 15rpx 20rpx;
		background: #F8F8F8;
		border-radius: 12rpx;
		font-size: 30rpx;
		max-width: 448rpx;
		color: #505050;
	}

	.scroll-Y .text.active .content {
		color: #2671E2 !important;
		position: relative;
	}

	.scroll-Y .text.active[data-speaker="2"] .content,
	.scroll-Y .text.active[data-speaker="4"] .content,
	.scroll-Y .text.active[data-speaker="6"] .content {
		color: #2671E2 !important;
		position: relative;
	}

	.likeArea {
		width: 86rpx;
		height: 84rpx;
		margin: 20rpx auto 38rpx auto;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
		// border: 1rpx solid #C1C2C1;

		&.liked {
			// border: 1rpx solid rgba(21, 144, 233, 1);
		}

		image {
			width: 38rpx;
			height: 39rpx;
		}
	}

	.chat {
		display: flex;
		flex-direction: column;
		border-top: 1rpx solid rgba(151, 151, 151, 0.4);
		padding: 20rpx 20rpx 0;

		.total {
			color: rgba(21, 144, 233, 1);
			font-size: 24rpx;
		}

		.list {
			display: flex;
			flex-direction: column;

			.message {
				display: flex;
				margin-top: 20rpx;

				border-bottom: 1rpx solid rgba(151, 151, 151, 0.4);
				padding-bottom: 20rpx;

				&:last-child {
					border-bottom: 0;
				}

				.avator {
					margin-left: 120rpx;
				}

				&:first-child {
					.avator {
						margin-left: 0;
					}
				}

				.right {
					display: flex;
					flex-direction: column;
					margin-left: 20rpx;
					flex: 1;

					.name {
						color: rgba(16, 16, 16, 1);
						font-size: 30rpx;
					}

					.subtitle {
						color: rgba(120, 120, 120, 1);
						font-size: 24rpx;
						margin-top: 16rpx;
					}

					.answer {
						font-size: 24rpx;
						color: #787878;
					}

					.content {
						color: rgba(49, 48, 48, 1);
						font-size: 30rpx;
						margin-top: 20rpx;
						position: relative;
					}

					.bottom {
						margin-top: 16rpx;
						display: flex;
						justify-content: space-between;

						.time {
							color: rgba(185, 185, 185, 1);
							font-size: 20rpx;
						}

						.button {
							color: rgba(144, 144, 144, 1);
							font-size: 30rpx;
							width: 111rpx;
							height: 44rpx;
							border-radius: 22rpx;
							border: 1rpx solid rgba(151, 151, 151, 1);
							text-align: center;
						}
					}
				}
			}
		}
	}

	.bottomArea {
		min-height: 90rpx;
		background: #F0F2F5;
		width: 100%;
		display: flex;
		align-items: center;
		border-top: 1rpx solid rgba(151, 151, 151, 0.25);

		.voice {
			width: 44rpx;
			height: 44rpx;
			margin-left: 38rpx;
		}

		.inputArea {
			margin-left: 38rpx;
			margin-right: 38rpx;
			flex: 1;
			display: flex;
			position: relative;

			.edit {
				width: 30rpx;
				height: 28rpx;
				position: absolute;
				top: 31rpx;
				left: 27rpx;
			}

			.editor {
				background: rgba(0, 139, 245, 0.17);
				border-radius: 29rpx;
				flex: 1;
				min-height: 58rpx;
				width: unset;
				padding: 0 32rpx;
				font-size: 30rpx;
				margin: 16rpx 0;
				line-height: 29px;
			}

			.placeholder {
				position: absolute;
				left: 70rpx;
				top: 22rpx;
				color: #26A2FF;

				&.editing {
					left: 36rpx;
				}
			}
		}

		.download {
			width: 41rpx;
			height: 35rpx;
			margin-right: 36rpx;
		}

		.like {
			width: 38rpx;
			height: 39rpx;
			margin-right: 38rpx;
		}

		.add {
			width: 50rpx;
			height: 50rpx;
			margin-right: 38rpx;
		}

		.send {
			background: #1590e9;
			color: white;
			padding: 10rpx 20rpx;
			margin: 5px;
			border-radius: 8rpx;
		}
	}

	.backTop {
		width: 60rpx;
		height: 60rpx;
		background: rgba(211, 235, 253, 1);
		box-shadow: 0rpx 0rpx 2rpx 4rpx rgba(38, 161, 255, 0.04);
		border-radius: 50%;
		position: fixed;
		bottom: 200rpx;
		right: 8rpx;
		display: flex;
		justify-content: center;
		align-items: center;

		image {
			width: 26rpx;
			height: 34rpx;
		}
	}

	.voiceContent {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100vw;
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		background: rgba(30, 30, 30, 0.4592);
		z-index: 10001;
	}

	.box {
		background: rgba(21, 144, 233, 0.299);
		width: 524rpx;
		height: 524rpx;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;

		.center {
			width: 412rpx;
			height: 412rpx;
			background: #1590E9;
			border-radius: 50%;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;

			.voice {
				width: 110rpx;
				height: 133rpx;
			}

			.text {
				color: #FFFFFF;
				font-size: 36rpx;
				margin-top: 24rpx;
			}
		}
	}

	.boxs {
		min-height: 100%;
		display: flex;
		flex-direction: column;

		.chat {
			flex-grow: 1;
		}

		.bottomArea {
			flex-shrink: 0;
			position: sticky;
			bottom: 0;
		}
	}
</style>
