大喇叭
This commit is contained in:
@@ -3,14 +3,15 @@
|
||||
<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)">
|
||||
<div class="value" @click="toSelectEquipment">
|
||||
<!-- @click="selectClick('showEquipment', equipmentList)" -->
|
||||
<span :class="formData.serialName == '请选择' ? 'color-999' : ''">{{ formData.serialName }}</span>
|
||||
<img src="./img/right-icon.png" alt="">
|
||||
</div>
|
||||
@@ -50,8 +51,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>
|
||||
@@ -169,7 +169,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.$on('choose', e => {
|
||||
uni.$on('chooseMedia', e => {
|
||||
console.log(e)
|
||||
this.formData.mediaId = e.mediaId
|
||||
this.formData.mediaName = e.mediaName
|
||||
@@ -180,8 +180,11 @@ export default {
|
||||
},
|
||||
|
||||
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 = []
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
<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">
|
||||
@@ -36,50 +42,50 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: "selectEquipment",
|
||||
data() {
|
||||
return {
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad(option) {
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName
|
||||
},
|
||||
methods: {
|
||||
areaSelect(e) {
|
||||
this.areaId = e
|
||||
// this.getList()
|
||||
},
|
||||
}
|
||||
}
|
||||
</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;
|
||||
|
||||
@@ -89,8 +95,8 @@ export default {
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
.check-img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin: 32px 32px 0 0;
|
||||
}
|
||||
|
||||
@@ -101,7 +107,7 @@ export default {
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 148px);
|
||||
width: calc(100% - 160px);
|
||||
padding: 18px 0;
|
||||
line-height: 44px;
|
||||
font-size: 34px;
|
||||
|
||||
355
src/project/beta/AppBroadcast1/selectMedia.vue
Normal file
355
src/project/beta/AppBroadcast1/selectMedia.vue
Normal file
@@ -0,0 +1,355 @@
|
||||
<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="getList" @clear="handerClear"></u-search>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="tab">
|
||||
<u-tabs :list="tab" :is-scroll="false" :current="currIndex" @change="change" height="96" :bar-style="barStyle"></u-tabs>
|
||||
</div>
|
||||
<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>李毅 2022-06-09 09:43:45</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>
|
||||
</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: {
|
||||
...this.search,
|
||||
type: this.currIndex === 0 ? 1 : 3,
|
||||
current: this.current,
|
||||
size: 10
|
||||
}
|
||||
}).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;
|
||||
|
||||
.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;
|
||||
|
||||
.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>
|
||||
@@ -33,7 +33,6 @@
|
||||
<!-- <audio :src="url" ref="audio" :controls="true" :name="autioName" style="display: block;"></audio> -->
|
||||
</div>
|
||||
</u-popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user