浏览代码

报价框滚动问题

yangc 7 年之前
父节点
当前提交
5d5800c80c

+ 1 - 1
components/home/displayCard.vue

@@ -72,7 +72,7 @@
       goStoreApply: function () {
         if (this.user.logged) {
           if (this.enterprise && this.enterprise.isVendor === 313) {
-            window.location.href = '/vendor#/store-apply'
+            window.location.href = '/vendor#/index'
           } else {
             this.$router.push('/register-saler')
           }

+ 19 - 11
components/mobile/Home.vue

@@ -55,7 +55,7 @@
       </div>
       <seek-list :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
     </div>
-    <div class="mobile-modal" v-if="showStoreInfo" @touchmove.self="preventTouchMove($event)">
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
       <div class="mobile-modal-box">
         <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
         <div class="mobile-modal-content">
@@ -69,12 +69,13 @@
     <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
     <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox" :url="url"></login-box>
+    <pull-up :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="getMoreSearch" :isValid="isValid"></pull-up>
   </div>
 </template>
 <script>
   import SeekList from './applyPurchase/SeekList.vue'
   import MainSearch from '~/components/mobile/search/MainSearch.vue'
-  import { RemindBox, LoginBox } from '~components/mobile/common'
+  import { RemindBox, LoginBox, PullUp } from '~components/mobile/common'
   export default {
     data () {
       return {
@@ -103,14 +104,16 @@
         purchaseManListData: [],
         isChange: false,
         isDataChange: false,
-        url: ''
+        url: '',
+        isValid: true
       }
     },
     components: {
       SeekList,
       MainSearch,
       RemindBox,
-      LoginBox
+      LoginBox,
+      PullUp
     },
     watch: {
       '$store.state.applyPurchase.purchaseManList.purchaseHomeList.data': {
@@ -140,20 +143,25 @@
       },
       allPage () {
         return Math.floor(this.purchaseManList.totalElements / this.purchaseManList.size) + Math.floor(this.purchaseManList.totalElements % this.purchaseManList.size > 0 ? 1 : 0)
+      },
+      fetching () {
+        return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.fetching
       }
     },
     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()
-         }
-      },
+//      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 () {
+        this.isValid = false
         this.showMainSearch = true
         this.$store.dispatch('searchData/getSearchHistory')
       },
       onCancelSearch: function () {
+        this.isValid = true
         this.showMainSearch = false
       },
       goOpportunity () {
@@ -183,7 +191,7 @@
     },
     mounted() {
       this.$nextTick(() => {
-        window.addEventListener('scroll', this.scroll, false)
+//        window.addEventListener('scroll', this.scroll, false)
         if (this.$route.query.code) {
           let ua = window.navigator.userAgent.toLowerCase()
           if (ua.match(/micromessenger/i)[0] === 'micromessenger') {

+ 1 - 1
components/mobile/HomeOld.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="home">
-    <div class="mobile-modal" v-if="showStoreInfo" @touchmove.self="preventTouchMove($event)">
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
       <div class="mobile-modal-box">
         <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
         <div class="mobile-modal-content">

+ 1 - 1
components/mobile/applyPurchase/PublishSeek.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-modal" v-if="showSayPriceBox" @click="setShowCurrencyList(false)" @touchmove.self="preventTouchMove($event)">
+  <div class="mobile-modal" v-if="showSayPriceBox" @click="setShowCurrencyList(false)" @touchmove="preventTouchMove($event)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">
         <i class="icon-guanbi iconfont" @click="cancel"></i>

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

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-modal" v-if="showPublishBox" @touchmove.self="preventTouchMove($event)">
+  <div class="mobile-modal" v-if="showPublishBox" @touchmove="preventTouchMove($event)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">我要询价<i class="icon-guanbi iconfont" @click="cancel"></i></div>
       <div class="props">

+ 2 - 5
components/mobile/applyPurchase/SayPrice.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="mobile-modal" v-show="showSayPriceBox" @touchmove.self="preventTouchMove($event)">
+  <div class="mobile-modal" v-show="showSayPriceBox" @touchmove="preventTouchMove($event)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">编辑报价<i class="icon-guanbi iconfont" @click="cancel"></i></div>
-      <div class="say-price"  ref="mobileModalBox">
+      <div class="say-price" ref="mobileModalBox">
         <div>
           <div class="base-info">
             <div class="content-line">
@@ -140,9 +140,6 @@
       }
     },
     methods: {
-      touchmove(e) {
-        e.preventDefault()
-      },
       cancel: function () {
         this.$emit('cancelSayPriceAction', false)
       },

+ 1 - 1
components/mobile/applyPurchase/SayPriceInfo.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-modal" @touchmove.self="preventTouchMove($event)">
+  <div class="mobile-modal" @touchmove="preventTouchMove($event)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">{{purchaseDetail.agreed == 1 || agreed == 1 ? '已采纳' : '已报价'}}<i class="icon-guanbi iconfont" @click="cancel"></i></div>
       <div class="say-price-info" ref="mobileModalBox">

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

@@ -304,6 +304,7 @@ export default {
             background: #008bf7;
             margin: .34rem auto 0;
             border-radius: .05rem;
+            vertical-align: middle;
 
             &.self-publish {
               background: rgb(204, 203, 203);

+ 23 - 4
components/mobile/base/SearchHeader.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="search-content com-mobile-header">
     <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
-    <input type="text" v-model="keyword" @input="getSimilarList()" :placeholder="placeholder" @keyup.13="onSearch">
+    <input type="text" v-model="keyword" @input="getSimilarList()" :placeholder="placeholder" @keyup.13="onSearch()">
     <span @click="onSearch()"><i class="iconfont icon-sousuo"></i></span>
-    <ul v-if="type == 'supplier' && keyword && keyword !== '' && showSimilarWord">
+    <ul v-if="emptyStatus && type == 'supplier' && keyword && keyword !== '' && showSimilarWord">
       <template v-if="similarList.pCmpCode && similarList.pCmpCode.length">
         <li class="title text-ellipse">型号</li>
         <li class="text-ellipse" v-for="code in similarList.pCmpCode.slice(0, 4)" @click="onSearch(code.pCmpCode, 'pCmpCode', $event)">{{code.pCmpCode}}</li>
@@ -17,7 +17,7 @@
         <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.kind, 'kind', $event)">{{kind.kind}}</li>
       </template>
     </ul>
-    <ul v-if="type == 'default' && keyword && keyword !== '' && showSimilarWord">
+    <ul v-if="emptyStatus && type == 'default' && keyword && keyword !== '' && showSimilarWord">
       <template v-if="similarList.component && similarList.component.length">
         <li class="title text-ellipse">型号</li>
         <li class="text-ellipse" v-for="code in similarList.component.slice(0, 4)" @click="onSearch(code.code, 'code', $event)">{{code.code}}</li>
@@ -58,7 +58,8 @@
       return {
         keyword: '',
         similarList: {},
-        showSimilarWord: false
+        showSimilarWord: false,
+        searchKeyword: ''
       }
     },
     mounted () {
@@ -68,11 +69,28 @@
         }
       })
     },
+    computed: {
+      emptyStatus () {
+        let similarList = this.similarList
+        if (this.type === 'supplier') {
+          return (similarList.pCmpCode && similarList.pCmpCode.length) ||
+            (similarList.pBrandEn && similarList.pBrandEn.length) ||
+            (similarList.kind && similarList.kind.length)
+        } else if (this.type === 'default') {
+          return (similarList.component && similarList.component.length) ||
+            (similarList.brand && similarList.brand.length) ||
+            (similarList.kind && similarList.kind.length)
+        }
+      }
+    },
     methods: {
       onSearch: function (key, type, e) {
         if (e) {
           e.stopPropagation()
         }
+        if (key === this.searchKeyword || this.keyword === this.searchKeyword) {
+          return
+        }
         if (key) {
           this.keyword = key
           this.$emit('searchAction', {
@@ -84,6 +102,7 @@
             keyword: this.keyword
           })
         }
+        this.searchKeyword = this.keyword
         scrollTo('body', 10)
         this.showSimilarWord = false
       },

+ 1 - 1
components/mobile/common/LoginBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-modal" v-show="showLogin" @touchmove.self="preventTouchMove($event)">
+  <div class="mobile-modal" v-show="showLogin" @touchmove="preventTouchMove($event)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">请登录后再操作<i @click="close" class="icon-guanbi iconfont"></i></div>
       <div class="mobile-modal-content">

+ 22 - 2
components/mobile/common/PullUp.vue

@@ -3,13 +3,33 @@
 </template>
 <script>
   export default {
-    props: ['searchMore', 'allPage', 'page', 'fixId'],
+    props: {
+      searchMore: {
+        type: Boolean
+      },
+      allPage: {
+        type: Number
+      },
+      page: {
+        type: Number
+      },
+      fixId: {
+        type: String,
+        default: null
+      },
+      isValid: {
+        type: Boolean,
+        default: true
+      }
+    },
     mounted () {
       let _this = this
       _this.$nextTick(function () {
         let obj = this.fixId ? document.getElementById(this.fixId) : window
         obj.addEventListener('scroll', function () {
-          _this.scroll()
+          if (_this.isValid) {
+            _this.scroll()
+          }
         }, false)
       })
     },

+ 2 - 2
components/mobile/search/MainSearch.vue

@@ -179,7 +179,7 @@
     width: 100%;
     position: fixed;
     z-index: 1000;
-    top: -2rem;
+    top: 0;
     bottom: 0;
     .main-search-header {
       position: relative;
@@ -187,7 +187,7 @@
       background: #3e82f5;
       padding-left: .3rem;
       line-height: .88rem;
-      margin-top: 2rem;
+      margin-top: 0;
       z-index: 1;
       input {
         width: 4.88rem;

+ 20 - 4
components/product/component/StoreInfo.vue

@@ -145,11 +145,16 @@
           </tr>
         </tbody>
       </table>
+      <div style="float: right; margin-bottom: 15px;">
+        <page :total="storeList.totalElements" :page-size="params.count"
+              :current="params.page" @childEvent="handleCurrentChange"></page>
+      </div>
     </div>
   </div>
 </template>
 <script>
   import Buy from '~components/common/buyOrCar/buyComponent.vue'
+  import Page from '~components/common/page/pageComponent.vue'
   export default {
     name: 'StoreInfo',
     data () {
@@ -165,13 +170,15 @@
             uuid: this.$route.params.uuid,
             ignoreUMall: false,
             ignoreStore: false,
-            storeIds: ''
+            storeIds: '',
+            status: 601
           }
         }
       }
     },
     components: {
-      Buy
+      Buy,
+      Page
     },
     filters: {
       currency: function (num) {
@@ -267,7 +274,8 @@
             this.params.filter.storeIds = this.params.filter.storeIds.replace(storeIn.uuid + ',', '')
           }
         }
-        this.$store.dispatch('loadComponentInformation', this.params)
+        this.params.page = 1
+        this.reloadData()
       },
       filterType (type) {
         if (type === 'umall') {
@@ -275,7 +283,8 @@
         } else if (type === 'store') {
           this.params.filter.ignoreStore = !this.params.filter.ignoreStore
         }
-        this.$store.dispatch('loadComponentInformation', this.params)
+        this.params.page = 1
+        this.reloadData()
       },
       goProductDetail: function (batchCode) {
         window.location.href = '/store/productDetail/' + batchCode
@@ -290,6 +299,13 @@
         } else {
           this.$router.push('/auth/login?returnUrl=' + window.location.href)
         }
+      },
+      reloadData () {
+        this.$store.dispatch('loadComponentInformation', this.params)
+      },
+      handleCurrentChange: function (page) {
+        this.params.page = page
+        this.reloadData()
       }
     }
   }

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

