Просмотр исходного кода

Merge remote-tracking branch 'origin/feature-yc-201813' into feature-yc-201813

yangc 7 лет назад
Родитель
Сommit
ce443586da

+ 15 - 13
components/home/count/displayCard.vue → components/home/displayCard.vue

@@ -51,19 +51,21 @@
             this.isTop = false
             let isChange = true
             this.timerIndex++
-            let _transitionEvent = whichTransitionEvent()
-            _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
-                   _transitionEvent, () => {
-                       if (isChange) {
-                         let title = this.title.shift()
-                         let count = this.counts.shift()
-                         this.title.push(title)
-                         this.counts.push(count)
-                         this.timerIndex = 0
-                         isChange = false
-                         this.isTop = true
-                       }
-              })
+            if (this.$refs.pingdanListWrapper[0]) {
+              let _transitionEvent = whichTransitionEvent()
+              _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
+                _transitionEvent, () => {
+                  if (isChange) {
+                    let title = this.title.shift()
+                    let count = this.counts.shift()
+                    this.title.push(title)
+                    this.counts.push(count)
+                    this.timerIndex = 0
+                    isChange = false
+                    this.isTop = true
+                  }
+                })
+            }
           }, 3000)
         } else {
           clearInterval(this.timer)

+ 1 - 1
components/home/index.js

@@ -1,5 +1,5 @@
 import KindCategory from './KindCategory.vue'
-import displayCard from './count/displayCard.vue'
+import displayCard from './displayCard.vue'
 import Carousel from './Carousel.vue'
 import Advert from './Advert.vue'
 import FloorList from './floor/FloorList.vue'

+ 6 - 13
components/mobile/applyPurchase/SayPrice.vue

@@ -95,18 +95,10 @@
     watch: {
       showSayPriceBox: function (val, old) {
          if (val) {
-//           document.body.style.position = 'fixed'
-//           document.body.style.left = '0'
-//           document.body.style.right = '0'
-//           document.documentElement.style['overflow'] = 'hidden'
-//           document.body.style.overflow = 'hidden'
-//           document.documentElement.addEventListener('touchmove', function(event) {
-//             event.preventDefault()
-//           }, false)
-         } else {
-//          document.body.style.position = 'static'
-//           document.documentElement.style['overflow'] = 'auto'
-//           document.body.style.overflow = 'auto'
+           this.$nextTick(() => {
+             this._initscroll()
+             this.initSctoll.scrollTo(0, 0, 0)
+           })
          }
         this.resetSayPrice()
       }
@@ -325,9 +317,10 @@
         overflow: hidden;
         height: 90%;
         .form-list {
-          height: 7.53rem;
+          /*height: 7.53rem;*/
           background: #fff;
           padding-top: .2rem;
+          padding-bottom: 0.4rem;
           > div {
             height: .7rem;
             line-height: .7rem;

+ 7 - 0
components/mobile/applyPurchase/SayPriceInfo.vue

@@ -89,6 +89,7 @@
                 </tbody>
               </table>
               </div>
+              <div class="refused-txt" v-if="item.agreed === 0">拒绝理由:<span v-text="item.refusereason"></span></div>
               <!--<div class="price-level">
                 <p>价格梯度:<span>(pcs)</span></p>
                 <ul>
@@ -192,6 +193,7 @@
                   </tbody>
                 </table>
               </div>
+              <div class="refused-txt" v-if="purchaseDetail.agreed === 0">拒绝理由:<span v-text="purchaseDetail.refusereason"></span></div>
               <!--<div class="price-level vendor">
                 <p>价格梯度:<span>(pcs)</span></p>
                 <ul>
@@ -345,6 +347,11 @@
         overflow: hidden;
         max-height: 90%;
         position: relative;
+        .refused-txt {
+          span{
+            color: #ef5042;
+          }
+        }
         .base-info {
           margin: 0 auto;
           /*border-bottom: .18rem solid #f3f3f3;*/

+ 31 - 27
components/mobile/common/StatisticsMobile.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="statistics">
-    <ul class="list-inline pull-left" ref="pingdanListWrapper" :style="'top: -' + 1 * timerIndexL + 'rem'" :class="{'topL': isTopL}">
+    <ul class="list-inline pull-left" ref="pingdanListWrapperL" :style="'top: -' + 1 * timerIndexL + 'rem'" :class="{'topL': isTopL}">
       <li v-for="(item, index) in itemLeft">
         <span  class="number">
           <span class="name" v-html="nameLeft[index]"></span>
@@ -63,19 +63,21 @@
             this.isTopL = false
             let isChange = true
             this.timerIndexL++
-            let _transitionEvent = whichTransitionEvent()
-            _transitionEvent && this.$refs.pingdanListWrapper.addEventListener(
-              _transitionEvent, () => {
-                if (isChange) {
-                  let title = this.itemLeft.shift()
-                  let name = this.nameLeft.shift()
-                  this.itemLeft.push(title)
-                  this.nameLeft.push(name)
-                  this.timerIndexL = 0
-                  isChange = false
-                  this.isTopL = true
-                }
-              })
+            if (this.$refs.pingdanListWrapperL) {
+              let _transitionEvent = whichTransitionEvent()
+              _transitionEvent && this.$refs.pingdanListWrapperL.addEventListener(
+                _transitionEvent, () => {
+                  if (isChange) {
+                    let title = this.itemLeft.shift()
+                    let name = this.nameLeft.shift()
+                    this.itemLeft.push(title)
+                    this.nameLeft.push(name)
+                    this.timerIndexL = 0
+                    isChange = false
+                    this.isTopL = true
+                  }
+                })
+           }
           }, 2400)
         } else {
           clearInterval(this.timerL)
@@ -87,19 +89,21 @@
             this.isTopR = false
             let isChange = true
             this.timerIndexR++
-            let _transitionEvent = whichTransitionEvent()
-            _transitionEvent && this.$refs.pingdanListWrapperR.addEventListener(
-              _transitionEvent, () => {
-                if (isChange) {
-                  let title = this.itemRight.shift()
-                  let name = this.nameRight.shift()
-                  this.itemRight.push(title)
-                  this.nameRight.push(name)
-                  this.timerIndexR = 0
-                  isChange = false
-                  this.isTopR = true
-                }
-              })
+            if (this.$refs.pingdanListWrapperR) {
+              let _transitionEvent = whichTransitionEvent()
+              _transitionEvent && this.$refs.pingdanListWrapperR.addEventListener(
+                _transitionEvent, () => {
+                  if (isChange) {
+                    let title = this.itemRight.shift()
+                    let name = this.nameRight.shift()
+                    this.itemRight.push(title)
+                    this.nameRight.push(name)
+                    this.timerIndexR = 0
+                    isChange = false
+                    this.isTopR = true
+                  }
+                })
+            }
           }, 3000)
         } else {
           clearInterval(this.timerR)

+ 1 - 0
pages/mobile/applyPurchase/list/businessOpportunity.vue

@@ -51,6 +51,7 @@
     },
     mounted: function () {
       this.$nextTick(() => {
+        localStorage.removeItem('RETURNURL')
         window.addEventListener('scroll', this.scroll, false)
       })
     },

