Selaa lähdekoodia

feat(home-new): 新增首页模块,包含整体数据展示、类型详情和通知组件

refactor: 重构路由配置,将原首页路径迁移至home-new
style: 更新图标资源,添加多种状态图标
docs: 添加首页模块相关API文档
huoyi 2 kuukautta sitten
vanhempi
commit
8e322e255c

+ 90 - 0
src/api/home-new/home-new.js

@@ -0,0 +1,90 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询我的任务列表(当天有效任务)shudong
4
+export function getHomePage(params) {
5
+  return request({
6
+    url: '/check/largeScreen/homePage',
7
+    method: 'get',
8
+    params: params
9
+  })
10
+}
11
+//获取查获上报数据  xiaoxiong
12
+export function getSeizureReport(params) {
13
+  return request({
14
+    url: '/system/check/seizureReport/data',
15
+    method: 'get',
16
+    params: params
17
+  })
18
+}
19
+
20
+//获取考勤统计数据   binge
21
+export function getAttendanceStats(params) {
22
+  return request({
23
+    url: '/attendance/stats/getAttendanceStats',
24
+    method: 'get',
25
+    params: params
26
+  })
27
+}
28
+
29
+//抽问抽答,首页   binge
30
+export function getAccuracyStatistics(params) {
31
+  return request({
32
+    url: '/exam/daily/accuracy-statistics',
33
+    method: 'get',
34
+    params: params
35
+  })
36
+}
37
+
38
+//根据角色获取查获排名  xiaoxiong
39
+export function getSeizureRanking(data) {
40
+  return request({
41
+    url: '/item/seizure/ranking/getRankingByRole',
42
+    method: 'post',
43
+    data: data
44
+  })
45
+}
46
+
47
+
48
+//获取检查排名  shudong
49
+export function getCheckRanking(params) {
50
+  return request({
51
+    url: '/system/homePage/homePageRanking',
52
+    method: 'get',
53
+    params: params
54
+  })
55
+}
56
+
57
+//首页-整体   shudong binge xiaoxiong
58
+export function getHomePageWhole(params) {
59
+  return request({
60
+    url: '/system/homePage/homePageWhole',
61
+    method: 'get',
62
+    params: params
63
+  })
64
+}
65
+//首页-明细(能力对比) shudong binge xiaoxiong
66
+export function getHomePageDetail(data) {
67
+  return request({
68
+    url: '/system/homePage/homePageDetail',
69
+    method: 'post',
70
+    data: data
71
+  })
72
+}
73
+
74
+//根据角色标识查询今日上岗用户列表
75
+export function selectUserListByRoleKey(data) {
76
+  return request({
77
+    url: '/attendance/postRecord/selectUserListByRoleKey',
78
+    method: 'post',
79
+    data: data
80
+  })
81
+}
82
+
83
+//首页报表-整体
84
+export function getHomeReportWhole(params) {
85
+  return request({
86
+    url: '/system/homeReport/homeReportWhole',
87
+    method: 'get',
88
+    params: params
89
+  })
90
+}

+ 1 - 1
src/components/custom-tabbar.vue

