tremble 5 years ago
parent
commit
8c31f1ff62

+ 2 - 0
sh_museum/src/components/slide/index.vue

@@ -189,8 +189,10 @@ export default {
   .swiper-container {
     .pagenav {
       position: fixed;
+      z-index: 888;
       top: 45%;
       img {
+        z-index: 888;
         width: 50%;
       }
     }

+ 3 - 5
sh_museum/src/pages/list/index.vue

@@ -8,9 +8,6 @@
           <p>部件赏析</p>
         </div>
         <div class="l-type">
-
-
-
           <div class="louti">
             <span class="txt-bold" id="label-louti" @click="loutiVisible = !loutiVisible">楼体 <svg viewBox='0 0 140 140' width='12' height='12' xmlns='http://www.w3.org/2000/svg'><g><path d='m121.3,34.6c-1.6-1.6-4.2-1.6-5.8,0l-51,51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8,0-1.6,1.6-1.6,4.2 0,5.8l53.9,53.9c0.8,0.8 1.8,1.2 2.9,1.2 1,0 2.1-0.4 2.9-1.2l53.9-53.9c1.7-1.6 1.7-4.2 0.1-5.8z' fill='black'/></g></svg></span>
             <div class="select-box" id="select-louti" v-if="loutiVisible">
@@ -252,13 +249,14 @@ export default {
     };
   },
   methods: {
-    handleItem(){
+    handleItem(item){
       this.$router.push({
         name:'Parts',
         query:{
           block: this.l_active,
           typeId: this.t_active,
-          zone: this.a_active
+          zone: this.a_active,
+          activeId:item.id
         }
       })
     },

+ 11 - 4
sh_museum/src/pages/parts/index.vue

@@ -17,7 +17,7 @@
               </template>
               <!-- <img class="full-btn" @click="full=true" :src="`${$cdn}images/full-btn.png`" alt=""> -->
             </div>
-            <slide v-if="list.length>0" @activeItem="handleItem" :list='list' :idx='list.length>3 ? 2 : 0' class="sld"/>
+            <slide v-if="list.length>0" @activeItem="handleItem" :list='list' :idx='activeIdx' class="sld"/>
           </div>
           <div class="p-txt" :style="{height:380+'px'}">
             <p>{{activeItem.name}}</p>
@@ -52,7 +52,7 @@
               </template>
               <img class="full-btn" @click="full=true" :src="`${$cdn}images/full-btn.png`" alt="">
             </div>
-            <slide v-if="list.length>0" @activeItem="handleItem" :list='list' :idx='list.length>3 ? 2 : 0' class="sld"/>
+            <slide v-if="list.length>0" @activeItem="handleItem" :list='list' :idx='activeIdx' class="sld"/>
           </div>
           <div class="p-txt" :style="{height:380+'px'}">
             <p>{{activeItem.name}}</p>
@@ -87,6 +87,7 @@ export default {
       full:false,
       list:[],
       activeItem:'',
+      activeIdx:'',
       isMobile: browser.mobile
     }
   },
@@ -108,7 +109,7 @@ export default {
       return arr
     },
     async getList(){
-      let {block,typeId,zone,searchKey=""} = this.$route.query
+      let {block,typeId,zone,searchKey="",activeId} = this.$route.query
       let res = await this.$http({
         method:'post',
         data:{
@@ -122,7 +123,13 @@ export default {
         url:`/api/web/part/list`
       })
       this.list = res.data.list
-      this.activeItem = this.list[this.list.length>3 ? 2 : 0]
+      this.list.forEach((item,i)=>{
+        if (item.id===activeId) {
+          this.activeIdx = i
+          this.activeItem = item
+        }
+      })
+      // this.activeItem = this.list[this.list.length>3 ? 2 : 0]
     },
   }
 }