大喇叭

This commit is contained in:
liuye
2022-06-10 11:34:03 +08:00
parent 5705c75e14
commit deecff9904
7 changed files with 320 additions and 106 deletions

View File

@@ -13,24 +13,14 @@
</div> </div>
</AiTopFixed> </AiTopFixed>
<div class="record"> <div class="record">
<div class="item" @click="toDetail"> <div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
<img src="../img/lb@2x.png" alt="" class="voice-img"> <img src="../img/lb@2x.png" alt="" class="voice-img">
<div class="info"> <div class="info">
<div class="text"> <div class="text">
<p>村头大喇叭</p> <p>{{item.deviceName}}</p>
<span>刘家河居委会</span> <span>{{item.orgName}}</span>
</div> </div>
<div class="status">在线</div> <div class="status">{{item.devStatus}}</div>
</div>
</div>
<div class="item">
<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> </div>
</div> </div>
</div> </div>
@@ -42,24 +32,46 @@ export default {
name: "AppEquipment", name: "AppEquipment",
data() { data() {
return { return {
current: 1,
areaId: '', areaId: '',
areaName: '', areaName: '',
keyword: '' keyword: '',
list: []
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
onLoad(option) { onLoad() {
this.areaId = this.user.areaId this.areaId = this.user.areaId
this.areaName = this.user.areaName this.areaName = this.user.areaName
this.getList()
}, },
methods: { methods: {
areaSelect(e) { areaSelect(e) {
this.areaId = e this.areaId = e
// this.getList() this.getListInit()
},
getListInit() {
this.list = []
this.current = 1
this.getList()
},
getList() {
this.$http.post(`/app/appdlbquipment/getDlbDeviceList?current=1&size=20&keyword=${this.keyword}`).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) { toDetail(item) {
uni.navigateTo({url: `./detail`}) uni.navigateTo({url: `./detail`})
} }
},
onReachBottom() {
} }
} }
</script> </script>

View File

@@ -7,26 +7,26 @@
</AiTopFixed> </AiTopFixed>
<div class="content"> <div class="content">
<div class="info-content" v-if="currIndex != 1"> <div class="info-content" v-if="currIndex != 1">
<p>村头大喇叭</p> <p>{{info.deviceName}}</p>
<div class="info"> <div class="info">
<span>设备编号</span> <span>设备编号</span>
<span class="color-333">121312312312</span> <span class="color-333">{{info.serialNo}}</span>
</div> </div>
<div class="info"> <div class="info">
<span>设备状态</span> <span>设备状态</span>
<span style="color: #4E8EEE">在线</span> <span style="color: #4E8EEE">{{info.devStatus}}</span>
</div> </div>
<div class="info"> <div class="info">
<span>信号强度</span> <span>信号强度</span>
<span class="color-333">一般</span> <span class="color-333">{{info.network}}</span>
</div> </div>
<div class="info"> <div class="info">
<span>音量</span> <span>音量</span>
<span class="color-333"></span> <span class="color-333">{{info.volume}}</span>
</div> </div>
<div class="info"> <div class="info">
<span>所属区划</span> <span>所属区划</span>
<span class="color-333"></span> <span class="color-333">{{info.areaName}}</span>
</div> </div>
</div> </div>
<div class="list-content" v-else> <div class="list-content" v-else>
@@ -47,9 +47,26 @@
</div> </div>
</div> </div>
<div class="btn">设置音量</div> <div class="btn" @click="setVolume">设置音量</div>
<u-popup v-model="isShow" mode="bottom"> <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> </u-popup>
</div> </div>
</template> </template>
@@ -65,6 +82,8 @@ export default {
currIndex: 1, currIndex: 1,
current: 1, current: 1,
isShow: false, isShow: false,
volume: 10,
info: {}
} }
}, },
onLoad(query) { onLoad(query) {
@@ -78,10 +97,21 @@ export default {
methods: { methods: {
change(index) { change(index) {
this.currIndex = index this.currIndex = index
this.getListInit()
}, },
toTaskDetail(item) { toTaskDetail(item) {
uni.navigateTo({url: `./taskDetail`}) uni.navigateTo({url: `./taskDetail`})
},
setVolume() {
this.isShow = true
this.volume = this.info.volume * 10 || 10
},
confirmAdd() {
this.$http.post(`/app/appdlbquipment/volumeControl?deviceId=${this.info.deviceId}&volume=${this.volume}`).then((res) => {
if (res.code == 0) {
this.getDetail()
this.$u.toast('音量设置成功')
}
})
} }
}, },
@@ -208,5 +238,54 @@ export default {
font-weight: 500; font-weight: 500;
color: #FFFFFF; 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> </style>

View File

@@ -16,13 +16,18 @@
<img :src="`${$cdn}video/play-icon.png`" alt="" @click="choose(item)"> <img :src="`${$cdn}video/play-icon.png`" alt="" @click="choose(item)">
<div class="info"> <div class="info">
<p>{{ item.name ? item.name.split('.')[0] : '-' }}</p> <p>{{ item.name ? item.name.split('.')[0] : '-' }}</p>
<div>{{ item.createUserName }}{{ item.createTime }}</div>
</div> </div>
<div class="btn">发布</div>
</div> </div>
</div> </div>
<div class="record-text" v-else> <div class="record-text" v-else>
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)"> <div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
<div>{{ item.name }}</div> <div class="info">
<p>{{ item.content }}</p> <div>{{ item.name }}</div>
<p>{{ item.content }}</p>
</div>
<div class="btn">发布</div>
</div> </div>
</div> </div>
<AiEmpty v-if="!list.length"></AiEmpty> <AiEmpty v-if="!list.length"></AiEmpty>
@@ -57,8 +62,7 @@ export default {
typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},] typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},]
} }
}, },
onLoad(query) { onLoad() {
this.isChoose = !!query.isChoose
this.getList() this.getList()
uni.$on('getList', () => { uni.$on('getList', () => {
this.isMore = false this.isMore = false
@@ -92,21 +96,8 @@ export default {
}, },
choose(item) { choose(item) {
if (!this.isChoose) { this.url = item.url
console.log(item.url) this.isShow = true
this.url = item.url
this.isShow = true
return false
}
uni.$emit('choose', {
mediaId: item.id,
mediaName: item.name
})
uni.navigateBack({
delta: 1
})
}, },
handerClear() { handerClear() {
@@ -207,7 +198,7 @@ export default {
} }
.info { .info {
width: calc(100% - 70px); width: calc(100% - 256px);
line-height: 44px; line-height: 44px;
font-size: 34px; font-size: 34px;
font-family: PingFang-SC-Medium, PingFang-SC; font-family: PingFang-SC-Medium, PingFang-SC;
@@ -220,6 +211,30 @@ export default {
white-space: nowrap; white-space: nowrap;
word-break: break-all; 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;
} }
} }
} }
@@ -233,43 +248,63 @@ export default {
padding: 32px 30px; padding: 32px 30px;
box-sizing: border-box; box-sizing: border-box;
font-size: 30px; 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;
margin-bottom: 12px;
div { .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-size: 30px;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500; font-weight: 500;
color: #333; color: #FFF;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-bottom: 12px;
.color-0063E5 {
color: #0063E5;
}
.color-FF8100 {
color: #FF8100;
}
.color-FF4466 {
color: #FF4466;
}
} }
.bg-AFD0FC{
p { background-color: #AFD0FC;
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;
} }
} }
} }

