|
@@ -63,7 +63,7 @@
|
|
<span class="label-profession" v-for="(str, index) in '职业:职业'" :key="index">{{ str }}</span>
|
|
<span class="label-profession" v-for="(str, index) in '职业:职业'" :key="index">{{ str }}</span>
|
|
</label>
|
|
</label>
|
|
<div class="value-wrap">
|
|
<div class="value-wrap">
|
|
- <input type="text" placeholder="请输入职业" v-myBlur v-model.trim="postData.profession">
|
|
|
|
|
|
+ <input type="text" placeholder="请输入职业" v-myBlur v-model.trim="postData.orderUserProfess">
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -71,9 +71,9 @@
|
|
<span class="label-age" v-for="(str, index) in '年龄:年龄'" :key="index">{{ str }}</span>
|
|
<span class="label-age" v-for="(str, index) in '年龄:年龄'" :key="index">{{ str }}</span>
|
|
</label>
|
|
</label>
|
|
<div class="value-wrap age-wrap">
|
|
<div class="value-wrap age-wrap">
|
|
- <input :class="{'opacity-0': postData.age * 1 > 0}" type="tel" placeholder="请输入年龄" v-myBlur
|
|
|
|
|
|
+ <input :class="{'opacity-0': postData.orderUserAge * 1 > 0}" type="tel" placeholder="请输入年龄" v-myBlur
|
|
v-model.trim="age">
|
|
v-model.trim="age">
|
|
- <p v-show="postData.age * 1 > 0">{{ postData.age * 1 }}</p>
|
|
|
|
|
|
+ <p v-show="postData.orderUserAge * 1 > 0">{{ postData.orderUserAge * 1 }}</p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -81,7 +81,7 @@
|
|
<span class="label-invite-code" v-for="(str, index) in '邀请码:码'" :key="index">{{ str }}</span>
|
|
<span class="label-invite-code" v-for="(str, index) in '邀请码:码'" :key="index">{{ str }}</span>
|
|
</label>
|
|
</label>
|
|
<div class="value-wrap">
|
|
<div class="value-wrap">
|
|
- <input type="text" placeholder="请输入邀请码" v-myBlur v-model.trim="postData.inviteCode">
|
|
|
|
|
|
+ <input type="text" placeholder="请输入邀请码" v-myBlur v-model.trim="postData.inviteCode" @input="funLimitLength">
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
@@ -106,6 +106,7 @@
|
|
<script>
|
|
<script>
|
|
import { Popup, Picker, Toast } from 'vant'
|
|
import { Popup, Picker, Toast } from 'vant'
|
|
import { getChinaArea, sendSMS } from '../../../api/common'
|
|
import { getChinaArea, sendSMS } from '../../../api/common'
|
|
|
|
+ import { createOrder } from './api'
|
|
|
|
|
|
const STRCAPTURE = process.env.API_DOMAIN + '/api/captcha'
|
|
const STRCAPTURE = process.env.API_DOMAIN + '/api/captcha'
|
|
export default {
|
|
export default {
|
|
@@ -125,8 +126,8 @@
|
|
orderProvince: '', // 省份
|
|
orderProvince: '', // 省份
|
|
orderCity: '', // 城市
|
|
orderCity: '', // 城市
|
|
orderDistrict: '', // 区域
|
|
orderDistrict: '', // 区域
|
|
- profession: '', // 职业
|
|
|
|
- age: 0,
|
|
|
|
|
|
+ orderUserProfess: '', // 职业
|
|
|
|
+ orderUserAge: 0,
|
|
inviteCode: ''
|
|
inviteCode: ''
|
|
},
|
|
},
|
|
numCount: 60,
|
|
numCount: 60,
|
|
@@ -140,16 +141,15 @@
|
|
computed: {
|
|
computed: {
|
|
age: {
|
|
age: {
|
|
get () {
|
|
get () {
|
|
- return this.postData.age ? this.postData.age * 1 : ''
|
|
|
|
|
|
+ return this.postData.orderUserAge ? this.postData.orderUserAge : ''
|
|
},
|
|
},
|
|
set (value) {
|
|
set (value) {
|
|
- this.postData.age = value
|
|
|
|
|
|
+ this.postData.orderUserAge = /^[1-9]+$/.test(value) ? value * 1 : 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async mounted () {
|
|
async mounted () {
|
|
- await this.$nextTick()
|
|
|
|
- this.$refreshTitle('成为合伙人')
|
|
|
|
|
|
+ this.funGetChinaArea()
|
|
},
|
|
},
|
|
activated () {
|
|
activated () {
|
|
if (!this.$route.meta.isUseCache) {
|
|
if (!this.$route.meta.isUseCache) {
|
|
@@ -162,17 +162,19 @@
|
|
orderProvince: '',
|
|
orderProvince: '',
|
|
orderCity: '',
|
|
orderCity: '',
|
|
orderDistrict: '',
|
|
orderDistrict: '',
|
|
- profession: '',
|
|
|
|
- age: 0,
|
|
|
|
|
|
+ orderUserProfess: '',
|
|
|
|
+ orderUserAge: 0,
|
|
inviteCode: ''
|
|
inviteCode: ''
|
|
}
|
|
}
|
|
|
|
+ this.numCount = 60
|
|
this.arrErrorList = []
|
|
this.arrErrorList = []
|
|
- this.showPicker = false
|
|
|
|
- this.columns = []
|
|
|
|
- this.funGetChinaArea()
|
|
|
|
|
|
+ this.timer = null
|
|
|
|
+ } else {
|
|
|
|
+ clearInterval(this.timer)
|
|
}
|
|
}
|
|
- this.numCount = 60
|
|
|
|
- clearInterval(this.timer)
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refreshTitle('成为合伙人')
|
|
|
|
+ })
|
|
this.$route.meta.isUseCache = false
|
|
this.$route.meta.isUseCache = false
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -180,7 +182,11 @@
|
|
getChinaArea().then(res => {
|
|
getChinaArea().then(res => {
|
|
if (res.status) {
|
|
if (res.status) {
|
|
this.columns = res.data
|
|
this.columns = res.data
|
|
|
|
+ } else {
|
|
|
|
+ Toast(res.msg)
|
|
}
|
|
}
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ Toast(err)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onConfirm (value) {
|
|
onConfirm (value) {
|
|
@@ -190,9 +196,10 @@
|
|
this.$set(this.postData, 'orderDistrict', value[2])
|
|
this.$set(this.postData, 'orderDistrict', value[2])
|
|
},
|
|
},
|
|
funLimitLength () {
|
|
funLimitLength () {
|
|
- const { orderUserPhone, code } = this.postData
|
|
|
|
|
|
+ const { orderUserPhone, code, inviteCode } = this.postData
|
|
this.postData.orderUserPhone = orderUserPhone.length > 11 ? orderUserPhone.slice(0, 11) : orderUserPhone
|
|
this.postData.orderUserPhone = orderUserPhone.length > 11 ? orderUserPhone.slice(0, 11) : orderUserPhone
|
|
this.postData.code = code.length > 4 ? code.slice(0, 4) : code
|
|
this.postData.code = code.length > 4 ? code.slice(0, 4) : code
|
|
|
|
+ this.postData.inviteCode = inviteCode.length > 4 ? inviteCode.slice(0, 4) : inviteCode
|
|
},
|
|
},
|
|
funCutDown () {
|
|
funCutDown () {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
@@ -222,9 +229,14 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.funCutDown()
|
|
this.funCutDown()
|
|
- sendSMS(orderUserPhone, 0, capture).then(res => {
|
|
|
|
|
|
+ sendSMS(orderUserPhone, 2, capture).then(res => {
|
|
if (res.status) {
|
|
if (res.status) {
|
|
Toast('发送成功')
|
|
Toast('发送成功')
|
|
|
|
+ } else {
|
|
|
|
+ Toast(res.msg)
|
|
|
|
+ this.funUpdateCapture()
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
+ this.numCount = 60
|
|
}
|
|
}
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
Toast(err.msg)
|
|
Toast(err.msg)
|
|
@@ -234,7 +246,7 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
verifyData () {
|
|
verifyData () {
|
|
- const { orderUserName, orderUserSex, orderUserPhone, code, orderProvince, orderCity, orderDistrict, profession, age } = this.postData
|
|
|
|
|
|
+ const { orderUserName, orderUserSex, orderUserPhone, code, orderProvince, orderCity, orderDistrict, orderUserProfess, orderUserAge } = this.postData
|
|
this.arrErrorList = []
|
|
this.arrErrorList = []
|
|
if (!orderUserName) {
|
|
if (!orderUserName) {
|
|
this.arrErrorList.push('请输入姓名')
|
|
this.arrErrorList.push('请输入姓名')
|
|
@@ -251,10 +263,10 @@
|
|
if (!orderProvince || !orderCity || !orderDistrict) {
|
|
if (!orderProvince || !orderCity || !orderDistrict) {
|
|
this.arrErrorList.push('请选择所在城市')
|
|
this.arrErrorList.push('请选择所在城市')
|
|
}
|
|
}
|
|
- if (!profession) {
|
|
|
|
|
|
+ if (!orderUserProfess) {
|
|
this.arrErrorList.push('请输入职业')
|
|
this.arrErrorList.push('请输入职业')
|
|
}
|
|
}
|
|
- if (age * 1 <= 0) {
|
|
|
|
|
|
+ if (orderUserAge * 1 <= 0) {
|
|
this.arrErrorList.push('请输入年龄')
|
|
this.arrErrorList.push('请输入年龄')
|
|
}
|
|
}
|
|
return this.arrErrorList.length <= 0
|
|
return this.arrErrorList.length <= 0
|
|
@@ -274,7 +286,30 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.$router.replace({ path: '/partner/detail' })
|
|
|
|
|
|
+ const myToast = Toast.loading({
|
|
|
|
+ message: '提交中...',
|
|
|
|
+ duration: 1000 * 100,
|
|
|
|
+ forbidClick: true
|
|
|
|
+ })
|
|
|
|
+ createOrder(postData).then(res => {
|
|
|
|
+ myToast.clear()
|
|
|
|
+ if (res.status) {
|
|
|
|
+ const { id } = res.data
|
|
|
|
+ Toast({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '提交成功',
|
|
|
|
+ forbidClick: true,
|
|
|
|
+ onClose: () => {
|
|
|
|
+ this.$router.replace({ path: '/partner/detail?id=' + id })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ Toast(res.msg)
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ myToast.clear()
|
|
|
|
+ Toast(err)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteLeave (to, from, next) {
|
|
beforeRouteLeave (to, from, next) {
|