Commit e8dae17a by 匡雅琴

接口调整

1 parent bbb8988f
...@@ -96,18 +96,18 @@ export default { ...@@ -96,18 +96,18 @@ export default {
} }
}, },
created() { created() {
this.$bus.$on('crowdFundingMonth', data => { // this.$bus.$on('crowdFundingMonth', data => {
this.month = data // this.month = data
this.getBrandRank(data) // this.getBrandRank(data)
}) // })
this.getBrandRank()
}, },
mounted() {}, mounted() {},
methods: { methods: {
async getBrandRank(month, queryItem) { async getBrandRank(queryItem) {
const _params = { const _params = {
month,
queryItem: queryItem || this.tabItem queryItem: queryItem || this.tabItem
} }
const _result = await this.api.crowdFunding.getBrandRank(_params) const _result = await this.api.crowdFunding.getBrandRank(_params)
...@@ -121,23 +121,23 @@ export default { ...@@ -121,23 +121,23 @@ export default {
changeTab(val) { changeTab(val) {
switch (val) { switch (val) {
case 0: case 0:
this.getBrandRank(this.month, 'AR') this.getBrandRank('AR')
this.tabItem = 'AR' this.tabItem = 'AR'
break break
case 1: case 1:
this.getBrandRank(this.month, 'navigation360') this.getBrandRank('navigation360')
this.tabItem = 'navigation360' this.tabItem = 'navigation360'
break break
case 2: case 2:
this.getBrandRank(this.month, 'seat') this.getBrandRank('seat')
this.tabItem = 'seat' this.tabItem = 'seat'
break break
case 3: case 3:
this.getBrandRank(this.month, 'light') this.getBrandRank('light')
this.tabItem = 'light' this.tabItem = 'light'
break break
case 4: case 4:
this.getBrandRank(this.month, 'digitalbeauty') this.getBrandRank('digitalbeauty')
this.tabItem = 'digitalbeauty' this.tabItem = 'digitalbeauty'
break break
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="flex"> <div class="flex">
<div v-for="(item, index) in tabList" :key="index" class="tab-item" :class="tabActive == index ? 'tab-item-active' : ''" @click="changeTab(index)">{{ item }}</div> <div v-for="(item, index) in tabList" :key="index" class="tab-item" :class="tabActive == index ? 'tab-item-active' : ''" @click="changeTab(index)">{{ item }}</div>
</div> </div>
<div class="flex"> <div class="flex" v-show="showMonth">
<span class="month-text">统计月份:</span> <span class="month-text">统计月份:</span>
<div class="month-plugin"> <div class="month-plugin">
<div class="month" @click.stop="switchMonth"> <div class="month" @click.stop="switchMonth">
...@@ -38,6 +38,7 @@ export default { ...@@ -38,6 +38,7 @@ export default {
return { return {
tabActive: 0, tabActive: 0,
isShow: false, isShow: false,
showMonth: true,
defaultMonth: { defaultMonth: {
label: new Date().format('yyyy-MM'), label: new Date().format('yyyy-MM'),
statMonth: new Date().format('yyyy-MM') statMonth: new Date().format('yyyy-MM')
...@@ -68,6 +69,7 @@ export default { ...@@ -68,6 +69,7 @@ export default {
// tab切换 // tab切换
changeTab(index) { changeTab(index) {
this.tabActive = index this.tabActive = index
this.showMonth = index === 0
this.$emit('tabChange', index) this.$emit('tabChange', index)
}, },
switchMonth() { switchMonth() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!