Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

yangc 7 лет назад
Родитель
Сommit
6c101235d3
2 измененных файлов с 51 добавлено и 15 удалено
  1. 3 0
      components/login/Login.vue
  2. 48 15
      pages/agency/index.vue

+ 3 - 0
components/login/Login.vue

@@ -495,6 +495,9 @@
             display:inline-block;
             padding: 10px 20px;
             width: 33%;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
             height: 42px;
             line-height: 21px;
             font-size: 12px;

+ 48 - 15
pages/agency/index.vue

@@ -1,12 +1,17 @@
-
-
-
-
-
 <template>
-  <div class="logout">
-    <loading/>
-    <p>跳转中,请稍后...</p>
+  <div>
+    <div class="logout">
+      <loading/>
+      <p>跳转中,请稍后...</p>
+    </div>
+    <template v-if="isMobile">
+      <mt-popup v-model="popupVisible" position="right" class="mint-popup" :modal="false">
+        <ul style="height:100vh;overflow-y:auto">
+          <li class="listitem itemgreen">选择您要登录的公司:</li>
+          <li v-for="item in enterprise" class="listitem" @click="selectEnterprise(false, item.id)">{{ item.name }}</li>
+        </ul>
+      </mt-popup>
+    </template>
   </div>
 </template>
 
@@ -15,22 +20,42 @@
   export default {
     name: 'agency',
     layout: 'mobile',
+    data () {
+      return {
+        popupVisible: false,
+        spaceUU: ''
+      }
+    },
     components: {
       Loading
     },
     mounted () {
       this.$nextTick(() => {
-        this.agency()
+        this.agency(true)
       })
     },
+    computed: {
+      isMobile () {
+        return this.$store.state.option.isMobile
+      },
+      enterprise () {
+        return this.$store.state.login.chooseRegisterEnterprise.choose.data
+      }
+    },
     methods: {
-      agency () {
+      selectEnterprise (flag, type) {
+        // console.log('type', type)
+        this.spaceUU = type
+        this.popupVisible = flag
+        this.agency(flag)
+      },
+      agency (flag) {
         let param = new FormData()
         param.append('returnUrl', this.$route.query.returnURL || '')
         param.append('appId', this.$route.query.appId || '')
         param.append('token', this.$route.query.token || '')
         param.append('baseUrl', this.$route.query.baseURL || '')
-        param.append('spaceUU', this.$route.query.spaceUU || '')
+        param.append('spaceUU', this.spaceUU || this.$route.query.spaceUU || '')
         param.append('isLoginAll', this.$route.query.isLoginAll || '')
         let config = {
           headers: {'Content-Type': 'multipart/form-data'}
@@ -39,7 +64,11 @@
         this.$http.post(url, param, config)
           .then(response => {
             if (response.data.success) {
-              if (response.data.content.loginUrls) {
+              // console.log('res', response.data.content)
+              if (response.data.content.spaces) {
+                this.$store.commit('login/chooseRegisterEnterprise/GET_ENTERPRISE_SUCCESS', response.data.content.spaces)
+                this.popupVisible = flag
+              } else if (response.data.content.loginUrls) {
                 // 遍历登录url循环让各应用登录(需要跨域)
                 let param = response.data.content.data
                 let a = ''
@@ -52,11 +81,15 @@
                     console.log(data)
                   })
                 }
+                setTimeout(function () {
+                  window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
+                }, 3000)
               }
-              setTimeout(function () {
-                window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
-              }, 3000)
+            } else {
+              return Promise.reject(response.data)
             }
+          }).catch(err => {
+            this.$message.error(err.errMsg)
           })
       }
     }