Commit 958f19c0 by chenwq

Merge branch 'v1.0.0' of http://192.168.3.233:8090/app/sales-assist-mobile into v1.0.0

2 parents 5827fc0d 890b0fbb
......@@ -120,7 +120,7 @@ export function navigateToTab(index: number, currentTabIndex: number): void {
return;
}
if (index == 3) {
switchTabPage("pages/common/orderEntry/index");
uni.navigateTo({ url: "/pages/common/orderEntry/index" });
return;
}
if (index == 4) {
......
......@@ -174,12 +174,6 @@
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home-active.png"
},
{
"pagePath": "pages/common/orderEntry/index",
"text": "录单",
"iconPath": "static/images/tabbar/study.png",
"selectedIconPath": "static/images/tabbar/study-active.png"
}
]
},
"uniIdRouter": {}
......
<template>
<layout-root :page-vars="pageVars">
<view class="order-entry-container">
<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"
@click="onTabChange(idx)"
>
<text :class="tabActiveIndex == idx ? 'tab-text active' : 'tab-text'">{{ tab.name }}</text>
<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>
</view>
<scroll-view class="form-box">
......@@ -21,7 +36,8 @@
<script setup lang="uts">
import pageVars from "./styles/index.vars";
import { ref, computed } from "vue";
import { ref, computed, getCurrentInstance, onMounted, nextTick, onResize } from "vue";
import { calcWindowTopInsetPx } from "@/utils/safe-area.uts";
import WorkOrder from "./components/WorkOrder.uvue";
import ContractOrder from "./components/ContractOrder.uvue";
import SalesOrder from "./components/SalesOrder.uvue";
......@@ -33,10 +49,41 @@ 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 - navbarHeight.value - statusBarHeight.value}px`;
});
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!;
}
});
}
onMounted(() => {
statusBarHeight.value = calcWindowTopInsetPx(uni.getWindowInfo());
nextTick(() => {
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: "gear", componentName: WorkOrder },
{ name: "合同单", iconType: "compose", componentName: ContractOrder },
{ name: "销售单", iconType: "medal", componentName: SalesOrder }
{ name: "施工单", iconType: "warning-fill", componentName: WorkOrder },
{ name: "合同单", iconType: "lock-fill", componentName: ContractOrder },
{ name: "销售单", iconType: "rmb-circle-fill", componentName: SalesOrder }
]);
function onTabChange(index: number): void {
if (activeTab.value == index) return;
......@@ -46,6 +93,9 @@ const activeEntryComponent = computed((): any => {
let component = tabs.value[tabActiveIndex.value].componentName;
return component;
});
const back = (): void => {
uni.navigateBack();
};
</script>
<style scoped lang="scss">
......
......@@ -10,7 +10,11 @@
background-color: #fff;
display: flex;
flex-direction: var(--order-tab-direction);
margin: var(--order-tab-margin);
border-radius: var(--order-tab-border-radius);
padding: var(--order-tab-padding);
box-sizing: border-box;
box-shadow: var(--order-tab-box-shadow);
.tab-item {
flex: 1;
display: flex;
......@@ -26,6 +30,19 @@
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;
}
}
.active-tab{
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
border-radius: 16px;
}
}
......@@ -42,6 +59,7 @@
width: 100%;
border-radius: 8px;
background-color: #fff;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
}
.form-card{
width: 100%;
......@@ -317,7 +335,7 @@
}
.submit-btn {
width: 100%;
width: 75%;
height: 48px;
background-color: #2c66f7;
border-radius: 24px;
......@@ -325,6 +343,7 @@
flex-direction: row;
align-items: center;
justify-content: center;
margin: 0 auto;
}
.submit-btn .check-icon-box {
......@@ -360,6 +379,7 @@
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
}
.recent-header {
......
......@@ -6,20 +6,28 @@ export default {
'--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': '100%',
'--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: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!