浏览代码

Merge remote-tracking branch 'origin/feature/yc-pc_mobile-0516' into feature/yc-pc_mobile-0516

# Conflicts:
#	components/mobile/common/userHeader.vue
shenjj 7 年之前
父节点
当前提交
bf08fc17fe

+ 11 - 1
components/main/Nav.vue

@@ -19,7 +19,7 @@
           <i class="iconfont icon-arrow-down"></i>
           <i class="iconfont icon-arrow-down"></i>
           <i class="iconfont icon-arrow-up"></i>
           <i class="iconfont icon-arrow-up"></i>
         </span>
         </span>
-        <ul class="expand-list">
+        <ul class="expand-list" v-if="isMounted">
           <li v-show="name !== '原厂专区'">
           <li v-show="name !== '原厂专区'">
             <nuxt-link to="/provider/factories">原厂专区</nuxt-link>
             <nuxt-link to="/provider/factories">原厂专区</nuxt-link>
           </li>
           </li>
@@ -43,6 +43,16 @@
 <script>
 <script>
   export default {
   export default {
     name: 'navView',
     name: 'navView',
+    data () {
+      return {
+        isMounted: false
+      }
+    },
+    mounted () {
+      this.$nextTick(() => {
+        this.isMounted = true
+      })
+    },
     computed: {
     computed: {
       name () {
       name () {
         let path = this.$route.path
         let path = this.$route.path

+ 53 - 3
components/mobile/Home.vue

@@ -53,7 +53,7 @@
         <span>最新求购信息</span>
         <span>最新求购信息</span>
         <nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
         <nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
       </div>
       </div>
-      <seek-list :purchaseManList="purchaseManList"></seek-list>
+      <seek-list :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
     </div>
     </div>
     <div class="mobile-modal" v-if="showStoreInfo">
     <div class="mobile-modal" v-if="showStoreInfo">
       <div class="mobile-modal-box">
       <div class="mobile-modal-box">
@@ -96,7 +96,13 @@
         },
         },
         remindText: '',
         remindText: '',
         timeoutCount: 0,
         timeoutCount: 0,
-        showLoginBox: false
+        showLoginBox: false,
+        isSearchSearchingMore: false,
+        page: 1,
+        size: 5,
+        purchaseManListData: [],
+        isChange: false,
+        isDataChange: false
       }
       }
     },
     },
     components: {
     components: {
@@ -105,12 +111,48 @@
       RemindBox,
       RemindBox,
       LoginBox
       LoginBox
     },
     },
+    mounted: function () {
+      this.$nextTick(() => {
+        window.addEventListener('scroll', this.scroll, false)
+      })
+    },
+    watch: {
+      '$store.state.applyPurchase.purchaseManList.purchaseHomeList.data': {
+        handler: function (val) {
+          if (this.isChange) {
+            this.purchaseManListData = []
+            this.page = 1
+            this.isChange = false
+            this.isDataChange = false
+          } else {
+            this.purchaseManListData = this.purchaseManListData.concat(val.content)
+            this.isSearchSearchingMore = false
+            this.isDataChange = true
+          }
+        },
+        immediate: true
+      }
+//      $route: {
+//        handler: function (val) {
+//          window.removeEventListener('scroll', this.scroll)
+//        }
+//      }
+    },
     computed: {
     computed: {
       purchaseManList () {
       purchaseManList () {
-        return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data.content
+        return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data
+      },
+      allPage () {
+        return Math.floor(this.purchaseManList.totalElements / this.purchaseManList.size) + Math.floor(this.purchaseManList.totalElements % this.purchaseManList.size > 0 ? 1 : 0)
       }
       }
     },
     },
     methods: {
     methods: {
+      scroll: function () {
+        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+        if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
+          this.getMoreSearch()
+        }
+      },
       onHomeSearchClick () {
       onHomeSearchClick () {
         this.showMainSearch = true
         this.showMainSearch = true
         this.$store.dispatch('searchData/getSearchHistory')
         this.$store.dispatch('searchData/getSearchHistory')
@@ -132,6 +174,14 @@
       onRemind: function (str) {
       onRemind: function (str) {
         this.remindText = str
         this.remindText = str
         this.timeoutCount ++
         this.timeoutCount ++
+      },
+      reloadData: function () {
+        this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, isLogin: this.user.logged ? '1' : '0'})
+      },
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchSearchingMore = true
+        this.reloadData()
       }
       }
     }
     }
   }
   }

+ 0 - 1
components/mobile/applyPurchase/PublishSupplierSeek.vue

