Quellcode durchsuchen

美业资料搜索页面修改

yuwenjun1997 vor 2 Jahren
Ursprung
Commit
a5db37efb1
1 geänderte Dateien mit 15 neuen und 3 gelöschten Zeilen
  1. 15 3
      src/main/resources/static/js/document/beauty-archive.js

+ 15 - 3
src/main/resources/static/js/document/beauty-archive.js

@@ -7,6 +7,15 @@ $(window).on('resize', function () {
     window.location.reload();
 });
 
+function getUrlParam(name) {
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+    var r = decodeURIComponent(window.location.search).substr(1).match(reg);
+    if (r != null) {
+        return (r[2])
+    }
+    return null;
+}
+
 //美业资料库列表
 var beautyArchive = new Vue({
     el: '#beautyArchive',
@@ -46,9 +55,12 @@ var beautyArchive = new Vue({
             if (val) return;
             this.openSearch = false;
             this.listQuery.keyword = '';
-            this.getList();
+            // this.getList();
         }
     },
+    created(){
+        this.keyword = this.listQuery.keyword = getUrlParam('keyword') || ''
+    },
     mounted() {
         this.getList();
         this.initAuthInputComplete();
@@ -156,8 +168,8 @@ var beautyArchive = new Vue({
             this.listQuery.pageNum = 1;
             this.productList = [];
             this.openSearch = true;
-            this.getList();
-            console.log(this.listQuery.keyword);
+            // this.getList();
+            open('/document/beauty-archive.html?keyword=' + this.listQuery.keyword, '_self')
         },
         //跳转到商品详情
         handleToDetail: function (product) {