From eea22bacc783a770f28a8b7fd0d7e22c196bda97 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 17 Nov 2021 17:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=BA=93=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/serve.js | 15 ++++++++---- package.json | 7 +++--- .../AppInterview/AppInterview.vue | 4 ++-- src/{pages => apps}/AppInterview/detail.vue | 0 src/pages/loading.vue | 23 +++++++++++++++---- src/store/index.js | 23 +------------------ 6 files changed, 37 insertions(+), 35 deletions(-) rename src/{pages => apps}/AppInterview/AppInterview.vue (99%) rename src/{pages => apps}/AppInterview/detail.vue (100%) diff --git a/bin/serve.js b/bin/serve.js index fbfa7d52..687b9f02 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -58,15 +58,22 @@ const start = () => { easycom: { "^u-(.*)": "@/uview/components/u-$1/u-$1.vue" }, - pages: [], + pages: [ + {path: 'pages/loading'}, + {path: 'pages/login'} + ], globalStyle: { pageOrientation: "auto", navigationStyle: "custom" } } - findApp('src/pages', file => { - if (/.*\\(.+)\.vue/g.test(file)) { - json.pages.push({path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g,'/')}) + findApp('src/apps', file => { + if (/.*\\.+\\App[^\\]+\.vue/g.test(file)) { + let app = { + name: file.replace(/.*\\([^\\]+).vue/g, '$1'), + path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/') + } + json.pages.push(app) } }).then(() => { fsExtra.outputJson('src/pages.json', json, () => { diff --git a/package.json b/package.json index 0d34bd50..0c4646af 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,12 @@ "author": "Kubbo", "scripts": { "dev": "node bin/serve.js&&cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --minimize", - "lib": "npm unpublish --force&&npm publish" + "lib": "npm unpublish --force&&npm publish", + "pages": "node bin/serve.js" }, "files": [ "src/components", - "src/pages", - "src/pages.json" + "src/apps" ], "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", @@ -64,6 +64,7 @@ "node-sass": "npm:dart-sass@^1.25.0", "postcss-comment": "^2.0.0", "sass-loader": "^7.1.0", + "uview-ui": "^2.0.3", "vue-template-compiler": "^2.6.11" }, "browserslist": [ diff --git a/src/pages/AppInterview/AppInterview.vue b/src/apps/AppInterview/AppInterview.vue similarity index 99% rename from src/pages/AppInterview/AppInterview.vue rename to src/apps/AppInterview/AppInterview.vue index d549c725..8f38285d 100644 --- a/src/pages/AppInterview/AppInterview.vue +++ b/src/apps/AppInterview/AppInterview.vue @@ -45,14 +45,14 @@ import AiFixedBtn from "../../components/AiFixedBtn"; export default { name: "AppInterview", - label: "调查走访", + appName: "调查走访", components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect}, data() { return { search: {title: ""}, list: [], current: 1, - pages: 0 + pages: 0, } }, computed: { diff --git a/src/pages/AppInterview/detail.vue b/src/apps/AppInterview/detail.vue similarity index 100% rename from src/pages/AppInterview/detail.vue rename to src/apps/AppInterview/detail.vue diff --git a/src/pages/loading.vue b/src/pages/loading.vue index 7e9ad3fc..4a5f2eab 100644 --- a/src/pages/loading.vue +++ b/src/pages/loading.vue @@ -10,7 +10,7 @@ {{ app.name }} - +0