Explorar o código

求购询价顶部广告、计数器、代理经销页修改

gaoxm %!s(int64=7) %!d(string=hai) anos
pai
achega
7a5e030a62

+ 1 - 1
components/default/Header.vue

@@ -2,7 +2,7 @@
   <header class="header">
     <div class="apply-adv" v-if="isShowApplyAdv">
       <a href="/applyPurchase#opportunities">
-        <img src="/images/applyPurchase/apply-ad.png" alt="">
+        <img src="/images/applyPurchase/apply-top-ad.jpg" alt="">
       </a>
       <i @click="ShowApplyAdv = false"></i>
     </div>

+ 0 - 87
components/home/count/countItem.vue

@@ -1,87 +0,0 @@
-<template>
-  <div class="count-item">
-      <span>{{ nums }}</span>
-      <span v-text="isMore?'万':'个'" v-if="!isShow && logo !== 0"></span>
-      <span v-text="isMore?'万':'家'" v-if="!isShow && logo === 0"></span>
-      <span v-if="isShow">亿</span>
-  </div>
-</template>
-<script>
-  export default {
-    name: 'count-item',
-    props: {
-      value: {
-        default: 0,
-        type: Number
-      },
-      logo: {
-        default: 0,
-        type: Number
-      }
-    },
-    data () {
-      return {
-        isMore: false,
-        isShow: false,
-        len: 0
-      }
-    },
-    methods: {
-      formatNumber (num) {
-//        let re = /(\d+)(\d{3})/
-        if (num > 99999999) {
-          this.isShow = true
-          let str2 = num.toString()
-          num = Math.floor(num / 100000000)
-          if (parseInt(str2.charAt(str2.length - 8)) > 8) {
-            num = num + 1
-          }
-        }
-        if (num > 9999) {
-          this.isMore = true
-          let str = num.toString()
-          num = Math.floor(num / 10000)
-          if (parseInt(str.charAt(str.length - 4)) > 4) {
-            num = num + 1
-          }
-        }
-        let length = String(num).length
-        this.len = length > 3 ? length + 1 : length
-        num = (Array(7 - length).join(0) + num)
-//        while (re.test(num)) {
-//          num = num.replace(re, '$1,$2')
-//        }
-//        num = num.split('')
-//        console.log(num)
-        return num
-      }
-    },
-    computed: {
-      nums () {
-        return this.formatNumber(this.value)
-      }
-    }
-  }
-</script>
-<style lang="scss" scoped>
-  @import '~assets/scss/variables';
-  .count-item {
-    width: 100%;
-    height: 30px;
-      span{
-        &:first-child{
-          position: relative;
-          top: -2px;
-        }
-        &:last-child{
-          font-size: 16px;
-          color: #376ef3;
-          font-weight: bold;
-          padding: 0px 34px 0px 7px;
-          position: relative;
-          top: -5px;
-        }
-      }
-  }
-</style>
-

+ 42 - 6
components/home/count/displayCard.vue

@@ -10,7 +10,7 @@
          </ul>
          <ul class="list-unstyled">
            <li ref="pingdanListWrapper" v-for="(c, index) in counts"  :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
-             <count-item :value ="c.count" :logo ="c.logo"></count-item>
+             <span v-html="formatScrollNumber(c.count, c.logo)"></span>
            </li>
          </ul>
        </div>
@@ -27,7 +27,6 @@
   </div>
 </template>
 <script>
-  import CountItem from './countItem.vue'
   import {whichTransitionEvent} from '~utils/baseUtils.js'
   export default {
     name: 'display-card',
@@ -40,9 +39,6 @@
         title: [ '品牌', '现货', '规格书', '店铺' ]
       }
     },
-    components: {
-      CountItem
-    },
     mounted () {
       this.$nextTick(() => {
         this.changeInterval(true)
@@ -69,7 +65,7 @@
                          this.isTop = true
                        }
               })
-          }, 4000)
+          }, 3000)
         } else {
           clearInterval(this.timer)
         }
@@ -77,6 +73,45 @@
       cardClose () {
         this.cardShow = false
       },
