| | |
| | | <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" > |
| | |
| | | |
| | | import { addAddress, editAddress, getAddressDetail } from "@/api/address.js"; |
| | | import city from "@/pages/mine/m-city/m-city.vue"; |
| | | import uniMap from "@/pages/subComponents/uniMap.vue"; |
| | | import uniMap from "@/pages/mine/uniMap.vue"; |
| | | import permision from "@/js_sdk/wa-permission/permission.js"; |
| | | export default { |
| | | components: { |
| | |
| | | // 判断当前系统权限定位是否开启 |
| | | }, |
| | | methods: { |
| | | changePhone(e) { |
| | | console.log('-------------------->手机号码修改', e); |
| | | // 去除空格 |
| | | this.form.mobile = this.form.mobile.replace(/\s/g, ''); |
| | | }, |
| | | // 关闭地图 |
| | | closeMap() { |
| | | this.mapFlag = false; |
| | |
| | | |
| | | // 选择地址后数据的回调 |
| | | callBackAddress(val) { |
| | | console.log(val) |
| | | uni.showLoading({ |
| | | title: "加载中", |
| | | }); |
| | |
| | | |
| | | // 保存当前 地址 |
| | | save() { |
| | | this.$refs.uForm.setRules(this.rules); |
| | | this.$refs.uForm.validate((valid) => { |
| | | if (valid) { |
| | | let pages = getCurrentPages(); //获取页面栈 |
| | |
| | | }, |
| | | // 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 |
| | | 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"> |