gaoxm 7 жил өмнө
parent
commit
96aba6afba

+ 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'

+ 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 - 1
nuxt.config.js

@@ -1,7 +1,7 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 // b2c后台
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://10.1.51.79:8080/platform-b2c')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://10.1.51.124:8080/platform-b2c')
 // 公共询价
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 // 公共物料