瀏覽代碼

Merge remote-tracking branch 'origin/feature-201820-wangcz' into feature-201820-wangcz

shenjj 7 年之前
父節點
當前提交
89efce4171

+ 0 - 3
components/applyPurchase/BatchPublish.vue

@@ -1037,9 +1037,7 @@
             obj.type = 'CHAT'
             if (!(/^1\d{10}$/).test(response.data.enTel)) {
               this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
-                console.log(response)
                 obj.toPhone = response.data.userTel
-                console.log(obj)
                 this.openWebChat(newTab, obj)
               }, err => {
                 console.log(err)
@@ -1047,7 +1045,6 @@
               })
             } else {
               obj.toPhone = response.data.enTel
-              console.log(obj)
               this.openWebChat(newTab, obj)
             }
           }, err => {

+ 0 - 3
components/applyPurchase/SeekProduct.vue

@@ -84,9 +84,6 @@
         default: {}
       }
     },
-    mounted() {
-      console.log(this.productItem)
-    },
     watch: {
       'showObj.show': {
         handler: function (val) {

+ 0 - 1
components/applyPurchase/articleOne.vue

@@ -320,7 +320,6 @@
         if (!this.validObj.prodTitle) {
           this.$message.error('物料名称不能为空')
         }
-        console.log(prodTitle)
         return this.validObj.prodTitle
       },
       checkBrand: function () {

+ 0 - 1
components/common/upload/upload.vue

@@ -37,7 +37,6 @@
     watch: {
       url: function (val, oldVal) {
         if (val && val !== '') {
-          console.log(val)
           this.qualifications.url = val
         }
       }

+ 0 - 2
components/default/RightBar.vue

@@ -216,13 +216,11 @@
           inner.style.transform = 'translate3d(0, 0, 0)'
           let transitionEvent = whichTransitionEvent()
             transitionEvent && el.addEventListener(transitionEvent, function() {
-              console.log('动画结束1')
               done()
             })
         })
       },
       afterEnter(el) {
-        console.log(this.dropBalls)
         // console.log('钩子函数收尾')
         let ball = this.dropBalls.shift()
         if (ball) {

+ 0 - 1
components/main/Search.vue

@@ -232,7 +232,6 @@
         this.associate.show = this.associate.focus
       },
       onSelectChange (count) {
-        console.log(1)
         let keywords = this.similarKeywords
         if (keywords && keywords.result.length) {
           let index = this.associate.activeIndex

+ 4 - 2
components/mobile/MobileHeader.vue

@@ -108,7 +108,9 @@
         return this.$store.state.componentDetail.detail.data
       },
       showEnHeader () {
-        return this.startWith(this.$route.path, '/mobile/center') || this.startWith(this.$route.path, '/mobile/order') || this.startWith(this.$route.path, '/mobile/user/address')
+        return this.startWith(this.$route.path, '/mobile/center') ||
+          this.startWith(this.$route.path, '/mobile/order') ||
+          this.startWith(this.$route.path, '/mobile/user/address')
       }
 //      showHeader () {
 //        return this.$route.path !== '/' || !this.$route.path || this.$route.path === ''
@@ -205,7 +207,7 @@
         } else if (this.startWith(val, '/mobile/store')) {
           this.showSearchIcon = false
           title = '开店申请'
-        } else if (val === '/mobile/center/user/cart') {
+        } else if (this.startWith(val, '/mobile/center/user/cart')) {
           this.showSearchIcon = false
           title = '购物车'
         } else if (this.startWith(val, '/mobile/center/user/payCenter')) {

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

@@ -132,7 +132,6 @@
         return this.$http.get('/productuser/match/getKind', {params: {cmpCode: code, brand: brand}})
       },
       goPublish: function () {
-        console.log('12', this.applyObj)
         if (this.checkAll()) {
           this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
             let inquiry = {}

+ 53 - 30
components/mobile/base/SearchHeader.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="search-content com-mobile-header">
+  <div class="search-content com-mobile-header mobile-search-header" :class="expandClass">
     <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
     <input type="text" v-model="keyword" @input="onKeywordInput()" :placeholder="placeholder" @keyup.13="onSearch()">
     <span @click="onSearch()"><i class="iconfont icon-sousuo"></i></span>
@@ -20,15 +20,15 @@
     <ul v-if="emptyStatus && type == 'default' && keyword && keyword !== '' && showSimilarWord">
       <template v-if="similarList.brand && similarList.brand.length && (similarType == 'all' || similarType == 'brand')">
         <li class="title text-ellipse" v-if="similarType == 'all'">品牌</li>
-        <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 4)" @click="onSearch(brand.nameEn, 'brand', $event)">{{brand.nameEn}}</li>
+        <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 8)" @click="onSearch(brand.nameEn, 'brand', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length && (similarType == 'all' || similarType == 'kind')">
         <li class="title text-ellipse" v-if="similarType == 'all'">物料名称</li>
-        <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.nameCn, 'kind', $event)">{{kind.nameCn}}</li>
+        <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 8)" @click="onSearch(kind.nameCn, 'kind', $event)">{{kind.nameCn}}</li>
       </template>
       <template v-if="similarList.component && similarList.component.length && (similarType == 'all' || similarType == 'code')">
         <li class="title text-ellipse" v-if="similarType == 'all'">型号</li>
-        <li class="text-ellipse" v-for="code in similarList.component.slice(0, 4)" @click="onSearch(code.code, 'code', $event)">{{code.code}}</li>
+        <li class="text-ellipse" v-for="code in similarList.component.slice(0, 8)" @click="onSearch(code.code, 'code', $event)">{{code.code}}</li>
       </template>
     </ul>
   </div>
@@ -64,6 +64,10 @@
       useMatchRule: { // 使用既定的匹配规则
         type: Boolean,
         default: true
+      },
+      expandClass: {
+        type: String,
+        default: ''
       }
     },
     data () {
@@ -196,34 +200,53 @@
   }
 </script>
 <style lang="scss" scoped>