@@ -14,7 +14,7 @@ export default {
14 14
     return {
15 15
       list: [
16 16
         {
17
-          pagePath: "pages/home/index",
17
+          pagePath: "pages/home-new/index",
18 18
           iconPath: "/static/images/tabbar/home.png",
19 19
           selectedIconPath: "/static/images/tabbar/home_.png",
20 20
           text: "首页"

+ 81 - 0
src/components/select-tag/select-tag.vue

@@ -0,0 +1,81 @@
1
+<template>
2
+    <div class="time-tag-container">
3
+        <div class="custom-tag-container">
4
+            <div v-for="tag in tags" :key="tag.value" class="custom-tag"
5
+                :class="{ 'active': selectedValue === tag.value }" @click="handleTagClick(tag)">
6
+                <span class="tag-text">{{ tag.label }}</span>
7
+            </div>
8
+        </div>
9
+    </div>
10
+</template>
11
+
12
+<script>
13
+export default {
14
+    name: 'SelectTag',
15
+    props: {
16
+        tags: {
17
+            type: Array,
18
+            default: () => []
19
+        },
20
+        selectedValue: {
21
+            type: String,
22
+            default: ''
23
+        }
24
+    },
25
+    methods: {
26
+        handleTagClick(tag) {
27
+            if (tag.value === 'custom') {
28
+                // 触发自定义时间选择器显示事件
29
+                this.$emit('show-custom-picker', tag.value);
30
+            } else {
31
+                // 触发普通时间范围变化事件
32
+                this.$emit('change', tag.value);
33
+            }
34
+        }
35
+    }
36
+}
37
+</script>
38
+
39
+<style lang="scss" scoped>
40
+.time-tag-container {
41
+    display: flex;
42
+    justify-content: flex-start;
43
+    margin-top: 30rpx;
44
+}
45
+
46
+.custom-tag-container {
47
+    display: flex;
48
+    flex-wrap: wrap;
49
+    gap: 5rpx;
50
+    align-items: center;
51
+}
52
+
53
+.custom-tag {
54
+    display: flex;
55
+    align-items: center;
56
+    padding: 7rpx 15rpx;
57
+
58
+    color: #FFFFFF;
59
+
60
+    border-radius: 20rpx;
61
+    font-size: 24rpx;
62
+    cursor: pointer;
63
+    transition: all 0.3s ease;
64
+}
65
+
66
+.custom-tag.active {
67
+    background: rgba(255, 255, 255, 0.2);
68
+    color: #FFFFFF;
69
+    font-weight: bold;
70
+    background: rgba(255, 255, 255, 0.2);
71
+}
72
+
73
+// .custom-tag:hover {
74
+//     background: rgba(255, 255, 255, 0.4);
75
+//     border-color: rgba(255, 255, 255, 0.6);
76
+// }
77
+
78
+.tag-text {
79
+    // margin-right: 8rpx;
80
+}
81
+</style>

+ 15 - 2
src/pages.json

@@ -26,6 +26,13 @@
26 26
       }
27 27
     },
28 28
     {
29
+      "path": "pages/home-new/index",
30
+      "style": {
31
+        "navigationBarTitleText": "安检分级质控系统移动端",
32
+        "navigationStyle": "custom"
33
+      }
34
+    },
35
+    {
29 36
       "path": "pages/work/index",
30 37
       "style": {
31 38
         "navigationBarTitleText": "工作台"
@@ -146,6 +153,12 @@
146 153
       }
147 154
     },
148 155
     {
156
+      "path": "pages/home-new/index",
157
+      "style": {
158
+        "navigationBarTitleText": "首页"
159
+      }
160
+    },
161
+    {
149 162
       "path": "pages/personal-center/index",
150 163
       "style": {
151 164
         "navigationBarTitleText": "个人中心"
@@ -217,7 +230,7 @@
217 230
         "navigationBarTitleText": "公告详情"
218 231
       }
219 232
     },
220
-       {
233
+    {
221 234
       "path": "pages/announcement/noticeDetail",
222 235
       "style": {
223 236
         "navigationBarTitleText": "通知详情"
@@ -294,7 +307,7 @@
294 307
     "marginBottom": "0px",
295 308
     "list": [
296 309
       {
297
-        "pagePath": "pages/home/index",
310
+        "pagePath": "pages/home-new/index",
298 311
         "iconPath": "static/images/tabbar/home.png",
299 312
         "selectedIconPath": "static/images/tabbar/home_.png",
300 313
         "text": "首页"

+ 157 - 0
src/pages/home-new/components/notice.vue

@@ -0,0 +1,157 @@
1
+<template>
2
+  <div class="tips" @click="navigateToDetail(currentNotice)">
3
+    <img alt="" src="@/static/images/notice.png">
4
+    <div class="notice-container">
5
+      <transition name="slide-up-down" mode="out-in">
6
+        <div :key="currentNotice && currentNotice.noticeId" class="notice-content">
7
+          {{ currentNotice && currentNotice.noticeTitle ? currentNotice.noticeTitle : '暂无通知' }}
8
+        </div>
9
+      </transition>
10
+    </div>
11
+  </div>
12
+</template>
13
+
14
+<script>
15
+import { getNoticeList } from "@/api/announcement/announcement.js";
16
+
17
+export default {
18
+  name: 'Notice',
19
+  data() {
20
+    return {
21
+      noticeList: [],
22
+      currentIndex: 0,
23
+      currentNotice: null,
24
+      timer: null
25
+    };
26
+  },
27
+  mounted() {
28
+    // 组件首次加载时获取数据
29
+    // this.fetchNoticeData();
30
+  },
31
+  destroyed() {
32
+    // 清理定时器
33
+    if (this.timer) {
34
+      clearInterval(this.timer);
35
+    }
36
+  },
37
+  methods: {
38
+    // 提供给父组件调用的刷新方法
39
+    refreshData() {
40
+      this.fetchNoticeData();
41
+    },
42
+
43
+    // 获取公告数据
44
+    async fetchNoticeData() {
45
+
46
+      try {
47
+        const response = await getNoticeList({
48
+          status: '0',
49
+          noticeType: 1,
50
+          pageSize: 999
51
+        });
52
+
53
+        // 假设response.data包含公告列表
54
+        this.noticeList = response.rows || [];
55
+        if (this.noticeList.length > 0) {
56
+          this.currentNotice = this.noticeList[0];
57
+          if (this.timer) {
58
+            clearInterval(this.timer);
59
+          }
60
+          // 数据加载完成后启动轮播
61
+          this.startCarousel();
62
+        }
63
+      } catch (error) {
64
+        console.error('获取公告数据失败:', error);
65
+      }
66
+    },
67
+
68
+    // 开始轮播
69
+    startCarousel() {
70
+      if (this.noticeList.length <= 1) return;
71
+
72
+      this.timer = setInterval(() => {
73
+        this.currentIndex = (this.currentIndex + 1) % this.noticeList.length;
74
+        this.currentNotice = this.noticeList[this.currentIndex];
75
+      }, 3000); // 5秒轮播一次
76
+    },
77
+
78
+    // 跳转到详情页
79
+    navigateToDetail(notice) {
80
+      if (!notice || !notice.noticeId) return;
81
+
82
+      uni.navigateTo({
83
+        url: '/pages/announcement/noticeDetail?id=' + notice.noticeId
84
+      });
85
+    }
86
+  }
87
+}
88
+</script>
89
+
90
+<style lang="scss" scoped>
91
+.tips {
92
+  display: flex;
93
+  align-items: center;
94
+  padding: 16rpx 28rpx;
95
+  background: #FFF4F4;
96
+  border-radius: 32rpx;
97
+  font-size: 24rpx;
98
+  color: #222222;
99
+  line-height: 28rpx;
100
+  margin-bottom: 32rpx;
101
+  cursor: pointer; // 鼠标指针变为手型
102
+  transition: all 0.3s ease; // 添加过渡效果
103
+  overflow: hidden;
104
+
105
+  img {
106
+    width: 66rpx;
107
+    padding-right: 28rpx;
108
+    border-right: 1px solid rgba(0, 0, 0, 0.1);
109
+    margin-right: 28rpx;
110
+    flex-shrink: 0;
111
+  }
112
+
113
+  .notice-container {
114
+    flex: 1;
115
+    overflow: hidden;
116
+    height: 28rpx;
117
+    position: relative;
118
+  }
119
+
120
+  .notice-content {
121
+    position: absolute;
122
+    top: 0;
123
+    left: 0;
124
+    width: 100%;
125
+    white-space: nowrap;
126
+    overflow: hidden;
127
+    text-overflow: ellipsis;
128
+  }
129
+
130
+  // 上下滚动动画
131
+  .slide-up-down-enter-active,
132
+  .slide-up-down-leave-active {
133
+    transition: all 0.5s ease;
134
+  }
135
+
136
+  .slide-up-down-enter-from {
137
+    transform: translateY(30rpx);
138
+    opacity: 0;
139
+  }
140
+
141
+  .slide-up-down-leave-to {
142
+    transform: translateY(-30rpx);
143
+    opacity: 0;
144
+  }
145
+
146
+  // 鼠标悬停效果
147
+  &:hover {
148
+    background: #FFE8E8; // 背景色变深
149
+    transform: scale(1.01); // 轻微放大
150
+  }
151
+
152
+  // 点击效果
153
+  &:active {
154
+    transform: scale(0.99); // 轻微缩小
155
+  }
156
+}
157
+</style>

+ 596 - 0
src/pages/home-new/components/total-detail.vue

@@ -0,0 +1,596 @@
1
+<template>
2
+    <div class="total-detail-container">
3
+        <!-- 标题和链接区域 -->
4
+        <div class="item-header">
5
+            <div class="title-section">
6
+                <div class="item-title">整体</div>
7
+                <div class="item-link report-link"
8
+                    @click="handleReportLinkClick">整体报表</div>
9
+            </div>
10
+            <div class="item-links">
11
+                <div class="item-link"
12
+                    v-if="!role.includes('SecurityCheck') && !(role.includes('banzuzhang') && selectedRole == 'individual')"
13
+                    @click="handleLinkClick('/pages/capabilityComparison/index')">能力对比</div>
14
+            </div>
15
+        </div>
16
+
17
+        <!-- 雷达图区域 -->
18
+        <div class="chart-section">
19
+            <div class="chart-container">
20
+                <div id="radar-chart" class="radar-chart"></div>
21
+            </div>
22
+
23
+        </div>
24
+
25
+        <!-- 数据展示区域 -->
26
+        <div class="data-section">
27
+            <div v-for="(item, index) in dataItems" :key="index" class="data-item">
28
+                <div class="item-title">{{ item.title }}</div>
29
+                <div class="data-content-section">
30
+                    <div class="data-content" v-for="ele in item.list">
31
+                        <div class="data-value">{{ ele.value }}</div>
32
+                        <div class="data-label">{{ ele.label }}</div>
33
+                    </div>
34
+                </div>
35
+            </div>
36
+        </div>
37
+    </div>
38
+</template>
39
+
40
+<script>
41
+import * as echarts from 'echarts';
42
+
43
+
44
+export default {
45
+    name: 'TotalDetail',
46
+    data() {
47
+        return {
48
+            chart: null,
49
+
50
+
51
+            dataItems: []
52
+        }
53
+    },
54
+    props: {
55
+        homePageWholeData: {
56
+            type: Array,
57
+            default: () => []
58
+        },
59
+        startDate: {
60
+            type: String,
61
+            default: ''
62
+        },
63
+        endDate: {
64
+            type: String,
65
+            default: ''
66
+        },
67
+        timeRange: {
68
+            type: String,
69
+            default: 'year'
70
+        },
71
+        selectedRole: {
72
+            type: String,
73
+            default: ''
74
+        }
75
+    },
76
+    watch: {
77
+        homePageWholeData: {
78
+            handler(newValue) {
79
+                this.updateData(newValue);
80
+            },
81
+            deep: true,
82
+            immediated: true,
83
+        }
84
+    },
85
+    computed: {
86
+        role() {
87
+            return this.$store?.state?.user?.roles
88
+        },
89
+        currentUser() {
90
+            return this.$store.state.user;
91
+        }
92
+    },
93
+    mounted() {
94
+        // this.initChart();
95
+
96
+    },
97
+
98
+    beforeDestroy() {
99
+        if (this.chart) {
100
+            this.chart.dispose();
101
+        }
102
+    },
103
+    methods: {
104
+        updateData(newValue) {
105
+            console.log(newValue, "newValue")
106
+            this.dataItems = newValue.map(item => {
107
+                return {
108
+                    title: item.name + "数据明细",
109
+                    list: [
110
+                        { label: '人均查获数量', value: item.seizureCount || 0 },
111
+                        { label: '人均在岗时长', value: item.workingHours || 0 },
112
+                        { label: '巡检合格率', value: `${((item.checkPassRate * 100) || 0).toFixed(2)}%` },
113
+                        { label: '抽问抽答正确率', value: `${((item.answersAccuracy * 100) || 0).toFixed(2)}%` },
114
+                        { label: '培训答题平均分', value: item.learningGrowthScore || 0 }
115
+                    ]
116
+                }
117
+            })
118
+
119
+            // 同时更新雷达图数据
120
+            this.updateChartWithData();
121
+        },
122
+        handleLinkClick(link) {
123
+            if (link) {
124
+                const roles = this.currentUser.roles;
125
+                const userInfo = this.currentUser.userInfo;
126
+
127
+                let obj = {};
128
+                if (roles.includes('SecurityCheck')) {
129
+                    obj = {
130
+                        id: userInfo.userId,
131
+                        name: userInfo.nickName,
132
+                        type: 'USER'
133
+                    }
134
+                }
135
+                if (roles.includes('banzuzhang')) {
136
+                    obj = {
137
+                        id: userInfo.teamsId,
138
+                        name: userInfo.teamsName,
139
+                        type: 'DEPT'
140
+                    }
141
+                }
142
+                if (roles.includes('kezhang')) {
143
+                    obj = {
144
+                        id: userInfo.departmentId,
145
+                        name: userInfo.departmentName,
146
+                        type: 'DEPT'
147
+                    }
148
+                }
149
+                if (roles.includes('test') || roles.includes('zhijianke')) {
150
+                    obj = {
151
+                        id: userInfo.stationId,
152
+                        name: userInfo.stationName,
153
+                        type: 'DEPT'
154
+                    }
155
+                }
156
+
157
+                // 添加时间参数
158
+                const timeParams = {
159
+                    startDate: this.startDate,
160
+                    endDate: this.endDate,
161
+                    timeRange: this.timeRange
162
+                };
163
+
164
+                // 合并所有参数
165
+                const allParams = {
166
+                    ...obj,
167
+                    ...timeParams
168
+                };
169
+
170
+                // 构建带参数的URL
171
+                let finalUrl = link;
172
+                if (Object.keys(allParams).length > 0) {
173
+                    // 检查URL是否已有参数
174
+                    const separator = link.includes('?') ? '&' : '?';
175
+                    const queryString = Object.keys(allParams)
176
+                        .filter(key => allParams[key]) // 过滤掉空值
177
+                        .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(allParams[key])}`)
178
+                        .join('&');
179
+
180
+                    if (queryString) {
181
+                        finalUrl = `${link}${separator}${queryString}`;
182
+                    }
183
+                }
184
+
185
+                uni.navigateTo({
186
+                    url: finalUrl
187
+                });
188
+            }
189
+        },
190
+
191
+
192
+
193
+
194
+        updateChartWithData() {
195
+            const chartDom = document.getElementById('radar-chart');
196
+            if (!chartDom) {
197
+                console.warn('雷达图容器未找到');
198
+                return;
199
+            }
200
+
201
+            this.chart = echarts.init(chartDom);
202
+            // 根据接口数据更新雷达图
203
+            if (this.chart && this.homePageWholeData && this.homePageWholeData.length > 0) {
204
+                // 使用Graph后缀的数据来显示雷达图
205
+                const seriesData = this.homePageWholeData.map(item => ({
206
+                    name: item.name,
207
+                    value: [
208
+                        item.seizureCountGraph || 0,
209
+                        item.workingHoursGraph || 0,
210
+                        item.checkPassRateGraph || 0,
211
+                        item.answersAccuracyGraph || 0,
212
+                        item.learningGrowthScoreGraph || 0
213
+                    ]
214
+                }));
215
+
216
+                // 计算每个指标的最大值,用于雷达图的max值
217
+                const indicators = [
218
+                    { name: '查获能力', max: Math.max(...seriesData.map(d => d.value[0])) },
219
+                    { name: '在岗时长', max: Math.max(...seriesData.map(d => d.value[1])) },
220
+                    { name: '巡检合格率', max: Math.max(...seriesData.map(d => d.value[2])) },
221
+                    { name: '抽问抽答', max: Math.max(...seriesData.map(d => d.value[3])) },
222
+                    { name: '培训答题', max: Math.max(...seriesData.map(d => d.value[4])) }
223
+                ];
224
+
225
+                const option = {
226
+                    legend: {
227
+                        type: 'scroll',
228
+                        orient: 'horizontal',
229
+                        bottom: 10,
230
+                        textStyle: {
231
+                            fontSize: 12,
232
+                            color: '#666'
233
+                        },
234
+                        itemWidth: 12,
235
+                        itemHeight: 12,
236
+                        data: seriesData.map(item => item.name)
237
+                    },
238
+                    radar: {
239
+                        shape: 'circle',
240
+                        indicator: indicators,
241
+                        splitNumber: 4,
242
+                        center: ['50%', '45%'],
243
+                        radius: '55%',
244
+                        axisName: {
245
+                            color: '#666',
246
+                            fontSize: 12
247
+                        },
248
+                        splitLine: {
249
+                            lineStyle: {
250
+                                color: ['#E6E6E6', '#E6E6E6', '#E6E6E6', '#E6E6E6']
251
+                            }
252
+                        },
253
+                        splitArea: {
254
+                            show: true,
255
+                            areaStyle: {
256
+                                color: ['#F8F8F8', '#FFFFFF']
257
+                            }
258
+                        },
259
+                        axisLine: {
260
+                            lineStyle: {
261
+                                color: '#E6E6E6'
262
+                            }
263
+                        }
264
+                    },
265
+                    series: [
266
+                        {
267
+                            name: '能力对比',
268
+                            type: 'radar',
269
+                            data: seriesData.map((item, index) => ({
270
+                                value: item.value,
271
+                                name: item.name,
272
+                                areaStyle: {
273
+                                    color: this.getChartColor(index, 0.3)
274
+                                },
275
+                                lineStyle: {
276
+                                    color: this.getChartColor(index),
277
+                                    width: 2
278
+                                },
279
+                                itemStyle: {
280
+                                    color: this.getChartColor(index)
281
+                                }
282
+                            }))
283
+                        }
284
+                    ],
285
+                    // 添加点击事件
286
+                    tooltip: {
287
+                        show: false
288
+                    },
289
+
290
+                };
291
+
292
+                this.chart.setOption(option);
293
+
294
+
295
+
296
+                // 响应式调整
297
+                window.addEventListener('resize', () => {
298
+                    this.chart.resize();
299
+                });
300
+            }
301
+        },
302
+
303
+        // 获取图表颜色
304
+        getChartColor(index, opacity = 1) {
305
+            const colors = ['#8FA5EC', '#FF9F7F', '#6ECEB2', '#FFD700', '#BA55D3'];
306
+            const color = colors[index % colors.length];
307
+            if (opacity < 1) {
308
+                // 转换为RGBA格式
309
+                const r = parseInt(color.slice(1, 3), 16);
310
+                const g = parseInt(color.slice(3, 5), 16);
311
+                const b = parseInt(color.slice(5, 7), 16);
312
+                return `rgba(${r}, ${g}, ${b}, ${opacity})`;
313
+            }
314
+            return color;
315
+        },
316
+
317
+        // 处理雷达图点击事件
318
+        handleRadarChartClick(params) {
319
+            if (params.componentType === 'series' && params.seriesType === 'radar') {
320
+                const clickedData = params.data;
321
+                const seriesIndex = params.seriesIndex;
322
+                const dataIndex = params.dataIndex;
323
+
324
+                // 获取对应的数据项
325
+                const dataItem = this.homePageWholeData[dataIndex];
326
+
327
+                if (dataItem) {
328
+                    // 显示详细数据弹窗
329
+                    this.showRadarDataDetail(dataItem);
330
+                }
331
+            }
332
+        },
333
+
334
+        // 显示雷达图数据详情
335
+        showRadarDataDetail(dataItem) {
336
+            const labels = ['查获数量', '在岗时长', '巡检合格率', '抽问抽答', '培训答题'];
337
+            const values = [
338
+                dataItem.seizureCount || 0,
339
+                dataItem.workingHours || 0,
340
+                dataItem.checkPassRate || 0,
341
+                dataItem.answersAccuracy || 0,
342
+                dataItem.learningGrowthScore || 0
343
+            ];
344
+
345
+            let detailHtml = `<div style="font-size: 16px; font-weight: bold; margin-bottom: 12px; text-align: center;">${dataItem.name} - 详细数据</div>`;
346
+
347
+            labels.forEach((label, index) => {
348
+                detailHtml += `<div style="display: flex; justify-content: space-between; margin: 8px 0; padding: 4px 0; border-bottom: 1px solid #f0f0f0;">
349
+                    <span style="color: #666;">${label}:</span>
350
+                    <span style="font-weight: bold; color: #1890ff;">${values[index]}</span>
351
+                </div>`;
352
+            });
353
+
354
+            uni.showModal({
355
+                title: '详细数据',
356
+                content: detailHtml,
357
+                showCancel: false,
358
+                confirmText: '关闭',
359
+                confirmColor: '#1890ff'
360
+            });
361
+        },
362
+
363
+        // 处理整体报表链接点击
364
+        handleReportLinkClick() {
365
+            // 根据时间范围自动计算开始和结束时间
366
+            const { startDate, endDate } = this.calculateDateRange(this.timeRange);
367
+            
368
+            // 构建跳转参数
369
+            const params = {
370
+                startDate: startDate,
371
+                endDate: endDate,
372
+            };
373
+
374
+            // 过滤掉空值
375
+            const queryParams = Object.keys(params)
376
+                .filter(key => params[key] && params[key] !== '')
377
+                .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
378
+                .join('&');
379
+
380
+            // 构建跳转URL
381
+            const url = queryParams ? 
382
+                `/pages/statisticalReport/index?${queryParams}` : 
383
+                '/pages/statisticalReport/index';
384
+
385
+            uni.navigateTo({
386
+                url: url
387
+            });
388
+        },
389
+
390
+        // 根据时间范围计算开始和结束时间
391
+        calculateDateRange(timeRange) {
392
+            const today = new Date();
393
+            const yesterday = new Date(today);
394
+            yesterday.setDate(today.getDate() - 1);
395
+
396
+            let startDate = new Date(yesterday);
397
+            let endDate = new Date(yesterday);
398
+
399
+            switch (timeRange) {
400
+                case 'week':
401
+                    // 近一周:从7天前到昨天
402
+                    startDate.setDate(yesterday.getDate() - 6);
403
+                    break;
404
+                case 'month':
405
+                    // 近一月:从30天前到昨天
406
+                    startDate.setDate(yesterday.getDate() - 29);
407
+                    break;
408
+                case 'quarter':
409
+                    // 近三月:从90天前到昨天
410
+                    startDate.setDate(yesterday.getDate() - 89);
411
+                    break;
412
+                case 'halfYear':
413
+                    // 近半年:从180天前到昨天
414
+                    startDate.setDate(yesterday.getDate() - 179);
415
+                    break;
416
+                case 'year':
417
+                    // 近一年:从365天前到昨天
418
+                    startDate.setDate(yesterday.getDate() - 364);
419
+                    break;
420
+                case 'custom':
421
+                    // 自定义时间:使用用户选择的日期
422
+                    if (this.startDate && this.endDate) {
423
+                        startDate = new Date(this.startDate);
424
+                        endDate = new Date(this.endDate);
425
+                    }
426
+                    break;
427
+                default:
428
+                    // 默认近一年
429
+                    startDate.setDate(yesterday.getDate() - 364);
430
+            }
431
+
432
+            return {
433
+                startDate: this.formatDateForInput(startDate),
434
+                endDate: this.formatDateForInput(endDate)
435
+            };
436
+        },
437
+
438
+        // 格式化日期为输入框格式
439
+        formatDateForInput(date) {
440
+            const year = date.getFullYear();
441
+            const month = String(date.getMonth() + 1).padStart(2, '0');
442
+            const day = String(date.getDate()).padStart(2, '0');
443
+            return `${year}-${month}-${day}`;
444
+        }
445
+
446
+
447
+
448
+    }
449
+}
450
+</script>
451
+
452
+<style lang="scss" scoped>
453
+.total-detail-container {
454
+    background: #FFFFFF;
455
+    border-radius: 20rpx;
456
+    padding: 30rpx;
457
+    margin-bottom: 30rpx;
458
+    box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
459
+}
460
+
461
+.item-header {
462
+    display: flex;
463
+    justify-content: space-between;
464
+    align-items: flex-start;
465
+    margin-bottom: 25rpx;
466
+}
467
+
468
+.title-section {
469
+    display: flex;
470
+    align-items: center;
471
+    gap: 20rpx;
472
+}
473
+
474
+.item-title {
475
+    font-size: 32rpx;
476
+    font-weight: bold;
477
+    color: #333333;
478
+    margin-bottom: 0;
479
+}
480
+
481
+.item-link {
482
+    font-size: 26rpx;
483
+    color: #1890FF;
484
+    cursor: pointer;
485
+}
486
+
487
+.report-link {
488
+    margin-left: 0;
489
+}
490
+
491
+.chart-section {
492
+    margin-bottom: 30rpx;
493
+}
494
+
495
+.chart-container {
496
+    width: 100%;
497
+    height: 600rpx;
498
+    margin-bottom: 20rpx;
499
+}
500
+
501
+.radar-chart {
502
+    width: 100%;
503
+    height: 100%;
504
+}
505
+
506
+.chart-legend {
507
+    display: flex;
508
+    justify-content: center;
509
+    gap: 40rpx;
510
+}
511
+
512
+.legend-item {
513
+    display: flex;
514
+    align-items: center;
515
+    gap: 10rpx;
516
+}
517
+
518
+.legend-color {
519
+    width: 20rpx;
520
+    height: 20rpx;
521
+    border-radius: 4rpx;
522
+}
523
+
524
+.legend-text {
525
+    font-size: 24rpx;
526
+    color: #666;
527
+}
528
+
529
+.data-section {}
530
+
531
+.data-item {
532
+    background: #EFF2FE;
533
+    border-radius: 15rpx;
534
+    padding: 20rpx;
535
+    text-align: center;
536
+    display: flex;
537
+    flex-direction: column;
538
+    align-items: flex-start;
539
+    margin-bottom: 30rpx;
540
+}
541
+
542
+.data-content-section {
543
+    display: flex;
544
+}
545
+
546
+.data-content {
547
+    flex: 1;
548
+    display: flex;
549
+    flex-direction: column;
550
+    align-items: center;
551
+}
552
+
553
+.data-value {
554
+    font-size: 32rpx;
555
+    font-weight: bold;
556
+    color: #333333;
557
+    margin-bottom: 8rpx;
558
+}
559
+
560
+.data-label {
561
+    font-size: 24rpx;
562
+    color: #666;
563
+}
564
+
565
+.rank-section {
566
+    margin-top: 30rpx;
567
+}
568
+
569
+.rank-item {
570
+    display: flex;
571
+    align-items: center;
572
+    margin-bottom: 10rpx;
573
+
574
+
575
+
576
+}
577
+
578
+.rank-label {
579
+    width: 80rpx;
580
+    font-size: 26rpx;
581
+    color: #333;
582
+    font-weight: 500;
583
+}
584
+
585
+.rank-progress {
586
+    flex: 1;
587
+    margin: 0 20rpx;
588
+}
589
+
590
+.rank-info {
591
+    width: 100rpx;
592
+    text-align: right;
593
+    font-size: 26rpx;
594
+    color: #666;
595
+}
596
+</style>

+ 515 - 0
src/pages/home-new/components/type-detail.vue

@@ -0,0 +1,515 @@
1
+<template>
2
+    <div class="type-detail-container">
3
+        <div v-for="(item, index) in dataList" :key="index" class="type-item">
4
+            <!-- 标题和链接区域 -->
5
+            <div class="item-header">
6
+                <div class="item-title">{{ item.title }}</div>
7
+                <div class="item-link" @click="handleLinkClick(item.link)">{{ item.linkText }}</div>
8
+            </div>
9
+
10
+            <!-- 主要内容区域 -->
11
+            <div class="item-content">
12
+                <!-- 数量统计区域 -->
13
+                <div class="stat-section">
14
+                    <div class="stat-header">
15
+                        <div class="stat-title">{{ item.statTitle }}</div>
16
+                        <div class="stat-trend" v-if="!role.includes('test') && !role.includes('zhijianke')">
17
+                            绿色为高于平均值,红色为低于平均值
18
+                        </div>
19
+                    </div>
20
+
21
+
22
+                    <div class="data-grid">
23
+                        <div v-for="(dataItem, dataIndex) in item.dataItems" :key="dataIndex" class="data-item">
24
+
25
+                            <div class="data-value">
26
+                                <image v-if="dataItem.isImage" :src="dataItem.value" class="data-image" />
27
+                                <span v-else :style="{ color: dataItem.color || '#333333' }">{{ dataItem.value }}</span>
28
+                            </div>
29
+                            <div class="data-label">{{ dataItem.label }}</div>
30
+
31
+                            <div v-if="dataIndex == item.dividerIndex" class="divider"></div>
32
+                        </div>
33
+                    </div>
34
+                </div>
35
+
36
+                <!-- 巡检部分的问题整改区域 -->
37
+                <div v-if="item.title === '巡检'" class="problem-rect-section">
38
+                    <div class="problem-title">问题整改</div>
39
+                    <div class="problem-grid">
40
+                        <!-- 左边:已办结问题 -->
41
+                        <div class="problem-item left-item">
42
+
43
+                            <div class="problem-value">{{ item.completed }}</div>
44
+                            <div class="problem-label">{{ '已办结' }}</div>
45
+                        </div>
46
+                        <!-- 右边:待办结问题 -->
47
+                        <div class="problem-item right-item">
48
+                            <div class="problem-value">{{ item.pending }}</div>
49
+                            <div class="problem-label">{{ '办理中' }}</div>
50
+                        </div>
51
+                    </div>
52
+                </div>
53
+
54
+                <!-- 排名区域 -->
55
+                <div class="rank-section" v-if="item.rankList.length > 0">
56
+                    <div v-for="(rank, i) in item.rankList" :key="i" class="rank-item">
57
+                        <div class="rank-label">{{ rank.label }}</div>
58
+                        <div class="rank-progress">
59
+                            <h-rank-line :percentage="Number(rank.percentage)" endType="round" :height="10"
60
+                                :color="rank.type == 'station' ? ['#F9CA91', '#ED9E3E'] : ['#87BFFC', '#5580F7']">
61
+                                <div class="rank-info"><span
62
+                                        :style="{ color: rank.type == 'station' ? '#ED9E3E' : '#5580F7' }">{{
63
+                                            rank.current
64
+                                        }}</span>/{{ rank.total }}</div>
65
+                            </h-rank-line>
66
+                        </div>
67
+                    </div>
68
+                </div>
69
+
70
+                <!-- test角色特殊显示:主管合格率排行和班组合格率排行 -->
71
+                <div class="rank-section" v-if="role && (role.includes('test') || role.includes('zhijianke'))">
72
+                    <!-- 大队合格率排行 -->
73
+                    <div class="rank-title">{{ item.title === '查获上报' ? '大队查获总数排名' : item.title == '抽问抽答' ? '大队正确率排名' :
74
+                        '大队合格率排名' }}
75
+                    </div>
76
+                    <div v-for="(dept, i) in (item.brigadeRank || [])" :key="'dept-' + i" class="rank-item">
77
+                        <div class="rank-label">{{ dept.name }}</div>
78
+                        <div class="rank-progress">
79
+                            <h-rank-line
80
+                                :percentage="item.title !== '查获上报' ? Number(dept.passRate || 0) : getPercentage(dept.passRate, item.departmentRank)"
81
+                                endType="round" :height="10" :color="['#F9CA91', '#ED9E3E']">
82
+                                <div class="rank-info"><span style="color: #999999">{{ dept.passRate || 0 }}</span>
83
+                                </div>
84
+                            </h-rank-line>
85
+                        </div>
86
+                    </div>
87
+                    <!-- 主管合格率排行 -->
88
+                    <div class="rank-header">
89
+                        <div class="rank-title">{{ item.title === '查获上报' ? '主管查获总数排名' : item.title == '抽问抽答' ? '主管正确率排名'
90
+                            :
91
+                            '主管合格率排名' }}</div>
92
+                        <div class="sort-buttons">
93
+                            <div :class="['sort-btn', { 'active': item.deptSortType === 'asc' }]"
94
+                                @click="$emit('sort-change', item.title, 'dept', 'asc')">正序</div>
95
+                            <div :class="['sort-btn', { 'active': item.deptSortType === 'desc' }]"
96
+                                @click="$emit('sort-change', item.title, 'dept', 'desc')">倒序</div>
97
+                        </div>
98
+                    </div>
99
+
100
+                    <!-- 主管排名显示 -->
101
+                    <template v-if="item.deptSortType === 'asc'">
102
+                        <div v-for="(dept, i) in (item.departmentRank || []).slice(0, 5)" :key="'dept-asc-' + i"
103
+                            class="rank-item">
104
+                            <div class="rank-label">{{ dept.name }}</div>
105
+                            <div class="rank-progress">
106
+                                <h-rank-line
107
+                                    :percentage="item.title !== '查获上报' ? Number(dept.passRate || 0) : getPercentage(dept.passRate, item.departmentRank)"
108
+                                    endType="round" :height="10" :color="['#F9CA91', '#ED9E3E']">
109
+                                    <div class="rank-info"><span style="color: #999999">{{ dept.passRate || 0 }}</span>
110
+                                    </div>
111
+                                </h-rank-line>
112
+                            </div>
113
+                        </div>
114
+                    </template>
115
+                    <template v-else>
116
+                        <div v-for="(dept, i) in (item.bottomDepartmentRank || []).slice(0, 5)" :key="'dept-desc-' + i"
117
+                            class="rank-item">
118
+                            <div class="rank-label">{{ dept.name }}</div>
119
+                            <div class="rank-progress">
120
+                                <h-rank-line
121
+                                    :percentage="item.title !== '查获上报' ? Number(dept.passRate || 0) : getPercentage(dept.passRate, item.bottomDepartmentRank)"
122
+                                    endType="round" :height="10" :color="['#F9CA91', '#ED9E3E']">
123
+                                    <div class="rank-info"><span style="color: #999999">{{ dept.passRate || 0 }}</span>
124
+                                    </div>
125
+                                </h-rank-line>
126
+                            </div>
127
+                        </div>
128
+                    </template>
129
+
130
+                    <!-- 班组合格率排行 -->
131
+                    <div class="rank-header">
132
+                        <div class="rank-title">{{ item.title ===
133
+                            '查获上报' ? '班组查获总数排名' : item.title == '抽问抽答' ? '班组正确率排名' : '班组合格率排名' }}</div>
134
+                        <div class="sort-buttons">
135
+                            <div :class="['sort-btn', { 'active': item.teamSortType === 'asc' }]"
136
+                                @click="$emit('sort-change', item.title, 'team', 'asc')">正序</div>
137
+                            <div :class="['sort-btn', { 'active': item.teamSortType === 'desc' }]"
138
+                                @click="$emit('sort-change', item.title, 'team', 'desc')">倒序</div>
139
+                        </div>
140
+                    </div>
141
+
142
+                    <!-- 班组排名显示 -->
143
+                    <template v-if="item.teamSortType === 'asc'">
144
+                        <div v-for="(team, i) in (item.teamRank || []).slice(0, 5)" :key="'team-asc-' + i"
145
+                            class="rank-item">
146
+                            <div class="rank-label">{{ team.name }}</div>
147
+                            <div class="rank-progress">
148
+                                <h-rank-line
149
+                                    :percentage="item.title !== '查获上报' ? Number(team.passRate || 0) : getPercentage(team.passRate, item.teamRank)"
150
+                                    endType="round" :height="10" :color="['#87BFFC', '#5580F7']">
151
+                                    <div class="rank-info"><span style="color: #999999">{{ team.passRate || 0 }}</span>
152
+                                    </div>
153
+                                </h-rank-line>
154
+                            </div>
155
+                        </div>
156
+                    </template>
157
+                    <template v-else>
158
+                        <div v-for="(team, i) in (item.bottomTeamRank || []).slice(0, 5)" :key="'team-desc-' + i"
159
+                            class="rank-item">
160
+                            <div class="rank-label">{{ team.name }}</div>
161
+                            <div class="rank-progress">
162
+                                <h-rank-line
163
+                                    :percentage="item.title !== '查获上报' ? Number(team.passRate || 0) : getPercentage(team.passRate, item.bottomTeamRank)"
164
+                                    endType="round" :height="10" :color="['#87BFFC', '#5580F7']">
165
+                                    <div class="rank-info"><span style="color: #999999">{{ team.passRate || 0 }}</span>
166
+                                    </div>
167
+                                </h-rank-line>
168
+                            </div>
169
+                        </div>
170
+                    </template>
171
+                </div>
172
+
173
+            </div>
174
+        </div>
175
+    </div>
176
+</template>
177
+
178
+<script>
179
+import HRankLine from "@/components/h-rank-line/h-rank-line.vue";
180
+
181
+export default {
182
+    name: 'TypeDetail',
183
+    components: {
184
+        HRankLine
185
+    },
186
+    props: {
187
+        dataList: {
188
+            type: Array,
189
+            default: () => []
190
+        }
191
+    },
192
+    emits: ['sort-change'],
193
+    computed: {
194
+        role() {
195
+            return this.$store?.state?.user?.roles
196
+        }
197
+    },
198
+    watch: {
199
+        dataList: {
200
+            handler(newValue, oldValue) {
201
+                console.log('dataList', newValue)
202
+            }
203
+        }
204
+    },
205
+    methods: {
206
+        handleLinkClick(link) {
207
+            if (link) {
208
+                // 检查是否是tabBar页面
209
+                const tabBarPages = [
210
+                    '/pages/home-new/index',
211
+                    '/pages/myToDoList/index',
212
+                    '/pages/work/index',
213
+                    '/pages/mine/index'
214
+                ];
215
+
216
+
217
+                if (tabBarPages.includes(link)) {
218
+                    uni.switchTab({
219
+                        url: link
220
+                    });
221
+                } else {
222
+                    uni.navigateTo({
223
+                        url: link
224
+                    });
225
+                }
226
+            }
227
+        },
228
+
229
+        // 计算百分比:使用数组中的最大值作为分母
230
+        getPercentage(value, array) {
231
+            if (!array || !Array.isArray(array) || array.length === 0) {
232
+                return 0;
233
+            }
234
+
235
+            // 找到数组中的最大值
236
+            const maxValue = Math.max(...array.map(item => Number(item.passRate) || 0));
237
+
238
+            // 如果最大值为0,则返回0避免除以0
239
+            if (maxValue === 0) {
240
+                return 0;
241
+            }
242
+
243
+            // 计算百分比
244
+            const percentage = (Number(value) || 0) / maxValue * 100;
245
+
246
+            // 确保百分比在0-100之间
247
+            return Math.min(Math.max(percentage, 0), 100);
248
+        },
249
+
250
+
251
+
252
+
253
+    }
254
+}
255
+</script>
256
+
257
+<style lang="scss" scoped>
258
+.type-detail-container {
259
+    margin-top: 30rpx;
260
+}
261
+
262
+.type-item {
263
+    background: #FFFFFF;
264
+    border-radius: 20rpx;
265
+    padding: 30rpx;
266
+    margin-bottom: 30rpx;
267
+    box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
268
+}
269
+
270
+.item-header {
271
+    display: flex;
272
+    justify-content: space-between;
273
+    align-items: center;
274
+    margin-bottom: 25rpx;
275
+}
276
+
277
+.item-title {
278
+    font-size: 32rpx;
279
+    font-weight: bold;
280
+    color: #333333;
281
+}
282
+
283
+.item-link {
284
+    font-size: 26rpx;
285
+    color: #1890FF;
286
+    cursor: pointer;
287
+}
288
+
289
+.item-content {
290
+    .stat-section {
291
+        background: #EFF2FE;
292
+        border-radius: 15rpx;
293
+        padding: 15rpx;
294
+    }
295
+
296
+    .stat-header {
297
+        display: flex;
298
+        justify-content: space-between;
299
+        align-items: center;
300
+        margin-bottom: 20rpx;
301
+    }
302
+
303
+    .stat-title {
304
+        font-size: 28rpx;
305
+        color: #3D3D3D;
306
+        font-weight: bold;
307
+        font-weight: 600;
308
+    }
309
+
310
+    .stat-trend {
311
+        font-size: 24rpx;
312
+        padding: 6rpx 12rpx;
313
+        border-radius: 8rpx;
314
+        color: #999999;
315
+    }
316
+
317
+    .trend-up {
318
+        color: #52C41A;
319
+        background: rgba(82, 196, 26, 0.1);
320
+    }
321
+
322
+    .trend-down {
323
+        color: #FF4D4F;
324
+        background: rgba(255, 77, 79, 0.1);
325
+    }
326
+
327
+    .data-grid {
328
+        display: flex;
329
+        justify-content: space-evenly;
330
+    }
331
+
332
+    .data-item {
333
+        display: flex;
334
+        flex: 1;
335
+        flex-direction: column;
336
+        align-items: center;
337
+        text-align: center;
338
+        position: relative;
339
+
340
+    }
341
+
342
+    .data-value {
343
+        font-size: 34rpx;
344
+        font-weight: bold;
345
+        color: #333333;
346
+        margin-bottom: 8rpx;
347
+        display: flex;
348
+        align-items: center;
349
+        justify-content: center;
350
+        min-height: 50rpx;
351
+    }
352
+
353
+    .data-image {
354
+        width: 40rpx;
355
+        height: 40rpx;
356
+        border-radius: 8rpx;
357
+    }
358
+
359
+    .data-label {
360
+        font-size: 24rpx;
361
+        color: #999999;
362
+    }
363
+
364
+    .divider {
365
+        position: absolute;
366
+        right: -4%;
367
+        top: 50%;
368
+        transform: translateY(-50%);
369
+        width: 1rpx;
370
+        height: 60%;
371
+        background: rgba(0, 0, 0, 0.1);
372
+    }
373
+
374
+    /* 问题整改区域样式 */
375
+    .problem-rect-section {
376
+        margin-top: 25rpx;
377
+    }
378
+
379
+    .problem-title {
380
+        font-size: 28rpx;
381
+        color: #3D3D3D;
382
+        font-weight: bold;
383
+        margin-bottom: 20rpx;
384
+    }
385
+
386
+    .problem-grid {
387
+        display: flex;
388
+        gap: 20rpx;
389
+    }
390
+
391
+    .problem-item {
392
+        flex: 1;
393
+        border-radius: 15rpx;
394
+        padding: 25rpx;
395
+        display: flex;
396
+        flex-direction: column;
397
+        align-items: flex-start;
398
+        text-align: center;
399
+    }
400
+
401
+    .left-item {
402
+        background: #EFFFF5;
403
+    }
404
+
405
+    .right-item {
406
+        background: #FFF6F6;
407
+    }
408
+
409
+    .problem-value {
410
+        font-size: 36rpx;
411
+        font-weight: bold;
412
+        margin-bottom: 8rpx;
413
+        min-height: 50rpx;
414
+        display: flex;
415
+        align-items: center;
416
+        justify-content: center;
417
+    }
418
+
419
+    .left-item .problem-value {
420
+        color: #00AE41;
421
+    }
422
+
423
+    .right-item .problem-value {
424
+        color: #F96060;
425
+    }
426
+
427
+    .problem-label {
428
+        font-size: 24rpx;
429
+        color: #999999;
430
+    }
431
+
432
+    /* 排名区域样式 */
433
+    .rank-section {
434
+        margin-top: 25rpx;
435
+    }
436
+
437
+    .rank-header {
438
+        display: flex;
439
+        justify-content: space-between;
440
+        align-items: center;
441
+        margin-bottom: 15rpx;
442
+        margin-top: 20rpx;
443
+    }
444
+
445
+    .rank-title {
446
+        font-size: 28rpx;
447
+        color: #3D3D3D;
448
+        font-weight: bold;
449
+    }
450
+
451
+    .sort-buttons {
452
+        display: flex;
453
+
454
+        div:nth-child(1) {
455
+
456
+            border-radius: 10rpx 0 0 10rpx;
457
+        }
458
+
459
+        div:nth-child(2) {
460
+
461
+            border-radius: 0 10rpx 10rpx 0;
462
+        }
463
+    }
464
+
465
+    .sort-btn {
466
+        padding: 4rpx 20rpx;
467
+        border: 2rpx solid #1890FF;
468
+
469
+        background: #FFFFFF;
470
+        color: #1890FF;
471
+        font-size: 24rpx;
472
+        cursor: pointer;
473
+        transition: all 0.3s ease;
474
+    }
475
+
476
+    .sort-btn.active {
477
+        background: #1890FF;
478
+        color: #FFFFFF;
479
+    }
480
+
481
+    // .sort-btn:not(.active):hover {
482
+    //     background: #F0F8FF;
483
+    // }
484
+
485
+    .rank-item {
486
+        display: flex;
487
+        align-items: center;
488
+        margin-bottom: 10rpx;
489
+    }
490
+
491
+    .rank-label {
492
+        width: 120rpx;
493
+        font-size: 26rpx;
494
+        color: #333;
495
+        font-weight: 500;
496
+    }
497
+
498
+    .rank-progress {
499
+        flex: 1;
500
+        margin: 0 20rpx;
501
+    }
502
+
503
+    .rank-info {
504
+        width: 100rpx;
505
+        text-align: right;
506
+        font-size: 26rpx;
507
+        color: #666;
508
+
509
+        span {
510
+            font-size: 29rpx;
511
+            font-weight: bold;
512
+        }
513
+    }
514
+}
515
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1529 - 0
src/pages/home-new/index.vue


+ 2 - 2
src/pages/login.vue

@@ -78,7 +78,7 @@ export default {
78 78
   onLoad() {
79 79
     //#ifdef H5
80 80
     if (getToken()) {
81
-      this.$tab.reLaunch('/pages/home/index')
81
+      this.$tab.reLaunch('/pages/home-new/index')
82 82
     }
83 83
     this.getStorage()
84 84
     //#endif
@@ -164,7 +164,7 @@ export default {
164 164
       this.$store.dispatch('GetInfo').then(res => {
165 165
         // 登录成功后调用showMessageTabRedDot更新消息tab红点状态
166 166
         showMessageTabRedDot()
167
-        this.$tab.reLaunch('/pages/home/index')
167
+        this.$tab.reLaunch('/pages/home-new/index')
168 168
       })
169 169
     }
170 170
   }

+ 1 - 1
src/pages/mine/setting/index.vue

@@ -50,7 +50,7 @@
50 50
       handleLogout() {
51 51
         this.$modal.confirm('确定注销并退出系统吗?').then(() => {
52 52
           this.$store.dispatch('LogOut').then(() => {}).finally(()=>{
53
-            this.$tab.reLaunch('/pages/home/index')
53
+            this.$tab.reLaunch('/pages/home-new/index')
54 54
           })
55 55
         })
56 56
       }

BIN
src/static/images/icon/bronze.png


BIN
src/static/images/icon/gold.png


BIN
src/static/images/icon/one.png


BIN
src/static/images/icon/orange-face.png


BIN
src/static/images/icon/red-face.png


BIN
src/static/images/icon/silver.png


BIN
src/static/images/icon/three.png


BIN
src/static/images/icon/two.png


BIN
src/static/images/icon/yellow-face.png