deepsea hai 11 meses
pai
achega
ad40ef240f
Modificáronse 2 ficheiros con 13 adicións e 72 borrados
  1. 1 58
      src/components/BenchDetail/index.vue
  2. 12 14
      src/views/ordinaryPage/index.vue

+ 1 - 58
src/components/BenchDetail/index.vue

@@ -155,64 +155,7 @@ export default {
       let benchId = this.bench.id;
       var strRemoteBenchList = window.localStorage.getItem('remoteBenchList');
       var objRBL = JSON.parse(strRemoteBenchList);
-      if (objRBL && objRBL.length>0) {
-        var bExist = false;
-        for(var i = 0; i< objRBL.length;i++)
-        {
-          if(objRBL[i] == benchId)
-          {
-            bExist = true;
-            if(objRBL.length == 1)
-            {
-              this.$router.push({
-                path: '/',
-                query:{
-                  m: '8b934420_ZJUb_b6f9',
-                  benchid: benchId
-                }
-              })
-              this.$store.dispatch('common/setSquareStatus', false)
-            }
-            else
-            {
-              this.$router.push({
-                path: '/',
-                query:{
-                  m: '8b934420_ZJUb_b6f9'
-                }
-              })
-              this.$store.dispatch('common/setSquareStatus', true)
-            }
-            
-          }
-        }
-        if(bExist == false)
-        {
-          objRBL.push(benchId);
-          window.localStorage.setItem('remoteBenchList',JSON.stringify(objRBL));
-          this.$router.push({
-            path: '/',
-            query:{
-              m: '8b934420_ZJUb_b6f9'
-            }
-          })
-          this.$store.dispatch('common/setSquareStatus', true)
-        }
-      }
-      else
-      {
-        var rml= [];
-        rml.push(benchId);
-        window.localStorage.setItem('remoteBenchList',JSON.stringify(rml));
-        this.$router.push({
-          path: '/',
-          query:{
-            m: '8b934420_ZJUb_b6f9',
-            benchid: benchId
-          }
-        })
-        this.$store.dispatch('common/setSquareStatus', false)
-      }
+      this.$emit('changeCurrentBench', benchId)
     },
     routerToBmt(){
       window.open("http://106.14.237.165/task/ticket/set?tab=1", "_blank");

+ 12 - 14
src/views/ordinaryPage/index.vue

@@ -4,12 +4,6 @@
       <SearchBarMain />
       <div class="vr-bg" id="vr-bg-container"></div>
       <div id="player" style="width: 100%; height: 100%"></div>
-      <bench-detail
-        :is-detail-visible="isDetailVisible"
-        :is-remote-btn-visible="isRemoteBtnVisible"
-        :closeDetail="closeDetail"
-        :bench="currentBench"
-      />
     </div>
     <div
       class="ordinary-container"
@@ -555,15 +549,15 @@
           ></TabList>
         </div>
       </div>
-
-      <bench-detail
-        :is-detail-visible="isDetailVisible"
-        :is-remote-btn-visible="isRemoteBtnVisible"
-        :closeDetail="closeDetail"
-        ref="benchdetail"
-        :bench="currentBench"
-      />
     </div>
+    <bench-detail
+      :is-detail-visible="isDetailVisible"
+      :is-remote-btn-visible="isRemoteBtnVisible"
+      :closeDetail="closeDetail"
+      ref="benchdetail"
+      :bench="currentBench"
+      @changeCurrentBench="changeCurrentBench"
+    />
   </div>
 </template>
 <script>
@@ -1040,6 +1034,10 @@ export default {
     }
   },
   methods: {
+    changeCurrentBench(benchId) {
+      this.$store.dispatch('common/set3dStatus', false);
+      this.selectBench(benchId);
+    },
     myInterval(callback, interval) {
       // 每设置一次定时器,num++ 代表系统中有num个自定义的定时器
       this.timerIdMap.num++;