|
@@ -272,7 +272,7 @@
|
|
|
<view v-if="tab == 3" class="padding flex sub-bottom">
|
|
<view v-if="tab == 3" class="padding flex sub-bottom">
|
|
|
<button class="cu-btn round line-blue shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页'
|
|
<button class="cu-btn round line-blue shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页'
|
|
|
}}</button>
|
|
}}</button>
|
|
|
- <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
|
|
|
|
|
|
|
+ <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " v-throttle="sumbit">提交审核</button>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="cu-load load-modal" v-if="lodingshow">
|
|
<view class="cu-load load-modal" v-if="lodingshow">
|
|
|
<image src="/static/logo.png" mode="aspectFit"></image>
|
|
<image src="/static/logo.png" mode="aspectFit"></image>
|
|
@@ -291,6 +291,8 @@
|
|
|
import regionPicker from "../../components/w-picker/region-picker.vue"
|
|
import regionPicker from "../../components/w-picker/region-picker.vue"
|
|
|
// import aMap from "./map.vue"
|
|
// import aMap from "./map.vue"
|
|
|
import status from "../store/components/status.vue"
|
|
import status from "../store/components/status.vue"
|
|
|
|
|
+ import {ACCESS_TOKEN, USER_INFO} from "@/common/util/constants";
|
|
|
|
|
+ import * as $p from "@/uni_modules/uni-easyinput/components/uni-easyinput/common";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -327,6 +329,7 @@
|
|
|
headPhoto: '',
|
|
headPhoto: '',
|
|
|
passWord: uni.getStorageSync('password'),
|
|
passWord: uni.getStorageSync('password'),
|
|
|
phone: uni.getStorageSync('phone'),
|
|
phone: uni.getStorageSync('phone'),
|
|
|
|
|
+ ordinaryUserId:null,
|
|
|
},
|
|
},
|
|
|
formName: {
|
|
formName: {
|
|
|
name: '姓名',
|
|
name: '姓名',
|
|
@@ -356,6 +359,7 @@
|
|
|
// }]
|
|
// }]
|
|
|
markers: [],
|
|
markers: [],
|
|
|
headPhotoImg: [],
|
|
headPhotoImg: [],
|
|
|
|
|
+ loginType:'',
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -370,67 +374,79 @@
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.getCurrentLocation();
|
|
this.getCurrentLocation();
|
|
|
- // this.setDefaultLocation()
|
|
|
|
|
- // uni.getStorage({
|
|
|
|
|
- // key: 'currentAddress',
|
|
|
|
|
- // success: function(res) {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- // let temp = res.data.location.split(',')
|
|
|
|
|
- // this.latitude = temp[1];
|
|
|
|
|
- // this.longitude = temp[0];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // this.marker = [{
|
|
|
|
|
- // id: 0,
|
|
|
|
|
- // latitude: temp[1],
|
|
|
|
|
- // longitude: temp[0],
|
|
|
|
|
- // title: res.data.name,
|
|
|
|
|
- // iconPath: '../../static/boiaoji.png',
|
|
|
|
|
- // width: 30,
|
|
|
|
|
- // height: 30
|
|
|
|
|
- // }];
|
|
|
|
|
- // console.log(this.marker)
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // let currentaddress = uni.getStorageSync('currentAddress')
|
|
|
|
|
- // console.log(currentaddress)
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
this.markers = uni.getStorageSync('address') ? [Object.assign(uni.getStorageSync('address'), {
|
|
this.markers = uni.getStorageSync('address') ? [Object.assign(uni.getStorageSync('address'), {
|
|
|
iconPath: '../../static/boiaoji.png'
|
|
iconPath: '../../static/boiaoji.png'
|
|
|
})] : []
|
|
})] : []
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
async onLoad(data) {
|
|
async onLoad(data) {
|
|
|
-
|
|
|
|
|
|
|
+ if (data.loginType){
|
|
|
|
|
+ // data.loginType =2 需要根据merchantId查询商户临时数据
|
|
|
|
|
+ // data.loginType =3 不需要回显
|
|
|
|
|
+ console.log(data.loginType)
|
|
|
|
|
+ this.loginType = data.loginType;
|
|
|
|
|
+ if(data.loginType === '2') {
|
|
|
|
|
+ this.$http.post('/merchant/examine/new/info/temporary', {
|
|
|
|
|
+ "merchantId": data.merchantId
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ id: data.merchantId,
|
|
|
|
|
+ ordinaryUserId: data.ordinaryUserId,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ type: res.data.result.type == null ? null : res.data.result.type + '',
|
|
|
|
|
+ corporateName: !res.data.result.corporateName ? null : res.data.result.corporateName,
|
|
|
|
|
+ creditCode: !res.data.result.creditCode ? null : res.data.result.creditCode,
|
|
|
|
|
+ lifespanType: !res.data.result.lifespanType ? null : res.data.result.lifespanType,
|
|
|
|
|
+ lifespanBegin: !res.data.result.lifespanBegin ? null : res.data.result.lifespanBegin,
|
|
|
|
|
+ lifespanEnd: !res.data.result.lifespanEnd ? null : res.data.result.lifespanEnd,
|
|
|
|
|
+ businessLicense: !res.data.result.businessLicense ? null : res.data.result.businessLicense,
|
|
|
|
|
+ legalPerson: !res.data.result.legalPerson ? null : res.data.result.legalPerson,
|
|
|
|
|
+ legalPersonCode: !res.data.result.legalPersonCode ? null : res.data.result.legalPersonCode,
|
|
|
|
|
+ storeName: !res.data.result.storeName ? null : res.data.result.storeName,
|
|
|
|
|
+ country: !res.data.result.country ? null : res.data.result.country,
|
|
|
|
|
+ locality: !res.data.result.locality ? null : res.data.result.locality,
|
|
|
|
|
+ address: !res.data.result.address ? null : res.data.result.address,
|
|
|
|
|
+ headPhoto: !res.data.result.headPhotoList ? [] : res.data.result.headPhotoList,
|
|
|
|
|
+ passWord: data.passWord,
|
|
|
|
|
+ phone: data.phone,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.markers = res.data.result.longitude && res.data.result.latitude ? [{
|
|
|
|
|
+ longitude: res.data.result.longitude,
|
|
|
|
|
+ latitude: res.data.result.latitude,
|
|
|
|
|
+ iconPath: '../../static/boiaoji.png'
|
|
|
|
|
+ }] : []
|
|
|
|
|
+ this.businessLicenseImg = !res.data.result.businessLicense ? null : configService.apiUrl + '/' + res.data.result.businessLicense;
|
|
|
|
|
+ this.identityOneImg = !res.data.result.identityOne ? null : configService.apiUrl + '/' + res.data.result.identityOne;
|
|
|
|
|
+ this.identityTwoImg = !res.data.result.identityTwo ? null : configService.apiUrl + '/' + res.data.result.identityTwo;
|
|
|
|
|
+ this.headPhotoImg = res.data.result.headPhotoList ? res.data.result.headPhotoList.split(',').filter(id => id !== '') : []
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if(data.loginType === '3') {
|
|
|
|
|
+ this.form.ordinaryUserId =data.ordinaryUserId;
|
|
|
|
|
+ this.form.name = data.name;
|
|
|
|
|
+ this.form.passWord =data.passWord;
|
|
|
|
|
+ this.form.phone =data.phone;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
if (data.params) {
|
|
if (data.params) {
|
|
|
let obj = JSON.parse(decodeURIComponent(data.params));
|
|
let obj = JSON.parse(decodeURIComponent(data.params));
|
|
|
- this.title = '店铺信息'
|
|
|
|
|
- this.tab = 2
|
|
|
|
|
- obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
|
|
|
|
|
- this.markers = this.form.longitude && this.form.latitude ? [{
|
|
|
|
|
- longitude: this.form.longitude,
|
|
|
|
|
- latitude: this.form.latitude,
|
|
|
|
|
- iconPath: '../../static/boiaoji.png'
|
|
|
|
|
- }] : []
|
|
|
|
|
- this.businessLicenseImg = configService.apiUrl + '/' + obj.businessLicense
|
|
|
|
|
- this.identityOneImg = configService.apiUrl + '/' + obj.identityOne
|
|
|
|
|
- this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
|
|
- obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
|
|
- this.identityTwoImg = configService.apiUrl + '/' + obj.identityTwo
|
|
|
|
|
- obj.locality = obj.locality ? obj.locality : ''
|
|
|
|
|
- this.form = obj
|
|
|
|
|
|
|
+ this.title = '店铺信息'
|
|
|
|
|
+ this.tab = 2
|
|
|
|
|
+ obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
|
|
|
|
|
+ this.markers = this.form.longitude && this.form.latitude ? [{
|
|
|
|
|
+ longitude: this.form.longitude,
|
|
|
|
|
+ latitude: this.form.latitude,
|
|
|
|
|
+ iconPath: '../../static/boiaoji.png'
|
|
|
|
|
+ }] : []
|
|
|
|
|
+ this.businessLicenseImg = configService.apiUrl + '/' + obj.businessLicense
|
|
|
|
|
+ this.identityOneImg = configService.apiUrl + '/' + obj.identityOne
|
|
|
|
|
+ this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
|
|
+ obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
|
|
+ this.identityTwoImg = configService.apiUrl + '/' + obj.identityTwo
|
|
|
|
|
+ obj.locality = obj.locality ? obj.locality : ''
|
|
|
|
|
+ this.form = obj
|
|
|
}
|
|
}
|
|
|
- // let res = await this.$http.get("/merchant/app/allList")
|
|
|
|
|
- // if (res.data.success) {
|
|
|
|
|
- // this.supplierOption = res.data.result
|
|
|
|
|
- // } else {
|
|
|
|
|
- // this.$tip.toast(res.data.message);
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getCurrentLocation() {
|
|
getCurrentLocation() {
|
|
@@ -716,45 +732,86 @@ this.$forceUpdate();
|
|
|
},
|
|
},
|
|
|
sumbit() {
|
|
sumbit() {
|
|
|
if (this.title == '申请入驻') {
|
|
if (this.title == '申请入驻') {
|
|
|
- for (let j in this.form) {
|
|
|
|
|
- console.log(j)
|
|
|
|
|
- console.log(this.form[j])
|
|
|
|
|
- console.log(this.formName[j])
|
|
|
|
|
- if (!this.form[j]) {
|
|
|
|
|
- if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form['lifespanEnd'] ==
|
|
|
|
|
- null)) {
|
|
|
|
|
- this.$tip.alert('请选择日期!')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.form['businessLicense'] == null) {
|
|
|
|
|
- this.$tip.alert('请上传营业执照!')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.formName[j]) {
|
|
|
|
|
- this.$tip.alert(`请填写${this.formName[j]}!`)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- let data = {
|
|
|
|
|
- ...this.form,
|
|
|
|
|
- source: 2,
|
|
|
|
|
- headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
|
|
|
|
|
- longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
|
|
|
|
|
- latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
|
|
|
|
|
- }
|
|
|
|
|
- this.$http.post('/merchant/app/add', data).then(res => {
|
|
|
|
|
- if (res.data.success) {
|
|
|
|
|
- this.$tip.success(res.data.result || '成功')
|
|
|
|
|
- this.$Router.push({
|
|
|
|
|
- name: "login"
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$tip.error(res.data.message);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if(this.loginType){
|
|
|
|
|
+ if(this.loginType === '2'){
|
|
|
|
|
+ //商户临时用户回显 ,修改
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ source: 2,
|
|
|
|
|
+ headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
|
|
|
|
|
+ longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
|
|
|
|
|
+ latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.form.headPhoto, 88);
|
|
|
|
|
+ this.$http.post('/merchant/localMerchantInfo/edit/new', data).then(res => {
|
|
|
|
|
+ if (res.data.success) {
|
|
|
|
|
+ //放入session
|
|
|
|
|
+ const result = res.data.result
|
|
|
|
|
+ const userInfo = result.userInfo
|
|
|
|
|
+ uni.setStorageSync(ACCESS_TOKEN,result.token);
|
|
|
|
|
+ uni.setStorageSync(USER_INFO,userInfo);
|
|
|
|
|
+ this.$store.commit('SET_TOKEN', result.token)
|
|
|
|
|
+ this.$store.commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
|
|
|
|
|
+ this.$store.commit('SET_AVATAR', userInfo.avatar)
|
|
|
|
|
+ this.$tip.success('登录成功!')
|
|
|
|
|
+ this.$Router.replaceAll({
|
|
|
|
|
+ name: 'index'
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$tip.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }else if(this.loginType === '3'){
|
|
|
|
|
+ //普通用户没有商户新增
|
|
|
|
|
+ for (let j in this.form) {
|
|
|
|
|
+ console.log(j)
|
|
|
|
|
+ console.log(this.form[j])
|
|
|
|
|
+ console.log(this.formName[j])
|
|
|
|
|
+ if (!this.form[j]) {
|
|
|
|
|
+ if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form['lifespanEnd'] ==
|
|
|
|
|
+ null)) {
|
|
|
|
|
+ this.$tip.alert('请选择日期!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.form['businessLicense'] == null) {
|
|
|
|
|
+ this.$tip.alert('请上传营业执照!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.formName[j]) {
|
|
|
|
|
+ this.$tip.alert(`请填写${this.formName[j]}!`)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ source: 2,
|
|
|
|
|
+ headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
|
|
|
|
|
+ longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
|
|
|
|
|
+ latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$http.post('/merchant/app/add', data).then(res => {
|
|
|
|
|
+ if (res.data.code==200) {
|
|
|
|
|
+ //放入session
|
|
|
|
|
+ const result = res.data.result
|
|
|
|
|
+ const userInfo = result.userInfo
|
|
|
|
|
+ uni.setStorageSync(ACCESS_TOKEN,result.token);
|
|
|
|
|
+ uni.setStorageSync(USER_INFO,userInfo);
|
|
|
|
|
+ this.$store.commit('SET_TOKEN', result.token)
|
|
|
|
|
+ this.$store.commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
|
|
|
|
|
+ this.$store.commit('SET_AVATAR', userInfo.avatar)
|
|
|
|
|
+ this.$tip.success('登录成功!')
|
|
|
|
|
+ this.$Router.replaceAll({
|
|
|
|
|
+ name: 'index'
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$tip.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
let data = {
|
|
let data = {
|
|
|
...this.form,
|
|
...this.form,
|
|
@@ -764,7 +821,6 @@ this.$forceUpdate();
|
|
|
latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
|
|
latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
|
|
|
}
|
|
}
|
|
|
console.log(this.form.headPhoto, 88);
|
|
console.log(this.form.headPhoto, 88);
|
|
|
-
|
|
|
|
|
this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
|
|
this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
this.$tip.success(res.data.result || '成功')
|
|
this.$tip.success(res.data.result || '成功')
|