From 8b8b52c18be211eed4dddf37b0ca6c182c10ede1 Mon Sep 17 00:00:00 2001 From: HardenSG <2767525216@qq.com> Date: Sat, 2 Mar 2024 22:29:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=88=A4=E5=88=AB=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- scripts/uploadDist/upload.js | 20 ++++++++++++++++++++ src/app.config.ts | 2 +- src/pages/Index/index.config.ts | 4 ++++ src/pages/Index/index.scss | 5 +++++ src/pages/Index/index.tsx | 2 +- 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2430184..f5e8ee5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build weapp ci on: # 监听PUSH和PR push: - branches: [ main ] + branches: [ main, pre ] pull_request: branches: [ main ] diff --git a/scripts/uploadDist/upload.js b/scripts/uploadDist/upload.js index 5e3df6e..4599ba3 100644 --- a/scripts/uploadDist/upload.js +++ b/scripts/uploadDist/upload.js @@ -1,11 +1,27 @@ const path = require('path') const ci = require('miniprogram-ci') +const { execSync } = require('child_process') const cwd = process.cwd() const { version } = require(path.resolve(cwd + '/package.json')) const now = new Date().toLocaleDateString(); +const ROBOT_MAP = { + 'pre': 2, + 'main': 3 +} + +const getCurrentBranch = () => execSync('git branch --show-current').toString().trim() +const getTargetRobotId = () => ROBOT_MAP[getCurrentBranch()] + const upload = async () => { + const robot = getTargetRobotId() + console.log('当前分支:' + getCurrentBranch() + ' 机器人编号为:' + robot); + if (!robot) { + console.log('您当前不在能够上传产物的白名单分支,请切换到指定分支并重新构建产物'); + return + } + const project = new ci.Project({ appid: 'wx6836fb3c447f8868', type: 'miniProgram', @@ -19,9 +35,13 @@ const upload = async () => { desc: now + ' 提交版本 v: ' + version, setting: { es6: true, + minify: true, + autoPrefixWXSS: true }, + robot, onProgressUpdate: console.log, }) console.log(uploadResult) } upload() + diff --git a/src/app.config.ts b/src/app.config.ts index 64e711b..4760a6d 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -19,7 +19,7 @@ export default defineAppConfig({ navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black', - enablePullDownRefresh: true, + enablePullDownRefresh: false, }, // 自定义TabBar使用 tabBar: { diff --git a/src/pages/Index/index.config.ts b/src/pages/Index/index.config.ts index feb4f0f..b85944d 100644 --- a/src/pages/Index/index.config.ts +++ b/src/pages/Index/index.config.ts @@ -1,3 +1,7 @@ export default definePageConfig({ navigationBarTitleText: '当我在追光~', + enablePullDownRefresh: true, + navigationStyle: 'custom', + enableShareAppMessage: true, + enableShareTimeline: true }) diff --git a/src/pages/Index/index.scss b/src/pages/Index/index.scss index e69de29..48fea8a 100644 --- a/src/pages/Index/index.scss +++ b/src/pages/Index/index.scss @@ -0,0 +1,5 @@ +.index_wrapper { + width: 750rpx; + height: 100vh; + background-color: #fff; +} \ No newline at end of file diff --git a/src/pages/Index/index.tsx b/src/pages/Index/index.tsx index c888e61..c349e26 100644 --- a/src/pages/Index/index.tsx +++ b/src/pages/Index/index.tsx @@ -10,7 +10,7 @@ const Index = () => { const state = useSelector((state1: RootState) => state1.common) return ( - + Hello world1212121!-- {state.age}