Browse Source

修改事件上报页面

feature
战立标 2 years ago
parent
commit
c1c648aca3
  1. 2
      src/config/env.development.js
  2. 2
      src/config/env.production.js
  3. 2
      src/config/env.staging.js
  4. 2
      src/router/router.config.js
  5. 9
      src/views/appeal/index.less
  6. 69
      src/views/appeal/index.vue
  7. 100
      src/views/event/index.vue

2
src/config/env.development.js

@ -1,6 +1,6 @@
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'e联社区', title: ' ',
englishName:'', englishName:'',
version: 'V1.0.0', version: 'V1.0.0',
technicalSupport: '', technicalSupport: '',

2
src/config/env.production.js

@ -9,7 +9,7 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'e联社区', title: ' ',
englishName:'', englishName:'',
version: 'V1.0.0', version: 'V1.0.0',
technicalSupport: '', technicalSupport: '',

2
src/config/env.staging.js

@ -1,6 +1,6 @@
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'e联社区', title: ' ',
englishName:'', englishName:'',
version: 'V1.0.0', version: 'V1.0.0',
technicalSupport: '', technicalSupport: '',

2
src/router/router.config.js

@ -24,7 +24,7 @@ export const constantRouterMap = [
path: '/event', path: '/event',
name: 'event', name: 'event',
component: () => import('@/views/event'), component: () => import('@/views/event'),
meta: { title: '事件上报', keepAlive: false } meta: { title: '居民上报诉求', keepAlive: false }
}, },
{ {
path: '/userInfo/:type', path: '/userInfo/:type',

9
src/views/appeal/index.less

@ -38,3 +38,12 @@
} }
} }
.no-data {
font-size: 14px;
width: 100%;
height: 80vh;
display: flex;
align-items: center;
justify-content: center;
color: #999;
}

69
src/views/appeal/index.vue

@ -1,41 +1,42 @@
<template> <template>
<div> <div>
<van-tabs v-model="type" @change="tabList" animated sticky swipeable lazy-render> <!-- <van-tabs v-model="type" @change="tabList" animated sticky swipeable lazy-render>
<van-tab title="我的事件"> <van-tab title="我的事件">-->
<div class="container"> <div class="container">
<div class="event-list"> <div class="event-list" v-if="eventList.length > 0">
<div <div
class="event-item" class="event-item"
v-for="(item, index) in eventList" v-for="(item, index) in eventList"
:key="index" :key="index"
@click="$router.push({ path: '/appealDetail', query: { pageType: 'event', ...item } })" @click="$router.push({ path: '/appealDetail', query: { pageType: 'event', ...item } })"
>
<div class="title">
<van-tag
round
size="medium"
style="margin-right: 5px"
:color="item.status == '处理中' ? processing.bg : completion.bg"
:text-color="item.status == '处理中' ? processing.text : completion.text"
> >
<div class="title"> {{ item.status }}
<van-tag </van-tag>
round <span class="text">{{ item.content }}</span>
size="medium" </div>
style="margin-right: 5px" <div class="time">{{ item.happenTime }}</div>
:color="item.status == '处理中' ? processing.bg : completion.bg" <div class="imgs">
:text-color="item.status == '处理中' ? processing.text : completion.text" <van-image
> fit="cover"
{{ item.status }} v-for="(item2, index2) in item.imageList"
</van-tag> @click.prevent.stop="previewImage(index2, item.imageList)"
<span class="text">{{ item.content }}</span> :src="item2"
</div> :key="index2"
<div class="time">{{ item.happenTime }}</div> />
<div class="imgs">
<van-image
fit="cover"
v-for="(item2, index2) in item.imageList"
@click.prevent.stop="previewImage(index2, item.imageList)"
:src="item2"
:key="index2"
/>
</div>
</div>
</div> </div>
</div> </div>
</van-tab> </div>
<div class="no-data">暂无内容</div>
</div>
<!-- </van-tab>
<van-tab title="我的需求"> <van-tab title="我的需求">
<div class="container"> <div class="container">
<div class="event-list"> <div class="event-list">
@ -71,7 +72,7 @@
</div> </div>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>-->
</div> </div>
</template> </template>

