删除旧版本 云广播
@@ -3,12 +3,12 @@
|
||||
<div class="header">
|
||||
<img src="./img/bigHorn-bg.png" alt="">
|
||||
<div class="content">
|
||||
<div class="item" @click="linkTo('./onlineList')">
|
||||
<div class="item" @click="linkTo('./AppEquipment/AppEquipment')">
|
||||
<img src="./img/bigHorn-icon1@2x.png" alt="">
|
||||
<div>在线设备</div>
|
||||
<div>广播设备</div>
|
||||
<!-- <h2>1</h2> -->
|
||||
</div>
|
||||
<div class="item" @click="linkTo('./playList')">
|
||||
<div class="item" @click="linkTo('./AppPlayList/AppPlayList')">
|
||||
<img src="./img/bigHorn-icon2@2x.png" alt="">
|
||||
<div>播放记录</div>
|
||||
</div>
|
||||
@@ -30,8 +30,8 @@
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "AppBroadcast2",
|
||||
appName: "云广播2",
|
||||
name: "AppBroadcast",
|
||||
appName: "云广播",
|
||||
data() {
|
||||
return {
|
||||
bannerList: [
|
||||
@@ -42,22 +42,23 @@ export default {
|
||||
path: './addPlay',
|
||||
bgClass: 'bg-67A3F4'
|
||||
},
|
||||
// {
|
||||
// title: '实时喊话',
|
||||
// text: '实时在线喊话,远程广播通知',
|
||||
// imgUrl: require('./img/bigHorn-icon22@2x.png'),
|
||||
// bgClass: 'bg-4ED5BB'
|
||||
// },
|
||||
{
|
||||
title: '实时喊话',
|
||||
path: './LiveBroadcast',
|
||||
text: '实时在线喊话,远程广播通知',
|
||||
imgUrl: require('./img/bigHorn-icon22@2x.png'),
|
||||
bgClass: 'bg-4ED5BB'
|
||||
},
|
||||
{
|
||||
title: '音频录制',
|
||||
text: '音频文件的录制',
|
||||
path: '/apps/AppResourcesManage/addPlay?type=1',
|
||||
path: './AppResourcesManage/addMedia?type=1',
|
||||
imgUrl: require('./img/bigHorn-icon33@2x.png'),
|
||||
bgClass: 'bg-E5B565'
|
||||
},
|
||||
{
|
||||
title: '媒资管理',
|
||||
path: '/apps/AppResourcesManage/AppResourcesManage',
|
||||
path: './AppResourcesManage/AppResourcesManage',
|
||||
text: '支持音频文件和录音内容添加',
|
||||
imgUrl: require('./img/bigHorn-icon44@2x.png'),
|
||||
bgClass: 'bg-F19661'
|
||||
|
||||
170
src/apps/AppBroadcast/AppEquipment/AppEquipment.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div class="AppEquipment">
|
||||
<AiTopFixed>
|
||||
<div class="currentLeft-top">
|
||||
<div class="left">
|
||||
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
|
||||
<span class="label" v-if="areaName">{{ areaName }}</span>
|
||||
<span v-else>请选择</span>
|
||||
<u-icon name="arrow-down" color="#666" size="24" style="margin-left: 4px" />
|
||||
</AiAreaPicker>
|
||||
</div>
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入设备名称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="getListInit"></u-search>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="record">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<img src="../img/lb@2x.png" alt="" class="voice-img">
|
||||
<div class="info">
|
||||
<div class="text">
|
||||
<p>{{item.name}}</p>
|
||||
<span>{{item.areaName}}</span>
|
||||
</div>
|
||||
<div class="status">{{ $dict.getLabel('dlbDevStatus', item.devStatus) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "AppEquipment",
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
keyword: '',
|
||||
list: []
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad() {
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName
|
||||
this.$dict.load(['dlbDevStatus']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = '设备管理'
|
||||
},
|
||||
methods: {
|
||||
areaSelect(e) {
|
||||
this.areaId = e
|
||||
this.getListInit()
|
||||
},
|
||||
getListInit() {
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
getList() { //&areaId=${this.areaId}
|
||||
this.$http.post(`/app/appdlbquipment/list?current=1&size=20&name=${this.keyword}&areaId=${this.areaId}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.navigateTo({url: `./detail?id=${item.id}`})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppEquipment {
|
||||
|
||||
.currentLeft-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.left {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.record {
|
||||
margin-top: 8px;
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
border-bottom: 1px solid #ddd;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.check-img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.voice-img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
font-size: 34px;
|
||||
padding-right: 32px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
|
||||
.text {
|
||||
line-height: 1;
|
||||
|
||||
p {
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #4E8EEE;
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
331
src/apps/AppBroadcast/AppEquipment/detail.vue
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<AiTopFixed>
|
||||
<div class="tab">
|
||||
<u-tabs :list="tab" :is-scroll="false" :current="currIndex" @change="change" height="96" :bar-style="barStyle"></u-tabs>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="content">
|
||||
<div class="info-content" v-if="currIndex != 1">
|
||||
<p>{{info.name}}</p>
|
||||
<div class="info">
|
||||
<span>设备编号</span>
|
||||
<span class="color-333">{{info.serialNo}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>设备状态</span>
|
||||
<span style="color: #4E8EEE">{{ $dict.getLabel('dlbDevStatus', info.devStatus) }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>信号强度</span>
|
||||
<span class="color-333">{{ $dict.getLabel('dlbDevSignal', info.devSignal) }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>音量</span>
|
||||
<span class="color-333">{{info.volume}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>所属区划</span>
|
||||
<span class="color-333">{{info.areaName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-content" v-else>
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toPlayDetail(item)">
|
||||
<div class="left">
|
||||
<p>{{ item.sourceName }}</p>
|
||||
<div>{{item.createUserName}} {{ item.createTime }}</div>
|
||||
<div>{{ $dict.getLabel('dlbMessageUrgency', item.messageLevel) }} {{item.taskType == 1 ? '定时播放' : '立即播放'}}</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="status" v-if="item.broadcastStatus == 6" style="color: #999;">已取消</div>
|
||||
<div class="status" v-if="item.broadcastStatus == 3" style="color: #5aad6a;">播发成功</div>
|
||||
<div class="status" v-if="item.broadcastStatus == 0">已下发</div>
|
||||
<div v-if="item.broadcastStatus == 0 || item.broadcastStatus == 1 || item.broadcastStatus == 2">
|
||||
<div class="cancel-btn" @click.stop="cancel(item.id)" v-if="item.taskType == 1">撤销</div>
|
||||
<div class="cancel-btn bg-AFD0FC" v-else>撤销</div>
|
||||
</div>
|
||||
<div class="cancel-btn bg-AFD0FC" v-else>撤销</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" @click="setVolume" v-if="currIndex != 1">设置音量</div>
|
||||
<u-popup v-model="isShow" mode="bottom" class="popup">
|
||||
<div class="title">
|
||||
<span @click="isShow=false">取消</span>
|
||||
<p>设置音量</p>
|
||||
<span @click="confirmAdd">保存</span>
|
||||
</div>
|
||||
<div class="slider-content">
|
||||
<span>1</span>
|
||||
<div class="slider">
|
||||
<u-slider v-model="volume" min="1" max="100" :use-slot="true" block-color="#007BFF" step="10">
|
||||
<view class="">
|
||||
<view class="badge-button">
|
||||
{{volume}}
|
||||
</view>
|
||||
</view>
|
||||
</u-slider>
|
||||
</div>
|
||||
<span>100</span>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "detail",
|
||||
data() {
|
||||
return {
|
||||
barStyle: {width: '98px', bottom: '-3px', left: '-38px'},
|
||||
tab: [{name: '基本信息'}, {name: '播发任务'}],
|
||||
list: [],
|
||||
currIndex: 0,
|
||||
current: 1,
|
||||
isShow: false,
|
||||
volume: 10,
|
||||
info: {},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
this.id = query.id
|
||||
this.$dict.load(['dlbDevStatus', 'dlbDevSignal']).then(() => {
|
||||
this.getDetail()
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '设备详情'
|
||||
},
|
||||
|
||||
methods: {
|
||||
change(index) {
|
||||
this.currIndex = index
|
||||
},
|
||||
toPlayDetail(item) {
|
||||
uni.navigateTo({url: `../AppPlayList/detail?id=${item.id}`})
|
||||
},
|
||||
setVolume() {
|
||||
this.isShow = true
|
||||
this.volume = this.info.volume
|
||||
},
|
||||
confirmAdd() {
|
||||
this.$http.post(`/app/appdlbquipment/volumeControl?deviceId=${this.info.deviceId}&volume=${this.volume}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.getDetail()
|
||||
this.isShow = false
|
||||
this.$u.toast('音量设置成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appdlbquipment/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data
|
||||
this.getPlayList()
|
||||
}
|
||||
})
|
||||
},
|
||||
getPlayList() {
|
||||
this.$http.post(`/app/appzyvideobroadcast/list?current=${this.current}&size=10&serialNo=${this.info.serialNo}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel(id) {
|
||||
this.$confirm('确定撤回该广播?').then(() => {
|
||||
this.$http.post(`/app/appzyvideobroadcast/getBroadcastRecall?broadcastId=${id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('撤回成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
if(this.currIndex == 1) {
|
||||
this.current ++
|
||||
this.getPlayList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
padding-bottom: 128px;
|
||||
::v-deep .AiTopFixed{
|
||||
.content{
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.tab {
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.content{
|
||||
margin-top: 8px;
|
||||
.info-content{
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
p{
|
||||
padding: 32px 32px 32px 0;
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 56px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.info{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 44px;
|
||||
padding: 34px 32px 32px 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.color-333{
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-content{
|
||||
.list{
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
.item{
|
||||
display: flex;
|
||||
padding: 16px 40px 16px 0;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.left{
|
||||
width: calc(100% - 176px);
|
||||
p{
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
word-break: break-all;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
div{
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
width: 160px;
|
||||
text-align: center;
|
||||
.status{
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #4E8EEE;
|
||||
line-height: 48px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
.cancel-btn{
|
||||
width: 154px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 8px;
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
.bg-AFD0FC{
|
||||
background: #AFD0FC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.popup{
|
||||
background-color: #fff;
|
||||
.title{
|
||||
padding: 24px 0;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
span{
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #5297FF;
|
||||
|
||||
}
|
||||
p{
|
||||
display: inline-block;
|
||||
width: calc(100% - 240px);
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #0F1826;
|
||||
}
|
||||
}
|
||||
.slider-content{
|
||||
padding: 56px 44px 120px;
|
||||
display: flex;
|
||||
span{
|
||||
display: inline-block;
|
||||
font-size: 40px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
line-height: 56px;
|
||||
}
|
||||
.slider{
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
margin: 26px 30px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .u-slider__button-wrap{
|
||||
margin-top: -40px;
|
||||
font-size: 44px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
190
src/apps/AppBroadcast/AppPlayList/AppPlayList.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="AppPlayList">
|
||||
<AiTopFixed>
|
||||
<div class="currentLeft-top">
|
||||
<div class="left">
|
||||
<AiSelect @data="selectType" :list="typeList" v-model="type"></AiSelect>
|
||||
</div>
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入素材名称/发布人员" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="handerClear"></u-search>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)" >
|
||||
<div class="left">
|
||||
<p>{{ item.sourceName }}</p>
|
||||
<div>{{item.createUserName}} {{ item.createTime }}</div>
|
||||
<div>{{ $dict.getLabel('dlbMessageUrgency', item.messageLevel) }} {{item.taskType == 1 ? '定时播放' : '立即播放'}}</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="status" v-if="item.broadcastStatus == 6" style="color: #999;">已取消</div>
|
||||
<div class="status" v-if="item.broadcastStatus == 3" style="color: #5aad6a;">播发成功</div>
|
||||
<div class="status" v-if="item.broadcastStatus == 0">已下发</div>
|
||||
<div v-if="item.broadcastStatus == 0 || item.broadcastStatus == 1 || item.broadcastStatus == 2">
|
||||
<div class="cancel-btn" @click.stop="cancel(item.id)" v-if="item.taskType == 1">撤销</div>
|
||||
<div class="cancel-btn bg-AFD0FC" v-else>撤销</div>
|
||||
</div>
|
||||
<div class="cancel-btn bg-AFD0FC" v-else>撤销</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "AppPlayList",
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
current: 1,
|
||||
type: '0',
|
||||
typeList: [{label: '全部', value: '0'}, {label: '我发布的', value: '1'}],
|
||||
keyword: '',
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad(query) {
|
||||
this.$dict.load(['dlbMessageUrgency']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = '播放记录'
|
||||
},
|
||||
methods: {
|
||||
selectType(selecteds) {
|
||||
this.type = selecteds?.[0]?.value
|
||||
this.getListInit()
|
||||
},
|
||||
getListInit() {
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.$http.post(`/app/appzyvideobroadcast/list`, null, {
|
||||
params: {
|
||||
sourceName: this.keyword,
|
||||
current: this.current,
|
||||
size: 10,
|
||||
createUserId: this.type == 1 ? this.user.id : ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
cancel(id) {
|
||||
this.$confirm('确定撤回该广播?').then(() => {
|
||||
this.$http.post(`/app/appzyvideobroadcast/getBroadcastRecall?broadcastId=${id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('撤回成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.navigateTo({url: `./detail?id=${item.id}`})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppPlayList {
|
||||
// ::v-deep .AiTopFixed{
|
||||
// .content{
|
||||
// padding: 0;
|
||||
// }
|
||||
// }
|
||||
.currentLeft-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.left {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list{
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
.item{
|
||||
display: flex;
|
||||
padding: 16px 40px 16px 0;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.left{
|
||||
width: calc(100% - 176px);
|
||||
p{
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
word-break: break-all;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
div{
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
width: 160px;
|
||||
text-align: center;
|
||||
.status{
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #4E8EEE;
|
||||
line-height: 48px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
.cancel-btn{
|
||||
width: 154px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 8px;
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
.bg-AFD0FC{
|
||||
background: #AFD0FC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
251
src/apps/AppBroadcast/AppPlayList/detail.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div class="info-content">
|
||||
<div class="info border-none">
|
||||
<h2>播发任务</h2>
|
||||
<h3 v-if="info.broadcastStatus == 6" style="color: #999;">已取消</h3>
|
||||
<h3 v-if="info.broadcastStatus == 3" style="color: #5aad6a;">播发成功</h3>
|
||||
<h3 v-if="info.broadcastStatus == 0">已下发</h3>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>播发级别</span>
|
||||
<span class="color-333">{{ $dict.getLabel('dlbMessageUrgency', info.messageLevel) }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>播放方式</span>
|
||||
<span class="color-333">{{info.taskType == 1 ? '定时播放' : '立即播放'}}
|
||||
<span v-if="info.taskType == 1 ">-{{ $dict.getLabel('dlbDyclingType', info.cyclingType) }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="info.taskType == 1">
|
||||
<div class="info" v-if="info.cyclingType != 1">
|
||||
<span>播放天数</span>
|
||||
<span class="color-333" v-if="info.cyclingType == 3">{{info.broadcastDay}}</span>
|
||||
<span class="color-333" v-if="info.cyclingType == 2">
|
||||
<span v-for="(item, index) in info.cyclingDateList" :key="index"><span v-if="index > 0">,</span>{{dayList[item]}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>开始日期</span>
|
||||
<span class="color-333">{{info.startDate}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>开始时间</span>
|
||||
<span class="color-333">{{info.startTime}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>结束时间</span>
|
||||
<span class="color-333">{{info.endTime}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>创建人</span>
|
||||
<span class="color-333">{{info.createUserName}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>创建时间</span>
|
||||
<span class="color-333">{{info.createTime}}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>播发设备</span>
|
||||
<span class="color-333" @click="toEquipmentList">共<span style="color:#1174FE;" v-if="info.devices">{{info.devices.length}}</span>个设备<u-icon name="arrow-right" size="28" color="#999999" style="margin-left:8px;"></u-icon></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
<h2>播发素材</h2>
|
||||
<div class="media-item" v-for="(item, index) in info.materials" :key="index">
|
||||
<img :src="`${$cdn}video/play-icon.png`" alt="" @click="choose(item)">
|
||||
<div class="info">
|
||||
<!-- <p>{{info.sourceName}}</p> -->
|
||||
<div>{{item.createUserName}} {{item.createTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:120px;"></div>
|
||||
<div v-if="info.broadcastStatus == 0 || info.broadcastStatus == 1 || info.broadcastStatus == 2">
|
||||
<div class="btn" v-if="info.taskType == 1" @click="cancel">撤销任务</div>
|
||||
</div>
|
||||
<u-popup v-model="isShow" mode="bottom">
|
||||
<div class="audio">
|
||||
<AiVideo :src="url" autoplay></AiVideo>
|
||||
<!-- <audio :src="url" ref="audio" :controls="true" :name="autioName" style="display: block;"></audio> -->
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "detail",
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
url: '',
|
||||
id: '',
|
||||
info: {},
|
||||
dayList: ['', '每周一', '每周二', '每周三', '每周四', '每周五', '每周六', '每周日'],
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.$dict.load(['dlbMessageUrgency', 'dlbDyclingType']).then(() => {
|
||||
this.getDetail()
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '任务详情'
|
||||
},
|
||||
|
||||
methods: {
|
||||
choose(item) {
|
||||
this.url = item.url
|
||||
this.isShow = true
|
||||
},
|
||||
toEquipmentList() {
|
||||
uni.navigateTo({url: `./equipmentList?id=${this.id}`})
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appzyvideobroadcast/queryDetailById?id=${this.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data
|
||||
if(this.info.cyclingType == 2) {
|
||||
this.info.cyclingDateList = this.info.cyclingDate.split(',')
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$confirm('确定撤回该广播?').then(() => {
|
||||
this.$http.post(`/app/appzyvideobroadcast/getBroadcastRecall?broadcastId=${this.info.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('撤回成功!')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
.info-content{
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
p{
|
||||
padding: 32px 32px 32px 0;
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 56px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.info{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 44px;
|
||||
padding: 34px 32px 32px 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.color-333{
|
||||
color: #333;
|
||||
}
|
||||
h2{
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 52px;
|
||||
}
|
||||
h3{
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #4E8EEE;
|
||||
line-height: 52px;
|
||||
}
|
||||
}
|
||||
.border-none{
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
.audio {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
box-sizing: border-box;
|
||||
padding: 104px 0 46px;
|
||||
}
|
||||
.media-content{
|
||||
margin-top: 16px;
|
||||
background-color: #fff;
|
||||
h2{
|
||||
padding: 32px;
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 52px;
|
||||
}
|
||||
.media-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 32px 30px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 70px);
|
||||
line-height: 44px;
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
div{
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #F46;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
119
src/apps/AppBroadcast/AppPlayList/equipmentList.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div class="equipmentList">
|
||||
<p class="title">播发设备<span class="mini-title">共<span style="color:#1174FE;">{{info.devices.length}}</span>个设备</span></p>
|
||||
<div class="record">
|
||||
<div class="item" v-for="(item, index) in info.devices" :key="index">
|
||||
<img src="../img/lb@2x.png" alt="" class="voice-img">
|
||||
<div class="info">
|
||||
<div class="text">
|
||||
<p>{{item.name}}</p>
|
||||
<span>{{item.areaName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "equipmentList",
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
info: {},
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.getDetail()
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appzyvideobroadcast/queryDetailById?id=${this.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.equipmentList {
|
||||
.title{
|
||||
padding: 32px;
|
||||
background-color: #fff;
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 52px;
|
||||
.mini-title{
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
.record {
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
.check-img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin: 32px 32px 0 0;
|
||||
}
|
||||
|
||||
.voice-img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 28px 16px 0 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 160px);
|
||||
padding: 18px 0;
|
||||
line-height: 44px;
|
||||
font-size: 34px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.text {
|
||||
p {
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #4E8EEE;
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
349
src/apps/AppBroadcast/AppResourcesManage/AppResourcesManage.vue
Normal file
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<div class="AppResourcesManage">
|
||||
<AiTopFixed>
|
||||
<div class="currentLeft-top">
|
||||
<div class="left">
|
||||
<AiSelect @data="selectType" :list="typeList" v-model="type"></AiSelect>
|
||||
</div>
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入素材名称/创建人员" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getListInit" @clear="handerClear"></u-search>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<u-tabs :list="tab" :is-scroll="false" :current="currIndex" @change="change" height="96" :bar-style="barStyle"></u-tabs>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="record" v-if="currIndex == 0">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<img :src="`${$cdn}video/play-icon.png`" alt="" @click.stop="choose(item)">
|
||||
<div class="info">
|
||||
<p>{{ item.name ? item.name.split('.')[0] : '-' }}</p>
|
||||
<div class="time">{{ item.createUserName }} {{ item.createTime }}</div>
|
||||
</div>
|
||||
<div class="btn" @click.stop="toAddBroadcast(item)">发布</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="record-text" v-else>
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<div class="info">
|
||||
<div>{{ item.name }}</div>
|
||||
<p>{{ item.content }}</p>
|
||||
<div class="time">{{ item.createUserName }} {{ item.createTime }}</div>
|
||||
</div>
|
||||
<div class="btn" @click.stop="toAddBroadcast(item)">发布</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
<img src="./img/add-icon.png" alt="" class="add-img" @click="add">
|
||||
<u-popup v-model="isShow" mode="bottom">
|
||||
<div class="audio">
|
||||
<AiVideo :src="url" autoplay></AiVideo>
|
||||
<!-- <audio :src="url" ref="audio" :controls="true" :name="autioName" style="display: block;"></audio> -->
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "AppResourcesManage",
|
||||
data() {
|
||||
return {
|
||||
tab: [{name: '音频素材'}, {name: '文本素材'}],
|
||||
list: [],
|
||||
currIndex: 0,
|
||||
current: 1,
|
||||
isChoose: false,
|
||||
isMore: false,
|
||||
isShow: false,
|
||||
url: '',
|
||||
autioName: '',
|
||||
audio: null,
|
||||
barStyle: {width: '96px', bottom: '-3px', left: '-38px'},
|
||||
keyword: '',
|
||||
type: '0',
|
||||
typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},]
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad() {
|
||||
this.getList()
|
||||
uni.$on('getList', () => {
|
||||
this.isMore = false
|
||||
this.list = []
|
||||
this.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '媒资管理'
|
||||
},
|
||||
|
||||
methods: {
|
||||
selectType(selecteds) {
|
||||
this.type = selecteds?.[0]?.value
|
||||
this.getListInit()
|
||||
},
|
||||
change(index) {
|
||||
this.currIndex = index
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
add() {
|
||||
uni.navigateTo({
|
||||
url: `./addMedia?type=${this.currIndex === 0 ? 1 : 3}`
|
||||
})
|
||||
},
|
||||
|
||||
choose(item) {
|
||||
this.url = item.url
|
||||
this.isShow = true
|
||||
},
|
||||
|
||||
handerClear() {
|
||||
this.keyword = ''
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
getListInit() {
|
||||
this.isMore = false
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
getList() {
|
||||
if (this.isMore) return
|
||||
|
||||
this.$http.post(`/app/appdlbresource/list`, null, {
|
||||
params: {
|
||||
name: this.keyword,
|
||||
current: this.current,
|
||||
size: 10,
|
||||
createUserId: this.type == 1 ? this.user.id : '',
|
||||
type: this.currIndex == 1 ? '3' : '1'
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.current = this.current + 1
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.navigateTo({url: `./detail?id=${item.id}`})
|
||||
},
|
||||
toAddBroadcast(item) {
|
||||
uni.navigateTo({ url: `../addPlay?mediaId=${item.id}&mediaName=${item.name}` })
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppResourcesManage {
|
||||
padding-bottom: 128px;
|
||||
::v-deep .AiTopFixed{
|
||||
.content{
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.time{
|
||||
font-size: 28px!important;
|
||||
color: #999!important;
|
||||
margin: 8px 0 0 0!important;
|
||||
}
|
||||
|
||||
.tab {
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.audio {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
box-sizing: border-box;
|
||||
padding: 104px 0 46px;
|
||||
|
||||
audio {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.record {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 32px 30px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 256px);
|
||||
line-height: 44px;
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
div{
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
width: 154px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 8px;
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
margin-left: 32px;
|
||||
}
|
||||
.bg-AFD0FC{
|
||||
background-color: #AFD0FC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.record-text {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 32px 30px;
|
||||
box-sizing: border-box;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.info{
|
||||
width: calc(100% - 190px);
|
||||
div {
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
.color-0063E5 {
|
||||
color: #0063E5;
|
||||
}
|
||||
|
||||
.color-FF8100 {
|
||||
color: #FF8100;
|
||||
}
|
||||
|
||||
.color-FF4466 {
|
||||
color: #FF4466;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
line-height: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
word-break: break-all;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
width: 154px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 8px;
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
.bg-AFD0FC{
|
||||
background-color: #AFD0FC;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.add-img {
|
||||
width: 120px;
|
||||
position: fixed;
|
||||
bottom: 120px;
|
||||
right: 32px;
|
||||
}
|
||||
|
||||
.currentLeft-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 32px 32px 0;
|
||||
|
||||
.left {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .u-search {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
204
src/apps/AppBroadcast/AppResourcesManage/addMedia.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<div class="addPlay">
|
||||
<div v-if="type == '1'">
|
||||
<div class="content">
|
||||
<div class="item">
|
||||
<div class="label">音频文件</div>
|
||||
<div class="value" @click="toRecord">
|
||||
<span class="color-999" :style="{ color: file ? '#333' : '' }">{{ file ? '已选择' : '请选择' }}</span>
|
||||
<img src="./img/right-img.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="radio-content">
|
||||
<div class="title">素材标题</div>
|
||||
<textarea rows="2" placeholder="请输入(30字以内)" v-model="name" style="width:100%;height:80px;"
|
||||
maxlength="30"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="radio-content mar-b16">
|
||||
<div class="title">素材标题</div>
|
||||
<textarea rows="2" placeholder="请输入(30字以内)" v-model="name" style="width:100%;height:80px;"
|
||||
maxlength="30"></textarea>
|
||||
</div>
|
||||
<div class="radio-content">
|
||||
<div class="title">文本内容</div>
|
||||
<textarea rows="8" placeholder="请输入文本内容(12000字以内)" v-model="content" style="width:100%;height:300px;"
|
||||
maxlength="12000"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn" @click="confirm">确认</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "addPlay",
|
||||
data() {
|
||||
return {
|
||||
type: '1',
|
||||
file: null,
|
||||
name: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.type = query.type
|
||||
uni.$on('record', e => {
|
||||
this.file = e
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = this.type == 1 ? '添加音频' : '添加文本'
|
||||
},
|
||||
|
||||
methods: {
|
||||
toRecord() {
|
||||
uni.navigateTo({
|
||||
url: `./recording`
|
||||
})
|
||||
},
|
||||
|
||||
dataURLtoFile(dataurl, filename) {
|
||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1]
|
||||
var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n)
|
||||
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n)
|
||||
}
|
||||
|
||||
return new File([u8arr], filename, {type: mime})
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if (!this.file && this.type === '1') {
|
||||
return this.$u.toast('请选择音频文件')
|
||||
}
|
||||
|
||||
if (!this.name) {
|
||||
return this.$u.toast('请输入素材标题')
|
||||
}
|
||||
|
||||
if (!this.content && this.type === '3') {
|
||||
return this.$u.toast('请输入文本内容')
|
||||
}
|
||||
|
||||
uni.showLoading()
|
||||
let formData = {}
|
||||
formData = new FormData()
|
||||
if (this.type === '1') {
|
||||
formData.append('file', this.dataURLtoFile(this.file, this.name + '.mp3'))
|
||||
formData.append('type', this.type)
|
||||
formData.append('content', this.content)
|
||||
formData.append('name', this.name)
|
||||
} else {
|
||||
formData.append('type', this.type)
|
||||
formData.append('content', this.content)
|
||||
formData.append('name', this.name)
|
||||
}
|
||||
this.$http.post(`/app/appdlbresource/addResourceWithFile`, formData).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('添加成功')
|
||||
uni.$emit('getList')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$u.toast('添加失败')
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.addPlay {
|
||||
padding-bottom: 128px;
|
||||
|
||||
.content {
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
padding: 34px 0;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 44px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: flex;
|
||||
color: #333;
|
||||
justify-content: space-between;
|
||||
|
||||
.label {
|
||||
width: 198px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 28px;
|
||||
width: calc(100% - 198px);
|
||||
padding-right: 32px;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.radio-content {
|
||||
padding: 34px 32px 38px;
|
||||
background-color: #fff;
|
||||
|
||||
.title {
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mar-b16 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
134
src/apps/AppBroadcast/AppResourcesManage/detail.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div class="header">
|
||||
<img :src="`${$cdn}video/play-icon.png`" alt="">
|
||||
<div class="right">
|
||||
<h2>{{info.name}}</h2>
|
||||
<p>{{info.createTime}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="info.content">{{info.content}}</div>
|
||||
<div class="footer-bottom"></div>
|
||||
<div class="footer">
|
||||
<div @click="del">删除素材</div>
|
||||
<div class="confirm" @click="toAddBroadcast()">发布广播</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "detail",
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.getDetail()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '媒资管理'
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appdlbresource/queryDetailById?id=${this.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
del() {
|
||||
this.$confirm(`是否删除该条素材?`).then(() => {
|
||||
this.$http.post(`/app/appdlbresource/delete?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('删除成功')
|
||||
uni.$emit('getList')
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toAddBroadcast() {
|
||||
uni.navigateTo({ url: `../addPlay?mediaId=${this.info.id}&mediaName=${this.info.name}` })
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
padding-top: 8px;
|
||||
.header {
|
||||
margin: 0 0 32px 0;
|
||||
width: 100%;
|
||||
padding: 20px 30px 16px 30px;
|
||||
box-sizing: border-box;
|
||||
background: #FFF;
|
||||
box-shadow: inset 0px 0px 0px 0px #D8DDE6;
|
||||
display: flex;
|
||||
img {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.right {
|
||||
width: calc(100% - 72px);
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
h2{
|
||||
width: 100%;
|
||||
font-size: 34px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
word-break: break-all;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
p{
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content{
|
||||
padding: 32px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
word-break: break-all;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.footer-bottom{
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
display: flex;
|
||||
div{
|
||||
flex: 1;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #F46;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
.confirm{
|
||||
background: #3975C6;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/apps/AppBroadcast/AppResourcesManage/img/add-icon.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/body.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/circle-active.png
Normal file
|
After Width: | Height: | Size: 979 B |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/circle-icon.png
Normal file
|
After Width: | Height: | Size: 795 B |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/microphone.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/play-icon.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/right-icon.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/right-img.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/stop-img.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/top.png
Normal file
|
After Width: | Height: | Size: 531 B |
BIN
src/apps/AppBroadcast/AppResourcesManage/img/video-img.png
Normal file
|
After Width: | Height: | Size: 577 B |
541
src/apps/AppBroadcast/AppResourcesManage/recording.vue
Normal file
@@ -0,0 +1,541 @@
|
||||
<template>
|
||||
<div class="recording">
|
||||
<div class="recording-content" v-if="isRecording">
|
||||
<div class="header-top" :style="{width: progress + '%'}"></div>
|
||||
<div class="header-line" :style="{width: progress + '%'}">
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line11 animation"></span>
|
||||
<span class="line12 animation"></span>
|
||||
<span class="line13 animation"></span>
|
||||
<span class="line14 animation"></span>
|
||||
<span class="line15 animation"></span>
|
||||
<span class="line16 animation"></span>
|
||||
<span class="line17 animation"></span>
|
||||
<span class="line18 animation"></span>
|
||||
<span class="line19 animation"></span>
|
||||
<span class="line20 animation"></span>
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line11 animation"></span>
|
||||
<span class="line12 animation"></span>
|
||||
<span class="line13 animation"></span>
|
||||
<span class="line14 animation"></span>
|
||||
<span class="line15 animation"></span>
|
||||
<span class="line16 animation"></span>
|
||||
<span class="line17 animation"></span>
|
||||
<span class="line18 animation"></span>
|
||||
<span class="line19 animation"></span>
|
||||
<span class="line20 animation"></span>
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line11 animation"></span>
|
||||
<span class="line12 animation"></span>
|
||||
<span class="line13 animation"></span>
|
||||
<span class="line14 animation"></span>
|
||||
<span class="line15 animation"></span>
|
||||
<span class="line16 animation"></span>
|
||||
<span class="line17 animation"></span>
|
||||
<span class="line18 animation"></span>
|
||||
<span class="line19 animation"></span>
|
||||
<span class="line20 animation"></span>
|
||||
</div>
|
||||
<div class="progress" :style="{left: progress + '%'}"></div>
|
||||
<p class="time">{{ time }}</p>
|
||||
</div>
|
||||
<div class="stop-content" v-else-if="!isRecording && isStop">
|
||||
<p class="time">{{ time }}</p>
|
||||
<div class="header-line">
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line11 animation"></span>
|
||||
<span class="line12 animation"></span>
|
||||
<span class="line13 animation"></span>
|
||||
<span class="line14 animation"></span>
|
||||
<span class="line15 animation"></span>
|
||||
<span class="line16 animation"></span>
|
||||
<span class="line17 animation"></span>
|
||||
<span class="line18 animation"></span>
|
||||
<span class="line19 animation"></span>
|
||||
<span class="line20 animation"></span>
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
<img src="./img/body.png" alt="">
|
||||
<p class="text">点击下方按钮开始录音</p>
|
||||
<p class="text">为了保证效果,请靠近手机讲话哦~</p>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<span v-if="isRecording || isStop" @click="restart">重新开始</span>
|
||||
<img v-if="isStop" :src="`${$cdn}video/${!isPlay ? 'play-icon' : 'stop-img'}.png`" @click="play">
|
||||
<img v-else :src="`${$cdn}video/${isRecording ? 'stop-img' : 'microphone'}.png`" @click="record">
|
||||
<!-- :src="isRecording ? stopImg : microphone" -->
|
||||
<span v-if="isStop" @click="save">保存</span>
|
||||
</div>
|
||||
<audio style="opacity: 0; visibility: hidden;" :src="audioSrc" @ended="onAudioEnd"></audio>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Recorder from 'recorder-core'
|
||||
import 'recorder-core/src/engine/mp3'
|
||||
import 'recorder-core/src/engine/mp3-engine'
|
||||
import microphone from './img/microphone.png'
|
||||
|
||||
export default {
|
||||
name: 'recording',
|
||||
data() {
|
||||
return {
|
||||
isRecording: false,
|
||||
progress: 0,
|
||||
microphone,
|
||||
isPlay: false,
|
||||
isStop: false,
|
||||
blobFile: null,
|
||||
time: '00:00:00',
|
||||
counterDownTime: 0,
|
||||
recorder: null,
|
||||
counterDownTimeout: null,
|
||||
timingTimeout: null,
|
||||
audioSrc: '',
|
||||
audio: null,
|
||||
duration: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.audio = document.querySelector('audio')
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '音频录制'
|
||||
},
|
||||
|
||||
methods: {
|
||||
record() {
|
||||
if (!this.isRecording) {
|
||||
this.duration = 0
|
||||
this.recorder = Recorder({
|
||||
type: 'mp3',
|
||||
sampleRate: 16000,
|
||||
bitRate: 16,
|
||||
onProcess(buffers, powerLevel, bufferDuration, bufferSampleRate, newBufferIdx, asyncEnd) {
|
||||
//可利用extensions/waveview.js扩展实时绘制波形
|
||||
}
|
||||
})
|
||||
|
||||
this.recorder.open(() => {
|
||||
this.recorder.start()
|
||||
this.isRecording = true
|
||||
this.timing()
|
||||
})
|
||||
} else {
|
||||
this.stop()
|
||||
}
|
||||
},
|
||||
|
||||
blobToDataURI(blob) {
|
||||
return new Promise((resolve) => {
|
||||
var reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = function (e) {
|
||||
resolve(e.target.result)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
save() {
|
||||
if (!this.blobFile) {
|
||||
return this.$u.toast(`请录音`)
|
||||
}
|
||||
|
||||
this.blobToDataURI(this.blobFile).then(res => {
|
||||
uni.$emit('record', res)
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onAudioEnd() {
|
||||
this.isPlay = false
|
||||
},
|
||||
|
||||
stop() {
|
||||
this.isRecording = false
|
||||
this.isStop = true
|
||||
clearTimeout(this.timingTimeout)
|
||||
this.recorder.stop((blob, duration) => {
|
||||
this.blobFile = blob
|
||||
|
||||
var durationObj = this.$dayjs.duration(this.counterDownTime * 1000)
|
||||
this.duration = this.counterDownTime
|
||||
var hours = durationObj.hours() > 9 ? durationObj.hours() : '0' + durationObj.hours()
|
||||
var min = durationObj.minutes() > 9 ? durationObj.minutes() : '0' + durationObj.minutes()
|
||||
var seconds = durationObj.seconds() > 9 ? durationObj.seconds() : '0' + durationObj.seconds()
|
||||
|
||||
this.time = hours + ':' + min + ':' + seconds
|
||||
console.log(blob, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms')
|
||||
this.recorder.close()
|
||||
this.recorder = null
|
||||
}, msg => {
|
||||
console.log('录音失败:' + msg)
|
||||
this.recorder.close()
|
||||
this.recorder = null
|
||||
})
|
||||
},
|
||||
|
||||
play() {
|
||||
if (!this.isPlay) {
|
||||
this.playAudio()
|
||||
this.counterDown()
|
||||
} else {
|
||||
this.isPlay = false
|
||||
clearTimeout(this.counterDownTimeout)
|
||||
this.audio.pause()
|
||||
}
|
||||
},
|
||||
|
||||
playAudio() {
|
||||
this.isPlay = true
|
||||
if (!this.audioSrc) {
|
||||
this.audioSrc = (window.URL || webkitURL).createObjectURL(this.blobFile)
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.audio.play()
|
||||
})
|
||||
},
|
||||
|
||||
recodeStop() {
|
||||
this.recorder.stop((blob, duration) => {
|
||||
this.restart()
|
||||
this.blobFile = blob
|
||||
console.log(blob, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms')
|
||||
this.recorder.close()
|
||||
this.recorder = null
|
||||
}, msg => {
|
||||
console.log('录音失败:' + msg)
|
||||
this.recorder.close()
|
||||
this.recorder = null
|
||||
})
|
||||
},
|
||||
|
||||
restart() {
|
||||
this.time = '00:00:00'
|
||||
this.progress = 0
|
||||
this.blobFile = null
|
||||
this.isPlay = false
|
||||
this.isRecording = false
|
||||
clearTimeout(this.counterDownTimeout)
|
||||
clearTimeout(this.timingTimeout)
|
||||
this.counterDownTime = 0
|
||||
this.audioSrc = ''
|
||||
this.isStop = false
|
||||
},
|
||||
|
||||
counterDown() {
|
||||
if (this.counterDownTime === -1) {
|
||||
clearTimeout(this.counterDownTimeout)
|
||||
this.counterDownTime = this.duration
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
var durationObj = this.$dayjs.duration(this.counterDownTime * 1000)
|
||||
var hours = durationObj.hours() > 9 ? durationObj.hours() : '0' + durationObj.hours()
|
||||
var min = durationObj.minutes() > 9 ? durationObj.minutes() : '0' + durationObj.minutes()
|
||||
var seconds = durationObj.seconds() > 9 ? durationObj.seconds() : '0' + durationObj.seconds()
|
||||
|
||||
this.time = hours + ':' + min + ':' + seconds
|
||||
this.counterDownTime--
|
||||
this.counterDownTimeout = setTimeout(() => {
|
||||
this.counterDown()
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
timing() {
|
||||
this.progress = ((this.counterDownTime / 120) * 100).toFixed(2) > 100 ? 101 : ((this.counterDownTime / 120) * 100).toFixed(2)
|
||||
var durationObj = this.$dayjs.duration(this.counterDownTime * 1000)
|
||||
var hours = durationObj.hours() > 9 ? durationObj.hours() : '0' + durationObj.hours()
|
||||
var min = durationObj.minutes() > 9 ? durationObj.minutes() : '0' + durationObj.minutes()
|
||||
var seconds = durationObj.seconds() > 9 ? durationObj.seconds() : '0' + durationObj.seconds()
|
||||
|
||||
this.time = hours + ':' + min + ':' + seconds
|
||||
this.counterDownTime++
|
||||
this.timingTimeout = setTimeout(() => {
|
||||
this.timing()
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.recording {
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
|
||||
.content {
|
||||
padding-top: 310px;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 406px;
|
||||
height: 306px;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 30px;
|
||||
color: #999;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 168px;
|
||||
background: #F6F8FC;
|
||||
padding: 20px 86px;
|
||||
box-sizing: border-box;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 160px;
|
||||
height: 64px;
|
||||
background: #4E8EEE;
|
||||
border-radius: 32px;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 64px;
|
||||
vertical-align: top;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
margin: 0 64px;
|
||||
}
|
||||
}
|
||||
|
||||
.recording-content {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stop-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 168px);
|
||||
|
||||
.header-line {
|
||||
width: 380px;
|
||||
}
|
||||
|
||||
.time {
|
||||
margin-top: 0;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.header-top {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 0;
|
||||
height: 6px;
|
||||
background: url(img/top.png) repeat-x;
|
||||
background-size: auto 6px;
|
||||
}
|
||||
|
||||
.time {
|
||||
width: 100%;
|
||||
margin-top: 208px;
|
||||
text-align: center;
|
||||
font-size: 96px;
|
||||
color: #000000;
|
||||
line-height: 134px;
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 0;
|
||||
width: 2px;
|
||||
height: 128px;
|
||||
background: #3477EE;
|
||||
}
|
||||
|
||||
.header-line {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 128px;
|
||||
line-height: 128px;
|
||||
margin-top: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.animation {
|
||||
animation: note 0.24s ease-in-out;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
.header-line span {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 16px;
|
||||
margin: 0 6px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background-color: #3476EE;
|
||||
}
|
||||
|
||||
.header-line span.line1 {
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
.header-line span.line2 {
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.header-line span.line3 {
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
.header-line span.line4 {
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
|
||||
.header-line span.line5 {
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
|
||||
.header-line span.line6 {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
.header-line span.line7 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line8 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line9 {
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
.header-line span.line10 {
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
|
||||
.header-line span.line11 {
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
.header-line span.line12 {
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.header-line span.line13 {
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
.header-line span.line14 {
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
|
||||
.header-line span.line15 {
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
|
||||
.header-line span.line16 {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
.header-line span.line17 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line18 {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
.header-line span.line19 {
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
.header-line span.line20 {
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
|
||||
@keyframes note {
|
||||
from {
|
||||
transform: scaleY(1);
|
||||
}
|
||||
to {
|
||||
transform: scaleY(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
95
src/apps/AppBroadcast/AppResourcesManage/talking.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="talking">
|
||||
<div class="header">
|
||||
<p>刘家河村委会、张家村…等<span>20</span>个设备</p>
|
||||
<img src="./img/right-img.png" alt="">
|
||||
</div>
|
||||
<div class="content">
|
||||
<!-- <p class="time">00:00:13</p> -->
|
||||
<img src="./img/body.png" alt="">
|
||||
<p class="text">请先选择设备</p>
|
||||
<p class="text">再点击下方按钮开始喊话~</p>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<img :src="`${$cdn}video/stop-img.png`" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "talking"
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.talking {
|
||||
.header {
|
||||
width: 100%;
|
||||
height: 128px;
|
||||
background: #F6F8FC;
|
||||
padding: 42px 32px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
p {
|
||||
font-size: 32px;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
|
||||
span {
|
||||
color: #1174FE;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 224px;
|
||||
|
||||
.time {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 96px;
|
||||
color: #000000;
|
||||
line-height: 134px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 406px;
|
||||
height: 306px;
|
||||
margin: 0 0 48px 172px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 30px;
|
||||
color: #999;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 168px;
|
||||
background: #F6F8FC;
|
||||
padding: 20px 310px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
699
src/apps/AppBroadcast/LiveBroadcast.vue
Normal file
@@ -0,0 +1,699 @@
|
||||
<template>
|
||||
<div class="LiveBroadcast" @touchend="onTouchend" @touchmove="onTouchmove">
|
||||
<div class="top" @click="toChoose" hover-class="bg-hover">
|
||||
<div class="left">
|
||||
<h2 v-if="!equipmentList.length">请选择设备</h2>
|
||||
<h2>{{ equipmentStr }}</h2>
|
||||
<h2 v-if="equipmentList.length > 2">...等</h2>
|
||||
<span v-if="equipmentList.length > 2">{{ equipmentList.length }}</span>
|
||||
<h2 v-if="equipmentList.length > 2">个设备</h2>
|
||||
</div>
|
||||
<image src="./img/right.png" />
|
||||
</div>
|
||||
<div class="middle">
|
||||
<div class="record" v-if="isShowRecord">
|
||||
<h2>喊话记录</h2>
|
||||
<scroll-view scroll-y class="record-wrapper">
|
||||
<div class="record-item" v-for="(item, index) in recordList" :key="index">
|
||||
<image :src="user.avatar" />
|
||||
<div class="right-wrapper">
|
||||
<div class="right" :style="{width: 'calc(83px + ' + (item.duration / 2) + '%)'}" @click="play(item.src, index)">
|
||||
<image mode="aspectFit" v-if="!item.isPlay" src="./img/voice-icon.png" />
|
||||
<image v-else src="./img/voice.gif" />
|
||||
<span>{{ item.duration }}"</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
<div class="tips" v-if="!isShowRecord">
|
||||
<image src="./img/body.png" />
|
||||
<p>请先选择设备再按住下方按钮开始喊话~</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom" @touchstart="onLongtap">
|
||||
<image src="./img/microphone.png" />
|
||||
<p>按住说话</p>
|
||||
</div>
|
||||
<div class="voice" :class="[isShow ? 'active' : '']">
|
||||
<div class="voice-bottom">
|
||||
<image src="./img/voice-w.png" />
|
||||
</div>
|
||||
<image class="close" :class="[isImpact ? 'close-active' : '']" :src="isImpact ? closeW : close" />
|
||||
<p>松开发送</p>
|
||||
<div class="header-line">
|
||||
<span class="line1 animation"></span>
|
||||
<span class="line2 animation"></span>
|
||||
<span class="line3 animation"></span>
|
||||
<span class="line4 animation"></span>
|
||||
<span class="line5 animation"></span>
|
||||
<span class="line6 animation"></span>
|
||||
<span class="line7 animation"></span>
|
||||
<span class="line8 animation"></span>
|
||||
<span class="line9 animation"></span>
|
||||
<span class="line10 animation"></span>
|
||||
<span class="line11 animation"></span>
|
||||
<span class="line12 animation"></span>
|
||||
<span class="line13 animation"></span>
|
||||
<span class="line14 animation"></span>
|
||||
<span class="line15 animation"></span>
|
||||
<span class="line16 animation"></span>
|
||||
<span class="line17 animation"></span>
|
||||
<span class="line18 animation"></span>
|
||||
<span class="line19 animation"></span>
|
||||
<span class="line20 animation"></span>
|
||||
</div>
|
||||
<h2>{{ time }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Recorder from 'recorder-core'
|
||||
import 'recorder-core/src/engine/mp3'
|
||||
import 'recorder-core/src/engine/mp3-engine'
|
||||
export default {
|
||||
name: 'LiveBroadcast',
|
||||
|
||||
appName: '实时喊话',
|
||||
|
||||
data () {
|
||||
return {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 0,
|
||||
h: 0,
|
||||
isShowRecord: false,
|
||||
close: require('./img/close.png'),
|
||||
closeW: require('./img/close-w.png'),
|
||||
isShow: false,
|
||||
isImpact: false,
|
||||
startTime: 0,
|
||||
isRecording: false,
|
||||
recorder: null,
|
||||
blobFile: null,
|
||||
counterDownTime: 0,
|
||||
time: '00:00:00',
|
||||
timingTimeout: null,
|
||||
equipmentList: [],
|
||||
recordList: [],
|
||||
innerAudioContext: null,
|
||||
currIndex: -1,
|
||||
broadcastId: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
|
||||
equipmentStr () {
|
||||
if (!this.equipmentList.length) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return this.equipmentList.filter((item, index) => index < 2).map(v => v.serialName).join('、')
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
const close = document.querySelector('.close')
|
||||
this.x = close.offsetLeft
|
||||
this.y = close.offsetTop
|
||||
this.w = close.clientWidth
|
||||
this.h = close.clientHeight
|
||||
|
||||
document.body.addEventListener('touchmove', this.bindEvent, { passive: false })
|
||||
})
|
||||
},
|
||||
|
||||
destroyed () {
|
||||
document.body.removeEventListener('touchmove', this.bindEvent)
|
||||
},
|
||||
|
||||
onLoad () {
|
||||
this.innerAudioContext = uni.createInnerAudioContext()
|
||||
this.innerAudioContext.autoplay = true
|
||||
this.innerAudioContext.onEnded(() => {
|
||||
if (this.currIndex > -1) {
|
||||
this.recordList.forEach((v, index) => {
|
||||
this.$set(this.recordList[index], 'isPlay', false)
|
||||
})
|
||||
this.currIndex = -1
|
||||
}
|
||||
})
|
||||
this.innerAudioContext.onPlay(() => {
|
||||
this.$set(this.recordList[this.currIndex], 'isPlay', true)
|
||||
})
|
||||
|
||||
uni.$on('chooseEquipment', e => {
|
||||
this.equipmentList = e.equipmentList
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
bindEvent (e) {
|
||||
e.preventDefault()
|
||||
},
|
||||
|
||||
onLongtap () {
|
||||
if (!this.equipmentList.length) {
|
||||
return this.$u.toast('请选择播发设备')
|
||||
}
|
||||
|
||||
this.isImpact = false
|
||||
this.startTime = new Date().getTime()
|
||||
this.isShow = true
|
||||
this.record()
|
||||
},
|
||||
|
||||
toChoose () {
|
||||
uni.navigateTo({
|
||||
url: './selectEquipment'
|
||||
})
|
||||
},
|
||||
|
||||
record () {
|
||||
this.duration = 0
|
||||
this.recorder = Recorder({
|
||||
type: 'mp3',
|
||||
sampleRate: 16000,
|
||||
bitRate: 16,
|
||||
onProcess(buffers, powerLevel, bufferDuration, bufferSampleRate, newBufferIdx, asyncEnd) {
|
||||
//可利用extensions/waveview.js扩展实时绘制波形
|
||||
}
|
||||
})
|
||||
|
||||
this.recorder.open(() => {
|
||||
this.recorder.start()
|
||||
this.timing()
|
||||
})
|
||||
},
|
||||
|
||||
timing () {
|
||||
var durationObj = this.$dayjs.duration(this.counterDownTime * 1000)
|
||||
var hours = durationObj.hours() > 9 ? durationObj.hours() : '0' + durationObj.hours()
|
||||
var min = durationObj.minutes() > 9 ? durationObj.minutes() : '0' + durationObj.minutes()
|
||||
var seconds = durationObj.seconds() > 9 ? durationObj.seconds() : '0' + durationObj.seconds()
|
||||
|
||||
this.time = hours + ':' + min + ':' + seconds
|
||||
this.counterDownTime++
|
||||
this.timingTimeout = setTimeout(() => {
|
||||
this.timing()
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
blobToDataURI(blob) {
|
||||
return new Promise((resolve) => {
|
||||
var reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = function (e) {
|
||||
resolve(e.target.result)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
play (url, index) {
|
||||
if (this.currIndex === index) {
|
||||
this.innerAudioContext.destroy()
|
||||
this.recordList.forEach((v, index) => {
|
||||
this.$set(this.recordList[index], 'isPlay', false)
|
||||
})
|
||||
|
||||
this.currIndex = -1
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.innerAudioContext.destroy()
|
||||
this.recordList.forEach((v, index) => {
|
||||
this.$set(this.recordList[index], 'isPlay', false)
|
||||
})
|
||||
this.currIndex = index
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.innerAudioContext.src = url
|
||||
})
|
||||
},
|
||||
|
||||
stop (isCancel) {
|
||||
this.counterDownTime = 0
|
||||
clearTimeout(this.timingTimeout)
|
||||
this.recorder.stop((blob, duration) => {
|
||||
this.recorder.close()
|
||||
this.recorder = null
|
||||
|
||||
if (isCancel) {
|
||||
return false
|
||||
}
|
||||
|
||||
this.time = '00:00:00'
|
||||
let formData = {}
|
||||
formData = new FormData()
|
||||
formData.append('file', new window.File([blob], `${(new Date).getTime()}` ))
|
||||
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appdlbresource/uploadDlbFile`, formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appzyvideobroadcast/playrealtime`, {
|
||||
mediaId: res.data.mediaId,
|
||||
accessUrl: res.data.accessUrl,
|
||||
messageLevel: 1,
|
||||
taskType: 0,
|
||||
coverageType: 4,
|
||||
broadcastId: this.broadcastId || '',
|
||||
serialNo: this.equipmentList.map(v => v.serialNo).join(',')
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
!this.broadcastId && (this.broadcastId = res.data.broadcastId)
|
||||
this.$u.toast('播发成功')
|
||||
this.recordList.push({
|
||||
src: (window.URL || webkitURL).createObjectURL(blob),
|
||||
isPlay: false,
|
||||
duration: (duration / 1000).toFixed(0)
|
||||
})
|
||||
this.isShowRecord = true
|
||||
}
|
||||
this.isShow = false
|
||||
}).catch(() => {
|
||||
this.isShow = false
|
||||
})
|
||||
} else {
|
||||
this.isShow = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.isShow = false
|
||||
})
|
||||
console.log(blob, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms')
|
||||
}, msg => {
|
||||
console.log('录音失败:' + msg)
|
||||
this.recorder.close()
|
||||
this.isShow = false
|
||||
this.recorder = null
|
||||
})
|
||||
},
|
||||
|
||||
onTouchend () {
|
||||
if (!this.isShow) return
|
||||
|
||||
if (this.isShow && new Date().getTime() - this.startTime < 1500) {
|
||||
this.isImpact = false
|
||||
this.isShow = false
|
||||
this.stop(true)
|
||||
return this.$u.toast('说话时间太短')
|
||||
}
|
||||
|
||||
if (this.isImpact) {
|
||||
this.isShow = false
|
||||
this.isImpact = false
|
||||
this.stop(true)
|
||||
return false
|
||||
}
|
||||
|
||||
this.isImpact = false
|
||||
this.stop()
|
||||
},
|
||||
|
||||
onTouchmove (e) {
|
||||
if (this.isShow) {
|
||||
const x = e.touches[0].clientX
|
||||
const y = e.touches[0].clientY
|
||||
|
||||
if (x >= this.x && x <= this.x + this.w && y >= this.y && y <= this.y + this.h) {
|
||||
this.isImpact = true
|
||||
} else {
|
||||
this.isImpact = false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
submit () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.LiveBroadcast {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
background: #F6F8FC;
|
||||
|
||||
.voice {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
flex-direction: column-reverse;
|
||||
align-items: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
background: rgba(0, 0, 0, 0.67);
|
||||
transition: all ease 0.5s;
|
||||
|
||||
&.active {
|
||||
z-index: 111;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.voice-bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 234px;
|
||||
margin-top: 48px;
|
||||
background: url(./img/voice-bg.png);
|
||||
background-size: 100% 100%;
|
||||
|
||||
image {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
.header-line {
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 322px;
|
||||
height: 164px;
|
||||
padding: 0 20px;
|
||||
border-radius: 20px;
|
||||
background: #86B7FF;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
z-index: 1;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 18px solid #86B7FF;
|
||||
border-right: 18px solid transparent;
|
||||
border-left: 18px solid transparent;
|
||||
content: ' ';
|
||||
transform: translate(-50%, 100%);
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 10px;
|
||||
margin: 0 6px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background-color: #4B7CC3;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 48px;
|
||||
font-weight: 400;
|
||||
font-size: 96px;
|
||||
color: #A2A3A4;
|
||||
line-height: 134px;
|
||||
}
|
||||
|
||||
& > p {
|
||||
margin: 48px;
|
||||
color: #A2A3A4;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
& > image {
|
||||
width: 132px;
|
||||
height: 132px;
|
||||
transition: all ease 0.3s;
|
||||
}
|
||||
|
||||
.close-active {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 128px;
|
||||
padding: 0 32px;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #1174FE;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.middle {
|
||||
height: calc(100% - 378px);
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
image {
|
||||
width: 406px;
|
||||
height: 306px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
p {
|
||||
width: 346px;
|
||||
font-size: 30px;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.record {
|
||||
height: 100%;
|
||||
|
||||
& > h2 {
|
||||
height: 116px;
|
||||
line-height: 116px;
|
||||
padding: 0 32px;
|
||||
font-size: 38px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.record-wrapper {
|
||||
width: 100%;
|
||||
height: calc(100% - 116px);
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.record-item {
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
& > image {
|
||||
width: 76px;
|
||||
height: 76px;
|
||||
margin-right: 26px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.right-wrapper {
|
||||
// flex: 1;
|
||||
width: calc(100% - 102px);
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 74px;
|
||||
padding: 0 32px;
|
||||
border-radius: 12px;
|
||||
min-width: 160px;
|
||||
max-width: 100%;
|
||||
background: #C0DAFF;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-right: 12px solid #C0DAFF;
|
||||
border-left: 12px solid transparent;
|
||||
border-bottom: 12px solid transparent;
|
||||
border-top: 12px solid transparent;
|
||||
content: " ";
|
||||
transform: translate(-100%, -50%);
|
||||
}
|
||||
|
||||
image {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 250px;
|
||||
width: min-content;
|
||||
margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
margin-bottom: 16px;
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #333333;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.animation {
|
||||
animation: note 0.24s ease-in-out;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
@keyframes note {
|
||||
from {
|
||||
transform: scaleY(1);
|
||||
}
|
||||
to {
|
||||
transform: scaleY(4);
|
||||
}
|
||||
}
|
||||
|
||||
.header-line span.line1 {
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
.header-line span.line2 {
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.header-line span.line3 {
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
.header-line span.line4 {
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
|
||||
.header-line span.line5 {
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
|
||||
.header-line span.line6 {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
.header-line span.line7 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line8 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line9 {
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
.header-line span.line10 {
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
|
||||
.header-line span.line11 {
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
.header-line span.line12 {
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.header-line span.line13 {
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
.header-line span.line14 {
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
|
||||
.header-line span.line15 {
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
|
||||
.header-line span.line16 {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
.header-line span.line17 {
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.header-line span.line18 {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
.header-line span.line19 {
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
.header-line span.line20 {
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,15 +3,17 @@
|
||||
<div class="content">
|
||||
<div class="item">
|
||||
<div class="label">播发内容</div>
|
||||
<div class="value" @click="nameClick">
|
||||
<div class="value" @click="toSelectMedia">
|
||||
<span :class="formData.mediaName == '请选择' ? 'color-999' : ''">{{ formData.mediaName }}</span>
|
||||
<img src="./img/right-icon.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="label">播放设备</div>
|
||||
<div class="value" @click="selectClick('showEquipment', equipmentList)">
|
||||
<span :class="formData.serialName == '请选择' ? 'color-999' : ''">{{ formData.serialName }}</span>
|
||||
<div class="value" @click="toSelectEquipment">
|
||||
<!-- @click="selectClick('showEquipment', equipmentList)" -->
|
||||
<span v-if="equipmentList.length">已选择<span style="color:#4E8EEE;">{{equipmentList.length}}</span>台设备</span>
|
||||
<span v-else style="color:#999;">请选择</span>
|
||||
<img src="./img/right-icon.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,10 +27,12 @@
|
||||
</div>
|
||||
<div class="radio-content">
|
||||
<div class="title">播放方式</div>
|
||||
<div class="item mar-r50" :class="formData.taskType == 0 ? 'active' : ''" @click="formData.taskType = 0">立即播放<img
|
||||
<div class="flex">
|
||||
<div class="item mar-r50" :class="formData.taskType == 0 ? 'active' : ''" @click="formData.taskType = 0">立即播放<img
|
||||
src="./img/bigHorn-xz.png" alt=""></div>
|
||||
<div class="item" :class="formData.taskType == 1 ? 'active' : ''" @click="formData.taskType = 1"><img
|
||||
src="./img/bigHorn-xz.png" alt="">定时播放
|
||||
<div class="item" :class="formData.taskType == 1 ? 'active' : ''" @click="formData.taskType = 1"><img
|
||||
src="./img/bigHorn-xz.png" alt="">定时播放
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="formData.taskType != 0">
|
||||
@@ -50,8 +54,7 @@
|
||||
<div class="item">
|
||||
<div class="label">播放天数</div>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" height="18" input-align="right" v-model="formData.broadcastDay"
|
||||
maxlength="4"/>
|
||||
<u-input type="text" placeholder="请输入" height="18" input-align="right" v-model="formData.broadcastDay" maxlength="4"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,7 +108,7 @@ export default {
|
||||
mediaId: '',
|
||||
mediaName: '请选择',
|
||||
serialNo: '',
|
||||
serialName: '请选择',
|
||||
serialName: '',
|
||||
messageLevel: '',
|
||||
messageLevelName: '请选择',
|
||||
taskType: '0',
|
||||
@@ -166,22 +169,34 @@ export default {
|
||||
minute: false,
|
||||
second: false
|
||||
},
|
||||
equipmentList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.$on('choose', e => {
|
||||
onLoad(option) {
|
||||
uni.$on('chooseMedia', e => {
|
||||
console.log(e)
|
||||
this.formData.mediaId = e.mediaId
|
||||
this.formData.mediaName = e.mediaName
|
||||
})
|
||||
uni.$on('chooseEquipment', e => {
|
||||
console.log(e)
|
||||
this.equipmentList = e.equipmentList
|
||||
})
|
||||
if(option.mediaId) {
|
||||
this.formData.mediaName = option.mediaName
|
||||
this.formData.mediaId = option.mediaId
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
document.title = '音频播放'
|
||||
},
|
||||
|
||||
methods: {
|
||||
nameClick() {
|
||||
uni.navigateTo({url: '../AppResourcesManage/AppResourcesManage?isChoose=1'})
|
||||
toSelectMedia() {
|
||||
uni.navigateTo({url: `./selectMedia?mediaId=${this.formData.mediaId}`})
|
||||
},
|
||||
toSelectEquipment() {
|
||||
uni.navigateTo({url: `./selectEquipment`})
|
||||
},
|
||||
addConfirm() {
|
||||
var cyclingDateList = []
|
||||
@@ -194,9 +209,10 @@ export default {
|
||||
if (!this.formData.mediaId) {
|
||||
return this.$u.toast('请选择播发内容')
|
||||
}
|
||||
if (!this.formData.serialNo) {
|
||||
if (!this.equipmentList.length) {
|
||||
return this.$u.toast('请选择播放设备')
|
||||
}
|
||||
|
||||
if (!this.formData.messageLevel) {
|
||||
return this.$u.toast('播发级别')
|
||||
}
|
||||
@@ -223,6 +239,11 @@ export default {
|
||||
if (this.formData.taskType != 0 && this.formData.cyclingType == 2) {
|
||||
this.formData.cyclingDate = cyclingDateList.join(',')
|
||||
}
|
||||
var serialNoList = []
|
||||
this.equipmentList.map(item => {
|
||||
serialNoList.push(item.serialNo)
|
||||
})
|
||||
this.formData.serialNo = serialNoList.join(',')
|
||||
this.formData.coverageType = '4'
|
||||
this.$http.post(`/app/appzyvideobroadcast/play`, {...this.formData,}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
@@ -289,38 +310,6 @@ export default {
|
||||
this[showType] = true
|
||||
this.selectList = list
|
||||
},
|
||||
getMediaList() {
|
||||
this.$http.post(`/app/appdlbresource/list?current=1&size=10000`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.mediaList = []
|
||||
if (res.data && res.data.records.length) {
|
||||
res.data.records.map((item) => {
|
||||
let info = {
|
||||
dictName: item.name,
|
||||
dictValue: item.id
|
||||
}
|
||||
this.mediaList.push(info)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipmentList() {
|
||||
this.$http.post(`/app/appdlbquipment/getDlbDeviceList?current=1&size=10000&keyword=`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.equipmentList = []
|
||||
if (res.data && res.data.records.length) {
|
||||
res.data.records.map((item) => {
|
||||
let info = {
|
||||
dictName: item.deviceName,
|
||||
dictValue: item.serialNo
|
||||
}
|
||||
this.equipmentList.push(info)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkClick(index) {
|
||||
this.dayList[index].isCheck = !this.dayList[index].isCheck
|
||||
},
|
||||
@@ -358,8 +347,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$dict.load('dlbMessageUrgency', 'dlbBroadTaskType', 'dlbDyclingType').then(() => {
|
||||
this.getMediaList()
|
||||
this.getEquipmentList()
|
||||
this.messageLevelList = this.$dict.getDict('dlbMessageUrgency')
|
||||
this.cyclingTypeList = this.$dict.getDict('dlbDyclingType')
|
||||
})
|
||||
@@ -441,9 +428,13 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
width: 320px;
|
||||
flex: 1;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
|
||||
BIN
src/apps/AppBroadcast/img/body.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/apps/AppBroadcast/img/close-w.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/apps/AppBroadcast/img/close.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/apps/AppBroadcast/img/microphone.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src/apps/AppBroadcast/img/right.png
Normal file
|
After Width: | Height: | Size: 288 B |
BIN
src/apps/AppBroadcast/img/voice-bg.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/apps/AppBroadcast/img/voice-icon.png
Normal file
|
After Width: | Height: | Size: 762 B |
BIN
src/apps/AppBroadcast/img/voice-w.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/apps/AppBroadcast/img/voice.gif
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
@@ -1,112 +1,163 @@
|
||||
<template>
|
||||
<div class="selectEquipment">
|
||||
<div class="search">
|
||||
<div class="search-bg">
|
||||
<img src="./img/search-icon.png" alt="">
|
||||
<u-input v-model="value" type="text" placeholder="搜索设备名称" class="search-input" height="18"/>
|
||||
<AiTopFixed>
|
||||
<div class="currentLeft-top">
|
||||
<div class="left">
|
||||
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
|
||||
<span class="label" v-if="areaName">{{ areaName }}</span>
|
||||
<span v-else>请选择</span>
|
||||
<u-icon name="arrow-down" color="#666" size="24" style="margin-left: 4px" />
|
||||
</AiAreaPicker>
|
||||
</div>
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入设备名称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="handerClear"></u-search>
|
||||
</div>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="record">
|
||||
<div class="item">
|
||||
<img src="./img/cir.png" alt="" class="check-img">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="checkClick(index)">
|
||||
<img src="./img/select-blue.png" mode="aspectFill" alt="" class="check-img" v-if="item.isCheck">
|
||||
<img src="./img/cir.png" alt="" mode="aspectFill" class="check-img" v-else>
|
||||
<img src="./img/lb@2x.png" alt="" class="voice-img">
|
||||
<div class="info">
|
||||
<div class="text">
|
||||
<p>村头大喇叭</p>
|
||||
<span>刘家河居委会</span>
|
||||
<p>{{item.name}}</p>
|
||||
<span>{{item.areaName}}</span>
|
||||
</div>
|
||||
<div class="status">在线</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="./img/cir.png" alt="" class="check-img">
|
||||
<img src="./img/lb@2x.png" alt="" class="voice-img">
|
||||
<div class="info">
|
||||
<div class="text">
|
||||
<p>村头大喇叭</p>
|
||||
<span>刘家河居委会</span>
|
||||
</div>
|
||||
<div class="status">在线</div>
|
||||
<div class="status">{{ $dict.getLabel('dlbDevStatus', item.devStatus) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
<div class="btn">
|
||||
<div>确定选择</div>
|
||||
<div @click="confirm">确定选择</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "selectEquipment",
|
||||
data() {
|
||||
return {
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
keyword: '',
|
||||
list: [],
|
||||
selectList: []
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad(option) {
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName
|
||||
this.$dict.load(['dlbDevStatus']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
areaSelect(e) {
|
||||
this.areaId = e
|
||||
// this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.$http.post(`/app/appdlbquipment/list?current=1&size=20&name=${this.keyword}&devStatus=5&areaId=${this.areaId}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map(item => {
|
||||
item.isCheck = false
|
||||
})
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkClick(index) {
|
||||
this.list[index].isCheck = !this.list[index].isCheck
|
||||
},
|
||||
confirm() {
|
||||
this.selectList = []
|
||||
this.list.map(item => {
|
||||
if(item.isCheck) {
|
||||
var info = {
|
||||
serialNo: item.serialNo,
|
||||
serialName: item.name
|
||||
}
|
||||
this.selectList.push(info)
|
||||
}
|
||||
})
|
||||
if(!this.selectList.length) {
|
||||
return this.$u.toast('请选择播放设备')
|
||||
}
|
||||
uni.$emit('chooseEquipment', {
|
||||
equipmentList: this.selectList
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.selectEquipment {
|
||||
padding-bottom: 128px;
|
||||
|
||||
.search {
|
||||
width: 100%;
|
||||
height: 104px;
|
||||
background: #FFF;
|
||||
margin-bottom: 4px;
|
||||
padding: 20px 32px;
|
||||
box-sizing: border-box;
|
||||
.currentLeft-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.search-bg {
|
||||
width: 686px;
|
||||
height: 64px;
|
||||
padding: 14px 0;
|
||||
box-sizing: border-box;
|
||||
background: #F5F5F5;
|
||||
border-radius: 32px;
|
||||
position: relative;
|
||||
.left {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 590px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
font-size: 28px;
|
||||
margin-left: 70px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.record {
|
||||
margin-top: 8px;
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.check-img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 32px 32px 0 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.voice-img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 28px 16px 0 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 148px);
|
||||
padding: 18px 0;
|
||||
flex: 1;
|
||||
line-height: 44px;
|
||||
padding-right: 32px;
|
||||
font-size: 34px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.text {
|
||||
p {
|
||||
|
||||
362
src/apps/AppBroadcast/selectMedia.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<div class="selectMedia">
|
||||
<AiTopFixed>
|
||||
<div class="currentLeft-top">
|
||||
<div class="left">
|
||||
<AiSelect @data="selectType" :list="typeList" v-model="type"></AiSelect>
|
||||
</div>
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入素材名称/创建人员" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getListInit" @clear="handerClear"></u-search>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<u-tabs :list="tab" :is-scroll="false" :current="currIndex" @change="change" height="96" :bar-style="barStyle"></u-tabs>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="record" v-if="currIndex == 0">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="choose(item)">
|
||||
<img src="./img/select-blue.png" alt="" @click.stop="check(index)" v-if="item.isCheck">
|
||||
<img src="./img/cir.png" alt="" @click.stop="check(index)" v-else>
|
||||
<div class="right">
|
||||
<div class="info">
|
||||
<p>{{ item.name ? item.name.split('.')[0] : '-' }}</p>
|
||||
<div class="time">{{ item.createUserName }} {{ item.createTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="record" v-else>
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="choose(item)">
|
||||
<img src="./img/select-blue.png" alt="" @click.stop="check(index)" v-if="item.isCheck">
|
||||
<img src="./img/cir.png" alt="" @click.stop="check(index)" v-else>
|
||||
<div class="right">
|
||||
<div class="info">
|
||||
<p>{{ item.name }}</p>
|
||||
<div>{{ item.content }}</div>
|
||||
<div class="time">{{ item.createUserName }} {{ item.createTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
<div class="btn">
|
||||
<div @click="confirm">确定选择</div>
|
||||
</div>
|
||||
<u-popup v-model="isShow" mode="bottom">
|
||||
<div class="audio">
|
||||
<AiVideo :src="url" autoplay></AiVideo>
|
||||
<!-- <audio :src="url" ref="audio" :controls="true" :name="autioName" style="display: block;"></audio> -->
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "selectMedia",
|
||||
data() {
|
||||
return {
|
||||
tab: [{name: '音频素材'}, {name: '文本素材'}],
|
||||
list: [],
|
||||
currIndex: 0,
|
||||
current: 1,
|
||||
isMore: false,
|
||||
isShow: false,
|
||||
url: '',
|
||||
autioName: '',
|
||||
audio: null,
|
||||
barStyle: {width: '98px', bottom: '-3px', left: '-38px'},
|
||||
keyword: '',
|
||||
type: '0',
|
||||
typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},],
|
||||
mediaId: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.mediaId = option.mediaId
|
||||
this.getList()
|
||||
uni.$on('getList', () => {
|
||||
this.isMore = false
|
||||
this.list = []
|
||||
this.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = '选择播发内容'
|
||||
},
|
||||
|
||||
methods: {
|
||||
selectType(selecteds) {
|
||||
this.type = selecteds?.[0]?.value
|
||||
this.getListInit()
|
||||
},
|
||||
change(index) {
|
||||
this.currIndex = index
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
choose(item) {
|
||||
this.url = item.url
|
||||
this.isShow = true
|
||||
|
||||
|
||||
},
|
||||
|
||||
handerClear() {
|
||||
this.keyword = ''
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
getListInit() {
|
||||
this.isMore = false
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
getList() {
|
||||
if (this.isMore) return
|
||||
|
||||
this.$http.post(`/app/appdlbresource/list`, null, {
|
||||
params: {
|
||||
name: this.keyword,
|
||||
type: this.currIndex === 0 ? 1 : 3,
|
||||
current: this.current,
|
||||
size: 10,
|
||||
areaId: this.areaId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.isCheck = false
|
||||
if(item.id == this.mediaId) {
|
||||
item.isCheck = true
|
||||
this.mediaId = ''
|
||||
}
|
||||
})
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.current = this.current + 1
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
check(index) {
|
||||
this.list.map((item) => {
|
||||
item.isCheck = false
|
||||
})
|
||||
this.list[index].isCheck = true
|
||||
},
|
||||
confirm() {
|
||||
var selectInfo = {}
|
||||
this.list.map((item) => {
|
||||
if(item.isCheck) {
|
||||
selectInfo = item
|
||||
}
|
||||
})
|
||||
|
||||
if(!selectInfo.id) {
|
||||
return this.$u.toast('请选择素材')
|
||||
}
|
||||
|
||||
uni.$emit('chooseMedia', {
|
||||
mediaId: selectInfo.id,
|
||||
mediaName: selectInfo.name
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.selectMedia {
|
||||
padding-bottom: 128px;
|
||||
::v-deep .AiTopFixed{
|
||||
.content{
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.tab {
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.audio {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
box-sizing: border-box;
|
||||
padding: 104px 0 46px;
|
||||
}
|
||||
|
||||
.record {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 32px 0 0 30px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.right{
|
||||
flex: 1;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 0 30px 32px 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 70px);
|
||||
line-height: 44px;
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
div{
|
||||
margin-top: 8px;
|
||||
font-size: 26px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #999;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.record-text {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 32px 30px;
|
||||
box-sizing: border-box;
|
||||
font-size: 30px;
|
||||
|
||||
div {
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.color-0063E5 {
|
||||
color: #0063E5;
|
||||
}
|
||||
|
||||
.color-FF8100 {
|
||||
color: #FF8100;
|
||||
}
|
||||
|
||||
.color-FF4466 {
|
||||
color: #FF4466;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
line-height: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
word-break: break-all;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add-img {
|
||||
width: 120px;
|
||||
position: fixed;
|
||||
bottom: 120px;
|
||||
right: 32px;
|
||||
}
|
||||
|
||||
.currentLeft-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 32px 32px 0;
|
||||
|
||||
.left {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .u-search {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 128px;
|
||||
background: #FFF;
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 24px 32px 24px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-size: 32px;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<div class="selectMp3">
|
||||
<div class="record">
|
||||
<div class="item">
|
||||
<img src="./img/cir.png" alt="">
|
||||
<div class="info">
|
||||
<p>村头大喇叭</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "selectMp3",
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.selectMp3 {
|
||||
padding-bottom: 128px;
|
||||
|
||||
.record {
|
||||
padding-left: 32px;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 40px 16px 0 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 60px);
|
||||
padding: 34px 0;
|
||||
line-height: 44px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-size: 34px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 128px;
|
||||
background: #FFF;
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 24px 32px 24px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-size: 32px;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||