|
@@ -8,7 +8,7 @@
|
|
<span v-for="(str, index) in '手机号码:'" :key="index">{{ str }}</span>
|
|
<span v-for="(str, index) in '手机号码:'" :key="index">{{ str }}</span>
|
|
</label>
|
|
</label>
|
|
<div class="value-wrap">
|
|
<div class="value-wrap">
|
|
- <input type="tel" placeholder="请输入手机号码" v-model.trim="postData.orderUserPhone" @input="funLimitLength">
|
|
|
|
|
|
+ <input type="tel" placeholder="请输入手机号码" v-model.trim="postData.partnerPhone" @input="funLimitLength">
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -37,6 +37,7 @@
|
|
<script>
|
|
<script>
|
|
import { Toast } from 'vant'
|
|
import { Toast } from 'vant'
|
|
import { sendSMS } from '../../../api/common'
|
|
import { sendSMS } from '../../../api/common'
|
|
|
|
+ import { partnerLogin } from './api'
|
|
|
|
|
|
const STRCAPTURE = process.env.API_DOMAIN + '/api/captcha'
|
|
const STRCAPTURE = process.env.API_DOMAIN + '/api/captcha'
|
|
export default {
|
|
export default {
|
|
@@ -44,7 +45,7 @@
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
postData: {
|
|
postData: {
|
|
- orderUserPhone: '',
|
|
|
|
|
|
+ partnerPhone: '',
|
|
capture: '',
|
|
capture: '',
|
|
code: ''
|
|
code: ''
|
|
},
|
|
},
|
|
@@ -60,8 +61,8 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
funLimitLength () {
|
|
funLimitLength () {
|
|
- const { orderUserPhone, code } = this.postData
|
|
|
|
- this.postData.orderUserPhone = orderUserPhone.length > 11 ? orderUserPhone.slice(0, 11) : orderUserPhone
|
|
|
|
|
|
+ const { partnerPhone, code } = this.postData
|
|
|
|
+ this.postData.partnerPhone = partnerPhone.length > 11 ? partnerPhone.slice(0, 11) : partnerPhone
|
|
this.postData.code = code.length > 4 ? code.slice(0, 4) : code
|
|
this.postData.code = code.length > 4 ? code.slice(0, 4) : code
|
|
},
|
|
},
|
|
funCutDown () {
|
|
funCutDown () {
|
|
@@ -77,12 +78,12 @@
|
|
// 获取验证码
|
|
// 获取验证码
|
|
funGetCode () {
|
|
funGetCode () {
|
|
const numCount = this.numCount
|
|
const numCount = this.numCount
|
|
- const { orderUserPhone, capture } = this.postData
|
|
|
|
|
|
+ const { partnerPhone, capture } = this.postData
|
|
if (numCount < 60 && numCount > 0) {
|
|
if (numCount < 60 && numCount > 0) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.numCount = 60
|
|
this.numCount = 60
|
|
- if (!(/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(orderUserPhone))) {
|
|
|
|
|
|
+ if (!(/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(partnerPhone))) {
|
|
Toast('请输入手机号码')
|
|
Toast('请输入手机号码')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -92,7 +93,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.funCutDown()
|
|
this.funCutDown()
|
|
- sendSMS(orderUserPhone, 0, capture).then(res => {
|
|
|
|
|
|
+ sendSMS(partnerPhone, 1, capture).then(res => {
|
|
if (res.status) {
|
|
if (res.status) {
|
|
Toast('发送成功')
|
|
Toast('发送成功')
|
|
}
|
|
}
|
|
@@ -107,9 +108,9 @@
|
|
this.strCapture = STRCAPTURE + '?' + new Date().getTime()
|
|
this.strCapture = STRCAPTURE + '?' + new Date().getTime()
|
|
},
|
|
},
|
|
verifyData () {
|
|
verifyData () {
|
|
- const { orderUserPhone, code } = this.postData
|
|
|
|
|
|
+ const { partnerPhone, code } = this.postData
|
|
this.arrErrorList = []
|
|
this.arrErrorList = []
|
|
- if (!/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(orderUserPhone)) {
|
|
|
|
|
|
+ if (!/^1[2|3|4|5|6|7|8|9]\d{9}$/.test(partnerPhone)) {
|
|
this.arrErrorList.push('请输入手机号码')
|
|
this.arrErrorList.push('请输入手机号码')
|
|
}
|
|
}
|
|
if (!(/^\d{4}$/.test(code))) {
|
|
if (!(/^\d{4}$/.test(code))) {
|
|
@@ -124,7 +125,29 @@
|
|
forbidClick: true
|
|
forbidClick: true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- this.$router.replace({ path: '/partner' })
|
|
|
|
|
|
+ const myToast = Toast.loading({
|
|
|
|
+ message: '提交中...',
|
|
|
|
+ duration: 1000 * 100,
|
|
|
|
+ forbidClick: true
|
|
|
|
+ })
|
|
|
|
+ partnerLogin(this.postData).then(res => {
|
|
|
|
+ myToast.clear()
|
|
|
|
+ if (res.status) {
|
|
|
|
+ Toast({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '提交成功',
|
|
|
|
+ forbidClick: true,
|
|
|
|
+ onClose: () => {
|
|
|
|
+ this.$router.replace({ path: '/partner' })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ Toast(res.msg)
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ myToast.clear()
|
|
|
|
+ Toast(err.msg)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|