Răsfoiți Sursa

检查登陆

panhui 3 ani în urmă
părinte
comite
886d443155

BIN
src/assets/kong-pimg-sosuo.png


+ 8 - 4
src/mixins/common.js

@@ -25,10 +25,14 @@ export default {
         updateUser(info, sucess = true) {
             if (info) {
                 return this.$http
-                    .post('/user/update', {
-                        ...this.$store.state.userInfo,
-                        ...info
-                    })
+                    .post(
+                        '/user/update',
+                        {
+                            ...this.$store.state.userInfo,
+                            ...info
+                        },
+                        { body: 'json' }
+                    )
                     .then(() => {
                         return this.$store.dispatch('getUserInfo');
                     })

+ 2 - 1
src/views/Exchange.vue

@@ -117,6 +117,7 @@ export default {
 
 .cell-title {
     .flex();
+    align-items: flex-end;
     span {
         &:first-child {
             font-size: 20px;
@@ -126,7 +127,7 @@ export default {
 
         &:nth-child(2) {
             font-size: 12px;
-            line-height: 24px;
+            line-height: 20px;
             margin-left: 2px;
         }
     }

+ 13 - 1
src/views/Home.vue

@@ -70,6 +70,12 @@
                 @load="getData"
             >
                 <room-info v-for="(item, index) in list" :key="index" :info="item"></room-info>
+
+                <van-empty
+                    v-if="empty"
+                    description="什么都没有哦,换个号码试试吧~"
+                    :image="require('@assets/kong-pimg-sosuo.png')"
+                />
             </van-list>
         </div>
     </van-pull-refresh>
@@ -204,8 +210,14 @@ export default {
         goCreate() {
             this.$router.push('/roomCreate');
         },
-        changeTab() {
+        changeTab(tab) {
+            console.log(tab);
             this.$nextTick(() => {
+                if (this.active === 1 && !this.isLogin) {
+                    this.active = 0;
+                    this.checkLogin();
+                    return;
+                }
                 this.$toast.loading({
                     message: '加载中...',
                     forbidClick: true

+ 23 - 19
src/views/Shop.vue

@@ -91,16 +91,18 @@ export default {
         //         console.log(e);
         //         this.$toast(e.error);
         //     });
-        if (this.$route.query.active) {
-            this.active = Number(this.$route.query.active);
-            if (this.active == 2) {
-                this.listKey = 'content';
-            } else {
-                this.listKey = '';
+        this.checkLogin().then(() => {
+            if (this.$route.query.active) {
+                this.active = Number(this.$route.query.active);
+                if (this.active == 2) {
+                    this.listKey = 'content';
+                } else {
+                    this.listKey = '';
+                }
             }
-        }
-        this.$nextTick(() => {
-            this.getData(true);
+            this.$nextTick(() => {
+                this.getData(true);
+            });
         });
     },
     methods: {
@@ -120,18 +122,20 @@ export default {
             this.chooseTicket = type;
         },
         changeTab() {
-            this.clear();
-            this.$router.replace({
-                query: {
-                    active: this.active
+            this.checkLogin().then(() => {
+                this.clear();
+                this.$router.replace({
+                    query: {
+                        active: this.active
+                    }
+                });
+                if (this.active == 2) {
+                    this.listKey = 'content';
+                } else {
+                    this.listKey = '';
                 }
+                this.getData(true);
             });
-            if (this.active == 2) {
-                this.listKey = 'content';
-            } else {
-                this.listKey = '';
-            }
-            this.getData(true);
         },
         clear() {
             this.chooseTicket = '';

+ 1 - 1
src/views/account/Setting.vue

@@ -20,7 +20,7 @@
                 is-link
                 :value="userInfo.nickname"
             />
-            <van-cell title="实名认证" @click="goAuth" is-link :value="authStatus" />
+            <!-- <van-cell title="实名认证" @click="goAuth" is-link :value="authStatus" /> -->
             <van-cell class="not" title="用户ID" :value="userInfo.id" @click="showConsoleEve" />
             <van-cell class="not" v-if="showConsole" title="审核版本" is-link @click="goReview" />
             <van-cell class="not" v-if="showConsole" title="测试app" is-link @click="goTest" />

+ 67 - 3
src/views/user/Report.vue

@@ -1,20 +1,84 @@
 <template>
-    <div></div>
+    <div class="page">
+        <div class="report" v-for="(item, index) in list" :key="index">
+            <div class="user">
+                <van-image :src="item.avatar" width="34" height="34" radius="4" fit="cover" />
+                <div class="user-info">
+                    <div class="text1">{{ item.name }}</div>
+                    <div class="text2">{{ item.createdAt }}</div>
+                </div>
+            </div>
+            <div class="text">{{ item.content }}</div>
+        </div>
+    </div>
 </template>
 
 <script>
 export default {
     data() {
         return {
-            reportId: 0
+            reportId: 0,
+            list: []
         };
     },
     mounted() {
         if (this.$route.query.reportId) {
             this.reportId = this.$route.query.reportId;
         }
+        this.getList();
+    },
+    methods: {
+        getList() {
+            this.$http
+                .post(
+                    '/reportMessage/all',
+                    {
+                        query: {
+                            reportId: this.reportId
+                        }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    this.list = res.content;
+                });
+        }
     }
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.page {
+    padding: 16px;
+}
+.report {
+    background-color: @bg2;
+    padding: 10px 12px;
+    border-radius: 8px;
+    .user {
+        .flex();
+        .user-info {
+            margin-left: 8px;
+            .text1 {
+                font-size: 14px;
+                color: #ffffff;
+                line-height: 20px;
+            }
+            .text2 {
+                font-size: 12px;
+                color: #6a6d83;
+                line-height: 17px;
+            }
+        }
+    }
+    .text {
+        font-size: 14px;
+        color: #ffffff;
+        line-height: 20px;
+        margin-top: 10px;
+    }
+}
+.report + .report {
+    margin-top: 16px;
+}
+</style>