|
|
@@ -4,18 +4,19 @@
|
|
|
<div class="content" v-if="cardShow">
|
|
|
<div>
|
|
|
<ul class="list-unstyled">
|
|
|
- <li ref="pingdanListWrapper" v-for="(item, index) in title" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
- <span>{{item}}</span>
|
|
|
+ <li ref="pingdanListWrapper" v-for="item in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
+ <span>{{item.item}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="list-unstyled">
|
|
|
- <li ref="pingdanListWrapper" v-for="(c, index) in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
+ <li ref="pingdanListWrapper" v-for="c in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
<span v-for="(item, index) in formatScrollNumber(c.count, c.logo)" class="count-distance" :class="'count' + index">{{item}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div v-for="item in itemCounts">
|
|
|
- <p><span v-html="item.count"></span>
|
|
|
+ <p>
|
|
|
+ <span v-html="item.count"></span>
|
|
|
<span style="color: #333" v-if="item.type === 3">家</span>
|
|
|
<span style="color: #333" v-if="item.type === 2">条</span>
|
|
|
</p>
|
|
|
@@ -31,8 +32,7 @@
|
|
|
cardShow: true,
|
|
|
timerIndex: 0,
|
|
|
isTop: false, // 判断是否滚动至顶,
|
|
|
- timer: {}, // 定时器实体
|
|
|
- title: [ '品牌', '现货', '规格书', '店铺' ]
|
|
|
+ timer: {} // 定时器实体
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
@@ -52,9 +52,7 @@
|
|
|
_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
|
|
|
@@ -71,7 +69,6 @@
|
|
|
this.cardShow = false
|
|
|
},
|
|
|
formatScrollNumber (num, logo) {
|
|
|
-// let re = /(\d+)(\d{3})/
|
|
|
if (num) {
|
|
|
if (num > 99999999) {
|
|
|
let str2 = num.toString()
|
|
|
@@ -104,11 +101,6 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// while (re.test(num)) {
|
|
|
-// num = num.replace(re, '$1,$2')
|
|
|
-// }
|
|
|
-// num = num.split('')
|
|
|
-// console.log(num)
|
|
|
let _arr = []
|
|
|
for (let i = 0; i < num.length; i++) {
|
|
|
_arr.push(num[i])
|
|
|
@@ -163,14 +155,8 @@
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
- allCount () {
|
|
|
- return this.$store.state.count.allCount.data
|
|
|
- },
|
|
|
- payMoneyLast () {
|
|
|
- return this.allCount[0] ? this.formatNumber(this.allCount[0].count, 1) : 0
|
|
|
- },
|
|
|
- payMoney () {
|
|
|
- return this.allCount[1] ? this.formatNumber(this.allCount[1].count, 1) : 0
|
|
|
+ counter () {
|
|
|
+ return this.$store.state.option.counter.data
|
|
|
},
|
|
|
inquirySheet () {
|
|
|
let sheetNum = this.$store.state.count.inquirySheet.data
|
|
|
@@ -180,33 +166,32 @@
|
|
|
let lastSheetNum = this.$store.state.count.inquirySheetLast.data
|
|
|
return lastSheetNum ? this.formatDouble(lastSheetNum.count) : 0
|
|
|
},
|
|
|
- all () {
|
|
|
- let count = this.$store.state.supplier.merchant.merchantAll.data
|
|
|
- let supplierCount = count.content ? count.totalElements + '' : 0
|
|
|
- return this.formatNumber(supplierCount, 0)
|
|
|
- },
|
|
|
itemCounts () {
|
|
|
let arr = []
|
|
|
- arr.push({count: this.all ? this.all : 0, type: 3}, {count: this.payMoney ? this.payMoney : 0, type: 1}, {count: this.payMoneyLast ? this.payMoneyLast : 0, type: 1}, {count: this.inquirySheet ? this.inquirySheet : 0, type: 2}, {count: this.inquirySheetLast ? this.inquirySheetLast : 0, type: 2})
|
|
|
+ let count = this.baseUtils.deepCopy(this.counter)
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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})
|
|
|
return arr
|
|
|
},
|
|
|
- list () {
|
|
|
- let list = JSON.parse(JSON.stringify(this.$store.state.provider.stores.storeList.data))
|
|
|
- return list
|
|
|
- },
|
|
|
counts () {
|
|
|
let arr = []
|
|
|
- let countM = this.$store.state.product.common.counts.data
|
|
|
- if (countM) {
|
|
|
- countM.forEach((value, key, $data) => {
|
|
|
- arr.push({count: value.count, logo: 1})
|
|
|
- })
|
|
|
- }
|
|
|
- arr.push({count: this.list.totalElements, logo: 0})
|
|
|
+ let count = this.baseUtils.deepCopy(this.counter)
|
|
|
+ count.forEach((value) => {
|
|
|
+ if (value.usedFor === 'b2c_index') {
|
|
|
+ value.logo = value.detno === 4 ? 0: 1
|
|
|
+ arr.push(value)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ arr = arr.sort((a,b) => {return a.detno - b.detno})
|
|
|
return arr
|
|
|
- },
|
|
|
- enterprise () {
|
|
|
- return this.user.data.enterprise
|
|
|
}
|
|
|
}
|
|
|
}
|