|
|
@@ -4,8 +4,8 @@
|
|
|
<div class="content" v-if="cardShow">
|
|
|
<div>
|
|
|
<ul class="list-unstyled">
|
|
|
- <li ref="pingdanListWrapper" v-for="item in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
- <span>{{item.item}}</span>
|
|
|
+ <li ref="pingdanListWrapper" v-for="item in title" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
+ <span>{{item}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="list-unstyled">
|
|
|
@@ -32,7 +32,8 @@
|
|
|
cardShow: true,
|
|
|
timerIndex: 0,
|
|
|
isTop: false, // 判断是否滚动至顶,
|
|
|
- timer: {} // 定时器实体
|
|
|
+ timer: {}, // 定时器实体
|
|
|
+ title: ['品 牌', '现 货', '规格书', '店 铺']
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
@@ -52,7 +53,9 @@
|
|
|
_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
|
|
|
@@ -171,15 +174,16 @@
|
|
|
let count = this.baseUtils.deepCopy(this.counter)
|
|
|
if(count.length){
|
|
|
count.forEach((value) => {
|
|
|
- if (value.usedFor === 'mall_home_banner') {
|
|
|
- value.type = value.detno === 2 ? 3: 1
|
|
|
- value.count = this.formatNumber(value.count)
|
|
|
- arr.push(value)
|
|
|
+ if (value.item === '供应商') {
|
|
|
+ arr[0] = {id: value.item, count: this.formatNumber(value.count), type: 3}
|
|
|
+ } else if (value.item === '本年交易金额') {
|
|
|
+ arr[1] = {id: value.item, count: this.formatNumber(value.count), type: 1}
|
|
|
+ } else if (value.item === '上年交易金额') {
|
|
|
+ arr[2] = {id: value.item, count: this.formatNumber(value.count), type: 1}
|
|
|
}
|
|
|
})
|
|
|
- arr = arr.sort((a,b) => {return a.detno - b.detno})
|
|
|
- arr.push({count: this.inquirySheet ? this.inquirySheet : 0, type: 2},
|
|
|
- {count: this.inquirySheetLast ? this.inquirySheetLast : 0, type: 2})
|
|
|
+ arr[3] = {id: '本月求购数', count: this.inquirySheet ? this.inquirySheet : 0, type: 2}
|
|
|
+ arr[4] = {id: '上月求购数', count: this.inquirySheetLast ? this.inquirySheetLast : 0, type: 2}
|
|
|
}
|
|
|
return arr
|
|
|
},
|
|
|
@@ -188,12 +192,16 @@
|
|
|
let count = this.baseUtils.deepCopy(this.counter)
|
|
|
if(count.length) {
|
|
|
count.forEach((value) => {
|
|
|
- if (value.usedFor === 'b2c_index') {
|
|
|
- value.logo = value.detno === 4 ? 0: 1
|
|
|
- arr.push(value)
|
|
|
+ if (value.item === '品牌') {
|
|
|
+ arr[0] = {id: value.item, count: value.count, logo: 1}
|
|
|
+ } else if (value.item === '现货') {
|
|
|
+ arr[1] = {id: value.item, count: value.count, logo: 1}
|
|
|
+ } else if (value.item === '规格书') {
|
|
|
+ arr[2] = {id: value.item, count: value.count, logo: 1}
|
|
|
+ } else if (value.item === '店铺') {
|
|
|
+ arr[3] = {id: value.item, count: value.count, logo: 0}
|
|
|
}
|
|
|
})
|
|
|
- arr = arr.sort((a,b) => {return a.detno - b.detno})
|
|
|
}
|
|
|
return arr
|
|
|
}
|