+      formatScrollNumber (num, logo) {
+//        let re = /(\d+)(\d{3})/
+        if (num > 99999999) {
+          let str2 = num.toString()
+          num = Math.floor(num / 100000000)
+          if (parseInt(str2.charAt(str2.length - 8)) > 8) {
+            num = num + 1
+          }
+          let length = String(num).length
+          this.len = length > 3 ? length + 1 : length
+          num = (Array(7 - length).join(0) + num)
+          num += '&nbsp;<span style="color: #376ef3;font-size: 16px;position:relative;top: -3px;">亿</span>'
+        } else if (num > 9999) {
+          let str = num.toString()
+          num = Math.floor(num / 10000)
+          if (parseInt(str.charAt(str.length - 4)) > 4) {
+            num = num + 1
+          }
+          let length = String(num).length
+          this.len = length > 3 ? length + 1 : length
+          num = (Array(7 - length).join(0) + num)
+          num += '&nbsp;<span style="color: #376ef3;font-size: 16px;position:relative;top: -3px;">万</span>'
+        } else {
+          let length = String(num).length
+          this.len = length > 3 ? length + 1 : length
+          num = (Array(7 - length).join(0) + num)
+          if (logo === 0) {
+            num += '&nbsp;<span style="color: #376ef3;font-size: 16px;position:relative;top: -3px;">家</span>'
+          } else {
+            num += '&nbsp;<span style="color: #376ef3;font-size: 16px;position:relative;top: -3px;">个</span>'
+          }
+        }
+//        while (re.test(num)) {
+//          num = num.replace(re, '$1,$2')
+//        }
+//        num = num.split('')
+//        console.log(num)
+        return num
+      },
       formatNumber (num, type) {
         if (num) {
           if (num.toString().indexOf('E') !== -1) {
@@ -258,6 +293,7 @@
                 color: #fff;
                 position: relative;
                 top: 0;
+                left: -28px;
                 transition: top 1s;
                 -moz-transition: top 1s; /* Firefox 4 */
                 -webkit-transition: top 1s; /* Safari and Chrome */

+ 74 - 47
components/mobile/common/StatisticsMobile.vue

@@ -206,19 +206,21 @@
 </style>-->
 <template>
   <div class="statistics">
-    <ul class="list-inline pull-left" ref="pingdanListWrapper" :style="{top: topLeft + 'rem'}" :class="{no_tran: topLeft == 2.4}">
-      <li v-for="(item, index) in itemData" v-if="index <= 4">
+    <!--<ul class="list-inline pull-left" :style="{top: topLeft + 'rem'}" :class="{no_tran: topLeft == 2.4}">-->
+    <ul class="list-inline pull-left" ref="pingdanListWrapper" :style="'top: -' + 1 * timerIndexL + 'rem'" :class="{'topL': isTopL}">
+      <li v-for="(item, index) in itemLeft">
         <span  class="number">
-          <span class="name" v-html="count[index]"></span>
+          <span class="name" v-html="countLeft[index]"></span>
           <span class="num" v-html="formatNumber(item.count, index)"></span>
           <span class="unit" v-if="item.type === 3">家</span>
         </span>
       </li>
     </ul>
-    <ul class="list-inline pull-right" ref="pingdanListWrapper" :style="{top: topRight + 'rem'}" :class="{no_tran: topRight == 2.4}">
-      <li v-for="(item, index) in itemData" v-if="index > 4">
+      <!--<ul class="list-inline pull-right" :style="{top: topRight + 'rem'}" :class="{no_tran: topRight == 2.4}">-->
+    <ul class="list-inline pull-right" ref="pingdanListWrapper" :style="'top: -' + 1 * timerIndexR + 'rem'" :class="{'topR': isTopR}">
+      <li v-for="(item, index) in itemRight">
         <span class="number">
-          <span class="name" v-html="count[index]"></span>
+          <span class="name" v-html="countRight[index]"></span>
           <span class="month" v-if="index === 5">(上月)</span>
           <span class="month" v-if="index === 6">(本月)</span>
           <span class="num" v-html="formatDouble(item.count)"></span>
@@ -235,11 +237,18 @@
     data () {
       return {
         step: 1,
-        count: ['现货', '品牌', '规格书', '供应商', '店铺', '询价求购', '询价求购', '上年交易', '本年交易'],
+        countLeft: ['现货', '品牌', '规格书', '供应商', '店铺'],
+        countRight: ['询价求购', '询价求购', '上年交易', '本年交易'],
         topLeft: 0,
         topRight: 0,
+        timer: {},
         timerIndex: 0,
-        timer: {}, // 定时器实体
+        timerIndexL: 0,
+        timerIndexR: 0,
+        isTopL: false,
+        isTopR: false,
+        timerL: {},
+        timerR: {}, // 定时器实体
         imgbox: {
             'src': ''
         }
@@ -247,17 +256,17 @@
     },
     mounted () {
       this.$nextTick(() => {
-        this.changeIntervalL()
-        this.changeIntervalR()
+        this.changeIntervalL(true)
+//        this.changeIntervalR(true)
       })
     },
     methods: {
 //      changeIntervalL () {
 //        setInterval(() => {
 //          this.topLeft += -1
-//          let arr1 = this.itemData.slice(0, 5)
-//          let arr2 = arr1.shift()
-//          arr1.push(arr2)
+// //          let arr1 = this.itemData.slice(0, 5)
+// //          let arr2 = arr1.shift()
+// //          arr1.push(arr2)
 //          if (this.topLeft === -5) {
 //            this.topLeft = 0
 //          }
@@ -266,10 +275,10 @@
 //      changeIntervalR () {
 //        setInterval(() => {
 //          this.topRight += -1
-//          let arr1 = this.itemData.slice(5, 9)
-//          let arr2 = arr1.shift()
-//          arr1.push(arr2)
-//          this.itemDataTemp.push(this.itemData)
+// //          let arr1 = this.itemData.slice(5, 9)
+// //          let arr2 = arr1.shift()
+// //          arr1.push(arr2)
+// //          this.itemDataTemp.push(this.itemData)
 //          if (this.topRight === -4) {
 //            this.topRight = 0
 //          }
@@ -277,50 +286,50 @@
 //      },
       changeIntervalL: function (flag) {
         if (flag) {
-          this.timer = setInterval(() => {
-            this.isTop = false
+          this.timerL = setInterval(() => {
+            this.isTopL = false
             let isChange = true
-            this.timerIndex++
+            this.timerIndexL++
             let _transitionEvent = whichTransitionEvent()
             _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
               _transitionEvent, () => {
                 console.log(isChange)
                 if (isChange) {
-                  let title = this.itemData.slice(0, 5).shift()
+                  let title = this.itemLeft.shift()
                   this.title.push(title)
-                  this.timerIndex = 0
+                  this.timerIndexL = 0
                   isChange = false
-                  this.isTop = true
+                  this.isTopL = true
                 }
               })
           }, 2400)
         } else {
-          clearInterval(this.timer)
-        }
-      },
-      changeIntervalR: function (flag) {
-        if (flag) {
-          this.timer = setInterval(() => {
-            this.isTop = false
-            let isChange = true
-            this.timerIndex++
-            let _transitionEvent = whichTransitionEvent()
-            _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
-              _transitionEvent, () => {
-                console.log(isChange)
-                if (isChange) {
-                  let title = this.itemData.slice(5, 9).shift()
-                  this.title.push(title)
-                  this.timerIndex = 0
-                  isChange = false
-                  this.isTop = true
-                }
-              })
-          }, 3000)
-        } else {
-          clearInterval(this.timer)
+          clearInterval(this.timerL)
         }
       },
+//      changeIntervalR: function (flag) {
+//        if (flag) {
+//          this.timerR = setInterval(() => {
+//            this.isTopR = false
+//            let isChange = true
+//            this.timerIndexR++
+//            let _transitionEvent = whichTransitionEvent()
+//            _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
+//              _transitionEvent, () => {
+//                console.log(isChange)
+//                if (isChange) {
+//                  let title = this.itemRight.shift()
+//                  this.title.push(title)
+//                  this.timerIndexR = 0
+//                  isChange = false
+//                  this.isTopR = true
+//                }
+//              })
+//          }, 3000)
+//        } else {
+//          clearInterval(this.timerR)
+//        }
+//      },
       formatNumber (num, type) {
         if (num.toString().indexOf('E') !== -1) {
           let arr = num.toString().split('E')
@@ -408,6 +417,12 @@
         str.push({id: '店铺', count: this.list ? this.list : 0, type: 3})
         str = [str[1], str[0], str[2], str[3], str[8], str[5], str[4], str[6], str[7]]
         return str
+      },
+      itemLeft () {
+        return this.itemData.slice(0, 5)
+      },
+      itemRight () {
+        return this.itemData.slice(5, 9)
       }
     }
   }
@@ -426,6 +441,18 @@
       width:50%;
       position:relative;
       transition: .5s all linear;
+      &.topL {
+        transition: top 0s;
+        -moz-transition: top 0s; /* Firefox 4 */
+        -webkit-transition: top 0s; /* Safari and Chrome */
+        -o-transition: top 0s; /* Opera */
+      }
+      &.topR {
+        transition: top 0s;
+        -moz-transition: top 0s; /* Firefox 4 */
+        -webkit-transition: top 0s; /* Safari and Chrome */
+        -o-transition: top 0s; /* Opera */
+      }
       &:first-child{
         margin-left: .0rem;
       }

+ 1 - 1
components/provider/Carousel.vue

@@ -62,7 +62,7 @@
 <style lang="scss" scoped>
   @import '~assets/scss/variables';
 
-  $carousel_width: 668px;
+  $carousel_width: 908px;
   $carousel_height: 358px;
 
   .carousel {

+ 7 - 7
components/provider/RecommendStore.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="container marketing">
-    <div class="sales-rank">
+    <!--<div class="sales-rank">
       <sales-rank />
-    </div>
+    </div>-->
     <div class="carousel">
       <carousel />
     </div>
@@ -12,14 +12,14 @@
   </div>
 </template>
 <script>
-import SalesRank from './SalesRank.vue'
+// import SalesRank from './SalesRank.vue'
 import NewStore from './NewStore.vue'
 import Carousel from './Carousel.vue'
 
 export default {
   name: 'recommend-store',
   components: {
-    SalesRank,
+//    SalesRank,
     NewStore,
     Carousel
   }
@@ -33,15 +33,15 @@ export default {
     min-height: 360px;
     padding: 0;
 
-    .sales-rank {
+    /*.sales-rank {
       width: 240px;
       min-height: 360px;
       float: left;
       display: inline-block;
-    }
+    }*/
 
     .carousel {
-      width: 670px;
+      width: 910px;
       min-height: 360px;
       display: inline-block;
       float: left;

BIN=BIN
static/images/applyPurchase/apply-top-ad.jpg