修改短信验证码发送逻辑

master
于肖磊 2025-09-24 11:50:03 +08:00
parent 36b9a0b99f
commit 6b4b5c44e6
3 changed files with 16 additions and 8 deletions

View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'https://d1.shopxo.vip/',
request_url:'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'https://d1.shopxo.vip/',
static_url:'http://shopxo.com/',
// default
system_type: 'default',

View File

@ -804,8 +804,8 @@ export const number_range_handle = (data, form_value) => {
};
const type_config = [
{ name: '手机号码', value: 'phone-number', check: /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/ },
{ name: '电话号码', value: 'telephone-number', check: [/^0\d{0,3}-?\d{7,8}$/, /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/] },
{ name: '手机号码', value: 'phone-number', check: /^1((3|4|5|6|7|8|9){1}\d{1})\d{8}$/ },
{ name: '电话号码', value: 'telephone-number', check: [/^0\d{0,3}-?\d{7,8}$/, /^1((3|4|5|6|7|8|9){1}\d{1})\d{8}$/] },
{ name: '邮政编码', value: 'postal-code', check: /^[1-9]\d{5}$/ },
{ name: '身份证号码', value: 'id-no', check: /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X|x)$/ },
{ name: '邮箱', value: 'email', check: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ },

View File

@ -8,7 +8,7 @@
<view v-if="propDirection == 'row' && com_data.is_sms_verification == '1'" class="verify-submi-border"></view>
<view v-if="com_data.is_sms_verification == '1'" class="flex-row gap-10">
<input :value="form_value_code" class="uni-input flex-1" :style="com_data.common_style + propStyle" type="text" placeholder="请输入验证码" placeholder-style="color: gray;" @blur="data_code_check" @input="input_code_value_event" />
<button :class="'uni-button flex-row align-c' + ( verify_submit_disabled ? 'verify_disabled' : '')" :style="propStyle + 'height:auto;'" type="default" :disabled="verify_submit_disabled" @click="verify_send_event">{{ verify_submit_text }}</button>
<button :class="'uni-button flex-row align-c' + (verify_submit_disabled ? 'verify_disabled' : '')" :style="propStyle + 'height:auto;'" type="default" :disabled="verify_submit_disabled" @click="verify_send_event">{{ verify_submit_text }}</button>
</view>
</view>
<!-- 图片验证码弹层 -->
@ -115,9 +115,17 @@
form_value_code: com_data?.form_value_code || '',
format: com_data.format,
verify_submit_text: this.$t('login.login.s665h5'),
verify_submit_disabled: true,
verify_submit_disabled: this.get_data_check(com_data?.form_value || '') ? false : true,
});
},
get_data_check(val) {
const data = this.com_data;
if (data) {
data.common_config.format = data.is_telephone === '1' ? 'telephone-number' : 'phone-number';
}
const { is_error = '0' } = get_format_checks(data, val, true);
return !isEmpty(val) && is_error === '0';
},
data_check() {
const data = this.com_data;
if (data) {
@ -195,7 +203,7 @@
}
let self = this;
uni.request({
url: app.globalData.get_request_url('verifysend', 'user'),
url: app.globalData.get_request_url('verifysend', 'forminput'),
method: 'POST',
data: post_data,
dataType: 'json',
@ -251,7 +259,7 @@
//
this.setData({
form_value: e.detail.value,
verify_submit_disabled: !isEmpty(e.detail.value) ? false : true,
verify_submit_disabled: this.get_data_check(e.detail.value) ? false : true,
});
this.$emit('dataChange', { value: e.detail.value, id: this.propDataId });
},