-  .search-content {
-    color: #333;
-    input {
-      margin: 0 0 0 .5rem;
-      line-height: normal;
-    }
-    ul {
-      width: 6.48rem;
-      background: #fff;
-      position: absolute;
-      left: .6rem;
-      top: .72rem;
-      border: 1px solid #ccc;
-      border-radius: .05rem;
-      max-height: 4.5rem;
-      overflow-y: auto;
-      li {
-        height: .6rem;
-        line-height: .6rem;
-        padding: 0 .1rem;
-        font-size: .26rem;
-        &.title {
-          color: #666;
-          border-bottom: 1px solid #ddd;
-          font-weight: bold;
-          background: #f6f5f5;
+  .mobile-search-header {
+    &.search-content {
+      color: #333;
+      input {
+        margin: 0 0 0 .5rem;
+        line-height: normal;
+      }
+      ul {
+        width: 6.48rem;
+        background: #fff;
+        position: absolute;
+        left: .6rem;
+        top: .72rem;
+        border: 1px solid #ccc;
+        border-radius: .05rem;
+        max-height: 4.9rem;
+        overflow-y: auto;
+        li {
+          height: .6rem;
+          line-height: .6rem;
+          padding: 0 .1rem;
+          font-size: .26rem;
+          &.title {
+            color: #666;
+            border-bottom: 1px solid #ddd;
+            font-weight: bold;
+            background: #f6f5f5;
+          }
         }
       }
     }
+    &.normal {
+      position: relative;
+      background: #f1f3f6;
+      z-index: 1;
+      input {
+        border: 1px solid #3f84f6;
+        width: 7.1rem;
+        margin: 0 0 0 .1rem;
+      }
+      > a {
+        display: none;
+      }
+      ul {
+        width: 7.1rem;
+        left: .19rem;
+      }
+    }
   }
 </style>

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

@@ -64,7 +64,8 @@
         } else {
           height = document.body.scrollHeight
           scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
-        } if (this.FixedEl) {
+        }
+        if (this.FixedEl) {
           let obj = document.getElementById(this.fixId)
           // availHeight = document.getElementById(this.fixId).clientHeight + 50
           let _sc = obj.clientHeight + obj.scrollTop

+ 17 - 2
components/mobile/search/componet-item.vue

@@ -2,7 +2,7 @@
   <div class="middle">
     <div class="list">
       <div class="name">品牌:</div>
-      <div class="text overHidden">{{item.brand && item.brand.nameEn || '-'}}</div>
+      <div class="text overHidden">{{item.brandNameEn || item.brandNameCn || '-'}}</div>
     </div>
     <div class="list">
       <div class="name">物料名称:</div>
@@ -38,7 +38,7 @@
       </div>
     </div>
     <div class="list">
-      <div class="fl" @click.stop="goAttach(item.attach)">
+      <div class="fl">
         <div class="name">规格书:</div>
         <div class="text">
           <a :href="item.attach" target="_blank" v-if="item.attach && item.attach !== '' && item.attach !== '1'">
@@ -83,10 +83,12 @@
         <div class="pull-left" @click="buy(item, true, $event)">立即购买</div>
       </div>
     </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 
 <script>
+  import { RemindBox } from '~components/mobile/common'
   export default {
     props: {
       item: {
@@ -94,12 +96,25 @@
         default: {}
       }
     },
+    components: {
+      RemindBox
+    },
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
     methods: {
       cancatSeller(item) {
         this.$emit('cancatSeller', item)
       },
       buy(item, flag, e) {
         this.baseUtils.buyOrCar(flag, e, this, item, '/mobile/center/user/pay/')
+      },
+      setRemindText (str) {
+        this.remindText = str
+        this.timeoutCount++
       }
     }
   }

+ 0 - 1
components/product/ComponentGoods.vue

@@ -276,7 +276,6 @@
         return null
       },
       handlerCurrentNode (data, node) {
-        console.log(this.pageParams)
         this.pageParams.page = 1
         this.pageCmpGoods(this.pageParams)
       },

+ 120 - 0
pages/mobile/center/user/cart/_key.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="mobile-search-goods mobile-content mobile-content-long">
+    <search-header
+      :placeholder="'请输入您要采购的型号'"
+      :outerKeyword="outerKeyword"
+      :useMatchRule="false"
+      :expandClass="'normal'"
+      :similarType="'code'"
+      @searchAction="onSearch"></search-header>
+    <ul v-if="goodsList.length">
+      <li v-for="goods in goodsList">
+        <component-item :item="goods" @cancatSeller="concatSeller"></component-item>
+      </li>
+    </ul>
+    <empty-status
+      :type="'search'"
+      :text="'暂无搜索结果'"
+      :showLink="false"
+      v-else></empty-status>
+    <link-user :infoObj="currentStoreInfo"
+               :showLink="showLink"
+               @closeAction="showLink = false"></link-user>
+    <pull-up
+      :allPage="allPage"
+      :page="page"
+      @pullUpAction="onPullUpAction"
+      :searchMore="fetching"></pull-up>
+  </div>
+</template>
+<script>
+  import {LinkUser, SearchHeader} from '~components/mobile/base'
+  import componentItem from '~components/mobile/search/componet-item'
+  import { PullUp, EmptyStatus } from '~components/mobile/common'
+  export default {
+    layout: 'mobile',
+    components: {
+      LinkUser,
+      SearchHeader,
+      componentItem,
+      PullUp,
+      EmptyStatus
+    },
+    data () {
+      return {
+        outerKeyword: '',
+        currentStoreInfo: {},
+        showLink: false,
+        page: 1,
+        goodsList: []
+      }
+    },
+    fetch ({ store, params }) {
+      return Promise.all([
+        store.dispatch('searchData/searchForListNew', {count: 10, keyword: params.key, page: 1, type: 'component'})
+      ])
+    },
+    watch: {
+      '$route.params.key': {
+        handler: function (val) {
+          this.outerKeyword = val || ''
+        },
+        immediate: true
+      },
+      'searchList': {
+        handler: function (val) {
+          if (val && val.stock && val.stock.content) {
+            this.goodsList = [...this.goodsList, ...val.stock.content]
+          }
+        },
+        immediate: true
+      }
+    },
+    computed: {
+      listData () {
+        return this.$store.state.searchData.searchList.listNew
+      },
+      searchList () {
+        return this.listData.data
+      },
+      fetching () {
+        return this.listData.fetching
+      },
+      goods () {
+        return this.searchList ? this.searchList.stock : {}
+      },
+      allPage () {
+        return this.goods && this.goods.total ? Math.ceil(this.goods.total / this.goods.size) : 0
+      }
+    },
+    methods: {
+      onSearch (searchObj) {
+        if (searchObj.keyword) {
+          this.$router.push(`/mobile/center/user/cart/${searchObj.keyword}`)
+        }
+      },
+      concatSeller (item) {
+        this.$http.get(`/api/store-service/stores?uuid=${item.storeid}`).then(res => {
+          this.currentStoreInfo = res.data.enterprise
+          this.showLink = true
+        })
+      },
+      reloadList () {
+        this.$store.dispatch('searchData/searchForListNew', {count: 10, keyword: this.$route.params.key, page: this.page, type: 'component'})
+      },
+      onPullUpAction () {
+        this.page++
+        this.reloadList()
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .mobile-search-goods {
+    ul {
+      li {
+        border-bottom: .2rem solid #f1f3f6;
+      }
+    }
+  }
+</style>

+ 17 - 5
pages/mobile/center/user/cart.vue → pages/mobile/center/user/cart/index.vue

@@ -1,5 +1,12 @@
 <template>
   <div class="mobile-cart" :class="{'empty-mobile-cart': !cartList.length}" id="mobileFixContent" @touchmove="blurEvent()">
+    <search-header
+      :placeholder="'请输入您要采购的型号'"
+      :outerKeyword="outerKeyword"
+      :useMatchRule="false"
+      :expandClass="'normal'"
+      :similarType="'code'"
+      @searchAction="onSearch"></search-header>
     <template v-if="cartList.length">
       <ul class="store-list">
         <li class="store-item" v-for="(item, storeIndex) in cartList">
@@ -72,7 +79,7 @@
 </template>
 <script>
   import {RemindBox, PullUp, EmptyStatus} from '~components/mobile/common'
-  import {LinkUser} from '~components/mobile/base'
+  import {LinkUser, SearchHeader} from '~components/mobile/base'
   import { goodsPurchaseOperate } from '~utils/mixin'
   export default {
     layout: 'mobile',
@@ -88,7 +95,8 @@
         allCurrency: 'RMB', // 选定币别
         currentStoreInfo: {},
         showLink: false,
-        isChange: false
+        isChange: false,
+        outerKeyword: ''
       }
     },
     mixins: [goodsPurchaseOperate],
@@ -96,7 +104,8 @@
       RemindBox,
       PullUp,
       LinkUser,
-      EmptyStatus
+      EmptyStatus,
+      SearchHeader
     },
     fetch ({ store }) {
       return Promise.all([
@@ -296,12 +305,10 @@
             storeid: item.storeUuid
           })
         })
-        console.log(arrOD)
         this.$http.post('/trade/order/saveByGroup', {
           arrOD: arrOD,
           currency: this.allCurrency
         }).then(res => {
-          console.log(res.data)
           if (res.data.code === 1) {
             if (res.data.message) {
               this.setRemindText(res.data.message)
@@ -359,6 +366,11 @@
         }, err => {
           this.setRemindText(err.response.data || '系统错误')
         })
+      },
+      onSearch (searchObj) {
+        if (searchObj.keyword) {
+          this.$router.push(`/mobile/center/user/cart/${searchObj.keyword}`)
+        }
       }
     }
   }

+ 0 - 1
pages/mobile/center/vendor/product.vue

@@ -587,7 +587,6 @@
       },
       // 编辑物料
       updateMateriel(item) {
-        console.log(item)
         this.MaterielItem = item
         this.$item = this.baseUtils.deepCopy(item)
         this.cmpImg = item.cmpImg || ''

+ 0 - 2
pages/mobile/center/vendor/productList/index.vue

@@ -135,7 +135,6 @@
     methods: {
       closeMoreinfo() {},
       update(item) {
-        console.log(item)
         this.$store.commit('product/brand/GET_ONSALE_DETAILS_SUCCESS', item)
         localStorage.setItem('ProductListItem', JSON.stringify(item))
         this.$router.push('/mobile/center/vendor/productdetails')
@@ -150,7 +149,6 @@
         })
       },
       toAddpro() {
-        console.log(this.vendorlist)
         let item = {
           brandNameEn: this.cnmpBand,
           kindNameCn: this.cnmpType,

+ 0 - 3
pages/mobile/center/vendor/productdetails.vue

@@ -161,7 +161,6 @@
     },
     mounted() {
       this.chooseItem = this.baseUtils.deepCopy(this.$store.state.product.brand.onSaleDetails.data)
-      console.log(this.chooseItem)
       this.chooseItem.storeInfoOms = this.chooseItem.storeid === '33069557578d44e69bd91ad12d28a8d4' ? '寄售' : '自营'
       if (localStorage.getItem('ProductListItem')) {
         let a = JSON.parse(localStorage.getItem('ProductListItem'))
@@ -344,7 +343,6 @@
             return false
           }
           this.chooseItem.prices[index - 1].end = item.start - 1
-          console.log(this.chooseItem.prices)
         }
       },
       // 结束价格阶段失去焦点
@@ -505,7 +503,6 @@
               isHas = true
               break
             } else if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(this.chooseItem.prices[i].rMBPrice)) {
-              console.log(this.chooseItem.prices[i].rMBPrice)
               this.timeoutCount++
               this.collectResult = '单价只能输入数字'
               isHas = true

+ 0 - 1
pages/mobile/order/details.vue

@@ -499,7 +499,6 @@
           }
         }
         let { data } = await axios.get(`/trade/purchase/purchaseId/${route.query.uuid}`)