+ 17 - 2
pages/mobile/center/user/collect/message.vue

@@ -14,7 +14,7 @@
           </div>
           <div class="message">
             <p>{{item.createTime | time}}</p>
-            <a :href="item.type === 'MALL跳转卖家待报价页面' ? '/vendor#/seekPurchase?type=1' : item.type === 'MALL公共询价' ? '/user#/seekPurchase' : item.type === '商城公共询价采纳结果' ? '/vendor#/vendorPurchaseOffer' : ''"
+            <a :href="item.type === 'MALL跳转卖家待报价页面' ? '/mobile/center/user/seek?seekType=done' : item.type === 'MALL公共询价' ? '/mobile/center/vendor/seek?seekType=wait' : item.type === '商城公共询价采纳结果' ? '/mobile/center/vendor/seek?seekType=done' : ''"
                v-if="item.type"
                :title="item.content" class="info" target="_blank">{{item.content}}</a>
             <a v-else :title="item.content" class="noLink info">{{item.content}}</a>
@@ -34,7 +34,9 @@
     data () {
       return {
         count: 10,
-        page: 1
+        page: 1,
+        isChange: false,
+        msgList: []
       }
     },
     fetch ({ store }) {
@@ -63,6 +65,19 @@
       PullUp,
       EmptyStatus
     },
