answerDetail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. <template>
  2. <view class="answerdetail-page flex-column">
  3. <template v-if="questionItem">
  4. <view class="question-wrap">
  5. <view class="question-item">
  6. <view class="question-info">
  7. <view style="flex: 1" class="question-title">
  8. <text class="item-label">{{
  9. questionItem.chart_permission_name
  10. }}</text>
  11. {{ questionItem.question_content }}
  12. </view>
  13. <view class="item-answer" v-if="questionItem.reply_status === 3">
  14. <view class="answer" @click.stop="handleAudio(questionItem)">
  15. <template v-if="!questionItem.loading">
  16. <image
  17. class="music-img"
  18. :src="questionItem.answer.isplay ? playImgSrc : pauseImgSrc"
  19. mode="widthFix"
  20. />
  21. <template
  22. v-if="
  23. questionItem.answer.isplay || questionItem.answer.ispause
  24. "
  25. >
  26. <text>{{
  27. questionItem.answer.audioTime -
  28. currentAudioMsg.audioCurrentTime >
  29. 0
  30. ? moment(
  31. (questionItem.answer.audioTime -
  32. currentAudioMsg.audioCurrentTime) *
  33. 1000
  34. ).format("mm:ss")
  35. : "00:00"
  36. }}</text>
  37. </template>
  38. <template v-else>
  39. <text>{{
  40. moment(questionItem.answer.audioTime * 1000).format(
  41. "mm:ss"
  42. )
  43. }}</text>
  44. </template>
  45. </template>
  46. <template v-else>
  47. <image
  48. class="load-img"
  49. src="../static/loading.png"
  50. mode="aspectFill"
  51. />
  52. <text>{{
  53. moment(questionItem.answer.audioTime).format("mm:ss")
  54. }}</text>
  55. </template>
  56. </view>
  57. </view>
  58. </view>
  59. <text class="item-time">提问时间:{{ questionItem.create_time }}</text>
  60. </view>
  61. </view>
  62. <view
  63. class="record-wrap flex-column"
  64. v-if="questionItem.reply_status === 2&&isUserResearcher"
  65. >
  66. <view class="record flex-column" v-if="questionItem.recordStatus !== 4">
  67. <view class="no-record" v-if="questionItem.recordStatus === 1">
  68. <image
  69. src="./static/record.png"
  70. mode="widthFix"
  71. style="width: 90rpx; height: 180rpx"
  72. />
  73. <view>无录音(录音时长超过三分钟自动结束)</view>
  74. </view>
  75. <!-- <view class="record-time" v-else>{{ audioTime }}</view> -->
  76. <view class="recode-image" v-else>
  77. <scroll-view scroll-x style="height: 100rpx" class="scroll-view" :scroll-left="scrollTop" @scrolltolower="handleScrolltolower" :show-scrollbar="false">
  78. <view style="width:100%;height:100rpx;display:inline-block;"></view>
  79. <image
  80. src="./static/record-img.png"
  81. mode="scaleToFill"
  82. />
  83. <image
  84. src="./static/record-img.png"
  85. mode="scaleToFill"
  86. />
  87. <image
  88. src="./static/record-img.png"
  89. mode="scaleToFill"
  90. />
  91. </scroll-view>
  92. </view>
  93. </view>
  94. <view
  95. class="record-tool flex-column"
  96. v-if="questionItem.recordStatus !== 4"
  97. >
  98. <view class="hint" v-if="questionItem.recordStatus === 1"
  99. >点击开始录音</view
  100. >
  101. <view class="record-time" v-else>{{ audioTime }}</view>
  102. <view
  103. class="record-btn-wrap center"
  104. v-if="questionItem.recordStatus === 1"
  105. >
  106. <view class="switch" @click="changeRecodeStatus"> </view>
  107. </view>
  108. <view class="record-btn-wrap" v-else>
  109. <text
  110. @click="questionItem.recordStatus === 3 && handleRecode('delete')"
  111. v-if="questionItem.recordStatus >= 2"
  112. :class="{ active: questionItem.recordStatus === 3 }"
  113. >删除</text
  114. >
  115. <view class="switch" @click="changeRecodeStatus">
  116. <image
  117. v-if="questionItem.recordStatus >= 2"
  118. :src="
  119. questionItem.recordStatus === 2 ? playImgSrc : pauseImgSrc
  120. "
  121. :key="playIconKey"
  122. :style="{
  123. 'margin-left': questionItem.recordStatus !== 2 ? '7rpx' : 0,
  124. width: '36rpx',
  125. height: '44rpx',
  126. }"
  127. mode="widthFix"
  128. />
  129. </view>
  130. <text
  131. @click="handleRecode('finish')"
  132. v-if="questionItem.recordStatus >= 2"
  133. :class="{ active: questionItem.recordStatus >= 2 }"
  134. >完成</text
  135. >
  136. </view>
  137. </view>
  138. <view class="record-play" v-if="questionItem.recordStatus === 4">
  139. <view class="audio-wrap">
  140. <view v-if="pageLoading">音频生成中...</view>
  141. <view class="play" v-else>
  142. <van-icon
  143. :name="isplay ? 'pause' : 'play'"
  144. @click="handleAudioByReplay"
  145. color="#E6B77DFF"
  146. size="64rpx"
  147. style="align-items: flex-start; margin-left: -20rpx"
  148. />
  149. <!-- 进度条 -->
  150. <view class="slider-box">
  151. <slider
  152. :value="currentAudioMsg.audioCurrentTime"
  153. :max="currentAudioMsg.audioTime"
  154. @change="sliderChange($event)"
  155. @changing="sliderChanging"
  156. activeColor="#E6B77DFF"
  157. backgroundColor="#EBEBEBFF"
  158. block-color="#E6B77DFF"
  159. block-size="12"
  160. />
  161. <view class="slider-time">
  162. <text>{{
  163. moment(currentAudioMsg.audioCurrentTime * 1000).format(
  164. "mm:ss.SS"
  165. )
  166. }}</text>
  167. <text>{{
  168. moment(currentAudioMsg.audioTime * 1000).format("mm:ss.SS")
  169. }}</text>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <view class="audio-delete" @click="handleRecode('delete')">
  175. <image
  176. src="./static/delerecord.png"
  177. mode="heightFix"
  178. style="width: 32rpx; height: 35rpx"
  179. />
  180. <text>删除</text></view
  181. >
  182. <view class="audio-pub" @click="handleRecode('pub')">发布</view>
  183. </view>
  184. </view>
  185. </template>
  186. </view>
  187. </template>
  188. <script>
  189. import mixin from "../mixin/questionMixin";
  190. import { apiReplayAsk, apiGetQuestion, apiSetRead } from "@/api/question";
  191. import { uploadAudioToServer } from "@/utils/upload";
  192. export default {
  193. mixins: [mixin],
  194. data() {
  195. return {
  196. questionItem: null /* {
  197. recordStatus: 1, //1:未录音;2:正在录音;3:已暂停;4:完成录音
  198. }, */,
  199. pauseImgSrc: "../static/question/recordplay.png",
  200. playImgSrc: "../static/question/recordpause.png",
  201. innerAudio: null, //该页面的音频
  202. audioCount: 0, //录音计时,毫秒
  203. audioSrc:'',//tempSrc
  204. audioTime: "00:00", //录音时间(格式化后):string
  205. timer: null,
  206. audioItem: null,
  207. pageLoading: false,
  208. playIconKey: 0,
  209. isplay: false,
  210. isSlider: false,
  211. scrollTop:0,
  212. isStart:false,//判断录音是否开始
  213. //globalRecorder:uni.getRecorderManager(),
  214. /* userInfo:{
  215. is_inner:1,//0:外部客户;1内部员工
  216. status:'试用',
  217. is_suspend:0,
  218. is_researcher:0
  219. },//mock用户信息 */
  220. };
  221. },
  222. onLoad(options) {
  223. this.initAudio();
  224. this.getQuestionItem(options.id);
  225. },
  226. onShow(){
  227. uni.authorize({
  228. scope: 'scope.record',
  229. success() {
  230. },
  231. fail(e){
  232. console.log('fail',e);
  233. }
  234. })
  235. },
  236. onUnload() {
  237. this.resetAudio();
  238. this.destroyAudio();
  239. //录音时误操作退出页面的情况
  240. if(this.questionItem.recordStatus!==4&&this.questionItem.recordStatus!==1){
  241. this.globalRecorder.stop()
  242. }
  243. },
  244. methods: {
  245. //初始化audio,onShow执行
  246. initAudio() {
  247. this.innerAudio = uni.createInnerAudioContext();
  248. this.handleAudioFun();
  249. this.handleRecorderFun();
  250. //录音完成后,切出其他页面再切回来
  251. if(this.questionItem?.recordStatus===4){
  252. console.log('count',this.audioCount,'src',this.audioSrc)
  253. this.setAudio(this.audioSrc,this.audioCount)
  254. }
  255. },
  256. //录音完成or从其他app切回本页面是,初始化音频
  257. setAudio(src,audioCount){
  258. this.innerAudio.stop();
  259. this.isplay = false;
  260. this.innerAudio.src = src;
  261. console.log('秒数',audioCount)
  262. this.changeCurrentAudio({
  263. id: "",
  264. answer: {
  265. source: src,
  266. audioTime: audioCount/1000,
  267. },
  268. });
  269. },
  270. //麦克风被占用,初始化录音相关变量 其他状态->未录音状态
  271. setRecorder(){
  272. this.questionItem.recordStatus = 1;
  273. this.innerAudio.stop();
  274. this.isplay = false;
  275. this.audioItem = null;
  276. this.audioCount = 0;
  277. this.scrollTop = 0;
  278. this.audioTime = this.moment(this.audioCount * 1000).format("mm:ss");
  279. },
  280. //onHide触发
  281. resetAudio(){
  282. this.innerAudio.stop();
  283. this.isplay = false;
  284. this.changeCurrentAudio({
  285. id: '',
  286. answer: {
  287. source: '',
  288. audioTime: 0
  289. }
  290. })
  291. },
  292. //audio事件
  293. handleAudioFun() {
  294. this.innerAudio.onPlay(() => {
  295. this.isplay = true;
  296. console.log("播放录音了");
  297. this.questionItem.loading = false;
  298. });
  299. this.innerAudio.onTimeUpdate(() => {
  300. //console.log("时间更新", this.innerAudio.currentTime);
  301. /* this.currentAudioMsg.audioCurrentTime = parseInt(
  302. this.innerAudio.currentTime
  303. ); */
  304. this.currentAudioMsg.audioCurrentTime = this.innerAudio.currentTime;
  305. });
  306. this.innerAudio.onSeeked(() => {
  307. //取this.innerAudio.currentTime为0
  308. console.log("seek完成");
  309. this.isSlider = false;
  310. });
  311. this.innerAudio.onPause(() => {
  312. this.isplay = false;
  313. console.log("暂停");
  314. console.log(this.innerAudio.paused);
  315. });
  316. this.innerAudio.onEnded(() => {
  317. console.log("音频播放完毕");
  318. this.questionItem.answer.isplay = false;
  319. this.questionItem.answer.ispause = false;
  320. /* this.changeCurrentAudio({
  321. id: "",
  322. answer: {
  323. source: "",
  324. audioTime: 0,
  325. },
  326. }); */
  327. this.currentAudioMsg.audioCurrentTime = 0;
  328. this.isplay = false;
  329. });
  330. },
  331. //录音事件
  332. handleRecorderFun() {
  333. this.globalRecorder.onStart(() => {
  334. console.log("开始录音");
  335. if(this.questionItem.recordStatus===1){
  336. this.questionItem.recordStatus=2
  337. }
  338. uni.hideToast();
  339. this.clockTime();
  340. });
  341. this.globalRecorder.onPause(() => {
  342. console.log("暂停录音");
  343. if(this.questionItem.recordStatus===2){
  344. this.questionItem.recordStatus = 3
  345. }
  346. this.cleanTime();
  347. });
  348. this.globalRecorder.onStop((res) => {
  349. console.log("录音完成");
  350. //录音自动结束 和 暂停时点击删除 的情况
  351. if (this.questionItem.recordStatus === 2) {
  352. this.questionItem.recordStatus = 4;
  353. }
  354. console.log('status',this.questionItem.recordStatus)
  355. console.log("res", JSON.stringify(res));
  356. this.cleanTime();
  357. //初始化音频播放
  358. this.audioSrc = res.tempFilePath
  359. this.setAudio(this.audioSrc ,this.audioCount)
  360. this.pageLoading = false;
  361. });
  362. this.globalRecorder.onError((res) => {
  363. console.log('err',res)
  364. console.log('errMsg',res.errMsg)
  365. /* uni.showToast({
  366. title:res.errMsg,
  367. icon:'none'
  368. }) */
  369. //开始录音失败
  370. if(res.errMsg.includes('start')){
  371. this.questionItem.recordStatus = 1;
  372. }
  373. //麦克风被占用的情况
  374. if(res.errCode===1){
  375. uni.showToast({
  376. title:'麦克风被占用,已停止录音',
  377. icon:'none'
  378. })
  379. this.globalRecorder.stop();
  380. this.setRecorder()
  381. }
  382. });
  383. /* this.globalRecorder.onFrameRecorded((res) => {
  384. console.log("?", res);
  385. }); */
  386. },
  387. async getQuestionItem(id) {
  388. const res = await apiGetQuestion({
  389. question_id: id,
  390. });
  391. if (res.code === 200) {
  392. this.questionItem = res.data;
  393. const { audio_list } = res.data;
  394. let temp = {};
  395. if (audio_list.length > 0) {
  396. temp = {
  397. source: res.data.audio_list[0].audio_url,
  398. audioTime: parseInt(res.data.audio_list[0].audio_play_seconds),
  399. isplay: false,
  400. ispause: false,
  401. };
  402. } else {
  403. temp = {
  404. source: "",
  405. audioTime: 0,
  406. isplay: false,
  407. ispause: false,
  408. };
  409. }
  410. let readKey = "";
  411. //const { is_inner } = this.userInfo;
  412. if (this.isUserResearcher) {
  413. readKey = "replier_is_read";
  414. } else {
  415. readKey = "is_read";
  416. }
  417. console.log('readKey',readKey)
  418. this.questionItem[readKey] !== 1 &&
  419. (await apiSetRead({
  420. question_ids: this.questionItem.community_question_id + "",
  421. }));
  422. this.questionItem.id = res.data.community_question_id;
  423. this.questionItem.answer = temp;
  424. this.questionItem.loading = false;
  425. this.questionItem.recordStatus = res.data.reply_status === 3 ? 4 : 1;
  426. }else{
  427. //问题被删除的情况,返回小程序首页
  428. setTimeout(()=>{
  429. uni.switchTab({ url:'/pages/report/report' });
  430. },1000)
  431. }
  432. },
  433. changeRecodeStatus() {
  434. console.log('a',this.questionItem.recordStatus)
  435. //根据questionItem.recordStatus
  436. if (this.questionItem.recordStatus === 1) {
  437. const that = this
  438. //检查是否有权限
  439. uni.getSetting({
  440. success(res){
  441. console.log('res',res)
  442. if(res.authSetting['scope.record']){
  443. that.startRecord()
  444. }else{
  445. that.getRecordAuth()
  446. }
  447. }
  448. });
  449. } else if (this.questionItem.recordStatus === 2) {
  450. //暂停录音
  451. this.globalRecorder.pause();
  452. this.questionItem.recordStatus = 3;
  453. } else if (this.questionItem.recordStatus === 3) {
  454. //继续录音
  455. this.globalRecorder.resume();
  456. this.clockTime();
  457. this.questionItem.recordStatus = 2;
  458. } else {
  459. //结束录音
  460. this.globalRecorder.stop();
  461. //this.cleanTime();
  462. }
  463. },
  464. //获取录音授权
  465. getRecordAuth(){
  466. const {community_question_id} = this.questionItem
  467. uni.openSetting({
  468. success(res){
  469. //刷新页面
  470. if(res.authSetting['scope.record']){
  471. uni.redirectTo({url: `/pages-question/answerDetail?id=${community_question_id}`})
  472. }
  473. }
  474. })
  475. //this.questionItem.recordStatus = 1
  476. },
  477. //开启录音
  478. startRecord(){
  479. console.log(this.globalRecorder)
  480. this.globalRecorder.start({ duration: 180000, format: "mp3" });
  481. uni.showToast({
  482. title:'加载中',
  483. icon:'loading'
  484. })
  485. this.questionItem.recordStatus = 2;
  486. },
  487. //上传音频
  488. async uploadAudio() {
  489. const res = await uploadAudioToServer(this.innerAudio.src);
  490. if (res.code === 200) {
  491. this.audioItem = res.data;
  492. } else {
  493. //重新录
  494. this.setRecorder()
  495. }
  496. },
  497. //录音操作:完成/删除/发布
  498. async handleRecode(type) {
  499. if (type==='finish') {
  500. this.questionItem.recordStatus = 4;
  501. this.changeRecodeStatus();
  502. }
  503. if (type === "finish") {
  504. //生成音频,更改页面布局
  505. this.pageLoading = true;
  506. } else if (type === "delete") {
  507. //重新录
  508. if(this.questionItem.recordStatus===3)this.globalRecorder.stop();
  509. this.setRecorder()
  510. } else {
  511. //发布
  512. if (!this.audioItem) {
  513. await this.uploadAudio();
  514. }
  515. //如果上传音频成功
  516. if (this.questionItem.recordStatus === 4) {
  517. //发布回答
  518. const res = await apiReplayAsk({
  519. question_id: this.questionItem.community_question_id,
  520. audio_list: [{ ...this.audioItem, sort: 1 }],
  521. });
  522. if (res.code === 200) {
  523. uni.showToast({
  524. title: "发布成功",
  525. icon: "success",
  526. duration: 500,
  527. });
  528. setTimeout(() => {
  529. //关闭当前页面,跳转到我的回答
  530. //uni.navigateBack({ delta: 1 });
  531. uni.redirectTo({
  532. url: '/pages-question/answerList'
  533. })
  534. }, 500);
  535. }
  536. }
  537. }
  538. },
  539. //(提问者)问题已被回答,点击回答音频
  540. handleAudio(item) {
  541. const { source, isplay, ispause } = item.answer;
  542. if (isplay) {
  543. //说明是播放->暂停
  544. this.innerAudio.pause();
  545. this.questionItem.answer.isplay = false;
  546. this.questionItem.answer.ispause = true;
  547. } else if (ispause) {
  548. //说明是暂停->播放
  549. this.innerAudio.play();
  550. this.questionItem.answer.isplay = true;
  551. this.questionItem.answer.ispause = false;
  552. } else {
  553. //console.log("aaa", source, this.innerAudio.src);
  554. //说明是第一次播放或播放完
  555. this.changeCurrentAudio(item);
  556. this.innerAudio.stop();
  557. this.innerAudio.src = source;
  558. this.handleAudioPlay();
  559. this.questionItem.answer.isplay = true;
  560. }
  561. },
  562. //(回答者)问题被回答,点击回答音频
  563. handleAudioByReplay() {
  564. this.isplay = !this.isplay;
  565. if (this.innerAudio.paused) {
  566. this.innerAudio.play();
  567. } else {
  568. this.innerAudio.pause();
  569. }
  570. this.playIconKey++; //更新音频播放图标
  571. },
  572. //拖动音频进度条
  573. sliderChange(e) {
  574. console.log("拖动完成?");
  575. //this.innerAudio.pause();
  576. const value = e.detail.value;
  577. this.innerAudio.seek(value);
  578. this.currentAudioMsg.audioCurrentTime = value;
  579. },
  580. sliderChanging() {
  581. this.isSlider = true;
  582. },
  583. //切换当前播放音频
  584. changeCurrentAudio(item) {
  585. const { id } = item;
  586. const { source, audioTime } = item.answer;
  587. this.currentAudioMsg = {
  588. id: id,
  589. audioCurrentTime: 0 * 1000,
  590. audioTime: audioTime,
  591. audioCurrentUrl: source,
  592. };
  593. if (id) {
  594. console.log("?");
  595. this.questionItem.loading = true;
  596. }
  597. },
  598. //录音计时
  599. clockTime() {
  600. console.log("开始录音计时");
  601. this.timer = setInterval(() => {
  602. if (this.timer) {
  603. this.audioCount += 30;
  604. this.audioTime = this.moment(this.audioCount).format("mm:ss.SS");
  605. this.scrollTop+=1;
  606. }
  607. }, 30);
  608. },
  609. //清除录音计时
  610. cleanTime() {
  611. console.log("结束录音计时");
  612. clearTimeout(this.timer);
  613. this.playIconKey++; //更新录音暂停播放图标
  614. //this.audioTime = this.moment(this.audioCount).format("mm:ss.SS");
  615. },
  616. //scroll-view滑动到最右
  617. handleScrolltolower(){
  618. console.log('a',this.scrollTop)
  619. this.scrollTop-=150;
  620. }
  621. },
  622. };
  623. </script>
  624. <style scoped lang="scss">
  625. .flex-column {
  626. display: flex;
  627. flex-direction: column;
  628. }
  629. .answerdetail-page {
  630. padding: 50rpx 30rpx 0 30rpx;
  631. height: calc(100vh - calc(50px + env(safe-area-inset-bottom)));
  632. box-sizing: border-box;
  633. .question-wrap {
  634. .question-item::after {
  635. height: 0;
  636. }
  637. }
  638. .record-wrap {
  639. margin: 0 -30rpx;
  640. flex: 1;
  641. .record {
  642. flex: 1;
  643. justify-content: center;
  644. align-items: center;
  645. .no-record {
  646. text-align: center;
  647. color: #999999ff;
  648. font-size: 28rpx;
  649. height:130rpx;
  650. image {
  651. width: 94rpx;
  652. }
  653. }
  654. /* .record-time {
  655. justify-self: flex-end;
  656. font-size: 60rpx;
  657. } */
  658. .recode-image {
  659. width: 100%;
  660. height: 100%;
  661. background-color: #fafafaff;
  662. display: flex;
  663. align-items: center;
  664. .scroll-view {
  665. width: 100%;
  666. white-space: nowrap;
  667. ::-webkit-scrollbar{
  668. width:0;
  669. height:0;
  670. display:none;
  671. color:transparent;
  672. }
  673. image {
  674. width: 421rpx;
  675. height: 100rpx;
  676. margin-right: 6rpx;
  677. }
  678. }
  679. }
  680. }
  681. .record-tool {
  682. justify-content: center;
  683. align-items: center;
  684. border-top: 1rpx solid #e6e6e6ff;
  685. height: 400rpx;
  686. position: relative;
  687. .hint {
  688. color: #ee3636ff;
  689. font-size: 28rpx;
  690. position: absolute;
  691. top: 50rpx;
  692. }
  693. .record-time{
  694. font-size: 60rpx;
  695. }
  696. .record-btn-wrap {
  697. margin-top: 38rpx;
  698. display: flex;
  699. width: 100%;
  700. justify-content: space-around;
  701. align-items: center;
  702. &.center {
  703. justify-content: center;
  704. }
  705. text {
  706. color: #999999ff;
  707. font-size: 32rpx;
  708. &.active {
  709. color: #ee3636ff;
  710. }
  711. }
  712. .switch {
  713. width: 118rpx;
  714. height: 118rpx;
  715. padding: 12rpx;
  716. box-sizing: border-box;
  717. border-radius: 50%;
  718. border: 1rpx solid #ee3636ff;
  719. /* background-color: rgb(68, 46, 46); */
  720. position: relative;
  721. display: flex;
  722. align-items: center;
  723. justify-content: center;
  724. image {
  725. position: absolute;
  726. width: 36rpx;
  727. z-index: 5;
  728. }
  729. &::after {
  730. content: "";
  731. display: inline-block;
  732. width: 100%;
  733. height: 100%;
  734. border-radius: 50%;
  735. background-color: #ee3636ff;
  736. }
  737. }
  738. }
  739. }
  740. .record-play {
  741. margin: 20rpx 30rpx;
  742. .audio-wrap {
  743. background-color: #fdf8f2ff;
  744. padding: 30rpx;
  745. border-radius: 16rpx;
  746. }
  747. .play {
  748. display: flex;
  749. justify-content: space-between;
  750. .slider-box {
  751. margin-left: 15rpx;
  752. flex: 1;
  753. slider {
  754. margin: 15rpx 0 0 0;
  755. }
  756. .slider-time {
  757. display: flex;
  758. justify-content: space-between;
  759. text {
  760. color: #999999ff;
  761. font-size: 22rpx;
  762. }
  763. }
  764. }
  765. }
  766. .audio-delete {
  767. margin-top: 20rpx;
  768. width: 100%;
  769. height: 40rpx;
  770. display: flex;
  771. justify-content: flex-end;
  772. align-items: center;
  773. image {
  774. height: 40rpx;
  775. }
  776. text {
  777. margin-left: 10rpx;
  778. color: #999999ff;
  779. font-size: 28rpx;
  780. }
  781. }
  782. .audio-pub {
  783. margin-top: 120rpx;
  784. background-color: #e6b77dff;
  785. color: #fff;
  786. height: 80rpx;
  787. line-height: 80rpx;
  788. border-radius: 40rpx;
  789. text-align: center;
  790. position: relative;
  791. width: 390rpx;
  792. left: 50%;
  793. margin-left: -170rpx;
  794. }
  795. }
  796. }
  797. }
  798. </style>