fanfan 7 months ago
commit 2e895ff215
  1. 72
      src/views/index/Index.vue

@ -168,23 +168,24 @@
<span>常用功能</span>
</div>
<a-row :gutter="32">
<a-col class :span="6" v-for="(item, index) in functions" :key="index">
<div
v-if="!item.moduleKey || $module(item.moduleKey)"
class="item"
@click="handleLink(item.link)"
>
<div class="flex flex-y-center">
<div
class="icon flex flex-x-center flex-y-center"
:style="{ backgroundColor: item.color }"
>
<a-icon :component="item.icon" />
<template v-for="(item, index) in functions">
<a-col class :span="6" v-if="(item.name !== '发布商品' || storeVersion !== 1) && (!item.moduleKey || $module(item.moduleKey))" :key="index">
<div
class="item"
@click="handleLink(item.link)"
>
<div class="flex flex-y-center">
<div
class="icon flex flex-x-center flex-y-center"
:style="{ backgroundColor: item.color }"
>
<a-icon :component="item.icon" />
</div>
<span class="name">{{ item.name }}</span>
</div>
<span class="name">{{ item.name }}</span>
</div>
</div>
</a-col>
</a-col>
</template>
</a-row>
</a-card>
@ -216,11 +217,18 @@ const functions = [
link: '/goods/create'
},
{
name: '店铺装修',
icon: Icons.functions.decorate,
color: '#f15858',
link: '/page/index'
name: '数据统计',
icon: Icons.functions.statistics,
color: '#139dff',
link: '/statistics',
moduleKey: 'statistics-statistics'
},
// {
// name: '',
// icon: Icons.functions.decorate,
// color: '#f15858',
// link: '/page/index'
// },
{
name: '会员管理',
icon: Icons.functions.user,
@ -252,13 +260,6 @@ const functions = [
color: '#f15858',
link: '/market/coupon/index',
moduleKey: 'app-coupon'
},
{
name: '数据统计',
icon: Icons.functions.statistics,
color: '#139dff',
link: '/statistics',
moduleKey: 'statistics-statistics'
}
]
@ -309,12 +310,29 @@ export default {
//
isLoading: false,
//
data
data,
timer: null,
storeVersion: window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
created () {
//
this.getData()
if (!window.localStorage.getItem('storeInfo')) {
this.timer = setInterval(() => {
if (window.localStorage.getItem('storeInfo')) {
this.storeVersion = JSON.parse(window.localStorage.getItem('storeInfo')).store_version
window.clearInterval(this.timer)
this.timer = null
}
}, 100)
}
},
beforeDestroy() {
if (this.timer) {
window.clearInterval(this.timer)
this.timer = null
}
},
methods: {

Loading…
Cancel
Save