孙永军 před 2 roky
rodič
revize
5910628098
5 změnil soubory, kde provedl 64 přidání a 32 odebrání
  1. 1 1
      package.json
  2. 54 20
      page.config.js
  3. 8 5
      saveOSSAGitte.js
  4. 0 6
      src/config/page.json
  5. 1 0
      vue.config.js

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve --mode dev",
-    "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build --mode pro & node ./saveOSSAGitte.js",
+    "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build --mode pro",
     "gitPush": "node ./saveOSSAGitte.js"
   },
   "dependencies": {

+ 54 - 20
page.config.js

@@ -38,27 +38,61 @@ class pageConfig {
       const isVue = fs.existsSync(nameVue);
       const isJs = fs.existsSync(nameJs);
       if (isVue && isJs) continue;
-
+      const conf = pageJSON[v]['conf'] ? JSON.stringify(pageJSON[v]['conf']) : ''
       const templateVue = `
-        <template>
-            <div class="${v}"></div>
-        </template>
-        <script setup>
-            // import { onMounted, reactive } from "vue";
-            // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
-            /**
-             * window.$originData.orginParames.title 页面标题
-             * window.$originData.orginParames.parameters 固定参数值
-             * window.$originData.urlParames url参数
-             */
-            console.log(window.$originData)
-        </script>
-        <style>
-            .${v} {
-                width: 100vw;
-                height: 100vh;
-            }
-        </style>
+<template>
+  <van-swipe class="my-swipe" indicator-color="white">
+    <template v-for="(item, index) in page.hoversList" :key="index">
+      <van-swipe-item>
+        <div class="pageItem" :style="{background: item.background_url}">
+          <component
+            v-for="(v, i) in item.components"
+            :key="'son' + index + i"
+            :is="components[v.type]"
+            :item="v"
+          ></component>
+        </div>
+      </van-swipe-item>
+    </template>
+  </van-swipe>
+</template>
+<script setup>
+// import { onMounted, reactive } from "vue";
+import { ref } from 'vue';
+// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
+
+import localImage from '../../components/image.vue';
+import localParagraph from '../../components/paragraph.vue';
+import localFromComponent from '../../components/fromComponent.vue';
+/**
+ * window.$originData.orginParames.title 页面标题
+ * window.$originData.orginParames.parameters 固定参数值
+ * window.$originData.urlParames url参数
+ */
+console.log(window.$originData);
+const page = ref(${conf});
+const components = {
+  image: localImage,
+  paragraph: localParagraph,
+  fromComponent: localFromComponent,
+};
+
+  document.title = page.value.title;
+
+</script>
+<style>
+.page {
+  width: 100vw;
+  height: 100vh;
+}
+.pageItem{
+  width: 100vw;
+  height: 100vh;
+  overflow-y: auto;
+}
+
+</style>
+
         `;
       const templateJS = `
         import App from './index.vue'

+ 8 - 5
saveOSSAGitte.js

@@ -8,7 +8,7 @@ const { execSync } = require("child_process");
 class saveOssGitte {
   constructor() {
     this.localDir = "dist/";
-    this.baseOssDir = "topic/activity/";
+    this.baseOssDir = "operate/products/";
     this.client = new oss({
       region: "oss-cn-chengdu",
       // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
@@ -58,9 +58,11 @@ class saveOssGitte {
     );
     console.log("oss文件清除---完成");
     try {
+      console.log(path.resolve(__dirname, "./" + this.localDir))
       await this.getFiles(path.resolve(__dirname, "./" + this.localDir));
       console.log("数据上传oss---完成");
     } catch (err) {
+      console.log(err)
       console.log("数据上传oss---失败");
     }
   }
@@ -72,10 +74,11 @@ class saveOssGitte {
     const dirList = fs.readdirSync(pathDir) || [];
     for (let i = 0; i < dirList.length; i++) {
       const P = [pathDir, dirList[i]];
-      const stat = fs.lstatSync(P.join("\\"));
+      const stat = fs.lstatSync(P.join("/"));
       if (!stat.isDirectory()) {
+        console.log(P)
         await this.upFileOSS(P);
-      } else this.getFiles(P.join("\\"));
+      } else this.getFiles(P.join("/"));
     }
   }
 
@@ -87,12 +90,12 @@ class saveOssGitte {
     try {
       // 填写OSS文件完整路径和本地文件的完整路径。OSS文件完整路径中不能包含Bucket名称。
       // 如果本地文件的完整路径中未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
-      let dir = filePath[0].split("\\");
+      let dir = filePath[0].split("/");
       dir = dir.reverse()[0] + "/";
       if (dir === this.localDir) dir = "";
       await this.client.put(
         this.baseOssDir + dir + filePath[1],
-        path.normalize(filePath.join("\\"))
+        path.normalize(filePath.join("/"))
         // 自定义headers
         //,{headers}
       );

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 6
src/config/page.json


+ 1 - 0
vue.config.js

@@ -4,6 +4,7 @@ const ComponentsPlugin = require("unplugin-vue-components/webpack");
 const page = require("./page.config");
 module.exports = {
   pages: page.output,
+  publicPath: './',
   configureWebpack: {
     plugins: [
       ComponentsPlugin({

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů