|
@@ -29,6 +29,20 @@
|
|
|
@click-icon="showFilter=true"
|
|
|
/>
|
|
|
|
|
|
+ <!-- 上传图片部分 -->
|
|
|
+ <view class="flex upload-img-box">
|
|
|
+ <view class="item" v-for="(item,index) in imgList" :key="item" @click="handlePreViewImg(item)">
|
|
|
+ <image :src="item" mode="aspectFill"/>
|
|
|
+ <view class="del-btn" @click.stop="handleDelImg(index)">
|
|
|
+ <van-icon name="cross" size="12" style="position: absolute;left:16rpx;top:8rpx" color="#ffffff"/>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="item add-btn" @click="handleUploadImg" v-if="imgList.length<5">
|
|
|
+ <image src="./static/camera.png" mode="aspectFill" />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="flex audio-box" v-if="recorderStatus==='stop'">
|
|
|
<image
|
|
|
:src="temAudio.paused?'../../../static/voice/pause.png':'../../../static/voice/playing.png'"
|
|
@@ -65,7 +79,7 @@
|
|
|
<image :class="['img move3',recorderStatus==='doing'?'animat-run':'animat-pause']" src="./static/record-img.png" mode="widthFix" />
|
|
|
</view>
|
|
|
<view class="bot-text">{{time|formatTime}}</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
|
|
|
<view class="sound-record-wrap" v-if="recorderStatus!=='stop'">
|
|
|
<view class="top-text">点击开始录音</view>
|
|
@@ -83,7 +97,10 @@
|
|
|
>完成</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="publish-btn" v-if="recorderStatus==='stop'" @click="handlePublish">发布</view>
|
|
|
+ <view class="publish-btn" v-if="recorderStatus==='stop'">
|
|
|
+ <text @click="showTime=true">定时发布</text>
|
|
|
+ <text @click="handlePublish">立即发布</text>
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 筛选弹窗 -->
|
|
|
<van-popup
|
|
@@ -110,7 +127,40 @@
|
|
|
</view>
|
|
|
</van-popup>
|
|
|
|
|
|
- <van-dialog id="van-dialog" />
|
|
|
+ <!-- 选择时间弹窗 -->
|
|
|
+ <van-popup
|
|
|
+ :show="showTime"
|
|
|
+ position="bottom"
|
|
|
+ :close-on-click-overlay="true"
|
|
|
+ @close="showTime = false"
|
|
|
+ round
|
|
|
+ >
|
|
|
+ <van-datetime-picker
|
|
|
+ title="设置发布时间"
|
|
|
+ type="datetime"
|
|
|
+ :value="selectTime"
|
|
|
+ :min-date="minDate"
|
|
|
+ @confirm="handleConfirmTime"
|
|
|
+ @cancel="showTime = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+
|
|
|
+ <!-- <van-dialog id="van-dialog" /> -->
|
|
|
+ <!-- 发布弹窗 -->
|
|
|
+ <van-dialog
|
|
|
+ use-slot
|
|
|
+ :show="showPublish"
|
|
|
+ confirm-button-text="发布且推送"
|
|
|
+ cancel-button-text="仅发布"
|
|
|
+ show-cancel-button
|
|
|
+ @confirm="handleConfirmPublish(false)"
|
|
|
+ @cancel="handleConfirmPublish(true)"
|
|
|
+ >
|
|
|
+ <view style="padding:40px 20px 20px;text-align:center;position: relative;">
|
|
|
+ 发布后将推送模板消息和客群,确认发布吗?
|
|
|
+ <van-icon name="cross" size="20" style="position: absolute;right:10px;top:10px" color="#6666" @click="showPublish=false"/>
|
|
|
+ </view>
|
|
|
+ </van-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -119,6 +169,7 @@ import {apiVoiceSectionList,apiVoiceSendMsg} from '@/api/voice'
|
|
|
import {baseApiUrl} from '@/utils/config.js'
|
|
|
import CryptoJS from '@/utils/crypto.js'
|
|
|
import uniAsync from "@/utils/uni-async.js"; // uni api async 化
|
|
|
+import {uploadImg} from '@/utils/upload'
|
|
|
const recorderManager = wx.getRecorderManager();//录音实例
|
|
|
let innerAudioContext = uni.createInnerAudioContext();//播放音频实例
|
|
|
let TIMER=null//计时器
|
|
@@ -170,6 +221,13 @@ export default {
|
|
|
options:[],
|
|
|
mainActiveIndex:0,
|
|
|
activeId:0,//选择的板块id
|
|
|
+
|
|
|
+ showPublish:false,
|
|
|
+
|
|
|
+ imgList:[],
|
|
|
+ showTime:false,
|
|
|
+ selectTime:new Date().getTime(),
|
|
|
+ minDate:new Date().getTime()+60000,
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|
|
@@ -401,18 +459,20 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- this.$dialog.confirm({
|
|
|
- title:'',
|
|
|
- message: '发布后将推送模板消息和客群,确认发布吗?',
|
|
|
- confirmButtonText:'发布且推送',
|
|
|
- cancelButtonText:'仅发布'
|
|
|
- }).then(()=>{
|
|
|
- //发布且推送
|
|
|
- this.handleConfirmPublish(false)
|
|
|
- }).catch(()=>{
|
|
|
- //仅仅是发布
|
|
|
- this.handleConfirmPublish(true)
|
|
|
- })
|
|
|
+ this.showPublish=true
|
|
|
+
|
|
|
+ // this.$dialog.confirm({
|
|
|
+ // title:'',
|
|
|
+ // message: '发布后将推送模板消息和客群,确认发布吗?',
|
|
|
+ // confirmButtonText:'发布且推送',
|
|
|
+ // cancelButtonText:'仅发布'
|
|
|
+ // }).then(()=>{
|
|
|
+ // //发布且推送
|
|
|
+ // this.handleConfirmPublish(false)
|
|
|
+ // }).catch(()=>{
|
|
|
+ // //仅仅是发布
|
|
|
+ // this.handleConfirmPublish(true)
|
|
|
+ // })
|
|
|
},
|
|
|
//确认发布 onlyPublished:true仅发布
|
|
|
handleConfirmPublish(onlyPublished){
|
|
@@ -494,6 +554,37 @@ export default {
|
|
|
}, 1000);
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+
|
|
|
+ //图片上传
|
|
|
+ handleUploadImg(e){
|
|
|
+ uploadImg({count:5-this.imgList.length}).then(res=>{
|
|
|
+ this.imgList=[...this.imgList,...res]
|
|
|
+ }).catch(err=>{
|
|
|
+ uni.showToast({
|
|
|
+ title:'上传失败,请重试!',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //预览图片
|
|
|
+ handlePreViewImg(item){
|
|
|
+ wx.previewImage({
|
|
|
+ urls:this.imgList,
|
|
|
+ current:item
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //删除图片
|
|
|
+ handleDelImg(index){
|
|
|
+ this.imgList.splice(index,1)
|
|
|
+ },
|
|
|
+
|
|
|
+ //选择时间
|
|
|
+ handleConfirmTime(e){
|
|
|
+ this.selectTime=e.detail
|
|
|
+ this.showTime=false
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -554,7 +645,7 @@ page{
|
|
|
<style lang="scss" scoped>
|
|
|
.add-voice-page{
|
|
|
.empty-voice-box{
|
|
|
- height: 50vh;
|
|
|
+ height: 36vh;
|
|
|
padding-top: 150rpx;
|
|
|
image{
|
|
|
width: 140rpx;
|
|
@@ -651,16 +742,71 @@ page{
|
|
|
}
|
|
|
|
|
|
.publish-btn{
|
|
|
- width: 390rpx;
|
|
|
- height: 80rpx;
|
|
|
+ // width: 390rpx;
|
|
|
+ // height: 80rpx;
|
|
|
+ // text-align: center;
|
|
|
+ // line-height: 80rpx;
|
|
|
+ // color: #fff;
|
|
|
+ // background: #E6B77D;
|
|
|
+ // font-size: 32rpx;
|
|
|
+ // border-radius: 40px;
|
|
|
+ // margin-left: auto;
|
|
|
+ // margin-right: auto;
|
|
|
text-align: center;
|
|
|
- line-height: 80rpx;
|
|
|
- color: #fff;
|
|
|
- background: #E6B77D;
|
|
|
- font-size: 32rpx;
|
|
|
- border-radius: 40px;
|
|
|
- margin-left: auto;
|
|
|
- margin-right: auto;
|
|
|
+ text{
|
|
|
+ width: 300rpx;
|
|
|
+ height: 80rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 80rpx;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin: 0 15rpx;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ }
|
|
|
+ text:first-child{
|
|
|
+ border: 1px solid #E6B77D;
|
|
|
+ color: #E6B77D;
|
|
|
+ }
|
|
|
+ text:last-child{
|
|
|
+ background-color: #E6B77D;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload-img-box{
|
|
|
+ padding: 34rpx 4rpx 34rpx 34rpx;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .item{
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ margin-right: 30rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ position: relative;
|
|
|
+ image{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .del-btn{
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 48rpx;
|
|
|
+ height: 48rpx;
|
|
|
+ background-color: rgba(0, 0, 0, 0.7);
|
|
|
+ border-radius: 0 0 0 48rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .add-btn{
|
|
|
+ background-color: #f7f7f7;
|
|
|
+ image{
|
|
|
+ width: 80rpx;
|
|
|
+ height: 80rpx;
|
|
|
+ position: absolute;
|
|
|
+ left: 60rpx;
|
|
|
+ top: 60rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|