|
@@ -39,10 +39,10 @@
|
|
|
</view>
|
|
|
<u-input v-model="form.code" placeholder="请输入验证码" type="number" />
|
|
|
<view class="" slot="right">
|
|
|
- <u-button size="mini" type="primary" @click="getCode" shape="circle" :loading="codeLoading" >{{codeText}}</u-button>
|
|
|
+ <u-button size="mini" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
- <u-form-item prop="region">
|
|
|
+<!-- <u-form-item prop="region">
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="map" size="36"></u-icon>
|
|
|
</view>
|
|
@@ -51,6 +51,15 @@
|
|
|
<view class="" slot="right">
|
|
|
<u-icon name="arrow-right" color="#666666" size="36"></u-icon>
|
|
|
</view>
|
|
|
+ </u-form-item> -->
|
|
|
+ <u-form-item prop="region">
|
|
|
+ <view style="margin-right: 10rpx;">
|
|
|
+ <u-icon name="map" size="36"></u-icon>
|
|
|
+ </view>
|
|
|
+ <u-input placeholder="点击选择省市区" v-model="form.region" :disabled="true" @click="inMap"></u-input>
|
|
|
+ <view class="" slot="right">
|
|
|
+ <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
|
|
|
+ </view>
|
|
|
</u-form-item>
|
|
|
<u-form-item prop="addressInfo">
|
|
|
<view style="margin-right: 10rpx;">
|
|
@@ -104,7 +113,18 @@
|
|
|
required: true,
|
|
|
message: '请输入门店名称',
|
|
|
trigger: 'blur,change'
|
|
|
- }],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
|
|
|
+ return this.$u.test.chinese(value);
|
|
|
+ },
|
|
|
+ message: '门店名称必须为中文',
|
|
|
+ // 触发器可以同时用blur和change,二者之间用英文逗号隔开
|
|
|
+ trigger: ['change','blur'],
|
|
|
+ },
|
|
|
+ ],
|
|
|
company: [{
|
|
|
required: true,
|
|
|
message: '请输入公司名称',
|
|
@@ -114,16 +134,51 @@
|
|
|
required: true,
|
|
|
message: '请输入联系人',
|
|
|
trigger: 'blur,change'
|
|
|
+ },{
|
|
|
+ min: 3,
|
|
|
+ max: 5,
|
|
|
+ message: '姓名长度在3到5个字符',
|
|
|
+ trigger: ['change','blur'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
|
|
|
+ return this.$u.test.chinese(value);
|
|
|
+ },
|
|
|
+ message: '姓名必须为中文',
|
|
|
+ // 触发器可以同时用blur和change,二者之间用英文逗号隔开
|
|
|
+ trigger: ['change','blur'],
|
|
|
}],
|
|
|
phone: [{
|
|
|
required: true,
|
|
|
message: '请输入联系电话',
|
|
|
trigger: 'blur,change'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
|
|
|
+ return this.$u.test.mobile(value);
|
|
|
+ },
|
|
|
+ message: '手机号码不正确',
|
|
|
+ // 触发器可以同时用blur和change,二者之间用英文逗号隔开
|
|
|
+ trigger: ['change','blur'],
|
|
|
}],
|
|
|
code: [{
|
|
|
required: true,
|
|
|
message: '请输入验证码',
|
|
|
trigger: 'blur,change'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 6,
|
|
|
+ max: 6,
|
|
|
+ message: '验证码为6位数',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'number',
|
|
|
+ message: '验证码只能为数字',
|
|
|
+ trigger: ['change','blur'],
|
|
|
}],
|
|
|
region: [{
|
|
|
required: true,
|
|
@@ -137,65 +192,72 @@
|
|
|
}],
|
|
|
},
|
|
|
dataUrl: "",
|
|
|
- codeLoading:false,
|
|
|
- modelshow:false,
|
|
|
- modelcontent:"如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照"
|
|
|
+ codeLoading: false,
|
|
|
+ modelshow: false,
|
|
|
+ modelcontent: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照"
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
uni.$on('licenseData', (data) => {
|
|
|
- this.form.store = data.company.words
|
|
|
+ if(data.company.words!="无"){
|
|
|
+ this.form.store = data.company.words
|
|
|
+ }
|
|
|
this.form.company = data.company.words
|
|
|
- this.form.name = data.person.words
|
|
|
+ if(data.company.words!="无"){
|
|
|
+ this.form.name = data.person.words
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
uni.$on('addressData', (data) => {
|
|
|
this.form.latitude = data.latitude
|
|
|
this.form.longitude = data.longitude
|
|
|
- this.form.addressInfo = data.address
|
|
|
+ this.address=data.address
|
|
|
+ this.form.region=this.address.province+"-"+this.address.city+"-"+this.address.district
|
|
|
+ this.form.addressInfo =this.address.addressInfo
|
|
|
})
|
|
|
uni.$on('dataUrl', (data) => {
|
|
|
this.dataUrl = data
|
|
|
})
|
|
|
uni.getSystemInfo({
|
|
|
- success:res=>{
|
|
|
- this.SystemInfo=res
|
|
|
+ success: res => {
|
|
|
+ this.SystemInfo = res
|
|
|
console.log(res)
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- if(this.SystemInfo.platform=='ios'){
|
|
|
+ if (this.SystemInfo.platform == 'ios') {
|
|
|
this.judgeIosPermission('location')
|
|
|
uni.showModal({
|
|
|
title: "温馨提示",
|
|
|
content: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照?",
|
|
|
confirmText: "确认",
|
|
|
- showCancel:false
|
|
|
+ showCancel: false
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
|
|
|
- this.modelshow=true
|
|
|
+ this.modelshow = true
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
judgeIosPermission(permisionID) {
|
|
|
let result = permision.judgeIosPermission(permisionID)
|
|
|
- if(!result){
|
|
|
+ if (!result) {
|
|
|
this.getLocation()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.getLocation()
|
|
|
}
|
|
|
},
|
|
|
async requestAndroidPermission(permisionID) {
|
|
|
- let result = await permision.requestAndroidPermission(permisionID)
|
|
|
+ let result = await permision.requestAndroidPermission(permisionID)
|
|
|
if (result == 1) {
|
|
|
- this.getLocation()
|
|
|
+ this.getLocation()
|
|
|
} else if (result == 0) {
|
|
|
- this.getLocation()
|
|
|
+ this.getLocation()
|
|
|
} else {
|
|
|
- this.getLocation()
|
|
|
+ this.getLocation()
|
|
|
}
|
|
|
},
|
|
|
- getLocation(){
|
|
|
+ getLocation() {
|
|
|
let that = this
|
|
|
uni.getLocation({
|
|
|
type: 'wgs84',
|
|
@@ -260,13 +322,13 @@
|
|
|
},
|
|
|
getCode() {
|
|
|
if (this.form.phone) {
|
|
|
- this.codeLoading=true
|
|
|
+ this.codeLoading = true
|
|
|
request({
|
|
|
url: '/sailun/appStoreBasicInfo/sendCode',
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
"phoneNumber": parseInt(this.form.phone),
|
|
|
- "opreaType":"0"
|
|
|
+ "opreaType": "0"
|
|
|
},
|
|
|
}).then(res => {
|
|
|
console.log(res)
|
|
@@ -283,7 +345,7 @@
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
}).finally(() => {
|
|
|
- this.codeLoading=false
|
|
|
+ this.codeLoading = false
|
|
|
// 通知验证码组件内部开始倒计时
|
|
|
})
|
|
|
} else {
|
|
@@ -292,10 +354,10 @@
|
|
|
|
|
|
},
|
|
|
regionConfirm(e) {
|
|
|
- this.form.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
|
|
|
- this.form.province = e.province.label;
|
|
|
- this.form.city = e.city.label;
|
|
|
- this.form.district = e.area.label;
|
|
|
+ // this.form.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
|
|
|
+ // this.form.province = e.province.label;
|
|
|
+ // this.form.city = e.city.label;
|
|
|
+ // this.form.district = e.area.label;
|
|
|
},
|
|
|
inMap() {
|
|
|
this.$u.route({
|