From d677c293e8af476828d3c1b92a5560ff4a256639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 3 Nov 2025 13:48:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增产线监控页面(line.vue)及相关组件 - 优化扫码页面(easycode.vue)的UI布局和样式 - 调整pages.json中的页面顺序和导航栏配置 - 启用并配置tabBar功能 --- apps/hand-factory/App.vue | 7 ++ apps/hand-factory/pages.json | 86 +++++++------ apps/hand-factory/pages/easycode/easycode.vue | 118 +++++++++++++++--- apps/hand-factory/pages/line/line.vue | 99 +++++++++++++++ 4 files changed, 254 insertions(+), 56 deletions(-) create mode 100644 apps/hand-factory/pages/line/line.vue diff --git a/apps/hand-factory/App.vue b/apps/hand-factory/App.vue index a75bf5d..4972546 100644 --- a/apps/hand-factory/App.vue +++ b/apps/hand-factory/App.vue @@ -17,7 +17,14 @@ //#ifdef H5 this.checkLogin() //#endif + // uni.hideTabBar() }, + // mounted() { + // uni.hideTabBar() + // }, + // onShow() { + // uni.hideTabBar() + // }, initConfig() { this.globalData.config = config }, diff --git a/apps/hand-factory/pages.json b/apps/hand-factory/pages.json index 1572e23..2ce3554 100644 --- a/apps/hand-factory/pages.json +++ b/apps/hand-factory/pages.json @@ -1,19 +1,5 @@ { "pages": [ - { - "path" : "pages/easycode/easycode", - "style" : - { - "navigationBarTitleText" : "扫码", - "navigationStyle": "custom" - } - }, - { - "path": "pages/login", - "style": { - "navigationBarTitleText": "登录" - } - }, { "path": "pages/index", "style": { @@ -21,7 +7,21 @@ "navigationStyle": "custom" } }, + { + "path" : "pages/easycode/easycode", + "style" : + { + "navigationBarTitleText" : "扫码", + "navigationStyle": "default" + } + }, + { + "path": "pages/login", + "style": { + "navigationBarTitleText": "登录" + } + }, { "path": "pages/mine/index", "style": { @@ -40,6 +40,13 @@ { "navigationBarTitleText" : "扫码" } + }, + { + "path" : "pages/line/line", + "style" : + { + "navigationBarTitleText" : "产线监控" + } } // { // "path": "pages/register", @@ -99,28 +106,35 @@ "navigationBarTitleText": "RuoYi", "navigationBarBackgroundColor": "#FFFFFF" }, - // "tabBar": { - // "list": [ - // { - // "text": "产线", - // "pagePath": "pages/index", - // "selectedIconPath": "/static/images/tabbar/home_.png", - // "iconPath": "/static/images/tabbar/home.png" - // }, - // { - // "text": "扫码", - // "pagePath": "pages/code/code", - // "selectedIconPath": "/static/images/tabbar/work_.png", - // "iconPath": "/static/images/tabbar/work.png" - // }, - // { - // "text": "我的", - // "pagePath": "pages/mine/index", - // "selectedIconPath": "/static/images/tabbar/mine_.png", - // "iconPath": "/static/images/tabbar/mine.png" - // } - // ] - // }, + "tabBar": { + "list": [ + { + "text": "产线", + "pagePath": "pages/index", + "selectedIconPath": "/static/images/tabbar/home_.png", + "iconPath": "/static/images/tabbar/home.png" + }, + { + "text": "扫码", + "pagePath": "pages/code/code", + "selectedIconPath": "/static/images/tabbar/work_.png", + "iconPath": "/static/images/tabbar/work.png" + }, + { + "text": "我的", + "pagePath": "pages/mine/index", + "selectedIconPath": "/static/images/tabbar/mine_.png", + "iconPath": "/static/images/tabbar/mine.png" + }, + { + "text": "扫码2", + "pagePath": "pages/easycode/easycode", + "selectedIconPath": "/static/images/tabbar/work_.png", + "iconPath": "/static/images/tabbar/work.png" + } + + ] + }, "easycom": { "autoscan": true, "custom": { diff --git a/apps/hand-factory/pages/easycode/easycode.vue b/apps/hand-factory/pages/easycode/easycode.vue index d15d4c1..704bcc5 100644 --- a/apps/hand-factory/pages/easycode/easycode.vue +++ b/apps/hand-factory/pages/easycode/easycode.vue @@ -1,12 +1,26 @@ @@ -29,32 +43,96 @@ }) }, handleScan(type) { - // 1. 扫码 uni.scanCode({ success(res) { const result = res.result; - // 2. 解析二维码的content,获取enter_coil_no、current_coil_no和coil_id - const qrcodeRecord = qrcodeRes.data; - const content = JSON.parse(qrcodeRecord.content); - const enterCoilNo = content.enter_coil_no; - const currentCoilNo = content.current_coil_no; - const coilId = content.coil_id && content.coil_id !== 'null' ? content.coil_id : null; - - // 3. 调用创建待操作记录的API } }) } }, mounted() { - // 获取字典 getDicts('easycode_type').then(res => { - console.log(res) this.types = res.data }) } } - +/* 页面标题 */ +.page-title { + font-size: 32rpx; + font-weight: bold; + color: #333; + padding: 20rpx 0; + margin-bottom: 30rpx; + text-align: center; +} + +/* 按钮网格布局 */ +.btn-grid { + display: grid; + grid-template-columns: 200rpx 200rpx; /* 固定按钮宽度 */ + grid-template-rows: repeat(2, 1fr); + gap: 40rpx; /* 按钮间距 */ + margin-bottom: 60rpx; +} + +/* 操作类型按钮样式 */ +.type-btn { + width: 200rpx; + height: 150rpx; + line-height: 150rpx; /* 文字竖直居中 */ + font-size: 28rpx; + color: #333; + background-color: #fff; + border-radius: 12rpx; + border: none; + box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05); + transition: all 0.2s ease; +} + +.type-btn:active { + background-color: #f0f0f0; + box-shadow: 0 2rpx 5rpx rgba(0, 0, 0, 0.1); + transform: scale(0.98); +} + +/* 退出登录按钮容器 */ +.logout-container { + width: 100%; + position: fixed; + bottom: 30rpx; + left: 0; + padding: 0 20rpx; + box-sizing: border-box; +} + +/* 退出登录按钮样式 */ +.logout-btn { + width: 100%; + height: 90rpx; + line-height: 90rpx; /* 文字竖直居中 */ + font-size: 30rpx; + color: #fff; + background-color: #ff4d4f; + border-radius: 16rpx; + border: none; + box-shadow: 0 4rpx 10rpx rgba(255, 77, 79, 0.2); + transition: all 0.2s ease; +} + +.logout-btn:active { + background-color: #f5222d; + transform: scale(0.98); +} + \ No newline at end of file diff --git a/apps/hand-factory/pages/line/line.vue b/apps/hand-factory/pages/line/line.vue new file mode 100644 index 0000000..31cff59 --- /dev/null +++ b/apps/hand-factory/pages/line/line.vue @@ -0,0 +1,99 @@ + + + + +