Переглянути джерело

fix: 修复轮播链接修改异常问题
1. 轮播图在使用直接链接时无法修改显示文字

kindring 1 рік тому
батько
коміт
bc06125699
3 змінених файлів з 46 додано та 3 видалено
  1. 5 0
      README.md
  2. 37 3
      nuxt.config.js
  3. 4 0
      server/control/c_base.js

+ 5 - 0
README.md

@@ -35,6 +35,11 @@ yarn build
 ```shell
 pm2 start npm --name "hfy" -- run start
 ```
+5. 管理项目
+```shell
+pm2 list
+```
+
 
 ## 注意事项
 1. 服务器`php`版本为`5.3`,请不要使用`php7`以上的版本

+ 37 - 3
nuxt.config.js

@@ -1,7 +1,10 @@
 import * as path from "path";
 import axios from "axios";
-import {handleAll} from "./until/handle";
+import {handleAll, handle} from "./until/handle";
 import {apiMap} from "./map/apiMap";
+import d_news from "./server/database/d_news";
+import d_product from "./server/database/d_product";
+
 const devPort = 3000;
 const serverPort = 4201;
 
@@ -15,6 +18,37 @@ const env = {
       ENV_API: `http://szhfy.com.cn:${serverPort}`  // 正式服务器地址
     }
 }
+
+async function loadProductTypes(baseUrl){
+  let productTypes = [];
+  let [err, res] = await handle(d_product.loadTypes())
+  if(err){
+    console.log(err);
+  }
+  // typekey
+  res.forEach(item=>{
+    productTypes.push(`${baseUrl}/${item.typeKey}`)
+  });
+  return productTypes;
+}
+async function loadNewsTypes(solutionUrl, newsUrl){
+  let pages = [];
+  let [err, res] = await handle(d_news.loadTypes())
+  if(err){
+    console.log(err);
+  }
+  // typekey
+  res.forEach(item=>{
+    if(item.parent_type == 1){
+      pages.push(`${solutionUrl}/${item.typeKey}`)
+    }else{
+      pages.push(`${newsUrl}/${item.typeKey}`)
+    }
+  });
+  return pages;
+}
+
+
 function loadSvgConfig(config, ctx) {
   // 排除 nuxt 原配置的影响,Nuxt 默认有vue-loader,会处理svg,img等
   // 找到匹配.svg的规则,然后将存放svg文件的目录排除
@@ -142,8 +176,8 @@ export default {
     head: {
         title: '深圳市合方圆科技',
         meta: [
-            { charset: 'utf-8' },
-            { name: 'viewport', content: 'width=device-width, initial-scale=1' },
+          { charset: 'utf-8' },
+          { name: 'viewport', content: 'width=device-width, initial-scale=1' },
           { hid: 'keywords', name: 'keywords',  content: '合方圆,深圳合方圆,深圳合方圆科技,合方圆科技,4G低功耗'},
           { hid: 'description', name: 'description', content: '网站描述' },
         ],

+ 4 - 0
server/control/c_base.js

@@ -144,6 +144,10 @@ async function updateCarousel(id,updateItems){
       }
       updateData.valueShowText = res[0].title;
     }
+    else {
+      updateData.valueShowText = updateItems.value;
+    }
+
 
     updateData.value = updateItems.value;
   }