From 25ee0fc249a081bb7bc4b485708c3e1afd3b07d1 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 18 九月 2025 14:13:17 +0800
Subject: [PATCH] 商品兑换卷调整以及绑定电话号码调整

---
 pages/mine/address/add.vue |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue
index 36b821f..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" >
@@ -40,28 +40,26 @@
   </view>
 </template>
 <script>
-import UForm from '@/uview-components/uview-ui/components/u-form/u-form.vue';
-import UFormItem from '@/uview-components/uview-ui/components/u-form-item/u-form-item.vue';
-import UInput from '@/uview-components/uview-ui/components/u-input/u-input.vue';
-import UCheckboxGroup from '@/uview-components/uview-ui/components/u-checkbox-group/u-checkbox-group.vue';
-import UCheckbox from '@/uview-components/uview-ui/components/u-checkbox/u-checkbox.vue';
-import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue';
-import UActionSheet from '@/uview-components/uview-ui/components/u-action-sheet/u-action-sheet.vue';
+import '@/components/uview-components/uview-ui';
 
 import { addAddress, editAddress, getAddressDetail } from "@/api/address.js";
-import city from "@/components/m-city/m-city.vue";
-import uniMap from "@/components/uniMap";
+import city from "@/pages/mine/m-city/m-city.vue";
+import uniMap from "@/pages/mine/uniMap.vue";
 import permision from "@/js_sdk/wa-permission/permission.js";
 export default {
   components: {
     "m-city": city,
-    uniMap,
-	UForm,UFormItem,UInput,UCheckboxGroup,UCheckbox,UIcon,UActionSheet
+    uniMap
   },
   onShow() {
     // 鍒ゆ柇褰撳墠绯荤粺鏉冮檺瀹氫綅鏄惁寮�鍚�
   },
   methods: {
+    changePhone(e) {
+      console.log('-------------------->鎵嬫満鍙风爜淇敼', e);
+      // 鍘婚櫎绌烘牸
+      this.form.mobile = this.form.mobile.replace(/\s/g, '');
+    },
     // 鍏抽棴鍦板浘
     closeMap() {
       this.mapFlag = false;
@@ -132,7 +130,6 @@
 
     // 閫夋嫨鍦板潃鍚庢暟鎹殑鍥炶皟
     callBackAddress(val) {
-      console.log(val)
       uni.showLoading({
         title: "鍔犺浇涓�",
       });
@@ -153,6 +150,7 @@
 
     // 淇濆瓨褰撳墠 鍦板潃
     save() {
+	  this.$refs.uForm.setRules(this.rules);
       this.$refs.uForm.validate((valid) => {
         if (valid) {
           let pages = getCurrentPages(); //鑾峰彇椤甸潰鏍�
@@ -295,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