ct
This commit is contained in:
@@ -42,10 +42,10 @@
|
|||||||
<div class="items" v-for="(item, index) in list" :key="index">
|
<div class="items" v-for="(item, index) in list" :key="index">
|
||||||
<img src="./img/22.png" alt="" @click="del(index)" />
|
<img src="./img/22.png" alt="" @click="del(index)" />
|
||||||
<div class="rightopts">
|
<div class="rightopts">
|
||||||
<u-input v-model="item.content" placeholder="选项" maxlength="200" :clearable="false" />
|
<u-input :height="40" type="textarea" v-model="item.content" placeholder="选项" maxlength="200" :clearable="false" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" @click="addOpts">
|
<div class="items" style="padding-top: 20px" @click="addOpts">
|
||||||
<img src="./img/11.png" alt="" />
|
<img src="./img/11.png" alt="" />
|
||||||
|
|
||||||
<div class="addopts">添加选项</div>
|
<div class="addopts">添加选项</div>
|
||||||
@@ -144,10 +144,6 @@ export default {
|
|||||||
if (!this.form.discussDeadline) {
|
if (!this.form.discussDeadline) {
|
||||||
return this.$u.toast('请选择议事截止时间')
|
return this.$u.toast('请选择议事截止时间')
|
||||||
}
|
}
|
||||||
if (!this.form.publicityDeadline) {
|
|
||||||
return this.$u.toast('请选择公示截止时间')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.type === '1') {
|
if (this.form.type === '1') {
|
||||||
if (!this.list.length) {
|
if (!this.list.length) {
|
||||||
return this.$u.toast('请添加选项')
|
return this.$u.toast('请添加选项')
|
||||||
@@ -209,7 +205,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
areaSelect(e) {
|
areaSelect(e) {
|
||||||
console.log(e)
|
|
||||||
this.form.areaId = e
|
this.form.areaId = e
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -319,11 +314,16 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 40px 0 32px !important;
|
padding: 20px 40px 0 !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120px;
|
// height: 120px;
|
||||||
line-height: 120px;
|
// line-height: 120px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
::v-deep .u-input__textarea {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|||||||
@@ -36,8 +36,11 @@
|
|||||||
<b v-text="op.createUserName" />
|
<b v-text="op.createUserName" />
|
||||||
<span class="tags">{{ data.createUserId === op.createUserId ? '话事人' : '居民' }}</span>
|
<span class="tags">{{ data.createUserId === op.createUserId ? '话事人' : '居民' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<u-icon name="thumb-up" :label="op.suport" :color="op.isSuport ? 'red' : '#ccc'" @click="like(op.id)" />
|
<u-icon name="thumb-up" :label="op.suport" :color="op.isSuport ? 'red' : '#ccc'" @click="like(op.id)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="content" v-text="op.content" @click="adddeleShow(op.id)" />
|
||||||
|
|
||||||
<div class="content" v-text="op.content" />
|
<div class="content" v-text="op.content" />
|
||||||
<div class="content color-999" v-text="op.createTime" />
|
<div class="content color-999" v-text="op.createTime" />
|
||||||
</div>
|
</div>
|
||||||
@@ -57,7 +60,7 @@
|
|||||||
<div class="vote-item" v-for="(item, index) in data.voteList" :key="index">
|
<div class="vote-item" v-for="(item, index) in data.voteList" :key="index">
|
||||||
<span>{{ item.content }}</span>
|
<span>{{ item.content }}</span>
|
||||||
<i>{{ item.count }}</i>
|
<i>{{ item.count }}</i>
|
||||||
<em :style="{width: item.percentage}"></em>
|
<em :style="{ width: item.percentage }"></em>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,6 +82,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<u-popup v-model="deleShow" mode="bottom" class="popupdele">
|
||||||
|
<div class="dele" @click="modalShow = true">删除</div>
|
||||||
|
<div @click="deleShow = false">取消</div>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<u-modal v-model="modalShow" content="确定删除该留言" @confirm="confirmDelete"></u-modal>
|
||||||
|
|
||||||
<div class="end-btn" hover-class="text-hover" v-if="data.status === '1'" @click="handleComplete">结束公示</div>
|
<div class="end-btn" hover-class="text-hover" v-if="data.status === '1'" @click="handleComplete">结束公示</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -98,7 +108,11 @@ export default {
|
|||||||
content: '',
|
content: '',
|
||||||
flag: false,
|
flag: false,
|
||||||
pageShow: false,
|
pageShow: false,
|
||||||
isAnnouncer: false
|
isAnnouncer: false,
|
||||||
|
deleShow: false,
|
||||||
|
modalShow: false,
|
||||||
|
deleId: '',
|
||||||
|
isAnnouncer: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -120,53 +134,58 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getDetail() {
|
getDetail() {
|
||||||
this.$loading()
|
this.$loading()
|
||||||
this.$http.post(`/app/appvillagediscuss/queryDetailById?id=${this.id}`).then((res) => {
|
this.$http
|
||||||
if (res?.data) {
|
.post(`/app/appvillagediscuss/queryDetailById?id=${this.id}`)
|
||||||
this.data = {
|
.then((res) => {
|
||||||
...res.data,
|
if (res?.data) {
|
||||||
avatar: res.data.createUserName?.substr(0, 2) || '游客',
|
this.data = {
|
||||||
messages: res.data.messages ? res.data.messages.map(v => {
|
...res.data,
|
||||||
return {
|
avatar: res.data.createUserName?.substr(0, 2) || '游客',
|
||||||
...v,
|
messages: res.data.messages
|
||||||
isSuport: v.suportUser ? v.suportUser.indexOf(this.user.id) > -1 : false
|
? res.data.messages.map((v) => {
|
||||||
}
|
return {
|
||||||
}) : []
|
...v,
|
||||||
}
|
isSuport: v.suportUser ? v.suportUser.indexOf(this.user.id) > -1 : false,
|
||||||
this.data.images = JSON.parse(res.data.images)
|
}
|
||||||
this.isAnnouncer = this.user.id === res.data.createUserId
|
})
|
||||||
|
: [],
|
||||||
|
}
|
||||||
|
this.data.images = JSON.parse(res.data.images)
|
||||||
|
this.isAnnouncer = this.user.id === res.data.createUserId
|
||||||
|
|
||||||
var discussTime = (new Date(res.data.discussDeadline).getTime() * 1) / 1000
|
var discussTime = (new Date(res.data.discussDeadline).getTime() * 1) / 1000
|
||||||
var nowTime = (new Date().getTime() * 1) / 1000
|
var nowTime = (new Date().getTime() * 1) / 1000
|
||||||
if (discussTime >= nowTime) {
|
if (discussTime >= nowTime) {
|
||||||
this.timestamp = discussTime - nowTime
|
this.timestamp = discussTime - nowTime
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.type === '1') {
|
if (res.data.type === '1') {
|
||||||
const total = Object.values(res.data.statistic).reduce((x, y) => {
|
const total = Object.values(res.data.statistic).reduce((x, y) => {
|
||||||
return x + y
|
return x + y
|
||||||
})
|
})
|
||||||
this.data.voteList = res.data.voteItems.map(v => {
|
this.data.voteList = res.data.voteItems.map((v) => {
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
count: res.data.statistic[v.item],
|
count: res.data.statistic[v.item],
|
||||||
percentage: (res.data.statistic[v.item] / total) * 100 + '%'
|
percentage: (res.data.statistic[v.item] / total) * 100 + '%',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$hideLoading()
|
||||||
|
this.pageShow = true
|
||||||
|
} else {
|
||||||
|
this.$hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
this.$hideLoading()
|
this.$hideLoading()
|
||||||
this.pageShow = true
|
})
|
||||||
} else {
|
|
||||||
this.$hideLoading()
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.$hideLoading()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
like (id) {
|
like(id) {
|
||||||
this.$loading()
|
this.$loading()
|
||||||
this.$http.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`).then(res => {
|
this.$http.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`).then((res) => {
|
||||||
this.$hideLoading()
|
this.$hideLoading()
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$u.toast('点赞成功')
|
this.$u.toast('点赞成功')
|
||||||
@@ -177,12 +196,29 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$u.toast(res.msg)
|
this.$u.toast(res.msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((e) => {
|
|
||||||
this.$hideLoading()
|
|
||||||
this.$u.toast(e)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
adddeleShow(id) {
|
||||||
|
this.deleId = id
|
||||||
|
this.deleShow = true
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmDelete() {
|
||||||
|
this.$http
|
||||||
|
.post(`/app/appvillagediscussmessage/delete?ids=${this.deleId}`)
|
||||||
|
.then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.deleShow = false
|
||||||
|
this.modalShow = false
|
||||||
|
this.deleId = ''
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
this.$hideLoading()
|
||||||
|
this.$u.toast(e)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
publish() {
|
publish() {
|
||||||
if (this.flag) return
|
if (this.flag) return
|
||||||
@@ -201,7 +237,7 @@ export default {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
this.$u.toast('留言成功')
|
this.$u.toast('留言成功')
|
||||||
this.flag = true
|
this.flag = false
|
||||||
this.content = ''
|
this.content = ''
|
||||||
this.showBottomInput = false
|
this.showBottomInput = false
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
@@ -251,15 +287,17 @@ export default {
|
|||||||
handleComplete() {
|
handleComplete() {
|
||||||
this.$confirm('是否要结束公示')
|
this.$confirm('是否要结束公示')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$http.post('/app/appvillagediscuss/finishPublic', {
|
this.$http
|
||||||
status: '2',
|
.post('/app/appvillagediscuss/finishPublic', {
|
||||||
id: this.id
|
status: '2',
|
||||||
}).then((res) => {
|
id: this.id,
|
||||||
if (res?.code == 0) {
|
})
|
||||||
this.$u.toast('已结束公示!')
|
.then((res) => {
|
||||||
this.getDetail()
|
if (res?.code == 0) {
|
||||||
}
|
this.$u.toast('结束公示成功!')
|
||||||
})
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => 0)
|
.catch(() => 0)
|
||||||
},
|
},
|
||||||
@@ -282,7 +320,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
background: #1365DD;
|
background: #1365dd;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.detail-active {
|
&.detail-active {
|
||||||
@@ -377,7 +415,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
background: #1AAAFF;
|
background: #1aaaff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,10 +437,10 @@ export default {
|
|||||||
line-height: 64px;
|
line-height: 64px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
background: #FFFFFF;
|
background: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid #95CBFF;
|
border: 1px solid #95cbff;
|
||||||
|
|
||||||
em {
|
em {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -410,13 +448,13 @@ export default {
|
|||||||
top: 0;
|
top: 0;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #DCE8F4;
|
background: #dce8f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
color: #5B84B3;
|
color: #5b84b3;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +462,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
color: #5B84B3;
|
color: #5b84b3;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -494,7 +532,7 @@ export default {
|
|||||||
.u-input {
|
.u-input {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
border-radius: 8px 8px 0 0;
|
border-radius: 8px 8px 0 0;
|
||||||
padding: 10px!important;
|
padding: 10px !important;
|
||||||
margin: 0 30px 0 30px;
|
margin: 0 30px 0 30px;
|
||||||
.uni-textarea-placeholder {
|
.uni-textarea-placeholder {
|
||||||
padding: 16px 0 0 16px;
|
padding: 16px 0 0 16px;
|
||||||
@@ -534,6 +572,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popupdele {
|
||||||
|
::v-deep .u-drawer-content {
|
||||||
|
text-align: center;
|
||||||
|
div {
|
||||||
|
padding: 5px 0;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ::v-deep .u-drawer {
|
// ::v-deep .u-drawer {
|
||||||
// .u-drawer-content {
|
// .u-drawer-content {
|
||||||
// .u-drawer__scroll-view {
|
// .u-drawer__scroll-view {
|
||||||
|
|||||||
Reference in New Issue
Block a user