StephenArk30 6 år sedan
förälder
incheckning
3237007a02

+ 2 - 3
sourcecode/h5app/vue/src/components/schoolCard.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="card" style="margin-bottom: 20px">
+    <div class="card" style="margin-bottom: 0">
         <van-row style="border-bottom: solid 1px #e4e4e4;">
             <van-col span="14">
                 <h3><strong>校卡审核</strong></h3>
@@ -23,7 +23,6 @@
             <img :src="schoolpic" style="max-width: 100%"/>
         </div>
 
-
     </div>
 </template>
 
@@ -256,7 +255,7 @@
     }
     .card {
         background-color: white;
-        margin: 20px 20px;
+        margin: 0 20px;
         border: solid 1px #e4e4e4;
         padding: 15px;
         text-align: left;

+ 23 - 1
sourcecode/h5app/vue/src/views/me.vue

@@ -1,11 +1,15 @@
 <template>
     <div>
-        <div style="margin-bottom: 80px">
+        <div style="margin-bottom: 20px">
             <schoolid-card
             />
             <school-card
             />
         </div>
+        <van-button type="danger" @click="logout" size="large"
+                    style="margin: 0 10px 90px 10px; width: 90%"
+        >退出登录
+        </van-button>
         <add-present-button :can_add="button_active"/>
     </div>
 </template>
@@ -15,6 +19,7 @@
     import SchoolidCard from "../components/schoolidCard";
     import SchoolCard from "../components/schoolCard";
     import {BasicFunction} from "../connector/basic-service";
+    import {Button, Toast, Dialog} from 'vant'
 
     export default {
         name: "me",
@@ -22,6 +27,7 @@
             SchoolCard,
             SchoolidCard,
             AddPresentButton,
+            [Button.name]: Button
         },
         data() {
             return {
@@ -29,6 +35,22 @@
                 photoURL: ''
             }
         },
+        methods: {
+            logout() {
+                Dialog.confirm({
+                    title: '退出登录吗',
+                    message: '退出登录后,请在公众号回复“1”重新获取链接登录哦'
+                }).then(() => {
+                    Toast.loading({
+                        mask: true,
+                        message: '加载中...',
+                        duration: 1000
+                    });
+                    localStorage.removeItem('frontend-userid');
+                    this.$router.push('warning');
+                }).catch();
+            }
+        },
         created: function () {
             if (!localStorage.getItem('frontend-userid')) {
                 this.$router.push('login');