Commit 5799be72 by 胡悦

提交

1 parent e2ca2e40
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-30 10:59:56 * @LastEditTime: 2022-06-30 17:18:27
--> -->
<template> <template>
<div> <div>
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
</div> </div>
<div class="ranking-content"> <div class="ranking-content">
<div class="ranking-item" v-for="(item, index) in flowData" :key="index"> <div class="ranking-item" v-for="(item, index) in flowData" :key="index">
<span>{{ item.id }}</span> <span>{{ index + 1 }}</span>
<span class="ranking-name"> <span class="ranking-name">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.name" /> <marquee :direction="directionTimer" :delay="delayTimer" :text="item.brand" />
</span> </span>
<span class="ranking-text">{{ item.num }}</span> <span class="ranking-text">{{ item.value }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -204,9 +204,26 @@ export default { ...@@ -204,9 +204,26 @@ export default {
api = 'storeSaleTrans' api = 'storeSaleTrans'
} }
this.api.sales[api](params).then(res => { this.api.sales[api](params).then(res => {
const { topList, lastList } = res.data.dataList[0] console.log(res)
this.topList = topList ? JSON.parse(topList) : [] this.topList = []
this.lastList = lastList ? JSON.parse(lastList) : [] this.lastList = []
let { topList, lastList } = res.data.dataList[0]
topList = topList ? JSON.parse(topList) : []
lastList = lastList ? JSON.parse(lastList) : []
for (const key in topList) {
this.topList.push({
brand: key,
value: topList[key]
})
}
for (const key in lastList) {
this.lastList.push({
brand: key,
value: lastList[key]
})
}
// this.lastList = lastList ? JSON.parse(lastList) : []
console.log(this.topList, this.lastList)
// this.topList = [ // this.topList = [
// { // {
// id: 1, // id: 1,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!