View File

@@ -3,21 +3,59 @@
<div class="header"> <div class="header">
<img :src="`${$cdn}video/play-icon.png`" alt=""> <img :src="`${$cdn}video/play-icon.png`" alt="">
<div class="right"> <div class="right">
<h2>五一活动唱红歌.mp3</h2> <h2>{{info.name}}.mp3</h2>
<p>2022-06-09 09:43:45</p> <p>{{info.createTime}}</p>
</div> </div>
</div> </div>
<div class="content"></div> <div class="content" v-if="info.content">{{info.content}}</div>
<div class="footer-bottom"></div> <div class="footer-bottom"></div>
<div class="footer"> <div class="footer">
<div>删除素材</div> <div @click="del">删除素材</div>
<div class="confirm">发布广播</div> <div class="confirm" @click="toAddBroadcast()">发布广播</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "detail" 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -12,7 +12,8 @@
<div class="label">播放设备</div> <div class="label">播放设备</div>
<div class="value" @click="toSelectEquipment"> <div class="value" @click="toSelectEquipment">
<!-- @click="selectClick('showEquipment', equipmentList)" --> <!-- @click="selectClick('showEquipment', equipmentList)" -->
<span :class="formData.serialName == '请选择' ? 'color-999' : ''">{{ formData.serialName }}</span> <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=""> <img src="./img/right-icon.png" alt="">
</div> </div>
</div> </div>
@@ -166,14 +167,23 @@ export default {
minute: false, minute: false,
second: false second: false
}, },
equipmentList: []
} }
}, },
onLoad() { onLoad(option) {
uni.$on('chooseMedia', e => { uni.$on('chooseMedia', e => {
console.log(e) console.log(e)
this.formData.mediaId = e.mediaId this.formData.mediaId = e.mediaId
this.formData.mediaName = e.mediaName 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() { onShow() {
document.title = '音频播放' document.title = '音频播放'

View File

@@ -13,31 +13,21 @@
</div> </div>
</AiTopFixed> </AiTopFixed>
<div class="record"> <div class="record">
<div class="item"> <div class="item" v-for="(item, index) in list" :key="index" @click="checkClick(index)">
<img src="./img/cir.png" alt="" class="check-img"> <img src="./img/select-blue.png" alt="" class="check-img" v-if="item.isCheck">
<img src="./img/cir.png" alt="" class="check-img" v-else>
<img src="./img/lb@2x.png" alt="" class="voice-img"> <img src="./img/lb@2x.png" alt="" class="voice-img">
<div class="info"> <div class="info">
<div class="text"> <div class="text">
<p>村头大喇叭</p> <p>{{item.deviceName}}</p>
<span>刘家河居委会</span> <span>{{item.orgName}}</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>
<div class="status">在线</div> <div class="status">在线</div>
</div> </div>
</div> </div>
</div> </div>
<div class="btn"> <div class="btn">
<div>确定选择</div> <div @click="confirm">确定选择</div>
</div> </div>
</div> </div>
</template> </template>
@@ -49,19 +39,64 @@ export default {
return { return {
areaId: '', areaId: '',
areaName: '', areaName: '',
keyword: '' keyword: '',
list: [],
selectList: []
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
onLoad(option) { onLoad(option) {
this.areaId = this.user.areaId this.areaId = this.user.areaId
this.areaName = this.user.areaName this.areaName = this.user.areaName
this.getList()
}, },
methods: { methods: {
areaSelect(e) { areaSelect(e) {
this.areaId = e this.areaId = e
// this.getList() // this.getList()
}, },
getList() {
this.$http.post(`/app/appdlbquipment/getDlbDeviceList?current=1&size=20&keyword=${this.keyword}`).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.deviceName,
serialName: item.serialNo
}
this.selectList.push(info)
}
})
if(!this.selectList.length) {
return this.$u.toast('请选择播放设备')
}
uni.$emit('chooseEquipment', {
equipmentList: this.selectList
})
uni.navigateBack({
delta: 1
})
}
},
onReachBottom() {
} }
} }
</script> </script>

View File

@@ -124,7 +124,7 @@ export default {
...this.search, ...this.search,
type: this.currIndex === 0 ? 1 : 3, type: this.currIndex === 0 ? 1 : 3,
current: this.current, current: this.current,
size: 10 size: 10,
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -194,7 +194,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.selectMedia { .selectMedia {
padding-bottom: 128px; padding-bottom: 128px;
::v-deep .AiTopFixed{
.content{
padding: 0;
}
}
.tab { .tab {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
margin-bottom: 4px; margin-bottom: 4px;
@@ -313,6 +317,7 @@ export default {
.currentLeft-top { .currentLeft-top {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 32px 32px 0;
.left { .left {
width: 200px; width: 200px;