@@ -224,7 +224,7 @@
       <nuxt-link to="/">返回首页</nuxt-link>
     </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
-    <div class="mobile-modal" v-if="showStoreInfo" @touchmove.self="preventTouchMove($event)">
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
       <div class="mobile-modal-box">
         <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
         <div class="mobile-modal-content">

+ 1 - 1
pages/mobile/center/user/collect/store.vue

@@ -22,7 +22,7 @@
       </div>
       <empty-status v-if="!storeList.length" :type="'collect'" :showLink="true" :text="'抱歉,暂无店铺关注'"></empty-status>
     </div>
-    <div class="mobile-modal" v-if="showStoreInfo" @touchmove.self="preventTouchMove($event)">
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
       <div class="mobile-modal-box">
         <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
         <div class="mobile-modal-content">

+ 1 - 1
pages/mobile/center/vendor/index.vue

@@ -40,7 +40,7 @@
       </div>
       <div class="block-wrap collect-block">
         <div class="content-line" @click="goStore">
-          <img src="/images/mobile/center/user/comp-collect.png" alt="">
+          <img src="/images/mobile/center/vendor/shop.png" alt="">
           <span>我的店铺</span>
           <i class="iconfont icon-xiangyou"></i>
         </div>

+ 1 - 1
pages/mobile/shop/index.vue

@@ -38,7 +38,7 @@
       </div>
       <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
       <loading v-show="isSearchingMore"></loading>
-      <div class="mobile-modal" v-if="showStoreInfo" @touchmove.self="preventTouchMove($event)">
+      <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
         <div class="mobile-modal-box">
           <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
           <div class="mobile-modal-content">

+ 6 - 6
pages/mobile/user/storeinfo.vue

@@ -176,7 +176,7 @@
         }
       },
       dealWithText(_T) {
-        if (_T !== undefined) {
+        if (_T && _T !== '') {
           // 文本处理
           this.normalText = _T
           if (_T.length < 140) {
@@ -204,11 +204,11 @@
           this.timeoutCount++
           return false
         }
-        if (!this.storeInfo.description || this.storeInfo.description === '') {
-          this.collectResult = '店铺简介信息不能为空'
-          this.timeoutCount++
-          return false
-        }
+//        if (!this.storeInfo.description || this.storeInfo.description === '') {
+//          this.collectResult = '店铺简介信息不能为空'
+//          this.timeoutCount++
+//          return false
+//        }
         if (!this.storeInfo.enterprise) {
           this.collectResult = '企业信息不能为空'
           this.timeoutCount++