Browse Source

语音播报增加核心观点

yujinwen 3 weeks ago
parent
commit
25966a0eef
5 changed files with 101 additions and 7 deletions
  1. 2 0
      api/voice.js
  2. 24 5
      pages-voice/addVoice.vue
  3. 25 0
      pages-voice/myVoice.vue
  4. 25 0
      pages-voice/voiceDetail.vue
  5. 25 2
      pages/voice/voice.vue

+ 2 - 0
api/voice.js

@@ -68,6 +68,7 @@ export const apiVoiceSendMsg=params=>{
  * @param voice_seconds 音频时长
  * @param voice_size 音频大小
  * @param voice_url 音频地址
+ * @param central_arguments 核心观点
  */
 export const apiVoiceAdd=params=>{
     return httpPost('/voice/broadcast/add',params)
@@ -87,6 +88,7 @@ export const apiVoiceAdd=params=>{
  * @param voice_seconds 音频时长
  * @param voice_size 音频大小
  * @param voice_url 音频地址
+ * @param central_arguments 核心观点
  */
 export const apiVoiceEdit=params=>{
     return httpPost('/voice/broadcast/edit',params)

+ 24 - 5
pages-voice/addVoice.vue

@@ -28,12 +28,22 @@
             @click-input="showFilter=true"
             @click-icon="showFilter=true"
         />
+        <van-field
+            :value="form.central_arguments"
+            placeholder="请输入文字"
+            :border="false"
+            clearable
+            @change="inputChangeArgument"
+            type="textarea"
+            label="核心观点"
+            :autosize="{minHeight:50,maxHeight:100}"
+        />
 
         <!-- 上传图片部分 -->
         <view 
             class="flex upload-img-box" 
             v-if="recorderStatus!=='doing'&&recorderStatus!=='pause'"
-            :style="[{'height':recorderStatus==='stop'&&'auto'},{'border-bottom':recorderStatus==='stop'?'1px solid #E6E6E6':''}]"
+            :style="[{'border-bottom':recorderStatus==='stop'?'1px solid #E6E6E6':''}]"
         >
             <view class="item" v-for="(item,index) in imgList" :key="item" @click="handlePreViewImg(item)">
                 <image :src="item" mode="aspectFill"/>
@@ -226,6 +236,7 @@ export default {
                 section_id:'',
                 section_name:'',
                 img_url:'',//分享时的底图
+                central_arguments:'',//核心观点
             },
             voiceId:0,
             voiceUrl:'',//编辑音频地址
@@ -314,6 +325,7 @@ export default {
                 this.pre_publish_time=dayjs(res.data.PrePublishTime).format('YYYY-MM-DD HH:mm')
                 this.selectTime=dayjs(res.data.PrePublishTime).valueOf()
                 this.recorderStatus='stop'
+                this.form.central_arguments=res.data.CentralArguments
             }
         },
 
@@ -514,6 +526,10 @@ export default {
             this.form.title=event.detail
         },
 
+        inputChangeArgument(event){
+            this.form.central_arguments=event.detail
+        },
+
         // 发布
         async handlePublish(type){
             if(!this.form.title||!this.form.variety_id){
@@ -554,7 +570,8 @@ export default {
                 imgs:this.imgList.join(','),
                 voice_seconds:this.temAudio.duration.toString(),
                 voice_size:this.temAudio.size.toString(),
-                voice_url:this.temAudio.url
+                voice_url:this.temAudio.url,
+                central_arguments:this.form.central_arguments
             }
             wx.showLoading({
                 title: '发布中...',
@@ -865,7 +882,7 @@ page{
     .upload-img-box{
         padding: 34rpx 4rpx 34rpx 34rpx;
         flex-wrap: wrap;
-        height: 50vh;
+        // height: 50vh;
         align-content: flex-start;
         .item{
             width: 200rpx;
@@ -902,9 +919,11 @@ page{
 }
 
 .animat-box{
-    height: 50vh;
+    height: 30vh;
+    width:100vw;
+    overflow-x: hidden;
     .con-box{
-        height: 80%;
+        height: 70%;
         background-color: #FAFAFA;
         position: relative;
     }

+ 25 - 0
pages-voice/myVoice.vue

@@ -18,6 +18,10 @@
                 <view class="title">{{item.BroadcastName}}</view>
                 <view class="time" v-if="item.PublishState==0">保存时间:{{item.ModifyTime|formatTime}}</view>
                 <view class="time" v-else>发布时间:{{item.PublishTime|formatTime}}</view>
+                <view class="argument" v-if="item.CentralArguments">
+                    <view class="btn">核心观点</view>
+                    <view class="van-multi-ellipsis--l2 argument_text">{{item.CentralArguments}}</view>
+                </view>
                 <view class="flex audio-box" @click.stop="handlePlay(item)">
                     <image 
                         :src="item.BroadcastId==curVoiceId&&!curAudioPaused?require('@/static/voice/playing.png'):require('@/static/voice/pause.png')" 
@@ -446,6 +450,27 @@ export default {
                 margin-right: 20rpx;
             }
         }
+        .argument{
+            margin-bottom: 30rpx;
+            position: relative;
+            .btn{
+                background: linear-gradient(90deg, #201E1C 0%, #625A4E 100%);
+                color: #F3A52F;
+                font-size: 24rpx;
+                width: 120rpx;
+                line-height: 42rpx;
+                border-radius: 20rpx;
+                text-align: center;
+                float: left;
+                position: absolute;
+                left: 0;
+                top: 0;
+            }
+            .argument_text{
+                color: #999999;
+                text-indent: 5em;
+            }
+        }
     }
 }
 </style>

+ 25 - 0
pages-voice/voiceDetail.vue

@@ -3,6 +3,10 @@
         <!-- <view class="section-name">{{info.SectionName}}</view> -->
         <view class="title">{{info.BroadcastName}}</view>
         <view class="time">发布时间:{{info.PublishTime|formatTime}}</view>
+        <view class="argument" v-if="info.CentralArguments">
+            <view class="btn">核心观点</view>
+            <view class="argument_text">{{info.CentralArguments}}</view>
+        </view>
         <view class="flex audio-box">
             <image 
                 :src="voiceId==curVoiceId&&!curAudioPaused?require('@/static/voice/playing.png'):require('@/static/voice/pause.png')" 
@@ -331,5 +335,26 @@ export default {
                 margin-bottom: 40rpx;
             }
         }
+        .argument{
+            margin: 30rpx 0;
+            position: relative;
+            .btn{
+                display: inline-block;
+                background: linear-gradient(90deg, #201E1C 0%, #625A4E 100%);
+                color: #F3A52F;
+                font-size: 24rpx;
+                width: 120rpx;
+                line-height: 42rpx;
+                border-radius: 20rpx;
+                text-align: center;
+                position: absolute;
+                left: 0;
+                top: 0;
+            }
+            .argument_text{
+                text-indent: 4em;
+                font-size: 32rpx;
+            }
+        }
     }
 </style>

+ 25 - 2
pages/voice/voice.vue

@@ -34,6 +34,10 @@
             <view class="item" v-for="item in list" :key="item.BroadcastId" @click="handleGoDetail(item)">
                 <view class="title">{{item.BroadcastName}}</view>
                 <view class="time">发布时间:{{item.PublishTime|formatTime}}</view>
+                <view class="argument" v-if="item.CentralArguments">
+                    <view class="btn">核心观点</view>
+                    <view class="van-multi-ellipsis--l2 argument_text">{{item.CentralArguments}}</view>
+                </view>
                 <view class="flex audio-box" @click.stop="handlePlay(item)">
                     <image 
                         :src="item.BroadcastId==curVoiceId&&!curAudioPaused?require('@/static/voice/playing.png'):require('@/static/voice/pause.png')" 
@@ -548,8 +552,6 @@ export default {
             }
             
         }
-
-
         .title{
             font-size: 32rpx;
         }
@@ -573,6 +575,27 @@ export default {
                 margin-right: 20rpx;
             }
         }
+        .argument{
+            margin-bottom: 30rpx;
+            position: relative;
+            .btn{
+                background: linear-gradient(90deg, #201E1C 0%, #625A4E 100%);
+                color: #F3A52F;
+                font-size: 24rpx;
+                width: 120rpx;
+                line-height: 42rpx;
+                border-radius: 20rpx;
+                text-align: center;
+                float: left;
+                position: absolute;
+                left: 0;
+                top: 0;
+            }
+            .argument_text{
+                color: #999999;
+                text-indent: 5em;
+            }
+        }
     }
 }
 .list-bot1{