Browse Source

需求调整

yangc 7 years ago
parent
commit
f51ae41f11

+ 2 - 2
components/applyPurchase/ApplyInfo.vue

@@ -592,8 +592,8 @@ export default {
                     float: left;
                   }
                   &.size-middle {
-                    width: 136px;
-                    margin-right: 37px;
+                    width: 198px;
+                    margin-right: 0;
                     .content {
                       width: 86px;
                     }

+ 59 - 29
components/mobile/MobileFooter.vue

@@ -10,49 +10,76 @@
         <i :class="activeType=='shops'?'iconfont icon-dianpu':'iconfont icon-dianpu1'"></i><p>店铺</p>
       </nuxt-link>
     </span>-->
-    <span class="seek" @click="goSayPrice">
+    <!--<span class="seek" @click="goSayPrice">
       <a>
         <img src="/images/mobile/@2x/applyPurchase/home/seek-footer.png" alt="">
         <p>发布求购</p>
       </a>
+    </span>-->
+    <span :class="{'active': activeType == 'userCenter'}">
+      <a @click="goWithLogin('/mobile/center?type=buyer')">
+        <img :src="`/images/mobile/@2x/home/userCenter${activeType === 'userCenter' ? '-active' : ''}.png`" alt="">
+        <p>买家中心</p>
+      </a>
+    </span>
+    <span :class="{'active': activeType == 'vendorCenter'}">
+      <a @click="goWithLogin('/mobile/center?type=saler')">
+        <img :src="`/images/mobile/@2x/home/vendorCenter${activeType === 'vendorCenter' ? '-active' : ''}.png`" alt="">
+        <p>卖家中心</p>
+      </a>
     </span>
     <span :class="activeType=='user'?'active':''">
-      <a @click="goCollect">
+      <a @click="goWithLogin('/mobile/user?type=buyer')">
         <i :class="activeType=='user'?'iconfont icon-icon':'iconfont icon-wo'"></i><p>我</p>
       </a>
     </span>
     <a @click="toTop" v-show="!hideToTop"><i class="iconfont icon-arrow-up icon-xlg"></i></a>
     <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
-    <publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>
-    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <!--<publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>-->
+    <!--<remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>-->
   </div>
 </template>
 <script>
   import { scrollTo } from '~utils/scroll'
-  import {LoginBox, RemindBox} from '~components/mobile/common'
-  import PublishSeek from './applyPurchase/PublishSeek.vue'
+  import {LoginBox} from '~components/mobile/common'
+//  import PublishSeek from './applyPurchase/PublishSeek.vue'
   export default{
     name: 'MobileFooter',
     data () {
       return {
         hideToTop: true,
-        showLoginBox: false,
-        showSayPriceBox: false,
-        remindText: '',
-        timeoutCount: 0
+        showLoginBox: false
+//        showSayPriceBox: false,
+//        remindText: '',
+//        timeoutCount: 0
       }
     },
     components: {
-      LoginBox,
-      PublishSeek,
-      RemindBox
+      LoginBox
+//      PublishSeek,
+//      RemindBox
     },
     computed: {
       InputGetFocus() {
         return this.$store.state.mobile.InputGetFocus
       },
       activeType () {
-        return this.$route.path === '/' ? 'home' : this.$route.path === '/mobile/shop' ? 'shops' : this.$route.path === '/mobile/user' ? 'user' : ''
+        let path = this.$route.path
+        if (path === '/') {
+          return 'home'
+        } else if (path === '/mobile/shop') {
+          return 'shops'
+        } else if (path === '/mobile/user') {
+          return 'user'
+        } else if (path === '/mobile/center') {
+          if (this.$route.query.type === 'saler') {
+            return 'vendorCenter'
+          } else {
+            return 'userCenter'
+          }
+        } else {
+          return 'home'
+        }
       },
       user () {
         return this.$store.state.option.user
@@ -75,32 +102,32 @@
       toTop () {
         scrollTo('body', 300)
       },
-      goCollect: function () {
+      goWithLogin: function (url) {
         if (this.user.logged) {
-          this.$router.push('/mobile/user?type=buyer')
+          this.$router.push(url)
         } else {
           this.showLoginBox = true
         }
       },
-      onReload: function () {
-        const path = this.$route.path
-        if (path === '/') {
-          this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
-        } else if (path === '/mobile/applyPurchase/list') {
-          this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
-        }
-      },
+//      onReload: function () {
+//        const path = this.$route.path
+//        if (path === '/') {
+//          this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+//        } else if (path === '/mobile/applyPurchase/list') {
+//          this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+//        }
+//      },
       goSayPrice: function () {
         if (this.user.logged) {
           this.showSayPriceBox = true
         } else {
           this.showLoginBox = true
         }
-      },
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount ++
       }
+//      onRemind: function (str) {
+//        this.remindText = str
+//        this.timeoutCount ++
+//      }
     }
   }
 </script>
@@ -120,7 +147,7 @@
   }
   .mobile-footer > span{
     display: inline-block;
-    width: 2rem;
+    width: 25%;
     font-size:.32rem;
     color:#b0b0b0;
     padding-top:.1rem;
@@ -136,6 +163,9 @@
   .mobile-footer > span a p{
     font-size:.22rem;
   }
+  .mobile-footer > span a img{
+    width: .46rem;
+  }
 
   .mobile-footer > span.active a{
     color:#3976f4;

+ 5 - 2
components/mobile/common/userHeader.vue

@@ -48,9 +48,12 @@
     methods: {
       // 切换当前企业
       switchEnterprise(en) {
-        this.showEnterpriseToggle = false
         this.$http.get(`/user/authentication/${en.uu}`).then(() => {
-          this.$store.dispatch('loadUserInfo')
+          this.showEnterpriseToggle = false
+//          this.$router.push('/')
+          this.$store.dispatch('loadUserInfo').then(() => {
+            this.$emit('switchEnAction')
+          })
         })
       },
       setShowEnterpriseToggle(flag, e) {

+ 1 - 1
pages/mobile/applyPurchase/list/index.vue

@@ -99,7 +99,7 @@
         this.reloadData()
       },
       reloadData: function () {
-        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
+        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, isLogin: this.user.logged ? '1' : '0'})
       },
       goLastPage: function () {
         window.history.back(-1)

+ 9 - 47
pages/mobile/usercenter/index.vue → pages/mobile/center/index.vue

@@ -1,29 +1,6 @@
 <template>
   <div class="user-content mobile-content">
-    <div class="user-name">
-      <img src="/images/component/default.png"/>
-      <div class="user-info">
-        <p v-text="userInfo.data.userName"></p>
-        <p>
-          <span class="en-name">{{enterpriseInfo.enName}}</span>
-          <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
-          <span class="vir">|</span>
-          <a class="exit" @click="showLogout = true">退出</a>
-        </p>
-        <ul class="en-list" v-show="showEnterpriseToggle">
-          <li class="menu-item"
-              v-for="en in sortEnterprises"
-              v-if="en.uu != enterpriseInfo.uu"
-              v-bind:key="en.uu">
-            <a @click="switchEnterprise(en)">{{ en.enName }}</a>
-          </li>
-          <li class="menu-item"  v-if="enterpriseInfo.uu">
-            <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
-          </li>
-        </ul>
-      </div>
-      <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
-    </div>
+    <user-header @switchEnAction="onSwitchEn"></user-header>
     <ul class="switch-list" v-if="userType !== 'saler'">
       <li :class="{active: activeType == 'seek'}" @click="activeType = 'seek'" v-text="userType === 'saler' ? '求购询价' : '我的求购'"></li>
       <li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
@@ -363,7 +340,7 @@
 
 <script>
   import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
-  import {RemindBox, Loading} from '~components/mobile/common'
+  import {RemindBox, Loading, userHeader} from '~components/mobile/common'
   import PageLoading from '~components/common/loading/PageLoading.vue'
   export default {
     layout: 'mobile',
@@ -388,7 +365,6 @@
         seekSize: 10,
         purchaseManListData: [],
         isDataChange: false,
-        showEnterpriseToggle: false,
         providerType: 'enterprise',
         GetEnterpriseListData: [],
         isUploadpro: 1, // 是否存在已上架信息
@@ -404,7 +380,8 @@
       RemindBox,
       SeekList,
       PageLoading,
-      Loading
+      Loading,
+      userHeader
     },
     fetch ({ store, route }) {
       let user = store.state.option.user.data
@@ -454,32 +431,17 @@
     mounted: function () {
       this.$nextTick(() => {
         window.addEventListener('scroll', this.scroll, false)
-        document.body.addEventListener('click', () => {
-          this.setShowEnterpriseToggle(false)
-        }, false)
       })
     },
     methods: {
-      // 切换当前企业
-      switchEnterprise (en) {
-        this.showEnterpriseToggle = false
-        this.$http.get(`/user/authentication/${en.uu}`).then(() => {
+      onSwitchEn: function () {
+        if (this.$route.query.type === 'saler' && !this.user.data.enterprise.uu) {
+          this.$router.push('/')
+        } else {
           this.isChange = true
-          this.$store.dispatch('loadUserInfo').then(() => {
-            if (this.userType === 'saler') {
-              this.$router.push('/mobile/user?type=buyer')
-            } else {
-              this.reloadData()
-            }
-          })
+          this.reloadData()
           this.$store.dispatch('loadStoreStatus', { op: 'check' })
-        })
-      },
-      setShowEnterpriseToggle (flag, e) {
-        if (e) {
-          e.stopPropagation()
         }
-        this.showEnterpriseToggle = flag
       },
       cancelFocus: function (type, item, event) {
         event.stopPropagation()

BIN
static/images/mobile/@2x/home/userCenter-active.png


BIN
static/images/mobile/@2x/home/userCenter.png


BIN
static/images/mobile/@2x/home/vendorCenter-active.png


BIN
static/images/mobile/@2x/home/vendorCenter.png