网格动态

This commit is contained in:
liuye
2024-10-11 11:09:46 +08:00
parent aa87c92e25
commit c18c183153
3 changed files with 231 additions and 262 deletions

View File

@@ -41,6 +41,7 @@ export default {
files: [], files: [],
lat: '', lat: '',
lng: '', lng: '',
address: '',
girdCode: '', girdCode: '',
girdName: '', girdName: '',
girdId: '', girdId: '',
@@ -102,6 +103,11 @@ export default {
success: res => { success: res => {
this.forms.lng = res.longitude this.forms.lng = res.longitude
this.forms.lat = res.latitude this.forms.lat = res.latitude
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
if (res.code === 0) {
this.forms.address = res.data.result.address
}
})
}, },
error: err => { error: err => {
console.log(err) console.log(err)

View File

@@ -2,10 +2,6 @@
<template> <template>
<div class="AppFormReview"> <div class="AppFormReview">
<AiTopFixed v-if="tabs.length"> <AiTopFixed v-if="tabs.length">
<!-- <div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index"
@click="tabClick(index, item)">{{ item.name }}<span></span></div>
</div> -->
<u-search class="serach_content" placeholder="请输入内容" :show-action="false" v-model="keyword" @clear="clearSearch" <u-search class="serach_content" placeholder="请输入内容" :show-action="false" v-model="keyword" @clear="clearSearch"
@search="getListInit"></u-search> @search="getListInit"></u-search>
<div class="select-top"> <div class="select-top">
@@ -20,44 +16,24 @@
<u-select v-model="showType" :list="typeList" value-name="dictValue" label-name="dictName" @confirm="confirmType"></u-select> <u-select v-model="showType" :list="typeList" value-name="dictValue" label-name="dictName" @confirm="confirmType"></u-select>
</div> </div>
</AiTopFixed> </AiTopFixed>
<template v-if="datas.length > 0"> <div class="user-list">
<AiCard v-for="(item, i) in datas" :ref="item.id" :key="i" @click.native="toDetail(item)"> <div class="item" v-for="(item, index) in datas" :key="index" @click="toDetail(item)">
<template #custom> <div class="item-top">
<div class="titles">{{ item.content }}</div> <div class="title">{{item.content}}</div>
<!-- <p class="item-content"> <div class="info">所属网格{{item.girdName}}</div>
<u-parse :html="item.content"></u-parse> <div class="info">类型{{$dict.getLabel('wyGirdNewsType', item.type)}}</div>
</p> --> <div class="info">网格员姓名{{item.name}}</div>
<div class="img-list" v-if="item.files.length"> </div>
<img :src="items.accessUrl" alt="" v-for="(items, index) in item.files" :key="index" v-if="index < 3" <div class="item-bottom">
@click.stop="previewImage(item.files, items.accessUrl)"/> <div class="status" :class="`status${item.status}`">{{$dict.getLabel('auditStatus', item.status)}}</div>
</div> <div class="time">{{item.createTime}}</div>
<div class="flex"> </div>
<span class="left"> </div>
<span class="type">{{ $dict.getLabel('wyGirdNewsType', item.type) }}</span> <AiEmpty v-if="!datas.length"></AiEmpty>
<span class="times">{{ item.name }}</span> </div>
</span>
<!-- <span class="right">
<img src="./img/view-icon.png" alt="">
<span>{{ item.viewCount }}</span>
</span> -->
</div>
</template>
<template #menu v-if="item.girdMemberId == user.girdMemberId">
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<AiFixedBtn> <AiFixedBtn>
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()"/> <div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()"/>
</AiFixedBtn> </AiFixedBtn>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true"
:show-title="false" @confirm="delet"></u-modal>
</div> </div>
</template> </template>
@@ -76,7 +52,6 @@ export default {
current: 1, current: 1,
size: 10, size: 10,
pages: 0, pages: 0,
deletShow: false,
tabs: [{name: '全部'}, {name: '我发布的'}], tabs: [{name: '全部'}, {name: '我发布的'}],
tabIndex: 0, tabIndex: 0,
searchGrid: {}, searchGrid: {},
@@ -92,7 +67,7 @@ export default {
onLoad() { onLoad() {
this.searchGrid.girdId = this.user.girdId this.searchGrid.girdId = this.user.girdId
this.searchGrid.girdName = this.user.girdName this.searchGrid.girdName = this.user.girdName
this.$dict.load(['wyGirdNewsType']).then(() => { this.$dict.load(['wyGirdNewsType', 'auditStatus']).then(() => {
this.typeList = this.$dict.getDict('wyGirdNewsType') this.typeList = this.$dict.getDict('wyGirdNewsType')
this.typeList.unshift({dictName: '全部', dictValue: ''}) this.typeList.unshift({dictName: '全部', dictValue: ''})
this.getList() this.getList()
@@ -148,22 +123,6 @@ export default {
uni.navigateTo({url: `./Detail?id=${row.id}`}) uni.navigateTo({url: `./Detail?id=${row.id}`})
}, },
toDetele(item) {
this.deletShow = true
this.deletId = item.id
this.$refs?.[item.id]?.[0]?.handleClose()
},
delet() {
this.$http.post(`/app/appgirdnews/delete?id=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.current = 1
this.$u.toast('删除成功!')
this.getListInit()
}
})
},
handleSelectGird(v) { handleSelectGird(v) {
console.log(v) console.log(v)
this.searchGrid = v this.searchGrid = v
@@ -261,116 +220,56 @@ export default {
margin-bottom: 0!important; margin-bottom: 0!important;
} }
::v-deep .AiCard { .user-list {
background: #f3f6f9; padding: 24px 32px 0 32px;
position: relative; box-sizing: border-box;
.item {
.start { width: 100%;
background: #fff; background: #FFF;
padding: 32px;
border-radius: 16px; border-radius: 16px;
margin-bottom: 24px;
.titles { .item-top {
width: 600px; padding: 24px;
font-size: 32px; .title {
font-weight: 500; line-height: 48px;
color: #333333; font-family: PingFangSC-Medium;
margin-bottom: 16px; font-weight: 500;
line-height: 50px; font-size: 34px;
word-break: break-all; color: #333;
} margin-bottom: 12px;
word-break: break-all;
.item-content { overflow: hidden;
width: 100%; text-overflow: ellipsis;
word-break: break-all; display: -webkit-box;
overflow: hidden; -webkit-line-clamp: 3;
text-overflow: ellipsis; -webkit-box-orient: vertical;
display: -webkit-box; }
-webkit-line-clamp: 3; .info {
-webkit-box-orient: vertical; line-height: 48px;
font-size: 32px; font-family: PingFangSC-Regular;
font-family: PingFangSC-Regular, PingFang SC; font-size: 26px;
color: #999; color: #666;
line-height: 44px;
margin-bottom: 24px;
}
.img-list {
margin-bottom: 24px;
img {
width: calc(33% - 16px);
height: 204px;
margin: 0 16px 8px 0;
} }
} }
.item-bottom {
.flex { padding: 18px 24px;
border-top: 1px solid #E4E5E6;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.time {
.left { line-height: 48px;
.garydiv { font-family: PingFangSC-Regular;
font-size: 28px; font-size: 24px;
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; color: #999;
img {
width: 32px;
height: 32px;
vertical-align: middle;
margin-right: 8px;
}
.font {
color: #4181ff;
}
} }
} .status0{
color: #FF883C;
.iconfont-iconMore { }
position: absolute; .status1{
top: 42px; color: #2EA222;
right: 32px; }
} .status2{
} color: #F46;
.mask {
.moreMenu {
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
} }
} }
} }

View File

@@ -1,32 +1,54 @@
<template> <template>
<div class="Detail"> <div class="Detail">
<div class="header-top"> <div class="header-top">
<div class="titles">{{ data.content }}</div> <div class="avatars" v-if="data.name">{{ data.name.substring(data.name.length, data.name.length - 2) }}</div>
<div class="flex"> <div class="right">
<span class="left"> <div class="names">{{ data.name }}的上报</div>
<span class="type">{{ $dict.getLabel('wyGirdNewsType', data.type) }}</span> <div class="times">{{ data.createTime }}</div>
<span class="times">{{ data.name }}</span> <!-- <span class="edit-btn" @click="toEdit()" v-if="data.eventStatus != 2 && data.eventStatus != 3">编辑</span> -->
</span>
</div> </div>
</div> </div>
<div class="img-list" v-if="data.files"> <div class="header-middle">
<div class="title">图片</div> <div class="titles">{{ data.content }}</div>
<img :src="item.accessUrl" alt="" v-for="(item, index) in data.files" :key="index" @click="previewImage(data.files, item.accessUrl)" /> <span class="status" :class="`status${data.status}`">{{$dict.getLabel('auditStatus', data.status)}}</span>
<div class="card">
<span class="card-left">所属网格</span>
<span class="card-right">{{data.girdName}}</span>
</div>
<div class="card">
<span class="card-left">类型</span>
<span class="card-right">{{$dict.getLabel('wyGirdNewsType', data.type)}}</span>
</div>
<div class="cards" v-if="data.files && data.files.length">
<span class="card-left" style="color:#999">图片</span>
</div>
<img :src="item.url" alt="" v-for="(item, i) in data.files" :key="i" @click="previewImage(data.files, item.accessUrl)"/>
</div> </div>
<div class="footer-btn" v-if="data.status == 0 && user.girdMemberId == data.girdMemberId">
<div class="btn" @click="deletShow=true">删除</div>
</div>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true"
:show-title="false" @confirm="confirm"></u-modal>
</div> </div>
</template> </template>
<script> <script>
import {mapState} from 'vuex'
export default { export default {
name: 'Detail', name: 'Detail',
data() { data() {
return { return {
data: {}, data: {},
id: '', id: '',
listName: '', selectList: [],
selectList: [] deletShow: false,
} }
}, },
computed: {
...mapState(['user']),
},
onLoad(o) { onLoad(o) {
this.id = o.id this.id = o.id
this.$dict.load(['wyGirdNewsType']).then(() => { this.$dict.load(['wyGirdNewsType']).then(() => {
@@ -51,127 +73,169 @@ export default {
} }
}) })
}, },
confirm() {
this.$http.post(`/app/appgirdnews/delete?id=${this.id}`).then((res) => {
if (res.code == 0) {
uni.$emit('update')
this.$u.toast('删除成功!')
setTimeout(() => {
uni.navigateBack()
}, 500);
}
})
},
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
uni-page-body {
height: 100%;
padding-top: 26px;
}
.Detail { .Detail {
height: 100%; height: 100%;
padding: 0 32px;
background: #fff;
.header-top { .header-top {
padding: 40px 0 32px 0; background-color: #fff;
display: flex;
padding: 32px 32px 0;
.titles { .avatars {
font-size: 48px; width: 80px;
font-weight: 600; height: 80px;
width: 100%; line-height: 80px;
font-family: PingFangSC-Semibold, PingFang SC; background: #3975c6;
color: #333; border-radius: 50%;
line-height: 66px; color: #fff;
word-break: break-all; text-align: center;
margin-bottom: 16px; font-size: 28px;
font-weight: 500;
margin-right: 16px;
} }
.titles-bottom { .right {
margin-top: 16px; .names {
font-size: 30px; font-size: 32px;
color: #999999; font-weight: 500;
}
.to-left { .times {
margin-left: 32px; margin-top: 10px;
font-size: 28px;
color: #999999;
}
.edit-btn {
position: absolute;
color: #197df0;
top: 32px;
right: 32px;
width: 150px;
height: 44px;
line-height: 44px;
text-align: right;
} }
} }
} }
.header-middle { .header-middle {
padding: 64px 0 48px 0; padding: 0 32px 180px 32px;
background: inherit; background: #fff;
.contsnts { .titles {
font-size: 36px; padding: 32px 0;
line-height: 1.5; line-height: 1.4;
word-break: break-all; word-break: break-all;
background: inherit; font-size: 40px;
font-weight: 600;
}
.status {
display: inline-block;
margin-bottom: 14px;
padding: 4px 8px;
font-size: 26px;
color: #fff;
border-radius: 8px;
}
.status0 {
background: #ff883c;
}
.status1 {
background: #2EA222;
}
.status2 {
background: #F46;
}
.status3 {
background: #ff4466;
}
.card {
display: flex;
justify-content: space-between;
padding: 34px 0;
border-bottom: 1px solid #ddd;
.card-left {
width: 46%;
font-size: 32px;
color: #999999;
}
.card-right {
font-size: 32px;
.u-icon {
margin-left: 8px;
}
}
}
// .card:last-child {
// border-bottom: none;
// }
.cards {
padding: 34px 0;
} }
img { img {
margin-top: 30px; width: 220px;
width: 686px; height: 220px;
height: 486px;
}
}
.img-list {
img {
width: 204px;
height: 204px;
margin: 0 8px 8px 0; margin: 0 8px 8px 0;
} }
.title { img:nth-of-type(3n) {
width: 100%; margin-right: 0;
line-height: 112px;
background: #FFF;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
} }
} }
.flex { .footer-btn {
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;
}
}
}
::v-deep uni-video {
width: 100%; width: 100%;
position: fixed;
bottom: 0;
left: 0;
padding: 16px 32px 52px 16px;
box-sizing: border-box;
background-color: #fff;
.btn {
width: 100%;
text-align: center;
height: 96px;
line-height: 94px;
border: 1px solid #2183FF;
border-radius: 8px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32px;
color: #2183FF;
margin-bottom: 16px;
}
} }
} }
</style> </style>