Browse Source

处理构建版本ssr异常问题

martin.ma 4 years ago
parent
commit
fda84eadea

+ 6 - 6
pages/frontend/personal/component/dynamic-item.vue

@@ -12,7 +12,7 @@
         <p class="dynamic-content">
             {{ info.title }}
         </p>
-        <div class="dynamic-link"  @click.capture.stop="clickResource(dynamicResources)"  v-if="dynamicResources.resources_status == 1">
+        <div class="dynamic-link" @click.capture.stop="clickResource(dynamicResources)" v-if="dynamicResources.resources_status == 1">
             <div class="dynamic-link-content">
                 <p class="dynamic-link-title">
                     {{ dynamicResources.resources_title }}
@@ -23,7 +23,7 @@
                 <img :src="dynamicResources.resources_img" alt="" />
             </div>
         </div>
-        <div class="dynamic-images" v-if="dynamicImg.length > 0">
+        <div class="dynamic-images" v-if="dynamicImg.length > 0 && init">
             <div v-for="(item, index) in dynamicImg" :key="index" class="dynamic-image-item">
                 <el-image style="width:90px;height:90px" fit="cover" :src="item.img" :preview-src-list="dynamicImgBig">
                 </el-image>
@@ -45,7 +45,7 @@
 
 <script>
 export default {
-    props: ["info"],
+    props: ["info", 'init'],
     computed: {
         dynamicUserInfo() {
             return this.info.user_info || {};
@@ -69,10 +69,10 @@ export default {
             this.checkLogin(true);
             this.$message("请前往APP查看");
         },
-        clickResource(resources){
-            if(resources.resources_status != 1){
+        clickResource(resources) {
+            if (resources.resources_status != 1) {
                 this.$message.info(resources.resources_text)
-            }else{
+            } else {
                 location.href = resources.resources_url
             }
         },

+ 4 - 3
pages/frontend/personal/index.vue

@@ -68,7 +68,7 @@
             <div class="personal-content-main">
                 <template v-if="tabSelected == 1">
                     <div v-for="item in list" :key="item.dynamicId">
-                        <DynamicItem :info="item"></DynamicItem>
+                        <DynamicItem :info="item" :init='init'></DynamicItem>
                     </div>
                 </template>
 
@@ -180,7 +180,8 @@ export default {
             pageLoading: false,
 
             user: {},
-            personUid: ""
+            personUid: "",
+            init:0
         };
     },
     watch: {
@@ -266,7 +267,7 @@ export default {
         this.personUid = this.$route.params.uid;
         this.baseUrl = this.$store.state.domainConfig.siteUrl;
         this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1;
-
+        this.init = 1
         this.$nextTick(() => {
             this.listenToEnd();
         });