feat: 添加产线监控页面并优化扫码页面样式

- 新增产线监控页面(line.vue)及相关组件
- 优化扫码页面(easycode.vue)的UI布局和样式
- 调整pages.json中的页面顺序和导航栏配置
- 启用并配置tabBar功能
This commit is contained in:
砂糖
2025-11-03 13:48:03 +08:00
parent 30c319694c
commit d677c293e8
4 changed files with 254 additions and 56 deletions

View File

@@ -1,12 +1,26 @@
<template>
<view>
<button v-for='item in types' @click="handleScan(item.dictValue)">
{{ item.dictLabel }}
</button>
<view class="container">
<!-- 标题区域 -->
<view class="page-title">操作类型选择</view>
<button @click='handleLogout'>
退出登录
</button>
<!-- 操作类型按钮区域 -->
<view class="btn-grid">
<button
v-for='item in types'
:key="item.dictValue"
@click="handleScan(item.dictValue)"
class="type-btn"
>
{{ item.dictLabel }}
</button>
</view>
<!-- 退出登录按钮固定在底部 -->
<view class="logout-container">
<button @click='handleLogout' class="logout-btn">
退出登录
</button>
</view>
</view>
</template>
@@ -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
})
}
}
</script>
<style>
<style scoped>
.container {
padding: 20rpx;
min-height: 100vh;
background-color: #f5f7fa;
display: flex;
flex-direction: column;
align-items: center;
}
</style>
/* 页面标题 */
.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);
}
</style>