100
src/views/event/index.vue

@ -1,48 +1,64 @@
<template> <template>
<div class="container"> <div>
<div class="block"> <van-tabs v-model="type" animated sticky swipeable lazy-render>
<div class="textarea"> <van-tab title="上报诉求">
<van-field <div class="container">
v-model="eventContent" <div class="block">
autosize <div class="textarea">
label="事件描述" <van-field
maxlength="500" v-model="eventContent"
placeholder="不超过500字" autosize
required label="事件描述"
rows="6" maxlength="500"
type="textarea" placeholder="不超过500字"
> required
<template #extra> rows="6"
<div class="speech"> type="textarea"
<Audio v-show="audio.duration" :audioSrc="audio" /> >
<Recording :isFile="isFile" @change="setAudio" /> <template #extra>
<div class="speech">
<Audio v-show="audio.duration" :audioSrc="audio" />
<Recording :isFile="isFile" @change="setAudio" />
</div>
</template>
</van-field>
</div> </div>
</template> </div>
</van-field>
</div>
</div>
<div class="block"> <div class="block">
<van-cell title="上传图片"> <van-cell title="上传图片">
<template #label> <template #label>
<van-uploader v-model="fileList" :after-read="afterRead" :max-count="3" :max-size="10 * 1024 * 1024" /> <van-uploader v-model="fileList" :after-read="afterRead" :max-count="3" :max-size="10 * 1024 * 1024" />
</template> </template>
</van-cell> </van-cell>
</div> </div>
<div class="block"> <div class="block">
<van-cell is-link title="发生地点" @click="$refs.map.show = true"> <van-cell is-link title="发生地点" @click="$refs.map.show = true">
<div>{{ address }}</div> <div>{{ address }}</div>
</van-cell> </van-cell>
</div> </div>
<div class="block"> <div class="block">
<van-field v-model="name" label="联系人" placeholder="请输入联系人" required /> <van-field v-model="name" label="联系人" placeholder="请输入联系人" required />
<van-field v-model="phone" label="联系电话" maxlength="11" placeholder="请输入联系电话" required type="number" /> <van-field
</div> v-model="phone"
<van-button block color="linear-gradient(to right, #81B5FB, #3E92FF)" round @click="submit">提交</van-button> label="联系电话"
maxlength="11"
placeholder="请输入联系电话"
required
type="number"
/>
</div>
<van-button block color="linear-gradient(to right, #81B5FB, #3E92FF)" round @click="submit">提交</van-button>
<Perfect /> <Perfect />
<Map ref="map" @locationChange="locationChange" /> <Map ref="map" @locationChange="locationChange" />
</div>
</van-tab>
<van-tab title="我的诉求">
<appeal v-if="type == 1" />
</van-tab>
</van-tabs>
</div> </div>
</template> </template>
@ -52,15 +68,17 @@ import Recording from '@/components/Recording'
import Perfect from '@/components/Perfect' import Perfect from '@/components/Perfect'
import Audio from '@/components/Audio' import Audio from '@/components/Audio'
import Map from '@/components/Map' import Map from '@/components/Map'
import appeal from '@/views/appeal'
import { uploadvariedfile } from '@/api/basic' import { uploadvariedfile } from '@/api/basic'
import { saveOfficialAccountEvent } from '@/api/event' import { saveOfficialAccountEvent } from '@/api/event'
import { mapKey } from '@/config' import { mapKey } from '@/config'
export default { export default {
name: 'event', name: 'event',
components: { Recording, Audio, Perfect, Map }, components: { Recording, Audio, Perfect, Map, appeal },
data() { data() {
return { return {
type: 0,
form: {}, form: {},
fileList: [], fileList: [],
latitude: '', latitude: '',

Loading…
Cancel
Save