Browse Source

调整 注册,时间上报,需求上报

feature
战立标 2 years ago
parent
commit
a2a0f804bd
  1. 26
      src/views/demand/index.vue
  2. 31
      src/views/event/index.vue
  3. 3
      src/views/register/index.vue

26
src/views/demand/index.vue

@ -38,6 +38,11 @@
</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 round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button> <van-button round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button>
<Perfect /> <Perfect />
@ -71,7 +76,9 @@ export default {
demandTypeOptions: [], demandTypeOptions: [],
content: '', content: '',
parentCode: '', parentCode: '',
categoryCode: '' categoryCode: '',
name: '',
phone: ''
} }
}, },
mounted() { mounted() {
@ -86,6 +93,7 @@ export default {
'translateVoice' 'translateVoice'
]) ])
this.getSelectList() this.getSelectList()
this.phone = this.$store.state.app.userInfo.phone
}, },
methods: { methods: {
setVal(values) { setVal(values) {
@ -117,6 +125,18 @@ export default {
this.$toast.fail('请输入描述') this.$toast.fail('请输入描述')
return return
} }
if (!this.name) {
this.$toast.fail('请输入姓名')
return
}
if (!this.phone) {
this.$toast.fail('请输入电话')
return
}
if (!/^1[3456789]\d{9}$/.test(this.phone)) {
this.$toast.fail('请输入正确的联系电话')
return
}
saveOfficialAccountDemand({ saveOfficialAccountDemand({
content: this.content, content: this.content,
duration: this.audio.duration, duration: this.audio.duration,
@ -126,7 +146,9 @@ export default {
parentCode: this.parentCode, parentCode: this.parentCode,
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,
phone: this.phone
}).then(() => { }).then(() => {
this.$toast.success('提交成功') this.$toast.success('提交成功')
this.$router.replace('/appeal') this.$router.replace('/appeal')

31
src/views/event/index.vue

@ -36,14 +36,8 @@
</van-cell> </van-cell>
</div> </div>
<div class="block"> <div class="block">
<van-cell title="联系人" @click="$refs.map.show = true" is-link> <van-field required v-model="name" label="联系人" placeholder="请输入联系人" />
<div>{{ address }}</div> <van-field required type="number" maxlength="11" v-model="phone" label="联系电话" placeholder="请输入联系电话" />
</van-cell>
</div>
<div class="block">
<van-cell title="联系电话" @click="$refs.map.show = true" is-link>
<div>{{ address }}</div>
</van-cell>
</div> </div>
<van-button round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button> <van-button round block @click="submit" color="linear-gradient(to right, #81B5FB, #3E92FF)">提交</van-button>
@ -60,7 +54,7 @@ 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 },
@ -76,7 +70,9 @@ export default {
audio: {}, audio: {},
isFile: true, isFile: true,
address: '', address: '',
eventContent: '' eventContent: '',
name: '',
phone: ''
} }
}, },
mounted() { mounted() {
@ -94,6 +90,7 @@ export default {
this.geolocation = new qq.maps.Geolocation(mapKey, 'myapp') this.geolocation = new qq.maps.Geolocation(mapKey, 'myapp')
// //
this.getMyLocation() this.getMyLocation()
this.phone = this.$store.state.app.userInfo.phone
}, },
methods: { methods: {
// //
@ -144,6 +141,18 @@ export default {
this.$toast.fail('请输入描述') this.$toast.fail('请输入描述')
return return
} }
if (!this.name) {
this.$toast.fail('请输入姓名')
return
}
if (!this.phone) {
this.$toast.fail('请输入电话')
return
}
if (!/^1[3456789]\d{9}$/.test(this.phone)) {
this.$toast.fail('请输入正确的联系电话')
return
}
saveOfficialAccountEvent({ saveOfficialAccountEvent({
duration: this.audio.duration, duration: this.audio.duration,
serverId: this.audio.serverId, serverId: this.audio.serverId,
@ -151,6 +160,8 @@ export default {
latitude: this.latitude, latitude: this.latitude,
longitutd: this.longitude, longitutd: this.longitude,
address: this.address, address: this.address,
name: this.name,
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

3
src/views/register/index.vue

@ -50,7 +50,8 @@ export default {
phone: this.phone, phone: this.phone,
smsCode: this.smsCode, smsCode: this.smsCode,
surName: this.surName, surName: this.surName,
appid: this.$store.state.app.appId appId: this.$store.state.app.appId,
gender: this.gender
} }
if (!params.phone) { if (!params.phone) {
this.$toast.fail('请输入手机号') this.$toast.fail('请输入手机号')

Loading…
Cancel
Save