answerDetail.vue 24 KB

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