Ver código fonte

冷战嵌入营业时间页面

guotianliang 4 anos atrás
pai
commit
5034fb70f8
1 arquivos alterados com 23 adições e 3 exclusões
  1. 23 3
      src/views/doBusiness/index.vue

+ 23 - 3
src/views/doBusiness/index.vue

@@ -1,7 +1,7 @@
 
 <template>
     <div class='business'>
-        <Head :headText='headText'></Head>
+        <Head :headText='headText' v-if="headShow"></Head>
         <!-- <div class="count-top-right">
       <month-temp @pickerVal="pickerVal"></month-temp>
         </div>-->
@@ -45,7 +45,8 @@ export default {
             headText: '营业时间调整',
             content: [],
             date: timestamp2String(+new Date()),
-            value: new Date()
+            value: new Date(),
+            headShow:true,
         }
     },
     components: {
@@ -154,7 +155,26 @@ export default {
         }
     },
     mounted() {
-        this.getHours()
+         if(this.$store.state.formLz&&!this.$store.state.toiframe){
+            //告诉父页面以及加载完成
+            this.$store.commit("setToFromLz",true)
+            window.parent.postMessage( {msg: 'iframeSuccess'}, '*');
+            //监听父页面传递过来的项目列表
+            const that = this;
+            window.addEventListener("message",(event)=>{
+                that.headShow=false;
+                if(event.data.hasOwnProperty('query') ){
+                    that.$store.commit("setProjects",{ projects:event.data.query.projectList })
+                    that.$store.commit("setProId",event.data.query.projectList[0].id)
+                    this.getHours()
+                    console.log('获取到列表了',event.data.query.projectList,event.data.query.projectList[0].id);
+                }
+                setTimeout(()=>{that.headShow=true},300)
+            })
+        }else{
+            this.getHours()
+        }
+
     }
 }
 </script>