Browse Source

提交移动端新手指导

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

+ 42 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -3,7 +3,7 @@
         <van-swipe class="my-swipe" :autoplay="3000" :height="200" indicator-color="white">
             <van-swipe-item v-for="(item, index) in images" :key="index" class="swipe-img">
                 <img :src="item"/>
-            </van-swipe-item>
+            </van-swipe-item> 
         </van-swipe>
         <van-grid :column-num="3">
             <van-grid-item v-for="(item,index) in routers" :key="index" :icon="item.icon" :text="item.name" 
@@ -25,6 +25,9 @@
 </template>
 <script>
     import Footer from "@/components/Footer";
+    import Vue from "vue";
+    import { ImagePreview } from "vant";
+    Vue.use(ImagePreview);
     export default {
         data() {
             return {
@@ -86,11 +89,47 @@
                     that.getAccountInfo(that.user.id);
                 }
             }
+            let userss = JSON.parse(localStorage.userInfo)
+            if(userss.isMobFirstLogin == 1 && userss.createTime[0] > '2022' && userss.roleName == '超级管理员') {
+                // 第一次登陆显示
+                this.previewPicture()
+            }
         },
         components: {
             Footer
         },
         methods: {
+            // 图片预览
+            previewPicture() {
+                let that = this
+                let arr = [
+                    'https://mobworktime.ttkuaiban.com/upload/b9cf863819924106a65255ccffae446d.png',
+                    'https://mobworktime.ttkuaiban.com/upload/65afcaed7ad84c51a309db69c888fe6c.png',
+                    'https://mobworktime.ttkuaiban.com/upload/3452d33a68bb4092b04147e5482fd0e9.png',
+                    'https://mobworktime.ttkuaiban.com/upload/af5b430f48b24b2683fb48a43deab98c.png'
+                ]
+                ImagePreview({
+                    images: arr,
+                    startPosition: 0,
+                    showIndicators: true,
+                    closeable: true,
+                    onClose() {
+                        that.previewPictureClose()
+                    },
+                });
+            },
+            // 处理关闭事件
+            previewPictureClose() {
+                this.$axios.post("/user/mobSkipGuidance", {
+                })
+                .then(res => {
+                    if(res.code == "ok") {
+                       let userss = JSON.parse(localStorage.userInfo)
+                       userss.isMobFirstLogin = 0
+                       localStorage.userInfo = JSON.stringify(userss);
+                    } 
+                }).catch(err=> {this.$toast.clear();});
+            },
             tokefu(){
                 wx.invoke('openThirdAppServiceChat', {
                     }, function(res) {
@@ -358,7 +397,8 @@
         },
         activated(){
             this.getMessage()
-        }
+        },
+        
     };
 </script>