From 286b2444577f0e1e7a1d9840bb885e0c8f715b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Sun, 27 Nov 2022 00:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E3=80=81=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=88=B0=E4=B8=8D=E5=90=8Cdist=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=9B=E4=B8=80=E4=BA=9B=E5=B0=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++++++++++++++--------- miniprogram/config/index.js | 4 ++-- miniprogram/project.config.json | 4 ++-- miniprogram/src/pages/index/login.css | 1 + miniprogram/src/pages/residents/code.css | 2 +- miniprogram/src/pages/residents/code.vue | 6 ++++-- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3791adb..3f3e006 100644 --- a/README.md +++ b/README.md @@ -119,10 +119,10 @@ > # 您会看到以;分隔的很多路径,其中应该包括: > # JDK 所在文件夹下的 bin 目录:...\openjdk-11\bin > # Maven 所在文件夹下的 bin 目录:...\apache-maven-3.6.3\bin -> +> > echo %JAVA_HOME% > # 您会看到 JDK 所在文件夹 -> +> > echo %MAVEN_HOME% > # 您会看到 Maven 所在文件夹 > ``` @@ -134,19 +134,19 @@ > git --version > # 您应该看到类似如下输出👇 > # git version 2.35.1.windows.2 -> +> > # 查看 MySQL 版本(如果 MySQL 的 bin 目录没有配在环境变量中,则需要先 cd 切换到 bin 目录下) > mysql --version > # 您应该看到类似如下输出👇 > # mysql Ver 8.0.12 for Win64 on x86_64 (MySQL Community Server - GPL) -> +> > # 查看 JDK 版本 > java -version > # 您应该看到类似如下输出👇 > # openjdk version "11" 2018-09-25 > # OpenJDK Runtime Environment 18.9 (build 11+28) > # OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode) -> +> > # 查看 Maven 版本 > mvn -v > # 您应该看到类似如下输出👇 @@ -155,12 +155,12 @@ > # Java version: 11, vendor: Oracle Corporation, runtime: xxxxxx\openjdk-11 > # Default locale: zh_CN, platform encoding: GBK > # OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" -> +> > # 查看 node 版本 > node -v > # 您应该看到类似如下输出👇 > # v14.18.0 -> +> > # 查看 npm 版本 > # 您应该看到类似如下输出👇 > # 8.19.2 @@ -215,7 +215,7 @@ > npm config get registry > ``` > -> +> @@ -283,7 +283,7 @@ cd ../ ##### 配置业务域名 -修改 `miniprogram/src/app.js` 文件 +1.修改 `miniprogram/src/app.js` 文件 ```javascript App.use(setGlobalDataPlugin, { @@ -293,7 +293,13 @@ App.use(setGlobalDataPlugin, { }) ``` -同时记得在[微信小程序后台](https://mp.weixin.qq.com/)填写小程序的**服务器域名**→**request合法域名**(注意不是业务域名)。 +2.配置服务域名 + +- 小程序:在[微信小程序后台](https://mp.weixin.qq.com/) - 左侧最下方**开发** - **开发管理** - 右侧上方**开发设置** - **服务器域名** 添加 `https://` 开头的**request合法域名** +- 小程序测试号:在[微信小程序后台](https://mp.weixin.qq.com/) - **服务器域名** 添加 `https://` 开头的**request合法域名**(注意不是业务域名) +- 支付宝沙箱应用:在[支付宝开放平台](https://open.alipay.com/develop/sandbox/app) - 左侧**沙箱应用** - **服务端域名白名单** 添加 `https://` 开头的**httpRequest接口请求域名白名单** + + ##### 配置微信小程序appid diff --git a/miniprogram/config/index.js b/miniprogram/config/index.js index 4d0eed5..42d13bc 100644 --- a/miniprogram/config/index.js +++ b/miniprogram/config/index.js @@ -8,13 +8,13 @@ const config = { 828: 1.81 / 2 }, sourceRoot: 'src', - outputRoot: 'dist', + outputRoot: `dist/${process.env.TARO_ENV}`, plugins: [], defineConstants: { }, copy: { patterns: [ - { from: 'src/image/', to: 'dist/image/', ignore: ['*.js'] }, // 指定需要 copy 的目录 + { from: 'src/image/', to: `dist/${process.env.TARO_ENV}/image/`, ignore: ['*.js'] }, // 指定需要 copy 的目录 ], options: { } diff --git a/miniprogram/project.config.json b/miniprogram/project.config.json index 1a56a1a..f0652cb 100644 --- a/miniprogram/project.config.json +++ b/miniprogram/project.config.json @@ -1,5 +1,5 @@ { - "miniprogramRoot": "dist/", + "miniprogramRoot": "dist/weapp/", "projectname": "epp", "description": "基于微服务的社区疫情防控系统", "appid": "wxa70348746d2b562f", @@ -18,7 +18,7 @@ }, "compileType": "miniprogram", "libVersion": "2.27.1", - "srcMiniprogramRoot": "dist/", + "srcMiniprogramRoot": "dist/weapp/", "packOptions": { "ignore": [], "include": [] diff --git a/miniprogram/src/pages/index/login.css b/miniprogram/src/pages/index/login.css index 154455e..b7f3adf 100644 --- a/miniprogram/src/pages/index/login.css +++ b/miniprogram/src/pages/index/login.css @@ -16,6 +16,7 @@ } .inputText { + width: 95%; border-bottom: solid 1px; margin-bottom: 50px; } diff --git a/miniprogram/src/pages/residents/code.css b/miniprogram/src/pages/residents/code.css index 3185fc3..c8a6bf2 100644 --- a/miniprogram/src/pages/residents/code.css +++ b/miniprogram/src/pages/residents/code.css @@ -15,7 +15,7 @@ #myQrcode { display: block; - margin: 0 auto; + margin: 30px auto; } #show-text { diff --git a/miniprogram/src/pages/residents/code.vue b/miniprogram/src/pages/residents/code.vue index 6aced57..f8c7349 100644 --- a/miniprogram/src/pages/residents/code.vue +++ b/miniprogram/src/pages/residents/code.vue @@ -2,7 +2,7 @@ {{ userText }} {{ time }} - + {{ showText }} 下拉可刷新 @@ -40,6 +40,7 @@ export default { console.log('onHide') clearInterval(this.timeInterval); this.isShow = 'none' + this.time = '' }, onPullDownRefresh() { @@ -47,6 +48,7 @@ export default { Taro.showNavigationBarLoading(); clearInterval(this.timeInterval); this.isShow = 'none' + this.time = '' this.userInfo = Taro.getStorageSync("userInfo"); if (!this.userInfo) { Taro.redirectTo({ @@ -112,7 +114,7 @@ export default { canvas: canvas, canvasId: 'myQrcode', width: 260, - padding: 30, + padding: 0, background: '#ffffff', foreground: foreground, text: text,