Browse Source

提交首页加PDF

Lijy 2 years ago
parent
commit
0b5e072df6
1 changed files with 29 additions and 1 deletions
  1. 29 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

+ 29 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -8,7 +8,7 @@
         <van-grid :column-num="3">
             <van-grid-item v-for="(item,index) in routers" :key="index" :icon="item.icon" :text="item.name" 
             :info="(item.name=='消息记录'&&unreadNum>0)?unreadNum:''"
-            :to="item.url">
+            :to="item.url" @click="pfdClick(item)">
             </van-grid-item>
         </van-grid>
         <!-- <div class="tip"  v-if="isCorpWX">
@@ -99,6 +99,24 @@
             Footer
         },
         methods: {
+            pfdClick(item) {
+                if(item.name == '使用说明') {
+                    let url = 'http://celiang.oss-cn-hangzhou.aliyuncs.com/measurement/2022-01/18/75it6phpocqYFV1642488558220118.pdf'
+                    let name = '使用说明书'
+                    // 将要传过去的值
+                    this.previewPDF(url, name)
+                }
+            },
+            // 预览pdf
+            previewPDF(url, name) {
+                this.$router.push({
+                    path:  '/pdf',
+                    query: {
+                        url: '',
+                        name: name
+                    }
+                })
+            },
             // 图片预览
             previewPicture() {
                 let that = this
@@ -218,6 +236,16 @@
                                     icon: 'todo-list-o',
                                     info: this.unreadNum
                                 });
+                
+                // 针对超级管理员加使用说明
+                if(this.user.roleName == '超级管理员') {
+                    this.routers.push(
+                    {
+                        name: '使用说明',
+                        // url: '/',
+                        icon: 'todo-list-o'
+                    });
+                }
             },
 
             // 获取企业微信参数