style: 上下模页面样式统一与优化

master
zhongwenkai 1 week ago
parent 96d09911c2
commit e1d1fb3e52

@ -1,10 +1,16 @@
<template> <template>
<view class="page-container"> <view class="page-container">
<NavBar :title="t('moldOperate.tabDown')"> <!-- 顶部导航栏 -->
<template #right> <view class="custom-nav">
<image class="nav-right-icon" src="/static/logo/history.png" mode="aspectFit" @click="goToHistory" /> <view class="nav-back" @click="goBack">
</template> <u-icon name="arrow-left" color="#ffffff" size="20"></u-icon>
</NavBar> </view>
<text class="nav-title">{{ t('moldOperate.tabDown') }}</text>
<view class="nav-right-btn" @click="goToHistory">
<uni-icons type="clock" size="22" color="#1f7cff"></uni-icons>
<text class="nav-right-text">{{ t('moldPressureNet.history') }}</text>
</view>
</view>
<!-- 操作按钮区 --> <!-- 操作按钮区 -->
<view class="action-row"> <view class="action-row">
@ -102,8 +108,8 @@
</view> </view>
<!-- 未选设备 --> <!-- 未选设备 -->
<view v-else class="empty-mold-hint" @click="handleSelectDeviceFirst"> <view v-else class="empty-mold-hint">
<text class="empty-mold-text">+ {{ t('moldOperate.clickSelectDeviceFirst') }}</text> <text class="empty-mold-text empty-gray">{{ t('moldOperate.clickSelectDeviceFirst') }}</text>
</view> </view>
</view> </view>
@ -142,7 +148,6 @@
import { computed, reactive, ref } from 'vue' import { computed, reactive, ref } from 'vue'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import NavBar from '@/components/common/NavBar.vue'
import { getLowerMoldList, getDeviceLedgerList, createMoldOperate } from '@/api/mes/moldoperate' import { getLowerMoldList, getDeviceLedgerList, createMoldOperate } from '@/api/mes/moldoperate'
import { getDeviceLineTree } from '@/api/mes/deviceLine' import { getDeviceLineTree } from '@/api/mes/deviceLine'
@ -437,14 +442,14 @@ function confirmLowerMoldSelection() {
function closeLowerMoldPicker() { lowerMoldPickerRef.value?.close() } function closeLowerMoldPicker() { lowerMoldPickerRef.value?.close() }
function handleSelectDeviceFirst() {
openDevicePicker()
}
function goToHistory() { function goToHistory() {
uni.navigateTo({ url: '/pages_function/pages/moldoperate/history?type=down' }) uni.navigateTo({ url: '/pages_function/pages/moldoperate/history?type=down' })
} }
function goBack() {
uni.navigateBack({ fail: () => uni.switchTab({ url: '/pages/index/index' }) })
}
// ---- ---- // ---- ----
function validForm() { function validForm() {
if (!selectedDevice.value?.id) { if (!selectedDevice.value?.id) {
@ -503,9 +508,53 @@ onShow(async () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.nav-right-icon { /* ====== 自定义导航栏 ====== */
width: 40rpx; .custom-nav {
height: 40rpx; position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
padding: 0 24rpx;
background: #22486e;
color: #fff;
.nav-back {
position: absolute;
left: 24rpx;
top: 50%;
transform: translateY(-50%);
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
text-align: center;
}
.nav-right-btn {
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
gap: 6rpx;
padding: 8rpx 18rpx;
background: #ffffff;
border-radius: 999rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
}
.nav-right-text {
font-size: 24rpx;
color: #374151;
font-weight: 500;
}
} }
.page-container { .page-container {
@ -529,7 +578,7 @@ onShow(async () => {
gap: 12rpx; gap: 12rpx;
height: 96rpx; height: 96rpx;
border-radius: 12rpx; border-radius: 12rpx;
background: #2563eb; background: #1f4b79;
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
@ -571,7 +620,7 @@ onShow(async () => {
width: 6rpx; width: 6rpx;
height: 32rpx; height: 32rpx;
border-radius: 3rpx; border-radius: 3rpx;
background: #2563eb; background: #1f4b79;
} }
.section-title { .section-title {
@ -697,6 +746,10 @@ onShow(async () => {
color: #2563eb; color: #2563eb;
} }
.empty-gray {
color: #9ca3af;
}
/* ====== 底部操作栏 ====== */ /* ====== 底部操作栏 ====== */
.bottom-actions { .bottom-actions {
position: fixed; position: fixed;
@ -720,7 +773,7 @@ onShow(async () => {
} }
.confirm-btn { .confirm-btn {
background: #2563eb; background: #1f4b79;
color: #fff; color: #fff;
} }

@ -3,10 +3,9 @@
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<view class="custom-nav"> <view class="custom-nav">
<view class="nav-back" @click="goBack"> <view class="nav-back" @click="goBack">
<text class="back-icon">&lt;</text> <u-icon name="arrow-left" color="#ffffff" size="20"></u-icon>
</view> </view>
<text class="nav-title">{{ pageType ? (pageType === 'up' ? t('moldOperate.tabUp') : t('moldOperate.tabDown')) + t('moldOperate.historySuffix') : t('moldOperate.historyTitle') }}</text> <text class="nav-title">{{ pageType ? (pageType === 'up' ? t('moldOperate.tabUp') : t('moldOperate.tabDown')) + t('moldOperate.historySuffix') : t('moldOperate.historyTitle') }}</text>
<view class="nav-placeholder"></view>
</view> </view>
<!-- Tab 切换路由指定 type 时隐藏 --> <!-- Tab 切换路由指定 type 时隐藏 -->
@ -108,7 +107,7 @@
<!-- 右下角删除 --> <!-- 右下角删除 -->
<view class="card-footer"> <view class="card-footer">
<view class="delete-wrap" @click="handleDelete(item)"> <view class="delete-wrap" @click="handleDelete(item)">
<text class="delete-icon">&#128465;</text> <u-icon name="trash" size="22" color="#dc2626"></u-icon>
</view> </view>
</view> </view>
</view> </view>
@ -427,39 +426,35 @@ onShow(async () => {
/* ====== 自定义导航栏 ====== */ /* ====== 自定义导航栏 ====== */
.custom-nav { .custom-nav {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: center;
height: 88rpx; height: 88rpx;
padding: 0 24rpx; padding: 0 24rpx;
background: #1a365d; background: #22486e;
color: #fff; color: #fff;
.nav-back { .nav-back {
width: 60rpx; position: absolute;
left: 24rpx;
top: 50%;
transform: translateY(-50%);
height: 60rpx; height: 60rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.back-icon {
font-size: 36rpx;
font-weight: bold;
}
.nav-title { .nav-title {
font-size: 34rpx; font-size: 34rpx;
font-weight: 600; font-weight: 600;
text-align: center;
max-width: 60%; max-width: 60%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.nav-placeholder {
width: 60rpx;
}
} }
/* ====== Tab 切换 ====== */ /* ====== Tab 切换 ====== */
@ -673,11 +668,6 @@ onShow(async () => {
.delete-wrap { .delete-wrap {
padding: 6rpx; padding: 6rpx;
.delete-icon {
font-size: 28rpx;
color: #dc2626;
}
} }
} }
} }

@ -3,10 +3,13 @@
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<view class="custom-nav"> <view class="custom-nav">
<view class="nav-back" @click="goBack"> <view class="nav-back" @click="goBack">
<text class="back-icon">&lt;</text> <u-icon name="arrow-left" color="#ffffff" size="20"></u-icon>
</view> </view>
<text class="nav-title">{{ t('moldOperate.tabUp') }}</text> <text class="nav-title">{{ t('moldOperate.tabUp') }}</text>
<image class="nav-right-icon" src="/static/logo/history.png" mode="aspectFit" @click="goToHistory" /> <view class="nav-right-btn" @click="goToHistory">
<uni-icons type="clock" size="22" color="#1f7cff"></uni-icons>
<text class="nav-right-text">{{ t('moldPressureNet.history') }}</text>
</view>
</view> </view>
<!-- ========== 上模 ========== --> <!-- ========== 上模 ========== -->
@ -106,8 +109,8 @@
<!-- 底部操作栏 - 上模 --> <!-- 底部操作栏 - 上模 -->
<view class="bottom-actions"> <view class="bottom-actions">
<view class="bottom-btn confirm-btn" @click="handleConfirmMount">{{ t('moldOperate.confirmMount') }}</view>
<view class="bottom-btn cancel-btn" @click="handleCancel">{{ t('functionCommon.cancel') }}</view> <view class="bottom-btn cancel-btn" @click="handleCancel">{{ t('functionCommon.cancel') }}</view>
<view class="bottom-btn confirm-btn" @click="handleConfirmMount">{{ t('moldOperate.confirmMount') }}</view>
</view> </view>
</view> </view>
@ -380,35 +383,50 @@ onShow(async () => {
/* ====== 自定义导航栏 ====== */ /* ====== 自定义导航栏 ====== */
.custom-nav { .custom-nav {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: center;
height: 88rpx; height: 88rpx;
padding: 0 24rpx; padding: 0 24rpx;
background: #1a365d; background: #22486e;
color: #fff; color: #fff;
.nav-back { .nav-back {
width: 60rpx; position: absolute;
left: 24rpx;
top: 50%;
transform: translateY(-50%);
height: 60rpx; height: 60rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.back-icon {
font-size: 36rpx;
font-weight: bold;
}
.nav-title { .nav-title {
font-size: 34rpx; font-size: 34rpx;
font-weight: 600; font-weight: 600;
text-align: center;
}
.nav-right-btn {
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
gap: 6rpx;
padding: 8rpx 18rpx;
background: #ffffff;
border-radius: 999rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
} }
.nav-right-icon { .nav-right-text {
width: 40rpx; font-size: 24rpx;
height: 40rpx; color: #374151;
font-weight: 500;
} }
} }
@ -427,7 +445,7 @@ onShow(async () => {
gap: 12rpx; gap: 12rpx;
height: 96rpx; height: 96rpx;
border-radius: 12rpx; border-radius: 12rpx;
background: #2563eb; background: #1f4b79;
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
@ -600,10 +618,10 @@ onShow(async () => {
right: 0; right: 0;
bottom: 0; bottom: 0;
display: flex; display: flex;
gap: 20rpx; gap: 18rpx;
padding: 16rpx 24rpx calc(16rpx + env(safe-area-inset-bottom)); padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom));
background: #fff; background: #ffffff;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06); box-shadow: 0 -8rpx 24rpx rgba(15, 23, 42, 0.06);
z-index: 99; z-index: 99;
&.single-btn { &.single-btn {
@ -612,25 +630,23 @@ onShow(async () => {
} }
.bottom-btn { .bottom-btn {
height: 88rpx; flex: 1;
line-height: 88rpx; height: 84rpx;
line-height: 84rpx;
text-align: center; text-align: center;
border-radius: 12rpx; border-radius: 16rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
} }
.confirm-btn { .confirm-btn {
flex: 1; background: #1f4b79;
background: #2563eb; color: #ffffff;
color: #fff;
} }
.cancel-btn { .cancel-btn {
flex: 1; background: #eef2f7;
background: #fff; color: #475569;
color: #666;
border: 1rpx solid #ddd;
} }

Loading…
Cancel
Save