提交 8a0d0628 编写于 作者: 芊里

手机号仅支持中国大陆

上级 fa1b52d9
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<uni-forms-item name="phone"> <uni-forms-item name="phone">
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号"> v-model="formData.phone" maxlength="11" placeholder="请输入手机号">
<template slot="left"> <template slot="left">
<picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> <!-- 当前仅支持中国大陆手机号 -->
<text class="phone-area">{{currenPhoneArea}}</text> <!-- <picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> -->
</picker> <text class="phone-area" @click="selectPhoneArea">{{currenPhoneArea}}</text>
<!-- </picker> -->
</template> </template>
</uni-easyinput> </uni-easyinput>
</uni-forms-item> </uni-forms-item>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
text: '隐私政策', text: '隐私政策',
to: '/pages/ucenter/agree-list/privacy/privacy' to: '/pages/ucenter/agree-list/privacy/privacy'
}], }],
phoneArea: ['+86', '+87'], phoneArea: ['+86'],
currenPhoneArea: '+86', currenPhoneArea: '+86',
phoneNumber: '', phoneNumber: '',
...@@ -104,8 +105,12 @@ ...@@ -104,8 +105,12 @@
console.log('表单错误信息:', err); console.log('表单错误信息:', err);
}) })
}, },
selectPhoneArea(event) { selectPhoneArea(event) {
this.currenPhoneArea = this.phoneArea[event.detail.value]; uni.showToast({
title: '当前仅支持中国大陆手机号',
icon: 'none'
});
// this.currenPhoneArea = this.phoneArea[event.detail.value];
}, },
sendShortMsg() { sendShortMsg() {
if (!this.canGetShortMsg) return; if (!this.canGetShortMsg) return;
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号"> v-model="formData.phone" maxlength="11" placeholder="请输入手机号">
<template slot="left"> <template slot="left">
<picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> <!-- 当前仅支持中国大陆手机号 -->
<text class="phone-area">{{currenPhoneArea}}</text> <!-- <picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> -->
</picker> <text class="phone-area" @click="selectPhoneArea">{{currenPhoneArea}}</text>
<!-- </picker> -->
</template> </template>
</uni-easyinput> </uni-easyinput>
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
text: '隐私政策', text: '隐私政策',
to: '/pages/ucenter/agree-list/privacy/privacy' to: '/pages/ucenter/agree-list/privacy/privacy'
}], }],
phoneArea: ['+86', '+87'], phoneArea: ['+86'],
currenPhoneArea: '+86', currenPhoneArea: '+86',
formData: { formData: {
...@@ -114,8 +115,12 @@ ...@@ -114,8 +115,12 @@
if (!this.canLogin) return; if (!this.canLogin) return;
// 下边是可以登录 // 下边是可以登录
}, },
selectPhoneArea(event) { selectPhoneArea(event) {
this.currenPhoneArea = this.phoneArea[event.detail.value]; uni.showToast({
title: '当前仅支持中国大陆手机号',
icon: 'none'
});
// this.currenPhoneArea = this.phoneArea[event.detail.value];
}, },
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册