|
@@ -1,473 +1,475 @@
|
|
|
-;
|
|
|
-var upgradePage = new Vue({
|
|
|
- el: "#upgradePage",
|
|
|
- data: {
|
|
|
- isRequset:true,
|
|
|
- loginLoading: false,
|
|
|
- clubUpgradeUser: {
|
|
|
- userId:'',
|
|
|
- clubId:'',
|
|
|
- contractEmail:'',
|
|
|
- name:'',
|
|
|
- shortName:'',
|
|
|
- socialCreditCode:'',
|
|
|
- mainProduct:[],
|
|
|
- businessLicense:'',
|
|
|
- shopPhoto:'',
|
|
|
- medicalPracticeLicense:'',
|
|
|
- firstClubType:1,
|
|
|
- secondClubType:0,
|
|
|
- department:'',
|
|
|
- provinceId :'',
|
|
|
- cityId : '',
|
|
|
- townId : '',
|
|
|
- address:'',
|
|
|
- linkManIdentity:0
|
|
|
- },
|
|
|
- userMainPros:[],
|
|
|
- formData:new FormData(),
|
|
|
- mentuzCampNullList:[
|
|
|
- {value:'1',name:'整形'},
|
|
|
- {value:'2',name:'轻医美'},
|
|
|
- {value:'3',name:'皮肤科'},
|
|
|
- {value:'4',name:'产后修复'},
|
|
|
- ],
|
|
|
- medicaCampNullList: [
|
|
|
- {name:'美容'},
|
|
|
- {name:'美体'},
|
|
|
- {name:'美发'},
|
|
|
- {name:'皮肤管理'},
|
|
|
- {name:'光电'},
|
|
|
- {name:'综合类'},
|
|
|
- {name:'中医养生'},
|
|
|
- {name:'spa'},
|
|
|
- ],
|
|
|
- mainPros: ['产品','仪器','服务','整形'],
|
|
|
- mainProEdit: '',
|
|
|
- provinceArray:[],
|
|
|
- cityArray: [],//市
|
|
|
- townArray: [],//区
|
|
|
- addressfrom: {
|
|
|
- townID:'',
|
|
|
- provinceID: '',//省id
|
|
|
- cityID: '',
|
|
|
- },
|
|
|
- rule:{
|
|
|
- name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
|
|
|
- phone: '^\\d{6,12}$',
|
|
|
- code: '^\\d{6}$',
|
|
|
- license: '^[a-zA-Z0-9_]{18}$',
|
|
|
- email: '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$',
|
|
|
- password: "^[^\\u4e00-\\u9fa5]{8,16}$"
|
|
|
- },
|
|
|
- flagshow:false,
|
|
|
- businessflag:false,
|
|
|
- typeflag:false,
|
|
|
- secondtypeflag:false,
|
|
|
- mproflag:false,
|
|
|
- userMainProflag:false,
|
|
|
- medicalPracticeLicenseFlag: false,
|
|
|
- userName:''
|
|
|
- },
|
|
|
- computed: {
|
|
|
-
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handleChangeType: function(type){
|
|
|
- if(type === parseInt(this.clubUpgradeUser.firstClubType)) return;
|
|
|
- this.userMainPros = [];
|
|
|
- this.clubUpgradeUser.secondClubType = (type === 1 ? 1 : 5);
|
|
|
- },
|
|
|
- infoInformationData:function(){//机构资料初始化
|
|
|
- var _self = this;
|
|
|
- UserApi.GetApplicationData({userId:_self.clubUpgradeUser.userId},function (response) {
|
|
|
- if(response.code === 0){
|
|
|
- var data = response.data;
|
|
|
- _self.isRequset = false;
|
|
|
- _self.clubUpgradeUser = data.club;
|
|
|
- _self.userIdentity = data.user.userIdentity;
|
|
|
- _self.userName = data.user.userName;
|
|
|
- _self.clubUpgradeUser.clubId = data.user.clubId;
|
|
|
- _self.clubUpgradeUser.userId = data.user.userId;
|
|
|
- _self.clubUpgradeUser.contractEmail = data.club.contractEmail;
|
|
|
- _self.clubUpgradeUser.provinceId = data.club.provinceId;
|
|
|
- _self.clubUpgradeUser.linkManIdentity = data.club.linkManIdentity ? data.club.linkManIdentity : 0;
|
|
|
- _self.clubUpgradeUser.cityId = data.club.cityId;
|
|
|
- _self.clubUpgradeUser.townId= data.club.townId;
|
|
|
- _self.clubUpgradeUser.shopPhoto = data.club.shopPhoto;
|
|
|
- _self.clubUpgradeUser.businessLicense = data.club.businessLicense;
|
|
|
- _self.clubUpgradeUser.firstClubType = data.club.firstClubType;
|
|
|
- _self.clubUpgradeUser.secondClubType = data.club.secondClubType;
|
|
|
- _self.clubUpgradeUser.address = data.club.address;
|
|
|
- if( _self.clubUpgradeUser.firstClubType === 1){
|
|
|
- if(data.club.mainProduct){
|
|
|
- _self.userMainPros = _self.setNewMainpro(data.club.mainProduct);
|
|
|
- _self.medicaCampNullList = _self.setNewMainProduct(_self.userMainPros);
|
|
|
- }else{
|
|
|
- _self.userMainPros = _self.medicaCampNullList;
|
|
|
- }
|
|
|
- }else if(_self.clubUpgradeUser.firstClubType === 2){
|
|
|
- if(data.club.mainProduct){
|
|
|
- _self.userMainPros = _self.setNewMainpro(data.club.mainProduct);
|
|
|
- _self.mentuzCampNullList = _self.setNewMainProduct(_self.userMainPros);
|
|
|
- }else{
|
|
|
- _self.userMainPros = _self.mentuzCampNullList;
|
|
|
- }
|
|
|
- }
|
|
|
- if( _self.clubUpgradeUser.contractEmail){
|
|
|
- _self.clubUpgradeUser.name = data.club.name;
|
|
|
- }else{
|
|
|
- _self.clubUpgradeUser.name = '';
|
|
|
- }
|
|
|
- if(data.club.provinceId ==null){
|
|
|
- _self.clubUpgradeUser.provinceId = 0;
|
|
|
- }
|
|
|
- if(data.club.cityId!==''&&data.club.cityId!=null){
|
|
|
- _self.getcity();
|
|
|
- }else {
|
|
|
- _self.clubUpgradeUser.cityId = 0
|
|
|
- }
|
|
|
- if(data.club.townId!==''&&data.club.townId!=null){
|
|
|
- _self.getcTown();
|
|
|
- }else {
|
|
|
- _self.clubUpgradeUser.townId = 0
|
|
|
- }
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- SubComfirUpgradeFn:function() {//升级会员机构
|
|
|
- var _self = this;
|
|
|
- var pass = verifyForm();
|
|
|
- if (!pass) { this.scrollIntoView(); return false;}
|
|
|
- if(!_self.clubUpgradeUser.linkManIdentity){
|
|
|
- $('#userNameType').parent().addClass("error");
|
|
|
- $('#userNameType').siblings('.errTips').text('请选择联系人身份').addClass("show");
|
|
|
- _self.scrollIntoView();
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(_self.clubUpgradeUser.townId==0||_self.clubUpgradeUser.address==''){
|
|
|
- _self.flagshow = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.flagshow = false;
|
|
|
- _self.scrollIntoView();
|
|
|
- },2000)
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_self.clubUpgradeUser.businessLicense==''||_self.clubUpgradeUser.businessLicense==null){
|
|
|
- _self.businessflag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.businessflag = false;
|
|
|
- },2000)
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_self.clubUpgradeUser.firstClubType==''||_self.clubUpgradeUser.firstClubType==null){
|
|
|
- _self.typeflag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.typeflag = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_self.clubUpgradeUser.firstClubType==1){
|
|
|
- if (_self.clubUpgradeUser.secondClubType == '' || _self.clubUpgradeUser.secondClubType == null) {
|
|
|
- _self.secondtypeflag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.secondtypeflag = false;
|
|
|
- }, 2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(!_self.clubUpgradeUser.medicalPracticeLicense){
|
|
|
- _self.medicalPracticeLicenseFlag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.medicalPracticeLicenseFlag = false;
|
|
|
- }, 2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_self.userMainPros==''){
|
|
|
- _self.mproflag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.mproflag = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- if(_self.clubUpgradeUser.firstClubType==2){
|
|
|
- if(_self.userMainPros ==''){
|
|
|
- _self.userMainProflag = true;
|
|
|
- setTimeout(function () {
|
|
|
- _self.userMainProflag = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- _self.clubUpgradeUser.mainProduct = _self.userMainPros.join("/");
|
|
|
- if (_self.loginLoading) { return false; }
|
|
|
- this.$nextTick(function() {
|
|
|
- var params= {
|
|
|
- userId:_self.clubUpgradeUser.userId,
|
|
|
- clubId:_self.clubUpgradeUser.clubId, //会所Id
|
|
|
- name:_self.clubUpgradeUser.name,
|
|
|
- linkMan:_self.clubUpgradeUser.linkMan,
|
|
|
- linkManIdentity:_self.clubUpgradeUser.linkManIdentity,
|
|
|
- shortName:_self.clubUpgradeUser.shortName,
|
|
|
- contractEmail:_self.clubUpgradeUser.contractEmail,
|
|
|
- provinceId:_self.clubUpgradeUser.provinceId,
|
|
|
- cityId:_self.clubUpgradeUser.cityId,
|
|
|
- townId:_self.clubUpgradeUser.townId,
|
|
|
- address:_self.clubUpgradeUser.address,
|
|
|
- socialCreditCode:_self.clubUpgradeUser.socialCreditCode,
|
|
|
- businessLicense:_self.clubUpgradeUser.businessLicense,
|
|
|
- shopPhoto:_self.clubUpgradeUser.shopPhoto,
|
|
|
- firstClubType:Number(_self.clubUpgradeUser.firstClubType), //机构类型分类 医美:0和生美:1
|
|
|
- secondClubType:Number(_self.clubUpgradeUser.secondClubType), //机构类型二级分类 诊所:1,门诊:2,医院:3
|
|
|
- department:_self.clubUpgradeUser.department, //科室
|
|
|
- medicalPracticeLicense:_self.clubUpgradeUser.medicalPracticeLicense,//资质图片
|
|
|
- mainProduct:_self.clubUpgradeUser.mainProduct,
|
|
|
- };
|
|
|
- _self.loginLoading = true;
|
|
|
- UserApi.ClubUpgrade(params,function (response) {
|
|
|
- if(response.code === 0){
|
|
|
- CAIMEI.Alert('升级信息提交成功,审核通过后您的身份即成为会员机构并且获得500采美豆的奖励','知道了',true,function () {
|
|
|
- _self.clubLoginIndex();
|
|
|
- _self.loginLoading = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.loginLoading = false;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- clubLoginIndex:function(){// 跳过升级直接去个人中心
|
|
|
- window.location.href = '/user/dashboard.html';
|
|
|
- },
|
|
|
- setNewMainProduct:function(arr){
|
|
|
- var Array = [];
|
|
|
- if(arr){
|
|
|
- arr.forEach(function(item){
|
|
|
- var obj ={
|
|
|
- name:item,
|
|
|
- };
|
|
|
- Array.push(obj);
|
|
|
- });
|
|
|
- }
|
|
|
- return Array
|
|
|
- },
|
|
|
- setNewMainpro:function(arr){//回显处理主营内容
|
|
|
- var newArr = [];
|
|
|
- if (arr!=null){
|
|
|
- arr.split('/').forEach(function(item){
|
|
|
- newArr.push(item);
|
|
|
- });
|
|
|
- }
|
|
|
- return newArr
|
|
|
- },
|
|
|
- mainProAdd: function(){
|
|
|
- var _self = this;
|
|
|
- if (_self.mainProEdit.length>0) {
|
|
|
- if (_self.mainPros.indexOf(_self.mainProEdit)<0){
|
|
|
- var obj = {name:_self.mainProEdit};
|
|
|
- if(Number(_self.clubUpgradeUser.firstClubType) == 1){
|
|
|
- if(_self.checkedArray(_self.mainProEdit,_self.medicaCampNullList)){
|
|
|
- CAIMEI.dialog('主营内容已存在!',false);
|
|
|
- }else {
|
|
|
- _self.medicaCampNullList.push(obj);
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(_self.checkedArray(_self.mainProEdit,_self.mentuzCampNullList)){
|
|
|
- CAIMEI.dialog('主营内容已存在!',false);
|
|
|
- }else {
|
|
|
- _self.mentuzCampNullList.push(obj);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- checkedArray:function(content,arr){//判断主营内容是否已存在
|
|
|
- for(var i in arr){
|
|
|
- if(arr[i].name == content){
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- },
|
|
|
- blurHandle: function(event) { // 失去焦点校验
|
|
|
- var el = event.currentTarget;
|
|
|
- verifyHandle(el);
|
|
|
- },
|
|
|
- uploadBusinessLicenseImageFn: function(event){//上传营业执照
|
|
|
- var _this = this;
|
|
|
- var inputDOM = _this.$refs.businessLicenseImage;
|
|
|
- var file = inputDOM.files;
|
|
|
- _this.formData.append('file', file[0]);
|
|
|
- PublicApi.uploadimg(_this.formData,function(response){
|
|
|
- _this.clubUpgradeUser.businessLicense = response.data;
|
|
|
- event.target.value = '';
|
|
|
- });
|
|
|
- },
|
|
|
- uploadMentuzImageFn: function(event){//上传营业执照
|
|
|
- var _this = this;
|
|
|
- var inputDOM = _this.$refs.businessMentuImage;
|
|
|
- var file = inputDOM.files;
|
|
|
- _this.formData.append('file', file[0]);
|
|
|
- PublicApi.uploadimg(_this.formData,function(response){
|
|
|
- _this.clubUpgradeUser.shopPhoto = response.data;
|
|
|
- event.target.value = '';
|
|
|
- });
|
|
|
- },
|
|
|
- uploadMedicaImageFn: function(event){//上传资质证书
|
|
|
- var _this = this;
|
|
|
- var inputDOM = _this.$refs.businessMedicaImage;
|
|
|
- var file = inputDOM.files;
|
|
|
- _this.formData.append('file', file[0]);
|
|
|
- PublicApi.uploadimg(_this.formData,function(response){
|
|
|
- _this.clubUpgradeUser.medicalPracticeLicense = response.data;
|
|
|
- event.target.value = '';
|
|
|
- });
|
|
|
- },
|
|
|
- deleteBusinessImage:function(){//清楚营业执照图片
|
|
|
- this.clubUpgradeUser.businessLicense = '';
|
|
|
- },
|
|
|
- deleteMentuzImage:function(){//清楚门头照图片
|
|
|
- this.clubUpgradeUser.shopPhoto = '';
|
|
|
- },
|
|
|
- deleteMedicalImage:function(){//清楚资质照图片
|
|
|
- this.clubUpgradeUser.medicalPracticeLicense = '';
|
|
|
- },
|
|
|
- // GetProvinceFn: function(){//获取全部省份
|
|
|
- // var _this = this;
|
|
|
- // PublicApi.GetProvince({},function(response){
|
|
|
- // if(response.code == 0){
|
|
|
- // _this.ProvinceList =response.data;
|
|
|
- // }else{
|
|
|
- // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- //
|
|
|
- // ChangeProvince:function () {//选择省份
|
|
|
- // var _self = this;
|
|
|
- // _self.addressfrom.provinceID = event.target.value;
|
|
|
- // _self.clubUpgradeUser.provinceID = event.target.value;
|
|
|
- // if(_self.addressfrom.provinceID==''){//省为请选择时市区初始化
|
|
|
- // _self.cityArray=[];
|
|
|
- // _self.townArray=[];
|
|
|
- // _self.clubUpgradeUser.townID=''
|
|
|
- // }else {
|
|
|
- // _self.GetCtiyFn();
|
|
|
- // }
|
|
|
- // },
|
|
|
- // ChangeGetcity:function(event){//加载市
|
|
|
- // var _self = this;
|
|
|
- // _self.addressfrom.cityID = event.target.value;
|
|
|
- // _self.clubUpgradeUser.cityID = event.target.value;
|
|
|
- // if(_self.addressfrom.cityID==''){
|
|
|
- // _self.townArray=[];
|
|
|
- // }else {
|
|
|
- // _self.GetTownFn();
|
|
|
- // }
|
|
|
- // },
|
|
|
- // ChangeGetcTown:function(event){//选择地区
|
|
|
- // var _self = this;
|
|
|
- // _self.clubUpgradeUser.townID = event.target.value;
|
|
|
- // },
|
|
|
- // GetCtiyFn: function(){//获取市
|
|
|
- // var _self = this;
|
|
|
- // PublicApi.GetCity({ type:1, parentId: _self.addressfrom.provinceID },function(response){
|
|
|
- // if(response.code == 0 ){
|
|
|
- // _self.cityArray = response.data;
|
|
|
- // }else{
|
|
|
- // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // GetTownFn: function(){//获取区
|
|
|
- // var _self = this;
|
|
|
- // PublicApi.GetTown({ type:2, parentId: _self.addressfrom.cityID },function(response){
|
|
|
- // if(response.code == 0 ){
|
|
|
- // _self.townArray = response.data;
|
|
|
- // }else{
|
|
|
- // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- province:function () {
|
|
|
- var _this = this;
|
|
|
- _this.clubUpgradeUser.provinceId = event.target.value;
|
|
|
- if(_this.clubUpgradeUser.provinceId==0){//省为请选择时市区初始化
|
|
|
- _this.cityArray=[];
|
|
|
- _this.townArray=[];
|
|
|
- _this.clubUpgradeUser.townId=0;
|
|
|
- _this.clubUpgradeUser.cityId = 0;
|
|
|
- }else {
|
|
|
- _this.getcity();
|
|
|
- _this.clubUpgradeUser.cityId = 0;
|
|
|
- }
|
|
|
- },
|
|
|
- getcity:function(event){//加载市
|
|
|
- var _this = this;
|
|
|
- PublicApi.GetCity({ type:1, parentId: _this.clubUpgradeUser.provinceId },function(response){
|
|
|
- if(response.code == 0 ){
|
|
|
- _this.cityArray = response.data;
|
|
|
- _this.clubUpgradeUser.cityId = event.target.value;
|
|
|
- if(_this.clubUpgradeUser.cityId==0){
|
|
|
- _this.townArray=[];
|
|
|
- _this.clubUpgradeUser.townId = 0;
|
|
|
- }else {
|
|
|
- _this.getcTown();
|
|
|
- _this.clubUpgradeUser.townId = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getcTown:function(event){
|
|
|
- var _this = this;
|
|
|
- PublicApi.GetTown({ type:2, parentId:_this.clubUpgradeUser.cityId},function(response){
|
|
|
- if(response.code == 0 ){
|
|
|
- _this.townArray = response.data;
|
|
|
- _this.clubUpgradeUser.townId = event.target.value;
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- changeUserNameType:function(event){
|
|
|
- $('#userNameType').parent().removeClass("error");
|
|
|
- $('#userNameType').siblings('.errTips').removeClass("show");
|
|
|
- },
|
|
|
- showViewerImageFn:function(){//预览营业执照图片
|
|
|
- var viewer = new Viewer(document.getElementById('businessLicenseImage'));
|
|
|
- },
|
|
|
- showViewerImageFn1:function(){//预览门头照图片
|
|
|
- var viewer = new Viewer(document.getElementById('uploadMentuzImage'));
|
|
|
- },
|
|
|
- showViewerImageFn2:function(){//预览资质图片
|
|
|
- var viewer = new Viewer(document.getElementById('medicalPracticeLicenseImg'));
|
|
|
- },
|
|
|
- scrollIntoView: function(){
|
|
|
- document.getElementById('upgradePage').scrollIntoView({block: 'start', behavior: 'smooth'});
|
|
|
- },
|
|
|
- },
|
|
|
- created: function () {
|
|
|
-
|
|
|
- },
|
|
|
- mounted: function () {
|
|
|
- var _self = this;
|
|
|
- if(globalUserData){
|
|
|
- _self.clubUpgradeUser.userId = globalUserData.userId;
|
|
|
- _self.clubUpgradeUser.clubId = globalUserData.clubId;
|
|
|
- _self.infoInformationData();
|
|
|
- }
|
|
|
- PublicApi.GetProvince({},function(response){ //省份
|
|
|
- if(response.code == 0){
|
|
|
- console.log(response)
|
|
|
- _self.provinceArray = response.data;
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- });
|
|
|
- $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
- $('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
|
|
|
- }
|
|
|
-});
|
|
|
+;
|
|
|
+var upgradePage = new Vue({
|
|
|
+ el: "#upgradePage",
|
|
|
+ mixins: [dataBaseShare],
|
|
|
+ data: {
|
|
|
+ isRequset:true,
|
|
|
+ loginLoading: false,
|
|
|
+ clubUpgradeUser: {
|
|
|
+ userId:'',
|
|
|
+ clubId:'',
|
|
|
+ contractEmail:'',
|
|
|
+ name:'',
|
|
|
+ shortName:'',
|
|
|
+ socialCreditCode:'',
|
|
|
+ mainProduct:[],
|
|
|
+ businessLicense:'',
|
|
|
+ shopPhoto:'',
|
|
|
+ medicalPracticeLicense:'',
|
|
|
+ firstClubType:1,
|
|
|
+ secondClubType:0,
|
|
|
+ department:'',
|
|
|
+ provinceId :'',
|
|
|
+ cityId : '',
|
|
|
+ townId : '',
|
|
|
+ address:'',
|
|
|
+ linkManIdentity:0
|
|
|
+ },
|
|
|
+ userMainPros:[],
|
|
|
+ formData:new FormData(),
|
|
|
+ mentuzCampNullList:[
|
|
|
+ {value:'1',name:'整形'},
|
|
|
+ {value:'2',name:'轻医美'},
|
|
|
+ {value:'3',name:'皮肤科'},
|
|
|
+ {value:'4',name:'产后修复'},
|
|
|
+ ],
|
|
|
+ medicaCampNullList: [
|
|
|
+ {name:'美容'},
|
|
|
+ {name:'美体'},
|
|
|
+ {name:'美发'},
|
|
|
+ {name:'皮肤管理'},
|
|
|
+ {name:'光电'},
|
|
|
+ {name:'综合类'},
|
|
|
+ {name:'中医养生'},
|
|
|
+ {name:'spa'},
|
|
|
+ ],
|
|
|
+ mainPros: ['产品','仪器','服务','整形'],
|
|
|
+ mainProEdit: '',
|
|
|
+ provinceArray:[],
|
|
|
+ cityArray: [],//市
|
|
|
+ townArray: [],//区
|
|
|
+ addressfrom: {
|
|
|
+ townID:'',
|
|
|
+ provinceID: '',//省id
|
|
|
+ cityID: '',
|
|
|
+ },
|
|
|
+ rule:{
|
|
|
+ name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
|
|
|
+ phone: '^\\d{6,12}$',
|
|
|
+ code: '^\\d{6}$',
|
|
|
+ license: '^[a-zA-Z0-9_]{18}$',
|
|
|
+ email: '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$',
|
|
|
+ password: "^[^\\u4e00-\\u9fa5]{8,16}$"
|
|
|
+ },
|
|
|
+ flagshow:false,
|
|
|
+ businessflag:false,
|
|
|
+ typeflag:false,
|
|
|
+ secondtypeflag:false,
|
|
|
+ mproflag:false,
|
|
|
+ userMainProflag:false,
|
|
|
+ medicalPracticeLicenseFlag: false,
|
|
|
+ userName:''
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleChangeType: function(type){
|
|
|
+ if(type === parseInt(this.clubUpgradeUser.firstClubType)) return;
|
|
|
+ this.userMainPros = [];
|
|
|
+ this.clubUpgradeUser.secondClubType = (type === 1 ? 1 : 5);
|
|
|
+ },
|
|
|
+ infoInformationData:function(){//机构资料初始化
|
|
|
+ var _self = this;
|
|
|
+ UserApi.GetApplicationData({userId:_self.clubUpgradeUser.userId},function (response) {
|
|
|
+ if(response.code === 0){
|
|
|
+ var data = response.data;
|
|
|
+ _self.isRequset = false;
|
|
|
+ _self.clubUpgradeUser = data.club;
|
|
|
+ _self.userIdentity = data.user.userIdentity;
|
|
|
+ _self.userName = data.user.userName;
|
|
|
+ _self.clubUpgradeUser.clubId = data.user.clubId;
|
|
|
+ _self.clubUpgradeUser.userId = data.user.userId;
|
|
|
+ _self.clubUpgradeUser.contractEmail = data.club.contractEmail;
|
|
|
+ _self.clubUpgradeUser.provinceId = data.club.provinceId;
|
|
|
+ _self.clubUpgradeUser.linkManIdentity = data.club.linkManIdentity ? data.club.linkManIdentity : 0;
|
|
|
+ _self.clubUpgradeUser.cityId = data.club.cityId;
|
|
|
+ _self.clubUpgradeUser.townId= data.club.townId;
|
|
|
+ _self.clubUpgradeUser.shopPhoto = data.club.shopPhoto;
|
|
|
+ _self.clubUpgradeUser.businessLicense = data.club.businessLicense;
|
|
|
+ _self.clubUpgradeUser.firstClubType = data.club.firstClubType;
|
|
|
+ _self.clubUpgradeUser.secondClubType = data.club.secondClubType;
|
|
|
+ _self.clubUpgradeUser.address = data.club.address;
|
|
|
+ if( _self.clubUpgradeUser.firstClubType === 1){
|
|
|
+ if(data.club.mainProduct){
|
|
|
+ _self.userMainPros = _self.setNewMainpro(data.club.mainProduct);
|
|
|
+ _self.medicaCampNullList = _self.setNewMainProduct(_self.userMainPros);
|
|
|
+ }else{
|
|
|
+ _self.userMainPros = _self.medicaCampNullList;
|
|
|
+ }
|
|
|
+ }else if(_self.clubUpgradeUser.firstClubType === 2){
|
|
|
+ if(data.club.mainProduct){
|
|
|
+ _self.userMainPros = _self.setNewMainpro(data.club.mainProduct);
|
|
|
+ _self.mentuzCampNullList = _self.setNewMainProduct(_self.userMainPros);
|
|
|
+ }else{
|
|
|
+ _self.userMainPros = _self.mentuzCampNullList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if( _self.clubUpgradeUser.contractEmail){
|
|
|
+ _self.clubUpgradeUser.name = data.club.name;
|
|
|
+ }else{
|
|
|
+ _self.clubUpgradeUser.name = '';
|
|
|
+ }
|
|
|
+ if(data.club.provinceId ==null){
|
|
|
+ _self.clubUpgradeUser.provinceId = 0;
|
|
|
+ }
|
|
|
+ if(data.club.cityId!==''&&data.club.cityId!=null){
|
|
|
+ _self.getcity();
|
|
|
+ }else {
|
|
|
+ _self.clubUpgradeUser.cityId = 0
|
|
|
+ }
|
|
|
+ if(data.club.townId!==''&&data.club.townId!=null){
|
|
|
+ _self.getcTown();
|
|
|
+ }else {
|
|
|
+ _self.clubUpgradeUser.townId = 0
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ SubComfirUpgradeFn:function() {//升级会员机构
|
|
|
+ var _self = this;
|
|
|
+ var pass = verifyForm();
|
|
|
+ if (!pass) { this.scrollIntoView(); return false;}
|
|
|
+ if(!_self.clubUpgradeUser.linkManIdentity){
|
|
|
+ $('#userNameType').parent().addClass("error");
|
|
|
+ $('#userNameType').siblings('.errTips').text('请选择联系人身份').addClass("show");
|
|
|
+ _self.scrollIntoView();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(_self.clubUpgradeUser.townId==0||_self.clubUpgradeUser.address==''){
|
|
|
+ _self.flagshow = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.flagshow = false;
|
|
|
+ _self.scrollIntoView();
|
|
|
+ },2000)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(_self.clubUpgradeUser.businessLicense==''||_self.clubUpgradeUser.businessLicense==null){
|
|
|
+ _self.businessflag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.businessflag = false;
|
|
|
+ },2000)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(_self.clubUpgradeUser.firstClubType==''||_self.clubUpgradeUser.firstClubType==null){
|
|
|
+ _self.typeflag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.typeflag = false;
|
|
|
+ },2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(_self.clubUpgradeUser.firstClubType==1){
|
|
|
+ if (_self.clubUpgradeUser.secondClubType == '' || _self.clubUpgradeUser.secondClubType == null) {
|
|
|
+ _self.secondtypeflag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.secondtypeflag = false;
|
|
|
+ }, 2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!_self.clubUpgradeUser.medicalPracticeLicense){
|
|
|
+ _self.medicalPracticeLicenseFlag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.medicalPracticeLicenseFlag = false;
|
|
|
+ }, 2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(_self.userMainPros==''){
|
|
|
+ _self.mproflag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.mproflag = false;
|
|
|
+ },2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(_self.clubUpgradeUser.firstClubType==2){
|
|
|
+ if(_self.userMainPros ==''){
|
|
|
+ _self.userMainProflag = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.userMainProflag = false;
|
|
|
+ },2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _self.clubUpgradeUser.mainProduct = _self.userMainPros.join("/");
|
|
|
+ if (_self.loginLoading) { return false; }
|
|
|
+ this.$nextTick(function() {
|
|
|
+ var params= {
|
|
|
+ userId:_self.clubUpgradeUser.userId,
|
|
|
+ clubId:_self.clubUpgradeUser.clubId, //会所Id
|
|
|
+ name:_self.clubUpgradeUser.name,
|
|
|
+ linkMan:_self.clubUpgradeUser.linkMan,
|
|
|
+ linkManIdentity:_self.clubUpgradeUser.linkManIdentity,
|
|
|
+ shortName:_self.clubUpgradeUser.shortName,
|
|
|
+ contractEmail:_self.clubUpgradeUser.contractEmail,
|
|
|
+ provinceId:_self.clubUpgradeUser.provinceId,
|
|
|
+ cityId:_self.clubUpgradeUser.cityId,
|
|
|
+ townId:_self.clubUpgradeUser.townId,
|
|
|
+ address:_self.clubUpgradeUser.address,
|
|
|
+ socialCreditCode:_self.clubUpgradeUser.socialCreditCode,
|
|
|
+ businessLicense:_self.clubUpgradeUser.businessLicense,
|
|
|
+ shopPhoto:_self.clubUpgradeUser.shopPhoto,
|
|
|
+ firstClubType:Number(_self.clubUpgradeUser.firstClubType), //机构类型分类 医美:0和生美:1
|
|
|
+ secondClubType:Number(_self.clubUpgradeUser.secondClubType), //机构类型二级分类 诊所:1,门诊:2,医院:3
|
|
|
+ department:_self.clubUpgradeUser.department, //科室
|
|
|
+ medicalPracticeLicense:_self.clubUpgradeUser.medicalPracticeLicense,//资质图片
|
|
|
+ mainProduct:_self.clubUpgradeUser.mainProduct,
|
|
|
+ };
|
|
|
+ _self.loginLoading = true;
|
|
|
+ UserApi.ClubUpgrade(params,function (response) {
|
|
|
+ if(response.code === 0){
|
|
|
+ CAIMEI.Alert('升级信息提交成功,审核通过后您的身份即成为会员机构并且获得500采美豆的奖励','知道了',true,function () {
|
|
|
+ _self.requireBaseLoginStatus(response)
|
|
|
+ _self.clubLoginIndex();
|
|
|
+ _self.loginLoading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ _self.loginLoading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clubLoginIndex:function(){// 跳过升级直接去个人中心
|
|
|
+ window.location.href = '/user/dashboard.html';
|
|
|
+ },
|
|
|
+ setNewMainProduct:function(arr){
|
|
|
+ var Array = [];
|
|
|
+ if(arr){
|
|
|
+ arr.forEach(function(item){
|
|
|
+ var obj ={
|
|
|
+ name:item,
|
|
|
+ };
|
|
|
+ Array.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return Array
|
|
|
+ },
|
|
|
+ setNewMainpro:function(arr){//回显处理主营内容
|
|
|
+ var newArr = [];
|
|
|
+ if (arr!=null){
|
|
|
+ arr.split('/').forEach(function(item){
|
|
|
+ newArr.push(item);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return newArr
|
|
|
+ },
|
|
|
+ mainProAdd: function(){
|
|
|
+ var _self = this;
|
|
|
+ if (_self.mainProEdit.length>0) {
|
|
|
+ if (_self.mainPros.indexOf(_self.mainProEdit)<0){
|
|
|
+ var obj = {name:_self.mainProEdit};
|
|
|
+ if(Number(_self.clubUpgradeUser.firstClubType) == 1){
|
|
|
+ if(_self.checkedArray(_self.mainProEdit,_self.medicaCampNullList)){
|
|
|
+ CAIMEI.dialog('主营内容已存在!',false);
|
|
|
+ }else {
|
|
|
+ _self.medicaCampNullList.push(obj);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(_self.checkedArray(_self.mainProEdit,_self.mentuzCampNullList)){
|
|
|
+ CAIMEI.dialog('主营内容已存在!',false);
|
|
|
+ }else {
|
|
|
+ _self.mentuzCampNullList.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkedArray:function(content,arr){//判断主营内容是否已存在
|
|
|
+ for(var i in arr){
|
|
|
+ if(arr[i].name == content){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ blurHandle: function(event) { // 失去焦点校验
|
|
|
+ var el = event.currentTarget;
|
|
|
+ verifyHandle(el);
|
|
|
+ },
|
|
|
+ uploadBusinessLicenseImageFn: function(event){//上传营业执照
|
|
|
+ var _this = this;
|
|
|
+ var inputDOM = _this.$refs.businessLicenseImage;
|
|
|
+ var file = inputDOM.files;
|
|
|
+ _this.formData.append('file', file[0]);
|
|
|
+ PublicApi.uploadimg(_this.formData,function(response){
|
|
|
+ _this.clubUpgradeUser.businessLicense = response.data;
|
|
|
+ event.target.value = '';
|
|
|
+ });
|
|
|
+ },
|
|
|
+ uploadMentuzImageFn: function(event){//上传营业执照
|
|
|
+ var _this = this;
|
|
|
+ var inputDOM = _this.$refs.businessMentuImage;
|
|
|
+ var file = inputDOM.files;
|
|
|
+ _this.formData.append('file', file[0]);
|
|
|
+ PublicApi.uploadimg(_this.formData,function(response){
|
|
|
+ _this.clubUpgradeUser.shopPhoto = response.data;
|
|
|
+ event.target.value = '';
|
|
|
+ });
|
|
|
+ },
|
|
|
+ uploadMedicaImageFn: function(event){//上传资质证书
|
|
|
+ var _this = this;
|
|
|
+ var inputDOM = _this.$refs.businessMedicaImage;
|
|
|
+ var file = inputDOM.files;
|
|
|
+ _this.formData.append('file', file[0]);
|
|
|
+ PublicApi.uploadimg(_this.formData,function(response){
|
|
|
+ _this.clubUpgradeUser.medicalPracticeLicense = response.data;
|
|
|
+ event.target.value = '';
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteBusinessImage:function(){//清楚营业执照图片
|
|
|
+ this.clubUpgradeUser.businessLicense = '';
|
|
|
+ },
|
|
|
+ deleteMentuzImage:function(){//清楚门头照图片
|
|
|
+ this.clubUpgradeUser.shopPhoto = '';
|
|
|
+ },
|
|
|
+ deleteMedicalImage:function(){//清楚资质照图片
|
|
|
+ this.clubUpgradeUser.medicalPracticeLicense = '';
|
|
|
+ },
|
|
|
+ // GetProvinceFn: function(){//获取全部省份
|
|
|
+ // var _this = this;
|
|
|
+ // PublicApi.GetProvince({},function(response){
|
|
|
+ // if(response.code == 0){
|
|
|
+ // _this.ProvinceList =response.data;
|
|
|
+ // }else{
|
|
|
+ // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ // ChangeProvince:function () {//选择省份
|
|
|
+ // var _self = this;
|
|
|
+ // _self.addressfrom.provinceID = event.target.value;
|
|
|
+ // _self.clubUpgradeUser.provinceID = event.target.value;
|
|
|
+ // if(_self.addressfrom.provinceID==''){//省为请选择时市区初始化
|
|
|
+ // _self.cityArray=[];
|
|
|
+ // _self.townArray=[];
|
|
|
+ // _self.clubUpgradeUser.townID=''
|
|
|
+ // }else {
|
|
|
+ // _self.GetCtiyFn();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // ChangeGetcity:function(event){//加载市
|
|
|
+ // var _self = this;
|
|
|
+ // _self.addressfrom.cityID = event.target.value;
|
|
|
+ // _self.clubUpgradeUser.cityID = event.target.value;
|
|
|
+ // if(_self.addressfrom.cityID==''){
|
|
|
+ // _self.townArray=[];
|
|
|
+ // }else {
|
|
|
+ // _self.GetTownFn();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // ChangeGetcTown:function(event){//选择地区
|
|
|
+ // var _self = this;
|
|
|
+ // _self.clubUpgradeUser.townID = event.target.value;
|
|
|
+ // },
|
|
|
+ // GetCtiyFn: function(){//获取市
|
|
|
+ // var _self = this;
|
|
|
+ // PublicApi.GetCity({ type:1, parentId: _self.addressfrom.provinceID },function(response){
|
|
|
+ // if(response.code == 0 ){
|
|
|
+ // _self.cityArray = response.data;
|
|
|
+ // }else{
|
|
|
+ // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // GetTownFn: function(){//获取区
|
|
|
+ // var _self = this;
|
|
|
+ // PublicApi.GetTown({ type:2, parentId: _self.addressfrom.cityID },function(response){
|
|
|
+ // if(response.code == 0 ){
|
|
|
+ // _self.townArray = response.data;
|
|
|
+ // }else{
|
|
|
+ // CAIMEI.Alert(response.msg,'确定',false);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ province:function () {
|
|
|
+ var _this = this;
|
|
|
+ _this.clubUpgradeUser.provinceId = event.target.value;
|
|
|
+ if(_this.clubUpgradeUser.provinceId==0){//省为请选择时市区初始化
|
|
|
+ _this.cityArray=[];
|
|
|
+ _this.townArray=[];
|
|
|
+ _this.clubUpgradeUser.townId=0;
|
|
|
+ _this.clubUpgradeUser.cityId = 0;
|
|
|
+ }else {
|
|
|
+ _this.getcity();
|
|
|
+ _this.clubUpgradeUser.cityId = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getcity:function(event){//加载市
|
|
|
+ var _this = this;
|
|
|
+ PublicApi.GetCity({ type:1, parentId: _this.clubUpgradeUser.provinceId },function(response){
|
|
|
+ if(response.code == 0 ){
|
|
|
+ _this.cityArray = response.data;
|
|
|
+ _this.clubUpgradeUser.cityId = event.target.value;
|
|
|
+ if(_this.clubUpgradeUser.cityId==0){
|
|
|
+ _this.townArray=[];
|
|
|
+ _this.clubUpgradeUser.townId = 0;
|
|
|
+ }else {
|
|
|
+ _this.getcTown();
|
|
|
+ _this.clubUpgradeUser.townId = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getcTown:function(event){
|
|
|
+ var _this = this;
|
|
|
+ PublicApi.GetTown({ type:2, parentId:_this.clubUpgradeUser.cityId},function(response){
|
|
|
+ if(response.code == 0 ){
|
|
|
+ _this.townArray = response.data;
|
|
|
+ _this.clubUpgradeUser.townId = event.target.value;
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(response.msg, '确定', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeUserNameType:function(event){
|
|
|
+ $('#userNameType').parent().removeClass("error");
|
|
|
+ $('#userNameType').siblings('.errTips').removeClass("show");
|
|
|
+ },
|
|
|
+ showViewerImageFn:function(){//预览营业执照图片
|
|
|
+ var viewer = new Viewer(document.getElementById('businessLicenseImage'));
|
|
|
+ },
|
|
|
+ showViewerImageFn1:function(){//预览门头照图片
|
|
|
+ var viewer = new Viewer(document.getElementById('uploadMentuzImage'));
|
|
|
+ },
|
|
|
+ showViewerImageFn2:function(){//预览资质图片
|
|
|
+ var viewer = new Viewer(document.getElementById('medicalPracticeLicenseImg'));
|
|
|
+ },
|
|
|
+ scrollIntoView: function(){
|
|
|
+ document.getElementById('upgradePage').scrollIntoView({block: 'start', behavior: 'smooth'});
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ var _self = this;
|
|
|
+ if(globalUserData){
|
|
|
+ _self.clubUpgradeUser.userId = globalUserData.userId;
|
|
|
+ _self.clubUpgradeUser.clubId = globalUserData.clubId;
|
|
|
+ _self.infoInformationData();
|
|
|
+ }
|
|
|
+ PublicApi.GetProvince({},function(response){ //省份
|
|
|
+ if(response.code == 0){
|
|
|
+ console.log(response)
|
|
|
+ _self.provinceArray = response.data;
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(response.msg, '确定', false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
+ $('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
|
|
|
+ }
|
|
|
+});
|