Browse Source

隐藏联系人联系电话

feature
战立标 2 years ago
parent
commit
11738243f7
  1. 80
      src/views/demand/index.vue
  2. 54
      src/views/event/index.vue

80
src/views/demand/index.vue

@ -2,29 +2,29 @@
<div class="container"> <div class="container">
<div class="block"> <div class="block">
<DemandPicker <DemandPicker
required
label="需求类型"
placeholder="请选择"
v-model="demandType" v-model="demandType"
:items="demandTypeOptions" :items="demandTypeOptions"
label="需求类型"
placeholder="请选择"
required
@change="setVal" @change="setVal"
@setChild="getChildSelectList" @setChild="getChildSelectList"
/> />
<div class="textarea"> <div class="textarea">
<van-field <van-field
required
v-model="content" v-model="content"
autosize
label="需求描述" label="需求描述"
placeholder="不超过500字"
type="textarea"
maxlength="500" maxlength="500"
placeholder="不超过500字"
required
rows="6" rows="6"
autosize type="textarea"
> >
<template #extra> <template #extra>
<div class="speech"> <div class="speech">
<Audio :audioSrc="audio" v-show="audio.duration" /> <Audio v-show="audio.duration" :audioSrc="audio"/>
<Recording @change="setAudio" :isFile="isFile" /> <Recording :isFile="isFile" @change="setAudio"/>
</div> </div>
</template> </template>
</van-field> </van-field>
@ -34,32 +34,33 @@
<div class="block"> <div class="block">
<van-cell title="上传图片"> <van-cell title="上传图片">
<template #label> <template #label>
<van-uploader v-model="fileList" :max-size="10 * 1024 * 1024" :after-read="afterRead" :max-count="3" /> <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">
<van-field required v-model="name" label="联系人" placeholder="请输入联系人" />
<van-field required type="number" maxlength="11" v-model="phone" label="联系电话" placeholder="请输入联系电话" />
</div>-->
<van-button block color="linear-gradient(to right, #81B5FB, #3E92FF)" round @click="submit">提交</van-button>
<div class="block"> <Perfect/>
<van-field required v-model="name" label="联系人" placeholder="请输入联系人" />
<van-field required type="number" maxlength="11" v-model="phone" label="联系电话" placeholder="请输入联系电话" />
</div>
<van-button round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button>
<Perfect />
</div> </div>
</template> </template>
<script> <script>
import { setConfig } from '@/utils/jweixin' import {setConfig} from '@/utils/jweixin'
import Recording from '@/components/Recording' 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 DemandPicker from '@/components/DemandPicker' import DemandPicker from '@/components/DemandPicker'
import { uploadvariedfile } from '@/api/basic' import {uploadvariedfile} from '@/api/basic'
import { saveOfficialAccountDemand, selectList } from '@/api/demand' import {saveOfficialAccountDemand, selectList} from '@/api/demand'
export default { export default {
name: 'demand', name: 'demand',
components: { Recording, Audio, Perfect, DemandPicker }, components: {Recording, Audio, Perfect, DemandPicker},
data() { data() {
return { return {
form: {}, form: {},
@ -100,7 +101,8 @@ export default {
this.parentCode = values[0].value this.parentCode = values[0].value
this.categoryCode = values[1].value this.categoryCode = values[1].value
}, },
clickUpload() {}, clickUpload() {
},
setAudio(val) { setAudio(val) {
this.isFile = false this.isFile = false
this.audio = val this.audio = val
@ -125,18 +127,18 @@ export default {
this.$toast.fail('请输入描述') this.$toast.fail('请输入描述')
return return
} }
if (!this.name) { /* if (!this.name) {
this.$toast.fail('请输入姓名') this.$toast.fail('请输入姓名')
return return
} }
if (!this.phone) { if (!this.phone) {
this.$toast.fail('请输入电话') this.$toast.fail('请输入电话')
return return
} }
if (!/^1[3456789]\d{9}$/.test(this.phone)) { if (!/^1[3456789]\d{9}$/.test(this.phone)) {
this.$toast.fail('请输入正确的联系电话') this.$toast.fail('请输入正确的联系电话')
return return
} }*/
saveOfficialAccountDemand({ saveOfficialAccountDemand({
content: this.content, content: this.content,
duration: this.audio.duration, duration: this.audio.duration,
@ -147,8 +149,8 @@ export default {
categoryCode: this.categoryCode, categoryCode: this.categoryCode,
homeId: this.$store.state.app.userInfo.homeId, homeId: this.$store.state.app.userInfo.homeId,
customerId: this.$store.state.app.userInfo.customerId, customerId: this.$store.state.app.userInfo.customerId,
name: this.name, /* name: this.name,
phone: this.phone phone: this.phone*/
}).then(() => { }).then(() => {
this.$toast.success('提交成功') this.$toast.success('提交成功')
this.$router.replace('/appeal') this.$router.replace('/appeal')
@ -165,11 +167,11 @@ export default {
}), }),
defaultIndex: 0 defaultIndex: 0
} }
this.getChildSelectList({ value: res[0].id }) this.getChildSelectList({value: res[0].id})
}) })
}, },
getChildSelectList({ picker, value }) { getChildSelectList({picker, value}) {
selectList(value).then(res => { selectList(value).then(res => {
let data = { let data = {
values: res.map(item => { values: res.map(item => {
@ -190,6 +192,6 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style lang="less" scoped>
@import './index'; @import './index';
</style> </style>

54
src/views/event/index.vue

@ -3,19 +3,19 @@
<div class="block"> <div class="block">
<div class="textarea"> <div class="textarea">
<van-field <van-field
required
v-model="eventContent" v-model="eventContent"
autosize
label="事件描述" label="事件描述"
placeholder="不超过500字"
type="textarea"
maxlength="500" maxlength="500"
placeholder="不超过500字"
required
rows="6" rows="6"
autosize type="textarea"
> >
<template #extra> <template #extra>
<div class="speech"> <div class="speech">
<Audio :audioSrc="audio" v-show="audio.duration" /> <Audio v-show="audio.duration" :audioSrc="audio"/>
<Recording @change="setAudio" :isFile="isFile" /> <Recording :isFile="isFile" @change="setAudio"/>
</div> </div>
</template> </template>
</van-field> </van-field>
@ -25,39 +25,40 @@
<div class="block"> <div class="block">
<van-cell title="上传图片"> <van-cell title="上传图片">
<template #label> <template #label>
<van-uploader v-model="fileList" :max-size="10 * 1024 * 1024" :after-read="afterRead" :max-count="3" /> <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 title="发生地点" @click="$refs.map.show = true" is-link> <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 required v-model="name" label="联系人" placeholder="请输入联系人" /> <van-field required v-model="name" label="联系人" placeholder="请输入联系人" />
<van-field required type="number" maxlength="11" v-model="phone" label="联系电话" placeholder="请输入联系电话" /> <van-field required type="number" maxlength="11" v-model="phone" label="联系电话" placeholder="请输入联系电话" />
</div> </div>-->
<van-button round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button> <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> </div>
</template> </template>
<script> <script>
import { setConfig } from '@/utils/jweixin' import {setConfig} from '@/utils/jweixin'
import Recording from '@/components/Recording' 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 { 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},
data() { data() {
return { return {
form: {}, form: {},
@ -112,7 +113,8 @@ export default {
errorPosition() { errorPosition() {
console.log('定位失败,再次进行定位') console.log('定位失败,再次进行定位')
}, },
clickUpload() {}, clickUpload() {
},
setAudio(val) { setAudio(val) {
console.log(val, 'this.val') console.log(val, 'this.val')
this.isFile = false this.isFile = false
@ -141,7 +143,7 @@ export default {
this.$toast.fail('请输入描述') this.$toast.fail('请输入描述')
return return
} }
if (!this.name) { /*if (!this.name) {
this.$toast.fail('请输入姓名') this.$toast.fail('请输入姓名')
return return
} }
@ -152,7 +154,7 @@ export default {
if (!/^1[3456789]\d{9}$/.test(this.phone)) { if (!/^1[3456789]\d{9}$/.test(this.phone)) {
this.$toast.fail('请输入正确的联系电话') this.$toast.fail('请输入正确的联系电话')
return return
} }*/
saveOfficialAccountEvent({ saveOfficialAccountEvent({
duration: this.audio.duration, duration: this.audio.duration,
serverId: this.audio.serverId, serverId: this.audio.serverId,
@ -160,8 +162,8 @@ export default {
latitude: this.latitude, latitude: this.latitude,
longitutd: this.longitude, longitutd: this.longitude,
address: this.address, address: this.address,
name: this.name, /* name: this.name,
phone: this.phone, phone: this.phone,*/
eventContent: this.eventContent, eventContent: this.eventContent,
userId: this.$store.state.app.userInfo.userId, userId: this.$store.state.app.userInfo.userId,
customerId: this.$store.state.app.userInfo.customerId customerId: this.$store.state.app.userInfo.customerId
@ -174,6 +176,6 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style lang="less" scoped>
@import './index'; @import './index';
</style> </style>

Loading…
Cancel
Save