guoxiaohuan 4 years ago
parent
commit
6284b5feed

+ 21 - 9
src/components/Rotation/src/rotation.vue

@@ -19,6 +19,18 @@
         <!-- 不显示指示器 -->
         <!-- :indicator-position='rotationImg.length == 1 ? "none":""' -->
         <el-carousel
+            v-else-if='type!="5"'
+            style='height:100%;width:100%'
+            :interval='5000'
+            indicator-position='none'
+            :arrow='rotationImg.length == 1 ? "never":"always"'
+            @change='changePic'
+        >
+            <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
+                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit: container;' />
+            </el-carousel-item>
+        </el-carousel>
+        <el-carousel
             v-else
             style='height:100%;width:100%'
             :interval='5000'
@@ -27,7 +39,7 @@
             @change='changePic'
         >
             <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
-                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit: cover;' />
+                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit:inherit' />
             </el-carousel-item>
         </el-carousel>
     </div>
@@ -42,21 +54,21 @@ export default {
             fileList: [
                 {
                     name: 'food.jpeg',
-                    url: require('@/assets/imgs/2020.png')
+                    url: require('@/assets/imgs/2020.png'),
                 },
                 {
                     name: 'food2.jpeg',
-                    url: require('@/assets/imgs/20200.png')
+                    url: require('@/assets/imgs/20200.png'),
                 },
                 {
                     name: 'food.jpeg',
-                    url: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
+                    url: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
                 },
                 {
                     name: 'food2.jpeg',
-                    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
-                }
-            ]
+                    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+                },
+            ],
         }
     },
     methods: {
@@ -64,7 +76,7 @@ export default {
             if (this.type == 2) {
                 this.$emit('scan', val + 1)
             }
-        }
+        },
     },
     // 解决两张图片时,轮播顺序反向
     created() {
@@ -76,7 +88,7 @@ export default {
         if (this.type == 2) {
             this.changePic(1)
         }
-    }
+    },
 }
 </script>
 <style lang="less" scoped>

+ 11 - 14
src/views/overview/index.vue

@@ -82,7 +82,7 @@
                 <div class='view-right-box'>
                     <div class='lb-right'>
                         <div v-if='pic1.length>0' style='height:100%'>
-                            <rotation type='2' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
+                            <rotation type='5' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
                             <div class='lb-icon' @click='picClick("1")'></div>
                             <img class='lb-img' @click='picClick("1")' src='../../assets/imgs/zk.png' alt />
                         </div>
@@ -205,9 +205,7 @@
 import PicModal from './picModal'
 import { queryFact } from '@/api/overview'
 import { mapGetters } from 'vuex'
-import {
-    query
-} from "@/utils/query"
+import { query } from '@/utils/query'
 export default {
     data() {
         return {
@@ -346,7 +344,7 @@ export default {
             // }
         },
         query() {
-            let plazaId = this.$route.query.plazaId ?this.$route.query.plazaId:this.plazaId
+            let plazaId = this.$route.query.plazaId ? this.$route.query.plazaId : this.plazaId
             let params = {
                 getParams: {
                     plazaId: plazaId,
@@ -380,8 +378,8 @@ export default {
                     this.shuzihuayijiao = res.shuzihuayijiao ? res.shuzihuayijiao : ''
                     if (res.plazaName) {
                         this.$store.commit('SETPLAZENAME', res.plazaName)
-                    }else{
-                         this.$store.commit('SETPLAZENAME','')
+                    } else {
+                        this.$store.commit('SETPLAZENAME', '')
                     }
                 }
             })
@@ -425,14 +423,13 @@ export default {
     },
     watch: {
         '$store.state.plazaId': {
-          handler(val,nel){
-           console.log('val',val,nel)
-           this.query()
-          },
-          immediate:true
-        }
+            handler(val, nel) {
+                console.log('val', val, nel)
+                this.query()
+            },
+            immediate: true,
+        },
     },
-
 }
 </script>
 <style lang="less" scoped>

+ 4 - 4
src/views/overview/picModal.vue

@@ -20,7 +20,7 @@ export default {
             rotationImg: [],
             key: 1,
             sizePic: '',
-            imgInfo: {}
+            imgInfo: {},
         }
     },
     methods: {
@@ -32,7 +32,7 @@ export default {
                 let img = new Image()
                 img.src = this.rotationImg[0].url
                 const vm = this
-                img.onload = function() {
+                img.onload = function () {
                     vm.$set(vm.imgInfo, 'width', img.width)
                     vm.$set(vm.imgInfo, 'height', img.height)
                     if (vm.imgInfo.width > vm.imgInfo.height) {
@@ -46,8 +46,8 @@ export default {
         },
         close() {
             this.dialogVisible = false
-        }
-    }
+        },
+    },
 }
 </script>