소스 검색

店铺详情查看大图功能增加。

ouxq 8 년 전
부모
커밋
20830d2bc5
3개의 변경된 파일105개의 추가작업 그리고 111개의 파일을 삭제
  1. 85 0
      assets/scss/common.scss
  2. 0 54
      components/default/RightBar.vue
  3. 20 57
      components/store/BaseInfo.vue

+ 85 - 0
assets/scss/common.scss

@@ -356,4 +356,89 @@ div.el-tree-node__content{
   display: block;
 }
 
+/*查看大图*/
+#image-box .x-floating-wrap,.image-box .x-floating-wrap {
+  position: fixed;
+  z-index: 99998;
+  background: #000;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  opacity: 0.5;
+}
+#image-box,.image-box{
+  display:table; overflow:hidden; margin-left:50px; _position:relative;  width: 1200px;height: 700px;
+  position: fixed;
+  top: 50%;
+  margin-top: -350px;
+  left: 50%;
+  margin-left: -600px;
+  z-index: 2000;
+}
+#image-box .x-floating,.image-box .x-floating {
+  vertical-align:middle !important;
+  display:table-cell;
+  text-align:center;
+  _position:absolute;
+  _top:50%; _left:50%;
+  top: inherit !important;
+  left: inherit !important;
+}
+#image-box .x-floating img ,.image-box .x-floating img {
+  margin: auto auto;
+  max-width: 970px !important;
+  max-height: 600px !important;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+#image-box .x-floating-wrap,.image-box .x-floating-wrap{
+  z-index: 1000000 !important;
+}
+#item-content{
+  color:#fff; display:inline-block; _position:relative; _top:-50%; _left:-50%;
+  position: relative;
+  z-index: 10000000;
+}
+#item-content div.x-close-wrap{
+  position: absolute;
+  right: -15px;
+  line-height: 30px;
+  top: -13px;
+  color: #fff;
+  width: 35px;
+  height: 35px;
+  background: rgba(0, 0, 0, 0.5);
+  border-radius: 100%;
+  opacity: 1;
+  margin: 0;
+  z-index: 100000;
+  min-height: initial;
+  text-align: center;
+}
+#item-content div.x-close-wrap a{
+  position: relative;
+  left: 0;
+  bottom: 0;
+  font-size: 34px;
+  color: #fff;
+}
+#item-content div.x-close-wrap a:hover{
+  color: #fff !important;
+}
+#item-content div.x-close-wrap:hover{
+  cursor: pointer;
+  opacity: .9;
+}
+#item-content div.x-close-wrap img{
+  width: 30px !important;
+  height: 30px !important;
+}
+#item-content .img{
+  position: relative;
+  z-index: 10;
+}
+
 

+ 0 - 54
components/default/RightBar.vue

@@ -215,60 +215,6 @@
 </script>
 <style lang="scss" scoped>
   /*查看*/
-  #image-box .x-floating-wrap {
-    position: fixed;
-    z-index: 99998;
-    background: #000;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    opacity: 0.5;
-  }
-  #image-box .x-floating {
-    position: fixed;
-    z-index: 99999;
-    top: 60px;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    text-align: center;
-    vertical-align: middle;
-  }
-  #image-box .x-floating img {
-    margin: auto auto;
-    max-width: 100%;
-    max-height: 80%;
-    -webkit-user-select: none;
-    -moz-user-select: none;
-    -ms-user-select: none;
-    user-select: none
-  }
-
-  #image-box .x-close-wrap {
-    position: fixed;
-    top: 0;
-    right: 0;
-    z-index: 100000;
-    width: 120px;
-    height: 120px;
-    margin: -60px -60px 0 0;
-    border-radius: 100%;
-    background: #000;
-    opacity: .3
-  }
-
-  #image-box .x-close-wrap a {
-    position: absolute;
-    left: 25px;
-    bottom: 25px;
-    font-size: 42px;
-    color: #fff
-  }
-  #image-box .x-close-wrap:hover {
-    opacity: .7
-  }
-
   a[disabled] {
     cursor: not-allowed;
   }

+ 20 - 57
components/store/BaseInfo.vue

@@ -64,6 +64,17 @@
         </div>
       </div>
     </div>
+    <!--查看大图-->
+    <div id="image-box" v-if="isShow">
+      <div class="x-floating-wrap"></div>
+      <div class="x-floating">
+        <div id="item-content">
+          <div class="x-close-wrap" @click="isShow = false"><a href="javascript:void(0);">&times;</a></div>
+          <div class="img"><img :src="imgUrl"/></div>
+        </div>
+      </div>
+    </div>
+    <!--查看大图 end-->
   </div>
 </template>
 <script>
@@ -84,6 +95,12 @@ function isPdf (path) {
 
 export default {
   name: 'base-info',
+  data () {
+    return {
+      imgUrl: '',
+      isShow: false
+    }
+  },
   computed: {
     storeInfo () {
       return this.$store.state.shop.storeInfo.store.data
@@ -101,8 +118,9 @@ export default {
     }
   },
   methods: {
-    showImg (path) {
-      window.open(path)
+    showImg (imgUrl) {
+      this.imgUrl = imgUrl
+      this.isShow = true
     }
   }
 }
@@ -204,61 +222,6 @@ export default {
 	.hover-show:hover{
 		cursor: pointer;
 	}
-	/* 预览框 end */
-	#image-box .x-floating-wrap {
-		position: fixed;
-		z-index: 99998;
-		background: #000;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		opacity: 0.5;
-	}
-	#image-box .x-floating {
-		position: fixed;
-		z-index: 99999;
-		top: 60px;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		text-align: center;
-		vertical-align: middle;
-	}
-	#image-box .x-floating img {
-		margin: auto auto;
-		max-width: 100%;
-		max-height: 80%;
-		-webkit-user-select: none;
-		-moz-user-select: none;
-		-ms-user-select: none;
-		user-select: none
-	}
-
-	#image-box .x-close-wrap {
-		position: fixed;
-		top: 0;
-		right: 0;
-		z-index: 100000;
-		width: 120px;
-		height: 120px;
-		margin: -60px -60px 0 0;
-		border-radius: 100%;
-		background: #000;
-		opacity: .3
-	}
-
-	#image-box .x-close-wrap a {
-		position: absolute;
-		left: 25px;
-		bottom: 25px;
-		font-size: 42px;
-		color: #fff
-	}
-
-	#image-box .x-close-wrap:hover {
-		opacity: .7
-	}
 	.hover-shows a{
 		text-decoration: none;
 		color: #fff;