2021-12-16 16:04:21 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="AppServicePublic">
|
2021-12-23 15:09:25 +08:00
|
|
|
<AiTopFixed v-if="tabs.length">
|
2021-12-24 09:04:23 +08:00
|
|
|
<div class="tab-select">
|
2021-12-23 17:56:36 +08:00
|
|
|
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index"
|
2021-12-24 09:04:23 +08:00
|
|
|
@click="tabClick(index, item)">{{ item.categoryName }}<span></span></div>
|
2021-12-23 15:09:25 +08:00
|
|
|
</div>
|
|
|
|
|
</AiTopFixed>
|
2021-12-16 16:04:21 +08:00
|
|
|
<div class="header-top">
|
|
|
|
|
<div>区域选择</div>
|
2021-12-23 15:09:25 +08:00
|
|
|
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect"></AiAreaPicker>
|
2021-12-16 16:04:21 +08:00
|
|
|
</div>
|
2021-12-24 20:24:17 +08:00
|
|
|
<u-search class="serach_content" placeholder="请输入标题" :show-action="false" v-model="keyword" @clear="clearSearch"
|
|
|
|
|
@search="search"></u-search>
|
2021-12-16 16:04:21 +08:00
|
|
|
<template v-if="datas.length > 0">
|
2021-12-23 17:56:36 +08:00
|
|
|
<AiCard v-for="(item, i) in datas" :ref="item.id" :key="i" @click.native="toAdd(item, 1)">
|
2021-12-16 17:13:18 +08:00
|
|
|
<template #custom>
|
2021-12-23 15:09:25 +08:00
|
|
|
<div class="titles">{{ item.title }}</div>
|
2021-12-23 20:02:26 +08:00
|
|
|
<p class="item-content">
|
|
|
|
|
<u-parse :html="item.content"></u-parse>
|
|
|
|
|
</p>
|
2021-12-24 14:48:06 +08:00
|
|
|
<div class="img-list" v-if="item.files.length && item.contentType != 1">
|
2021-12-24 20:24:17 +08:00
|
|
|
<img :src="items.accessUrl" alt="" v-for="(items, index) in item.files" :key="index" v-if="index < 3"
|
|
|
|
|
@click.stop="previewImage(item.files, items.accessUrl)"/>
|
2021-12-24 14:48:06 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="img-list" v-if="item.files.length && item.contentType == 1">
|
|
|
|
|
<video class="video" :src="item.files[0].url"></video>
|
2021-12-23 18:54:49 +08:00
|
|
|
</div>
|
2021-12-16 17:13:18 +08:00
|
|
|
<div class="flex">
|
|
|
|
|
<span class="left">
|
2021-12-24 20:24:17 +08:00
|
|
|
<span class="type" v-if="item.categoryName">{{ item.categoryName }}</span>
|
2021-12-23 18:54:49 +08:00
|
|
|
<span class="times">{{ item.createTime }}</span>
|
2021-12-16 17:13:18 +08:00
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span class="right">
|
2021-12-23 18:54:49 +08:00
|
|
|
<img src="./img/view-icon.png" alt="">
|
2021-12-24 20:24:17 +08:00
|
|
|
<span>{{ item.viewCount }}</span>
|
2021-12-16 17:13:18 +08:00
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template #menu>
|
|
|
|
|
<div class="menu" @tap.stop="toAdd(item, 2)">编辑</div>
|
|
|
|
|
<div class="menu" @tap.stop="toDetele(item)">删除</div>
|
|
|
|
|
</template>
|
|
|
|
|
</AiCard>
|
2021-12-16 16:04:21 +08:00
|
|
|
|
2021-12-23 17:56:36 +08:00
|
|
|
<u-loadmore :status="loadmore" color="#999" font-size="24" margin-top="32" margin-bottom="80"/>
|
2021-12-16 16:04:21 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<AiEmpty description="暂无数据" v-else></AiEmpty>
|
|
|
|
|
|
|
|
|
|
<AiFixedBtn>
|
2021-12-23 17:56:36 +08:00
|
|
|
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()"/>
|
2021-12-16 16:04:21 +08:00
|
|
|
</AiFixedBtn>
|
2021-12-16 17:13:18 +08:00
|
|
|
|
2021-12-23 17:56:36 +08:00
|
|
|
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true"
|
|
|
|
|
:show-title="false" @confirm="delet"></u-modal>
|
2021-12-16 16:04:21 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-12-23 17:56:36 +08:00
|
|
|
import {mapState} from 'vuex'
|
2021-12-16 16:04:21 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'AppServicePublic',
|
2021-12-24 20:24:17 +08:00
|
|
|
appName: '内容发布',
|
2021-12-16 16:04:21 +08:00
|
|
|
components: {},
|
|
|
|
|
props: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
datas: [],
|
|
|
|
|
keyword: '',
|
|
|
|
|
areaId: '',
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
pages: 0,
|
2021-12-16 17:13:18 +08:00
|
|
|
deletShow: false,
|
|
|
|
|
deletId: '',
|
2021-12-23 15:09:25 +08:00
|
|
|
moduleId: '',
|
|
|
|
|
listName: '',
|
|
|
|
|
tabs: [],
|
|
|
|
|
tabIndex: 0,
|
|
|
|
|
categoryId: ''
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState(['user']),
|
|
|
|
|
|
|
|
|
|
loadmore() {
|
|
|
|
|
return this.pages <= this.current ? 'loading ' : 'nomore'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
2021-12-23 11:03:06 +08:00
|
|
|
onLoad(o) {
|
2021-12-16 16:04:21 +08:00
|
|
|
this.areaId = this.user.areaId
|
2021-12-23 11:03:06 +08:00
|
|
|
this.moduleId = o.moduleId
|
2021-12-23 15:09:25 +08:00
|
|
|
this.listName = o.listName
|
|
|
|
|
this.getType()
|
2021-12-16 16:04:21 +08:00
|
|
|
this.getList()
|
2021-12-23 17:56:36 +08:00
|
|
|
uni.$on('update', () => {
|
2021-12-23 15:49:49 +08:00
|
|
|
this.getList()
|
|
|
|
|
})
|
2021-12-24 20:24:17 +08:00
|
|
|
|
2021-12-24 15:27:36 +08:00
|
|
|
},
|
|
|
|
|
onShow() {
|
2021-12-24 14:17:10 +08:00
|
|
|
document.title = this.listName
|
2021-12-16 16:04:21 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2021-12-24 09:04:23 +08:00
|
|
|
previewImage(images, img) {
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
urls: images.map(v => v.url),
|
|
|
|
|
current: img
|
|
|
|
|
})
|
|
|
|
|
},
|
2021-12-23 15:09:25 +08:00
|
|
|
getType() {
|
|
|
|
|
this.$http.post(`/app/appcontentmoduleinfo/listByName?names=${this.listName}`).then((res) => {
|
|
|
|
|
if (res.code == 0) {
|
2021-12-23 17:56:36 +08:00
|
|
|
if (res.data && res.data[0].categoryList.length) {
|
2021-12-23 15:09:25 +08:00
|
|
|
var all = [{
|
|
|
|
|
categoryName: '全部',
|
|
|
|
|
id: '',
|
|
|
|
|
showIndex: 0,
|
|
|
|
|
}]
|
2021-12-23 17:56:36 +08:00
|
|
|
this.tabs = [...all, ...res.data[0].categoryList]
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
2021-12-23 15:09:25 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2021-12-24 09:04:23 +08:00
|
|
|
tabClick(index, row) {
|
|
|
|
|
this.tabIndex = index
|
2021-12-23 15:09:25 +08:00
|
|
|
this.categoryId = row.id
|
2021-12-24 09:04:23 +08:00
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
search() {
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
2021-12-23 15:09:25 +08:00
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
|
this.$http.post('/app/appcontentinfo/list', null, {
|
|
|
|
|
params: {
|
2021-12-24 09:04:23 +08:00
|
|
|
size: 20,
|
2021-12-23 15:09:25 +08:00
|
|
|
current: this.current,
|
|
|
|
|
areaId: this.areaId,
|
|
|
|
|
title: this.keyword,
|
|
|
|
|
moduleId: this.moduleId,
|
|
|
|
|
categoryId: this.categoryId
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
|
|
|
|
|
this.pages = res.data.pages
|
|
|
|
|
}
|
|
|
|
|
})
|
2021-12-16 16:04:21 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
areaSelect(e) {
|
2021-12-16 17:13:18 +08:00
|
|
|
this.areaId = e.id
|
2021-12-16 16:04:21 +08:00
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
toAdd(item, type) {
|
2021-12-23 17:56:36 +08:00
|
|
|
if (item?.id) {
|
|
|
|
|
this.$refs?.[item.id]?.[0]?.handleClose()
|
|
|
|
|
}
|
2021-12-16 17:13:18 +08:00
|
|
|
if (type == '1') {
|
2021-12-23 17:56:36 +08:00
|
|
|
uni.navigateTo({url: `./Detail?id=${item.id}&listName=${this.listName}`})
|
2021-12-16 17:13:18 +08:00
|
|
|
}
|
|
|
|
|
if (type == '2') {
|
2021-12-23 17:56:36 +08:00
|
|
|
uni.navigateTo({url: `./Add?id=${item.id}&moduleId=${this.moduleId}&listName=${this.listName}`})
|
2021-12-16 17:13:18 +08:00
|
|
|
}
|
|
|
|
|
if (type == null) {
|
2021-12-23 17:56:36 +08:00
|
|
|
uni.navigateTo({url: `./Add?moduleId=${this.moduleId}&listName=${this.listName}`})
|
2021-12-16 17:13:18 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toDetele(item) {
|
|
|
|
|
this.deletShow = true
|
|
|
|
|
this.deletId = item.id
|
2021-12-23 17:56:36 +08:00
|
|
|
this.$refs?.[item.id]?.[0]?.handleClose()
|
2021-12-16 16:04:21 +08:00
|
|
|
},
|
|
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
delet() {
|
2021-12-23 15:49:49 +08:00
|
|
|
this.$http.post(`/app/appcontentinfo/delete?ids=${this.deletId}`).then((res) => {
|
2021-12-16 17:13:18 +08:00
|
|
|
if (res.code == 0) {
|
2021-12-23 15:49:49 +08:00
|
|
|
this.current = 1
|
2021-12-16 17:13:18 +08:00
|
|
|
this.$u.toast('删除成功!')
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
})
|
2021-12-16 16:04:21 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
this.current = this.current + 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
uni-page-body {
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
::v-deep .content {
|
|
|
|
|
padding: 0 !important;
|
2021-12-23 15:09:25 +08:00
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
.tab-select {
|
2021-12-23 15:09:25 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 96px;
|
|
|
|
|
line-height: 96px;
|
|
|
|
|
background: #3975C6;
|
|
|
|
|
display: flex;
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
.item {
|
2021-12-23 15:09:25 +08:00
|
|
|
flex: 1;
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
|
color: #CDDCF0;
|
|
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
.active {
|
2021-12-23 15:09:25 +08:00
|
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
position: relative;
|
|
|
|
|
color: #fff;
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
span {
|
2021-12-23 15:09:25 +08:00
|
|
|
width: 48px;
|
|
|
|
|
height: 4px;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 14px;
|
|
|
|
|
left: 50%;
|
|
|
|
|
margin-left: -24px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
|
|
|
|
.iconfont-iconMore {
|
2021-12-23 15:49:49 +08:00
|
|
|
// margin-top: 8px;
|
2021-12-23 15:09:25 +08:00
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 16:04:21 +08:00
|
|
|
.AppServicePublic {
|
|
|
|
|
height: 100%;
|
2021-12-16 17:31:50 +08:00
|
|
|
|
2021-12-16 16:04:21 +08:00
|
|
|
.header-top {
|
|
|
|
|
display: flex;
|
|
|
|
|
background: #fff;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 10px 30px;
|
|
|
|
|
border-bottom: 1px solid #d8dde6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.u-search {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 20px 30px;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
::v-deep .AiCard {
|
|
|
|
|
background: #f3f6f9;
|
2021-12-23 18:54:49 +08:00
|
|
|
position: relative;
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.start {
|
|
|
|
|
background: #fff;
|
|
|
|
|
padding: 32px;
|
|
|
|
|
border-radius: 16px;
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-17 14:54:51 +08:00
|
|
|
.titles {
|
2021-12-23 18:54:49 +08:00
|
|
|
width: 600px;
|
2021-12-16 17:13:18 +08:00
|
|
|
font-size: 32px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #333333;
|
|
|
|
|
margin-bottom: 16px;
|
2021-12-23 18:54:49 +08:00
|
|
|
line-height: 50px;
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-24 20:24:17 +08:00
|
|
|
.item-content {
|
2021-12-23 18:54:49 +08:00
|
|
|
width: 100%;
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
|
color: #999;
|
|
|
|
|
line-height: 44px;
|
2021-12-24 14:48:06 +08:00
|
|
|
margin-bottom: 24px;
|
2021-12-23 18:54:49 +08:00
|
|
|
}
|
|
|
|
|
|
2021-12-24 20:24:17 +08:00
|
|
|
.img-list {
|
2021-12-24 14:48:06 +08:00
|
|
|
margin-bottom: 24px;
|
2021-12-24 20:24:17 +08:00
|
|
|
|
|
|
|
|
img {
|
2021-12-23 18:54:49 +08:00
|
|
|
width: calc(33% - 16px);
|
|
|
|
|
height: 204px;
|
|
|
|
|
margin: 0 16px 8px 0;
|
|
|
|
|
}
|
2021-12-16 17:13:18 +08:00
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.flex {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.left {
|
|
|
|
|
.garydiv {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #999999;
|
|
|
|
|
background: #eeeeee;
|
|
|
|
|
border-radius: 24px;
|
|
|
|
|
padding: 4px 16px;
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.times {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
2021-12-23 18:54:49 +08:00
|
|
|
|
2021-12-24 20:24:17 +08:00
|
|
|
.type {
|
2021-12-23 18:54:49 +08:00
|
|
|
display: inline-block;
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
line-height: 48px;
|
|
|
|
|
background: #EEE;
|
|
|
|
|
border-radius: 24px;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #999;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
}
|
2021-12-16 17:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #999;
|
2021-12-24 20:24:17 +08:00
|
|
|
|
|
|
|
|
img {
|
2021-12-23 18:54:49 +08:00
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
2021-12-24 20:24:17 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.font {
|
|
|
|
|
color: #4181ff;
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-23 18:54:49 +08:00
|
|
|
|
2021-12-24 20:24:17 +08:00
|
|
|
.iconfont-iconMore {
|
2021-12-23 18:54:49 +08:00
|
|
|
position: absolute;
|
|
|
|
|
top: 42px;
|
|
|
|
|
right: 32px;
|
|
|
|
|
}
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
2021-12-23 17:56:36 +08:00
|
|
|
|
2021-12-16 17:13:18 +08:00
|
|
|
.mask {
|
|
|
|
|
.moreMenu {
|
|
|
|
|
.menu {
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 80px;
|
|
|
|
|
width: 192px;
|
|
|
|
|
height: 80px;
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.AiFixedBtn {
|
|
|
|
|
.movableArea {
|
|
|
|
|
.addBtn {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 96px;
|
|
|
|
|
height: 96px;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
background: $uni-color-primary;
|
|
|
|
|
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
|
|
|
|
|
font-size: 48px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-24 14:48:06 +08:00
|
|
|
|
2021-12-24 20:24:17 +08:00
|
|
|
::v-deep uni-video {
|
2021-12-24 14:48:06 +08:00
|
|
|
width: 100%;
|
|
|
|
|
}
|
2021-12-16 16:04:21 +08:00
|
|
|
}
|
|
|
|
|
</style>
|