|
@@ -19,7 +19,7 @@
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="home" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-input v-model="form.company" placeholder="请输入公司名称" />
|
|
|
+ <u-input v-model="form.company" placeholder="请输入公司名称" :disabled="true" />
|
|
|
</u-form-item>
|
|
|
<u-form-item prop="name">
|
|
|
<view style="margin-right: 10rpx;">
|
|
@@ -31,13 +31,13 @@
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="phone" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-input v-model="form.phone" placeholder="请输入联系电话" type="number"/>
|
|
|
+ <u-input v-model="form.phone" placeholder="请输入联系电话" type="number" />
|
|
|
</u-form-item>
|
|
|
<u-form-item prop="code">
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="lock" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-input v-model="form.code" placeholder="请输入验证码" type="number"/>
|
|
|
+ <u-input v-model="form.code" placeholder="请输入验证码" type="number" />
|
|
|
<view class="" slot="right">
|
|
|
<u-button size="mini" type="primary" @click="getCode" shape="circle">{{codeText}}</u-button>
|
|
|
</view>
|
|
@@ -46,27 +46,28 @@
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="map" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-input :select-open="pickerShow" v-model="form.region" placeholder="点击选择省市区" @click="pickerShow = true" :disabled="true"></u-input>
|
|
|
+ <u-input :select-open="pickerShow" v-model="form.region" placeholder="点击选择省市区" @click="pickerShow = true"
|
|
|
+ :disabled="true"></u-input>
|
|
|
<view class="" slot="right">
|
|
|
<u-icon name="arrow-right" color="#666666" size="36"></u-icon>
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
- <u-form-item>
|
|
|
+ <u-form-item prop="addressInfo">
|
|
|
<view style="margin-right: 10rpx;">
|
|
|
<u-icon name="map" size="36"></u-icon>
|
|
|
</view>
|
|
|
- <u-input placeholder="点击选择详细地址" :disabled="true" @click="inMap"></u-input>
|
|
|
+ <u-input placeholder="点击选择详细地址" v-model="form.addressInfo" :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>
|
|
|
<u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
|
|
|
- <u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
|
|
|
+ <u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm" :default-region="defaultRegion"></u-picker>
|
|
|
</view>
|
|
|
</u-card>
|
|
|
<view style="margin: 30rpx;">
|
|
|
- <u-button @click="nextStep" type="primary" :ripple="true" ripple-bg-color="#99d4ff">下一步</u-button>
|
|
|
+ <u-button @click="nextStep" type="primary">下一步</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -81,6 +82,7 @@
|
|
|
return {
|
|
|
codeText: '',
|
|
|
pickerShow: false,
|
|
|
+ defaultRegion: [],
|
|
|
form: {
|
|
|
store: '',
|
|
|
company: '',
|
|
@@ -88,97 +90,170 @@
|
|
|
phone: "",
|
|
|
code: '',
|
|
|
region: '',
|
|
|
+ latitude: '',
|
|
|
+ longitude: '',
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ district: "",
|
|
|
+ addressInfo: "",
|
|
|
+
|
|
|
},
|
|
|
rules: {
|
|
|
- store: [{
|
|
|
- required: true,
|
|
|
- message: '请输入门店名称',
|
|
|
- trigger: 'blur,change'
|
|
|
- }],
|
|
|
- company: [{
|
|
|
- required: true,
|
|
|
- message: '请输入公司名称',
|
|
|
- trigger: 'blur,change'
|
|
|
- }],
|
|
|
- name: [{
|
|
|
- required: true,
|
|
|
- message: '请输入联系人',
|
|
|
- trigger: 'blur,change'
|
|
|
- }],
|
|
|
- phone: [{
|
|
|
- required: true,
|
|
|
- message: '请输入联系电话',
|
|
|
- trigger: 'blur,change'
|
|
|
- }],
|
|
|
- code: [{
|
|
|
- required: true,
|
|
|
- message: '请输入验证码',
|
|
|
- trigger: 'blur,change'
|
|
|
- }],
|
|
|
- region: [{
|
|
|
- required: true,
|
|
|
- message: '请选择地区',
|
|
|
- trigger: 'change',
|
|
|
- }],
|
|
|
+ // store: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入门店名称',
|
|
|
+ // trigger: 'blur,change'
|
|
|
+ // }],
|
|
|
+ // company: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入公司名称',
|
|
|
+ // trigger: 'blur,change'
|
|
|
+ // }],
|
|
|
+ // name: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入联系人',
|
|
|
+ // trigger: 'blur,change'
|
|
|
+ // }],
|
|
|
+ // phone: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入联系电话',
|
|
|
+ // trigger: 'blur,change'
|
|
|
+ // }],
|
|
|
+ // code: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入验证码',
|
|
|
+ // trigger: 'blur,change'
|
|
|
+ // }],
|
|
|
+ // region: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择地区',
|
|
|
+ // trigger: 'change',
|
|
|
+ // }],
|
|
|
+ // addressInfo: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择地区',
|
|
|
+ // trigger: 'change',
|
|
|
+ // }],
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ uni.$on('licenseData', (data) => {
|
|
|
+ this.form.store = data.company.words
|
|
|
+ this.form.company = data.company.words
|
|
|
+ this.form.name = data.person.words
|
|
|
+ })
|
|
|
+ uni.$on('addressData', (data) => {
|
|
|
+ console.log(data)
|
|
|
+ this.form.latitude = data.coord.latitude
|
|
|
+ this.form.longitude = data.coord.longitude
|
|
|
+ this.form.addressInfo = data.address
|
|
|
+ })
|
|
|
+ let that = this
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ geocode: true,
|
|
|
+ success: function(res) {
|
|
|
+ switch (res.address.province) {
|
|
|
+ case "北京市":
|
|
|
+ {
|
|
|
+ that.city = "直辖市"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "天津市":
|
|
|
+ {
|
|
|
+ that.city = "直辖市"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "上海市":
|
|
|
+ {
|
|
|
+ that.city = "直辖市"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "重庆市":
|
|
|
+ {
|
|
|
+ that.city = "直辖市"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ that.city = "不是直辖市"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (that.city == "直辖市") {
|
|
|
+ let RegionData = res.address.province + "," + that.city + "," + res.address.district
|
|
|
+ that.defaultRegion = RegionData.split(",");
|
|
|
+ } else {
|
|
|
+ let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
|
|
|
+ that.defaultRegion = RegionData.split(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
methods: {
|
|
|
nextStep() {
|
|
|
this.$refs.uForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- console.log('验证通过');
|
|
|
+ uni.$emit("formData", this.form)
|
|
|
this.$u.route({
|
|
|
url: 'pages/login/register_3',
|
|
|
})
|
|
|
+
|
|
|
} else {
|
|
|
console.log('验证失败');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
codeChange(text) {
|
|
|
this.codeText = text;
|
|
|
},
|
|
|
getCode() {
|
|
|
- console.log(this.form.phone)
|
|
|
- request({
|
|
|
- url: '/sailun/appStoreBasicInfo/sendCode',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- "phoneNumber": parseInt(this.form.phone),
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- if(res.data.code==0){
|
|
|
- if (this.$refs.uCode.canGetCode) {
|
|
|
- // 模拟向后端请求验证码
|
|
|
- uni.showLoading({
|
|
|
- title: '正在获取验证码',
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.hideLoading();
|
|
|
- // 通知验证码组件内部开始倒计时
|
|
|
- this.$refs.uCode.start();
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
- this.$u.toast('倒计时结束后再发送');
|
|
|
+ if (this.form.phone) {
|
|
|
+ request({
|
|
|
+ url: '/sailun/appStoreBasicInfo/sendCode',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ "phoneNumber": parseInt(this.form.phone),
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (this.$refs.uCode.canGetCode) {
|
|
|
+ // 模拟向后端请求验证码
|
|
|
+ uni.showLoading({
|
|
|
+ title: '正在获取验证码',
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ // 通知验证码组件内部开始倒计时
|
|
|
+ this.$refs.uCode.start();
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ this.$u.toast('倒计时结束后再发送');
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if(res.data.code==500){
|
|
|
- this.$u.toast(res.data.msg);
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false;
|
|
|
- uni.hideLoading();
|
|
|
- })
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ this.$u.toast(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$u.toast('请输入手机号');
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
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;
|
|
|
},
|
|
|
- inMap(){
|
|
|
+ inMap() {
|
|
|
this.$u.route({
|
|
|
url: 'pages/login/register_map'
|
|
|
})
|