Prechádzať zdrojové kódy

Merge branch 'master' of http://face3d.4dage.com:7005/chenzhiguang/guangdongVR_museum into master

shaogen1995 2 rokov pred
rodič
commit
a20895a2ef

+ 12 - 0
code/src/config/api.js

@@ -11,6 +11,18 @@ export function getMuseumList(data, cb) {
     data: params,
     url: `show/museum/list`,
   }).then((res) => {
+    if (res && res.data && res.data.records) {
+      // 按首字母排序
+      res.data.records.sort((item1, item2) => {
+        if (item1.initial < item2.initial) {
+          return -1
+        } else if (item1.initial === item2.initial) {
+          return 0
+        } else {
+          return 1
+        }
+      })
+    }
     cb(res);
   });
 }

+ 16 - 37
code/src/utils/fns/ClickOutSide.js

@@ -1,41 +1,20 @@
-let nodeList = {}
-
-function createDocumentHandler(el, binding) {
-    return function (e) {
-        const target = e.target
-        if (el.contains(target)) {
-            return false
-        }
-        // if (binding.arg) {
-            binding.value(e)
-        // }
-    }
-}
-
-const handler = e => {
-
-    const { documentHandler } = nodeList
-    if (documentHandler) {
-        documentHandler(e)
-    }
-}
-
-window.addEventListener('click', handler)
-
 const ClickOutSide = {
-    beforeMount(el, binding) {
-        nodeList = {
-            documentHandler: createDocumentHandler(el, binding),
-        }
-    },
-    updated(el, binding) {
-        nodeList = {
-            documentHandler: createDocumentHandler(el, binding),
-        }
-    },
-    unmounted() {
-        window.removeEventListener('click', handler)
-    },
+  beforeMount(el, binding) {
+    function documentHandler(e) {
+      if (el.contains(e.target)) {
+        return false
+      }
+      binding.value(e)
+    }
+    el.__vueClickOutside__ = documentHandler
+    document.addEventListener('click', documentHandler)
+  },
+  updated(el, binding) {
+  },
+  unmounted(el) {
+    document.removeEventListener('click', el.__vueClickOutside__)
+    delete el.__vueClickOutside__
+  },
 }
 
 export default ClickOutSide

+ 1 - 0
code/src/views/collection/index.vue

@@ -22,6 +22,7 @@
           </ui-select>
 
           <ui-search v-model="searchKey" :placeholder="'请输入展览名称11'"></ui-search>
+
         </div>
 
         <div class="sright">

+ 2 - 1
code/src/views/collection/mobile.vue

@@ -286,13 +286,14 @@ export default {
         text-align: center;
         margin: 0 6px;
         cursor: pointer;
+        white-space: nowrap;
 
         &.active {
-          width: 80px;
           height: 30px;
           color: var(--main-color);
           line-height: 30px;
           border-radius: 60px;
+          padding: 0 8px;
           border: 1px solid var(--main-color);
         }
       }

+ 2 - 3
code/src/views/exhibition/exhibition/mobile/collections.vue

@@ -229,15 +229,14 @@ export default {
         text-align: center;
         margin: 0 6px;
         cursor: pointer;
+        white-space: nowrap;
 
         &.active {
-          max-width: 80px;
-          min-width: 62px;
           height: 30px;
           color: var(--main-color);
           line-height: 30px;
           border-radius: 60px;
-          padding: 0 10px;
+          padding: 0 8px;
           border: 1px solid var(--main-color);
         }
       }

+ 2 - 0
code/src/views/exhibition/exhibition/mobile/permanent.vue

@@ -114,6 +114,8 @@ onMounted(() => {
         label: item.name,
         value: item.id
       }
+    }).filter(item => {
+      return item.name !== '广东省博物馆'
     })
     if (!props.currentMuseumItem) {
       currentMuseum.value = museumList.value[0].value

+ 2 - 4
code/src/views/gdmuseum/exhibition/mobile/collections.vue

@@ -221,15 +221,13 @@ export default {
         text-align: center;
         margin: 0 6px;
         cursor: pointer;
-
+        white-space: nowrap;
         &.active {
-          max-width: 80px;
-          min-width: 62px;
           height: 30px;
           color: var(--main-color);
           line-height: 30px;
           border-radius: 60px;
-          padding: 0 10px;
+          padding: 0 8px;
           border: 1px solid var(--main-color);
         }
       }