From f77dad86de37e5ab0df6a6ce43f21e1ab408d389 Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期六, 08 八月 2020 11:23:39 +0800 Subject: [PATCH] 调整布局 --- src/components/subComponents/CardItem.vue | 28 ++++++++++------------------ 1 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/components/subComponents/CardItem.vue b/src/components/subComponents/CardItem.vue index e6abb97..3c9791c 100644 --- a/src/components/subComponents/CardItem.vue +++ b/src/components/subComponents/CardItem.vue @@ -488,14 +488,8 @@ </template> <script> -import cardType from "../../mockData/cardType.ts"; -import bus from "@/main"; - export default { mounted() { - bus.$on('refreshCompareImg', () => { - // this.tempShowType = false - }) window.addEventListener("resize", this.watchWindow); }, props: { @@ -526,7 +520,6 @@ return { tempShowType: true, initialIndex: 0, - cardType, carouselIndex: 0, dialogVisible: false, overflowState: true @@ -554,9 +547,9 @@ }, getUrl(bwtype) { if (bwtype == 1) { - return `url(${require("@/assets/bg/red.png")})` + return `url(${require("@/assets/img/red.png")})` } else { - return `url(${require("@/assets/bg/green.png")})` + return `url(${require("@/assets/img/green.png")})` } }, changeInitialIndex(index) { @@ -579,19 +572,18 @@ this.$emit("addToBase", item); }, tosearch(item) { - var curWwwPath = window.document.location.href; - var pathname = window.document.location.pathname; - var pos = curWwwPath.indexOf(pathname); - var localhostPath = curWwwPath.substring(0, pos); //ip+port - var href = localhostPath + "/Layout/Searching" let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id - var url = item.targetInfo ? item.targetInfo[0].picSmUrl : item.baseInfo[0].targetPicUrl - console.log("璺宠浆鍦板潃", href, "url", url) - var compType = 1 // 鏁版嵁鏉ヨ嚜浜巈s + let imgUrl = item.targetInfo ? item.targetInfo[0].picSmUrl : item.baseInfo[0].targetPicUrl + let compType = 1 // 鏁版嵁鏉ヨ嚜浜巈s if (!item.id || item.id == "") { compType = 0 // 鏁版嵁鏉ヨ嚜浜庡簳搴� } - window.open(href + '?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + url + '&compType=' + compType) + // window.open(href + '?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + url + '&compType=' + compType) + + let message = 'toSearch?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + imgUrl + '&compType=' + compType; + window.parent.postMessage({ + msg: message + }, "*") } } }; -- Gitblit v1.8.0