提交一波居民议事
This commit is contained in:
206
src/apps/AppVillageDiscuss/Add.vue
Normal file
206
src/apps/AppVillageDiscuss/Add.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div class="add">
|
||||
<div class="header-description">
|
||||
<u-form :model="form" ref="uForm" label-width="auto">
|
||||
<u-form-item label="主题" prop="content" required label-position="top">
|
||||
<u-input v-model="form.content" placeholder="请输入标题(1000字以内)" type="textarea" auto-height height="280"
|
||||
maxlength="1000"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="图片(最多9张)" prop="images" class="avatars" label-position="top">
|
||||
<AiUploader :def.sync="form.images" multiple placeholder="上传图片" :limit="9"
|
||||
action="/admin/file/add2"></AiUploader>
|
||||
</u-form-item>
|
||||
<u-form-item label="议事截止时间" prop="discussDeadline" required>
|
||||
<AiDateTime v-model="form.discussDeadline"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="公示截止时间" prop="publicityDeadline">
|
||||
<AiDateTime v-model="form.publicityDeadline"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="议事类型" prop="type" required label-position="top">
|
||||
<div v-for="op in $dict.getDict('discussType')" :key="op.dictValue" class="discussType"
|
||||
@click="form.type=op.dictValue" :class="{current:form.type==op.dictValue}">
|
||||
{{ op.dictName }}
|
||||
</div>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</div>
|
||||
<div class="pad-b112"></div>
|
||||
<div class="btn" @click="submit">保存</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'Add',
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
form: {type: 0},
|
||||
flag: false,
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
onLoad(o) {
|
||||
if (o.id) {
|
||||
this.id = o.id
|
||||
this.getDetail()
|
||||
}
|
||||
this.$dict.load("discussType")
|
||||
},
|
||||
onShow() {
|
||||
document.title = "新增议事"
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appvillagediscuss/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.form = {...res.data}
|
||||
if (res.data.images) {
|
||||
this.form.images = JSON.parse(res.data.images || '[]')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if (this.flag) return
|
||||
if (!this.form.content) {
|
||||
return this.$u.toast('请输入 主题')
|
||||
}
|
||||
if (!this.form.discussDeadline) {
|
||||
return this.$u.toast('请选择 议事截止时间')
|
||||
}
|
||||
this.$http.post(`/app/appvillagediscuss/addOrUpdate`, {
|
||||
...this.form,
|
||||
images: JSON.stringify(this.form.images),
|
||||
id: this.id,
|
||||
}).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
uni.$emit('update')
|
||||
this.$u.toast('发布成功')
|
||||
this.flag = true
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add {
|
||||
height: 100%;
|
||||
|
||||
.header-description {
|
||||
::v-deep .u-form {
|
||||
.u-form-item {
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-form-item:last-child {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.avatars {
|
||||
margin: 16px 0;
|
||||
|
||||
.u-form-item__body {
|
||||
.default {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pad-b112 {
|
||||
padding-bottom: 224px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #1365dd;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
|
||||
.right-icon {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.discussType {
|
||||
width: 320px;
|
||||
height: 112px;
|
||||
background: #F5F5F5;
|
||||
border-radius: 4px;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
line-height: 112px;
|
||||
|
||||
& + .discussType {
|
||||
margin-left: 42px;
|
||||
}
|
||||
|
||||
&.current {
|
||||
color: #1174FE;
|
||||
background: #E7F1FE;
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: " ";
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border: 24px solid #1576FE;
|
||||
border-top-color: transparent;
|
||||
border-left-color: transparent;
|
||||
border-radius: inherit;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "✓";
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
color: #fff;
|
||||
z-index: 2;
|
||||
line-height: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
382
src/apps/AppVillageDiscuss/AppVillageDiscuss.vue
Normal file
382
src/apps/AppVillageDiscuss/AppVillageDiscuss.vue
Normal file
@@ -0,0 +1,382 @@
|
||||
<template>
|
||||
<div class="AppVillageDiscuss">
|
||||
<AiTopFixed v-if="tabs.length>0">
|
||||
<div class="tab-select">
|
||||
<div class="item" :class="{active:type == item.dictValue}" v-for="(item) in tabs" :key="item.dictValue"
|
||||
@click="tabClick(item.dictValue)">{{ item.dictName }}<span/>
|
||||
</div>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<template v-if="datas.length > 0">
|
||||
<AiCard v-for="(item, i) in datas" :ref="item.id" :key="i" @click.native="toAdd(item, 1)">
|
||||
<template #custom>
|
||||
<div flex class="w-100">
|
||||
<div class="avatar" v-text="item.avatar"/>
|
||||
<div flex class="column start fill">
|
||||
<b class="color-333" v-text="item.createUserName"/>
|
||||
<span class="color-999" v-text="item.createTime"/>
|
||||
</div>
|
||||
<div class="statusTag" :class="{over:item.status>0}"
|
||||
v-text="item.status==0? item.type==0?'征集中':'投票中':$dict.getLabel('discussStatus',item.status)"/>
|
||||
</div>
|
||||
<p class="item-content">
|
||||
<u-parse :html="item.content"></u-parse>
|
||||
</p>
|
||||
<div v-if="item.images&&item.images.length">
|
||||
<div class="img-list" v-if="item.contentType != 1">
|
||||
<img :src="items.accessUrl" alt="" v-for="(items, index) in item.images" :key="index" v-if="index < 3"
|
||||
@click.stop="previewImage(item.images, items.accessUrl)"/>
|
||||
</div>
|
||||
<div class="img-list" v-else>
|
||||
<video class="video" :src="item.images[0].url"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</AiCard>
|
||||
<u-loadmore :status="loadmore" color="#999" font-size="24" margin-top="32" margin-bottom="80"/>
|
||||
</template>
|
||||
|
||||
<AiEmpty description="暂无数据" v-else></AiEmpty>
|
||||
|
||||
<AiFixedBtn>
|
||||
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()"/>
|
||||
<div class="addBtn iconfont iconfont-iconDouble_Up" @tap.stop="backTop" v-if="showBackTop"/>
|
||||
</AiFixedBtn>
|
||||
|
||||
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true"
|
||||
:show-title="false" @confirm="delet"></u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppVillageDiscuss',
|
||||
appName: '居民议事',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
datas: [],
|
||||
current: 1,
|
||||
size: 10,
|
||||
pages: 0,
|
||||
deletShow: false,
|
||||
deletId: '',
|
||||
type: '0',
|
||||
listName: '',
|
||||
tabIndex: 0,
|
||||
showBackTop: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
loadmore() {
|
||||
return this.pages <= this.current ? 'loading ' : 'nomore'
|
||||
},
|
||||
tabs() {
|
||||
return this.$dict.getDict("discussStatus")
|
||||
}
|
||||
},
|
||||
onLoad(o) {
|
||||
this.moduleId = o.moduleId
|
||||
this.listName = o.listName
|
||||
this.getList()
|
||||
uni.$on('update', () => {
|
||||
this.getList()
|
||||
})
|
||||
this.$dict.load("discussStatus")
|
||||
},
|
||||
onShow() {
|
||||
document.title = "居民议事"
|
||||
},
|
||||
onPageScroll(obj) {
|
||||
this.showBackTop = obj.scrollTop > 0
|
||||
},
|
||||
methods: {
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map(v => v.url),
|
||||
current: img
|
||||
})
|
||||
},
|
||||
tabClick(type) {
|
||||
this.type = type
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
search() {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
let {current, type} = this
|
||||
this.$http.post('/app/appvillagediscuss/list', null, {
|
||||
params: {size: 20, current, type},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.data) {
|
||||
res.data.records.forEach(e => {
|
||||
e.avatar = e.createUserName?.substring(0, 2) || "游客"
|
||||
if (e.images) {
|
||||
e.images = JSON.parse(e.images)
|
||||
}
|
||||
})
|
||||
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd(item, type) {
|
||||
if (item?.id) {
|
||||
this.$refs?.[item.id]?.[0]?.handleClose()
|
||||
}
|
||||
if (type == '1') {
|
||||
uni.navigateTo({url: `./Detail?id=${item.id}`})
|
||||
}
|
||||
if (type == '2') {
|
||||
uni.navigateTo({url: `./Add?id=${item.id}`})
|
||||
}
|
||||
if (type == null) {
|
||||
uni.navigateTo({url: `./Add`})
|
||||
}
|
||||
},
|
||||
|
||||
toDetele(item) {
|
||||
this.deletShow = true
|
||||
this.deletId = item.id
|
||||
this.$refs?.[item.id]?.[0]?.handleClose()
|
||||
},
|
||||
|
||||
delet() {
|
||||
this.$http.post(`/app/appcontentinfo/delete?ids=${this.deletId}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.current = 1
|
||||
this.$u.toast('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
backTop() {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current++
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppVillageDiscuss {
|
||||
height: 100%;
|
||||
|
||||
.avatar {
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
color: #fff;
|
||||
background: $uni-color-primary;
|
||||
border-radius: 50%;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
line-height: 64px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.color-333 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.w-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.statusTag {
|
||||
padding: 0 12px;
|
||||
line-height: 30px;
|
||||
border: 1px solid #2573FF;
|
||||
color: #2573FF;
|
||||
font-size: 22px;
|
||||
|
||||
&.over {
|
||||
border-color: #666;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep.AiTopFixed {
|
||||
.content {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-select {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
line-height: 96px;
|
||||
background: #3975C6;
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #CDDCF0;
|
||||
}
|
||||
|
||||
.active {
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
|
||||
span {
|
||||
width: 48px;
|
||||
height: 4px;
|
||||
background: #FFF;
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
left: 50%;
|
||||
margin-left: -24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
::v-deep .AiCard {
|
||||
background: #f3f6f9;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin-bottom: 16px;
|
||||
|
||||
& > .start {
|
||||
background: #fff;
|
||||
padding: 32px;
|
||||
border-radius: 16px;
|
||||
|
||||
.titles {
|
||||
width: 600px;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
margin-bottom: 16px;
|
||||
line-height: 50px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.item-content {
|
||||
width: 100%;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 4;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.img-list {
|
||||
margin-bottom: 24px;
|
||||
|
||||
img {
|
||||
width: calc(33% - 16px);
|
||||
height: 204px;
|
||||
margin: 0 16px 8px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
.garydiv {
|
||||
font-size: 28px;
|
||||
color: #999999;
|
||||
background: #eeeeee;
|
||||
border-radius: 24px;
|
||||
padding: 4px 16px;
|
||||
}
|
||||
|
||||
.times {
|
||||
font-size: 28px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.type {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
font-size: 28px;
|
||||
color: #999;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.font {
|
||||
color: #4181ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.AiFixedBtn {
|
||||
.movableArea {
|
||||
.addBtn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
|
||||
font-size: 48px;
|
||||
background: #fff;
|
||||
color: $uni-color-primary;
|
||||
border-radius: 50%;
|
||||
|
||||
& + .addBtn {
|
||||
margin-top: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep uni-video {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
237
src/apps/AppVillageDiscuss/Detail.vue
Normal file
237
src/apps/AppVillageDiscuss/Detail.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div class="Detail">
|
||||
<AiTopFixed>
|
||||
<div flex class="w-100">
|
||||
<div class="avatar" v-text="data.avatar"/>
|
||||
<div flex class="column start fill">
|
||||
<b class="color-333" v-text="data.createUserName"/>
|
||||
<span class="color-999" v-text="data.createTime"/>
|
||||
</div>
|
||||
<div class="statusTag" :class="{over:data.status>0}"
|
||||
v-text="data.status==0? data.type==0?'征集中':'投票中':$dict.getLabel('discussStatus',data.status)"/>
|
||||
</div>
|
||||
<div class="header-middle">
|
||||
<div class="contsnts">
|
||||
<u-parse :html="data.content"></u-parse>
|
||||
</div>
|
||||
</div>
|
||||
<div class="img-list" v-if="data.images && data.images.length && data.contentType != 1">
|
||||
<img :src="item.accessUrl" alt="" v-for="(item, index) in data.images" :key="index"
|
||||
@click="previewImage(data.images, item.accessUrl)"/>
|
||||
</div>
|
||||
<div class="img-list" v-if="data.images && data.images.length && data.contentType == 1">
|
||||
<video class="video" :src="data.images[0].url"></video>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div v-if="data.type==0" class="comments">
|
||||
<b class="total" v-text="`全部评论(${commentCount})`"/>
|
||||
<div v-for="op in data.messages" :key="op.id">
|
||||
<div flex class="header">
|
||||
<u-avatar :src="op.avatar" size="48"/>
|
||||
<b class="fill" v-text="op.createUserName"/>
|
||||
<u-icon name="thumb-up" :label="op.suport"/>
|
||||
</div>
|
||||
<div class="content" v-text="op.content"/>
|
||||
<div class="content color-999" v-text="op.createTime"/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="data.type==1" class="comments">
|
||||
|
||||
</div>
|
||||
<div class="bottomBar">
|
||||
<div v-if="data.status<2" @click="handleComplete">结束公示</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Detail',
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
data: {},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
commentCount() {
|
||||
return this.data.messages?.length || 0
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
onLoad(o) {
|
||||
this.id = o.id
|
||||
this.getDetail()
|
||||
this.$dict.load("discussStatus")
|
||||
},
|
||||
onShow() {
|
||||
document.title = "议事详情"
|
||||
},
|
||||
methods: {
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map(v => v.url),
|
||||
current: img
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appvillagediscuss/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.data = {
|
||||
...res.data,
|
||||
avatar: res.data.createUserName?.substr(0, 2) || "游客",
|
||||
images: JSON.parse(res.data.images),
|
||||
messages: res.data.messages || []
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSubmitComment(content) {
|
||||
if (!!content) {
|
||||
let {id} = this
|
||||
this.$http.post("/app/appvillagediscussmessage/addOrUpdate", {
|
||||
id, content
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast("不能提交空评论!")
|
||||
}
|
||||
},
|
||||
handleComplete() {
|
||||
this.$confirm("是否要结束公示").then(() => {
|
||||
let {id} = this
|
||||
this.$http.post("/app/appvillagediscuss/finishPublic", {id}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("已结束公示!")
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
}).catch(() => 0)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Detail {
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
padding-bottom: 112px;
|
||||
|
||||
::v-deep.AiTopFixed {
|
||||
border-bottom: 16px solid #F6F7F9;
|
||||
|
||||
.avatar {
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
color: #fff;
|
||||
background: $uni-color-primary;
|
||||
border-radius: 50%;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
line-height: 64px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.color-333 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.w-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.statusTag {
|
||||
padding: 0 12px;
|
||||
line-height: 30px;
|
||||
border: 1px solid #2573FF;
|
||||
color: #2573FF;
|
||||
font-size: 22px;
|
||||
|
||||
&.over {
|
||||
border-color: #666;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
padding: 32px 0 48px 0;
|
||||
|
||||
.contsnts {
|
||||
font-size: 26px;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
img {
|
||||
margin-top: 30px;
|
||||
width: 686px;
|
||||
height: 486px;
|
||||
}
|
||||
}
|
||||
|
||||
.img-list {
|
||||
img {
|
||||
width: calc(33vw - 6px - 24px);
|
||||
height: calc(33vw - 6px - 24px);
|
||||
margin: 0 12px 12px 0;
|
||||
|
||||
&:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
line-height: 112px;
|
||||
background: #FFF;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep uni-video {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comments {
|
||||
padding: 0 32px;
|
||||
font-size: 28px;
|
||||
|
||||
.total {
|
||||
display: block;
|
||||
font-size: 30px;
|
||||
height: 120px;
|
||||
padding-top: 44px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.u-avatar {
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
.content {
|
||||
color: #333;
|
||||
margin-left: 72px;
|
||||
margin-top: 10px;
|
||||
|
||||
&.color-999 {
|
||||
color: #999999;
|
||||
font-size: 24px;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
66
src/components/AiDateTime.vue
Normal file
66
src/components/AiDateTime.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<section class="AiDateTime">
|
||||
<div @tap.stop="show=true">
|
||||
<slot v-if="$slots.default"/>
|
||||
<div v-else class="right">
|
||||
<span v-if="value" v-text="value"/>
|
||||
<span v-else class="color-999" v-text="placeholder"/>
|
||||
<u-icon name="arrow-right" color="#ccc" class="right-icon"/>
|
||||
</div>
|
||||
</div>
|
||||
<u-picker v-model="show" mode="time" @confirm="handleConfirm" :params="params"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AiDateTime",
|
||||
model: {
|
||||
event: "change",
|
||||
prop: "value"
|
||||
},
|
||||
props: {
|
||||
value: {default: ""},
|
||||
placeholder: {default: "请选择"},
|
||||
format: {default: "YYYY-MM-DD HH:mm:ss"}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: true,
|
||||
timestamp: true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleConfirm(v) {
|
||||
this.$emit('change', this.$dateFormat(v.timestamp * 1000, this.format))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AiDateTime {
|
||||
width: 100%;
|
||||
|
||||
.right {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
|
||||
.right-icon {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,603 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="header-content">
|
||||
<div class="header-top">
|
||||
<img :src="detail.url" alt="" />
|
||||
</div>
|
||||
|
||||
<div class="header-middle">
|
||||
<div class="img-title">{{ detail.title }}</div>
|
||||
|
||||
<div class="header-middle-bottom">
|
||||
<div class="left">
|
||||
<div class="left-btn" :class="'status' + detail.status">{{ $dict.getLabel('newActivityStatus', detail.status) }}</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<img :src="detail.avatar" alt="" />
|
||||
<span>{{ detail.createUserName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cards">
|
||||
<div class="cards-left">活动时间</div>
|
||||
<div class="cards-right">{{ detail.beginTime }}-{{ detail.endTime }}</div>
|
||||
</div>
|
||||
|
||||
<div class="cards">
|
||||
<div class="cards-left">活动人数</div>
|
||||
<div class="cards-right" @click="toSignUser()">
|
||||
<span>
|
||||
<span :style="{ color: detail.realNum == detail.total ? '#FF4466 ' : '#1C6BDF' }">{{ detail.realNum || 0 }}</span>
|
||||
<span v-if="detail.total != 0">/{{ detail.total }}</span>
|
||||
<span v-else>/不限</span>
|
||||
</span>
|
||||
<u-icon name="arrow-right" color="#DDDDDD" size="28" style="margin-left: 8px"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cards">
|
||||
<div class="cards-left">活动地点</div>
|
||||
<div class="cards-right" style="width: 75%; text-align: right">{{ detail.address }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header-bottom">
|
||||
<!-- v-if="detail.status == 1 || detail.status == 2 || detail.status == 3" -->
|
||||
<div class="tab-title">
|
||||
<span :class="current == 0 ? 'active' : ''" @click="change(0)">活动详情</span>
|
||||
<span :class="current == 1 ? 'active' : ''" @click="change(1)">活动动态</span>
|
||||
</div>
|
||||
<!-- <div class="info-title" v-else>活动详情</div> -->
|
||||
<div class="content-details" v-if="current == 0">
|
||||
<div v-html="detail.content"></div>
|
||||
</div>
|
||||
|
||||
<div class="content-trends" v-if="current == 1">
|
||||
<div class="details" v-if="activeList.length > 0">
|
||||
<div class="card" v-for="(item, index) in activeList" :key="index" @click="toDetail(item.id)">
|
||||
<div class="card-nav">
|
||||
<div class="avatar">
|
||||
<img :src="item.avatar" alt="" style="width: 100%; height: 100%" v-if="item.avatar" />
|
||||
<span v-else>
|
||||
<span v-if="item.name">{{ item.name.substring(item.name.length, item.name.length - 2) }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<span class="time">{{ item.createTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-font">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
|
||||
<div class="card-img">
|
||||
<img :src="e.url" v-for="(e, i) in imgList[index]" :key="i" alt="" @click.stop="previewImage(info.images, item.url)" />
|
||||
</div>
|
||||
|
||||
<div class="card-icon">
|
||||
<div>
|
||||
<i class="iconfont"></i>
|
||||
<span>{{ item.viewNum ? item.viewNum : 0 }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<i class="iconfont"></i>
|
||||
<span>{{ item.replyNum ? item.replyNum : 0 }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<i class="iconfont"></i>
|
||||
<span>{{ item.supportNum ? item.supportNum : 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-bottom"></div>
|
||||
</div>
|
||||
|
||||
<AiEmpty v-else />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="addicon" @click="toPublicPage()">
|
||||
<u-icon name="plus" color="#1365DD" size="50"></u-icon>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.status == 0 && detail.createUserId == user.partyId">
|
||||
<div class="edit" @click="editActive">编辑</div>
|
||||
<div class="public" style="background: #3671ee" @click="changeStatus(1, '是否发布?')">发布活动</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.realNum < detail.total && detail.status == 1 && detail.myReport == 0">
|
||||
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
|
||||
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.status == 1 && detail.myReport == 0 && detail.total == 0">
|
||||
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
|
||||
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.status == 1 && detail.myReport == 1">
|
||||
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
|
||||
<div class="public" style="background: #3671ee" @click="changeStatus(3, '是否取消报名?取消报名无法重新报名!')">取消报名</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.realNum == detail.total && detail.status == 1 && detail.status == 1 && detail.total != 0">
|
||||
<div class="max">已满员</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.myReport == 1 && detail.status == 2">
|
||||
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
|
||||
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow1 == 0">未签到</div>
|
||||
<div class="public" style="background: #3671ee; color: #ffffff" v-if="detail.allow1 == 1" @click="sign(0)">签到</div>
|
||||
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow1 == 2">已签到</div>
|
||||
</div>
|
||||
|
||||
<div class="btn" v-if="detail.status == 5">
|
||||
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
|
||||
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 1" @click="sign(1)">离场签到</div>
|
||||
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 2">已离场签到</div>
|
||||
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow2 == 0">未离场签到</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'ActiveDetail',
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
detail: {},
|
||||
activeList: [],
|
||||
imgList: [],
|
||||
list: [
|
||||
{
|
||||
name: '活动详情',
|
||||
},
|
||||
{
|
||||
name: '活动动态',
|
||||
},
|
||||
],
|
||||
current: 0,
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.$dict.load(['newActivityStatus']).then(() => {
|
||||
this.getDetail()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$instance.post(`/app/appactivityinfo/queryDetailById?id=${this.id}&partyId=${this.user.partyId}`).then((res) => {
|
||||
if (res?.data) {
|
||||
res.data.beginTime = res.data.beginTime.substring(0, 16)
|
||||
res.data.endTime = res.data.endTime.substring(0, 16)
|
||||
this.detail = res.data
|
||||
this.getActiveList()
|
||||
}
|
||||
})
|
||||
},
|
||||
getActiveList() {
|
||||
this.$instance.post(`/app/apppostinfo/list?activityId=${this.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.activeList = res.data.records
|
||||
|
||||
if (this.activeList) {
|
||||
let imagesList = []
|
||||
this.activeList.map((item) => {
|
||||
if (item.images) {
|
||||
item.images = JSON.parse(item.images || '[]')
|
||||
imagesList.push(item.images)
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.imgList = imagesList
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
change(index) {
|
||||
this.current = index
|
||||
},
|
||||
toPublicPage() {
|
||||
uni.navigateTo({
|
||||
url: `./AddPosts?id=${this.id}`,
|
||||
})
|
||||
},
|
||||
editActive() {
|
||||
uni.navigateTo({ url: `./AddActive?id=${this.id}` })
|
||||
},
|
||||
changeStatus(status, text) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `${text}`,
|
||||
confirmText: '确定',
|
||||
success: (e) => {
|
||||
if (status == 1) {
|
||||
//发布
|
||||
this.changeStatusConfirm(status)
|
||||
}
|
||||
if (status == 2) {
|
||||
//报名
|
||||
this.report()
|
||||
}
|
||||
if (status == 3) {
|
||||
//取消报名
|
||||
this.cancelReport()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
cancelReport() {
|
||||
this.$instance
|
||||
.post(`/app/appactivityuser/removeReport`, {
|
||||
activityId: this.id,
|
||||
partyId: this.user.partyId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast('提交成功')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
changeStatusConfirm(status) {
|
||||
this.$instance
|
||||
.post(`/app/appactivityinfo/changeStatus`, {
|
||||
id: this.id,
|
||||
status: status,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast('提交成功')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({ phoneNumber: phone })
|
||||
},
|
||||
report() {
|
||||
this.$instance
|
||||
.post(`/app/appactivityuser/report`, {
|
||||
activityId: this.id,
|
||||
partyId: this.user.partyId,
|
||||
name: this.user.realName,
|
||||
orgId: this.user.partyOrgId,
|
||||
orgName: this.user.partyOrgName,
|
||||
phone: this.user.phone,
|
||||
communityId: this.user.communityId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast('报名成功')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
toSignUser() {
|
||||
var isAdmin = this.detail.createUserId == this.user.partyId ? 1 : 0
|
||||
uni.navigateTo({ url: `./SignUser?id=${this.id}&isAdmin=${isAdmin}&status=${this.detail.status}` })
|
||||
},
|
||||
sign(status) {
|
||||
//status 0开始签到 1离场签到
|
||||
this.$instance
|
||||
.post(`/app/appactivityuser/sign`, {
|
||||
activityId: this.id,
|
||||
partyId: this.user.partyId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast(status == 1 ? '离场签到成功' : '签到成功')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(id) {
|
||||
this.linkTo(`./detail?id=${id}`)
|
||||
},
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map((v) => v.url),
|
||||
current: img,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
.info-title {
|
||||
padding-left: 32px;
|
||||
line-height: 108px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.tab-title {
|
||||
line-height: 108px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 192px;
|
||||
text-align: center;
|
||||
}
|
||||
.active {
|
||||
color: #3671ee;
|
||||
border-bottom: 4px solid #3671ee;
|
||||
}
|
||||
}
|
||||
.status0 {
|
||||
background: #000;
|
||||
}
|
||||
.status1 {
|
||||
background: #ff883c;
|
||||
}
|
||||
.status3 {
|
||||
background: #1aaaff;
|
||||
}
|
||||
.status2 {
|
||||
background: #42d784;
|
||||
}
|
||||
.status4,
|
||||
.status5 {
|
||||
background: #e4e4e4;
|
||||
}
|
||||
.header-content {
|
||||
padding-bottom: 150px;
|
||||
.header-top {
|
||||
width: 100%;
|
||||
height: 440px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
padding: 32px 32px 0 32px;
|
||||
|
||||
.img-title {
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.header-middle-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 32px;
|
||||
.left {
|
||||
.left-btn {
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
|
||||
font-size: 26px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
vertical-align: text-top;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #eee;
|
||||
padding: 36px 0;
|
||||
line-height: 40px;
|
||||
font-size: 28px;
|
||||
|
||||
.cards-left {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.cards-right {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header-bottom {
|
||||
background: #fff;
|
||||
|
||||
.content-details {
|
||||
padding: 32px 32px 80px 32px;
|
||||
.font {
|
||||
margin-top: 32px;
|
||||
font-size: 30px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.font-img {
|
||||
margin-top: 26px;
|
||||
width: 100%;
|
||||
height: 480px;
|
||||
}
|
||||
}
|
||||
|
||||
.content-trends {
|
||||
// padding-bottom: 40px;
|
||||
.details {
|
||||
.card {
|
||||
padding: 26px 32px 28px 32px;
|
||||
.card-nav {
|
||||
display: flex;
|
||||
.avatar {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
line-height: 60px;
|
||||
background: #4e8eee;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.right {
|
||||
// display: inline;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.name {
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.time {
|
||||
font-size: 22px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-font {
|
||||
margin-top: 36px;
|
||||
line-height: 1.6;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
margin-top: 16px;
|
||||
img {
|
||||
width: 224px;
|
||||
height: 224px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
img:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 28px;
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .emptyWrap {
|
||||
// background-color: pink;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.noDeatil {
|
||||
background-color: #f3f6f9;
|
||||
img {
|
||||
width: 400px;
|
||||
height: 240px;
|
||||
transform: translate(50%, 25%);
|
||||
padding-bottom: 156px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-bottom {
|
||||
height: 20px;
|
||||
background-color: #f3f6f9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addicon {
|
||||
position: fixed;
|
||||
bottom: 280px;
|
||||
right: 30px;
|
||||
background: #fefefe;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 50%;
|
||||
padding: 26px 24px 22px 24px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
// height: 112px;
|
||||
background: #f3f6f9;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 32px 0;
|
||||
text-align: center;
|
||||
.edit {
|
||||
width: 254px;
|
||||
height: 92px;
|
||||
line-height: 92px;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #3671ee;
|
||||
|
||||
font-size: 34px;
|
||||
font-weight: 500;
|
||||
color: #3671ee;
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.public {
|
||||
width: 400px;
|
||||
|
||||
line-height: 92px;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.max {
|
||||
margin: 0 auto;
|
||||
width: 686px;
|
||||
height: 92px;
|
||||
line-height: 92px;
|
||||
background: #cbddf9;
|
||||
border-radius: 8px;
|
||||
|
||||
font-size: 34px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,467 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="textarea-div border">
|
||||
<div class="title mar-b32"><span>*</span>活动标题</div>
|
||||
<div class="pad-l20">
|
||||
<u-input type="textarea" v-model="params.title" :border="false" height="44" :auto-height="true" placeholder="请输入标题(60字以内)" :placeholder-style="placeholderStyle" maxlength="60" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="textarea-div mar-b16">
|
||||
<div class="title mar-b32"><span>*</span>活动详情</div>
|
||||
<div class="pad-l20">
|
||||
<u-input type="textarea" v-model="params.content" :border="false" :height="140" :auto-height="true" placeholder="请输入活动详情(500字以内)" :placeholder-style="placeholderStyle" maxlength="500" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="textarea-div mar-b16">
|
||||
<div class="title mar-b32"><span>*</span>活动封面图</div>
|
||||
<div class="pad-l20">
|
||||
<AiUploader v-model="files"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>活动主题</div>
|
||||
<div class="value" @click="selectClick(topicList, 'target')">
|
||||
<span :class="params.target ? '' : 'color-999'">{{ params.target || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>活动类型</div>
|
||||
<div class="value" @click="selectClick(activeTypeList, 'type')">
|
||||
<span :class="params.type ? '' : 'color-999'">{{ params.type || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>报名范围</div>
|
||||
<div class="value" @click="selectClick($dict.getDict('activityScope'), 'scope')">
|
||||
<span :class="params.scope === '' ? 'color-999' : ''">{{ $dict.getLabel('activityScope', params.scope) || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div" v-if="params.scope == 1">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>发布单位</div>
|
||||
<div class="value">
|
||||
<AIsEarchPopup title="请选择发布单位" placeholder="搜索单位名称" :ops="{ label: 'name', search: 'name' }" url="/admin/partyOrganization/queryPartyOrganizationListByName" @select="(v) => (selectedOrg = v)">
|
||||
<div class="picker-input" slot="btn">
|
||||
<view class="uni-input color-999" v-if="!selectedOrg.id">请选择</view>
|
||||
<view class="uni-input" v-else>{{ selectedOrg.name }}</view>
|
||||
<image src="https://cdn.cunwuyun.cn/img/right-icon-999.png" class="right-icon"></image>
|
||||
</div>
|
||||
</AIsEarchPopup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-div" v-if="params.scope == 2">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>发布小区</div>
|
||||
<div class="value" @click="estateSelect = true">
|
||||
<span :class="params.communityName ? '' : 'color-999'">{{ params.communityName || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-select v-model="estateSelect" mode="mutil-column-auto" :list="estateTreeData" @confirm="handleBindEstate" value-name="id" label-name="name" />
|
||||
|
||||
<div class="input-div mar-b16">
|
||||
<div class="border-content">
|
||||
<div class="title"><span>*</span>活动名额</div>
|
||||
<div class="value">
|
||||
<u-input type="input" v-model="params.total" :border="false" :height="44" :auto-height="true" placeholder="如不限制人数,填写0" input-align="right" :placeholder-style="placeholderStyle" maxlength="5" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>开始时间</div>
|
||||
<div class="value" @click="selectDate('beginTime')">
|
||||
<span :class="params.beginTime ? '' : 'color-999'">{{ params.beginTime || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>结束时间</div>
|
||||
<div class="value" @click="selectDate('endTime')">
|
||||
<span :class="params.endTime ? '' : 'color-999'">{{ params.endTime || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>报名截止时间</div>
|
||||
<div class="value" @click="selectDate('stopSignupTime')">
|
||||
<span :class="params.stopSignupTime ? '' : 'color-999'">{{ params.stopSignupTime || '请选择' }}</span>
|
||||
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div mar-b16">
|
||||
<div class="border-content">
|
||||
<div class="title"><span>*</span>活动地点</div>
|
||||
<div class="value">
|
||||
<input type="text" maxlength="20" v-model="params.address" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div">
|
||||
<div class="border-content border">
|
||||
<div class="title"><span>*</span>联系人</div>
|
||||
<div class="value">
|
||||
<u-input type="input" v-model="params.contactPerson" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" maxlength="10" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-div mar-b16 pad-b220">
|
||||
<div class="border-content">
|
||||
<div class="title"><span>*</span>联系方式</div>
|
||||
<div class="value">
|
||||
<u-input type="input" v-model="params.contactPhone" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" maxlength="11" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-btn">
|
||||
<div class="btn" @click="add">保存</div>
|
||||
</div>
|
||||
|
||||
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="selectConfirm"></u-select>
|
||||
<u-picker mode="time" v-model="showDate" :start-year="startYear" @confirm="dateConfirm" :params="timeParams"></u-picker>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AddActive',
|
||||
components: {},
|
||||
computed: {
|
||||
...mapState(['user', 'global']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
showSelect: false,
|
||||
selectList: [],
|
||||
topicList: [], //活动主题分类
|
||||
activeTypeList: [],
|
||||
selectData: '',
|
||||
showDate: false,
|
||||
startYear: '',
|
||||
beginTimestamp: '',
|
||||
params: {
|
||||
title: '',
|
||||
content: '',
|
||||
url: '',
|
||||
target: '',
|
||||
type: '',
|
||||
scope: '',
|
||||
total: '',
|
||||
address: '',
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
stopSignupTime: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
status: 0,
|
||||
createUserId: '',
|
||||
createUserName: '',
|
||||
avatar: '',
|
||||
id: '',
|
||||
orgId: '',
|
||||
orgName: '',
|
||||
communityId: '',
|
||||
communityName: '',
|
||||
},
|
||||
timeParams: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: true,
|
||||
timestamp: true,
|
||||
},
|
||||
placeholderStyle: 'color:#999;font-size:16px;',
|
||||
selectedOrg: {},
|
||||
estateTreeData: [],
|
||||
estateSelect: false,
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.$dict.load('activityScope').then(() => {
|
||||
this.getTopicList()
|
||||
console.log(option)
|
||||
if (option.id) {
|
||||
this.params.id = option.id
|
||||
this.getDetail()
|
||||
} else {
|
||||
this.params.contactPerson = this.user.realName
|
||||
this.params.contactPhone = this.user.phone
|
||||
}
|
||||
})
|
||||
var date = new Date()
|
||||
this.startYear = date.getFullYear()
|
||||
this.getEstates()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '编辑活动'
|
||||
},
|
||||
methods: {
|
||||
getEstates() {
|
||||
this.$http.post(`/app/appvanguardcommunityinfo/getTree?type=1&areaId=${this.global.areaId}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.estateTreeData = res.data?.children
|
||||
}
|
||||
})
|
||||
},
|
||||
handleBindEstate(e) {
|
||||
this.params.communityId = e[2].value
|
||||
this.params.communityName = e[2].label
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appactivityinfo/queryDetailById?id=${this.params.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.files = [
|
||||
{
|
||||
url: res.data.url,
|
||||
},
|
||||
]
|
||||
this.params = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getTopicList() {
|
||||
this.$http.post(`/app/appactivitytopic/list?status=1&size=1000`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
;(item.dictName = item.name), (item.dictValue = item.content)
|
||||
})
|
||||
this.topicList = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
selectClick(list, data) {
|
||||
if (data == 'type' && !list.length) {
|
||||
//活动类型
|
||||
return this.$toast('请先选择活动主题')
|
||||
}
|
||||
this.selectData = data
|
||||
this.selectList = list
|
||||
this.showSelect = true
|
||||
},
|
||||
selectConfirm(e) {
|
||||
console.log(e)
|
||||
if (this.selectData == 'target' || this.selectData == 'type') {
|
||||
this.params[this.selectData] = e[0].label
|
||||
} else {
|
||||
this.params[this.selectData] = e[0].value
|
||||
}
|
||||
|
||||
if (this.selectData == 'target') {
|
||||
//选择主题分类
|
||||
var content = e[0].value.split(',')
|
||||
this.activeTypeList = []
|
||||
this.type = ''
|
||||
content.map((items) => {
|
||||
var info = { dictName: items }
|
||||
this.activeTypeList.push(info)
|
||||
})
|
||||
}
|
||||
},
|
||||
selectDate(data) {
|
||||
if (data == 'endTime' && !this.params.beginTime) {
|
||||
return this.$toast('请先选择活动开始时间')
|
||||
}
|
||||
if (data == 'stopSignupTime' && !this.params.beginTime) {
|
||||
return this.$toast('请先选择活动开始时间')
|
||||
}
|
||||
this.selectData = data
|
||||
this.showDate = true
|
||||
},
|
||||
dateConfirm(e) {
|
||||
console.log(e)
|
||||
if (this.selectData == 'beginTime') {
|
||||
this.beginTimestamp = e.timestamp
|
||||
this.params.endTime = ''
|
||||
this.params.stopSignupTime = ''
|
||||
}
|
||||
if (this.selectData == 'endTime' && e.timestamp < this.beginTimestamp) {
|
||||
return this.$toast('活动结束时间不能晚于开始时间')
|
||||
}
|
||||
|
||||
if (this.selectData == 'stopSignupTime' && e.timestamp > this.beginTimestamp) {
|
||||
return this.$toast('报名截止时间不能早于开始时间')
|
||||
}
|
||||
this.params[this.selectData] = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
|
||||
},
|
||||
add() {
|
||||
if (!this.params.title) {
|
||||
return this.$toast('请输入活动标题')
|
||||
}
|
||||
if (!this.params.content) {
|
||||
return this.$toast('请输入活动标题')
|
||||
}
|
||||
if (!this.files.length) {
|
||||
return this.$toast('请上传活动封面')
|
||||
}
|
||||
if (!this.params.target) {
|
||||
return this.$toast('请选择活动主题')
|
||||
}
|
||||
if (!this.params.type) {
|
||||
return this.$toast('请选择活动类型')
|
||||
}
|
||||
if (this.params.scope === '') {
|
||||
return this.$toast('请选择报名范围')
|
||||
}
|
||||
if (this.params.scope == 1 && !this.selectedOrg.id) {
|
||||
return this.$toast('请选择发布单位')
|
||||
}
|
||||
if (this.params.scope == 2 && !this.params.communityId) {
|
||||
return this.$toast('请选择发布小区')
|
||||
}
|
||||
|
||||
if (!this.params.total) {
|
||||
return this.$toast('请输入活动名额')
|
||||
}
|
||||
if (!this.params.address) {
|
||||
return this.$toast('请输入活动地点')
|
||||
}
|
||||
if (!this.params.beginTime) {
|
||||
return this.$toast('请选择开始时间')
|
||||
}
|
||||
if (!this.params.endTime) {
|
||||
return this.$toast('请选择结束时间')
|
||||
}
|
||||
if (!this.params.stopSignupTime) {
|
||||
return this.$toast('请选择报名截止时间')
|
||||
}
|
||||
if (!this.params.contactPerson) {
|
||||
return this.$toast('请输入联系人')
|
||||
}
|
||||
if (!this.params.contactPhone) {
|
||||
return this.$toast('请输入联系方式')
|
||||
}
|
||||
if (this.params.scope == 1) {
|
||||
this.params.orgId = this.selectedOrg.id
|
||||
this.params.orgName = this.selectedOrg.name
|
||||
}
|
||||
this.params.url = this.files[0].url
|
||||
this.params.createUserId = this.user.partyId
|
||||
this.params.createUserName = this.user.realName
|
||||
this.params.orgName = this.user.partyOrgName
|
||||
this.params.avatar = this.user.avatarUrl
|
||||
this.confirmAdd()
|
||||
},
|
||||
confirmAdd() {
|
||||
this.$http.post(`/app/appactivityinfo/addOrUpdate`, this.params).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast(this.params.id ? '活动编辑成功' : '活动新增成功')
|
||||
setTimeout(() => {
|
||||
uni.$emit('refresh')
|
||||
uni.navigateBack()
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.textarea-div {
|
||||
width: 100%;
|
||||
padding: 32px 32px 38px 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
.input-div {
|
||||
width: 100%;
|
||||
padding-left: 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
.border-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 44px;
|
||||
color: #333;
|
||||
padding: 34px 32px 34px 0;
|
||||
.right-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
span {
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #ff4466;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
.border {
|
||||
border-bottom: 2px solid #ddd;
|
||||
}
|
||||
.mar-b32 {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.pad-l20 {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.mar-b16 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.pad-b220 {
|
||||
padding-bottom: 220px;
|
||||
}
|
||||
.footer-btn {
|
||||
width: 100%;
|
||||
padding: 116px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #f3f6f9;
|
||||
z-index: 99;
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 92px;
|
||||
line-height: 92px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.value {
|
||||
width: calc(100% - 240px);
|
||||
text-align: right;
|
||||
}
|
||||
::v-deep ai-search-popup {
|
||||
width: 100%;
|
||||
.uni-input {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,137 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="textarea-div mar-b16">
|
||||
<div class="title mar-b32"><span></span>帖子内容</div>
|
||||
<div class="pad-l20">
|
||||
<u-input v-model="form.content" type="textarea" :border="false" :height="140" :auto-height="true" placeholder="请输入内容(1000字以内)" placeholder-style="color:#999;font-size:16px;" maxLength="140" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="textarea-div pad-b208">
|
||||
<div class="title mar-b32"><span></span>图片(最多9张)</div>
|
||||
<div class="pad-l20">
|
||||
<AiUploader :limit="9" v-model="form.images"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-btn">
|
||||
<div class="btn" @click="addPost">立即发布</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AddPosts',
|
||||
components: {},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
id: '',
|
||||
flag: false,
|
||||
form: {
|
||||
content: '',
|
||||
images: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(o) {
|
||||
this.id = o.id || ''
|
||||
},
|
||||
methods: {
|
||||
addPost() {
|
||||
if (this.flag) return
|
||||
|
||||
if (!this.form.content && !this.form.images.length) {
|
||||
return this.$u.toast('帖子内容不能为空')
|
||||
}
|
||||
this.flag = true
|
||||
|
||||
let imagesList = []
|
||||
if (this.form.images) {
|
||||
this.form.images.map((item) => {
|
||||
imagesList.push({ id: item.id, url: item.url })
|
||||
})
|
||||
}
|
||||
|
||||
this.$http
|
||||
.post(`/app/apppostinfo/addOrUpdate`, {
|
||||
content: this.form.content,
|
||||
avatar: this.user.avatarUrl,
|
||||
name: this.user.realName,
|
||||
phone: this.user.phone ? this.user.phone : '',
|
||||
userId: this.user.partyId,
|
||||
activityId: this.id,
|
||||
images: JSON.stringify(imagesList),
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('发布成功')
|
||||
this.flag = false
|
||||
uni.$emit('refresh')
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.textarea-div {
|
||||
width: 100%;
|
||||
padding: 32px 32px 38px 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
.title {
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
span {
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #ff4466;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
.border {
|
||||
border-bottom: 2px solid #ddd;
|
||||
}
|
||||
.mar-b32 {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.pad-l20 {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.mar-b16 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.pad-b208 {
|
||||
padding-bottom: 208px;
|
||||
}
|
||||
.footer-btn {
|
||||
width: 100%;
|
||||
padding: 116px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #f3f6f9;
|
||||
z-index: 99;
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 92px;
|
||||
line-height: 92px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,643 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="po-f">
|
||||
<view class="nav-box flex-row">
|
||||
<view
|
||||
class="nav-item"
|
||||
:class="tabIndex == index ? 'active' : ''"
|
||||
v-for="(item, index) in tabList"
|
||||
:key="index"
|
||||
@click="tabClick(index)"
|
||||
>{{ item }}<span></span
|
||||
></view>
|
||||
</view>
|
||||
<div v-if="tabIndex == 0" class="header-tab">
|
||||
<div class="header-info" v-if="newsList.length">
|
||||
<span class="tips">公告</span>
|
||||
<div class="text-content">
|
||||
<u-notice-bar @click="noticeClick"
|
||||
mode="vertical"
|
||||
:list="newsList"
|
||||
:volume-icon="false"
|
||||
type="none"
|
||||
color="#333"
|
||||
></u-notice-bar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<p class="text">帖子列表</p>
|
||||
<!-- <div class="right-select" @click="showSelect=true">
|
||||
{{selectText}}<img src="../../static/img/right-icon-666.png" alt="" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tabIndex == 1" class="header-tab">
|
||||
<div class="header-info">活动报名大于{{num}}人时组团成功,人数不足时活动失效。</div>
|
||||
<div class="header-title">
|
||||
<p class="text">活动列表</p>
|
||||
<div class="right-select" @click="showSelect=true">
|
||||
{{selectText}}<img src="components/right-icon-666.png" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tabIndex == 2" class="header-tab">
|
||||
<!-- <AiHeaderSearchBar placeholder="请输入活动标题或者地点" barBgColor="#fff" inputBgColor="#F5F5F5" inputColor="#333" inputPlaceholderColor="#999" searchIconColor="#ccc" @change="search"></AiHeaderSearchBar> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-content">
|
||||
<div v-if="tabIndex == 0" :class="isPadding ? 'pad-t308' : 'pad-t200'">
|
||||
<div class="forum-list">
|
||||
<div class="forum-item" v-for="(item, index) in list" :key="index" @click="toBBSDetail(item.id)">
|
||||
<div class="user-info">
|
||||
<image :src="item.avatar" class="user-name-bg"></image>
|
||||
<div class="info">
|
||||
<div>{{ item.name }}</div>
|
||||
<p>{{ item.createTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="conent-text">{{ item.content }}</p>
|
||||
<div class="img-list" v-if="item.images.length">
|
||||
<image v-for="(img, i) in item.images" :key="i" :src="img.url" @click.stop="previewImage(item.images, img.url)" v-if="i<3"/>
|
||||
</div>
|
||||
<div class="bottom-icon">
|
||||
<div>
|
||||
<i class="iconfont"></i>
|
||||
<span>{{ item.viewNum }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<i class="iconfont"></i>
|
||||
<span>{{ item.replyNum }}</span>
|
||||
</div>
|
||||
<!-- <div @click.stop="support(item, index)">
|
||||
<AiIcon icon="iconpraiseactive2x" size="18" v-if="item.mySupport==1" style="vertical-align: middle;" />
|
||||
<i class="iconfont" v-else></i>
|
||||
<span>{{ item.supportNum }}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tabIndex == 1" class="pad-t308">
|
||||
<div class="active-list mar-t32">
|
||||
<div class="active-item" v-for="(item, index) in list" :key="index" @click="toActiveDetail(item)">
|
||||
<div class="img-div">
|
||||
<div class="status" :class="'status'+item.status">{{ $dict.getLabel('newActivityStatus', item.status) }}</div>
|
||||
<img :src="item.url" alt="">
|
||||
</div>
|
||||
<div class="right-info">
|
||||
<p class="title">{{ item.title }}</p>
|
||||
<div class="time"><span>{{ item.realNum }}人</span>已报名</div>
|
||||
<div class="time">{{ item.beginTime }} </div>
|
||||
<div class="time address">{{ item.address }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tabIndex == 2" class="pad-t200">
|
||||
<div class="active-list mar-t32">
|
||||
<div class="active-item" v-for="(item, index) in list" :key="index" @click="toActiveDetail(item)">
|
||||
<div class="img-div">
|
||||
<div class="status" :class="'status'+item.status">{{ $dict.getLabel('newActivityStatus', item.status) }}</div>
|
||||
<img :src="item.url" alt="">
|
||||
</div>
|
||||
<div class="right-info">
|
||||
<p class="title">{{ item.title }}</p>
|
||||
<div class="time"><span>{{ item.realNum }}人</span>已报名</div>
|
||||
<div class="time">{{ item.beginTime }} </div>
|
||||
<div class="time address">{{ item.address }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"/>
|
||||
</div>
|
||||
<u-select v-model="showSelect" mode="mutil-column-auto" :list="selectList" @confirm="confirmSelect" />
|
||||
<!-- <img src="../../static/img/add-icon.png" alt="" class="add-icon" @click="toAdd"> -->
|
||||
|
||||
<AiFixedBtn>
|
||||
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()" />
|
||||
</AiFixedBtn>
|
||||
|
||||
<u-back-top :scrollTop="scrollTop" :iconStyle="iconStyle" icon="arrow-up" :customStyle="customStyle" bottom="72" right="32"></u-back-top>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppActive',
|
||||
appName: '居民议事',
|
||||
components: {},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isMore: false,
|
||||
current: 0,
|
||||
pageShow: false,
|
||||
tabIndex: 0,
|
||||
tabList: ["论坛", "活动", "动态"],
|
||||
list: [],
|
||||
newsList: [],
|
||||
iconStyle: {
|
||||
fontSize: '56rpx',
|
||||
color: '#1365DD',
|
||||
fontWeight: '700'
|
||||
},
|
||||
customStyle: {
|
||||
width: '96rpx',
|
||||
height: '96rpx',
|
||||
backgroundColor: '#fff',
|
||||
boxShadow: '0px 8rpx 16rpx 0px rgba(0, 0, 0, 0.2)',
|
||||
},
|
||||
scrollTop: 0,
|
||||
supportFlag: true,
|
||||
num: '',
|
||||
title: '',
|
||||
selectText: '最新活动',
|
||||
showSelect: false,
|
||||
selectList: [{label: '最新活动'}, {label: '我的活动'}],
|
||||
noticeList: [],
|
||||
isPadding: false
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.tabIndex) {
|
||||
this.tabIndex = option.tabIndex
|
||||
}
|
||||
this.$dict.load(['newActivityStatus']).then(() => {
|
||||
this.getList()
|
||||
this.getActiveNum()
|
||||
})
|
||||
|
||||
uni.$on('refresh', () => {
|
||||
this.getListInit()
|
||||
})
|
||||
|
||||
this.getNewList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
search(v) {
|
||||
this.title = v
|
||||
this.getListInit()
|
||||
},
|
||||
confirmSelect(e) {
|
||||
this.selectText = e[0].label
|
||||
this.getListInit()
|
||||
},
|
||||
tabClick(index) {
|
||||
this.tabIndex = index
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
toBBSDetail (id) {
|
||||
uni.navigateTo({
|
||||
url: `./Detail?id=${id}`
|
||||
})
|
||||
},
|
||||
|
||||
toAdd () {
|
||||
if (this.tabIndex == 0) {
|
||||
uni.navigateTo({
|
||||
url: `./AddPosts`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `./AddActive`
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
previewImage (images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map(v => v.url),
|
||||
current: img
|
||||
})
|
||||
},
|
||||
|
||||
getListInit() {
|
||||
this.current = 0
|
||||
this.isMore = false
|
||||
this.getList()
|
||||
},
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
|
||||
this.$loading()
|
||||
let url = this.tabIndex == 0 ? `/app/apppostinfo/list` : `/app/appactivityinfo/list`
|
||||
let params = `&searchUserId=${this.user.partyId}`
|
||||
|
||||
if(this.tabIndex == 1 && this.selectText == '我的活动') { //我的活动
|
||||
params = `&createUserId=${this.user.partyId}`
|
||||
}
|
||||
if (this.tabIndex == 2) {
|
||||
params = `&status=5&title=${this.title}`
|
||||
}
|
||||
|
||||
|
||||
this.$http.post(`${url}?size=10¤t=${this.current + 1}${params}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (!this.current) {
|
||||
this.list = []
|
||||
}
|
||||
|
||||
if (!res.data.records.length) {
|
||||
this.$hideLoading()
|
||||
this.isMore = true
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
const data = res.data.records.map(item => {
|
||||
if (this.tabIndex == 0) {
|
||||
if (item.images) {
|
||||
item.images = JSON.parse(item.images)
|
||||
}
|
||||
}
|
||||
|
||||
return item
|
||||
})
|
||||
|
||||
this.list.push(...data)
|
||||
this.current = this.current + 1
|
||||
|
||||
this.$hideLoading()
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
} else {
|
||||
this.$hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
support(e, index) {
|
||||
if (this.supportFlag) {
|
||||
this.supportFlag = false;
|
||||
this.$http.post(`/app/apppostsupport/support`, {
|
||||
postId: e.id,
|
||||
createUserId: this.user.partyId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.supportFlag = true
|
||||
if(e.mySupport == 1) {
|
||||
this.list[index].mySupport = 0
|
||||
this.list[index].supportNum = this.list[index].supportNum-1
|
||||
}else {
|
||||
this.list[index].mySupport = 1
|
||||
this.list[index].supportNum = this.list[index].supportNum+1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
toActiveDetail(e) {
|
||||
uni.navigateTo({url: `./ActiveDetail?id=${e.id}`})
|
||||
},
|
||||
getActiveNum() {
|
||||
this.$http.post(`/app/appactivityconfig/queryDetail`).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.num = res.data.num
|
||||
}
|
||||
})
|
||||
},
|
||||
getNewList() {
|
||||
this.$http.post(`/app/apppolicypromotion/listWechat`, {
|
||||
type: 3,
|
||||
areaId: this.$areaId,
|
||||
current: 1,
|
||||
size: 5
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
if(res.data && res.data.records.length) {
|
||||
this.isPadding = true
|
||||
this.noticeList = res.data.records
|
||||
res.data.records.map((item) => {
|
||||
this.newsList.push(item.title)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
noticeClick(e) {
|
||||
console.log(e)
|
||||
this.linkTo(`./notice?id=${this.noticeList[0].id}`)
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom (){
|
||||
this.getList()
|
||||
},
|
||||
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.po-f{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
}
|
||||
.pad-t200{
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
.pad-t308{
|
||||
padding-top: 308rpx;
|
||||
}
|
||||
.header-tab{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.list-content{
|
||||
// padding-top: 96px;
|
||||
}
|
||||
|
||||
.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;
|
||||
background: #fff;
|
||||
color: #1365dd;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-box {
|
||||
background-color: #3671ee;
|
||||
height: 96px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
.active {
|
||||
display: block;
|
||||
position: relative;
|
||||
span {
|
||||
position: absolute;
|
||||
top: 78px;
|
||||
left: 50%;
|
||||
margin-left: -20px;
|
||||
width: 40px;
|
||||
height: 4px;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
color: #ffffff;
|
||||
font-size: 28px;
|
||||
line-height: 96px;
|
||||
text-align: center;
|
||||
}
|
||||
.header-info {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background: #fefaea;
|
||||
color: #FFA13E;
|
||||
font-size: 28px;
|
||||
.tips {
|
||||
display: inline-block;
|
||||
width: 104px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
background: #ffa13e;
|
||||
border-radius: 16px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
vertical-align: top;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.text-content {
|
||||
display: inline-block;
|
||||
width: calc(100% - 122px);
|
||||
margin-top: -10px;
|
||||
}
|
||||
}
|
||||
.header-title {
|
||||
width: 100%;
|
||||
height: 108px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #f3f6f9;
|
||||
.text {
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
}
|
||||
.right-select {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
line-height: 36px;
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
.forum-item{
|
||||
padding: 26px 30px 28px;
|
||||
background-color: #fff;
|
||||
.user-info{
|
||||
display: flex;
|
||||
margin-bottom: 32px;
|
||||
.user-name-bg{
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
background: #4E8EEE;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
margin-right: 16px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.info{
|
||||
div{
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 26px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
p{
|
||||
font-size: 22px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.conent-text{
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 42px;
|
||||
word-break: break-all;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 4;
|
||||
line-clamp: 4;
|
||||
-webkit-box-orient: vertical;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.img-list{
|
||||
image {
|
||||
width: 224px;
|
||||
height: 224px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
img:nth-of-type(3n){
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.bottom-icon{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.iconfont{
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
span{
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.active-item{
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
width: 686px;
|
||||
background: #FFF;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.02);
|
||||
border-radius: 4px;
|
||||
margin: 0 0 32px 32px;
|
||||
box-sizing: border-box;
|
||||
.img-div{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin-right: 24px;
|
||||
position: relative;
|
||||
img{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.status{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 44px;
|
||||
padding: 0 8px;
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #FFF;
|
||||
}
|
||||
.status0{
|
||||
background: #000;
|
||||
}
|
||||
.status1{
|
||||
background: #FF883C;
|
||||
}
|
||||
.status3{
|
||||
background: #1AAAFF;
|
||||
}
|
||||
.status2{
|
||||
background: #42D784;
|
||||
}
|
||||
.status4, .status5{
|
||||
background: #E4E4E4;
|
||||
}
|
||||
}
|
||||
.right-info{
|
||||
width: calc(100% - 224px);
|
||||
.title{
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
word-break: break-all;
|
||||
margin-bottom: 8px;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.time{
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #666;
|
||||
line-height: 36px;
|
||||
margin-bottom: 4px;
|
||||
word-break: break-all;
|
||||
span{
|
||||
color: #3376FD;
|
||||
}
|
||||
}
|
||||
.address{
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add-icon{
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
bottom: 160px;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
}
|
||||
.mar-t32{
|
||||
margin-top: 32px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,387 +0,0 @@
|
||||
<template>
|
||||
<div class="page" v-if="pageShow">
|
||||
<div class="header">
|
||||
<div class="user-info">
|
||||
<image class="user-name-bg" :src="info.avatar" />
|
||||
<div class="info">
|
||||
<div>{{ info.name }}</div>
|
||||
<p>{{ info.createTime }}<span v-if="info.userId == user.id" @click="del">删除帖子</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-content">{{ info.content }}</p>
|
||||
<div class="img-list" v-if="info.images.length">
|
||||
<img :src="item.url" :key="index" v-for="(item, index) in info.images" @click.stop="previewImage(info.images, item.url)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="reply-list">
|
||||
<div class="item" v-for="(item, index) in info.replyList" :key="index" @click="replyClick(item)">
|
||||
<div class="user-img">
|
||||
<img :src="item.headPortrait" alt="" />
|
||||
</div>
|
||||
<div class="item-info">
|
||||
<div class="user-info">
|
||||
<span class="user-name">{{ item.createUserName }}</span>
|
||||
<span class="time">{{ item.createTime }}</span>
|
||||
</div>
|
||||
<p class="text">
|
||||
<span v-if="item.lastReplyName"
|
||||
>回复<span class="color-365D92">{{ item.lastReplyName }}</span></span
|
||||
>{{ item.content }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="reply-bottom">
|
||||
<div class="input" @click="showReply = true">我来说两句…</div>
|
||||
<div class="support" @click="support()">
|
||||
<!-- <AiIcon icon="iconpraiseactive2x" size="18" v-if="info.mySupport == 1" style="vertical-align: middle" />
|
||||
<i class="iconfont" v-else></i>赞 -->
|
||||
</div>
|
||||
</div>
|
||||
<u-popup v-model="showReply" mode="bottom">
|
||||
<div class="reply-content">
|
||||
<u-input v-model.trim="content" type="textarea" :height="144" :auto-height="true" placeholder="写下你的想法…" placeholder-style="color:#999999;font-size:24rpx;" maxlength="1000" />
|
||||
<div class="btn">
|
||||
<span class="clear" @click="content = ''">清空内容</span>
|
||||
<span class="confirm" @click="confirmReply()">发表</span>
|
||||
</div>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'Detail',
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
pageShow: false,
|
||||
id: '',
|
||||
supportFlag: true,
|
||||
showReply: false,
|
||||
content: '',
|
||||
lastReplyId: '',
|
||||
lastReplyName: '',
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.id = query.id
|
||||
this.getInfo()
|
||||
uni.$emit('refresh')
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo() {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/apppostinfo/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
|
||||
if (res.data.images) {
|
||||
this.info.images = JSON.parse(res.data.images)
|
||||
} else {
|
||||
this.info.images = []
|
||||
}
|
||||
if (res.data.replyList.length) {
|
||||
res.data.replyList.map((item) => {
|
||||
item.createTime = item.createTime.substring(0, 19)
|
||||
})
|
||||
}
|
||||
document.title = this.info.userId == this.user.id ? '我的帖子' : 'Ta的帖子'
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
support() {
|
||||
if (this.supportFlag) {
|
||||
this.supportFlag = false
|
||||
this.$http
|
||||
.post(`/app/apppostsupport/support`, {
|
||||
postId: this.id,
|
||||
createUserId: this.user.partyId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
uni.$emit('refresh')
|
||||
this.supportFlag = true
|
||||
if (this.info.mySupport == 1) {
|
||||
this.info.mySupport = 0
|
||||
} else {
|
||||
this.info.mySupport = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
confirmReply() {
|
||||
if (!this.content) {
|
||||
return this.$toast('请输入回复内容')
|
||||
}
|
||||
var params = {
|
||||
postId: this.id,
|
||||
content: this.content,
|
||||
createUserId: this.user.partyId,
|
||||
createUserName: this.user.realName,
|
||||
headPortrait: this.user.avatarUrl,
|
||||
lastReplyId: this.lastReplyId ? this.lastReplyId : '',
|
||||
lastReplyName: this.lastReplyName ? this.lastReplyName : '',
|
||||
}
|
||||
this.$http.post(`/app/apppostreply/addOrUpdate`, params).then((res) => {
|
||||
if (res.code == 0) {
|
||||
uni.$emit('refresh')
|
||||
this.$toast('提交成功')
|
||||
this.lastReplyId = ''
|
||||
this.lastReplyName = ''
|
||||
this.content = ''
|
||||
this.showReply = false
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
replyClick(e) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `是否回复${e.createUserName}的评论?`,
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.$emit('refresh')
|
||||
this.showReply = true
|
||||
this.lastReplyId = e.id
|
||||
this.lastReplyName = e.createUserName
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
del() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `是否删除该帖子?`,
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.confirmDel()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
confirmDel() {
|
||||
this.$http.post(`/app/apppostinfo/delete?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$toast('删除成功')
|
||||
setTimeout(() => {
|
||||
uni.$emit('refresh')
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
},
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map((v) => v.url),
|
||||
current: img,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f6f7f9;
|
||||
}
|
||||
.color-365D92 {
|
||||
color: #365d92;
|
||||
}
|
||||
.header {
|
||||
background-color: #fff;
|
||||
padding: 26px 30px 32px;
|
||||
.user-info {
|
||||
display: flex;
|
||||
margin-bottom: 32px;
|
||||
.user-name-bg {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
background: #4e8eee;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
margin-right: 16px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.info {
|
||||
div {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 26px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
p {
|
||||
font-size: 22px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 22px;
|
||||
}
|
||||
span {
|
||||
color: #3376fd;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.text-content {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 42px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.img-list {
|
||||
margin-top: 16px;
|
||||
img {
|
||||
width: 224px;
|
||||
height: 224px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
img:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply-list {
|
||||
padding: 0 32px 112px;
|
||||
.item {
|
||||
display: flex;
|
||||
padding: 32px 0;
|
||||
border-bottom: 2px solid #eee;
|
||||
.user-img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-right: 24px;
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.item-info {
|
||||
width: calc(100% - 116px);
|
||||
}
|
||||
.user-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
.user-name {
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #365d92;
|
||||
line-height: 42px;
|
||||
}
|
||||
.time {
|
||||
font-size: 22px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 42px;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply-bottom {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 104px;
|
||||
padding: 22px 30px 24px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 58px;
|
||||
.input {
|
||||
display: inline-block;
|
||||
width: 580px;
|
||||
height: 58px;
|
||||
line-height: 58px;
|
||||
text-align: center;
|
||||
background: #f0f0f0;
|
||||
border-radius: 30px;
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #666;
|
||||
margin-right: 42px;
|
||||
}
|
||||
.support {
|
||||
display: inline-block;
|
||||
}
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
font-size: 36px;
|
||||
color: #333;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
.reply-content {
|
||||
width: 100%;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
::v-deep .u-input {
|
||||
background-color: #f7f7f7 !important;
|
||||
border-radius: 8px !important;
|
||||
padding: 24px !important;
|
||||
font-size: 26px !important;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 24px 0;
|
||||
span {
|
||||
line-height: 64px;
|
||||
}
|
||||
.clear {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #666;
|
||||
}
|
||||
.confirm {
|
||||
width: 144px;
|
||||
height: 64px;
|
||||
text-align: center;
|
||||
background: #135ab8;
|
||||
border-radius: 32px;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,164 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<!-- <div class="title">已签到(2)</div>
|
||||
<div class="user-list">
|
||||
<div class="item">
|
||||
<div class="item-border">
|
||||
<div class="left">
|
||||
<span class="user-name-bg">李毅</span>李毅
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>157****8456</span>
|
||||
<img src="../../static/img/phone-icon.png" alt="">
|
||||
<img src="../../static/img/del-icon.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">未签到(3)</div> -->
|
||||
<div class="user-list" v-for="(item, index) in list" :key="index">
|
||||
<div class="item">
|
||||
<div class="item-border">
|
||||
<div class="left">
|
||||
<span class="user-name-bg">{{$formatName(item.name)}}</span>{{item.name}}
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>{{formatPhone(item.phone)}}</span>
|
||||
<img src="components/phone-icon.png" alt="" v-if="isAdmin" @click="callPhone(item.phone)">
|
||||
<img src="components/del-icon.png" alt="" v-if="isAdmin && status < 2" @click="del(item.id)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无活动报名人员" v-if="!list.length" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAdmin: 0,
|
||||
id: '',
|
||||
list: [],
|
||||
status: 0
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.isAdmin = option.isAdmin
|
||||
this.status = Number(option.status)
|
||||
console.log(option)
|
||||
this.getUserList()
|
||||
},
|
||||
methods: {
|
||||
getUserList() {
|
||||
this.$http.post(`/app/appactivityuser/list?activityId=${this.id}&status=1`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.list = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
formatPhone(value) {
|
||||
const start = value.slice(0, 3)
|
||||
const end = value.slice(-4)
|
||||
return `${start}****${end}`
|
||||
},
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({phoneNumber: phone})
|
||||
},
|
||||
del(id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `是否删除该报名人?`,
|
||||
confirmText: "确定",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.confirmDel(id)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmDel(id) {
|
||||
this.$http.post(`/app/appactivityuser/removeReport`, {
|
||||
id: id
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$toast('删除成功')
|
||||
this.getUserList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.title{
|
||||
width: 100%;
|
||||
height: 108px;
|
||||
line-height: 108px;
|
||||
background: #FFF;
|
||||
padding-left: 32px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.item{
|
||||
padding: 0 32px;
|
||||
background-color: #fff;
|
||||
.item-border{
|
||||
border-bottom: 2px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px 0;
|
||||
.left{
|
||||
line-height: 80px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
.user-name-bg{
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #4E8EEE;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
span{
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 80px;
|
||||
}
|
||||
img{
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 50%;
|
||||
margin-left: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.iconfont{
|
||||
display: inline-block;
|
||||
font-size: 26px;
|
||||
color: #3671EE;
|
||||
}
|
||||
.bg-blue{
|
||||
// width: 56px;
|
||||
// height: 56px;
|
||||
// background: #EAF0FD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 267 B |
Reference in New Issue
Block a user