ソースを参照

fix: 搜索列表双击多次请求问题

cuiyalong 4 年 前
コミット
db15e6ebd3

+ 9 - 36
README.md

@@ -40,11 +40,6 @@ PC端 /opt/nginx/nginx/html/page_docs/
 │       ├── _mixin.scss
 │       └── _variables.scss
 ├── components
-│   ├── CardItem.vue        # 卡片型文件缩略展示
-│   ├── HelloWorld.vue
-│   ├── List.vue            # 列表展示
-│   ├── ListItem.vue        # 列表型文件缩略展示
-│   └── Search.vue          # 顶部搜索框
 ├── main.js
 ├── router.js
 ├── set-public-path.js
@@ -52,8 +47,6 @@ PC端 /opt/nginx/nginx/html/page_docs/
     ├── 404.vue
     ├── Content.vue         # 内容页
     ├── Home.vue            # 首页
-    ├── Keep.vue            # 收藏
-    ├── Mine.vue            # 我的
     └── Search.vue          # 搜索结果列表页
 
 ```
@@ -75,46 +68,26 @@ PC端 /opt/nginx/nginx/html/page_docs/
 3. 访问`/swordfish/frontPage/docs/sess/index`
 
 ##### 部署
-```
-# 剑鱼文库 前端配置
-location ^~/page_docs_app {
-    if ($uri ~ \.html$) {
-		add_header         Pragma   no-cache;
-        add_header         Expires  0;
-        add_header         Cache-Control no-cache,no-store,must-revalidate;
-    }
-    root /opt/nginx/nginx/html/;
-    index index.html;
-    try_files $uri $uri/ /page_docs_app/index.html;
-}
 
-location ^~/page_docs {
-    if ($uri ~ \.html$) {
-		add_header         Pragma   no-cache;
-        add_header         Expires  0;
-        add_header         Cache-Control no-cache,no-store,must-revalidate;
-    }
-    root /opt/nginx/nginx/html/;
-    index index.html;
-    try_files $uri $uri/ /page_docs/index.html;
-}
-```
+###### 剑鱼文库 前端配置
 
-```
+```nginx
+# 如果nginx配置文件中有这段代码,则 不需要 再次配置
 # 静态资源配置
 # 1. 禁止html缓存
-location ~ ^\/(.*).html {
+location ~ ^\/page_(.*)\.html {
     add_header         Pragma   no-cache;
     add_header         Expires  0;
     add_header         Cache-Control no-cache,no-store,must-revalidate;
-    
+
     root html;
+    # root /opt/nginx/nginx/html/;
 }
-# 2. 静态资源配置(vue程序刷新404问题)
+
+# 2.静态资源配置(vue程序刷新404问题)
 location ~ ^\/page_(.*?)\/ {
     root html;
     index index.html;
     try_files $uri $uri/ /page_$1/index.html;
 }
-```
-
+```

+ 1 - 1
jydocs-mobile/public/index.html

@@ -32,7 +32,7 @@
 <div id="app"></div>
 <!-- built files will be auto injected -->
 <% if (process.env.NODE_ENV === 'production') { %>
-  <script src="/page_partner/js/commonForVue.js?v=<%= htmlWebpackPlugin.options.version %>"></script>
+  <script src="/page_entniche/js/commonForVue.js?v=<%= htmlWebpackPlugin.options.version %>"></script>
 <% } else if (process.env.NODE_ENV === 'development') { %>
   <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
 <% } %>

+ 6 - 0
jydocs-mobile/src/views/Search.vue

@@ -255,6 +255,12 @@ export default class extends Vue {
 
   async getList () {
     if (!this.listState.value) return
+    if (this.listState.pageNum === 1) {
+      this.$toast.loading({
+        forbidClick: true,
+        duration: 0
+      })
+    }
     const query = {
       keyWord: this.listState.value,
       tag: this.docsTypeConf.active === '全部' ? '' : this.docsTypeConf.active,

+ 1 - 1
jydocs-mobile/src/views/purchase/purchasesuccess.vue

@@ -64,7 +64,7 @@ export default class extends Vue {
     this.query = location.href.split('/')[location.href.split('/').length - 1] // 获取num
     this.setCountDown()
     this.setSession()
-    this.clearLibState('clearLib') // 清除我的文库列表缓存数据
+    this.clearLibState() // 清除我的文库列表缓存数据
   }
 
   setSession () {

+ 1 - 1
jydocs-pc/src/views/Search.vue

@@ -19,7 +19,7 @@
           v-for="(item, index) in listState.list"
           :key="index"
           :title="item.docName"
-          :desc="item.docSummary"
+          :desc="item.docSummary + '...'"
           :docType="item.docFileType"
           :price="item.price"
           :highlightKey="highlightKey"