Procházet zdrojové kódy

提交商户登录逻辑判断
提交商户入驻的逻辑判断

hxl13994548489 před 1 rokem
rodič
revize
988ea033eb

+ 1 - 1
components/yzhua006-update/app-update.vue

@@ -98,12 +98,12 @@
 						vm.platform = res.platform //ios  or android
 					}
 				});
+        // #ifdef APP-PLUS
 				// 获取当前版本号
 				plus.runtime.getProperty(plus.runtime.appid, function(inf) {
 					vm.version = inf.version
 				});
 				vm.getUpdateInfo(); //获取更新信息
-					// #ifdef APP-PLUS
 				// #endif
 			},
 			// 获取线上版本信息

+ 3 - 0
pages/login/login.vue

@@ -224,6 +224,9 @@
 					if (res.data.success) {
 						// #ifdef APP-PLUS
 						this.saveClientId()
+            uni.switchTab({
+              url: '/pages/index/index'
+            })
 						// #endif
 						// #ifndef APP-PLUS
 						this.$tip.success('登录成功!')

+ 2 - 70
pages/login/settled.vue

@@ -384,44 +384,7 @@
         // data.loginType =2  需要根据merchantId查询商户临时数据
         // data.loginType =3  不需要回显
         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==null || data.name =='null') ?"":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.headPhoto ? [] : res.data.result.headPhoto,
-                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.headPhoto ? res.data.result.headPhoto.split(',').filter(id => id !== '') : []
-            }
-          });
-        }else if(data.loginType === '3') {
+       if(data.loginType === '3') {
           this.form.ordinaryUserId =data.ordinaryUserId;
             name: (data.name==null || data.name =='null') ?"":data.name,
           this.form.passWord =data.passWord;
@@ -727,37 +690,7 @@ this.$forceUpdate();
 			sumbit() {
 				if (this.title == '申请入驻') {
           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 => {
-                console.log(res.data.success, 11);
-                if (res.data.success) {
-				         	console.log(res.data.success, 99);
-                  //放入session
-                  const result = res.data.result
-                  const userInfo = result.userInfo
-                  console.log(res.data.success)
-                  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)
-                  uni.switchTab({
-                    url:'/pages/index/index'
-                  })
-                } else {
-                  this.$tip.error(res.data.message);
-                }
-              })
-            }else if(this.loginType === '3'){
+            if(this.loginType === '3'){
               //普通用户没有商户新增
               for (let j in this.form) {
                 console.log(j)
@@ -824,7 +757,6 @@ this.$forceUpdate();
 						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', data).then(res => {
 						if (res.data.success) {
 							this.$tip.success(res.data.result || '成功')

+ 2 - 2
store/index.js

@@ -38,7 +38,8 @@ export default new Vuex.Store({
           if(response.data.code ==200){ 
             const result = response.data.result
             const userInfo = result.userInfo
-            if (userInfo.userState === '1'){
+            console.log(result)
+            if (userInfo.userState === '1' || userInfo.userState === '2'){
               uni.setStorageSync(ACCESS_TOKEN,result.token);
               uni.setStorageSync(USER_INFO,userInfo);
               commit('SET_TOKEN', result.token)
@@ -46,7 +47,6 @@ export default new Vuex.Store({
               commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
               resolve(response)
             }else{
-              console.log(8888888888888888)
               uni.navigateTo({
                 url: `/pages/login/settled?loginType=`+userInfo.userState+'&merchantId='+userInfo.merchantId+'&passWord='+userInfo.passWord
                    +'&name='+userInfo.name +'&ordinaryUserId='+userInfo.ordinaryUserId+'&phone='+userInfo.phone