@@ -63,7 +63,6 @@
 //      },
 //      },
       product: {
       product: {
         handler (val, oldVal) {
         handler (val, oldVal) {
-          console.log(val)
           if (val) {
           if (val) {
             let isStandard = val.standard === 1
             let isStandard = val.standard === 1
             this.applyObj.code = val.cmpCode
             this.applyObj.code = val.cmpCode

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

@@ -4,8 +4,8 @@
       <img src="/images/component/default.png"/>
       <img src="/images/component/default.png"/>
       <div class="user-info">
       <div class="user-info">
         <p v-text="userInfo.data.userName"></p>
         <p v-text="userInfo.data.userName"></p>
-        <p>
-          <span class="en-name">{{enterpriseInfo2.enName}}</span>
+        <p :class="{'long': !isShow}">
+          <span class="en-name">{{enterpriseInfo.enName}}</span>
         </p>
         </p>
         <div class="switch" v-if="isShow">
         <div class="switch" v-if="isShow">
           <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
           <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
@@ -90,12 +90,10 @@
     },
     },
     computed: {
     computed: {
       userInfo () {
       userInfo () {
-        // console.log(this.$store.state.option.user)
         return this.$store.state.option.user
         return this.$store.state.option.user
       },
       },
       enterpriseInfo2 () {
       enterpriseInfo2 () {
         if (this.userInfo.data.enterprises) {
         if (this.userInfo.data.enterprises) {
-          console.log(1)
           let ens = this.userInfo.data.enterprises.slice()
           let ens = this.userInfo.data.enterprises.slice()
           if (ens && ens.length) {
           if (ens && ens.length) {
             for (let i = 0; i < ens.length; i++) {
             for (let i = 0; i < ens.length; i++) {

+ 4 - 2
components/store/CommodityList.vue

@@ -35,7 +35,7 @@
           <thead>
           <thead>
           <tr style="height: 40px;">
           <tr style="height: 40px;">
             <!--<th width="90"></th>-->
             <!--<th width="90"></th>-->
-            <th width="150">品牌/型号</th>
+            <th width="150">品牌/型号/类目</th>
             <th width="100">包装/生产日期</th>
             <th width="100">包装/生产日期</th>
             <th width="90">库存</th>
             <th width="90">库存</th>
             <th width="90">梯度/pcs</th>
             <th width="90">梯度/pcs</th>
@@ -60,6 +60,8 @@
               <div class="brand" v-if="!commodity.brandNameEn && !commodity.brandEn">—</div>
               <div class="brand" v-if="!commodity.brandNameEn && !commodity.brandEn">—</div>
               <div class="code" v-if="commodity.code" v-text="commodity.code"></div>
               <div class="code" v-if="commodity.code" v-text="commodity.code"></div>
               <div class="code" v-if="!commodity.code">—</div>
               <div class="code" v-if="!commodity.code">—</div>
+              <a v-if="commodity.kindNameCn" @click="goBrandDetail('/product/kind/' + commodity.kindUuid, $event)" v-text="commodity.kindNameCn"></a>
+              <div class="brand" v-if="!commodity.kindNameCn">—</div>
             </td>
             </td>
             <td>
             <td>
               <div class="package" v-if="commodity.packaging" v-text="commodity.packaging"></div>
               <div class="package" v-if="commodity.packaging" v-text="commodity.packaging"></div>
@@ -292,7 +294,7 @@ export default {
     },
     },
     async pageCommodity (pageParams, kindId, keyword) {
     async pageCommodity (pageParams, kindId, keyword) {
 //    pageCommodity (pageParams, kindId, keyword) {
 //    pageCommodity (pageParams, kindId, keyword) {
-      let params = { storeid: this.$route.params.uuid, origin: 'store', kindUuid: kindId, code: keyword }
+      let params = { storeid: this.$route.params.uuid, origin: 'store', kindUuid: kindId === -10 ? '其他' : kindId, code: keyword }
       params.page = pageParams.page
       params.page = pageParams.page
       params.count = pageParams.count
       params.count = pageParams.count
 
 

+ 2 - 2
nuxt.config.js

@@ -1,7 +1,7 @@
 const path = require('path')
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://192.168.253.121:9090/platform-b2c')
-const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://10.1.51.77:8080/platform-b2c')
+const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://10.1.51.77:7070/')
 const materialUrl = process.env.MATERIAL_URL || (isProdMode ? 'https://api-product.usoftmall.com/' : 'http://218.17.158.219:24000/')
 const materialUrl = process.env.MATERIAL_URL || (isProdMode ? 'https://api-product.usoftmall.com/' : 'http://218.17.158.219:24000/')
 
 
 module.exports = {
 module.exports = {

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

@@ -59,7 +59,7 @@
         let list = this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
         let list = this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
         if (this.isChange) {
         if (this.isChange) {
           this.purchaseManListData = []
           this.purchaseManListData = []
-          this.seekPage = 1
+          this.page = 1
           this.isChange = false
           this.isChange = false
           this.isDataChange = true
           this.isDataChange = true
         } else {
         } else {

+ 3 - 3
pages/mobile/center/index.vue

@@ -439,7 +439,7 @@
     watch: {
     watch: {
       '$route.query': {
       '$route.query': {
         handler: function (val, old) {
         handler: function (val, old) {
-          this.switchSeek('wait')
+//          this.switchSeek('wait')
           if (val.type === 'saler' && !this.shopuuid.uuid) {
           if (val.type === 'saler' && !this.shopuuid.uuid) {
             this.$store.dispatch('loadStoreStatus', { op: 'check' })
             this.$store.dispatch('loadStoreStatus', { op: 'check' })
           }
           }
@@ -557,8 +557,8 @@
         let type = this.seekType
         let type = this.seekType
         let user = this.$store.state.option.user.data
         let user = this.$store.state.option.user.data
         let params = {
         let params = {
-          pageNumber: 1,
-          pageSize: 10,
+          pageNumber: this.seekPage,
+          pageSize: this.seekSize,
           keyword: this.seekKeyword || null
           keyword: this.seekKeyword || null
         }
         }
         if (user.enterprise.uu) {
         if (user.enterprise.uu) {

+ 10 - 0
pages/mobile/shop/index.vue

@@ -78,6 +78,16 @@
       Loading,
       Loading,
       LoginBox
       LoginBox
     },
     },
+    watch: {
+      '$route.query.keyword': {
+        handler: function (val) {
+          this.page = 1
+          this.type = 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT'
+          this.$store.dispatch('provider/findStoreListInMobil', { page: this.page, count: this.count, types: this.types, keyword: this.$route.query.keyword || null })
+        },
+        immediate: true
+      }
+    },
     fetch ({ store, query }) {
     fetch ({ store, query }) {
       return Promise.all([
       return Promise.all([
         store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: query.keyword || null })
         store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: query.keyword || null })