From c61f03cfe1fcf023c7128f77f3d692aef309f77f Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 30 十月 2025 14:59:59 +0800
Subject: [PATCH] 页面优化
---
pages/mine/address/add.vue | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue
index b57c855..85f14ea 100644
--- a/pages/mine/address/add.vue
+++ b/pages/mine/address/add.vue
@@ -12,7 +12,7 @@
</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" >
@@ -35,7 +35,7 @@
<m-city :provinceData="list" headTitle="鍖哄煙閫夋嫨" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
</m-city>
- <!-- <uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" /> -->
+ <uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
</div>
</view>
</template>
@@ -55,6 +55,11 @@
// 鍒ゆ柇褰撳墠绯荤粺鏉冮檺瀹氫綅鏄惁寮�鍚�
},
methods: {
+ changePhone(e) {
+ console.log('-------------------->鎵嬫満鍙风爜淇敼', e);
+ // 鍘婚櫎绌烘牸
+ this.form.mobile = this.form.mobile.replace(/\s/g, '');
+ },
// 鍏抽棴鍦板浘
closeMap() {
this.mapFlag = false;
@@ -145,6 +150,7 @@
// 淇濆瓨褰撳墠 鍦板潃
save() {
+ this.$refs.uForm.setRules(this.rules);
this.$refs.uForm.validate((valid) => {
if (valid) {
let pages = getCurrentPages(); //鑾峰彇椤甸潰鏍�
@@ -287,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