This commit is contained in:
yanran200730
2022-01-07 16:29:40 +08:00
4 changed files with 106 additions and 79 deletions

View File

@@ -79,7 +79,9 @@ export default {
}) })
}, },
onReachBottom() { onReachBottom() {
if(!this.tabIndex) {
uni.$emit('nextList') uni.$emit('nextList')
}
}, },
} }
</script> </script>

View File

@@ -48,7 +48,7 @@
</div> --> </div> -->
<div class="cards"> <div class="cards">
<span class="card-left">照片</span> <span class="card-left" style="color:#999">照片</span>
</div> </div>
<img :src="item.url" alt="" v-for="(item, i) in data.files" :key="i" @click="previewImage(data.files, item.url)" /> <img :src="item.url" alt="" v-for="(item, i) in data.files" :key="i" @click="previewImage(data.files, item.url)" />

View File

@@ -8,8 +8,8 @@
<div class="info-content"> <div class="info-content">
<div class="title">今日概况</div> <div class="title">今日概况</div>
<div class="el-row"> <div class="el-row">
<div class="item" v-for="(item, index) in contents" :key="index"> <div class="item" v-for="(item, index) in todayList" :key="index">
<h2>{{item.num}}</h2> <h2>{{item.value}}</h2>
<p>{{item.label}}</p> <p>{{item.label}}</p>
</div> </div>
</div> </div>
@@ -20,11 +20,11 @@
<div class="left"> <div class="left">
<div class="item"> <div class="item">
<p>受理率</p> <p>受理率</p>
<h2>83.3%</h2> <h2>{{info.businessCountMap['受理率'] * 100}}%</h2>
</div> </div>
<div class="item"> <div class="item">
<p>办结率</p> <p>办结率</p>
<h2>83.3%</h2> <h2>{{info.businessCountMap['办结率'] * 100}}%</h2>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@@ -35,15 +35,15 @@
<div class="num"> <div class="num">
<div class="item bg1"> <div class="item bg1">
<h2>累计反馈</h2> <h2>累计反馈</h2>
<p>30</p> <p>{{info.businessCountMap['累计反馈']}}</p>
</div> </div>
<div class="item bg2"> <div class="item bg2">
<h2>累计受理</h2> <h2>累计受理</h2>
<p>30</p> <p>{{info.businessCountMap['累计受理']}}</p>
</div> </div>
<div class="item bg3"> <div class="item bg3">
<h2>累计办理</h2> <h2>累计办理</h2>
<p>30</p> <p>{{info.businessCountMap['累计办结']}}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -63,13 +63,13 @@
<div class="item"> <div class="item">
<div class="mini-title">小区管理</div> <div class="mini-title">小区管理</div>
<div class="info"> <div class="info">
<div class="line-bg" style="width:50%;"><div class="active-bg"></div></div>共11条 | 已办结9 <img src="./components/img/right-icon.png" alt=""> <div class="line-bg" style="width:44%;"><div class="active-bg"></div></div>共11条 | 已办结9 <img src="./components/img/right-icon.png" alt="">
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="mini-title">小区管理</div> <div class="mini-title">小区管理</div>
<div class="info"> <div class="info">
<div class="line-bg" style="width:40%;"><div class="active-bg"></div></div>共11条 | 已办结9 <img src="./components/img/right-icon.png" alt=""> <div class="line-bg" style="width:30%;"><div class="active-bg"></div></div>共11条 | 已办结9 <img src="./components/img/right-icon.png" alt="">
</div> </div>
</div> </div>
</div> </div>
@@ -88,44 +88,25 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
contents: [ todayList: [],
{ info: {}
label: '待受理',
num: 5
},
{
label: '办理中',
num: 5
},
{
label: '今日上报',
num: 5
},
{
label: '今日办结',
num: 5
}
]
} }
}, },
onLoad() { mounted() {
this.getStatistics()
}, },
onShow() {},
methods: { methods: {
getList() { getStatistics() {
this.$http this.$http.post('/app/appclapeventinfo/countByGirdMember').then((res) => {
.post('/app/appvisitvondolence/list', null, {
params: {
size: this.size,
current: this.current,
createUserId: this.currentTabs == 1 ? this.user.id : '',
},
})
.then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records this.info = res.data
this.pages = res.data.pages Object.keys(res.data.todayCountMap).forEach((key) => {
var info = {
label: key,
value: res.data.todayCountMap[key]
}
this.todayList.push(info)
})
} }
}) })
}, },
@@ -219,8 +200,8 @@ export default {
display: flex; display: flex;
padding: 40px 0 30px 0; padding: 40px 0 30px 0;
.left{ .left{
width: 240px; width: 220px;
padding: 20px 0 78px 64px; padding: 20px 0 78px 50px;
.item{ .item{
margin-bottom: 58px; margin-bottom: 58px;
} }
@@ -230,6 +211,7 @@ export default {
font-weight: bold; font-weight: bold;
color: #3B424A; color: #3B424A;
line-height: 64px; line-height: 64px;
letter-spacing: -4px;
} }
p{ p{
font-size: 28px; font-size: 28px;
@@ -239,7 +221,7 @@ export default {
} }
} }
.right{ .right{
width: calc(100% - 240px); width: calc(100% - 220px);
display: flex; display: flex;
.img{ .img{
width: 140px; width: 140px;
@@ -273,16 +255,16 @@ export default {
} }
} }
.bg1{ .bg1{
width: 304px; width: 272px;
background-image: url('./components/img/bg-1.png'); background-image: url('./components/img/bg-1.png');
} }
.bg2{ .bg2{
width: 266px; width: 234px;
background-image: url('./components/img/bg-2.png'); background-image: url('./components/img/bg-2.png');
margin-left: 16px; margin-left: 16px;
} }
.bg3{ .bg3{
width: 240px; width: 208px;
background-image: url('./components/img/bg-3.png'); background-image: url('./components/img/bg-3.png');
margin-left: 32px; margin-left: 32px;
} }
@@ -309,7 +291,7 @@ export default {
line-height: 48px; line-height: 48px;
.line-bg{ .line-bg{
display: inline-block; display: inline-block;
width: 63%; width: 56%;
height: 14px; height: 14px;
background: #D7D8D9; background: #D7D8D9;
border-radius: 8px; border-radius: 8px;

View File

@@ -3,7 +3,7 @@
<div class="header-description"> <div class="header-description">
<u-form :model="form" ref="uForm" label-width="auto"> <u-form :model="form" ref="uForm" label-width="auto">
<u-form-item label="主题" prop="content" required label-position="top" class="contents"> <u-form-item label="主题" prop="content" required label-position="top" class="contents">
<u-input v-model="form.content" placeholder="请输入题(1000字以内)" type="textarea" auto-height height="280" maxlength="1000" /> <u-input v-model="form.content" placeholder="请输入题(500字以内)" type="textarea" auto-height height="280" maxlength="500" />
</u-form-item> </u-form-item>
<u-form-item label="图片(最多9张)" prop="images" class="avatars" label-position="top"> <u-form-item label="图片(最多9张)" prop="images" class="avatars" label-position="top">
@@ -11,7 +11,7 @@
</u-form-item> </u-form-item>
<u-form-item label="发布地区" prop="areaId" required :border-bottom="false" right-icon="arrow-right" class="addresss"> <u-form-item label="发布地区" prop="areaId" required :border-bottom="false" right-icon="arrow-right" class="addresss">
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" style="color: #666"></AiAreaPicker> <AiAreaPicker v-model="form.areaId" :areaId="user.areaId" :name.sync="form.areaName" @select="areaSelect" style="color: #666"></AiAreaPicker>
</u-form-item> </u-form-item>
<u-form-item label="议事截止时间" prop="discussDeadline" required :border-bottom="false" right-icon="arrow-right"> <u-form-item label="议事截止时间" prop="discussDeadline" required :border-bottom="false" right-icon="arrow-right">
@@ -39,7 +39,7 @@
<img src="./img/22.png" alt="" /> <img src="./img/22.png" alt="" />
<div class="rightopts"> <div class="rightopts">
<u-input v-model="content" placeholder="选项" maxlength="20" :clearable="false" /> <u-input v-model="contents" placeholder="选项" maxlength="200" :clearable="false" />
</div> </div>
</div> </div>
</div> </div>
@@ -53,7 +53,7 @@
<img src="./img/22.png" alt="" /> <img src="./img/22.png" alt="" />
<div class="rightopts"> <div class="rightopts">
<u-input v-model="content" placeholder="选项" :clearable="false" maxlength="20" /> <u-input v-model="contents" placeholder="选项" :clearable="false" maxlength="200" />
</div> </div>
</div> </div>
@@ -94,7 +94,11 @@ export default {
data() { data() {
return { return {
id: '', id: '',
form: { type: 0 }, form: {
type: 0,
areaId: '',
areaName: '',
},
flag: false, flag: false,
showStartTime: false, showStartTime: false,
showEndTime: false, showEndTime: false,
@@ -108,9 +112,10 @@ export default {
timestamp: true, timestamp: true,
}, },
opts: 0, opts: 0,
checked: true, checked: false,
list: [], list: [],
content: '', contents: '',
keys: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
@@ -119,7 +124,7 @@ export default {
this.id = o.id this.id = o.id
this.getDetail() this.getDetail()
} }
this.form.areaId = this.user.areaId
this.$dict.load('discussType').then(() => { this.$dict.load('discussType').then(() => {
// this.areaId = this.user.areaId // this.areaId = this.user.areaId
}) })
@@ -142,19 +147,57 @@ export default {
submit() { submit() {
if (this.flag) return if (this.flag) return
if (!this.form.content) { if (!this.form.content) {
return this.$u.toast('请输入 主题') return this.$u.toast('请输入主题')
} }
if (!this.form.discussDeadline) { if (!this.form.areaId) {
return this.$u.toast('请选择 议事截止时间') return this.$u.toast('请输入发布地区')
} }
this.$http // if (!this.form.discussDeadline) {
.post(`/app/appvillagediscuss/addOrUpdate`, { // return this.$u.toast('请选择议事截止时间')
...this.form, // }
images: JSON.stringify(this.form.images), // if (!this.form.publicityDeadline) {
id: this.id, // return this.$u.toast('请选择公示截止时间')
// }
if (this.form.type == 1) {
if (this.opts == 0) {
if (!this.form.contents) {
return this.$u.toast('请输入单选选项')
}
}
if (this.opts == 1) {
if (!this.list.length > 0) {
return this.$u.toast('请输入多选选项')
}
}
}
if (this.opts == 1) {
var lists = []
this.list.map((item, index) => {
item.contents == item, item.item == this.keys[index]
lists.push({
content: item,
item: this.keys[index],
}) })
.then((res) => { })
if (res?.code == 0) { console.log(lists)
}
var params = {
...this.form,
// voteItems: this.list,
areaId: this.form.areaId,
areaName: this.form.areaName,
voteItems: lists,
anonymous: this.checked == true ? 1 : 0,
createUserId: this.user.id,
createUserName: this.user.name,
images: JSON.stringify(this.form.images),
voteType: this.opts,
}
this.$http.post(`/app/appvillagediscuss/addOrUpdate`, params).then((res) => {
if (res.code == 0) {
uni.$emit('update') uni.$emit('update')
this.$u.toast('发布成功') this.$u.toast('发布成功')
this.flag = true this.flag = true