+    watch: {
+      'messageList': {
+        handler: function (val) {
+          if (this.isChange) {
+            this.msgList = val.content
+            this.isChange = false
+          } else {
+            this.msgList = [...this.msgList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
     methods: {
       reloadList: function () {
         this.$store.dispatch('messageShow/getAllMessage', { receiverUu: this.user.data.userUU, receiverEnuu: this.user.data.enterprise.uu, consumerApp: 'MALL', page: this.page, count: this.count, sorting: {'createTime': 'DESC'} })

+ 249 - 0
pages/mobile/center/vendor/attentionBus.vue

@@ -0,0 +1,249 @@
+<template>
+    <div class="attention-bus-wrap" id="attention-bus-wrap">
+      <div class="product-switch-item">
+        <span :class="activeType==='attention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('attention')">已关注</span>
+        <span :class="activeType==='isattention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('isattention')">未关注</span>
+      </div>
+      <div class="search-content" style="padding-bottom: 0.25rem">
+        <input type="text" placeholder="请输入您要查找的品牌或型号" v-model="keyword" @keyup.13="searchSeek">
+        <span @click="searchSeek" >
+          <i class="iconfont icon-sousuo"></i>
+          </span>
+      </div>
+      <div class="attention-bus-list">
+        <ul>
+          <li v-for="item in attentionList">
+            <div class="item">
+              <div class="name">
+                {{ item.nameCn | filterStr}}
+              </div>
+              <div class="attention-button" @click="attentionFn(item)">
+                <i class="iconfont icon-shoucang" :class="{'active': item.status}"></i>
+                <p v-if="item.status === 1">取消关注</p>
+                <p v-else>关注</p>
+              </div>
+            </div>
+          </li>
+        </ul>
+      </div>
+      <div class="fixedAlert" v-show="isShowAlert">
+        关注类目,商机无限!
+        <i class="iconfont icon-guanbi" @click="isShowAlert = false"></i>
+      </div>
+      <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+      <pull-up :fixId="'attention-bus-wrap'" :searchMore="isSearchSearchingMore" :allPage="allPage" :page="page" @pullUpAction="getMoreSearch"></pull-up>
+    </div>
+</template>
+<script>
+    import { RemindBox, PullUp } from '~components/mobile/common'
+    export default {
+      name: 'attention-Bus',
+      layout: 'mobile',
+      middleware: 'authenticated',
+      fetch({store}) {
+        return Promise.all([
+          store.dispatch('product/getUserCollectCode', {keyword: '', count: 10, page: 1, type: 'yes', enUU: store.state.option.user.data.enterprise.uu})
+        ])
+      },
+      data() {
+        return {
+          activeType: 'attention',
+          keyword: '',
+          collectResult: '',
+          timeoutCount: 0,
+          page: 1,
+          attentionList: [],
+          isShowAlert: true,
+          isSearchSearchingMore: false
+        }
+      },
+      watch: {
+        'getkindConcernList.data': {
+          handler: function (val) {
+            if (this.isChange) {
+              this.attentionList = val.content
+              this.isChange = false
+            } else {
+              this.attentionList = [...this.attentionList, ...val.content]
+            }
+            this.isSearchSearchingMore = false
+          },
+          immediate: true
+        }
+      },
+      computed: {
+        allPage() {
+          return Math.ceil(this.$store.state.product.component.collectCode.data.totalElements / 10)
+        },
+        getkindConcernList() {
+          return this.$store.state.product.component.collectCode
+        }
+      },
+      methods: {
+        ChangeTab(a) {
+          this.activeType = a
+          this.attentionList = []
+          this.page = 1
+          this.getAttentionListArray(this.page)
+        },
+        searchSeek() {
+          this.page = 0
+          this.attentionList = []
+          this.getMoreSearch()
+        },
+        attentionFn(item) {
+          if (item.status === 1) {
+            this.$http.post('/kind/concern', {kindConcern: item, type: 'del'}).then(res => {
+              this.collectResult = '取消成功'
+              this.timeoutCount++
+            })
+          } else {
+            this.$http.post('/kind/concern', {indConcern: item, type: 'add'}).then(res => {
+              this.collectResult = '关注成功'
+              this.timeoutCount++
+            })
+          }
+        },
+        getAttentionListArray(page) {
+          this.isSearchSearchingMore = true
+          if (this.activeType === 'attention') {
+            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 10, page: page, type: 'yes', enUU: this.$store.state.option.user.data.enterprise.uu})
+          } else {
+            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 10, page: page, type: 'no', enUU: this.$store.state.option.user.data.enterprise.uu})
+          }
+        },
+        getMoreSearch() {
+          this.page++
+          this.getAttentionListArray(this.page)
+        }
+      },
+      components: {
+        RemindBox,
+        PullUp
+      },
+      filters: {
+        filterStr(val) {
+          if (val.length > 30) {
+            return val.substr(0, 30) + '...'
+          }
+          return val
+        }
+      }
+    }
+</script>
+<style scoped lang='scss'>
+  .attention-bus-wrap {
+    background: #f1f3f6;
+    margin: 1.26rem 0 0.98rem 0;
+    height: calc(100vh - 1.26rem - 0.98rem);
+    overflow-y: auto;
+    padding-bottom: 0.2rem;
+    .product-switch-item {
+      text-align: center;
+      background: #fff;
+      border-bottom: 1px solid #d8d8d8;
+      box-shadow: 0 1px 3px #ddd;
+      .mobile-switch-btn {
+        background: #fff;
+        color: #333;
+        display: inline-block;
+        height: .72rem;
+        line-height: .72rem;
+        font-size: .28rem;
+        width: 1.4rem;
+        &:first-child {
+          margin-right: 1.78rem;
+        }
+        &.active {
+          color: #3f84f6;
+          border-bottom: .04rem solid #3f84f6;
+        }
+      }
+    }
+    .search-content {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      input {
+        width: 7.1rem;
+        border: 1px solid #376ff3;
+      }
+      span {
+        height: .46rem;
+        line-height: .46rem;
+      }
+    }
+    .attention-bus-list {
+      border: 0.01rem solid #e3e5e8;
+      border-radius: 4px;
+      background: #fff;
+      width: 7.1rem;
+      margin: 0 auto;
+      ul {
+        li {
+          display: table;
+          border-bottom: 1px solid #d3d3d3;
+          margin: 0 0.24rem;
+          height: 1.1rem;
+          &:nth-last-of-type(1) {
+            border-bottom: 0;
+          }
+          div {
+            display: table-cell;
+            vertical-align: middle;
+            position: relative;
+            word-wrap: break-word;
+            &.name {
+              font-size: 0.28rem;
+              color: #666;
+              width: 5.48rem;
+              overflow : hidden;
+            }
+            &.attention-button {
+              width: 1.2rem;
+              font-size: 0.24rem;
+              color: #666;
+              text-align: center;
+              .icon-shoucang {
+                &.active {
+                  color: #ff7800
+                }
+                color: #dadada;
+                font-size: 0.5rem;
+              }
+            }
+          }
+        }
+      }
+    }
+    .fixedAlert {
+      position: fixed;
+      z-index: 11;
+      width: 4.91rem;
+      height: 0.7rem;
+      line-height:0.7rem;
+      left: 50%;
+      margin-left: -2.455rem;
+      background: rgba(82, 147, 255, 0.9);
+      border-radius: 0.7rem;
+      font-size: 0.32rem;
+      color: #fff;
+      text-align: center;
+      top: 2.6rem;
+      i {
+        font-size: 0.4rem;
+        position: absolute;
+        right: -0.15rem;
+        top: -0.28rem;
+        color: rgba(61, 61, 61, 0.76);
+        &:after {
+          position: absolute;
+          top: -0.1rem;
+          right: -0.1rem;
+          left: -0.1rem;
+          bottom: -0.1rem;
+          content: ' ';
+        }
+      }
+    }
+  }
+</style>

+ 4 - 0
pages/mobile/center/vendor/index.vue

@@ -37,6 +37,10 @@
             <img src="/images/mobile/center/vendor/seek-done.png" alt="">
             <p>已报价</p>
           </nuxt-link>
+          <nuxt-link to="/mobile/center/vendor/attentionBus" tag="li">
+            <img src="/images/mobile/center/vendor/attention-bu.png" alt="">
+            <p>商机关注</p>
+          </nuxt-link>
         </ul>
       </div>
       <div class="block-wrap collect-block">

+ 17 - 2
pages/mobile/center/vendor/message.vue

@@ -14,7 +14,7 @@
           </div>
           <div class="message">
             <p>{{item.createTime | time}}</p>
-            <a :href="item.type === 'MALL跳转卖家待报价页面' ? '/vendor#/seekPurchase?type=1' : item.type === 'MALL公共询价' ? '/user#/seekPurchase' : item.type === '商城公共询价采纳结果' ? '/vendor#/vendorPurchaseOffer' : ''"
+            <a :href="item.type === 'MALL跳转卖家待报价页面' ? '/mobile/center/user/seek?seekType=done' : item.type === 'MALL公共询价' ? '/mobile/center/vendor/seek?seekType=wait' : item.type === '商城公共询价采纳结果' ? '/mobile/center/vendor/seek?seekType=done' : ''"
                v-if="item.type"
                :title="item.content" class="info" target="_blank">{{item.content}}</a>
             <a v-else :title="item.content" class="noLink info">{{item.content}}</a>
@@ -34,7 +34,9 @@
     data () {
       return {
         count: 10,
-        page: 1
+        page: 1,
+        isChange: false,
+        msgList: []
       }
     },
     fetch ({ store }) {
@@ -63,6 +65,19 @@
       PullUp,
       EmptyStatus
     },
+    watch: {
+      'messageList': {
+        handler: function (val) {
+          if (this.isChange) {
+            this.msgList = val.content
+            this.isChange = false
+          } else {
+            this.msgList = [...this.msgList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
     methods: {
       reloadList: function () {
         this.$store.dispatch('messageShow/getAllMessage', { receiverUu: this.user.data.userUU, receiverEnuu: this.user.data.enterprise.uu, consumerApp: 'MALL', page: this.page, count: this.count, sorting: {'createTime': 'DESC'} })

+ 3 - 1
pages/mobile/wechat/index.vue

@@ -81,7 +81,9 @@
     },
     mounted() {
       let info = localStorage.getItem('USOFTMALLWECHATINFO')
-      localStorage.setItem('RETURNURL', this.$route.query.url || '')
+      if (this.$route.query.url) {
+        localStorage.setItem('RETURNURL', this.$route.query.url || '')
+      }
       if (!info && !this.$route.query.code) {
         window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb3274b676737a319&redirect_uri=https://www.usoftmall.com/mobile/wechat&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
       } else if (info) {

BIN
static/images/mobile/center/vendor/attention-bu.png


+ 10 - 0
store/product.js

@@ -199,5 +199,15 @@ export const actions = {
       }, err => {
         commit('component/REQUEST_COLLECT_FAILURE', err)
       })
+  },
+  // 获取用户收藏类目数据
+  getUserCollectCode({ commit }, params = {}) {
+    commit('component/REQUEST_COLLECTCODE')
+    return axios.get('/kind/concern/list', { params: params })
+      .then(response => {
+        commit('component/REQUEST_COLLECTCODE_SUCCESS', response.data)
+      }, err => {
+        commit('component/REQUEST_COLLECTCODE_FAILURE', err)
+      })
   }
 }

+ 15 - 0
store/product/component.js

@@ -6,6 +6,11 @@ export const state = () => ({
   collectCount: {
     fetching: false,
     data: []
+  },
+  collectCode: {
+    // 类目关注
+    fetching: false,
+    data: []
   }
 })
 
@@ -29,5 +34,15 @@ export const mutations = {
   },
   REQUEST_COLLECT_FAILURE (state) {
     state.fetching = false
+  },
+  REQUEST_COLLECTCODE (state) {
+    state.collectCode.fetching = true
+  },
+  REQUEST_COLLECTCODE_SUCCESS (state, result) {
+    state.collectCode.fetching = false
+    state.collectCode.data = result
+  },
+  REQUEST_COLLECTCODE_FAILURE (state) {
+    state.collectCode = false
   }
 }