From 6a20878b9b1e3460531b055d72d5d671f761abc3 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 16 十月 2025 15:36:20 +0800
Subject: [PATCH] 定制商品
---
pages/mine/address/add.vue | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue
index b2d8df2..85f14ea 100644
--- a/pages/mine/address/add.vue
+++ b/pages/mine/address/add.vue
@@ -3,16 +3,16 @@
<div class="uForm">
<u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules">
<!-- #ifndef H5 -->
- <view class="selectAddress" @click="clickUniMap">
+<!-- <view class="selectAddress" @click="clickUniMap">
閫夋嫨鏀惰揣鍦板潃
- </view>
+ </view> -->
<!-- #endif -->
<u-form-item class="border" label="鏀惰揣浜�" label-width="130" prop="name">
<u-input v-model="form.name" clearable placeholder="璇疯緭鍏ユ敹璐т汉濮撳悕" />
</u-form-item>
<u-form-item label="鎵嬫満鍙风爜" label-width="130" prop="mobile">
- <u-input v-model="form.mobile" type="number" maxlength="11" placeholder="璇疯緭鍏ユ敹璐т汉鎵嬫満鍙风爜" />
+ <u-input v-model="form.mobile" type="number" maxlength="15" placeholder="璇疯緭鍏ユ敹璐т汉鎵嬫満鍙风爜" />
</u-form-item>
<u-form-item label="鎵�鍦ㄥ尯鍩�" label-width="130" prop="___path">
<div @click="showPicker" >
@@ -55,6 +55,11 @@
// 鍒ゆ柇褰撳墠绯荤粺鏉冮檺瀹氫綅鏄惁寮�鍚�
},
methods: {
+ changePhone(e) {
+ console.log('-------------------->鎵嬫満鍙风爜淇敼', e);
+ // 鍘婚櫎绌烘牸
+ this.form.mobile = this.form.mobile.replace(/\s/g, '');
+ },
// 鍏抽棴鍦板浘
closeMap() {
this.mapFlag = false;
@@ -125,7 +130,6 @@
// 閫夋嫨鍦板潃鍚庢暟鎹殑鍥炶皟
callBackAddress(val) {
- console.log(val)
uni.showLoading({
title: "鍔犺浇涓�",
});
@@ -146,6 +150,7 @@
// 淇濆瓨褰撳墠 鍦板潃
save() {
+ this.$refs.uForm.setRules(this.rules);
this.$refs.uForm.validate((valid) => {
if (valid) {
let pages = getCurrentPages(); //鑾峰彇椤甸潰鏍�
@@ -288,8 +293,16 @@
},
// 鍒濆鍖杛ules蹇呴』瑕佸湪onReady鐢熷懡鍛ㄦ湡锛屽洜涓簅nLoad鐢熷懡鍛ㄦ湡缁勪欢鍙兘灏氭湭鍒涘缓瀹屾瘯
onReady() {
- this.$refs.uForm.setRules(this.rules);
+ // this.$refs.uForm.setRules(this.rules);
},
+ watch:{
+ 'form.mobile': function(newVal, oldVal) {
+ // 褰撴墜鏈哄彿鍙樺寲鏃讹紝鑷姩鍘婚櫎绌烘牸
+ if (newVal && typeof newVal === 'string') {
+ this.form.mobile = newVal.replace(/\s/g, '');
+ }
+ }
+ }
};
</script>
<style scoped lang="scss">
--
Gitblit v1.8.0