Commit 5ef6d0e1 by liimin

refactor: 调整录单页面目录路径,同步更新路由配置

将录单页面、配套组件及样式文件从pages/common/orderEntry迁移至pages/orderEntry,更新tabbar跳转路径,修正pages.json配置并清理旧目录冗余文件。
1 parent 47379cfe
......@@ -125,8 +125,8 @@ export function navigateToTab(index: number, currentTabIndex: number): void {
return;
}
if (index == 2) {
// uni.navigateTo({ url: "/pages/common/orderEntry/index" });
switchTabPage("pages/common/orderEntry/index");
// uni.navigateTo({ url: "/pages/orderEntry/index" });
switchTabPage("pages/orderEntry/index");
return;
}
if (index == 3) {
......
......@@ -132,7 +132,7 @@
}
},
{
"path": "pages/common/orderEntry/index",
"path": "pages/orderEntry/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "录单"
......@@ -198,7 +198,7 @@
"selectedIconPath": "static/images/tabbar/home-active.png"
},
{
"pagePath": "pages/common/orderEntry/index",
"pagePath": "pages/orderEntry/index",
"text": "录单",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home-active.png"
......
// orderEntry 响应式样式配置 - 横屏时 Tab 在左、表单在右
export default {
common: {
'--order-tab-width': '100%',
'--order-form-width': '100%',
'--order-tab-height': '60px',
'--order-tab-direction': 'row',
'--order-form-item-width': '100%',
},
portrait: {
'--order-entry-direction': 'column',
'--order-form-width': '100%',
'--order-tab-icon-display':'none',
'--order-tab-padding': '4px 8px',
},
landscape: {
'--order-entry-direction': 'row',
'--order-tab-width': '15%',
'--order-form-width': '85%',
'--order-tab-height': '95%',
'--order-tab-direction': 'column',
'--order-form-item-width': '50%',
'--order-tab-icon-display':'flex',
'--order-tab-margin':'16px',
'--order-tab-border-radius': '8px',
'--order-tab-padding': '16px',
'--order-tab-box-shadow': '0 2px 8px rgba(0, 0, 0, 0.1)',
},
resolutions: {
'portrait-768x1174': {
},
}
}
<template>
<!-- <layout-root :page-vars="pageVars"> -->
<TabBarShell ref="shellRef" :active-tab-index="1" :page-vars="pageVars as UTSJSONObject">
<view class="navbar-wrapper">
<!-- <app-navbar
:fixed="false"
:placeholder="false"
title="录单"
bg-color="#fff"
:border="false"
:auto-back="false"
:safe-area-inset-top="false"
@leftClick="back"
/> -->
</view>
<view class="order-entry-container" :style="contentStyle">
<view class="tab-box">
<view
v-for="(tab, idx) in tabs"
:key="idx"
:class="['tab-item', tabActiveIndex == idx ? 'active-tab' : '']"
@click="onTabChange(idx)"
>
<un-icon
:label="tab.name"
:name="tab.iconType"
:class="['tab-icon', tabActiveIndex == idx ? 'active-icon' : '']"
></un-icon>
<text :class="tabActiveIndex == idx ? 'tab-text active' : 'tab-text'">
{{ tab.name }}
</text>
<view class="order-entry-page">
<!-- 页面头部 -->
<view class="page-header">
<view class="page-header-accent"></view>
<view class="page-header-copy">
<text class="page-header-title">录单</text>
<text class="page-header-desc">选择订单类型,快速录入</text>
</view>
</view>
<!-- 主体区:竖屏上下 / 横屏左右 -->
<view class="order-body">
<view class="tab-box">
<view
v-for="(tab, idx) in tabs"
:key="idx"
:class="['tab-item', tabActiveIndex == idx ? 'active-tab' : '']"
@click="onTabChange(idx)"
>
<view :class="['tab-icon-wrap', tabActiveIndex == idx ? 'active-icon-wrap' : '']">
<un-icon
:label="tab.name"
:name="tab.iconType"
:class="['tab-icon', tabActiveIndex == idx ? 'active-icon' : '']"
></un-icon>
</view>
<text :class="tabActiveIndex == idx ? 'tab-text active' : 'tab-text'">
{{ tab.name }}
</text>
</view>
</view>
<scroll-view class="form-scroll">
<component :is="activeEntryComponent" :customers-list="customersList"></component>
<RecentOrderEntry />
</scroll-view>
</view>
<scroll-view class="form-box">
<component :is="activeEntryComponent" :customers-list="customersList"></component>
<RecentOrderEntry />
</scroll-view>
</view>
</TabBarShell>
<!-- </layout-root> -->
</template>
<script setup lang="uts">
import TabBarShell from "@/components/TabBar/TabBarShell.uvue";
import {getCustomersListApi} from "@/api/modules/customers.uts";
import pageVars from "./styles/index.vars";
import { ref, computed, getCurrentInstance, onMounted, nextTick, onResize } from "vue";
import { calcWindowTopInsetPx } from "@/utils/safe-area.uts";
import { ref, computed, onMounted, nextTick } from "vue";
import WorkOrder from "./components/WorkOrder.uvue";
import ContractOrder from "./components/ContractOrder.uvue";
import SalesOrder from "./components/SalesOrder.uvue";
......@@ -58,29 +58,9 @@ type TabItem = {
};
const activeTab = ref(0);
const tabActiveIndex = computed((): number => activeTab.value);
const currentInstance = getCurrentInstance();
const navbarHeight = ref(0);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight);
const statusBarHeight = ref(0);
const contentStyle = computed((): string => {
return `height: ${windowHeight.value - statusBarHeight.value}px`;
// return `height: ${windowHeight.value - navbarHeight.value - statusBarHeight.value}px`;
});
const customersList = ref<UnSelectOption[]>([]);
function measureNavbarHeight(): void {
uni
.createSelectorQuery()
.in(currentInstance!.proxy)
.select(".navbar-wrapper")
.boundingClientRect()
.exec((ret) => {
if (ret.length > 0) {
navbarHeight.value = (ret[0] as NodeInfo).height!;
}
});
}
const getCustomersList = async (): Promise<void> => {
try {
const rawList = await getCustomersListApi({ storeId: 1 }) as any[];
......@@ -100,19 +80,9 @@ const getCustomersList = async (): Promise<void> => {
onMounted(() => {
nextTick(() => {
getCustomersList()
statusBarHeight.value = calcWindowTopInsetPx(uni.getWindowInfo());
measureNavbarHeight();
});
});
onResize((_res: any): void => {
const winInfo = uni.getWindowInfo();
windowHeight.value = winInfo.windowHeight;
statusBarHeight.value = calcWindowTopInsetPx(winInfo);
nextTick(() => {
measureNavbarHeight();
});
});
const tabs = ref<TabItem[]>([
{ name: "施工单", iconType: "warning-fill", componentName: WorkOrder },
{ name: "合同单", iconType: "file-text-fill", componentName: ContractOrder },
......@@ -126,9 +96,6 @@ const activeEntryComponent = computed((): any => {
let component = tabs.value[tabActiveIndex.value].componentName;
return component;
});
const back = (): void => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
......
.order-entry-container {
display: flex;
// ==========================================
// orderEntry 页面整体布局
// ==========================================
.order-entry-page {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
padding: var(--order-page-padding-y) var(--order-page-padding-x);
box-sizing: border-box;
background-color: var(--order-page-bg);
overflow: hidden;
}
// ==========================================
// 页面头部
// ==========================================
.page-header {
flex-shrink: 0;
display: flex;
flex-direction: row;
align-items: center;
padding: 18px 18px 16px;
border-radius: 20px;
background-color: #ffffff;
border: 1px solid #e2e8f0;
box-shadow: 0 4px 14px rgba(44, 102, 247, 0.06);
margin-bottom: var(--order-section-gap);
box-sizing: border-box;
position: relative;
overflow: hidden;
&::before {
content: "";
position: absolute;
top: -40px;
right: -20px;
width: 120px;
height: 120px;
border-radius: 999px;
background-color: rgba(44, 102, 247, 0.04);
}
}
.page-header-accent {
width: 4px;
height: 40px;
border-radius: 2px;
background: linear-gradient(180deg, #2c66f7 0%, #93c5fd 100%);
margin-right: 14px;
flex-shrink: 0;
}
.page-header-copy {
display: flex;
flex-direction: column;
position: relative;
z-index: 1;
}
.page-header-title {
font-size: 20px;
font-weight: 700;
color: #163152;
line-height: 26px;
}
.page-header-desc {
margin-top: 4px;
font-size: 12px;
font-weight: 400;
color: #6b7a90;
line-height: 16px;
}
// ==========================================
// 主体区:竖屏上下 / 横屏左右
// ==========================================
.order-body {
flex: 1;
min-height: 0;
display: flex;
flex-direction: var(--order-entry-direction);
.tab-box {
flex-shrink: 0;
width: var(--order-tab-width);
height: var(--order-tab-height);
background-color: #fff;
margin-right: var(--order-tab-margin-right);
margin-bottom: var(--order-tab-margin-bottom);
display: flex;
flex-direction: var(--order-tab-direction);
margin: var(--order-tab-margin);
border-radius: var(--order-tab-border-radius);
background-color: #eef4ff;
border: 1px solid #d7e7ff;
border-radius: 18px;
padding: var(--order-tab-padding);
box-sizing: border-box;
box-shadow: var(--order-tab-box-shadow);
box-shadow: 0 1px 3px rgba(44, 102, 247, 0.05);
position: relative;
.tab-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 14px;
padding: 10px 6px;
min-height: 64px;
position: relative;
z-index: 1;
box-sizing: border-box;
transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 图标容器 */
.tab-icon-wrap {
width: 40px;
height: 40px;
border-radius: 12px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-bottom: 6px;
background-color: transparent;
transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.active-icon-wrap {
background-color: rgba(44, 102, 247, 0.08);
box-shadow: 0 2px 6px rgba(44, 102, 247, 0.1);
}
.tab-text {
color: #333;
}
.active {
color: #2c66f7;
font-weight: bold;
}
.tab-icon{
display: var(--order-tab-icon-display);
font-size: 32px;
color: #333;
margin-bottom: 6px;
}
.active-icon{
color: #2c66f7;
}
.tab-icon {
display: flex;
font-size: var(--order-tab-icon-size);
color: #94a3b8;
transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.active-tab{
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
border-radius: 16px;
.active-icon {
color: #2c66f7;
}
.tab-text {
font-size: var(--order-tab-text-size);
font-weight: 500;
color: #5b6b82;
line-height: 18px;
text-align: center;
transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
font-weight 0.25s ease;
}
.tab-text.active {
color: #2c66f7;
font-weight: 700;
}
.active-tab {
background-color: #ffffff;
border: 1px solid rgba(44, 102, 247, 0.15);
}
}
.form-box {
width: var(--order-form-width);
box-sizing: border-box;
padding: 16px;
.form-scroll {
flex: 1;
min-width: 0;
min-height: 0;
padding: var(--order-form-scroll-padding);
box-sizing: border-box;
}
}
// ==========================================
// 表单卡片
// ==========================================
.order-box {
width: 100%;
border-radius: 8px;
border-radius: 16px;
background-color: #fff;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
border: 1px solid #e8ecf2;
}
.form-card{
.form-card {
width: 100%;
box-sizing: border-box;
padding: 16px 0;
padding: 20px 0 8px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
flex-direction: var(--order-entry-direction);
}
.form-item {
display: flex;
flex-direction: column;
width: var(--order-form-item-width);
margin-bottom: 16px;
padding: 0 16px;
box-sizing: border-box;
}
.form-item--last {
......@@ -82,10 +214,11 @@
}
.form-label {
font-size: 13px;
font-weight: 400;
color: #666666;
margin-bottom: 8px;
font-size: 12px;
font-weight: 600;
color: #6b7a90;
margin-bottom: 6px;
letter-spacing: 0.3px;
}
.form-picker {
......@@ -101,18 +234,20 @@
justify-content: space-between;
width: 100%;
height: 44px;
border: 1px solid #e5e6eb;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 0 12px;
box-sizing: border-box;
background-color: #ffffff;
background-color: #f8fafc;
position: relative;
}
.form-select-custom{
.form-select-custom {
width: 100%;
height: 44px;
box-sizing: border-box;
}
.form-select-text {
font-size: 14px;
font-weight: 400;
......@@ -126,23 +261,25 @@
.form-input {
width: 100%;
height: 44px;
border: 1px solid #e5e6eb;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 0 12px;
font-size: 14px;
color: #1a1a1a;
box-sizing: border-box;
background-color: #f8fafc;
}
.form-textarea {
width: 100%;
height: 80px;
border: 1px solid #e5e6eb;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 10px 12px;
font-size: 14px;
color: #1a1a1a;
box-sizing: border-box;
background-color: #f8fafc;
}
.form-placeholder {
......@@ -150,16 +287,18 @@
font-size: 14px;
}
// ==========================================
// 商品/服务列表
// ==========================================
/* 商品/服务列表 */
.product-list {
width: 100%;
height: 160px;
border: 1px solid #e5e6eb;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 8px 0;
box-sizing: border-box;
background-color: #ffffff;
background-color: #f8fafc;
}
.product-item {
......@@ -188,18 +327,21 @@
color: #1a1a1a;
}
/* 金额输入 */
// ==========================================
// 金额输入
// ==========================================
.amount-input-wrap {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height: 44px;
border: 1px solid #e5e6eb;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 0 12px;
box-sizing: border-box;
background-color: #ffffff;
background-color: #f8fafc;
}
.amount-input-wrap .amount-symbol {
......@@ -218,7 +360,10 @@
padding: 0;
}
/* 销售单商品卡片 */
// ==========================================
// 销售单商品卡片
// ==========================================
.sales-product-list {
display: flex;
flex-direction: column;
......@@ -232,7 +377,7 @@
align-items: center;
width: 100%;
background-color: #ffffff;
border: 1px solid #e5e6eb;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 12px;
box-sizing: border-box;
......@@ -248,7 +393,7 @@
.sales-product-card .sales-product-icon {
width: 44px;
height: 44px;
background-color: #f5f6f7;
background-color: #f8fafc;
border-radius: 10px;
display: flex;
flex-direction: row;
......@@ -332,59 +477,50 @@
color: #ef4444;
}
// ==========================================
// 提交按钮
// ==========================================
/* 提交按钮 */
.submit-wrap {
width: 100%;
margin-top: 16px;
padding: 0 16px 8px;
box-sizing: border-box;
}
.submit-btn {
width: 75%;
height: 48px;
width: 100%;
height: 50px;
background-color: #2c66f7;
border-radius: 24px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin: 0 auto;
}
.submit-btn .check-icon-box {
width: 18px;
height: 18px;
background-color: #ffffff;
border-radius: 4px;
border-radius: 14px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-right: 8px;
}
.submit-btn .check-icon-text {
font-size: 13px;
font-weight: 700;
color: #22c55e;
box-shadow: 0 4px 12px rgba(44, 102, 247, 0.25);
transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.submit-btn-text {
font-size: 16px;
font-weight: 700;
color: #ffffff;
letter-spacing: 0.5px;
}
// ==========================================
// 最近录单
// ==========================================
/**最近录单*/
.recent-section {
width: 100%;
background-color: #ffffff;
border-radius: 12px;
border-radius: 16px;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
border: 1px solid #e8ecf2;
}
.recent-header {
......@@ -522,4 +658,4 @@
.status-text.status-done {
color: #22c55e;
}
\ No newline at end of file
}
// orderEntry 响应式样式配置 — 横屏时 Tab 在左、表单在右
export default {
common: {
'--order-tab-width': '100%',
'--order-form-item-width': '100%',
'--order-tab-height': 'auto',
'--order-tab-direction': 'row',
'--order-page-padding-x': '14px',
'--order-page-padding-y': '14px',
'--order-section-gap': '14px',
'--order-tab-padding': '8px',
'--order-tab-icon-display': 'flex',
'--order-page-bg': '#f3f6fb',
'--order-tab-icon-size': '20px',
'--order-tab-text-size': '14px',
'--order-tab-margin-right': '0',
'--order-tab-margin-bottom': '14px',
'--order-form-scroll-padding': '0 0 0 0',
},
portrait: {
'--order-entry-direction': 'column',
'--order-tab-margin-right': '0',
'--order-tab-margin-bottom': '14px',
'--order-form-scroll-padding': '0 0 0 0',
},
landscape: {
'--order-entry-direction': 'row',
'--order-tab-width': '13%',
'--order-tab-height': '95%',
'--order-tab-direction': 'column',
'--order-form-item-width': '33.33%',
'--order-tab-padding': '8px',
'--order-page-padding-x': '16px',
'--order-page-padding-y': '14px',
'--order-section-gap': '12px',
'--order-tab-margin-right': '12px',
'--order-tab-margin-bottom': '0',
'--order-form-scroll-padding': '0 0 0 0',
},
resolutions: {
'portrait-393x816': {
'--order-page-padding-x': '12px',
'--order-page-padding-y': '10px',
'--order-section-gap': '12px',
'--order-tab-icon-size': '18px',
'--order-tab-text-size': '13px',
'--order-tab-padding': '6px',
'--order-tab-margin-bottom': '12px',
},
'portrait-414x736': {
'--order-page-padding-x': '12px',
'--order-page-padding-y': '10px',
'--order-tab-padding': '6px',
},
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!