Przeglądaj źródła

注册优软 适配产城

hangb 7 lat temu
rodzic
commit
d58347b238

+ 1 - 4
components/default/AccountCenterHeader.vue

@@ -4,7 +4,7 @@
       <div class="navbar-container container">
         <div class="navbar-header">
           <a href="http://www.ubtob.com" class="item navbar-link">
-            <img :src="loginStyle.logoUrl || ''" class="navbar-logo">
+            <img src="https://dfs.ubtob.com/group1/M00/62/0F/CgpkyFp3uZmAHIU6AAANkRVx1Gk236.png" class="navbar-logo">
           </a>
           <a href=""><span class="navbar-slogan">账号中心</span></a>
         </div>
@@ -19,9 +19,6 @@
       return {}
     },
     computed: {
-      loginStyle () {
-        return this.$store.state.login.loginStyle.data.content
-      }
 //      user () {
 //        return this.$store.state.option.user
 //      },

+ 308 - 0
components/default/RegisterCenterHeader.vue

@@ -0,0 +1,308 @@
+<template>
+  <header class="header">
+    <nav class="navbar">
+      <div class="navbar-container container">
+        <div class="navbar-header">
+          <a href="http://www.ubtob.com" class="item navbar-link">
+            <img :src="loginStyle.logoUrl ? loginStyle.logoUrl : 'https://dfs.ubtob.com/group1/M00/62/0F/CgpkyFp3uZmAHIU6AAANkRVx1Gk236.png'" class="navbar-logo">
+          </a>
+          <a href=""><span class="navbar-slogan">账号中心</span></a>
+        </div>
+      </div>
+    </nav>
+  </header>
+</template>
+<script>
+  export default {
+    name: 'AccountCenterHeader',
+    data () {
+      return {}
+    },
+    computed: {
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      }
+//      user () {
+//        return this.$store.state.option.user
+//      },
+//      enterprise () {
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          return ens.find(item => item.current) || {enName: '个人账户'}
+//        } else {
+//          return {enName: '个人账户'}
+//        }
+//      },
+//      sortEnterprises () {
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          ens.sort(function (a, b) {
+//            return b.lastLoginTime - a.lastLoginTime
+//          })
+//        }
+//        return ens
+//      },
+//      url () {
+//        return this.$store.state.option.url
+//      }
+    },
+    methods: {
+//      logout () {
+//        this.$http.get('/logout/crossBefore').then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+//          }
+//        })
+//      },
+//      onLoginClick () {
+//        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+//          }
+//        })
+//      },
+//      onRegisterClick () {
+//        this.$http.get('/register/page').then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.content
+//          }
+//        })
+//      },
+//      // 切换当前企业
+//      switchEnterprise (en) {
+//        this.showEnterpriseToggle = false
+//        this.$http.get(`/user/authentication/${en.uu}`).then(() => {
+//          this.$store.dispatch('loadUserInfo')
+//          window.location.href = '/'
+//        })
+//      },
+//      toVendor: function () {
+//        let isSelf = true
+//        let tempEnterprise = {}
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          ens.forEach(function (item) {
+//            if (item.current) {
+//              isSelf = false
+//              tempEnterprise = item
+//            }
+//          })
+//        } else {
+//          isSelf = true
+//        }
+//        if (isSelf) {
+//          window.location.href = '/register-saler'
+//        } else {
+//          if (tempEnterprise.isVendor === 313) {
+//            window.location.href = '/vendor#/index'
+//          } else {
+//            window.location.href = '/register-saler'
+//          }
+//        }
+//      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  @import '~assets/scss/mixins';
+  @import '~assets/scss/variables';
+
+  $nav-height: 60px;
+  $nav-boxshadow: 2px 2px 5px rgba(0,0,0,.12);
+  $nav-color: #3c3c3c;
+  .header .navbar{
+    min-height: inherit;
+    border-radius: 0;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
+    font-size: 12px;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
+    width: 100%;
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    height: 25px;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
+    height: 30px;
+  }
+  .dropdown-menu>li>a{
+    padding: 0;
+    line-height: 30px;
+  }
+  .dropdown-menu>li a:hover{
+    background: none;
+    text-decoration: underline !important;
+  }
+  .header {
+    height: $nav-height;
+
+  .navbar {
+    width: 100%;
+    height: 100%;
+    font-size: $font-size-small;
+    background-color: $black-light;
+    box-shadow: $nav-boxshadow;
+    -o-box-shadow: $nav-boxshadow;
+    -moz-box-shadow: $nav-boxshadow;
+    -webkit-box-shadow: $nav-boxshadow;
+
+  .navbar-container {
+
+  .item-wrap {
+    display: inline-block;
+  }
+
+  .item {
+    color: $nav-color;
+    display: inline-block;
+    height: $nav-height;
+    line-height: $nav-height;
+  }
+
+  a {
+    position: relative;
+    color: $nav-color;
+    font-weight: bold;
+    font-size: 16px;
+    > span:before{
+        content: '';
+        position: absolute;
+        top: 5px;
+        left: 16px;
+        width: 1px;
+        height: 14px;
+        background: #bfbfbf;
+      }
+  }
+
+  .navbar-header {
+    float: left;
+
+  .navbar-logo {
+    margin-bottom: 2px;
+  }
+
+  .navbar-slogan {
+    margin-left: $sm-pad;
+  }
+
+  }
+
+  .navbar-right {
+    float: right;
+
+  .item {
+    padding: 0 $pad;
+  }
+
+  .dropdown {
+  .dropdown-toggle {
+    line-height: $nav-height;
+    border-left: 1px solid $black-light;
+    border-right: 1px solid $black-light;
+    height: 35px;
+  a {
+    margin-left: 15px;
+    float: right;
+  &:hover {
+     color: $red !important;
+   }
+  }
+  &:hover {
+     border-left: 1px solid #999;
+     border-right: 1px solid #999;
+   }
+  span {
+    display: inline-block;
+    max-width: 190px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    float: right;
+  }
+  }
+  .menu-item-first {
+    background: #eee;
+    padding: 0 12px;
+    line-height: 30px;
+    font-size: 12px;
+  >span:nth-child(1) {
+     cursor: default;
+     font-weight: bold;
+   }
+  input {
+    width: 174px;
+    height: 24px;
+    margin-left: 35px;
+    background: #fff;
+    border: 1px solid #5078cb;
+    padding-left: 4px;
+  }
+  .search-enterprise {
+    display: inline-block;
+    width: 36px;
+    height: 24px;
+    color: #fff;
+    background: #5078cb;
+    text-align: center;
+    line-height: 24px;
+    cursor: pointer;
+  }
+  }
+
+  .dropdown-menu {
+    padding: 0 6px 13px;
+    margin:0;
+    border-radius: 0;
+    right: unset;
+    background: #fff;
+    border: 1px solid #999999;
+    border-top: none;
+    -webkit-box-shadow: none;
+    -moz-box-shadow: none;
+    box-shadow: none;
+
+  ::-webkit-scrollbar {
+    background: #f6f6f6;
+  }
+
+  ul {
+    max-height: 300px;
+    overflow-y: auto;
+    background: #f6f6f6;
+  }
+
+  .menu-item {
+    padding: 0 12px;
+  a {
+    color: #333;
+    max-width: 300px;
+    line-height: 30px;
+    width: auto;
+  &:hover {
+     color: #5078cb;
+     text-decoration: none!important;
+   }
+  }
+  }
+  }
+
+  &:hover {
+     background-color: $white;
+
+  .dropdown-toggle {
+    color: $text;
+  }
+  a {
+    color: $text
+  }
+  }
+  }
+  }
+  }
+  }
+  }
+</style>

+ 1 - 5
components/login/Login.vue

@@ -72,7 +72,7 @@
                   <a class="code-click" @click="getCode">看不清换一张</a>
                 </el-form-item>
                 <el-form-item class="text-position">
-                  <div class="page-part" v-if="checkedRemember">
+                  <div class="page-part" v-if="loginStyle.needRememberPwd">
                     <el-checkbox v-model="checked">记住密码</el-checkbox>
                   </div>
                   <a class="forget" id='forget' @click="goForgetPassword">忘记密码?</a>
@@ -207,7 +207,6 @@
           spaceUU: ''
         },
         checked: false,
-        checkedRemember: false,
         isShowLoading: false,
         checkUsername: false,
         checkPassword: false,
@@ -301,9 +300,6 @@
         this.appId = request['appId'] || ''
         this.returnUrl = request['returnURL'] || ''
         this.baseUrl = request['baseUrl'] || ''
-        if (this.appId === 'home' || this.appId === 'mall') {
-          this.checkedRemember = true
-        }
       },
       goForgetPassword () {
         let url = `/reset/forgetPasswordValidationAccount?${this.queryLink}`

+ 6 - 1
components/register/PersonalRegistration.vue

@@ -49,7 +49,8 @@
 
             <el-form-item>
               <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
-              <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-if="JSON.parse(agreementUrl.terms).isUrl || ''">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
             </el-form-item>
           </el-form>
         </div>
@@ -362,6 +363,10 @@
     computed: {
       loginStyle () {
         return this.$store.state.login.loginStyle.data.content
+      },
+      agreementUrl () {
+        console.log('agreementUrl', this.$store.state.login.agreementUrl.data.content)
+        return this.$store.state.login.agreementUrl.data.content
       }
     },
     methods: {

+ 130 - 0
pages/common/cityAgreement.vue

@@ -0,0 +1,130 @@
+<template>
+  <div>
+    <template>
+      <div>
+        <accountCenter-header/>
+      </div>
+      <div class="x-content">
+        <div class="container">
+          <div class="x-form-wrap">
+            <%--优软云协议开始--%>
+            <div class="rules-content" v-html="agreementUrl.term"></div>
+          </div>
+        </div>
+      </div>
+    </template>
+    <div v-html="loginStyle.footUrl" style="margin: 50px 0;"></div>
+  </div>
+</template>
+<script>
+  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  export default {
+    layout (context) {
+      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
+    },
+    components: {
+      AccountCenterHeader
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
+    },
+    computed: {
+      isMobile () {
+        return this.$store.state.option.isMobile
+      },
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      },
+      agreementUrl () {
+        console.log('agreementUrl', this.$store.state.login.agreementUrl.data.content)
+        return this.$store.state.login.agreementUrl.data.content
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .w-form-wrap {
+    padding: .2rem;
+    background: #fff;
+    border: 1px solid #e4ecf3;
+    padding-bottom: .4rem;
+    .rules-content {
+      width: 100%;
+      margin: 0 auto;
+      h3 {
+        font-size: 14px;
+        font-weight: bold;
+        line-height: 80px;
+        text-align: center;
+        margin-bottom: 0;
+        color: #333;
+      }
+      .content {
+        width: 98%;
+        margin: 0 auto;
+        font-size: 14px;
+        color: #333;
+        p {
+          font-size: 14px;
+          color: #333;
+          margin-bottom: 0;
+          line-height: 35px;
+          strong{
+            font-weight: bold;
+          }
+        }
+        div {
+          line-height: 35px;
+        }
+      }
+    }
+  }
+  .x-content {
+    position: relative;
+    margin-top: 30px;
+    .container{
+      width: 990px!important;
+      position: relative;
+      .x-form-wrap {
+        padding: 20px;
+        background: #fff;
+        border: 1px solid #e4ecf3;
+        padding-bottom: 40px;
+        .rules-content {
+          width: 100%;
+          margin: 0 auto;
+          h3 {
+            font-size: 18px;
+            font-weight: bold;
+            line-height: 80px;
+            text-align: center;
+            margin-bottom: 0;
+            color: #333;
+          }
+          .content {
+            width: 98%;
+            margin: 0 auto;
+            font-size: 14px;
+            color: #333;
+            p {
+              font-size: 14px;
+              color: #333;
+              margin-bottom: 0;
+              /* text-indent: 2em; */
+              line-height: 35px;
+              strong{
+                font-weight: bold;
+              }
+            }
+            div {
+              line-height: 35px;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 7 - 4
pages/register/enterpriseRegistration.vue

@@ -6,13 +6,13 @@
       <footer-mobile/>
     </template>
     <template v-else>
-      <accountCenter-header/>
+      <registerCenter-header/>
       <enterprise-registration/>
     </template>
   </div>
 </template>
 <script>
-  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
   import EnterpriseRegistration from '~components/register/EnterpriseRegistration.vue'
   import { HeaderMobile, FooterMobile } from '~components/mobile'
   import registerEnterpriseMobile from '~components/mobile/registerEnterprise'
@@ -21,10 +21,13 @@
       return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
     },
     fetch ({store, route}) {
-      return Promise.all([store.dispatch('GetLoginStyle', {appId: route.query.appId})])
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
     },
     components: {
-      AccountCenterHeader,
+      RegisterCenterHeader,
       EnterpriseRegistration,
       registerEnterpriseMobile,
       HeaderMobile,

+ 7 - 4
pages/register/personalRegistration.vue

@@ -6,13 +6,13 @@
       <footer-mobile/>
     </template>
     <template v-else>
-      <accountCenter-header/>
+      <registerCenter-header/>
       <personal-registration/>
     </template>
   </div>
 </template>
 <script>
-  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
   import PersonalRegistration from '~components/register/PersonalRegistration.vue'
   import { HeaderMobile, FooterMobile } from '~components/mobile'
   import registerPersonalMobile from '~components/mobile/registerPersonal'
@@ -21,10 +21,13 @@
       return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
     },
     fetch ({store, route}) {
-      return Promise.all([store.dispatch('GetLoginStyle', {appId: route.query.appId})])
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
     },
     components: {
-      AccountCenterHeader,
+      RegisterCenterHeader,
       PersonalRegistration,
       HeaderMobile,
       FooterMobile,

+ 9 - 0
store/index.js

@@ -129,5 +129,14 @@ export const actions = {
       }, err => {
         commit('login/GET_LOGIN_STYLE_FAILURE', err)
       })
+  },
+  // 获取协议
+  GetAgreementUrl ({ commit }, params = {}) {
+    return axios.get('/api/app/getAgreementUrl', { params })
+      .then(response => {
+        commit('login/REQUEST_AGREEMENT_URL_SUCCESS', response.data)
+      }, err => {
+        commit('login/GET_AGREEMENT_URL_FAILURE', err)
+      })
   }
 }

+ 14 - 0
store/login.js

@@ -21,6 +21,10 @@ export const state = () => ({
   loginStyle: {
     fetching: false,
     data: {}
+  },
+  agreementUrl: {
+    fetching: false,
+    data: {}
   }
 })
 
@@ -37,5 +41,15 @@ export const mutations = {
   },
   REQUEST_LOGIN_STYLE_FAILURE (state) {
     state.loginStyle.fetching = false
+  },
+  REQUEST_AGREEMENT_URL (state) {
+    state.agreementUrl.fetching = true
+  },
+  REQUEST_AGREEMENT_URL_SUCCESS (state, result) {
+    state.agreementUrl.data = result
+    state.agreementUrl.fetching = false
+  },
+  REQUEST_AGREEMENT_URL_FAILURE (state) {
+    state.agreementUrl.fetching = false
   }
 }