-        console.log(data)
         data.data.area = JSON.parse(data.data.jsonAddress)
         data.data.rule = data.data.jsonRule ? JSON.parse(data.data.jsonRule) : ''
         data.data.paytype = route.query.paytype

+ 0 - 2
pages/mobile/order/index.vue

@@ -400,7 +400,6 @@
             this.cancatInfo = {
               entel: item.buyPhone
             }
-            console.log(this.cancatInfo)
             return
           }
           this.$http.get(`/basic/enterprise/${item.buyerenuu}/tels`).then(res => {
@@ -848,7 +847,6 @@
         let newTime = new Date()
         let msec = newTime.getTime() - time
         let hours = parseInt(parseInt(msec) / (1000 * 60 * 60))
-        console.log(hours)
         return hours
       },
       onMind(str) {

+ 0 - 1
pages/mobile/search/_keycode.vue

@@ -199,7 +199,6 @@
 //            this.collectResult = '卖家上传的产品暂无参数,请联系卖家了解具体详情。'
 //            this.timeoutCount++
 //          }
-          console.log(item)
           if (item.batchCode) {
             this.$router.push('/mobile/product/' + item.batchCode)
           } else {

+ 0 - 1
pages/product/brand/_code.vue

@@ -32,7 +32,6 @@
     },
     methods: {
       showList: function (status) {
-        console.log(status)
         this.isShow = status
       },
       listenChild: function (brand) {

+ 7 - 1
plugins/axios.js

@@ -70,7 +70,13 @@ service.interceptors.response.use(response => {
       document.getElementById('loading').setAttribute('class', 'loading')
     }
     // 401拦截
-    if (error.response.status === 401 && !/\/store-service\/stores$/g.test(error.response.config.url)) {
+    if (error.response.status === 401 &&
+        // 当前账套店铺信息
+      !/\/store-service\/stores$/g.test(error.response.config.url) &&
+        // 店铺关注
+      !/\/trade\/storeFocus\/ifFocus/g.test(error.response.config.url) &&
+        // 器件收藏
+      !/\/trade\/collection\/list/g.test(error.response.config.url)) {
       window.location.href = `/auth/login?returnUrl=${window.location.href}`
       return
     }

+ 0 - 1
store/index.js

@@ -465,7 +465,6 @@ export const actions = {
   // 保存微信信息
   GerWechatInfo({ commit }, params = {}) {
     let id = params.openId
-    console.log('openid:' + id)
     commit('option/REQUEST_WECHATINFO_STATUS')
     return axios.get('/wx/getWxUserInfo', { params: params })
       .then(response => {

+ 1 - 1
store/searchData.js

@@ -119,7 +119,7 @@ export const actions = {
         commit('searchHistory/GET_SEARCH_HISTORY_FAILURE', err)
       })
   },
-  // 获取搜索历史
+  // 新版搜索结果
   searchForListNew ({ commit }, params = {}) {
     commit('searchList/REQUEST_LIST_NEW', params)
     return axios.get(`/search/201819`, {params})